@dynamic-labs/sdk-react-core 0.18.0-RC.21 → 0.18.0-RC.23
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 +16 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +8 -8
- package/src/index.cjs +3 -0
- package/src/index.d.ts +2 -1
- package/src/index.js +2 -0
- package/src/lib/Main.cjs +3 -0
- package/src/lib/Main.js +3 -0
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.cjs +1 -0
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.js +1 -0
- package/src/lib/components/AnimatePresence/AnimatePresence.cjs +1 -0
- package/src/lib/components/AnimatePresence/AnimatePresence.js +1 -0
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.cjs +1 -0
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.js +1 -0
- package/src/lib/components/Divider/Divider.cjs +1 -0
- package/src/lib/components/Divider/Divider.js +1 -0
- package/src/lib/components/MenuList/Dropdown/Dropdown.cjs +1 -0
- package/src/lib/components/MenuList/Dropdown/Dropdown.js +1 -0
- package/src/lib/components/Modal/Modal.cjs +1 -0
- package/src/lib/components/Modal/Modal.js +1 -0
- package/src/lib/components/NetworkPicker/NetworkPicker.cjs +1 -0
- package/src/lib/components/NetworkPicker/NetworkPicker.js +1 -0
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.cjs +1 -0
- package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.js +1 -0
- package/src/lib/components/NetworkPicker/components/Network/Network.cjs +1 -0
- package/src/lib/components/NetworkPicker/components/Network/Network.js +1 -0
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.cjs +1 -0
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.js +1 -0
- package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +1 -0
- package/src/lib/components/OTPVerificationView/OTPVerificationView.js +1 -0
- package/src/lib/components/OverlayCard/OverlayCard.cjs +1 -0
- package/src/lib/components/OverlayCard/OverlayCard.js +1 -0
- package/src/lib/components/Popper/PopperContext/PopperContext.js +1 -1
- package/src/lib/components/Portal/Portal.cjs +1 -0
- package/src/lib/components/Portal/Portal.js +1 -0
- package/src/lib/components/Tooltip/Tooltip.cjs +1 -0
- package/src/lib/components/Tooltip/Tooltip.js +1 -0
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.cjs +1 -0
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.js +1 -0
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.cjs +1 -0
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.js +1 -0
- package/src/lib/components/UserAddress/UserAddress.cjs +1 -0
- package/src/lib/components/UserAddress/UserAddress.js +1 -0
- package/src/lib/components/UserProfile/UserProfile.cjs +6 -14
- package/src/lib/components/UserProfile/UserProfile.js +6 -14
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.cjs +1 -0
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.js +1 -0
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.cjs +1 -0
- package/src/lib/components/UserProfile/parts/UserProfileSection/UserProfileSection.js +1 -0
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +13 -64
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.d.ts +2 -4
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +13 -64
- package/src/lib/context/AccountExistsContext/AccountExistsContext.cjs +27 -0
- package/src/lib/context/AccountExistsContext/AccountExistsContext.d.ts +17 -0
- package/src/lib/context/AccountExistsContext/AccountExistsContext.js +21 -0
- package/src/lib/context/AccountExistsContext/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +2 -1
- package/src/lib/context/DynamicContext/DynamicContext.js +2 -1
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.cjs +1 -0
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.js +1 -0
- package/src/lib/context/MockContext/MockContext.cjs +36 -2
- package/src/lib/context/MockContext/MockContext.d.ts +1 -1
- package/src/lib/context/MockContext/MockContext.js +36 -2
- package/src/lib/context/MockContext/constants/index.cjs +64 -0
- package/src/lib/context/MockContext/constants/index.d.ts +2 -0
- package/src/lib/context/MockContext/constants/index.js +60 -0
- package/src/lib/context/QrCodeContext/QrCodeContext.cjs +1 -0
- package/src/lib/context/QrCodeContext/QrCodeContext.js +1 -0
- package/src/lib/context/SendBalanceContext/SendBalanceContext.cjs +1 -0
- package/src/lib/context/SendBalanceContext/SendBalanceContext.js +1 -0
- package/src/lib/context/ViewContext/ViewContext.d.ts +1 -1
- package/src/lib/context/WalletContext/WalletContext.cjs +1 -0
- package/src/lib/context/WalletContext/WalletContext.js +1 -0
- package/src/lib/data/api.cjs +6 -0
- package/src/lib/data/api.js +7 -1
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.cjs +1 -0
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.js +1 -0
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +3 -0
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +3 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpHeader/HelpHeader.cjs +1 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpHeader/HelpHeader.js +1 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/Item/Item.cjs +1 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/Item/Item.js +1 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.cjs +1 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletExtensionOrAppContinueButton/WalletExtensionOrAppContinueButton.js +1 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletListHelpContent.cjs +1 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletListHelpContent/WalletListHelpContent.js +1 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletMoreInfoContent/WalletMoreInfoContent.cjs +1 -0
- package/src/lib/layout/DynamicAuthLayout/HelpContent/WalletMoreInfoContent/WalletMoreInfoContent.js +1 -0
- package/src/lib/layout/DynamicAuthLayout/ToSFooter/ToSFooter.cjs +1 -0
- package/src/lib/layout/DynamicAuthLayout/ToSFooter/ToSFooter.js +1 -0
- package/src/lib/layout/DynamicAuthLayout/WalletProgressStepper/WalletProgressStepper.cjs +1 -0
- package/src/lib/layout/DynamicAuthLayout/WalletProgressStepper/WalletProgressStepper.js +1 -0
- package/src/lib/layouts/BridgeNextWalletToConnectLayout/BridgeNextWalletToConnectLayout.cjs +1 -0
- package/src/lib/layouts/BridgeNextWalletToConnectLayout/BridgeNextWalletToConnectLayout.js +1 -0
- package/src/lib/layouts/BridgeWelcomeLayout/BridgeWelcomeLayout.cjs +1 -0
- package/src/lib/layouts/BridgeWelcomeLayout/BridgeWelcomeLayout.js +1 -0
- package/src/lib/layouts/ConnectedWalletsListLayout/ConnectedWalletsListLayout.cjs +1 -0
- package/src/lib/layouts/ConnectedWalletsListLayout/ConnectedWalletsListLayout.js +1 -0
- package/src/lib/modals/SendBalanceModal/SendBalanceModal.cjs +1 -0
- package/src/lib/modals/SendBalanceModal/SendBalanceModal.js +1 -0
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +1 -0
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +1 -0
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +1 -0
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +1 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/getDynamicLayoutData/getDynamicLayoutData.cjs +1 -0
- package/src/lib/utils/functions/getDynamicLayoutData/getDynamicLayoutData.js +1 -0
- package/src/lib/utils/functions/index.d.ts +1 -0
- package/src/lib/utils/functions/isSocialKycEnabled/index.d.ts +1 -0
- package/src/lib/utils/functions/isSocialKycEnabled/isSocialKycEnabled.cjs +7 -0
- package/src/lib/utils/functions/isSocialKycEnabled/isSocialKycEnabled.d.ts +2 -0
- package/src/lib/utils/functions/isSocialKycEnabled/isSocialKycEnabled.js +3 -0
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs +7 -1
- package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js +7 -1
- package/src/lib/utils/hooks/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.cjs +1 -0
- package/src/lib/utils/hooks/multiWallet/useVerifyOnAwaitingSignature/useVerifyOnAwaitingSignature.js +1 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +2 -1
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +2 -1
- package/src/lib/utils/hooks/useAuthenticateConnectedUser/useAuthenticateConnectedUser.cjs +1 -0
- package/src/lib/utils/hooks/useAuthenticateConnectedUser/useAuthenticateConnectedUser.js +1 -0
- package/src/lib/utils/hooks/useKYCFlag/useKYCFlag.cjs +17 -2
- package/src/lib/utils/hooks/useKYCFlag/useKYCFlag.js +17 -2
- package/src/lib/utils/hooks/useSocialAccounts/index.d.ts +1 -0
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.cjs +159 -0
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.d.ts +10 -0
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.js +155 -0
- package/src/lib/utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs +9 -0
- package/src/lib/utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js +10 -1
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +7 -0
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +8 -1
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs +1 -0
- package/src/lib/utils/hooks/useWalletItemActions/useWalletItemActions.js +1 -0
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +1 -0
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +1 -0
- package/src/lib/views/AccountExistsView/AccountExistsView.cjs +73 -0
- package/src/lib/views/AccountExistsView/AccountExistsView.d.ts +2 -0
- package/src/lib/views/AccountExistsView/AccountExistsView.js +69 -0
- package/src/lib/views/AccountExistsView/index.d.ts +1 -0
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +1 -0
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +1 -0
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.cjs +1 -0
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.js +1 -0
- package/src/lib/views/CollectUserDataView/UserDataFields/index.cjs +1 -0
- package/src/lib/views/CollectUserDataView/UserDataFields/index.js +1 -0
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.cjs +1 -0
- package/src/lib/views/CollectUserDataViewLoginWithEmail/CollectUserDataViewLoginWithEmail.js +1 -0
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.cjs +1 -0
- package/src/lib/views/EmailConfirmationWaitingView/EmailConfirmationWaitingView.js +1 -0
- package/src/lib/views/EmailUpdate/EmailUpdate.cjs +1 -0
- package/src/lib/views/EmailUpdate/EmailUpdate.js +1 -0
- package/src/lib/views/EmailVerification/EmailVerification.cjs +7 -0
- package/src/lib/views/EmailVerification/EmailVerification.js +8 -1
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +1 -0
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +1 -0
- package/src/lib/views/LoginWithEmailView/components/ListItemButton/ListItemButton.cjs +1 -0
- package/src/lib/views/LoginWithEmailView/components/ListItemButton/ListItemButton.js +1 -0
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.cjs +1 -0
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.js +1 -0
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.cjs +1 -0
- package/src/lib/views/LoginWithEmailView/components/SocialSignIn/SocialSignIn.js +1 -0
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +1 -0
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +1 -0
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +1 -0
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +1 -0
- package/src/lib/views/NoAccess/NoAccess.cjs +1 -0
- package/src/lib/views/NoAccess/NoAccess.js +1 -0
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.cjs +1 -0
- package/src/lib/views/NoQrNotInstalledView/NoQrNotInstalledView.js +1 -0
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.cjs +1 -0
- package/src/lib/views/NoQrNotInstalledView/WalletHelpLink.js +1 -0
- package/src/lib/views/PendingConnectView/PendingConnectView.cjs +1 -0
- package/src/lib/views/PendingConnectView/PendingConnectView.js +1 -0
- package/src/lib/views/PendingSignatureView/PendingSignatureView.cjs +1 -0
- package/src/lib/views/PendingSignatureView/PendingSignatureView.js +1 -0
- package/src/lib/views/QrCodeView/QRCode.cjs +1 -0
- package/src/lib/views/QrCodeView/QRCode.js +1 -0
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.cjs +1 -0
- package/src/lib/views/QrCodeView/QrCodeContainer/QrCodeContainer.js +1 -0
- package/src/lib/views/QrCodeView/QrCodeView.cjs +1 -0
- package/src/lib/views/QrCodeView/QrCodeView.js +1 -0
- package/src/lib/views/SendBalanceView/SendBalanceView.cjs +1 -0
- package/src/lib/views/SendBalanceView/SendBalanceView.js +1 -0
- package/src/lib/views/SocialRedirectView/SocialRedirectView.cjs +1 -0
- package/src/lib/views/SocialRedirectView/SocialRedirectView.js +1 -0
- package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.cjs +1 -0
- package/src/lib/views/SocialWrongAccountView/SocialWrongAccountView.js +1 -0
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +1 -0
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +1 -0
- package/src/lib/views/TransactionConfirmationView/hooks/useTransactionData/useTransactionData.cjs +1 -0
- package/src/lib/views/TransactionConfirmationView/hooks/useTransactionData/useTransactionData.js +1 -0
- package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.cjs +1 -0
- package/src/lib/views/WalletList/SearchNotFoundMessage/SearchNotFoundMessage.js +1 -0
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +1 -0
- package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +1 -0
- package/src/lib/views/WalletLockedView/WalletLockedView.cjs +1 -0
- package/src/lib/views/WalletLockedView/WalletLockedView.js +1 -0
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.cjs +1 -0
- package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.js +1 -0
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +1 -0
- package/src/lib/views/WalletUsedView/WalletUsedView.js +1 -0
- package/src/lib/views/viewToComponentMap.cjs +2 -0
- package/src/lib/views/viewToComponentMap.js +2 -0
- package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.cjs +1 -0
- package/src/lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.js +1 -0
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeUserProfile/DynamicBridgeUserProfile.cjs +1 -0
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeUserProfile/DynamicBridgeUserProfile.js +1 -0
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCard/DynamicBridgeWalletCard.cjs +1 -0
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCard/DynamicBridgeWalletCard.js +1 -0
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.cjs +1 -0
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.js +1 -0
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWidgetEmptyCard/DynamicBridgeWidgetEmptyCard.cjs +1 -0
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWidgetEmptyCard/DynamicBridgeWidgetEmptyCard.js +1 -0
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.cjs +1 -0
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.js +1 -0
- package/src/lib/widgets/DynamicWidget/DynamicWidget.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/DynamicWidget.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/AccountControl/AccountControl.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +1 -0
- 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 +1 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenu/DotsMenu.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/DotsMenuDropdown/DotsMenuDropdown.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetModal/DynamicWidgetModal.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/EmailConnectorPendingSignModalContent/EmailConnectorPendingSignModalContent.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/EmptyWallets/EmptyWallets.js +1 -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 +1 -0
- package/src/lib/widgets/DynamicWidget/components/WidgetPortal/WidgetPortal.js +1 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/DefaultPromptModal/DefaultPromptModal.js +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/DetectedNewWalletModal/DetectedNewWalletModal.js +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.js +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchAccountView/SwitchAccountView.js +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchModal/SwitchOrUseActiveAccountView/SwitchOrUseActiveAccountView.js +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingAccountSwitchToLinkModal/PendingAccountSwitchToLinkModal.js +1 -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 +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PendingSignModal/DefaultPendingSignModalContent/DefaultPendingSignModalContent.js +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.js +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/QrCodeModalView/QrCodeModalView.js +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/UnlinkWalletPopUp/UnlinkWalletPopUp.js +1 -0
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.js +1 -0
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/views/ProfileView/ProfileView.js +1 -0
- package/src/lib/widgets/DynamicWidget/views/WalletsView/WalletsView.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/views/WalletsView/WalletsView.js +1 -0
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.cjs +1 -0
- package/src/lib/widgets/FundingWidget/views/FundWalletView/FundWalletView.js +1 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
2
|
import { fieldsConfig } from '../../views/CollectUserDataView/fieldsConfig.js';
|
|
4
3
|
import '@dynamic-labs/sdk-api';
|
|
5
4
|
import '../../shared/logger.js';
|
|
6
5
|
import '@dynamic-labs/iconic';
|
|
7
6
|
import '@dynamic-labs/wallet-connector-core';
|
|
8
7
|
import '../../context/ViewContext/ViewContext.js';
|
|
8
|
+
import 'react';
|
|
9
9
|
import '@dynamic-labs/wallet-book';
|
|
10
10
|
import { getValueByKey } from '../../shared/utils/functions/getValueByKey/index.js';
|
|
11
11
|
import '@dynamic-labs/utils';
|
|
@@ -17,6 +17,7 @@ import { classNames } from '../../utils/functions/classNames/classNames.js';
|
|
|
17
17
|
import { useInternalDynamicContext } from '../../context/DynamicContext/useInternalDynamicContext.js';
|
|
18
18
|
import '@dynamic-labs/multi-wallet';
|
|
19
19
|
import { getEnabledOAuthProviders } from '../../utils/functions/getEnabledOAuthProviders/index.js';
|
|
20
|
+
import { isSocialKycEnabled } from '../../utils/functions/isSocialKycEnabled/isSocialKycEnabled.js';
|
|
20
21
|
import { getUserProfileFields } from '../../utils/functions/getUserProfileFields/getUserProfileFields.js';
|
|
21
22
|
import { UserProfileField } from './parts/UserProfileField/UserProfileField.js';
|
|
22
23
|
import { UserProfileSection } from './parts/UserProfileSection/UserProfileSection.js';
|
|
@@ -28,18 +29,9 @@ const UserProfile = ({ rootClassName }) => {
|
|
|
28
29
|
projectSettingsKyc: projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.kyc,
|
|
29
30
|
user,
|
|
30
31
|
});
|
|
31
|
-
const providers =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const verifiedOAuthCredential = (_b = (_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.filter((credential) => credential.format === 'oauth')) !== null && _b !== void 0 ? _b : [];
|
|
35
|
-
return Object.fromEntries(new Map(verifiedOAuthCredential.map((credential) => {
|
|
36
|
-
var _a;
|
|
37
|
-
return [
|
|
38
|
-
(_a = credential.oauthProvider) !== null && _a !== void 0 ? _a : credential.id,
|
|
39
|
-
credential,
|
|
40
|
-
];
|
|
41
|
-
})));
|
|
42
|
-
}, [user === null || user === void 0 ? void 0 : user.verifiedCredentials]);
|
|
32
|
+
const providers = isSocialKycEnabled(projectSettings)
|
|
33
|
+
? getEnabledOAuthProviders(projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers)
|
|
34
|
+
: [];
|
|
43
35
|
const mapFieldKeyToValue = (fieldKey) => user === null || user === void 0 ? void 0 : user[fieldKey];
|
|
44
36
|
if (!user)
|
|
45
37
|
return null;
|
|
@@ -47,7 +39,7 @@ const UserProfile = ({ rootClassName }) => {
|
|
|
47
39
|
const { label } = getValueByKey(fieldsConfig, name);
|
|
48
40
|
const value = mapFieldKeyToValue(name);
|
|
49
41
|
return (jsx(UserProfileField, { name: name, label: label, value: value }, name));
|
|
50
|
-
}) })) }))), (providers === null || providers === void 0 ? void 0 : providers.length) > 0 && (jsx(UserProfileSection, Object.assign({ title: 'Social accounts' }, { children: jsx("div", Object.assign({ className: 'user-profile__social-accounts' }, { children: providers.map(({ authorizationUrl, provider }) => (jsx(UserProfileSocialAccount, { provider: provider
|
|
42
|
+
}) })) }))), (providers === null || providers === void 0 ? void 0 : providers.length) > 0 && (jsx(UserProfileSection, Object.assign({ title: 'Social accounts' }, { children: jsx("div", Object.assign({ className: 'user-profile__social-accounts' }, { children: providers.map(({ authorizationUrl, provider }) => (jsx(UserProfileSocialAccount, { provider: provider }, provider))) })) })))] })));
|
|
51
43
|
};
|
|
52
44
|
|
|
53
45
|
export { UserProfile };
|
|
@@ -30,6 +30,7 @@ require('@dynamic-labs/rpc-providers');
|
|
|
30
30
|
require('../../../../utils/hooks/useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup.cjs');
|
|
31
31
|
require('../../../../context/ErrorContext/ErrorContext.cjs');
|
|
32
32
|
require('../../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
33
|
+
require('../../../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
33
34
|
require('../../../IconButton/IconButton.cjs');
|
|
34
35
|
require('../../../Alert/Alert.cjs');
|
|
35
36
|
require('../../../../context/MockContext/MockContext.cjs');
|
|
@@ -26,6 +26,7 @@ import '@dynamic-labs/rpc-providers';
|
|
|
26
26
|
import '../../../../utils/hooks/useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup.js';
|
|
27
27
|
import '../../../../context/ErrorContext/ErrorContext.js';
|
|
28
28
|
import '../../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
29
|
+
import '../../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
29
30
|
import '../../../IconButton/IconButton.js';
|
|
30
31
|
import '../../../Alert/Alert.js';
|
|
31
32
|
import '../../../../context/MockContext/MockContext.js';
|
|
@@ -30,6 +30,7 @@ require('@dynamic-labs/rpc-providers');
|
|
|
30
30
|
require('../../../../utils/hooks/useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup.cjs');
|
|
31
31
|
require('../../../../context/ErrorContext/ErrorContext.cjs');
|
|
32
32
|
require('../../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
33
|
+
require('../../../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
33
34
|
require('../../../IconButton/IconButton.cjs');
|
|
34
35
|
require('../../../Alert/Alert.cjs');
|
|
35
36
|
require('../../../../context/MockContext/MockContext.cjs');
|
|
@@ -26,6 +26,7 @@ import '@dynamic-labs/rpc-providers';
|
|
|
26
26
|
import '../../../../utils/hooks/useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup.js';
|
|
27
27
|
import '../../../../context/ErrorContext/ErrorContext.js';
|
|
28
28
|
import '../../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
29
|
+
import '../../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
29
30
|
import '../../../IconButton/IconButton.js';
|
|
30
31
|
import '../../../Alert/Alert.js';
|
|
31
32
|
import '../../../../context/MockContext/MockContext.js';
|
package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs
CHANGED
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var _tslib = require('../../../../../../_virtual/_tslib.cjs');
|
|
6
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
-
var React = require('react');
|
|
8
6
|
var iconic = require('@dynamic-labs/iconic');
|
|
7
|
+
require('react');
|
|
9
8
|
var Typography = require('../../../Typography/Typography.cjs');
|
|
10
9
|
require('@dynamic-labs/sdk-api');
|
|
11
|
-
|
|
10
|
+
require('../../../../shared/logger.cjs');
|
|
12
11
|
require('@dynamic-labs/wallet-connector-core');
|
|
13
12
|
require('../../../../context/ViewContext/ViewContext.cjs');
|
|
14
13
|
var add = require('../../../../shared/assets/add.cjs');
|
|
@@ -19,7 +18,7 @@ require('../../../../utils/constants/colors.cjs');
|
|
|
19
18
|
require('../../../../shared/utils/classes/storage/localStorage.cjs');
|
|
20
19
|
require('ethers');
|
|
21
20
|
require('../../../../shared/consts/index.cjs');
|
|
22
|
-
|
|
21
|
+
require('../../../../context/DynamicContext/DynamicContext.cjs');
|
|
23
22
|
require('@dynamic-labs/multi-wallet');
|
|
24
23
|
require('../../../ShadowDOM/ShadowDOM.cjs');
|
|
25
24
|
require('../../../../context/ThemeContext/ThemeContext.cjs');
|
|
@@ -29,11 +28,12 @@ require('react-focus-lock');
|
|
|
29
28
|
require('../../../Transition/ZoomTransition/ZoomTransition.cjs');
|
|
30
29
|
require('../../../Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
31
30
|
require('../../../Transition/OpacityTransition/OpacityTransition.cjs');
|
|
32
|
-
|
|
31
|
+
require('../../../../config/ApiEndpoint.cjs');
|
|
33
32
|
require('@dynamic-labs/rpc-providers');
|
|
34
33
|
require('../../../../utils/hooks/useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup.cjs');
|
|
35
34
|
require('../../../../context/ErrorContext/ErrorContext.cjs');
|
|
36
35
|
require('../../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
36
|
+
require('../../../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
37
37
|
require('../../../IconButton/IconButton.cjs');
|
|
38
38
|
var Button = require('../../../Button/Button.cjs');
|
|
39
39
|
require('../../../Alert/Alert.cjs');
|
|
@@ -48,72 +48,21 @@ require('yup');
|
|
|
48
48
|
require('../../../InlineWidget/InlineWidget.cjs');
|
|
49
49
|
require('../../../MenuList/Dropdown/Dropdown.cjs');
|
|
50
50
|
var helpers = require('../../../../widgets/DynamicWidget/helpers/helpers.cjs');
|
|
51
|
-
var
|
|
51
|
+
var useSocialAccounts = require('../../../../utils/hooks/useSocialAccounts/useSocialAccounts.cjs');
|
|
52
52
|
var ConnectedAccountAvatar = require('./components/ConnectedAccountAvatar/ConnectedAccountAvatar.cjs');
|
|
53
53
|
|
|
54
|
-
const UserProfileSocialAccount = ({ provider,
|
|
55
|
-
var _a
|
|
56
|
-
const {
|
|
57
|
-
const
|
|
58
|
-
const
|
|
59
|
-
const connectAccount = () => {
|
|
60
|
-
setLoading(true);
|
|
61
|
-
const authWindow = window.open(authorizationUrl, '_blank', 'width=500,height=600');
|
|
62
|
-
const handleAuthWindowMessage = (event) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
63
|
-
var _a, _b;
|
|
64
|
-
if (((_a = event.data) === null || _a === void 0 ? void 0 : _a.type) !== 'authorization_response' ||
|
|
65
|
-
((_b = event.data) === null || _b === void 0 ? void 0 : _b.provider) !== provider) {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
const { code } = event.data;
|
|
69
|
-
const jwt = yield api.verifyOAuth(environmentId, provider, {
|
|
70
|
-
code,
|
|
71
|
-
}, String(authToken || onboardingOnlyJwt));
|
|
72
|
-
if (!jwt) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
yield updateUserProfileByJWT(jwt);
|
|
76
|
-
setLoading(false);
|
|
77
|
-
});
|
|
78
|
-
window.addEventListener('message', handleAuthWindowMessage);
|
|
79
|
-
const authWindowInterval = setInterval(() => {
|
|
80
|
-
if (authWindow === null || authWindow === void 0 ? void 0 : authWindow.closed) {
|
|
81
|
-
window.removeEventListener('message', handleAuthWindowMessage);
|
|
82
|
-
clearInterval(authWindowInterval);
|
|
83
|
-
setLoading(false);
|
|
84
|
-
}
|
|
85
|
-
}, 1000);
|
|
86
|
-
};
|
|
87
|
-
const disconnectAccount = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
88
|
-
var _c;
|
|
89
|
-
try {
|
|
90
|
-
setLoading(true);
|
|
91
|
-
const jwt = yield api.unlinkOAuth({
|
|
92
|
-
environmentId,
|
|
93
|
-
verifiedCrentialId: (_c = verifiedCredential === null || verifiedCredential === void 0 ? void 0 : verifiedCredential.id) !== null && _c !== void 0 ? _c : '',
|
|
94
|
-
}, String(authToken || onboardingOnlyJwt));
|
|
95
|
-
if (!jwt) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
updateUserProfileByJWT(jwt);
|
|
99
|
-
}
|
|
100
|
-
catch (err) {
|
|
101
|
-
logger.logger.error(err);
|
|
102
|
-
}
|
|
103
|
-
finally {
|
|
104
|
-
setLoading(false);
|
|
105
|
-
}
|
|
106
|
-
});
|
|
54
|
+
const UserProfileSocialAccount = ({ provider, }) => {
|
|
55
|
+
var _a;
|
|
56
|
+
const { linkSocialAccount, unlinkSocialAccount, isProcessing, isLinked, getLinkedAccountInformation, } = useSocialAccounts.useSocialAccounts();
|
|
57
|
+
const isProviderLinked = isLinked(provider);
|
|
58
|
+
const connectedAccountInfo = getLinkedAccountInformation(provider);
|
|
107
59
|
const iconThemeVariant = useIconThemeVariant.useIconThemeVariant();
|
|
108
|
-
|
|
109
|
-
return null;
|
|
110
|
-
}
|
|
111
|
-
return (jsxRuntime.jsxs("div", Object.assign({ className: 'user-profile-social-account', "data-testid": `social-account-${provider}` }, { children: [jsxRuntime.jsx("div", Object.assign({ className: 'user-profile-social-account__icon' }, { children: verifiedCredential ? (jsxRuntime.jsx(ConnectedAccountAvatar.ConnectedAccountAvatar, { provider: provider, avatarUrl: (_a = verifiedCredential.oauthAccountPhotos) === null || _a === void 0 ? void 0 : _a[0], iconThemeVariant: iconThemeVariant })) : (jsxRuntime.jsx(iconic.SocialIcon, { name: provider, variant: iconThemeVariant })) })), jsxRuntime.jsx("div", Object.assign({ className: 'user-profile-social-account__label' }, { children: jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'medium', variant: 'body_normal', color: 'primary' }, { children: (_b = verifiedCredential === null || verifiedCredential === void 0 ? void 0 : verifiedCredential.publicIdentifier) !== null && _b !== void 0 ? _b : helpers.capitalize(provider) })) })), verifiedCredential ? (jsxRuntime.jsx(Button.Button, { buttonClassName: 'user-profile-social-account__button', buttonVariant: 'secondary', buttonRounded: 'small', buttonPadding: 'none', onClick: disconnectAccount, loading: loading, dataTestId: 'social-account-disconnect-button', typographyProps: {
|
|
60
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: 'user-profile-social-account', "data-testid": `social-account-${provider}` }, { children: [jsxRuntime.jsx("div", Object.assign({ className: 'user-profile-social-account__icon' }, { children: isProviderLinked ? (jsxRuntime.jsx(ConnectedAccountAvatar.ConnectedAccountAvatar, { provider: provider, avatarUrl: connectedAccountInfo === null || connectedAccountInfo === void 0 ? void 0 : connectedAccountInfo.avatar, iconThemeVariant: iconThemeVariant })) : (jsxRuntime.jsx(iconic.SocialIcon, { name: provider, variant: iconThemeVariant })) })), jsxRuntime.jsx("div", Object.assign({ className: 'user-profile-social-account__label' }, { children: jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'medium', variant: 'body_normal', color: 'primary' }, { children: (_a = connectedAccountInfo === null || connectedAccountInfo === void 0 ? void 0 : connectedAccountInfo.publicIdentifier) !== null && _a !== void 0 ? _a : helpers.capitalize(provider) })) })), isProviderLinked ? (jsxRuntime.jsx(Button.Button, { buttonClassName: 'user-profile-social-account__button', buttonVariant: 'secondary', buttonRounded: 'small', buttonPadding: 'none', onClick: () => unlinkSocialAccount(provider), loading: isProcessing, dataTestId: 'social-account-disconnect-button', typographyProps: {
|
|
112
61
|
color: 'secondary',
|
|
113
62
|
variant: 'button_tertiary',
|
|
114
63
|
}, startSlot:
|
|
115
64
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
116
|
-
jsxRuntime.jsx(Icon.Icon, Object.assign({ color: 'text-tertiary', size: 'small' }, { children: jsxRuntime.jsx(unlink.ReactComponent, {}) })) })) : (jsxRuntime.jsx(Button.Button, Object.assign({ buttonClassName: 'user-profile-social-account__button', buttonVariant: 'secondary', buttonRounded: 'small', buttonPadding: 'none', onClick:
|
|
65
|
+
jsxRuntime.jsx(Icon.Icon, Object.assign({ color: 'text-tertiary', size: 'small' }, { children: jsxRuntime.jsx(unlink.ReactComponent, {}) })) })) : (jsxRuntime.jsx(Button.Button, Object.assign({ buttonClassName: 'user-profile-social-account__button', buttonVariant: 'secondary', buttonRounded: 'small', buttonPadding: 'none', onClick: () => linkSocialAccount(provider), loading: isProcessing, dataTestId: 'social-account-connect-button', typographyProps: {
|
|
117
66
|
color: 'secondary',
|
|
118
67
|
variant: 'button_tertiary',
|
|
119
68
|
weight: 'medium',
|
package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { ProviderEnum } from '@dynamic-labs/sdk-api';
|
|
3
3
|
export type UserProfileSocialAccountProps = {
|
|
4
|
-
authorizationUrl: string | undefined;
|
|
5
4
|
provider: ProviderEnum;
|
|
6
|
-
verifiedCredential: JwtVerifiedCredential | null;
|
|
7
5
|
};
|
|
8
|
-
export declare const UserProfileSocialAccount: ({ provider,
|
|
6
|
+
export declare const UserProfileSocialAccount: ({ provider, }: UserProfileSocialAccountProps) => JSX.Element;
|
package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { __awaiter } from '../../../../../../_virtual/_tslib.js';
|
|
2
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { useState } from 'react';
|
|
4
2
|
import { SocialIcon } from '@dynamic-labs/iconic';
|
|
3
|
+
import 'react';
|
|
5
4
|
import { Typography } from '../../../Typography/Typography.js';
|
|
6
5
|
import '@dynamic-labs/sdk-api';
|
|
7
|
-
import
|
|
6
|
+
import '../../../../shared/logger.js';
|
|
8
7
|
import '@dynamic-labs/wallet-connector-core';
|
|
9
8
|
import '../../../../context/ViewContext/ViewContext.js';
|
|
10
9
|
import { ReactComponent as SvgAdd } from '../../../../shared/assets/add.js';
|
|
@@ -15,7 +14,7 @@ import '../../../../utils/constants/colors.js';
|
|
|
15
14
|
import '../../../../shared/utils/classes/storage/localStorage.js';
|
|
16
15
|
import 'ethers';
|
|
17
16
|
import '../../../../shared/consts/index.js';
|
|
18
|
-
import
|
|
17
|
+
import '../../../../context/DynamicContext/DynamicContext.js';
|
|
19
18
|
import '@dynamic-labs/multi-wallet';
|
|
20
19
|
import '../../../ShadowDOM/ShadowDOM.js';
|
|
21
20
|
import '../../../../context/ThemeContext/ThemeContext.js';
|
|
@@ -25,11 +24,12 @@ import 'react-focus-lock';
|
|
|
25
24
|
import '../../../Transition/ZoomTransition/ZoomTransition.js';
|
|
26
25
|
import '../../../Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
27
26
|
import '../../../Transition/OpacityTransition/OpacityTransition.js';
|
|
28
|
-
import
|
|
27
|
+
import '../../../../config/ApiEndpoint.js';
|
|
29
28
|
import '@dynamic-labs/rpc-providers';
|
|
30
29
|
import '../../../../utils/hooks/useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup.js';
|
|
31
30
|
import '../../../../context/ErrorContext/ErrorContext.js';
|
|
32
31
|
import '../../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
32
|
+
import '../../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
33
33
|
import '../../../IconButton/IconButton.js';
|
|
34
34
|
import { Button } from '../../../Button/Button.js';
|
|
35
35
|
import '../../../Alert/Alert.js';
|
|
@@ -44,72 +44,21 @@ import 'yup';
|
|
|
44
44
|
import '../../../InlineWidget/InlineWidget.js';
|
|
45
45
|
import '../../../MenuList/Dropdown/Dropdown.js';
|
|
46
46
|
import { capitalize } from '../../../../widgets/DynamicWidget/helpers/helpers.js';
|
|
47
|
-
import {
|
|
47
|
+
import { useSocialAccounts } from '../../../../utils/hooks/useSocialAccounts/useSocialAccounts.js';
|
|
48
48
|
import { ConnectedAccountAvatar } from './components/ConnectedAccountAvatar/ConnectedAccountAvatar.js';
|
|
49
49
|
|
|
50
|
-
const UserProfileSocialAccount = ({ provider,
|
|
51
|
-
var _a
|
|
52
|
-
const {
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
const connectAccount = () => {
|
|
56
|
-
setLoading(true);
|
|
57
|
-
const authWindow = window.open(authorizationUrl, '_blank', 'width=500,height=600');
|
|
58
|
-
const handleAuthWindowMessage = (event) => __awaiter(void 0, void 0, void 0, function* () {
|
|
59
|
-
var _a, _b;
|
|
60
|
-
if (((_a = event.data) === null || _a === void 0 ? void 0 : _a.type) !== 'authorization_response' ||
|
|
61
|
-
((_b = event.data) === null || _b === void 0 ? void 0 : _b.provider) !== provider) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
const { code } = event.data;
|
|
65
|
-
const jwt = yield verifyOAuth(environmentId, provider, {
|
|
66
|
-
code,
|
|
67
|
-
}, String(authToken || onboardingOnlyJwt));
|
|
68
|
-
if (!jwt) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
yield updateUserProfileByJWT(jwt);
|
|
72
|
-
setLoading(false);
|
|
73
|
-
});
|
|
74
|
-
window.addEventListener('message', handleAuthWindowMessage);
|
|
75
|
-
const authWindowInterval = setInterval(() => {
|
|
76
|
-
if (authWindow === null || authWindow === void 0 ? void 0 : authWindow.closed) {
|
|
77
|
-
window.removeEventListener('message', handleAuthWindowMessage);
|
|
78
|
-
clearInterval(authWindowInterval);
|
|
79
|
-
setLoading(false);
|
|
80
|
-
}
|
|
81
|
-
}, 1000);
|
|
82
|
-
};
|
|
83
|
-
const disconnectAccount = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
84
|
-
var _c;
|
|
85
|
-
try {
|
|
86
|
-
setLoading(true);
|
|
87
|
-
const jwt = yield unlinkOAuth({
|
|
88
|
-
environmentId,
|
|
89
|
-
verifiedCrentialId: (_c = verifiedCredential === null || verifiedCredential === void 0 ? void 0 : verifiedCredential.id) !== null && _c !== void 0 ? _c : '',
|
|
90
|
-
}, String(authToken || onboardingOnlyJwt));
|
|
91
|
-
if (!jwt) {
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
updateUserProfileByJWT(jwt);
|
|
95
|
-
}
|
|
96
|
-
catch (err) {
|
|
97
|
-
logger.error(err);
|
|
98
|
-
}
|
|
99
|
-
finally {
|
|
100
|
-
setLoading(false);
|
|
101
|
-
}
|
|
102
|
-
});
|
|
50
|
+
const UserProfileSocialAccount = ({ provider, }) => {
|
|
51
|
+
var _a;
|
|
52
|
+
const { linkSocialAccount, unlinkSocialAccount, isProcessing, isLinked, getLinkedAccountInformation, } = useSocialAccounts();
|
|
53
|
+
const isProviderLinked = isLinked(provider);
|
|
54
|
+
const connectedAccountInfo = getLinkedAccountInformation(provider);
|
|
103
55
|
const iconThemeVariant = useIconThemeVariant();
|
|
104
|
-
|
|
105
|
-
return null;
|
|
106
|
-
}
|
|
107
|
-
return (jsxs("div", Object.assign({ className: 'user-profile-social-account', "data-testid": `social-account-${provider}` }, { children: [jsx("div", Object.assign({ className: 'user-profile-social-account__icon' }, { children: verifiedCredential ? (jsx(ConnectedAccountAvatar, { provider: provider, avatarUrl: (_a = verifiedCredential.oauthAccountPhotos) === null || _a === void 0 ? void 0 : _a[0], iconThemeVariant: iconThemeVariant })) : (jsx(SocialIcon, { name: provider, variant: iconThemeVariant })) })), jsx("div", Object.assign({ className: 'user-profile-social-account__label' }, { children: jsx(Typography, Object.assign({ weight: 'medium', variant: 'body_normal', color: 'primary' }, { children: (_b = verifiedCredential === null || verifiedCredential === void 0 ? void 0 : verifiedCredential.publicIdentifier) !== null && _b !== void 0 ? _b : capitalize(provider) })) })), verifiedCredential ? (jsx(Button, { buttonClassName: 'user-profile-social-account__button', buttonVariant: 'secondary', buttonRounded: 'small', buttonPadding: 'none', onClick: disconnectAccount, loading: loading, dataTestId: 'social-account-disconnect-button', typographyProps: {
|
|
56
|
+
return (jsxs("div", Object.assign({ className: 'user-profile-social-account', "data-testid": `social-account-${provider}` }, { children: [jsx("div", Object.assign({ className: 'user-profile-social-account__icon' }, { children: isProviderLinked ? (jsx(ConnectedAccountAvatar, { provider: provider, avatarUrl: connectedAccountInfo === null || connectedAccountInfo === void 0 ? void 0 : connectedAccountInfo.avatar, iconThemeVariant: iconThemeVariant })) : (jsx(SocialIcon, { name: provider, variant: iconThemeVariant })) })), jsx("div", Object.assign({ className: 'user-profile-social-account__label' }, { children: jsx(Typography, Object.assign({ weight: 'medium', variant: 'body_normal', color: 'primary' }, { children: (_a = connectedAccountInfo === null || connectedAccountInfo === void 0 ? void 0 : connectedAccountInfo.publicIdentifier) !== null && _a !== void 0 ? _a : capitalize(provider) })) })), isProviderLinked ? (jsx(Button, { buttonClassName: 'user-profile-social-account__button', buttonVariant: 'secondary', buttonRounded: 'small', buttonPadding: 'none', onClick: () => unlinkSocialAccount(provider), loading: isProcessing, dataTestId: 'social-account-disconnect-button', typographyProps: {
|
|
108
57
|
color: 'secondary',
|
|
109
58
|
variant: 'button_tertiary',
|
|
110
59
|
}, startSlot:
|
|
111
60
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
112
|
-
jsx(Icon, Object.assign({ color: 'text-tertiary', size: 'small' }, { children: jsx(SvgUnlink, {}) })) })) : (jsx(Button, Object.assign({ buttonClassName: 'user-profile-social-account__button', buttonVariant: 'secondary', buttonRounded: 'small', buttonPadding: 'none', onClick:
|
|
61
|
+
jsx(Icon, Object.assign({ color: 'text-tertiary', size: 'small' }, { children: jsx(SvgUnlink, {}) })) })) : (jsx(Button, Object.assign({ buttonClassName: 'user-profile-social-account__button', buttonVariant: 'secondary', buttonRounded: 'small', buttonPadding: 'none', onClick: () => linkSocialAccount(provider), loading: isProcessing, dataTestId: 'social-account-connect-button', typographyProps: {
|
|
113
62
|
color: 'secondary',
|
|
114
63
|
variant: 'button_tertiary',
|
|
115
64
|
weight: 'medium',
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
|
|
8
|
+
const AccountExistsContext = React.createContext(undefined);
|
|
9
|
+
const AccountExistsContextProvider = ({ children, }) => {
|
|
10
|
+
const [existentAccountData, setExistentAccountData] = React.useState();
|
|
11
|
+
const value = React.useMemo(() => ({
|
|
12
|
+
existentAccountData,
|
|
13
|
+
setExistentAccountData,
|
|
14
|
+
}), [existentAccountData, setExistentAccountData]);
|
|
15
|
+
return (jsxRuntime.jsx(AccountExistsContext.Provider, Object.assign({ value: value }, { children: children })));
|
|
16
|
+
};
|
|
17
|
+
const useAccountExistsContext = () => {
|
|
18
|
+
const context = React.useContext(AccountExistsContext);
|
|
19
|
+
if (context === undefined) {
|
|
20
|
+
throw new Error('usage of useAccountExistsContext not wrapped in `AccountExistsContextProvider`.');
|
|
21
|
+
}
|
|
22
|
+
return context;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
exports.AccountExistsContext = AccountExistsContext;
|
|
26
|
+
exports.AccountExistsContextProvider = AccountExistsContextProvider;
|
|
27
|
+
exports.useAccountExistsContext = useAccountExistsContext;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Dispatch, ReactNode, SetStateAction } from 'react';
|
|
2
|
+
import { ProviderEnum } from '@dynamic-labs/sdk-api';
|
|
3
|
+
export type AccountExistsContextData = {
|
|
4
|
+
email: string;
|
|
5
|
+
embeddedSocialSigninProvider: ProviderEnum;
|
|
6
|
+
embeddedWalletName: string;
|
|
7
|
+
loginProvider: ProviderEnum;
|
|
8
|
+
};
|
|
9
|
+
export type AccountExistsContextType = {
|
|
10
|
+
existentAccountData: AccountExistsContextData | undefined;
|
|
11
|
+
setExistentAccountData: Dispatch<SetStateAction<AccountExistsContextData | undefined>>;
|
|
12
|
+
};
|
|
13
|
+
export declare const AccountExistsContext: import("react").Context<AccountExistsContextType | undefined>;
|
|
14
|
+
export declare const AccountExistsContextProvider: ({ children, }: {
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}) => JSX.Element;
|
|
17
|
+
export declare const useAccountExistsContext: () => AccountExistsContextType;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { createContext, useState, useMemo, useContext } from 'react';
|
|
3
|
+
|
|
4
|
+
const AccountExistsContext = createContext(undefined);
|
|
5
|
+
const AccountExistsContextProvider = ({ children, }) => {
|
|
6
|
+
const [existentAccountData, setExistentAccountData] = useState();
|
|
7
|
+
const value = useMemo(() => ({
|
|
8
|
+
existentAccountData,
|
|
9
|
+
setExistentAccountData,
|
|
10
|
+
}), [existentAccountData, setExistentAccountData]);
|
|
11
|
+
return (jsx(AccountExistsContext.Provider, Object.assign({ value: value }, { children: children })));
|
|
12
|
+
};
|
|
13
|
+
const useAccountExistsContext = () => {
|
|
14
|
+
const context = useContext(AccountExistsContext);
|
|
15
|
+
if (context === undefined) {
|
|
16
|
+
throw new Error('usage of useAccountExistsContext not wrapped in `AccountExistsContextProvider`.');
|
|
17
|
+
}
|
|
18
|
+
return context;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { AccountExistsContext, AccountExistsContextProvider, useAccountExistsContext };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AccountExistsContext';
|
|
@@ -38,6 +38,7 @@ var getAuthToken = require('../../utils/functions/getAuthToken/getAuthToken.cjs'
|
|
|
38
38
|
require('@dynamic-labs/sdk-api');
|
|
39
39
|
var ErrorContext = require('../ErrorContext/ErrorContext.cjs');
|
|
40
40
|
var AccessDeniedContext = require('../AccessDeniedContext/AccessDeniedContext.cjs');
|
|
41
|
+
var AccountExistsContext = require('../AccountExistsContext/AccountExistsContext.cjs');
|
|
41
42
|
var useWalletUiUtils = require('../../utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs');
|
|
42
43
|
require('../MockContext/MockContext.cjs');
|
|
43
44
|
var CaptchaContext = require('../CaptchaContext/CaptchaContext.cjs');
|
|
@@ -663,7 +664,7 @@ const DynamicContextProvider = ({ children, theme, settings, }) => {
|
|
|
663
664
|
isBridgeFlow,
|
|
664
665
|
isFullyConnected,
|
|
665
666
|
loginWithEmail,
|
|
666
|
-
}) }, { children: jsxRuntime.jsx(WalletContext.WalletContextProvider, Object.assign({ canSync: didConnectedStateLoad }, { children: jsxRuntime.jsx(QrCodeContext.QrCodeContextProvider, { children: jsxRuntime.jsx(EmailVerificationContext.EmailVerificationContextProvider, { children: jsxRuntime.jsx(ErrorContext.ErrorContextProvider, { children: jsxRuntime.jsx(DynamicWidgetContext.DynamicWidgetContextProvider, { children: jsxRuntime.jsx(DynamicBridgeWidgetContext.DynamicBridgeWidgetContextProvider, { children: jsxRuntime.jsx(CaptchaContext.CaptchaContextProvider, { children: jsxRuntime.jsx(FundingContext.FundingContextProvider, { children: jsxRuntime.jsx(AccessDeniedContext.AccessDeniedContextProvider, { children: jsxRuntime.jsx(SendBalanceContext.SendBalanceContextProvider, { children: jsxRuntime.jsxs(WalletGroupContext.WalletGroupContextProvider, { children: [jsxRuntime.jsx(app.DynamicAuthFlow, {}), jsxRuntime.jsx(Toolkit.Toolkit, {}), jsxRuntime.jsx(FundingWidget.FundingWidget, {}), confirmationModal, children] }) }) }) }) }) }) }) }) }) }) })) })) }) })) })) })));
|
|
667
|
+
}) }, { children: jsxRuntime.jsx(AccountExistsContext.AccountExistsContextProvider, { children: jsxRuntime.jsx(WalletContext.WalletContextProvider, Object.assign({ canSync: didConnectedStateLoad }, { children: jsxRuntime.jsx(QrCodeContext.QrCodeContextProvider, { children: jsxRuntime.jsx(EmailVerificationContext.EmailVerificationContextProvider, { children: jsxRuntime.jsx(ErrorContext.ErrorContextProvider, { children: jsxRuntime.jsx(DynamicWidgetContext.DynamicWidgetContextProvider, { children: jsxRuntime.jsx(DynamicBridgeWidgetContext.DynamicBridgeWidgetContextProvider, { children: jsxRuntime.jsx(CaptchaContext.CaptchaContextProvider, { children: jsxRuntime.jsx(FundingContext.FundingContextProvider, { children: jsxRuntime.jsx(AccessDeniedContext.AccessDeniedContextProvider, { children: jsxRuntime.jsx(SendBalanceContext.SendBalanceContextProvider, { children: jsxRuntime.jsxs(WalletGroupContext.WalletGroupContextProvider, { children: [jsxRuntime.jsx(app.DynamicAuthFlow, {}), jsxRuntime.jsx(Toolkit.Toolkit, {}), jsxRuntime.jsx(FundingWidget.FundingWidget, {}), confirmationModal, children] }) }) }) }) }) }) }) }) }) }) })) }) })) }) })) })) })));
|
|
667
668
|
};
|
|
668
669
|
|
|
669
670
|
exports.DynamicContext = DynamicContext;
|
|
@@ -34,6 +34,7 @@ import { getAuthToken } from '../../utils/functions/getAuthToken/getAuthToken.js
|
|
|
34
34
|
import '@dynamic-labs/sdk-api';
|
|
35
35
|
import { ErrorContextProvider } from '../ErrorContext/ErrorContext.js';
|
|
36
36
|
import { AccessDeniedContextProvider } from '../AccessDeniedContext/AccessDeniedContext.js';
|
|
37
|
+
import { AccountExistsContextProvider } from '../AccountExistsContext/AccountExistsContext.js';
|
|
37
38
|
import { useWalletUiUtils } from '../../utils/hooks/useWalletUiUtils/useWalletUiUtils.js';
|
|
38
39
|
import '../MockContext/MockContext.js';
|
|
39
40
|
import { CaptchaContextProvider } from '../CaptchaContext/CaptchaContext.js';
|
|
@@ -659,7 +660,7 @@ const DynamicContextProvider = ({ children, theme, settings, }) => {
|
|
|
659
660
|
isBridgeFlow,
|
|
660
661
|
isFullyConnected,
|
|
661
662
|
loginWithEmail,
|
|
662
|
-
}) }, { children: jsx(WalletContextProvider, Object.assign({ canSync: didConnectedStateLoad }, { children: jsx(QrCodeContextProvider, { children: jsx(EmailVerificationContextProvider, { children: jsx(ErrorContextProvider, { children: jsx(DynamicWidgetContextProvider, { children: jsx(DynamicBridgeWidgetContextProvider, { children: jsx(CaptchaContextProvider, { children: jsx(FundingContextProvider, { children: jsx(AccessDeniedContextProvider, { children: jsx(SendBalanceContextProvider, { children: jsxs(WalletGroupContextProvider, { children: [jsx(DynamicAuthFlow, {}), jsx(Toolkit, {}), jsx(FundingWidget, {}), confirmationModal, children] }) }) }) }) }) }) }) }) }) }) })) })) }) })) })) })));
|
|
663
|
+
}) }, { children: jsx(AccountExistsContextProvider, { children: jsx(WalletContextProvider, Object.assign({ canSync: didConnectedStateLoad }, { children: jsx(QrCodeContextProvider, { children: jsx(EmailVerificationContextProvider, { children: jsx(ErrorContextProvider, { children: jsx(DynamicWidgetContextProvider, { children: jsx(DynamicBridgeWidgetContextProvider, { children: jsx(CaptchaContextProvider, { children: jsx(FundingContextProvider, { children: jsx(AccessDeniedContextProvider, { children: jsx(SendBalanceContextProvider, { children: jsxs(WalletGroupContextProvider, { children: [jsx(DynamicAuthFlow, {}), jsx(Toolkit, {}), jsx(FundingWidget, {}), confirmationModal, children] }) }) }) }) }) }) }) }) }) }) })) }) })) }) })) })) })));
|
|
663
664
|
};
|
|
664
665
|
|
|
665
666
|
export { DynamicContext, DynamicContextProvider, PUBLIC_PROJECT_LIVE_ENVIRONMENT_ID };
|
package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.cjs
CHANGED
|
@@ -22,6 +22,7 @@ require('../../../utils/hooks/useWallets/utils/verifyMagicIsSetup/verifyMagicIsS
|
|
|
22
22
|
require('../DynamicContext.cjs');
|
|
23
23
|
require('../../ErrorContext/ErrorContext.cjs');
|
|
24
24
|
require('../../AccessDeniedContext/AccessDeniedContext.cjs');
|
|
25
|
+
require('../../AccountExistsContext/AccountExistsContext.cjs');
|
|
25
26
|
var usePrevious = require('../../../utils/hooks/usePrevious/usePrevious.cjs');
|
|
26
27
|
require('react-dom');
|
|
27
28
|
require('../../../components/ShadowDOM/ShadowDOM.cjs');
|
|
@@ -18,6 +18,7 @@ import '../../../utils/hooks/useWallets/utils/verifyMagicIsSetup/verifyMagicIsSe
|
|
|
18
18
|
import '../DynamicContext.js';
|
|
19
19
|
import '../../ErrorContext/ErrorContext.js';
|
|
20
20
|
import '../../AccessDeniedContext/AccessDeniedContext.js';
|
|
21
|
+
import '../../AccountExistsContext/AccountExistsContext.js';
|
|
21
22
|
import { usePrevious } from '../../../utils/hooks/usePrevious/usePrevious.js';
|
|
22
23
|
import 'react-dom';
|
|
23
24
|
import '../../../components/ShadowDOM/ShadowDOM.js';
|
|
@@ -4,11 +4,45 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var React = require('react');
|
|
7
|
+
var walletBook = require('@dynamic-labs/wallet-book');
|
|
7
8
|
var DynamicAuthLayout = require('../../layout/DynamicAuthLayout/DynamicAuthLayout.cjs');
|
|
9
|
+
var ErrorContext = require('../ErrorContext/ErrorContext.cjs');
|
|
8
10
|
var index = require('../FooterAnimationContext/index.cjs');
|
|
9
11
|
var ThemeContext = require('../ThemeContext/ThemeContext.cjs');
|
|
10
12
|
var ViewContext = require('../ViewContext/ViewContext.cjs');
|
|
11
|
-
|
|
13
|
+
require('@dynamic-labs/sdk-api');
|
|
14
|
+
require('../../shared/logger.cjs');
|
|
15
|
+
require('@dynamic-labs/iconic');
|
|
16
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
17
|
+
require('@dynamic-labs/utils');
|
|
18
|
+
require('../../utils/constants/colors.cjs');
|
|
19
|
+
require('../../shared/utils/classes/storage/localStorage.cjs');
|
|
20
|
+
require('ethers');
|
|
21
|
+
require('../../shared/consts/index.cjs');
|
|
22
|
+
require('../DynamicContext/DynamicContext.cjs');
|
|
23
|
+
require('@dynamic-labs/multi-wallet');
|
|
24
|
+
require('../../components/ShadowDOM/ShadowDOM.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('../AccessDeniedContext/AccessDeniedContext.cjs');
|
|
34
|
+
require('../AccountExistsContext/AccountExistsContext.cjs');
|
|
35
|
+
require('../../components/IconButton/IconButton.cjs');
|
|
36
|
+
require('../../components/Alert/Alert.cjs');
|
|
37
|
+
require('../CaptchaContext/CaptchaContext.cjs');
|
|
38
|
+
require('../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
39
|
+
require('../../components/Popper/Popper/Popper.cjs');
|
|
40
|
+
var PopperContext = require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
41
|
+
require('formik');
|
|
42
|
+
require('yup');
|
|
43
|
+
require('../../components/InlineWidget/InlineWidget.cjs');
|
|
44
|
+
require('../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
45
|
+
var index$1 = require('./constants/index.cjs');
|
|
12
46
|
|
|
13
47
|
const MockContext = React.createContext(undefined);
|
|
14
48
|
const MockContextProvider = ({ children, walletName, view, mockedWalletConnector, customerTheme, dynamicLayoutClassName, }) => {
|
|
@@ -18,7 +52,7 @@ const MockContextProvider = ({ children, walletName, view, mockedWalletConnector
|
|
|
18
52
|
setView: () => { },
|
|
19
53
|
view,
|
|
20
54
|
};
|
|
21
|
-
return (jsxRuntime.jsx(MockContext.Provider, Object.assign({ value: { mockedSDK: true } }, { children: jsxRuntime.jsx(ViewContext.ViewContext.Provider, Object.assign({ value: viewContextValue }, { children: jsxRuntime.jsx(ErrorContext.ErrorContextProvider, { children: jsxRuntime.jsx(ThemeContext.ThemeContextProvider, Object.assign({ customerTheme: customerTheme }, { children: jsxRuntime.jsx(index.FooterAnimationContextProvider, { children: jsxRuntime.jsx(MockContextWrapper, Object.assign({ dynamicLayoutClassName: dynamicLayoutClassName, mockedWalletConnector: mockedWalletConnector, walletName: walletName }, { children: children })) }) })) }) })) })));
|
|
55
|
+
return (jsxRuntime.jsx(MockContext.Provider, Object.assign({ value: { mockedSDK: true } }, { children: jsxRuntime.jsx(PopperContext.PopperProvider, { children: jsxRuntime.jsx(ViewContext.ViewContext.Provider, Object.assign({ value: viewContextValue }, { children: jsxRuntime.jsx(ErrorContext.ErrorContextProvider, { children: jsxRuntime.jsx(ThemeContext.ThemeContextProvider, Object.assign({ customerTheme: customerTheme }, { children: jsxRuntime.jsx(index.FooterAnimationContextProvider, { children: jsxRuntime.jsx(walletBook.WalletBookContextProvider, Object.assign({ walletBook: index$1.walletBookMock }, { children: jsxRuntime.jsx(MockContextWrapper, Object.assign({ dynamicLayoutClassName: dynamicLayoutClassName, mockedWalletConnector: mockedWalletConnector, walletName: walletName }, { children: children })) })) }) })) }) })) }) })));
|
|
22
56
|
};
|
|
23
57
|
const MockContextWrapper = ({ dynamicLayoutClassName, mockedWalletConnector, walletName, children, }) => {
|
|
24
58
|
/* istanbul ignore next */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import type { WalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
3
|
+
import { ChainToWalletMap } from '../../shared';
|
|
3
4
|
import { ThemeData } from '../ThemeContext';
|
|
4
5
|
import { ViewType } from '../ViewContext';
|
|
5
|
-
import { ChainToWalletMap } from '../../shared';
|
|
6
6
|
type MockContextProps = {
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
customerTheme?: ThemeData;
|
|
@@ -1,10 +1,44 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { createContext, useContext } from 'react';
|
|
3
|
+
import { WalletBookContextProvider } from '@dynamic-labs/wallet-book';
|
|
3
4
|
import { DynamicAuthLayout } from '../../layout/DynamicAuthLayout/DynamicAuthLayout.js';
|
|
5
|
+
import { ErrorContextProvider } from '../ErrorContext/ErrorContext.js';
|
|
4
6
|
import { FooterAnimationContextProvider } from '../FooterAnimationContext/index.js';
|
|
5
7
|
import { ThemeContextProvider } from '../ThemeContext/ThemeContext.js';
|
|
6
8
|
import { ViewContext } from '../ViewContext/ViewContext.js';
|
|
7
|
-
import
|
|
9
|
+
import '@dynamic-labs/sdk-api';
|
|
10
|
+
import '../../shared/logger.js';
|
|
11
|
+
import '@dynamic-labs/iconic';
|
|
12
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
13
|
+
import '@dynamic-labs/utils';
|
|
14
|
+
import '../../utils/constants/colors.js';
|
|
15
|
+
import '../../shared/utils/classes/storage/localStorage.js';
|
|
16
|
+
import 'ethers';
|
|
17
|
+
import '../../shared/consts/index.js';
|
|
18
|
+
import '../DynamicContext/DynamicContext.js';
|
|
19
|
+
import '@dynamic-labs/multi-wallet';
|
|
20
|
+
import '../../components/ShadowDOM/ShadowDOM.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 '../AccessDeniedContext/AccessDeniedContext.js';
|
|
30
|
+
import '../AccountExistsContext/AccountExistsContext.js';
|
|
31
|
+
import '../../components/IconButton/IconButton.js';
|
|
32
|
+
import '../../components/Alert/Alert.js';
|
|
33
|
+
import '../CaptchaContext/CaptchaContext.js';
|
|
34
|
+
import '../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
35
|
+
import '../../components/Popper/Popper/Popper.js';
|
|
36
|
+
import { PopperProvider } from '../../components/Popper/PopperContext/PopperContext.js';
|
|
37
|
+
import 'formik';
|
|
38
|
+
import 'yup';
|
|
39
|
+
import '../../components/InlineWidget/InlineWidget.js';
|
|
40
|
+
import '../../components/MenuList/Dropdown/Dropdown.js';
|
|
41
|
+
import { walletBookMock } from './constants/index.js';
|
|
8
42
|
|
|
9
43
|
const MockContext = createContext(undefined);
|
|
10
44
|
const MockContextProvider = ({ children, walletName, view, mockedWalletConnector, customerTheme, dynamicLayoutClassName, }) => {
|
|
@@ -14,7 +48,7 @@ const MockContextProvider = ({ children, walletName, view, mockedWalletConnector
|
|
|
14
48
|
setView: () => { },
|
|
15
49
|
view,
|
|
16
50
|
};
|
|
17
|
-
return (jsx(MockContext.Provider, Object.assign({ value: { mockedSDK: true } }, { children: jsx(ViewContext.Provider, Object.assign({ value: viewContextValue }, { children: jsx(ErrorContextProvider, { children: jsx(ThemeContextProvider, Object.assign({ customerTheme: customerTheme }, { children: jsx(FooterAnimationContextProvider, { children: jsx(MockContextWrapper, Object.assign({ dynamicLayoutClassName: dynamicLayoutClassName, mockedWalletConnector: mockedWalletConnector, walletName: walletName }, { children: children })) }) })) }) })) })));
|
|
51
|
+
return (jsx(MockContext.Provider, Object.assign({ value: { mockedSDK: true } }, { children: jsx(PopperProvider, { children: jsx(ViewContext.Provider, Object.assign({ value: viewContextValue }, { children: jsx(ErrorContextProvider, { children: jsx(ThemeContextProvider, Object.assign({ customerTheme: customerTheme }, { children: jsx(FooterAnimationContextProvider, { children: jsx(WalletBookContextProvider, Object.assign({ walletBook: walletBookMock }, { children: jsx(MockContextWrapper, Object.assign({ dynamicLayoutClassName: dynamicLayoutClassName, mockedWalletConnector: mockedWalletConnector, walletName: walletName }, { children: children })) })) }) })) }) })) }) })));
|
|
18
52
|
};
|
|
19
53
|
const MockContextWrapper = ({ dynamicLayoutClassName, mockedWalletConnector, walletName, children, }) => {
|
|
20
54
|
/* istanbul ignore next */
|