@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
|
@@ -20,14 +20,19 @@ require('@dynamic-labs/utils');
|
|
|
20
20
|
require('../../shared/consts/index.cjs');
|
|
21
21
|
require('@dynamic-labs/multi-wallet');
|
|
22
22
|
var isEmailProviderEnabled = require('../../utils/functions/isEmailProviderEnabled/isEmailProviderEnabled.cjs');
|
|
23
|
-
var index = require('../../utils/functions/getEnabledProviders/index.cjs');
|
|
24
23
|
|
|
25
24
|
/* eslint-disable multiline-comment-style */
|
|
26
25
|
const NUMBER_OF_WALLETS = 3;
|
|
27
26
|
const useLoginView = () => {
|
|
28
|
-
var _a, _b, _c, _d;
|
|
27
|
+
var _a, _b, _c, _d, _e, _f;
|
|
29
28
|
const { projectSettings, authorizationViewDisplayOrder, loginWithEmail, wallets, walletsFilter, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
29
|
+
const { t } = reactI18next.useTranslation();
|
|
30
30
|
const { enabledSocialProviders } = SocialRedirectContext.useSocialRedirectContext();
|
|
31
|
+
const hasSocialProvidersEnabled = Boolean(enabledSocialProviders === null || enabledSocialProviders === void 0 ? void 0 : enabledSocialProviders.length);
|
|
32
|
+
const hasEmailProviderEnabled = ((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) === null || _a === void 0 ? void 0 : _a.length) &&
|
|
33
|
+
isEmailProviderEnabled.isEmailProviderEnabled(projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers);
|
|
34
|
+
// is email only is set in the project settings when the "Email (Web2) only" is toggled on in the dashboard
|
|
35
|
+
const isEmailOnly = (_c = (_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design) === null || _b === void 0 ? void 0 : _b.modal) === null || _c === void 0 ? void 0 : _c.emailOnly;
|
|
31
36
|
/** Takes from wallets only those that can be selected in the wallet list by the user.
|
|
32
37
|
* Should filter out embedded wallets
|
|
33
38
|
* WHY: when we decide whether to show wallets or not, we need to know how many wallets
|
|
@@ -35,61 +40,91 @@ const useLoginView = () => {
|
|
|
35
40
|
* wallets and then display an empty wallet list (since turnkey doesn't render)
|
|
36
41
|
*/
|
|
37
42
|
const selectableWallets = (walletsFilter ? walletsFilter(wallets) : wallets).filter(({ key }) => key !== 'turnkey');
|
|
38
|
-
const
|
|
39
|
-
|
|
43
|
+
const separator = React.useMemo(() => ({
|
|
44
|
+
label: t('dyn_login.separators.default'),
|
|
45
|
+
type: sdkApi.SdkViewSectionType.Separator,
|
|
46
|
+
}), [t]);
|
|
40
47
|
const isWalletOnly = React.useMemo(() => {
|
|
41
|
-
var _a, _b, _c
|
|
48
|
+
var _a, _b, _c;
|
|
42
49
|
if (!projectSettings) {
|
|
43
50
|
return false;
|
|
44
51
|
}
|
|
45
|
-
//
|
|
46
|
-
if (!loginWithEmail) {
|
|
52
|
+
// if both loginWithEmail AND hasSocialProvidersEnabled are false, it's wallet only
|
|
53
|
+
if (!loginWithEmail && !hasSocialProvidersEnabled) {
|
|
47
54
|
return true;
|
|
48
55
|
}
|
|
49
56
|
const loginView = (_b = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.views) === null || _b === void 0 ? void 0 : _b.find((view) => view.type === sdkApi.SdkViewType.Login);
|
|
50
|
-
// backwards compatibility for those that didn't set up login view
|
|
57
|
+
// backwards compatibility for those that didn't set up login view sections
|
|
51
58
|
if (!((_c = loginView === null || loginView === void 0 ? void 0 : loginView.sections) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
52
|
-
return
|
|
53
|
-
!isEmailProviderEnabled.isEmailProviderEnabled(projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers));
|
|
59
|
+
return !hasEmailProviderEnabled && !hasSocialProvidersEnabled;
|
|
54
60
|
}
|
|
55
61
|
return (loginView.sections.length === 1 && loginView.sections[0].type === 'wallet');
|
|
56
|
-
}, [
|
|
62
|
+
}, [
|
|
63
|
+
projectSettings,
|
|
64
|
+
loginWithEmail,
|
|
65
|
+
hasSocialProvidersEnabled,
|
|
66
|
+
hasEmailProviderEnabled,
|
|
67
|
+
enabledSocialProviders === null || enabledSocialProviders === void 0 ? void 0 : enabledSocialProviders.length,
|
|
68
|
+
]);
|
|
57
69
|
/**
|
|
58
|
-
* build email
|
|
70
|
+
* build email from project settings design.modal props
|
|
59
71
|
* @returns SdkViewSection[]
|
|
60
72
|
*/
|
|
61
73
|
const getEmailViewSectionDefinition = React.useCallback(() => {
|
|
62
|
-
|
|
63
|
-
|
|
74
|
+
if (!hasEmailProviderEnabled)
|
|
75
|
+
return [];
|
|
76
|
+
return [
|
|
64
77
|
{
|
|
65
78
|
type: sdkApi.SdkViewSectionType.Email,
|
|
66
79
|
},
|
|
67
80
|
];
|
|
68
|
-
|
|
69
|
-
|
|
81
|
+
}, [hasEmailProviderEnabled]);
|
|
82
|
+
/**
|
|
83
|
+
* build social from project settings design.modal props
|
|
84
|
+
* @returns SdkViewSection[]
|
|
85
|
+
*/
|
|
86
|
+
const getSocialViewSectionDefinition = React.useCallback(() => {
|
|
87
|
+
if (!(enabledSocialProviders === null || enabledSocialProviders === void 0 ? void 0 : enabledSocialProviders.length))
|
|
88
|
+
return [];
|
|
89
|
+
return [
|
|
90
|
+
{
|
|
70
91
|
numOfItemsToDisplay: 5,
|
|
71
92
|
type: sdkApi.SdkViewSectionType.Social,
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
93
|
+
},
|
|
94
|
+
];
|
|
95
|
+
}, [enabledSocialProviders === null || enabledSocialProviders === void 0 ? void 0 : enabledSocialProviders.length]);
|
|
96
|
+
const getWalletViewSectionDefinition = React.useCallback(() => {
|
|
97
|
+
var _a, _b;
|
|
98
|
+
if (!(selectableWallets === null || selectableWallets === void 0 ? void 0 : selectableWallets.length))
|
|
99
|
+
return [];
|
|
100
|
+
const numOfItemsToDisplay = ((_b = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design) === null || _a === void 0 ? void 0 : _a.modal) === null || _b === void 0 ? void 0 : _b.showWalletsButton)
|
|
101
|
+
? 0
|
|
102
|
+
: NUMBER_OF_WALLETS;
|
|
103
|
+
return [
|
|
104
|
+
{
|
|
105
|
+
numOfItemsToDisplay,
|
|
106
|
+
type: sdkApi.SdkViewSectionType.Wallet,
|
|
107
|
+
},
|
|
108
|
+
];
|
|
87
109
|
}, [
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
(_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design.modal) === null || _b === void 0 ? void 0 : _b.splitEmailAndSocial,
|
|
91
|
-
t,
|
|
110
|
+
(_e = (_d = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design) === null || _d === void 0 ? void 0 : _d.modal) === null || _e === void 0 ? void 0 : _e.showWalletsButton,
|
|
111
|
+
selectableWallets === null || selectableWallets === void 0 ? void 0 : selectableWallets.length,
|
|
92
112
|
]);
|
|
113
|
+
const applyLoginModalSettings = React.useCallback((emailAndSocialSections) => {
|
|
114
|
+
if (emailAndSocialSections.length < 2) {
|
|
115
|
+
return emailAndSocialSections;
|
|
116
|
+
}
|
|
117
|
+
const { splitEmailAndSocial, socialAboveEmail } = (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design.modal) || {};
|
|
118
|
+
if (splitEmailAndSocial) {
|
|
119
|
+
emailAndSocialSections.splice(1, 0, separator);
|
|
120
|
+
// eslint-disable-next-line prefer-destructuring
|
|
121
|
+
emailAndSocialSections[2].defaultItem = enabledSocialProviders[0];
|
|
122
|
+
}
|
|
123
|
+
if (socialAboveEmail) {
|
|
124
|
+
emailAndSocialSections.reverse();
|
|
125
|
+
}
|
|
126
|
+
return emailAndSocialSections;
|
|
127
|
+
}, [enabledSocialProviders, projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design.modal, separator]);
|
|
93
128
|
// TODO: https://linear.app/dynamic-labs/issue/GVTY-212/rethink-or-implement-toolkit-template-for-email-wallet-order
|
|
94
129
|
/**
|
|
95
130
|
* remove wallet view section from projectSettings?.sdk?.views if no wallet defined
|
|
@@ -102,78 +137,60 @@ const useLoginView = () => {
|
|
|
102
137
|
}
|
|
103
138
|
return sections.filter((section) => section.type !== 'wallet');
|
|
104
139
|
}, [selectableWallets === null || selectableWallets === void 0 ? void 0 : selectableWallets.length]);
|
|
105
|
-
const addSeparator = React.useCallback((index) => {
|
|
106
|
-
// if not the first index, no separator is needed
|
|
107
|
-
// if the first index but does not have wallets or providers,
|
|
108
|
-
// it'll show only one view section - no separator is needed
|
|
109
|
-
if (index !== 0 || !(selectableWallets === null || selectableWallets === void 0 ? void 0 : selectableWallets.length) || !hasEnabledProviders) {
|
|
110
|
-
return [];
|
|
111
|
-
}
|
|
112
|
-
return [
|
|
113
|
-
{
|
|
114
|
-
label: t('dyn_login.separators.default'),
|
|
115
|
-
type: sdkApi.SdkViewSectionType.Separator,
|
|
116
|
-
},
|
|
117
|
-
];
|
|
118
|
-
}, [hasEnabledProviders, selectableWallets === null || selectableWallets === void 0 ? void 0 : selectableWallets.length, t]);
|
|
119
140
|
/**
|
|
120
141
|
* build login view sections array from project settings design.modal props - backwards compatibility
|
|
121
142
|
* @returns SdkViewSection[]
|
|
122
143
|
*/
|
|
123
|
-
const buildLoginSections = React.useCallback(() => {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
if (
|
|
128
|
-
(
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
// add
|
|
132
|
-
|
|
144
|
+
const buildLoginSections = React.useCallback((buildOrder) => {
|
|
145
|
+
const loginViewSections = [];
|
|
146
|
+
buildOrder === null || buildOrder === void 0 ? void 0 : buildOrder.forEach((loginItem) => {
|
|
147
|
+
// Add a separator if there are sections already
|
|
148
|
+
if (loginViewSections.length)
|
|
149
|
+
loginViewSections.push(separator);
|
|
150
|
+
if (loginItem === 'email') {
|
|
151
|
+
// In the past, the email and social sections were combined into one section,
|
|
152
|
+
// so we need to check for that case and add the social section if needed for backwards compatibility
|
|
153
|
+
// if email was just pushed to the loginViewSections array and social is not defined in the buildOrder,
|
|
154
|
+
// then we need to add social (if social is enabled)
|
|
155
|
+
const emailAndSocialSections = [
|
|
156
|
+
...getEmailViewSectionDefinition(),
|
|
157
|
+
...getSocialViewSectionDefinition(),
|
|
158
|
+
];
|
|
159
|
+
loginViewSections.push(...applyLoginModalSettings(emailAndSocialSections));
|
|
133
160
|
}
|
|
134
|
-
if (loginItem === 'wallet'
|
|
135
|
-
|
|
136
|
-
const numOfItemsToDisplay = ((_b = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design) === null || _a === void 0 ? void 0 : _a.modal) === null || _b === void 0 ? void 0 : _b.showWalletsButton)
|
|
137
|
-
? 0
|
|
138
|
-
: NUMBER_OF_WALLETS;
|
|
139
|
-
loginViewSections = loginViewSections.concat([
|
|
140
|
-
{
|
|
141
|
-
numOfItemsToDisplay,
|
|
142
|
-
type: sdkApi.SdkViewSectionType.Wallet,
|
|
143
|
-
},
|
|
144
|
-
],
|
|
145
|
-
// add separator if email providers defined
|
|
146
|
-
addSeparator(index));
|
|
161
|
+
if (loginItem === 'wallet') {
|
|
162
|
+
loginViewSections.push(...getWalletViewSectionDefinition());
|
|
147
163
|
}
|
|
148
164
|
});
|
|
149
165
|
return loginViewSections;
|
|
150
166
|
}, [
|
|
151
|
-
|
|
152
|
-
authorizationViewDisplayOrder,
|
|
167
|
+
applyLoginModalSettings,
|
|
153
168
|
getEmailViewSectionDefinition,
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
169
|
+
getSocialViewSectionDefinition,
|
|
170
|
+
getWalletViewSectionDefinition,
|
|
171
|
+
separator,
|
|
157
172
|
]);
|
|
158
173
|
/**
|
|
159
174
|
* returns the login view sections to be displayed in order from projectSettings?.sdk?.views
|
|
160
175
|
* and has backwards compatibility with project settings design.modal props
|
|
161
176
|
*/
|
|
162
177
|
const logingViewSections = React.useMemo(() => {
|
|
163
|
-
var _a, _b, _c
|
|
178
|
+
var _a, _b, _c;
|
|
164
179
|
const loginView = (_b = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.views) === null || _b === void 0 ? void 0 : _b.find((view) => view.type === sdkApi.SdkViewType.Login);
|
|
165
180
|
if ((_c = loginView === null || loginView === void 0 ? void 0 : loginView.sections) === null || _c === void 0 ? void 0 : _c.length) {
|
|
166
181
|
return filterLoginViewSections(loginView === null || loginView === void 0 ? void 0 : loginView.sections);
|
|
167
182
|
}
|
|
168
|
-
|
|
169
|
-
|
|
183
|
+
let viewOrder = authorizationViewDisplayOrder;
|
|
184
|
+
if (isEmailOnly) {
|
|
185
|
+
viewOrder = ['email'];
|
|
170
186
|
}
|
|
171
|
-
return buildLoginSections();
|
|
187
|
+
return buildLoginSections(viewOrder);
|
|
172
188
|
}, [
|
|
173
|
-
projectSettings,
|
|
174
|
-
|
|
175
|
-
|
|
189
|
+
(_f = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _f === void 0 ? void 0 : _f.views,
|
|
190
|
+
authorizationViewDisplayOrder,
|
|
191
|
+
isEmailOnly,
|
|
176
192
|
buildLoginSections,
|
|
193
|
+
filterLoginViewSections,
|
|
177
194
|
]);
|
|
178
195
|
return {
|
|
179
196
|
isWalletOnly,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMemo, useCallback } from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import {
|
|
3
|
+
import { SdkViewSectionType, SdkViewType } from '@dynamic-labs/sdk-api';
|
|
4
4
|
import { useInternalDynamicContext } from '../../context/DynamicContext/useInternalDynamicContext.js';
|
|
5
5
|
import { useSocialRedirectContext } from '../../context/SocialRedirectContext/SocialRedirectContext.js';
|
|
6
6
|
import '../../shared/logger.js';
|
|
@@ -16,14 +16,19 @@ import '@dynamic-labs/utils';
|
|
|
16
16
|
import '../../shared/consts/index.js';
|
|
17
17
|
import '@dynamic-labs/multi-wallet';
|
|
18
18
|
import { isEmailProviderEnabled } from '../../utils/functions/isEmailProviderEnabled/isEmailProviderEnabled.js';
|
|
19
|
-
import { getEnabledProviders } from '../../utils/functions/getEnabledProviders/index.js';
|
|
20
19
|
|
|
21
20
|
/* eslint-disable multiline-comment-style */
|
|
22
21
|
const NUMBER_OF_WALLETS = 3;
|
|
23
22
|
const useLoginView = () => {
|
|
24
|
-
var _a, _b, _c, _d;
|
|
23
|
+
var _a, _b, _c, _d, _e, _f;
|
|
25
24
|
const { projectSettings, authorizationViewDisplayOrder, loginWithEmail, wallets, walletsFilter, } = useInternalDynamicContext();
|
|
25
|
+
const { t } = useTranslation();
|
|
26
26
|
const { enabledSocialProviders } = useSocialRedirectContext();
|
|
27
|
+
const hasSocialProvidersEnabled = Boolean(enabledSocialProviders === null || enabledSocialProviders === void 0 ? void 0 : enabledSocialProviders.length);
|
|
28
|
+
const hasEmailProviderEnabled = ((_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) === null || _a === void 0 ? void 0 : _a.length) &&
|
|
29
|
+
isEmailProviderEnabled(projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers);
|
|
30
|
+
// is email only is set in the project settings when the "Email (Web2) only" is toggled on in the dashboard
|
|
31
|
+
const isEmailOnly = (_c = (_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design) === null || _b === void 0 ? void 0 : _b.modal) === null || _c === void 0 ? void 0 : _c.emailOnly;
|
|
27
32
|
/** Takes from wallets only those that can be selected in the wallet list by the user.
|
|
28
33
|
* Should filter out embedded wallets
|
|
29
34
|
* WHY: when we decide whether to show wallets or not, we need to know how many wallets
|
|
@@ -31,61 +36,91 @@ const useLoginView = () => {
|
|
|
31
36
|
* wallets and then display an empty wallet list (since turnkey doesn't render)
|
|
32
37
|
*/
|
|
33
38
|
const selectableWallets = (walletsFilter ? walletsFilter(wallets) : wallets).filter(({ key }) => key !== 'turnkey');
|
|
34
|
-
const
|
|
35
|
-
|
|
39
|
+
const separator = useMemo(() => ({
|
|
40
|
+
label: t('dyn_login.separators.default'),
|
|
41
|
+
type: SdkViewSectionType.Separator,
|
|
42
|
+
}), [t]);
|
|
36
43
|
const isWalletOnly = useMemo(() => {
|
|
37
|
-
var _a, _b, _c
|
|
44
|
+
var _a, _b, _c;
|
|
38
45
|
if (!projectSettings) {
|
|
39
46
|
return false;
|
|
40
47
|
}
|
|
41
|
-
//
|
|
42
|
-
if (!loginWithEmail) {
|
|
48
|
+
// if both loginWithEmail AND hasSocialProvidersEnabled are false, it's wallet only
|
|
49
|
+
if (!loginWithEmail && !hasSocialProvidersEnabled) {
|
|
43
50
|
return true;
|
|
44
51
|
}
|
|
45
52
|
const loginView = (_b = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.views) === null || _b === void 0 ? void 0 : _b.find((view) => view.type === SdkViewType.Login);
|
|
46
|
-
// backwards compatibility for those that didn't set up login view
|
|
53
|
+
// backwards compatibility for those that didn't set up login view sections
|
|
47
54
|
if (!((_c = loginView === null || loginView === void 0 ? void 0 : loginView.sections) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
48
|
-
return
|
|
49
|
-
!isEmailProviderEnabled(projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers));
|
|
55
|
+
return !hasEmailProviderEnabled && !hasSocialProvidersEnabled;
|
|
50
56
|
}
|
|
51
57
|
return (loginView.sections.length === 1 && loginView.sections[0].type === 'wallet');
|
|
52
|
-
}, [
|
|
58
|
+
}, [
|
|
59
|
+
projectSettings,
|
|
60
|
+
loginWithEmail,
|
|
61
|
+
hasSocialProvidersEnabled,
|
|
62
|
+
hasEmailProviderEnabled,
|
|
63
|
+
enabledSocialProviders === null || enabledSocialProviders === void 0 ? void 0 : enabledSocialProviders.length,
|
|
64
|
+
]);
|
|
53
65
|
/**
|
|
54
|
-
* build email
|
|
66
|
+
* build email from project settings design.modal props
|
|
55
67
|
* @returns SdkViewSection[]
|
|
56
68
|
*/
|
|
57
69
|
const getEmailViewSectionDefinition = useCallback(() => {
|
|
58
|
-
|
|
59
|
-
|
|
70
|
+
if (!hasEmailProviderEnabled)
|
|
71
|
+
return [];
|
|
72
|
+
return [
|
|
60
73
|
{
|
|
61
74
|
type: SdkViewSectionType.Email,
|
|
62
75
|
},
|
|
63
76
|
];
|
|
64
|
-
|
|
65
|
-
|
|
77
|
+
}, [hasEmailProviderEnabled]);
|
|
78
|
+
/**
|
|
79
|
+
* build social from project settings design.modal props
|
|
80
|
+
* @returns SdkViewSection[]
|
|
81
|
+
*/
|
|
82
|
+
const getSocialViewSectionDefinition = useCallback(() => {
|
|
83
|
+
if (!(enabledSocialProviders === null || enabledSocialProviders === void 0 ? void 0 : enabledSocialProviders.length))
|
|
84
|
+
return [];
|
|
85
|
+
return [
|
|
86
|
+
{
|
|
66
87
|
numOfItemsToDisplay: 5,
|
|
67
88
|
type: SdkViewSectionType.Social,
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
89
|
+
},
|
|
90
|
+
];
|
|
91
|
+
}, [enabledSocialProviders === null || enabledSocialProviders === void 0 ? void 0 : enabledSocialProviders.length]);
|
|
92
|
+
const getWalletViewSectionDefinition = useCallback(() => {
|
|
93
|
+
var _a, _b;
|
|
94
|
+
if (!(selectableWallets === null || selectableWallets === void 0 ? void 0 : selectableWallets.length))
|
|
95
|
+
return [];
|
|
96
|
+
const numOfItemsToDisplay = ((_b = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design) === null || _a === void 0 ? void 0 : _a.modal) === null || _b === void 0 ? void 0 : _b.showWalletsButton)
|
|
97
|
+
? 0
|
|
98
|
+
: NUMBER_OF_WALLETS;
|
|
99
|
+
return [
|
|
100
|
+
{
|
|
101
|
+
numOfItemsToDisplay,
|
|
102
|
+
type: SdkViewSectionType.Wallet,
|
|
103
|
+
},
|
|
104
|
+
];
|
|
83
105
|
}, [
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
(_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design.modal) === null || _b === void 0 ? void 0 : _b.splitEmailAndSocial,
|
|
87
|
-
t,
|
|
106
|
+
(_e = (_d = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design) === null || _d === void 0 ? void 0 : _d.modal) === null || _e === void 0 ? void 0 : _e.showWalletsButton,
|
|
107
|
+
selectableWallets === null || selectableWallets === void 0 ? void 0 : selectableWallets.length,
|
|
88
108
|
]);
|
|
109
|
+
const applyLoginModalSettings = useCallback((emailAndSocialSections) => {
|
|
110
|
+
if (emailAndSocialSections.length < 2) {
|
|
111
|
+
return emailAndSocialSections;
|
|
112
|
+
}
|
|
113
|
+
const { splitEmailAndSocial, socialAboveEmail } = (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design.modal) || {};
|
|
114
|
+
if (splitEmailAndSocial) {
|
|
115
|
+
emailAndSocialSections.splice(1, 0, separator);
|
|
116
|
+
// eslint-disable-next-line prefer-destructuring
|
|
117
|
+
emailAndSocialSections[2].defaultItem = enabledSocialProviders[0];
|
|
118
|
+
}
|
|
119
|
+
if (socialAboveEmail) {
|
|
120
|
+
emailAndSocialSections.reverse();
|
|
121
|
+
}
|
|
122
|
+
return emailAndSocialSections;
|
|
123
|
+
}, [enabledSocialProviders, projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design.modal, separator]);
|
|
89
124
|
// TODO: https://linear.app/dynamic-labs/issue/GVTY-212/rethink-or-implement-toolkit-template-for-email-wallet-order
|
|
90
125
|
/**
|
|
91
126
|
* remove wallet view section from projectSettings?.sdk?.views if no wallet defined
|
|
@@ -98,78 +133,60 @@ const useLoginView = () => {
|
|
|
98
133
|
}
|
|
99
134
|
return sections.filter((section) => section.type !== 'wallet');
|
|
100
135
|
}, [selectableWallets === null || selectableWallets === void 0 ? void 0 : selectableWallets.length]);
|
|
101
|
-
const addSeparator = useCallback((index) => {
|
|
102
|
-
// if not the first index, no separator is needed
|
|
103
|
-
// if the first index but does not have wallets or providers,
|
|
104
|
-
// it'll show only one view section - no separator is needed
|
|
105
|
-
if (index !== 0 || !(selectableWallets === null || selectableWallets === void 0 ? void 0 : selectableWallets.length) || !hasEnabledProviders) {
|
|
106
|
-
return [];
|
|
107
|
-
}
|
|
108
|
-
return [
|
|
109
|
-
{
|
|
110
|
-
label: t('dyn_login.separators.default'),
|
|
111
|
-
type: SdkViewSectionType.Separator,
|
|
112
|
-
},
|
|
113
|
-
];
|
|
114
|
-
}, [hasEnabledProviders, selectableWallets === null || selectableWallets === void 0 ? void 0 : selectableWallets.length, t]);
|
|
115
136
|
/**
|
|
116
137
|
* build login view sections array from project settings design.modal props - backwards compatibility
|
|
117
138
|
* @returns SdkViewSection[]
|
|
118
139
|
*/
|
|
119
|
-
const buildLoginSections = useCallback(() => {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
if (
|
|
124
|
-
(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
// add
|
|
128
|
-
|
|
140
|
+
const buildLoginSections = useCallback((buildOrder) => {
|
|
141
|
+
const loginViewSections = [];
|
|
142
|
+
buildOrder === null || buildOrder === void 0 ? void 0 : buildOrder.forEach((loginItem) => {
|
|
143
|
+
// Add a separator if there are sections already
|
|
144
|
+
if (loginViewSections.length)
|
|
145
|
+
loginViewSections.push(separator);
|
|
146
|
+
if (loginItem === 'email') {
|
|
147
|
+
// In the past, the email and social sections were combined into one section,
|
|
148
|
+
// so we need to check for that case and add the social section if needed for backwards compatibility
|
|
149
|
+
// if email was just pushed to the loginViewSections array and social is not defined in the buildOrder,
|
|
150
|
+
// then we need to add social (if social is enabled)
|
|
151
|
+
const emailAndSocialSections = [
|
|
152
|
+
...getEmailViewSectionDefinition(),
|
|
153
|
+
...getSocialViewSectionDefinition(),
|
|
154
|
+
];
|
|
155
|
+
loginViewSections.push(...applyLoginModalSettings(emailAndSocialSections));
|
|
129
156
|
}
|
|
130
|
-
if (loginItem === 'wallet'
|
|
131
|
-
|
|
132
|
-
const numOfItemsToDisplay = ((_b = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design) === null || _a === void 0 ? void 0 : _a.modal) === null || _b === void 0 ? void 0 : _b.showWalletsButton)
|
|
133
|
-
? 0
|
|
134
|
-
: NUMBER_OF_WALLETS;
|
|
135
|
-
loginViewSections = loginViewSections.concat([
|
|
136
|
-
{
|
|
137
|
-
numOfItemsToDisplay,
|
|
138
|
-
type: SdkViewSectionType.Wallet,
|
|
139
|
-
},
|
|
140
|
-
],
|
|
141
|
-
// add separator if email providers defined
|
|
142
|
-
addSeparator(index));
|
|
157
|
+
if (loginItem === 'wallet') {
|
|
158
|
+
loginViewSections.push(...getWalletViewSectionDefinition());
|
|
143
159
|
}
|
|
144
160
|
});
|
|
145
161
|
return loginViewSections;
|
|
146
162
|
}, [
|
|
147
|
-
|
|
148
|
-
authorizationViewDisplayOrder,
|
|
163
|
+
applyLoginModalSettings,
|
|
149
164
|
getEmailViewSectionDefinition,
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
165
|
+
getSocialViewSectionDefinition,
|
|
166
|
+
getWalletViewSectionDefinition,
|
|
167
|
+
separator,
|
|
153
168
|
]);
|
|
154
169
|
/**
|
|
155
170
|
* returns the login view sections to be displayed in order from projectSettings?.sdk?.views
|
|
156
171
|
* and has backwards compatibility with project settings design.modal props
|
|
157
172
|
*/
|
|
158
173
|
const logingViewSections = useMemo(() => {
|
|
159
|
-
var _a, _b, _c
|
|
174
|
+
var _a, _b, _c;
|
|
160
175
|
const loginView = (_b = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _a === void 0 ? void 0 : _a.views) === null || _b === void 0 ? void 0 : _b.find((view) => view.type === SdkViewType.Login);
|
|
161
176
|
if ((_c = loginView === null || loginView === void 0 ? void 0 : loginView.sections) === null || _c === void 0 ? void 0 : _c.length) {
|
|
162
177
|
return filterLoginViewSections(loginView === null || loginView === void 0 ? void 0 : loginView.sections);
|
|
163
178
|
}
|
|
164
|
-
|
|
165
|
-
|
|
179
|
+
let viewOrder = authorizationViewDisplayOrder;
|
|
180
|
+
if (isEmailOnly) {
|
|
181
|
+
viewOrder = ['email'];
|
|
166
182
|
}
|
|
167
|
-
return buildLoginSections();
|
|
183
|
+
return buildLoginSections(viewOrder);
|
|
168
184
|
}, [
|
|
169
|
-
projectSettings,
|
|
170
|
-
|
|
171
|
-
|
|
185
|
+
(_f = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _f === void 0 ? void 0 : _f.views,
|
|
186
|
+
authorizationViewDisplayOrder,
|
|
187
|
+
isEmailOnly,
|
|
172
188
|
buildLoginSections,
|
|
189
|
+
filterLoginViewSections,
|
|
173
190
|
]);
|
|
174
191
|
return {
|
|
175
192
|
isWalletOnly,
|
|
@@ -49,6 +49,7 @@ require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
|
49
49
|
var EmailVerificationContext = require('../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
50
50
|
require('qrcode');
|
|
51
51
|
require('../../context/LoadingContext/LoadingContext.cjs');
|
|
52
|
+
require('i18next');
|
|
52
53
|
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
53
54
|
require('yup');
|
|
54
55
|
require('../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
@@ -59,6 +60,7 @@ require('formik');
|
|
|
59
60
|
var Button = require('../../components/Button/Button.cjs');
|
|
60
61
|
require('../../components/IconButton/IconButton.cjs');
|
|
61
62
|
require('../../components/Alert/Alert.cjs');
|
|
63
|
+
require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
62
64
|
var shortenEmail = require('../../shared/utils/functions/shortenEmail/shortenEmail.cjs');
|
|
63
65
|
require('../../components/Popper/Popper/Popper.cjs');
|
|
64
66
|
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
@@ -45,6 +45,7 @@ import '../../context/CaptchaContext/CaptchaContext.js';
|
|
|
45
45
|
import { useEmailVerificationContext } from '../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
46
46
|
import 'qrcode';
|
|
47
47
|
import '../../context/LoadingContext/LoadingContext.js';
|
|
48
|
+
import 'i18next';
|
|
48
49
|
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
49
50
|
import 'yup';
|
|
50
51
|
import '../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
@@ -55,6 +56,7 @@ import 'formik';
|
|
|
55
56
|
import { Button } from '../../components/Button/Button.js';
|
|
56
57
|
import '../../components/IconButton/IconButton.js';
|
|
57
58
|
import '../../components/Alert/Alert.js';
|
|
59
|
+
import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
58
60
|
import { shortenEmail } from '../../shared/utils/functions/shortenEmail/shortenEmail.js';
|
|
59
61
|
import '../../components/Popper/Popper/Popper.js';
|
|
60
62
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
@@ -47,6 +47,7 @@ require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
|
47
47
|
require('../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
48
48
|
require('qrcode');
|
|
49
49
|
require('../../context/LoadingContext/LoadingContext.cjs');
|
|
50
|
+
require('i18next');
|
|
50
51
|
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
51
52
|
require('yup');
|
|
52
53
|
var ErrorContainer = require('../../components/ErrorContainer/ErrorContainer.cjs');
|
|
@@ -57,6 +58,7 @@ require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
|
57
58
|
require('formik');
|
|
58
59
|
require('../../components/IconButton/IconButton.cjs');
|
|
59
60
|
require('../../components/Alert/Alert.cjs');
|
|
61
|
+
require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
60
62
|
require('../../components/Popper/Popper/Popper.cjs');
|
|
61
63
|
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
62
64
|
require('../../components/InlineWidget/InlineWidget.cjs');
|
|
@@ -43,6 +43,7 @@ import '../../context/CaptchaContext/CaptchaContext.js';
|
|
|
43
43
|
import '../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
44
44
|
import 'qrcode';
|
|
45
45
|
import '../../context/LoadingContext/LoadingContext.js';
|
|
46
|
+
import 'i18next';
|
|
46
47
|
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
47
48
|
import 'yup';
|
|
48
49
|
import { ErrorContainer } from '../../components/ErrorContainer/ErrorContainer.js';
|
|
@@ -53,6 +54,7 @@ import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
|
53
54
|
import 'formik';
|
|
54
55
|
import '../../components/IconButton/IconButton.js';
|
|
55
56
|
import '../../components/Alert/Alert.js';
|
|
57
|
+
import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
56
58
|
import '../../components/Popper/Popper/Popper.js';
|
|
57
59
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
58
60
|
import '../../components/InlineWidget/InlineWidget.js';
|
|
@@ -48,6 +48,7 @@ require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
|
48
48
|
require('../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
49
49
|
require('qrcode');
|
|
50
50
|
require('../../context/LoadingContext/LoadingContext.cjs');
|
|
51
|
+
require('i18next');
|
|
51
52
|
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
52
53
|
require('yup');
|
|
53
54
|
require('../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
@@ -57,6 +58,7 @@ require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
|
57
58
|
require('formik');
|
|
58
59
|
require('../../components/IconButton/IconButton.cjs');
|
|
59
60
|
require('../../components/Alert/Alert.cjs');
|
|
61
|
+
require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
60
62
|
require('../../components/Popper/Popper/Popper.cjs');
|
|
61
63
|
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
62
64
|
require('../../components/InlineWidget/InlineWidget.cjs');
|
|
@@ -44,6 +44,7 @@ import '../../context/CaptchaContext/CaptchaContext.js';
|
|
|
44
44
|
import '../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
45
45
|
import 'qrcode';
|
|
46
46
|
import '../../context/LoadingContext/LoadingContext.js';
|
|
47
|
+
import 'i18next';
|
|
47
48
|
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
48
49
|
import 'yup';
|
|
49
50
|
import '../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
@@ -53,6 +54,7 @@ import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
|
53
54
|
import 'formik';
|
|
54
55
|
import '../../components/IconButton/IconButton.js';
|
|
55
56
|
import '../../components/Alert/Alert.js';
|
|
57
|
+
import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
56
58
|
import '../../components/Popper/Popper/Popper.js';
|
|
57
59
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
58
60
|
import '../../components/InlineWidget/InlineWidget.js';
|