@dynamic-labs/sdk-react-core 0.19.3 → 0.19.5
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/CHANGELOG.md +30 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +10 -10
- package/src/index.cjs +8 -0
- package/src/index.d.ts +1 -1
- package/src/index.js +5 -0
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.cjs +2 -0
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.js +2 -0
- package/src/lib/components/AnimatePresence/AnimatePresence.cjs +2 -0
- package/src/lib/components/AnimatePresence/AnimatePresence.js +2 -0
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.cjs +2 -0
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.js +2 -0
- package/src/lib/components/Button/Button.cjs +4 -2
- package/src/lib/components/Button/Button.d.ts +1 -0
- package/src/lib/components/Button/Button.js +4 -2
- package/src/lib/components/Divider/Divider.cjs +2 -0
- package/src/lib/components/Divider/Divider.js +2 -0
- package/src/lib/components/MenuList/Dropdown/Dropdown.cjs +2 -0
- package/src/lib/components/MenuList/Dropdown/Dropdown.js +2 -0
- package/src/lib/components/Modal/Modal.cjs +2 -0
- package/src/lib/components/Modal/Modal.js +2 -0
- package/src/lib/components/NeedHelpSection/NeedHelpSection.cjs +85 -3
- package/src/lib/components/NeedHelpSection/NeedHelpSection.js +86 -4
- package/src/lib/components/NetworkPicker/NetworkPicker.cjs +2 -0
- package/src/lib/components/NetworkPicker/NetworkPicker.js +2 -0
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.cjs +2 -0
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.js +2 -0
- package/src/lib/components/NetworkPicker/components/Network/Network.cjs +2 -0
- package/src/lib/components/NetworkPicker/components/Network/Network.js +2 -0
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.cjs +2 -0
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.js +2 -0
- package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +2 -0
- package/src/lib/components/OTPVerificationView/OTPVerificationView.js +2 -0
- package/src/lib/components/OverlayCard/OverlayCard.cjs +2 -0
- package/src/lib/components/OverlayCard/OverlayCard.js +2 -0
- package/src/lib/components/Portal/Portal.cjs +2 -0
- package/src/lib/components/Portal/Portal.js +2 -0
- package/src/lib/components/SocialSignIn/SocialSignIn.cjs +2 -0
- package/src/lib/components/SocialSignIn/SocialSignIn.js +2 -0
- package/src/lib/components/SyncPasskeyFlow/SyncPasskeyFlow.cjs +18 -5
- package/src/lib/components/SyncPasskeyFlow/SyncPasskeyFlow.js +18 -5
- package/src/lib/components/Textarea/Textarea.d.ts +2 -0
- package/src/lib/components/Textarea/Textarea.types.d.ts +14 -0
- package/src/lib/components/Textarea/index.d.ts +1 -0
- package/src/lib/components/Tooltip/Tooltip.cjs +2 -0
- package/src/lib/components/Tooltip/Tooltip.js +2 -0
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.cjs +2 -0
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.js +2 -0
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.cjs +2 -0
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.js +2 -0
- package/src/lib/components/UserAddress/UserAddress.cjs +2 -0
- package/src/lib/components/UserAddress/UserAddress.js +2 -0
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.cjs +2 -0
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.js +2 -0
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.cjs +2 -0
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.js +2 -0
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +1 -0
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +1 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +15 -14
- package/src/lib/context/DynamicContext/DynamicContext.js +16 -15
- package/src/lib/context/DynamicContext/internalEvents/internalEvents.d.ts +2 -0
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.cjs +2 -0
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.js +2 -0
- package/src/lib/context/QrCodeContext/QrCodeContext.cjs +2 -0
- package/src/lib/context/QrCodeContext/QrCodeContext.js +2 -0
- package/src/lib/context/SendBalanceContext/SendBalanceContext.cjs +2 -0
- package/src/lib/context/SendBalanceContext/SendBalanceContext.js +2 -0
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +2 -0
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +2 -0
- package/src/lib/context/UserFieldEditorContext/UserFieldEditorContext.cjs +2 -0
- package/src/lib/context/UserFieldEditorContext/UserFieldEditorContext.js +2 -0
- package/src/lib/context/ViewContext/ViewContext.d.ts +1 -1
- package/src/lib/data/api.cjs +37 -0
- package/src/lib/data/api.d.ts +20 -0
- package/src/lib/data/api.js +36 -2
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.cjs +2 -0
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.js +2 -0
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +11 -11
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +12 -12
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpHeader/HelpHeader.cjs +2 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpHeader/HelpHeader.js +2 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/PasskeyInfoHelper/PasskeyInfoHelper.cjs +2 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/PasskeyInfoHelper/PasskeyInfoHelper.js +2 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/Item/Item.cjs +2 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/Item/Item.js +2 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.cjs +2 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.js +2 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletListHelpContent.cjs +2 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletListHelpContent.js +2 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletMoreInfoContent/WalletMoreInfoContent.cjs +2 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletMoreInfoContent/WalletMoreInfoContent.js +2 -0
- package/src/lib/layout/DynamicAuthLayout/ToSFooter/ToSFooter.cjs +2 -0
- package/src/lib/layout/DynamicAuthLayout/ToSFooter/ToSFooter.js +2 -0
- package/src/lib/layout/DynamicAuthLayout/WalletProgressStepper/WalletProgressStepper.cjs +2 -0
- package/src/lib/layout/DynamicAuthLayout/WalletProgressStepper/WalletProgressStepper.js +2 -0
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.cjs +7 -1
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.js +7 -1
- package/src/lib/layouts/BridgeNextWalletToConnectLayout/BridgeNextWalletToConnectLayout.cjs +2 -0
- package/src/lib/layouts/BridgeNextWalletToConnectLayout/BridgeNextWalletToConnectLayout.js +2 -0
- package/src/lib/layouts/BridgeWelcomeLayout/BridgeWelcomeLayout.cjs +2 -0
- package/src/lib/layouts/BridgeWelcomeLayout/BridgeWelcomeLayout.js +2 -0
- package/src/lib/layouts/ConnectedWalletsListLayout/ConnectedWalletsListLayout.cjs +2 -0
- package/src/lib/layouts/ConnectedWalletsListLayout/ConnectedWalletsListLayout.js +2 -0
- package/src/lib/locale/en/translation.cjs +127 -5
- package/src/lib/locale/en/translation.d.ts +126 -4
- package/src/lib/locale/en/translation.js +127 -5
- package/src/lib/main.global.cjs +1 -1
- package/src/lib/main.global.js +1 -1
- package/src/lib/modals/DynamicAuthModal/DynamicAuthModal.cjs +2 -0
- package/src/lib/modals/DynamicAuthModal/DynamicAuthModal.js +2 -0
- package/src/lib/modals/SendBalanceModal/SendBalanceModal.cjs +2 -0
- package/src/lib/modals/SendBalanceModal/SendBalanceModal.js +2 -0
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +2 -0
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +2 -0
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.types.d.ts +2 -7
- package/src/lib/modals/SignMessageConfirmationModal/getProperErrorMessage.cjs +17 -8
- package/src/lib/modals/SignMessageConfirmationModal/getProperErrorMessage.d.ts +1 -1
- package/src/lib/modals/SignMessageConfirmationModal/getProperErrorMessage.js +17 -8
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +5 -2
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +5 -2
- package/src/lib/modals/UserFieldEditorModal/UserFieldEditorModal.cjs +2 -0
- package/src/lib/modals/UserFieldEditorModal/UserFieldEditorModal.js +2 -0
- package/src/lib/shared/assets/circle-locker.cjs +53 -0
- package/src/lib/shared/assets/circle-locker.js +29 -0
- package/src/lib/shared/assets/index.d.ts +2 -0
- package/src/lib/shared/assets/turnkey.cjs +79 -0
- package/src/lib/shared/assets/turnkey.js +55 -0
- package/src/lib/shared/utils/functions/detectBrowser/detectBrowser.cjs +5 -5
- package/src/lib/shared/utils/functions/detectBrowser/detectBrowser.d.ts +1 -1
- package/src/lib/shared/utils/functions/detectBrowser/detectBrowser.js +5 -5
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/index.d.ts +1 -0
- package/src/lib/utils/functions/removeElementById/index.d.ts +1 -0
- package/src/lib/utils/functions/removeElementById/removeElementById.cjs +16 -0
- package/src/lib/utils/functions/removeElementById/removeElementById.d.ts +1 -0
- package/src/lib/utils/functions/removeElementById/removeElementById.js +12 -0
- package/src/lib/utils/hooks/index.d.ts +1 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +5 -2
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +5 -2
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.cjs +9 -0
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.js +9 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +35 -18
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +35 -18
- package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.cjs +8 -1
- package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.js +9 -2
- package/src/lib/utils/hooks/useIsFirstRender/useIsFirstRender.cjs +6 -4
- package/src/lib/utils/hooks/useIsFirstRender/useIsFirstRender.js +7 -5
- package/src/lib/utils/hooks/usePasskeyRecovery/index.d.ts +1 -0
- package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.cjs +67 -0
- package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.d.ts +4 -0
- package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.js +63 -0
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +8 -0
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +9 -1
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +2 -0
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +2 -0
- package/src/lib/views/AccountExistsView/AccountExistsView.cjs +2 -0
- package/src/lib/views/AccountExistsView/AccountExistsView.js +2 -0
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.cjs +2 -0
- package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.js +2 -0
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +2 -0
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +2 -0
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.cjs +2 -0
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.js +2 -0
- package/src/lib/views/CollectUserDataView/UserDataFields/index.cjs +2 -0
- package/src/lib/views/CollectUserDataView/UserDataFields/index.js +2 -0
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.cjs +2 -0
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.js +2 -0
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +2 -0
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +2 -0
- package/src/lib/views/EmailUpdate/EmailUpdate.cjs +2 -0
- package/src/lib/views/EmailUpdate/EmailUpdate.js +2 -0
- package/src/lib/views/EmailVerification/EmailVerification.cjs +2 -0
- package/src/lib/views/EmailVerification/EmailVerification.js +2 -0
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +2 -0
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +2 -0
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.cjs +2 -0
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.js +2 -0
- package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.cjs +2 -0
- package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.js +2 -0
- package/src/lib/views/LoginView/sections/SocialSignInSection/MagicSocialSignIn/MagicSocialSignIn.cjs +2 -0
- package/src/lib/views/LoginView/sections/SocialSignInSection/MagicSocialSignIn/MagicSocialSignIn.js +2 -0
- package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.cjs +2 -5
- package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.js +2 -5
- package/src/lib/views/LoginView/sections/WalletSignInSection/ListItemButton/ListItemButton.cjs +2 -0
- package/src/lib/views/LoginView/sections/WalletSignInSection/ListItemButton/ListItemButton.js +2 -0
- package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSignInSection.cjs +2 -0
- package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSignInSection.js +2 -0
- package/src/lib/views/LoginView/useLoginView.cjs +101 -84
- package/src/lib/views/LoginView/useLoginView.js +102 -85
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.cjs +2 -0
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.js +2 -0
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +2 -0
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +2 -0
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +2 -0
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +2 -0
- package/src/lib/views/NoAccess/NoAccess.cjs +2 -0
- package/src/lib/views/NoAccess/NoAccess.js +2 -0
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.cjs +2 -0
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.js +2 -0
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.cjs +2 -0
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.js +2 -0
- package/src/lib/views/Passkey/PasskeyDeviceIcon/PasskeyDeviceIcon.cjs +90 -0
- package/src/lib/views/Passkey/PasskeyDeviceIcon/PasskeyDeviceIcon.d.ts +2 -0
- package/src/lib/views/Passkey/PasskeyDeviceIcon/PasskeyDeviceIcon.js +86 -0
- package/src/lib/views/Passkey/PasskeyDeviceIcon/index.d.ts +1 -0
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.cjs +133 -0
- package/src/lib/views/{PasskeyIntroView → Passkey/PasskeyIntroView}/PasskeyIntroView.d.ts +1 -1
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.js +129 -0
- package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.cjs +136 -0
- package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.d.ts +2 -0
- package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/PasskeyBundleRecovery.js +132 -0
- package/src/lib/views/Passkey/PasskeyRecovery/BundleValidation/index.d.ts +1 -0
- package/src/lib/views/Passkey/PasskeyRecovery/CompleteRecovery/PasskeyCompleteRecovery.cjs +108 -0
- package/src/lib/views/Passkey/PasskeyRecovery/CompleteRecovery/PasskeyCompleteRecovery.d.ts +2 -0
- package/src/lib/views/Passkey/PasskeyRecovery/CompleteRecovery/PasskeyCompleteRecovery.js +104 -0
- package/src/lib/views/Passkey/PasskeyRecovery/CompleteRecovery/index.d.ts +1 -0
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.cjs +115 -0
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.d.ts +2 -0
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.js +111 -0
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/index.d.ts +1 -0
- package/src/lib/views/Passkey/PasskeyRecovery/constants.cjs +9 -0
- package/src/lib/views/Passkey/PasskeyRecovery/constants.d.ts +2 -0
- package/src/lib/views/Passkey/PasskeyRecovery/constants.js +4 -0
- package/src/lib/views/Passkey/PasskeyRecovery/index.d.ts +3 -0
- package/src/lib/views/Passkey/index.d.ts +2 -0
- package/src/lib/views/Passkey/passkey.types.d.ts +8 -0
- package/src/lib/views/Passkey/utils/passkeyRecovery/index.d.ts +1 -0
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.cjs +141 -0
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.d.ts +26 -0
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.js +134 -0
- package/src/lib/views/PendingConnectView/PendingConnectView.cjs +2 -0
- package/src/lib/views/PendingConnectView/PendingConnectView.js +2 -0
- package/src/lib/views/PendingSignatureView/PendingSignatureView.cjs +2 -0
- package/src/lib/views/PendingSignatureView/PendingSignatureView.js +2 -0
- package/src/lib/views/QrCodeView/QRCode.cjs +2 -0
- package/src/lib/views/QrCodeView/QRCode.js +2 -0
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.cjs +2 -0
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.js +2 -0
- package/src/lib/views/QrCodeView/QrCodeView.cjs +2 -0
- package/src/lib/views/QrCodeView/QrCodeView.js +2 -0
- package/src/lib/views/SendBalanceView/SendBalanceView.cjs +2 -0
- package/src/lib/views/SendBalanceView/SendBalanceView.js +2 -0
- package/src/lib/views/SendBalanceView/components/TransactionStage/TransactionStage.cjs +2 -0
- package/src/lib/views/SendBalanceView/components/TransactionStage/TransactionStage.js +2 -0
- package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +2 -0
- package/src/lib/views/SocialRedirectView/SocialRedirectView.js +2 -0
- package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.cjs +2 -0
- package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.js +2 -0
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +2 -0
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +2 -0
- package/src/lib/views/TransactionConfirmationView/hooks/useTransactionGas/useTransactionGas.cjs +2 -0
- package/src/lib/views/TransactionConfirmationView/hooks/useTransactionGas/useTransactionGas.js +2 -0
- package/src/lib/views/UserFieldEditorView/UserFieldEditorView.cjs +2 -0
- package/src/lib/views/UserFieldEditorView/UserFieldEditorView.js +2 -0
- package/src/lib/views/WalletCannotBeTransferredView/WalletCannotBeTransferredView.cjs +2 -0
- package/src/lib/views/WalletCannotBeTransferredView/WalletCannotBeTransferredView.js +2 -0
- package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.cjs +2 -0
- package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.js +2 -0
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +2 -0
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +2 -0
- package/src/lib/views/WalletLockedView/WalletLockedView.cjs +2 -0
- package/src/lib/views/WalletLockedView/WalletLockedView.js +2 -0
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.cjs +2 -0
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.js +2 -0
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +2 -0
- package/src/lib/views/WalletUsedView/WalletUsedView.js +2 -0
- package/src/lib/views/viewToComponentMap.cjs +7 -1
- package/src/lib/views/viewToComponentMap.js +7 -1
- package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.cjs +2 -0
- package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.js +2 -0
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeUserProfile/DynamicBridgeUserProfile.cjs +2 -0
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeUserProfile/DynamicBridgeUserProfile.js +2 -0
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCard/DynamicBridgeWalletCard.cjs +2 -0
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCard/DynamicBridgeWalletCard.js +2 -0
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.cjs +2 -0
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.js +2 -0
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWidgetEmptyCard/DynamicBridgeWidgetEmptyCard.cjs +2 -0
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWidgetEmptyCard/DynamicBridgeWidgetEmptyCard.js +2 -0
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.cjs +2 -0
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.js +2 -0
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedAuthFlow/DynamicEmbeddedAuthFlow.cjs +4 -1
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedAuthFlow/DynamicEmbeddedAuthFlow.d.ts +1 -1
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedAuthFlow/DynamicEmbeddedAuthFlow.js +4 -1
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedUserProfile/DynamicEmbeddedUserProfile.cjs +2 -1
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedUserProfile/DynamicEmbeddedUserProfile.d.ts +1 -1
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedUserProfile/DynamicEmbeddedUserProfile.js +2 -1
- package/src/lib/widgets/DynamicWidget/DynamicWidget.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/DynamicWidget.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +11 -2
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +11 -2
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/Balance/Balance.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/DynamicWidgetVariants.cjs +10 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/DynamicWidgetVariants.js +10 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/DynamicWidgetViews.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/DynamicWidgetViews.d.ts +2 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/DynamicWidgetViews.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.js +2 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.d.ts +2 -13
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +2 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.cjs +9 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.d.ts +17 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.js +4 -0
- package/src/lib/widgets/DynamicWidget/helpers/getPasskeyProviderFromUserAgent.cjs +33 -0
- package/src/lib/widgets/DynamicWidget/helpers/getPasskeyProviderFromUserAgent.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/helpers/getPasskeyProviderFromUserAgent.js +29 -0
- package/src/lib/widgets/DynamicWidget/helpers/getTimeSince.cjs +64 -0
- package/src/lib/widgets/DynamicWidget/helpers/getTimeSince.d.ts +4 -0
- package/src/lib/widgets/DynamicWidget/helpers/getTimeSince.js +60 -0
- package/src/lib/widgets/DynamicWidget/helpers/helpers.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/helpers/helpers.d.ts +2 -1
- package/src/lib/widgets/DynamicWidget/helpers/helpers.js +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.js +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.js +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.js +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.js +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.js +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.js +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.js +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.js +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.js +2 -0
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.js +2 -0
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/ManagePasskeysWidgetView.cjs +96 -0
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/ManagePasskeysWidgetView.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/ManagePasskeysWidgetView.js +92 -0
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs +108 -0
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.d.ts +7 -0
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js +104 -0
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.js +2 -0
- package/src/lib/widgets/DynamicWidget/views/WalletsView/WalletsView.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/views/WalletsView/WalletsView.js +2 -0
- package/src/lib/widgets/DynamicWidget/views/index.d.ts +1 -0
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.cjs +2 -0
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.js +2 -0
- package/src/lib/utils/functions/getEnabledProviders/index.cjs +0 -7
- package/src/lib/utils/functions/getEnabledProviders/index.js +0 -3
- package/src/lib/views/PasskeyIntroView/PasskeyIntroView.cjs +0 -156
- package/src/lib/views/PasskeyIntroView/PasskeyIntroView.js +0 -152
- /package/src/lib/views/{PasskeyIntroView → Passkey/PasskeyIntroView}/index.d.ts +0 -0
- /package/src/lib/views/{PasskeyIntroView → Passkey}/utils/createEmbeddedWalletWithPasskey/createEmbeddedWalletWithPasskey.cjs +0 -0
- /package/src/lib/views/{PasskeyIntroView → Passkey}/utils/createEmbeddedWalletWithPasskey/createEmbeddedWalletWithPasskey.d.ts +0 -0
- /package/src/lib/views/{PasskeyIntroView → Passkey}/utils/createEmbeddedWalletWithPasskey/createEmbeddedWalletWithPasskey.js +0 -0
- /package/src/lib/views/{PasskeyIntroView → Passkey}/utils/createEmbeddedWalletWithPasskey/index.d.ts +0 -0
- /package/src/lib/views/{PasskeyIntroView → Passkey}/utils/findPasskeyEmailWalletConnector/findPasskeyEmailWalletConnector.cjs +0 -0
- /package/src/lib/views/{PasskeyIntroView → Passkey}/utils/findPasskeyEmailWalletConnector/findPasskeyEmailWalletConnector.d.ts +0 -0
- /package/src/lib/views/{PasskeyIntroView → Passkey}/utils/findPasskeyEmailWalletConnector/findPasskeyEmailWalletConnector.js +0 -0
- /package/src/lib/views/{PasskeyIntroView → Passkey}/utils/findPasskeyEmailWalletConnector/index.d.ts +0 -0
- /package/src/lib/views/{PasskeyIntroView → Passkey}/utils/index.d.ts +0 -0
package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/ManagePasskeysWidgetView.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { __awaiter } from '../../../../../../_virtual/_tslib.js';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useState, useCallback, useEffect } from 'react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
5
|
+
import { Typography } from '../../../../components/Typography/Typography.js';
|
|
6
|
+
import '@dynamic-labs/sdk-api';
|
|
7
|
+
import '../../../../shared/logger.js';
|
|
8
|
+
import '@dynamic-labs/iconic';
|
|
9
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
10
|
+
import '../../../../context/ViewContext/ViewContext.js';
|
|
11
|
+
import { ReactComponent as SvgChevronLeft } from '../../../../shared/assets/chevron-left.js';
|
|
12
|
+
import '@dynamic-labs/wallet-book';
|
|
13
|
+
import '../../../../utils/constants/colors.js';
|
|
14
|
+
import '../../../../shared/utils/classes/storage/localStorage.js';
|
|
15
|
+
import 'viem';
|
|
16
|
+
import '@dynamic-labs/utils';
|
|
17
|
+
import '../../../../shared/consts/index.js';
|
|
18
|
+
import { useInternalDynamicContext } from '../../../../context/DynamicContext/useInternalDynamicContext.js';
|
|
19
|
+
import '@dynamic-labs/multi-wallet';
|
|
20
|
+
import { getAuthToken } from '../../../../utils/functions/getAuthToken/getAuthToken.js';
|
|
21
|
+
import '../../../../components/ShadowDOM/ShadowDOM.js';
|
|
22
|
+
import '../../../../context/ThemeContext/ThemeContext.js';
|
|
23
|
+
import 'react-dom';
|
|
24
|
+
import 'react-focus-lock';
|
|
25
|
+
import '../../../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
26
|
+
import '../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
27
|
+
import '../../../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
28
|
+
import { getUserPasskeys } from '../../../../data/api.js';
|
|
29
|
+
import '@dynamic-labs/rpc-providers';
|
|
30
|
+
import '../../../../utils/hooks/useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup.js';
|
|
31
|
+
import '../../../../context/ErrorContext/ErrorContext.js';
|
|
32
|
+
import '../../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
33
|
+
import '../../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
34
|
+
import '../../../../components/OverlayCard/OverlayCard.context.js';
|
|
35
|
+
import '../../../../context/FooterAnimationContext/index.js';
|
|
36
|
+
import '../../../../context/MockContext/MockContext.js';
|
|
37
|
+
import '../../../../context/QrCodeContext/QrCodeContext.js';
|
|
38
|
+
import { Skeleton } from '../../../../components/Skeleton/Skeleton.js';
|
|
39
|
+
import '../../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
40
|
+
import '../../components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
41
|
+
import '../../../../context/CaptchaContext/CaptchaContext.js';
|
|
42
|
+
import '../../../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
43
|
+
import 'qrcode';
|
|
44
|
+
import '../../../../context/LoadingContext/LoadingContext.js';
|
|
45
|
+
import 'i18next';
|
|
46
|
+
import { useWidgetContext } from '../../context/DynamicWidgetContext.js';
|
|
47
|
+
import 'yup';
|
|
48
|
+
import '../../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
49
|
+
import '@dynamic-labs/types';
|
|
50
|
+
import '../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
51
|
+
import '../../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
52
|
+
import 'formik';
|
|
53
|
+
import { Button } from '../../../../components/Button/Button.js';
|
|
54
|
+
import { ModalHeader } from '../../../../components/ModalHeader/ModalHeader.js';
|
|
55
|
+
import { IconButton } from '../../../../components/IconButton/IconButton.js';
|
|
56
|
+
import '../../../../components/Alert/Alert.js';
|
|
57
|
+
import { usePasskeyRecovery } from '../../../../utils/hooks/usePasskeyRecovery/usePasskeyRecovery.js';
|
|
58
|
+
import { PasskeyCard } from './PasskeyCard/PasskeyCard.js';
|
|
59
|
+
import '../../../../components/Popper/Popper/Popper.js';
|
|
60
|
+
import '../../../../components/Popper/PopperContext/PopperContext.js';
|
|
61
|
+
import '../../../../components/InlineWidget/InlineWidget.js';
|
|
62
|
+
import '../../../../components/MenuList/Dropdown/Dropdown.js';
|
|
63
|
+
import { NeedHelpSection } from '../../../../components/NeedHelpSection/NeedHelpSection.js';
|
|
64
|
+
|
|
65
|
+
const ManagePasskeysWidgetView = () => {
|
|
66
|
+
const { goToInitialDynamicWidgetView } = useWidgetContext();
|
|
67
|
+
const { environmentId, projectSettings } = useInternalDynamicContext();
|
|
68
|
+
const { initPasskeyRecoveryProcess } = usePasskeyRecovery();
|
|
69
|
+
const { t } = useTranslation();
|
|
70
|
+
const [userPasskeys, setUserPasskeys] = useState([]);
|
|
71
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
72
|
+
const userJwt = getAuthToken();
|
|
73
|
+
const getPasskeysData = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
74
|
+
if (!environmentId || !userJwt)
|
|
75
|
+
return;
|
|
76
|
+
setIsLoading(true);
|
|
77
|
+
const data = yield getUserPasskeys({
|
|
78
|
+
environmentId: environmentId,
|
|
79
|
+
userJwt: userJwt,
|
|
80
|
+
});
|
|
81
|
+
setUserPasskeys(data.passkeys);
|
|
82
|
+
setIsLoading(false);
|
|
83
|
+
}), [environmentId, userJwt]);
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
getPasskeysData();
|
|
86
|
+
}, [getPasskeysData]);
|
|
87
|
+
const isRecoveryEnabled = Boolean(projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk.passkeyEmbeddedWalletRecoveryEnabled);
|
|
88
|
+
const backButton = (jsx(IconButton, { type: 'button', onClick: goToInitialDynamicWidgetView, "data-testid": 'back-button', children: jsx(SvgChevronLeft, {}) }));
|
|
89
|
+
return (jsxs("div", { className: 'manage-passkeys-widget-view', children: [jsx(ModalHeader, { leading: backButton, children: jsx("div", { className: 'send-balance-page-layout__header-content', children: jsx(Typography, { variant: 'title', color: 'primary', children: t('dyn_manage_passkeys.title') }) }) }), jsxs("div", { className: 'manage-passkeys-widget-view__body', children: [jsx("div", { className: 'manage-passkeys-widget-view__body__cards', children: isLoading ? (jsx(Skeleton, { count: 1, className: 'manage-passkeys-widget-view__body__cards__skeleton' })) : (userPasskeys.map((passkey) => (jsx(PasskeyCard, { passkey: passkey }, passkey.id)))) }), isRecoveryEnabled && (jsx(Button, { buttonPadding: 'large', buttonClassName: 'manage-passkeys-widget-view__body__recovery-button', onClick: initPasskeyRecoveryProcess, children: t('dyn_manage_passkeys.recovery_button') })), jsx(NeedHelpSection, {})] })] }));
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export { ManagePasskeysWidgetView };
|
package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var reactI18next = require('react-i18next');
|
|
8
|
+
var iconic = require('@dynamic-labs/iconic');
|
|
9
|
+
var Typography = require('../../../../../components/Typography/Typography.cjs');
|
|
10
|
+
require('@dynamic-labs/sdk-api');
|
|
11
|
+
require('../../../../../shared/logger.cjs');
|
|
12
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
13
|
+
require('../../../../../context/ViewContext/ViewContext.cjs');
|
|
14
|
+
require('@dynamic-labs/wallet-book');
|
|
15
|
+
require('../../../../../utils/constants/colors.cjs');
|
|
16
|
+
require('../../../../../shared/utils/classes/storage/localStorage.cjs');
|
|
17
|
+
require('viem');
|
|
18
|
+
require('@dynamic-labs/utils');
|
|
19
|
+
require('../../../../../shared/consts/index.cjs');
|
|
20
|
+
require('../../../../../context/DynamicContext/DynamicContext.cjs');
|
|
21
|
+
require('@dynamic-labs/multi-wallet');
|
|
22
|
+
require('../../../../../components/ShadowDOM/ShadowDOM.cjs');
|
|
23
|
+
require('../../../../../context/ThemeContext/ThemeContext.cjs');
|
|
24
|
+
var classNames = require('../../../../../utils/functions/classNames/classNames.cjs');
|
|
25
|
+
require('react-dom');
|
|
26
|
+
require('react-focus-lock');
|
|
27
|
+
require('../../../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
28
|
+
require('../../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
29
|
+
require('../../../../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
30
|
+
require('../../../../../config/ApiEndpoint.cjs');
|
|
31
|
+
require('@dynamic-labs/rpc-providers');
|
|
32
|
+
require('../../../../../utils/hooks/useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup.cjs');
|
|
33
|
+
require('../../../../../context/ErrorContext/ErrorContext.cjs');
|
|
34
|
+
require('../../../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
35
|
+
require('../../../../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
36
|
+
require('../../../../../components/OverlayCard/OverlayCard.context.cjs');
|
|
37
|
+
require('../../../../../context/FooterAnimationContext/index.cjs');
|
|
38
|
+
require('../../../../../context/MockContext/MockContext.cjs');
|
|
39
|
+
require('../../../../../context/QrCodeContext/QrCodeContext.cjs');
|
|
40
|
+
require('../../../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
41
|
+
require('../../../components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
42
|
+
require('../../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
43
|
+
require('../../../../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
44
|
+
require('qrcode');
|
|
45
|
+
require('../../../../../context/LoadingContext/LoadingContext.cjs');
|
|
46
|
+
var getPasskeyProviderFromUserAgent = require('../../../helpers/getPasskeyProviderFromUserAgent.cjs');
|
|
47
|
+
var getTimeSince = require('../../../helpers/getTimeSince.cjs');
|
|
48
|
+
require('../../../context/DynamicWidgetContext.cjs');
|
|
49
|
+
require('yup');
|
|
50
|
+
require('../../../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
51
|
+
require('@dynamic-labs/types');
|
|
52
|
+
require('../../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
53
|
+
require('../../../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
54
|
+
require('formik');
|
|
55
|
+
require('../../../../../components/IconButton/IconButton.cjs');
|
|
56
|
+
require('../../../../../components/Alert/Alert.cjs');
|
|
57
|
+
var shortenEmail = require('../../../../../shared/utils/functions/shortenEmail/shortenEmail.cjs');
|
|
58
|
+
require('../../../../../components/Popper/Popper/Popper.cjs');
|
|
59
|
+
require('../../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
60
|
+
require('../../../../../components/InlineWidget/InlineWidget.cjs');
|
|
61
|
+
require('../../../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
62
|
+
|
|
63
|
+
const mapPasskeyProviderToIcon = {
|
|
64
|
+
android: jsxRuntime.jsx(iconic.AndroidIcon, {}),
|
|
65
|
+
brave: jsxRuntime.jsx(iconic.BraveIcon, {}),
|
|
66
|
+
chrome: jsxRuntime.jsx(iconic.ChromeIcon, {}),
|
|
67
|
+
edge: jsxRuntime.jsx(iconic.EdgeIcon, {}),
|
|
68
|
+
firefox: jsxRuntime.jsx(iconic.FirefoxIcon, {}),
|
|
69
|
+
iPhone: jsxRuntime.jsx(iconic.AppleIcon, {}),
|
|
70
|
+
opera: jsxRuntime.jsx(iconic.OperaIcon, {}),
|
|
71
|
+
safari: jsxRuntime.jsx(iconic.SafariIcon, {}),
|
|
72
|
+
};
|
|
73
|
+
const PasskeyCard = ({ passkey }) => {
|
|
74
|
+
const { t } = reactI18next.useTranslation();
|
|
75
|
+
const [showTooltip, setShowTooltip] = React.useState(false);
|
|
76
|
+
const { value: timeSinceValue, unit: timeSinceUnit } = getTimeSince.getTimeSince(passkey.createdAt);
|
|
77
|
+
const PasskeyProviderIcon = () => {
|
|
78
|
+
if (!passkey.userAgent)
|
|
79
|
+
return null;
|
|
80
|
+
const provider = getPasskeyProviderFromUserAgent.getPasskeyProviderFromUserAgent(passkey.userAgent);
|
|
81
|
+
if (!provider)
|
|
82
|
+
return null;
|
|
83
|
+
return mapPasskeyProviderToIcon[provider];
|
|
84
|
+
};
|
|
85
|
+
const getPasskeyProviderName = () => {
|
|
86
|
+
if (!passkey.userAgent)
|
|
87
|
+
return null;
|
|
88
|
+
const provider = getPasskeyProviderFromUserAgent.getPasskeyProviderFromUserAgent(passkey.userAgent);
|
|
89
|
+
if (!provider)
|
|
90
|
+
return null;
|
|
91
|
+
return t(`dyn_manage_passkeys.passkey_providers.${provider}`);
|
|
92
|
+
};
|
|
93
|
+
const handleShowTooltip = () => {
|
|
94
|
+
setShowTooltip(true);
|
|
95
|
+
setTimeout(() => {
|
|
96
|
+
setShowTooltip(false);
|
|
97
|
+
}, 2000);
|
|
98
|
+
};
|
|
99
|
+
return (jsxRuntime.jsxs("div", { className: 'passkey-card', children: [jsxRuntime.jsxs("div", { className: 'passkey-card__info', children: [jsxRuntime.jsx("div", { className: 'passkey-card__info__icon', "data-testId": 'provider-icon', children: jsxRuntime.jsx(PasskeyProviderIcon, {}) }), jsxRuntime.jsxs("div", { className: 'passkey-card__info__text', children: [jsxRuntime.jsxs(Typography.Typography, { "data-testid": 'passkey-alias', variant: 'body_normal', color: 'primary', title: passkey.alias, onClick: handleShowTooltip, children: [shortenEmail.shortenEmail(passkey.alias, {
|
|
100
|
+
breakpoint: 12,
|
|
101
|
+
cutEnd: 4,
|
|
102
|
+
cutStart: 4,
|
|
103
|
+
}), jsxRuntime.jsx("p", { className: classNames.classNames('passkey-card__info__tooltip', {
|
|
104
|
+
'passkey-card__info__tooltip--visible': showTooltip,
|
|
105
|
+
}), children: passkey.alias })] }), getPasskeyProviderName() && (jsxRuntime.jsxs(Typography.Typography, { variant: 'body_small', color: 'secondary', children: [t('dyn_manage_passkeys.passkey_from'), " ", getPasskeyProviderName()] }))] })] }), jsxRuntime.jsx("div", { className: 'passkey-card__date', children: jsxRuntime.jsxs(Typography.Typography, { variant: 'body_small', color: 'secondary', children: [t('dyn_time_since.created'), ' ', `${timeSinceValue} ${timeSinceUnit} ${t('dyn_time_since.ago')}`] }) })] }));
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
exports.PasskeyCard = PasskeyCard;
|
package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { AndroidIcon, BraveIcon, ChromeIcon, EdgeIcon, FirefoxIcon, AppleIcon, OperaIcon, SafariIcon } from '@dynamic-labs/iconic';
|
|
5
|
+
import { Typography } from '../../../../../components/Typography/Typography.js';
|
|
6
|
+
import '@dynamic-labs/sdk-api';
|
|
7
|
+
import '../../../../../shared/logger.js';
|
|
8
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
9
|
+
import '../../../../../context/ViewContext/ViewContext.js';
|
|
10
|
+
import '@dynamic-labs/wallet-book';
|
|
11
|
+
import '../../../../../utils/constants/colors.js';
|
|
12
|
+
import '../../../../../shared/utils/classes/storage/localStorage.js';
|
|
13
|
+
import 'viem';
|
|
14
|
+
import '@dynamic-labs/utils';
|
|
15
|
+
import '../../../../../shared/consts/index.js';
|
|
16
|
+
import '../../../../../context/DynamicContext/DynamicContext.js';
|
|
17
|
+
import '@dynamic-labs/multi-wallet';
|
|
18
|
+
import '../../../../../components/ShadowDOM/ShadowDOM.js';
|
|
19
|
+
import '../../../../../context/ThemeContext/ThemeContext.js';
|
|
20
|
+
import { classNames } from '../../../../../utils/functions/classNames/classNames.js';
|
|
21
|
+
import 'react-dom';
|
|
22
|
+
import 'react-focus-lock';
|
|
23
|
+
import '../../../../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
24
|
+
import '../../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
25
|
+
import '../../../../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
26
|
+
import '../../../../../config/ApiEndpoint.js';
|
|
27
|
+
import '@dynamic-labs/rpc-providers';
|
|
28
|
+
import '../../../../../utils/hooks/useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup.js';
|
|
29
|
+
import '../../../../../context/ErrorContext/ErrorContext.js';
|
|
30
|
+
import '../../../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
31
|
+
import '../../../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
32
|
+
import '../../../../../components/OverlayCard/OverlayCard.context.js';
|
|
33
|
+
import '../../../../../context/FooterAnimationContext/index.js';
|
|
34
|
+
import '../../../../../context/MockContext/MockContext.js';
|
|
35
|
+
import '../../../../../context/QrCodeContext/QrCodeContext.js';
|
|
36
|
+
import '../../../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
37
|
+
import '../../../components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
38
|
+
import '../../../../../context/CaptchaContext/CaptchaContext.js';
|
|
39
|
+
import '../../../../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
40
|
+
import 'qrcode';
|
|
41
|
+
import '../../../../../context/LoadingContext/LoadingContext.js';
|
|
42
|
+
import { getPasskeyProviderFromUserAgent } from '../../../helpers/getPasskeyProviderFromUserAgent.js';
|
|
43
|
+
import { getTimeSince } from '../../../helpers/getTimeSince.js';
|
|
44
|
+
import '../../../context/DynamicWidgetContext.js';
|
|
45
|
+
import 'yup';
|
|
46
|
+
import '../../../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
47
|
+
import '@dynamic-labs/types';
|
|
48
|
+
import '../../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
49
|
+
import '../../../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
50
|
+
import 'formik';
|
|
51
|
+
import '../../../../../components/IconButton/IconButton.js';
|
|
52
|
+
import '../../../../../components/Alert/Alert.js';
|
|
53
|
+
import { shortenEmail } from '../../../../../shared/utils/functions/shortenEmail/shortenEmail.js';
|
|
54
|
+
import '../../../../../components/Popper/Popper/Popper.js';
|
|
55
|
+
import '../../../../../components/Popper/PopperContext/PopperContext.js';
|
|
56
|
+
import '../../../../../components/InlineWidget/InlineWidget.js';
|
|
57
|
+
import '../../../../../components/MenuList/Dropdown/Dropdown.js';
|
|
58
|
+
|
|
59
|
+
const mapPasskeyProviderToIcon = {
|
|
60
|
+
android: jsx(AndroidIcon, {}),
|
|
61
|
+
brave: jsx(BraveIcon, {}),
|
|
62
|
+
chrome: jsx(ChromeIcon, {}),
|
|
63
|
+
edge: jsx(EdgeIcon, {}),
|
|
64
|
+
firefox: jsx(FirefoxIcon, {}),
|
|
65
|
+
iPhone: jsx(AppleIcon, {}),
|
|
66
|
+
opera: jsx(OperaIcon, {}),
|
|
67
|
+
safari: jsx(SafariIcon, {}),
|
|
68
|
+
};
|
|
69
|
+
const PasskeyCard = ({ passkey }) => {
|
|
70
|
+
const { t } = useTranslation();
|
|
71
|
+
const [showTooltip, setShowTooltip] = useState(false);
|
|
72
|
+
const { value: timeSinceValue, unit: timeSinceUnit } = getTimeSince(passkey.createdAt);
|
|
73
|
+
const PasskeyProviderIcon = () => {
|
|
74
|
+
if (!passkey.userAgent)
|
|
75
|
+
return null;
|
|
76
|
+
const provider = getPasskeyProviderFromUserAgent(passkey.userAgent);
|
|
77
|
+
if (!provider)
|
|
78
|
+
return null;
|
|
79
|
+
return mapPasskeyProviderToIcon[provider];
|
|
80
|
+
};
|
|
81
|
+
const getPasskeyProviderName = () => {
|
|
82
|
+
if (!passkey.userAgent)
|
|
83
|
+
return null;
|
|
84
|
+
const provider = getPasskeyProviderFromUserAgent(passkey.userAgent);
|
|
85
|
+
if (!provider)
|
|
86
|
+
return null;
|
|
87
|
+
return t(`dyn_manage_passkeys.passkey_providers.${provider}`);
|
|
88
|
+
};
|
|
89
|
+
const handleShowTooltip = () => {
|
|
90
|
+
setShowTooltip(true);
|
|
91
|
+
setTimeout(() => {
|
|
92
|
+
setShowTooltip(false);
|
|
93
|
+
}, 2000);
|
|
94
|
+
};
|
|
95
|
+
return (jsxs("div", { className: 'passkey-card', children: [jsxs("div", { className: 'passkey-card__info', children: [jsx("div", { className: 'passkey-card__info__icon', "data-testId": 'provider-icon', children: jsx(PasskeyProviderIcon, {}) }), jsxs("div", { className: 'passkey-card__info__text', children: [jsxs(Typography, { "data-testid": 'passkey-alias', variant: 'body_normal', color: 'primary', title: passkey.alias, onClick: handleShowTooltip, children: [shortenEmail(passkey.alias, {
|
|
96
|
+
breakpoint: 12,
|
|
97
|
+
cutEnd: 4,
|
|
98
|
+
cutStart: 4,
|
|
99
|
+
}), jsx("p", { className: classNames('passkey-card__info__tooltip', {
|
|
100
|
+
'passkey-card__info__tooltip--visible': showTooltip,
|
|
101
|
+
}), children: passkey.alias })] }), getPasskeyProviderName() && (jsxs(Typography, { variant: 'body_small', color: 'secondary', children: [t('dyn_manage_passkeys.passkey_from'), " ", getPasskeyProviderName()] }))] })] }), jsx("div", { className: 'passkey-card__date', children: jsxs(Typography, { variant: 'body_small', color: 'secondary', children: [t('dyn_time_since.created'), ' ', `${timeSinceValue} ${timeSinceUnit} ${t('dyn_time_since.ago')}`] }) })] }));
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export { PasskeyCard };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PasskeyCard } from './PasskeyCard';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ManagePasskeysWidgetView } from './ManagePasskeysWidgetView';
|
|
@@ -46,6 +46,7 @@ require('../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
|
46
46
|
require('../../../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
47
47
|
require('qrcode');
|
|
48
48
|
require('../../../../context/LoadingContext/LoadingContext.cjs');
|
|
49
|
+
require('i18next');
|
|
49
50
|
var DynamicWidgetContext = require('../../context/DynamicWidgetContext.cjs');
|
|
50
51
|
require('../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
51
52
|
require('../../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
@@ -54,6 +55,7 @@ require('yup');
|
|
|
54
55
|
var Button = require('../../../../components/Button/Button.cjs');
|
|
55
56
|
require('../../../../components/IconButton/IconButton.cjs');
|
|
56
57
|
require('../../../../components/Alert/Alert.cjs');
|
|
58
|
+
require('../ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
57
59
|
require('@dynamic-labs/types');
|
|
58
60
|
var LogoutButton = require('../../../../components/LogoutButton/LogoutButton.cjs');
|
|
59
61
|
require('../../../../components/Popper/Popper/Popper.cjs');
|
|
@@ -42,6 +42,7 @@ import '../../../../context/CaptchaContext/CaptchaContext.js';
|
|
|
42
42
|
import '../../../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
43
43
|
import 'qrcode';
|
|
44
44
|
import '../../../../context/LoadingContext/LoadingContext.js';
|
|
45
|
+
import 'i18next';
|
|
45
46
|
import { useWidgetContext } from '../../context/DynamicWidgetContext.js';
|
|
46
47
|
import '../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
47
48
|
import '../../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
@@ -50,6 +51,7 @@ import 'yup';
|
|
|
50
51
|
import { Button } from '../../../../components/Button/Button.js';
|
|
51
52
|
import '../../../../components/IconButton/IconButton.js';
|
|
52
53
|
import '../../../../components/Alert/Alert.js';
|
|
54
|
+
import '../ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
53
55
|
import '@dynamic-labs/types';
|
|
54
56
|
import { LogoutButton } from '../../../../components/LogoutButton/LogoutButton.js';
|
|
55
57
|
import '../../../../components/Popper/Popper/Popper.js';
|
|
@@ -44,6 +44,7 @@ require('../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
|
44
44
|
require('../../../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
45
45
|
require('qrcode');
|
|
46
46
|
require('../../../../context/LoadingContext/LoadingContext.cjs');
|
|
47
|
+
require('i18next');
|
|
47
48
|
require('../../context/DynamicWidgetContext.cjs');
|
|
48
49
|
var DynamicWidgetWallets = require('../../components/DynamicWidgetWallets/DynamicWidgetWallets.cjs');
|
|
49
50
|
var SingleWalletButtons = require('../../components/SingleWalletButtons/SingleWalletButtons.cjs');
|
|
@@ -56,6 +57,7 @@ require('formik');
|
|
|
56
57
|
var Button = require('../../../../components/Button/Button.cjs');
|
|
57
58
|
require('../../../../components/IconButton/IconButton.cjs');
|
|
58
59
|
require('../../../../components/Alert/Alert.cjs');
|
|
60
|
+
require('../ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
59
61
|
var useKYCFlag = require('../../../../utils/hooks/useKYCFlag/useKYCFlag.cjs');
|
|
60
62
|
var useMultiWalletFlag = require('../../../../utils/hooks/useMultiWalletFlag/useMultiWalletFlag.cjs');
|
|
61
63
|
var LogoutButton = require('../../../../components/LogoutButton/LogoutButton.cjs');
|
|
@@ -40,6 +40,7 @@ import '../../../../context/CaptchaContext/CaptchaContext.js';
|
|
|
40
40
|
import '../../../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
41
41
|
import 'qrcode';
|
|
42
42
|
import '../../../../context/LoadingContext/LoadingContext.js';
|
|
43
|
+
import 'i18next';
|
|
43
44
|
import '../../context/DynamicWidgetContext.js';
|
|
44
45
|
import { DynamicWidgetWallets } from '../../components/DynamicWidgetWallets/DynamicWidgetWallets.js';
|
|
45
46
|
import { SingleWalletButtons } from '../../components/SingleWalletButtons/SingleWalletButtons.js';
|
|
@@ -52,6 +53,7 @@ import 'formik';
|
|
|
52
53
|
import { Button } from '../../../../components/Button/Button.js';
|
|
53
54
|
import '../../../../components/IconButton/IconButton.js';
|
|
54
55
|
import '../../../../components/Alert/Alert.js';
|
|
56
|
+
import '../ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
55
57
|
import { useKYCFlag } from '../../../../utils/hooks/useKYCFlag/useKYCFlag.js';
|
|
56
58
|
import { useMultiWalletFlag } from '../../../../utils/hooks/useMultiWalletFlag/useMultiWalletFlag.js';
|
|
57
59
|
import { LogoutButton } from '../../../../components/LogoutButton/LogoutButton.js';
|
|
@@ -2,3 +2,4 @@ export { WalletsView } from './WalletsView/WalletsView';
|
|
|
2
2
|
export { ProfileView } from './ProfileView/ProfileView';
|
|
3
3
|
export { EditProfileView } from './EditProfileView/EditProfileView';
|
|
4
4
|
export { SendBalanceWidgetView } from './SendBalanceWidgetView';
|
|
5
|
+
export { ManagePasskeysWidgetView } from './ManagePasskeysWidgetView';
|
|
@@ -42,6 +42,7 @@ require('../../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
|
42
42
|
require('../../../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
43
43
|
require('qrcode');
|
|
44
44
|
require('../../../../context/LoadingContext/LoadingContext.cjs');
|
|
45
|
+
require('i18next');
|
|
45
46
|
require('../../../DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
46
47
|
require('yup');
|
|
47
48
|
require('../../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
@@ -51,6 +52,7 @@ require('../../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs')
|
|
|
51
52
|
require('formik');
|
|
52
53
|
require('../../../../components/IconButton/IconButton.cjs');
|
|
53
54
|
require('../../../../components/Alert/Alert.cjs');
|
|
55
|
+
require('../../../DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
54
56
|
require('../../../../components/Popper/Popper/Popper.cjs');
|
|
55
57
|
require('../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
56
58
|
require('../../../../components/InlineWidget/InlineWidget.cjs');
|
|
@@ -38,6 +38,7 @@ import '../../../../context/CaptchaContext/CaptchaContext.js';
|
|
|
38
38
|
import '../../../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
39
39
|
import 'qrcode';
|
|
40
40
|
import '../../../../context/LoadingContext/LoadingContext.js';
|
|
41
|
+
import 'i18next';
|
|
41
42
|
import '../../../DynamicWidget/context/DynamicWidgetContext.js';
|
|
42
43
|
import 'yup';
|
|
43
44
|
import '../../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
@@ -47,6 +48,7 @@ import '../../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
|
47
48
|
import 'formik';
|
|
48
49
|
import '../../../../components/IconButton/IconButton.js';
|
|
49
50
|
import '../../../../components/Alert/Alert.js';
|
|
51
|
+
import '../../../DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
50
52
|
import '../../../../components/Popper/Popper/Popper.js';
|
|
51
53
|
import '../../../../components/Popper/PopperContext/PopperContext.js';
|
|
52
54
|
import '../../../../components/InlineWidget/InlineWidget.js';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const getEnabledProviders = (providers) => { var _a; return (_a = providers === null || providers === void 0 ? void 0 : providers.filter(({ enabledAt }) => Boolean(enabledAt))) !== null && _a !== void 0 ? _a : []; };
|
|
6
|
-
|
|
7
|
-
exports.getEnabledProviders = getEnabledProviders;
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var _tslib = require('../../../../_virtual/_tslib.cjs');
|
|
6
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
-
var React = require('react');
|
|
8
|
-
var reactI18next = require('react-i18next');
|
|
9
|
-
var utils = require('@dynamic-labs/utils');
|
|
10
|
-
var useInternalDynamicContext = require('../../context/DynamicContext/useInternalDynamicContext.cjs');
|
|
11
|
-
var Typography = require('../../components/Typography/Typography.cjs');
|
|
12
|
-
require('@dynamic-labs/sdk-api');
|
|
13
|
-
var logger = require('../../shared/logger.cjs');
|
|
14
|
-
require('@dynamic-labs/iconic');
|
|
15
|
-
require('@dynamic-labs/wallet-connector-core');
|
|
16
|
-
require('../../context/ViewContext/ViewContext.cjs');
|
|
17
|
-
var footerInfoIcon = require('../../shared/assets/footer-info-icon.cjs');
|
|
18
|
-
var passkeyIntroIcon = require('../../shared/assets/passkey-intro-icon.cjs');
|
|
19
|
-
var androidFaceId = require('../../shared/assets/android-face-id.cjs');
|
|
20
|
-
var androidTouchId = require('../../shared/assets/android-touch-id.cjs');
|
|
21
|
-
var iphoneFaceId = require('../../shared/assets/iphone-face-id.cjs');
|
|
22
|
-
var iphoneTouchId = require('../../shared/assets/iphone-touch-id.cjs');
|
|
23
|
-
require('@dynamic-labs/wallet-book');
|
|
24
|
-
var localStorage$1 = require('../../utils/constants/localStorage.cjs');
|
|
25
|
-
require('../../utils/constants/colors.cjs');
|
|
26
|
-
var localStorage = require('../../shared/utils/classes/storage/localStorage.cjs');
|
|
27
|
-
require('viem');
|
|
28
|
-
require('../../shared/consts/index.cjs');
|
|
29
|
-
var index$1 = require('../../utils/functions/storeAuthToken/index.cjs');
|
|
30
|
-
require('@dynamic-labs/multi-wallet');
|
|
31
|
-
var createUserProfile = require('../../utils/functions/createUserProfile/createUserProfile.cjs');
|
|
32
|
-
require('../../components/ShadowDOM/ShadowDOM.cjs');
|
|
33
|
-
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
34
|
-
var Icon = require('../../components/Icon/Icon.cjs');
|
|
35
|
-
require('react-dom');
|
|
36
|
-
require('react-focus-lock');
|
|
37
|
-
require('../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
38
|
-
require('../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
39
|
-
require('../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
40
|
-
require('../../config/ApiEndpoint.cjs');
|
|
41
|
-
require('@dynamic-labs/rpc-providers');
|
|
42
|
-
require('../../utils/hooks/useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup.cjs');
|
|
43
|
-
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
44
|
-
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
45
|
-
require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
46
|
-
require('../../components/OverlayCard/OverlayCard.context.cjs');
|
|
47
|
-
var index = require('../../context/FooterAnimationContext/index.cjs');
|
|
48
|
-
require('../../context/MockContext/MockContext.cjs');
|
|
49
|
-
require('../../context/QrCodeContext/QrCodeContext.cjs');
|
|
50
|
-
var Tooltip = require('../../components/Tooltip/Tooltip.cjs');
|
|
51
|
-
require('../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
52
|
-
require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
53
|
-
var usePromise = require('../../utils/hooks/usePromise/usePromise.cjs');
|
|
54
|
-
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
55
|
-
require('../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
56
|
-
require('qrcode');
|
|
57
|
-
require('../../context/LoadingContext/LoadingContext.cjs');
|
|
58
|
-
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
59
|
-
require('yup');
|
|
60
|
-
var ErrorContainer = require('../../components/ErrorContainer/ErrorContainer.cjs');
|
|
61
|
-
require('../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
62
|
-
require('@dynamic-labs/types');
|
|
63
|
-
require('../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
64
|
-
require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
65
|
-
require('formik');
|
|
66
|
-
var Button = require('../../components/Button/Button.cjs');
|
|
67
|
-
var ModalHeader = require('../../components/ModalHeader/ModalHeader.cjs');
|
|
68
|
-
var IconButton = require('../../components/IconButton/IconButton.cjs');
|
|
69
|
-
require('../../components/Alert/Alert.cjs');
|
|
70
|
-
var useMutation = require('../../utils/hooks/useMutation/useMutation.cjs');
|
|
71
|
-
var TextButton = require('../../components/TextButton/TextButton.cjs');
|
|
72
|
-
require('../../components/Popper/Popper/Popper.cjs');
|
|
73
|
-
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
74
|
-
require('../../components/InlineWidget/InlineWidget.cjs');
|
|
75
|
-
require('../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
76
|
-
var isPasskeyEnabled = require('../../utils/functions/isPasskeyEnabled/isPasskeyEnabled.cjs');
|
|
77
|
-
var createEmbeddedWalletWithPasskey = require('./utils/createEmbeddedWalletWithPasskey/createEmbeddedWalletWithPasskey.cjs');
|
|
78
|
-
var findPasskeyEmailWalletConnector = require('./utils/findPasskeyEmailWalletConnector/findPasskeyEmailWalletConnector.cjs');
|
|
79
|
-
|
|
80
|
-
const PasskeyIntroView = ({ createEmbeddedWalletMutation = createEmbeddedWalletWithPasskey.createEmbeddedWalletWithPasskey, }) => {
|
|
81
|
-
const { user, wallets, setPrimaryWalletId, setUser, authToken, environmentId, handleLogOut, internalEvents, setShowAuthFlow, setCallback, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
82
|
-
const { setIsFooterExpanded } = index.useFooterAnimationContext();
|
|
83
|
-
const { t } = reactI18next.useTranslation();
|
|
84
|
-
const { data: passkeyEnabled } = usePromise.usePromise(isPasskeyEnabled.isPasskeyEnabled);
|
|
85
|
-
// if passkey is not yet setup, but user logged in with email in a passkey env
|
|
86
|
-
// it should be null to force user to setup passkey even after the a refresh
|
|
87
|
-
React.useEffect(() => localStorage.LocalStorage.removeFromLS(localStorage$1.LAST_USED_WALLET), []);
|
|
88
|
-
const { mutate: createEmbeddedWalletWithPasskeyMutation, isLoading, error, } = useMutation.useMutation(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
89
|
-
var _a;
|
|
90
|
-
const { embeddedWalletVerifiedCredentialId, jwt, decodedJwt, walletConnector, } = yield createEmbeddedWalletMutation({
|
|
91
|
-
authToken,
|
|
92
|
-
environmentId,
|
|
93
|
-
user,
|
|
94
|
-
walletConnector: findPasskeyEmailWalletConnector.findPasskeyEmailWalletConnector(wallets),
|
|
95
|
-
});
|
|
96
|
-
const passkeyWallet = {
|
|
97
|
-
address: (yield walletConnector.fetchPublicAddress()) || '',
|
|
98
|
-
chain: walletConnector.connectedChain || '',
|
|
99
|
-
connected: true,
|
|
100
|
-
connector: walletConnector,
|
|
101
|
-
id: embeddedWalletVerifiedCredentialId,
|
|
102
|
-
};
|
|
103
|
-
internalEvents.current.emit('embeddedWalletCreated', passkeyWallet);
|
|
104
|
-
setPrimaryWalletId(embeddedWalletVerifiedCredentialId);
|
|
105
|
-
index$1.storeAuthToken(jwt);
|
|
106
|
-
setUser(createUserProfile.createUserProfile(decodedJwt));
|
|
107
|
-
setShowAuthFlow(false);
|
|
108
|
-
const turnkeyVerifiedCredentials = (_a = decodedJwt === null || decodedJwt === void 0 ? void 0 : decodedJwt.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.find(({ walletName }) => walletName === 'turnkey');
|
|
109
|
-
setCallback('embeddedWalletCreated', {
|
|
110
|
-
email: (turnkeyVerifiedCredentials === null || turnkeyVerifiedCredentials === void 0 ? void 0 : turnkeyVerifiedCredentials.email) || '',
|
|
111
|
-
verifiedCredential: turnkeyVerifiedCredentials,
|
|
112
|
-
});
|
|
113
|
-
}), {
|
|
114
|
-
onFailure: (err) => {
|
|
115
|
-
logger.logger.error('Failed to create embedded wallet', err);
|
|
116
|
-
internalEvents.current.emit('embeddedWalletFailed', err);
|
|
117
|
-
},
|
|
118
|
-
});
|
|
119
|
-
const errorText = React.useMemo(() => {
|
|
120
|
-
if (!error) {
|
|
121
|
-
return undefined;
|
|
122
|
-
}
|
|
123
|
-
if (error instanceof utils.DynamicError) {
|
|
124
|
-
return "Make sure you're logged in.";
|
|
125
|
-
}
|
|
126
|
-
return 'Something went wrong.';
|
|
127
|
-
}, [error]);
|
|
128
|
-
const infoIconButton = (jsxRuntime.jsx(Tooltip.Tooltip, { content: t('dyn_passkey_intro.helper.tooltip'), className: 'header__tooltip', children: jsxRuntime.jsx(IconButton.IconButton, { type: 'button', "data-testid": 'info-button', onClick: () => setIsFooterExpanded((prev) => !prev), className: 'header__icon', children: jsxRuntime.jsx(footerInfoIcon.ReactComponent, {}) }) }, 'info-button'));
|
|
129
|
-
const renderIcon = () => {
|
|
130
|
-
let IdIcon;
|
|
131
|
-
if (utils.isIPhone()) {
|
|
132
|
-
if (utils.isIPhone8OrEarlier()) {
|
|
133
|
-
IdIcon = jsxRuntime.jsx(iphoneTouchId.ReactComponent, { "data-testid": 'iphone-8-icon' });
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
IdIcon = jsxRuntime.jsx(iphoneFaceId.ReactComponent, { "data-testid": 'iphone-icon' });
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
if (utils.isAndroid()) {
|
|
140
|
-
const androidVersion = utils.getAndroidVersion();
|
|
141
|
-
if (androidVersion && androidVersion >= 9) {
|
|
142
|
-
IdIcon = jsxRuntime.jsx(androidTouchId.ReactComponent, { "data-testid": 'android-9-icon' });
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
145
|
-
IdIcon = jsxRuntime.jsx(androidFaceId.ReactComponent, { "data-testid": 'android-icon' });
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
if (!IdIcon) {
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
return jsxRuntime.jsx(Icon.Icon, { size: 'small', children: IdIcon });
|
|
152
|
-
};
|
|
153
|
-
return (jsxRuntime.jsxs("div", { className: 'passkey-intro-modal-wrapper', children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: infoIconButton, children: jsxRuntime.jsx("div", { className: 'passkey-intro-view__header', children: jsxRuntime.jsx(passkeyIntroIcon.ReactComponent, {}) }) }), jsxRuntime.jsx("div", { className: 'passkey-intro-view', children: jsxRuntime.jsxs("div", { className: 'passkey-intro-view__content', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'passkey-intro-view__title', children: t('dyn_passkey_intro.title') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'passkey-intro-view__subtitle', children: t('dyn_passkey_intro.subtitle') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'passkey-intro-view__subtitle--underline', children: t('dyn_passkey_intro.warning') }), passkeyEnabled === false && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: t('dyn_passkey_intro.disabled') })), errorText && jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: errorText }), jsxRuntime.jsxs("div", { className: 'passkey-intro-view__actions', children: [jsxRuntime.jsx(Button.Button, { buttonPadding: 'large', onClick: () => createEmbeddedWalletWithPasskeyMutation(), dataTestId: 'setup-passkey-button', loading: isLoading, disabled: isLoading || !passkeyEnabled, children: jsxRuntime.jsxs("div", { className: 'passkey-intro-view__inline-button', children: [renderIcon(), jsxRuntime.jsx(Typography.Typography, { children: t('dyn_passkey_intro.button') })] }) }), jsxRuntime.jsx(TextButton.TextButton, { "data-testid": 'setup-passkey-logout-button', className: 'passkey-intro-view__log-out', onClick: handleLogOut, children: t('dyn_passkey_intro.button_logout') })] })] }) })] }));
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
exports.PasskeyIntroView = PasskeyIntroView;
|