@web3auth/modal 10.0.0-beta.0 → 10.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib.cjs/node_modules/style-inject/dist/style-inject.es.js +1 -1
- package/dist/lib.cjs/packages/modal/src/modalManager.js +195 -140
- package/dist/lib.cjs/packages/modal/src/react/Web3AuthProvider.js +2 -2
- package/dist/lib.cjs/packages/modal/src/react/context/Web3AuthInnerContext.js +26 -26
- package/dist/lib.cjs/packages/modal/src/react/hooks/useWeb3Auth.js +2 -2
- package/dist/lib.cjs/packages/modal/src/ui/components/BottomSheet/BottomSheet.js +60 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/Button.js +47 -22
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/Button.type.js +8 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/ButtonSocial/ButtonSocial.js +53 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/ButtonWallet/ButtonWallet.js +68 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWallet.js +202 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.js +65 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/{ExternalWallet/ExternalWalletChainNamespace.js → ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.js} +29 -30
- package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.js +49 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWalletList/ConnectWalletList.js +140 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.js +93 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.js +55 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Embed/Embed.js +70 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Footer/Footer.js +53 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Image/Image.js +89 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Loader/Loader.js +151 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Login/Login.js +489 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Login/LoginOtp/LoginOtp.js +116 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Login/LoginPasswordLess/LoginPasswordLess.js +117 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/LoginHint/LoginHint.js +52 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Modal/Modal.js +87 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Otp/Otp.js +190 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/PulseLoader/PulseLoader.js +18 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Root/Root.js +448 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/SocialLoginList/SocialLoginList.js +156 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Toast/Toast.js +70 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/Widget/Widget.js +231 -0
- package/dist/lib.cjs/packages/modal/src/ui/config.js +12 -1
- package/dist/lib.cjs/packages/modal/src/ui/constants.js +18 -0
- package/dist/lib.cjs/packages/modal/src/ui/context/RootContext.js +20 -0
- package/dist/lib.cjs/packages/modal/src/ui/context/ThemeContext.js +2 -2
- package/dist/lib.cjs/packages/modal/src/ui/css/index.css.js +8 -0
- package/dist/lib.cjs/packages/modal/src/ui/handlers/AbstractHandler.js +117 -0
- package/dist/lib.cjs/packages/modal/src/ui/handlers/EmailPasswordlessHandler.js +54 -0
- package/dist/lib.cjs/packages/modal/src/ui/handlers/SmsPasswordlessHandler.js +57 -0
- package/dist/lib.cjs/packages/modal/src/ui/handlers/factory.js +19 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/dutch.json.js +37 -2
- package/dist/lib.cjs/packages/modal/src/ui/i18n/english.json.js +37 -2
- package/dist/lib.cjs/packages/modal/src/ui/i18n/french.json.js +37 -2
- package/dist/lib.cjs/packages/modal/src/ui/i18n/german.json.js +37 -2
- package/dist/lib.cjs/packages/modal/src/ui/i18n/japanese.json.js +37 -2
- package/dist/lib.cjs/packages/modal/src/ui/i18n/korean.json.js +37 -2
- package/dist/lib.cjs/packages/modal/src/ui/i18n/mandarin.json.js +37 -2
- package/dist/lib.cjs/packages/modal/src/ui/i18n/portuguese.json.js +37 -2
- package/dist/lib.cjs/packages/modal/src/ui/i18n/spanish.json.js +37 -2
- package/dist/lib.cjs/packages/modal/src/ui/i18n/turkish.json.js +37 -2
- package/dist/lib.cjs/packages/modal/src/ui/interfaces.js +7 -10
- package/dist/lib.cjs/packages/modal/src/ui/loginModal.js +69 -44
- package/dist/lib.cjs/packages/modal/src/ui/utils.js +107 -1
- package/dist/lib.cjs/types/interface.d.ts +1 -1
- package/dist/lib.cjs/types/modalManager.d.ts +5 -1
- package/dist/lib.cjs/types/ui/components/BottomSheet/BottomSheet.d.ts +7 -0
- package/dist/lib.cjs/types/ui/components/BottomSheet/BottomSheet.type.d.ts +7 -0
- package/dist/lib.cjs/types/ui/components/BottomSheet/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Button/Button.d.ts +2 -15
- package/dist/lib.cjs/types/ui/components/Button/Button.type.d.ts +12 -0
- package/dist/lib.cjs/types/ui/components/Button/ButtonSocial/ButtonSocial.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/Button/ButtonSocial/ButtonSocial.type.d.ts +14 -0
- package/dist/lib.cjs/types/ui/components/Button/ButtonSocial/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Button/ButtonWallet/ButtonWallet.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/Button/ButtonWallet/ButtonWallet.type.d.ts +13 -0
- package/dist/lib.cjs/types/ui/components/Button/ButtonWallet/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Button/index.d.ts +1 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWallet.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWallet.type.d.ts +24 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.type.d.ts +13 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletChainFilter/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.type.d.ts +10 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletChainNamespaceSelect/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.type.d.ts +6 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletHeader/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletList/ConnectWalletList.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletList/ConnectWalletList.type.d.ts +19 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletList/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.type.d.ts +9 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletQrCode/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.type.d.ts +9 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/ConnectWalletSearch/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/ConnectWallet/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Embed/Embed.d.ts +8 -0
- package/dist/lib.cjs/types/ui/components/Embed/Embed.type.d.ts +12 -0
- package/dist/lib.cjs/types/ui/components/Embed/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Footer/Footer.d.ts +7 -0
- package/dist/lib.cjs/types/ui/components/Footer/Footer.type.d.ts +4 -0
- package/dist/lib.cjs/types/ui/components/Footer/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Image/Image.d.ts +7 -0
- package/dist/lib.cjs/types/ui/components/{Image.d.ts → Image/Image.type.d.ts} +2 -1
- package/dist/lib.cjs/types/ui/components/Image/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Loader/Loader.d.ts +8 -0
- package/dist/lib.cjs/types/ui/components/Loader/Loader.type.d.ts +12 -0
- package/dist/lib.cjs/types/ui/components/Loader/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Login/Login.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/Login/Login.type.d.ts +29 -0
- package/dist/lib.cjs/types/ui/components/Login/LoginOtp/LoginOtp.d.ts +8 -0
- package/dist/lib.cjs/types/ui/components/Login/LoginOtp/LoginOtp.type.d.ts +10 -0
- package/dist/lib.cjs/types/ui/components/Login/LoginOtp/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Login/LoginPasswordLess/LoginPasswordLess.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/Login/LoginPasswordLess/LoginPasswordLess.type.d.ts +13 -0
- package/dist/lib.cjs/types/ui/components/Login/LoginPasswordLess/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Login/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/LoginHint/LoginHint.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/LoginHint/LoginHint.type.d.ts +6 -0
- package/dist/lib.cjs/types/ui/components/LoginHint/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Modal/Modal.d.ts +8 -0
- package/dist/lib.cjs/types/ui/components/Modal/Modal.type.d.ts +14 -0
- package/dist/lib.cjs/types/ui/components/Modal/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Otp/Otp.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/Otp/Otp.type.d.ts +22 -0
- package/dist/lib.cjs/types/ui/components/Otp/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/PulseLoader/PulseLoader.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/PulseLoader/index.d.ts +1 -0
- package/dist/lib.cjs/types/ui/components/Root/Root.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/Root/Root.type.d.ts +27 -0
- package/dist/lib.cjs/types/ui/components/Root/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/SocialLoginList/SocialLoginList.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/SocialLoginList/SocialLoginList.type.d.ts +11 -0
- package/dist/lib.cjs/types/ui/components/SocialLoginList/index.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Toast/Toast.d.ts +2 -0
- package/dist/lib.cjs/types/ui/components/Toast/index.d.ts +1 -0
- package/dist/lib.cjs/types/ui/components/Widget/Widget.d.ts +3 -0
- package/dist/lib.cjs/types/ui/components/{Modal.d.ts → Widget/Widget.type.d.ts} +4 -5
- package/dist/lib.cjs/types/ui/components/Widget/index.d.ts +1 -0
- package/dist/lib.cjs/types/ui/config.d.ts +4 -1
- package/dist/lib.cjs/types/ui/constants.d.ts +13 -0
- package/dist/lib.cjs/types/ui/context/RootContext.d.ts +18 -0
- package/dist/lib.cjs/types/ui/handlers/AbstractHandler.d.ts +20 -0
- package/dist/lib.cjs/types/ui/handlers/EmailPasswordlessHandler.d.ts +8 -0
- package/dist/lib.cjs/types/ui/handlers/SmsPasswordlessHandler.d.ts +9 -0
- package/dist/lib.cjs/types/ui/handlers/factory.d.ts +5 -0
- package/dist/lib.cjs/types/ui/interfaces.d.ts +115 -14
- package/dist/lib.cjs/types/ui/loginModal.d.ts +9 -7
- package/dist/lib.cjs/types/ui/utils.d.ts +17 -2
- package/dist/lib.esm/node_modules/style-inject/dist/style-inject.es.js +1 -1
- package/dist/lib.esm/packages/modal/src/modalManager.js +203 -145
- package/dist/lib.esm/packages/modal/src/ui/components/BottomSheet/BottomSheet.js +58 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Button/Button.js +48 -24
- package/dist/lib.esm/packages/modal/src/ui/components/Button/Button.type.js +6 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Button/ButtonSocial/ButtonSocial.js +51 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Button/ButtonWallet/ButtonWallet.js +66 -0
- package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWallet.js +200 -0
- package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWalletChainFilter/ConnectWalletChainFilter.js +63 -0
- package/dist/lib.esm/packages/modal/src/ui/components/{ExternalWallet/ExternalWalletChainNamespace.js → ConnectWallet/ConnectWalletChainNamespaceSelect/ConnectWalletChainNamespaceSelect.js} +29 -31
- package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWalletHeader/ConnectWalletHeader.js +47 -0
- package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWalletList/ConnectWalletList.js +138 -0
- package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWalletQrCode/ConnectWalletQrCode.js +91 -0
- package/dist/lib.esm/packages/modal/src/ui/components/ConnectWallet/ConnectWalletSearch/ConnectWalletSearch.js +56 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Embed/Embed.js +68 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Footer/Footer.js +51 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Image/Image.js +87 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Loader/Loader.js +152 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Login/Login.js +489 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Login/LoginOtp/LoginOtp.js +115 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Login/LoginPasswordLess/LoginPasswordLess.js +115 -0
- package/dist/lib.esm/packages/modal/src/ui/components/LoginHint/LoginHint.js +50 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Modal/Modal.js +85 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Otp/Otp.js +188 -0
- package/dist/lib.esm/packages/modal/src/ui/components/PulseLoader/PulseLoader.js +16 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Root/Root.js +458 -0
- package/dist/lib.esm/packages/modal/src/ui/components/SocialLoginList/SocialLoginList.js +154 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Toast/Toast.js +68 -0
- package/dist/lib.esm/packages/modal/src/ui/components/Widget/Widget.js +233 -0
- package/dist/lib.esm/packages/modal/src/ui/config.js +10 -3
- package/dist/lib.esm/packages/modal/src/ui/constants.js +13 -0
- package/dist/lib.esm/packages/modal/src/ui/context/RootContext.js +18 -0
- package/dist/lib.esm/packages/modal/src/ui/css/index.css.js +6 -0
- package/dist/lib.esm/packages/modal/src/ui/handlers/AbstractHandler.js +115 -0
- package/dist/lib.esm/packages/modal/src/ui/handlers/EmailPasswordlessHandler.js +52 -0
- package/dist/lib.esm/packages/modal/src/ui/handlers/SmsPasswordlessHandler.js +55 -0
- package/dist/lib.esm/packages/modal/src/ui/handlers/factory.js +17 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/dutch.json.js +37 -3
- package/dist/lib.esm/packages/modal/src/ui/i18n/english.json.js +37 -3
- package/dist/lib.esm/packages/modal/src/ui/i18n/french.json.js +37 -3
- package/dist/lib.esm/packages/modal/src/ui/i18n/german.json.js +37 -3
- package/dist/lib.esm/packages/modal/src/ui/i18n/japanese.json.js +37 -3
- package/dist/lib.esm/packages/modal/src/ui/i18n/korean.json.js +37 -3
- package/dist/lib.esm/packages/modal/src/ui/i18n/mandarin.json.js +37 -3
- package/dist/lib.esm/packages/modal/src/ui/i18n/portuguese.json.js +37 -3
- package/dist/lib.esm/packages/modal/src/ui/i18n/spanish.json.js +37 -3
- package/dist/lib.esm/packages/modal/src/ui/i18n/turkish.json.js +37 -3
- package/dist/lib.esm/packages/modal/src/ui/interfaces.js +8 -9
- package/dist/lib.esm/packages/modal/src/ui/loginModal.js +70 -45
- package/dist/lib.esm/packages/modal/src/ui/utils.js +105 -3
- package/dist/modal.umd.min.js +1 -1
- package/dist/modal.umd.min.js.LICENSE.txt +8 -8
- package/package.json +16 -11
- package/dist/lib.cjs/packages/modal/src/ui/assets/arrow-left-dark.svg.js +0 -7
- package/dist/lib.cjs/packages/modal/src/ui/assets/arrow-left-light.svg.js +0 -7
- package/dist/lib.cjs/packages/modal/src/ui/assets/x-dark.svg.js +0 -7
- package/dist/lib.cjs/packages/modal/src/ui/assets/x-light.svg.js +0 -7
- package/dist/lib.cjs/packages/modal/src/ui/components/AdapterLoader.js +0 -108
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/styles.css.js +0 -8
- package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallet/ExternalWalletButton.js +0 -44
- package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallet/ExternalWalletConnect.js +0 -67
- package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallet/ExternalWalletDetails.js +0 -43
- package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallet/ExternalWalletHeader.js +0 -46
- package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallet/ExternalWalletInstall.js +0 -167
- package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallets.js +0 -279
- package/dist/lib.cjs/packages/modal/src/ui/components/Footer.js +0 -20
- package/dist/lib.cjs/packages/modal/src/ui/components/Header.js +0 -81
- package/dist/lib.cjs/packages/modal/src/ui/components/Icon.js +0 -73
- package/dist/lib.cjs/packages/modal/src/ui/components/Image.js +0 -51
- package/dist/lib.cjs/packages/modal/src/ui/components/Loader.js +0 -59
- package/dist/lib.cjs/packages/modal/src/ui/components/Modal.js +0 -278
- package/dist/lib.cjs/packages/modal/src/ui/components/SelfCustodyViaWeb3Auth.js +0 -30
- package/dist/lib.cjs/packages/modal/src/ui/components/SocialLoginPasswordless.js +0 -150
- package/dist/lib.cjs/packages/modal/src/ui/components/SocialLogins.js +0 -153
- package/dist/lib.cjs/packages/modal/src/ui/components/WalletConnect.js +0 -84
- package/dist/lib.cjs/packages/modal/src/ui/css/web3auth.css.js +0 -8
- package/dist/lib.cjs/types/ui/components/AdapterLoader.d.ts +0 -11
- package/dist/lib.cjs/types/ui/components/ExternalWallet/ExternalWalletButton.d.ts +0 -7
- package/dist/lib.cjs/types/ui/components/ExternalWallet/ExternalWalletChainNamespace.d.ts +0 -9
- package/dist/lib.cjs/types/ui/components/ExternalWallet/ExternalWalletConnect.d.ts +0 -9
- package/dist/lib.cjs/types/ui/components/ExternalWallet/ExternalWalletDetails.d.ts +0 -10
- package/dist/lib.cjs/types/ui/components/ExternalWallet/ExternalWalletHeader.d.ts +0 -8
- package/dist/lib.cjs/types/ui/components/ExternalWallet/ExternalWalletInstall.d.ts +0 -8
- package/dist/lib.cjs/types/ui/components/ExternalWallets.d.ts +0 -15
- package/dist/lib.cjs/types/ui/components/Footer.d.ts +0 -1
- package/dist/lib.cjs/types/ui/components/Header.d.ts +0 -8
- package/dist/lib.cjs/types/ui/components/Icon.d.ts +0 -9
- package/dist/lib.cjs/types/ui/components/Loader.d.ts +0 -10
- package/dist/lib.cjs/types/ui/components/SelfCustodyViaWeb3Auth.d.ts +0 -1
- package/dist/lib.cjs/types/ui/components/SocialLoginPasswordless.d.ts +0 -14
- package/dist/lib.cjs/types/ui/components/SocialLogins.d.ts +0 -10
- package/dist/lib.cjs/types/ui/components/WalletConnect.d.ts +0 -8
- package/dist/lib.esm/packages/modal/src/ui/assets/arrow-left-dark.svg.js +0 -5
- package/dist/lib.esm/packages/modal/src/ui/assets/arrow-left-light.svg.js +0 -5
- package/dist/lib.esm/packages/modal/src/ui/assets/x-dark.svg.js +0 -5
- package/dist/lib.esm/packages/modal/src/ui/assets/x-light.svg.js +0 -5
- package/dist/lib.esm/packages/modal/src/ui/components/AdapterLoader.js +0 -106
- package/dist/lib.esm/packages/modal/src/ui/components/Button/styles.css.js +0 -6
- package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallet/ExternalWalletButton.js +0 -42
- package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallet/ExternalWalletConnect.js +0 -65
- package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallet/ExternalWalletDetails.js +0 -44
- package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallet/ExternalWalletHeader.js +0 -44
- package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallet/ExternalWalletInstall.js +0 -165
- package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallets.js +0 -281
- package/dist/lib.esm/packages/modal/src/ui/components/Footer.js +0 -18
- package/dist/lib.esm/packages/modal/src/ui/components/Header.js +0 -79
- package/dist/lib.esm/packages/modal/src/ui/components/Icon.js +0 -71
- package/dist/lib.esm/packages/modal/src/ui/components/Image.js +0 -49
- package/dist/lib.esm/packages/modal/src/ui/components/Loader.js +0 -57
- package/dist/lib.esm/packages/modal/src/ui/components/Modal.js +0 -277
- package/dist/lib.esm/packages/modal/src/ui/components/SelfCustodyViaWeb3Auth.js +0 -28
- package/dist/lib.esm/packages/modal/src/ui/components/SocialLoginPasswordless.js +0 -148
- package/dist/lib.esm/packages/modal/src/ui/components/SocialLogins.js +0 -152
- package/dist/lib.esm/packages/modal/src/ui/components/WalletConnect.js +0 -82
- package/dist/lib.esm/packages/modal/src/ui/css/web3auth.css.js +0 -6
package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallet/ExternalWalletDetails.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import ExternalWalletChainNamespace from './ExternalWalletChainNamespace.js';
|
|
2
|
-
import ExternalWalletConnect from './ExternalWalletConnect.js';
|
|
3
|
-
import ExternalWalletInstall from './ExternalWalletInstall.js';
|
|
4
|
-
import { jsx } from 'react/jsx-runtime';
|
|
5
|
-
|
|
6
|
-
function ExternalWalletDetail(props) {
|
|
7
|
-
const {
|
|
8
|
-
connectButton,
|
|
9
|
-
walletConnectUri,
|
|
10
|
-
goBack,
|
|
11
|
-
closeModal,
|
|
12
|
-
handleExternalWalletClick
|
|
13
|
-
} = props;
|
|
14
|
-
|
|
15
|
-
// Select chain namespace for injected wallets
|
|
16
|
-
if (connectButton.hasInjectedWallet) {
|
|
17
|
-
return /*#__PURE__*/jsx(ExternalWalletChainNamespace, {
|
|
18
|
-
handleExternalWalletClick: handleExternalWalletClick,
|
|
19
|
-
button: connectButton,
|
|
20
|
-
goBack: goBack,
|
|
21
|
-
closeModal: closeModal
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
return /*#__PURE__*/jsx("div", {
|
|
25
|
-
children: connectButton.hasWalletConnect ?
|
|
26
|
-
/*#__PURE__*/
|
|
27
|
-
// Wallet Connect
|
|
28
|
-
jsx(ExternalWalletConnect, {
|
|
29
|
-
connectButton: connectButton,
|
|
30
|
-
walletConnectUri: walletConnectUri,
|
|
31
|
-
goBack: goBack,
|
|
32
|
-
closeModal: closeModal
|
|
33
|
-
}) :
|
|
34
|
-
/*#__PURE__*/
|
|
35
|
-
// Download wallets
|
|
36
|
-
jsx(ExternalWalletInstall, {
|
|
37
|
-
connectButton: connectButton,
|
|
38
|
-
goBack: goBack,
|
|
39
|
-
closeModal: closeModal
|
|
40
|
-
})
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export { ExternalWalletDetail as default };
|
package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallet/ExternalWalletHeader.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import Icon from '../Icon.js';
|
|
2
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
|
|
4
|
-
function ExternalWalletHeader(props) {
|
|
5
|
-
const {
|
|
6
|
-
title,
|
|
7
|
-
goBack,
|
|
8
|
-
closeModal,
|
|
9
|
-
disableBackButton
|
|
10
|
-
} = props;
|
|
11
|
-
return /*#__PURE__*/jsxs("div", {
|
|
12
|
-
className: "w3a--flex w3a--flex-row w3a--justify-center w3a--items-center w3a--gap-1",
|
|
13
|
-
children: [/*#__PURE__*/jsx("div", {
|
|
14
|
-
className: "w3a--flex-grow-1 w3a--flex-shrink-0 w3a--items-center w3a--justify-start w3a--mr-auto",
|
|
15
|
-
children: !disableBackButton && /*#__PURE__*/jsx("button", {
|
|
16
|
-
type: "button",
|
|
17
|
-
className: "w3a-external-back w3ajs-external-back",
|
|
18
|
-
onClick: goBack,
|
|
19
|
-
children: /*#__PURE__*/jsx(Icon, {
|
|
20
|
-
iconName: "arrow-left-light",
|
|
21
|
-
darkIconName: "arrow-left-dark",
|
|
22
|
-
width: "16",
|
|
23
|
-
height: "16"
|
|
24
|
-
})
|
|
25
|
-
})
|
|
26
|
-
}), /*#__PURE__*/jsx("div", {
|
|
27
|
-
className: "w3a-header__title w3a--flex-grow-0 w3a--flex-shrink w3a--truncate w3a--mr-6",
|
|
28
|
-
children: title
|
|
29
|
-
}), /*#__PURE__*/jsx("div", {
|
|
30
|
-
className: "w3a--flex-grow-1 w3a--flex-shrink-0 w3a--items-center w3a--justify-end w3a--ml-auto",
|
|
31
|
-
children: /*#__PURE__*/jsx("button", {
|
|
32
|
-
type: "button",
|
|
33
|
-
onClick: closeModal,
|
|
34
|
-
className: "w3a-header__button_wallet w3ajs-close-btn",
|
|
35
|
-
children: /*#__PURE__*/jsx(Icon, {
|
|
36
|
-
iconName: "x-light",
|
|
37
|
-
darkIconName: "x-dark"
|
|
38
|
-
})
|
|
39
|
-
})
|
|
40
|
-
})]
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export { ExternalWalletHeader as default };
|
package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallet/ExternalWalletInstall.js
DELETED
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import Bowser from 'bowser';
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import i18nInstance from '../../localeImport.js';
|
|
5
|
-
import Button from '../Button/Button.js';
|
|
6
|
-
import Image from '../Image.js';
|
|
7
|
-
import ExternalWalletHeader from './ExternalWalletHeader.js';
|
|
8
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
9
|
-
|
|
10
|
-
const getBrowserExtensionUrl = (browserType, walletId) => {
|
|
11
|
-
if (walletId !== null && walletId !== void 0 && walletId.startsWith("https://")) return walletId;
|
|
12
|
-
switch (browserType) {
|
|
13
|
-
case "chrome":
|
|
14
|
-
return `https://chrome.google.com/webstore/detail/${walletId}`;
|
|
15
|
-
case "firefox":
|
|
16
|
-
return `https://addons.mozilla.org/firefox/addon/${walletId}`;
|
|
17
|
-
case "edge":
|
|
18
|
-
return `https://microsoftedge.microsoft.com/addons/detail/${walletId}`;
|
|
19
|
-
default:
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
const getMobileInstallLink = (os, appId) => {
|
|
24
|
-
if (appId !== null && appId !== void 0 && appId.includes("https://")) {
|
|
25
|
-
return appId;
|
|
26
|
-
}
|
|
27
|
-
switch (os) {
|
|
28
|
-
case "android":
|
|
29
|
-
return `https://play.google.com/store/apps/details?id=${appId}`;
|
|
30
|
-
case "ios":
|
|
31
|
-
return `https://apps.apple.com/app/safepal-wallet/${appId}`;
|
|
32
|
-
default:
|
|
33
|
-
return "";
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
const getOsName = os => {
|
|
37
|
-
switch (os) {
|
|
38
|
-
case "ios":
|
|
39
|
-
return "iOS";
|
|
40
|
-
case "android":
|
|
41
|
-
return "Android";
|
|
42
|
-
default:
|
|
43
|
-
return "";
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
const getBrowserName = browser => {
|
|
47
|
-
return browser.charAt(0).toUpperCase() + browser.slice(1);
|
|
48
|
-
};
|
|
49
|
-
function ExternalWalletInstall(props) {
|
|
50
|
-
const {
|
|
51
|
-
connectButton,
|
|
52
|
-
goBack,
|
|
53
|
-
closeModal
|
|
54
|
-
} = props;
|
|
55
|
-
const [t] = useTranslation(undefined, {
|
|
56
|
-
i18n: i18nInstance
|
|
57
|
-
});
|
|
58
|
-
const deviceDetails = useMemo(() => {
|
|
59
|
-
const browser = Bowser.getParser(window.navigator.userAgent);
|
|
60
|
-
return {
|
|
61
|
-
platform: browser.getPlatformType(),
|
|
62
|
-
browser: browser.getBrowserName().toLowerCase(),
|
|
63
|
-
os: browser.getOSName()
|
|
64
|
-
};
|
|
65
|
-
}, []);
|
|
66
|
-
const mobileInstallLinks = () => {
|
|
67
|
-
const installConfig = connectButton.walletRegistryItem.app || {};
|
|
68
|
-
const installLinks = Object.keys(installConfig).reduce((acc, os) => {
|
|
69
|
-
if (!["android", "ios"].includes(os)) return acc;
|
|
70
|
-
const appId = installConfig[os];
|
|
71
|
-
if (!appId) return acc;
|
|
72
|
-
const appUrl = getMobileInstallLink(os, appId);
|
|
73
|
-
if (!appUrl) return acc;
|
|
74
|
-
const logoLight = `${os}-light`;
|
|
75
|
-
const logoDark = `${os}-dark`;
|
|
76
|
-
acc.push(/*#__PURE__*/jsx("li", {
|
|
77
|
-
className: "w3a--w-full",
|
|
78
|
-
children: /*#__PURE__*/jsx("a", {
|
|
79
|
-
href: appUrl,
|
|
80
|
-
rel: "noopener noreferrer",
|
|
81
|
-
target: "_blank",
|
|
82
|
-
children: /*#__PURE__*/jsxs(Button, {
|
|
83
|
-
type: "button",
|
|
84
|
-
variant: "tertiary",
|
|
85
|
-
className: "w3a--w-full !w3a--justify-start w3a--flex w3a--items-center w3a--gap-2 wallet-link-btn",
|
|
86
|
-
children: [/*#__PURE__*/jsx(Image, {
|
|
87
|
-
imageId: logoLight,
|
|
88
|
-
darkImageId: logoDark,
|
|
89
|
-
hoverImageId: logoLight,
|
|
90
|
-
darkHoverImageId: logoDark,
|
|
91
|
-
height: "28",
|
|
92
|
-
width: "28",
|
|
93
|
-
isButton: true
|
|
94
|
-
}), /*#__PURE__*/jsx("span", {
|
|
95
|
-
className: "w3a--text-sm w3a--font-medium",
|
|
96
|
-
children: t("modal.external.install-mobile-app", {
|
|
97
|
-
os: getOsName(os)
|
|
98
|
-
})
|
|
99
|
-
})]
|
|
100
|
-
})
|
|
101
|
-
})
|
|
102
|
-
}, os));
|
|
103
|
-
return acc;
|
|
104
|
-
}, []);
|
|
105
|
-
return installLinks;
|
|
106
|
-
};
|
|
107
|
-
const desktopInstallLinks = () => {
|
|
108
|
-
// if browser is brave, use chrome extension
|
|
109
|
-
const browserType = deviceDetails.browser === "brave" ? "chrome" : deviceDetails.browser;
|
|
110
|
-
const browserExtensionConfig = connectButton.walletRegistryItem.app || {};
|
|
111
|
-
const extensionForCurrentBrowser = browserExtensionConfig.browser && browserExtensionConfig.browser.includes(browserType) ? browserExtensionConfig.browser : undefined;
|
|
112
|
-
const browserExtensionId = browserExtensionConfig[browserType] || extensionForCurrentBrowser;
|
|
113
|
-
const browserExtensionUrl = browserExtensionId ? getBrowserExtensionUrl(browserType, browserExtensionId) : null;
|
|
114
|
-
const installLink = browserExtensionUrl ? /*#__PURE__*/jsx("li", {
|
|
115
|
-
children: /*#__PURE__*/jsx("a", {
|
|
116
|
-
href: browserExtensionUrl,
|
|
117
|
-
rel: "noopener noreferrer",
|
|
118
|
-
target: "_blank",
|
|
119
|
-
children: /*#__PURE__*/jsxs(Button, {
|
|
120
|
-
type: "button",
|
|
121
|
-
variant: "tertiary",
|
|
122
|
-
className: "w3a--w-full !w3a--justify-start w3a--flex w3a--items-center w3a--gap-2 wallet-link-btn",
|
|
123
|
-
children: [/*#__PURE__*/jsx(Image, {
|
|
124
|
-
imageId: deviceDetails.browser,
|
|
125
|
-
darkImageId: deviceDetails.browser,
|
|
126
|
-
hoverImageId: deviceDetails.browser,
|
|
127
|
-
darkHoverImageId: deviceDetails.browser,
|
|
128
|
-
height: "30",
|
|
129
|
-
width: "30",
|
|
130
|
-
isButton: true
|
|
131
|
-
}), /*#__PURE__*/jsx("span", {
|
|
132
|
-
className: "w3a--text-sm w3a--font-medium",
|
|
133
|
-
children: t("modal.external.install-browser-extension", {
|
|
134
|
-
browser: getBrowserName(deviceDetails.browser)
|
|
135
|
-
})
|
|
136
|
-
})]
|
|
137
|
-
})
|
|
138
|
-
})
|
|
139
|
-
}, deviceDetails.browser) : null;
|
|
140
|
-
return [installLink, ...mobileInstallLinks()];
|
|
141
|
-
};
|
|
142
|
-
return /*#__PURE__*/jsxs("div", {
|
|
143
|
-
children: [/*#__PURE__*/jsx(ExternalWalletHeader, {
|
|
144
|
-
title: `${t("modal.external.get")} ${connectButton.displayName}`,
|
|
145
|
-
goBack: goBack,
|
|
146
|
-
closeModal: closeModal
|
|
147
|
-
}), /*#__PURE__*/jsx("div", {
|
|
148
|
-
className: "w3a--flex w3a--justify-center w3a--my-6",
|
|
149
|
-
children: /*#__PURE__*/jsx(Image, {
|
|
150
|
-
imageId: `login-${connectButton.name}`,
|
|
151
|
-
hoverImageId: `login-${connectButton.name}`,
|
|
152
|
-
fallbackImageId: "wallet",
|
|
153
|
-
height: "100",
|
|
154
|
-
width: "100",
|
|
155
|
-
isButton: true,
|
|
156
|
-
extension: connectButton.imgExtension
|
|
157
|
-
})
|
|
158
|
-
}), /*#__PURE__*/jsx("ul", {
|
|
159
|
-
className: "w3a--flex w3a--flex-col w3a--gap-3",
|
|
160
|
-
children: deviceDetails.platform === "desktop" ? desktopInstallLinks() : mobileInstallLinks()
|
|
161
|
-
})]
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
export { ExternalWalletInstall as default };
|
|
@@ -1,281 +0,0 @@
|
|
|
1
|
-
import { log, WALLET_CONNECTORS } from '@web3auth/no-modal';
|
|
2
|
-
import Bowser from 'bowser';
|
|
3
|
-
import { useState, useMemo, useEffect } from 'react';
|
|
4
|
-
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { MODAL_STATUS } from '../interfaces.js';
|
|
6
|
-
import i18nInstance from '../localeImport.js';
|
|
7
|
-
import ExternalWalletButton from './ExternalWallet/ExternalWalletButton.js';
|
|
8
|
-
import ExternalWalletDetail from './ExternalWallet/ExternalWalletDetails.js';
|
|
9
|
-
import ExternalWalletHeader from './ExternalWallet/ExternalWalletHeader.js';
|
|
10
|
-
import Loader from './Loader.js';
|
|
11
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
12
|
-
|
|
13
|
-
function formatIOSMobile(params) {
|
|
14
|
-
const encodedUri = encodeURIComponent(params.uri);
|
|
15
|
-
if (params.link.startsWith("http")) return `${params.link}/wc?uri=${encodedUri}`;
|
|
16
|
-
if (params.link) return `${params.link}wc?uri=${encodedUri}`;
|
|
17
|
-
return "";
|
|
18
|
-
}
|
|
19
|
-
function ExternalWallets(props) {
|
|
20
|
-
const {
|
|
21
|
-
hideExternalWallets,
|
|
22
|
-
handleExternalWalletClick,
|
|
23
|
-
closeModal,
|
|
24
|
-
config = {},
|
|
25
|
-
walletConnectUri,
|
|
26
|
-
showBackButton,
|
|
27
|
-
modalStatus,
|
|
28
|
-
chainNamespaces,
|
|
29
|
-
walletRegistry
|
|
30
|
-
} = props;
|
|
31
|
-
const [externalButtons, setExternalButtons] = useState([]);
|
|
32
|
-
const [totalExternalWallets, setTotalExternalWallets] = useState(0);
|
|
33
|
-
const [selectedButton, setSelectedButton] = useState(null);
|
|
34
|
-
const [walletSearch, setWalletSearch] = useState("");
|
|
35
|
-
const [t] = useTranslation(undefined, {
|
|
36
|
-
i18n: i18nInstance
|
|
37
|
-
});
|
|
38
|
-
const walletDiscoverySupported = useMemo(() => {
|
|
39
|
-
const supported = walletRegistry && (Object.keys(walletRegistry.default).length > 0 || Object.keys(walletRegistry.others).length > 0);
|
|
40
|
-
return supported;
|
|
41
|
-
}, [walletRegistry]);
|
|
42
|
-
const deviceDetails = useMemo(() => {
|
|
43
|
-
const browser = Bowser.getParser(window.navigator.userAgent);
|
|
44
|
-
return {
|
|
45
|
-
platform: browser.getPlatformType(),
|
|
46
|
-
os: browser.getOSName(),
|
|
47
|
-
browser: browser.getBrowserName().toLowerCase()
|
|
48
|
-
};
|
|
49
|
-
}, []);
|
|
50
|
-
const handleWalletSearch = e => {
|
|
51
|
-
setWalletSearch(e.target.value);
|
|
52
|
-
};
|
|
53
|
-
const adapterVisibilityMap = useMemo(() => {
|
|
54
|
-
const canShowMap = {};
|
|
55
|
-
Object.keys(config).forEach(adapter => {
|
|
56
|
-
const adapterConfig = config[adapter];
|
|
57
|
-
if (!adapterConfig.showOnModal) {
|
|
58
|
-
canShowMap[adapter] = false;
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
if (deviceDetails.platform === "desktop" && adapterConfig.showOnDesktop) {
|
|
62
|
-
canShowMap[adapter] = true;
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
if ((deviceDetails.platform === "mobile" || deviceDetails.platform === "tablet") && adapterConfig.showOnMobile) {
|
|
66
|
-
canShowMap[adapter] = true;
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
canShowMap[adapter] = false;
|
|
70
|
-
});
|
|
71
|
-
log.debug("adapter visibility map", canShowMap);
|
|
72
|
-
return canShowMap;
|
|
73
|
-
}, [config, deviceDetails.platform]);
|
|
74
|
-
useEffect(() => {
|
|
75
|
-
var _config$WALLET_CONNEC;
|
|
76
|
-
log.debug("loaded external wallets", config, walletConnectUri);
|
|
77
|
-
const wcAvailable = (((_config$WALLET_CONNEC = config[WALLET_CONNECTORS.WALLET_CONNECT_V2]) === null || _config$WALLET_CONNEC === void 0 ? void 0 : _config$WALLET_CONNEC.showOnModal) || false) !== false;
|
|
78
|
-
if (wcAvailable && !walletConnectUri) {
|
|
79
|
-
handleExternalWalletClick({
|
|
80
|
-
connector: WALLET_CONNECTORS.WALLET_CONNECT_V2
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
}, [config, handleExternalWalletClick, walletConnectUri]);
|
|
84
|
-
useEffect(() => {
|
|
85
|
-
if (walletDiscoverySupported) {
|
|
86
|
-
const isWalletConnectAdapterIncluded = Object.keys(config).some(adapter => adapter === WALLET_CONNECTORS.WALLET_CONNECT_V2);
|
|
87
|
-
const generateWalletButtons = wallets => {
|
|
88
|
-
return Object.keys(wallets).reduce((acc, wallet) => {
|
|
89
|
-
var _walletRegistryItem$c, _walletRegistryItem$i, _config$wallet, _walletRegistryItem$w;
|
|
90
|
-
if (adapterVisibilityMap[wallet] === false) return acc;
|
|
91
|
-
// Metamask is always visible in the main screen, no need to show it in the external wallets list
|
|
92
|
-
if (wallet === WALLET_CONNECTORS.METAMASK) return acc;
|
|
93
|
-
const walletRegistryItem = wallets[wallet];
|
|
94
|
-
let href = "";
|
|
95
|
-
if (deviceDetails.platform === Bowser.PLATFORMS_MAP.mobile) {
|
|
96
|
-
var _walletRegistryItem$m, _walletRegistryItem$m2;
|
|
97
|
-
const universalLink = walletRegistryItem === null || walletRegistryItem === void 0 || (_walletRegistryItem$m = walletRegistryItem.mobile) === null || _walletRegistryItem$m === void 0 ? void 0 : _walletRegistryItem$m.universal;
|
|
98
|
-
const deepLink = walletRegistryItem === null || walletRegistryItem === void 0 || (_walletRegistryItem$m2 = walletRegistryItem.mobile) === null || _walletRegistryItem$m2 === void 0 ? void 0 : _walletRegistryItem$m2.native;
|
|
99
|
-
href = universalLink || deepLink;
|
|
100
|
-
}
|
|
101
|
-
const registryNamespaces = new Set((_walletRegistryItem$c = walletRegistryItem.chains) === null || _walletRegistryItem$c === void 0 ? void 0 : _walletRegistryItem$c.map(chain => chain.split(":")[0]));
|
|
102
|
-
const injectedChainNamespaces = new Set((_walletRegistryItem$i = walletRegistryItem.injected) === null || _walletRegistryItem$i === void 0 ? void 0 : _walletRegistryItem$i.map(injected => injected.namespace));
|
|
103
|
-
const availableChainNamespaces = chainNamespaces.filter(x => registryNamespaces.has(x) || injectedChainNamespaces.has(x));
|
|
104
|
-
const button = {
|
|
105
|
-
name: wallet,
|
|
106
|
-
displayName: walletRegistryItem.name,
|
|
107
|
-
href,
|
|
108
|
-
hasInjectedWallet: ((_config$wallet = config[wallet]) === null || _config$wallet === void 0 ? void 0 : _config$wallet.isInjected) || false,
|
|
109
|
-
hasWalletConnect: isWalletConnectAdapterIncluded && ((_walletRegistryItem$w = walletRegistryItem.walletConnect) === null || _walletRegistryItem$w === void 0 || (_walletRegistryItem$w = _walletRegistryItem$w.sdks) === null || _walletRegistryItem$w === void 0 ? void 0 : _walletRegistryItem$w.includes("sign_v2")),
|
|
110
|
-
hasInstallLinks: Object.keys(walletRegistryItem.app || {}).length > 0,
|
|
111
|
-
walletRegistryItem,
|
|
112
|
-
imgExtension: walletRegistryItem.imgExtension || "svg",
|
|
113
|
-
chainNamespaces: availableChainNamespaces
|
|
114
|
-
};
|
|
115
|
-
// const isBrowserExtensionAvailable = walletRegistryItem.app?.chrome || walletRegistryItem.app?.firefox || walletRegistryItem.app?.edge;
|
|
116
|
-
if (!button.hasInjectedWallet && !button.hasWalletConnect && !button.hasInstallLinks) return acc;
|
|
117
|
-
if (availableChainNamespaces.length === 0) return acc;
|
|
118
|
-
acc.push(button);
|
|
119
|
-
return acc;
|
|
120
|
-
}, []);
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
// Generate buttons for default and other wallets
|
|
124
|
-
const defaultButtons = generateWalletButtons(walletRegistry.default);
|
|
125
|
-
const otherButtons = generateWalletButtons(walletRegistry.others);
|
|
126
|
-
|
|
127
|
-
// Generate custom adapter buttons
|
|
128
|
-
const customAdapterButtons = Object.keys(config).reduce((acc, adapter) => {
|
|
129
|
-
// Metamask is always visible in the main screen, no need to show it in the external wallets list
|
|
130
|
-
if (adapter === WALLET_CONNECTORS.METAMASK) return acc;
|
|
131
|
-
if (![WALLET_CONNECTORS.WALLET_CONNECT_V2].includes(adapter) && !config[adapter].isInjected && adapterVisibilityMap[adapter]) {
|
|
132
|
-
log.debug("custom adapter", adapter, config[adapter]);
|
|
133
|
-
acc.push({
|
|
134
|
-
name: adapter,
|
|
135
|
-
displayName: config[adapter].label || adapter,
|
|
136
|
-
hasInjectedWallet: false,
|
|
137
|
-
hasWalletConnect: false,
|
|
138
|
-
hasInstallLinks: false
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
return acc;
|
|
142
|
-
}, []);
|
|
143
|
-
const allButtons = [...defaultButtons, ...otherButtons];
|
|
144
|
-
|
|
145
|
-
// Filter and set external buttons based on search input
|
|
146
|
-
if (walletSearch) {
|
|
147
|
-
const filteredList = allButtons.concat(customAdapterButtons).filter(button => button.name.toLowerCase().includes(walletSearch.toLowerCase()));
|
|
148
|
-
log.debug("filteredLists", filteredList);
|
|
149
|
-
setExternalButtons(filteredList);
|
|
150
|
-
} else {
|
|
151
|
-
const finalDefaultButtons = defaultButtons.length > 0 ? defaultButtons : allButtons.slice(0, 10);
|
|
152
|
-
const defaultButtonKeys = new Set(finalDefaultButtons.map(button => button.name));
|
|
153
|
-
const sortedButtons = [...allButtons.filter(button => button.hasInjectedWallet && defaultButtonKeys.has(button.name)), ...customAdapterButtons, ...allButtons.filter(button => !button.hasInjectedWallet && defaultButtonKeys.has(button.name))];
|
|
154
|
-
setExternalButtons(sortedButtons);
|
|
155
|
-
}
|
|
156
|
-
setTotalExternalWallets(allButtons.length + customAdapterButtons.length);
|
|
157
|
-
log.debug("external buttons", allButtons);
|
|
158
|
-
} else {
|
|
159
|
-
const buttons = Object.keys(config).reduce((acc, adapter) => {
|
|
160
|
-
log.debug("external buttons", adapter, adapterVisibilityMap[adapter]);
|
|
161
|
-
if (![WALLET_CONNECTORS.WALLET_CONNECT_V2].includes(adapter) && adapterVisibilityMap[adapter]) {
|
|
162
|
-
acc.push({
|
|
163
|
-
name: adapter,
|
|
164
|
-
displayName: config[adapter].label || adapter,
|
|
165
|
-
hasInjectedWallet: config[adapter].isInjected,
|
|
166
|
-
hasWalletConnect: false,
|
|
167
|
-
hasInstallLinks: false
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
return acc;
|
|
171
|
-
}, []);
|
|
172
|
-
setExternalButtons(buttons);
|
|
173
|
-
setTotalExternalWallets(buttons.length);
|
|
174
|
-
}
|
|
175
|
-
}, [config, deviceDetails, adapterVisibilityMap, walletRegistry, walletSearch, chainNamespaces, walletDiscoverySupported]);
|
|
176
|
-
const handleWalletClick = button => {
|
|
177
|
-
var _button$chainNamespac;
|
|
178
|
-
// if has injected wallet and single chain namespace, connect to injected wallet
|
|
179
|
-
const isInjectedConnectorAndSingleChainNamespace = button.hasInjectedWallet && ((_button$chainNamespac = button.chainNamespaces) === null || _button$chainNamespac === void 0 ? void 0 : _button$chainNamespac.length) === 1;
|
|
180
|
-
// if doesn't have wallet connect & doesn't have install links, must be a custom connector
|
|
181
|
-
const isCustomConnector = !button.hasInjectedWallet && !button.hasWalletConnect && !button.hasInstallLinks;
|
|
182
|
-
if (isInjectedConnectorAndSingleChainNamespace || isCustomConnector) {
|
|
183
|
-
handleExternalWalletClick({
|
|
184
|
-
connector: button.name
|
|
185
|
-
});
|
|
186
|
-
} else {
|
|
187
|
-
setSelectedButton(button);
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
return /*#__PURE__*/jsx("div", {
|
|
191
|
-
className: `w3ajs-external-wallet w3a-group ${totalExternalWallets === 0 ? "w3a-group-loader-height" : ""}`,
|
|
192
|
-
children: /*#__PURE__*/jsx("div", {
|
|
193
|
-
className: "w3a-external-container w3ajs-external-container",
|
|
194
|
-
children: totalExternalWallets === 0 ? /*#__PURE__*/jsx(Loader, {
|
|
195
|
-
modalStatus: MODAL_STATUS.CONNECTING,
|
|
196
|
-
canEmit: false
|
|
197
|
-
}) : modalStatus === MODAL_STATUS.INITIALIZED && (
|
|
198
|
-
// All wallets
|
|
199
|
-
!selectedButton ? /*#__PURE__*/jsxs(Fragment, {
|
|
200
|
-
children: [/*#__PURE__*/jsx(ExternalWalletHeader, {
|
|
201
|
-
disableBackButton: !showBackButton,
|
|
202
|
-
title: t("modal.external.connect-wallet"),
|
|
203
|
-
goBack: hideExternalWallets,
|
|
204
|
-
closeModal: closeModal
|
|
205
|
-
}), totalExternalWallets > 15 && /*#__PURE__*/jsx("div", {
|
|
206
|
-
className: "w3a--py-4",
|
|
207
|
-
children: /*#__PURE__*/jsx("input", {
|
|
208
|
-
className: "w3a-text-field w3a--w-full",
|
|
209
|
-
name: "passwordless-input",
|
|
210
|
-
required: true,
|
|
211
|
-
value: walletSearch,
|
|
212
|
-
placeholder: t("modal.external.search-wallet", {
|
|
213
|
-
count: totalExternalWallets
|
|
214
|
-
}),
|
|
215
|
-
onFocus: e => {
|
|
216
|
-
e.target.placeholder = "";
|
|
217
|
-
},
|
|
218
|
-
onBlur: e => {
|
|
219
|
-
e.target.placeholder = t("modal.external.search-wallet", {
|
|
220
|
-
count: totalExternalWallets
|
|
221
|
-
});
|
|
222
|
-
},
|
|
223
|
-
onChange: e => handleWalletSearch(e)
|
|
224
|
-
})
|
|
225
|
-
}), externalButtons.length === 0 ? /*#__PURE__*/jsx("div", {
|
|
226
|
-
className: "w3a--flex w3a--w-full w3a--items-center w3a--justify-center w3a--py-6 w3a--text-center w3a--text-app-gray-400 dark:w3a--text-app-gray-500",
|
|
227
|
-
children: t("modal.external.no-wallets-found")
|
|
228
|
-
}) : /*#__PURE__*/jsx("div", {
|
|
229
|
-
className: `w3a-adapter-list-container ${totalExternalWallets < 15 ? "w3a--py-4" : ""}`,
|
|
230
|
-
children: /*#__PURE__*/jsxs("ul", {
|
|
231
|
-
className: "w3a-adapter-list w3ajs-wallet-adapters",
|
|
232
|
-
children: [externalButtons.map(button => {
|
|
233
|
-
return /*#__PURE__*/jsxs("li", {
|
|
234
|
-
className: "w3a-adapter-item w3a-adapter-item--full",
|
|
235
|
-
children: [deviceDetails.platform === "desktop" && /*#__PURE__*/jsx(ExternalWalletButton, {
|
|
236
|
-
button: button,
|
|
237
|
-
handleWalletClick: handleWalletClick
|
|
238
|
-
}), deviceDetails.platform !== "desktop" && (button.href && button.hasWalletConnect && !button.hasInjectedWallet ? /*#__PURE__*/jsx("a", {
|
|
239
|
-
href: button.href ? formatIOSMobile({
|
|
240
|
-
uri: walletConnectUri,
|
|
241
|
-
link: button.href
|
|
242
|
-
}) : walletConnectUri,
|
|
243
|
-
target: "_blank",
|
|
244
|
-
className: "w3a--w-full",
|
|
245
|
-
rel: "noreferrer noopener",
|
|
246
|
-
children: /*#__PURE__*/jsx(ExternalWalletButton, {
|
|
247
|
-
button: button,
|
|
248
|
-
handleWalletClick: handleWalletClick
|
|
249
|
-
})
|
|
250
|
-
}) : /*#__PURE__*/jsx(ExternalWalletButton, {
|
|
251
|
-
button: button,
|
|
252
|
-
handleWalletClick: handleWalletClick
|
|
253
|
-
}))]
|
|
254
|
-
}, button.name + button.displayName);
|
|
255
|
-
}), totalExternalWallets > 10 && !walletSearch && /*#__PURE__*/jsxs("li", {
|
|
256
|
-
className: "w3a-adapter-item--full w3a--mx-auto w3a--my-4 w3a--flex w3a--w-full w3a--flex-col w3a--items-center w3a--justify-center w3a--gap-y-0.5",
|
|
257
|
-
children: [/*#__PURE__*/jsx("p", {
|
|
258
|
-
className: "w3a--text-xs w3a--text-app-gray-500 dark:w3a--text-app-gray-400",
|
|
259
|
-
children: t("modal.external.search-text")
|
|
260
|
-
}), /*#__PURE__*/jsx("p", {
|
|
261
|
-
className: "w3a--text-xs w3a--font-medium w3a--text-app-gray-900 dark:w3a--text-app-white",
|
|
262
|
-
children: t("modal.external.search-subtext")
|
|
263
|
-
})]
|
|
264
|
-
})]
|
|
265
|
-
})
|
|
266
|
-
})]
|
|
267
|
-
}) :
|
|
268
|
-
/*#__PURE__*/
|
|
269
|
-
// Wallet Detail
|
|
270
|
-
jsx(ExternalWalletDetail, {
|
|
271
|
-
connectButton: selectedButton,
|
|
272
|
-
goBack: () => setSelectedButton(null),
|
|
273
|
-
walletConnectUri: walletConnectUri,
|
|
274
|
-
closeModal: closeModal,
|
|
275
|
-
handleExternalWalletClick: handleExternalWalletClick
|
|
276
|
-
}))
|
|
277
|
-
})
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
export { ExternalWallets as default };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import SelfCustodyViaWeb3Auth from './SelfCustodyViaWeb3Auth.js';
|
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
|
|
4
|
-
function Footer() {
|
|
5
|
-
return /*#__PURE__*/jsx("div", {
|
|
6
|
-
className: "w3a-modal__footer",
|
|
7
|
-
children: /*#__PURE__*/jsx("div", {
|
|
8
|
-
className: "w3a-footer",
|
|
9
|
-
children: /*#__PURE__*/jsx("div", {
|
|
10
|
-
children: /*#__PURE__*/jsx("div", {
|
|
11
|
-
children: /*#__PURE__*/jsx(SelfCustodyViaWeb3Auth, {})
|
|
12
|
-
})
|
|
13
|
-
})
|
|
14
|
-
})
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { Footer as default };
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { memo } from 'react';
|
|
2
|
-
import { useTranslation } from 'react-i18next';
|
|
3
|
-
import { DEFAULT_LOGO_DARK, DEFAULT_LOGO_LIGHT } from '../interfaces.js';
|
|
4
|
-
import i18nInstance from '../localeImport.js';
|
|
5
|
-
import Icon from './Icon.js';
|
|
6
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
|
-
|
|
8
|
-
function Header(props) {
|
|
9
|
-
const {
|
|
10
|
-
onClose,
|
|
11
|
-
appLogo,
|
|
12
|
-
appName
|
|
13
|
-
} = props;
|
|
14
|
-
const [t] = useTranslation(undefined, {
|
|
15
|
-
i18n: i18nInstance
|
|
16
|
-
});
|
|
17
|
-
const headerLogo = [DEFAULT_LOGO_DARK, DEFAULT_LOGO_LIGHT].includes(appLogo) ? "" : appLogo;
|
|
18
|
-
const subtitle = t("modal.header-subtitle-name", {
|
|
19
|
-
appName
|
|
20
|
-
});
|
|
21
|
-
return /*#__PURE__*/jsxs("div", {
|
|
22
|
-
className: "w3a-modal__header",
|
|
23
|
-
children: [/*#__PURE__*/jsx("div", {
|
|
24
|
-
className: "w3a-header",
|
|
25
|
-
children: /*#__PURE__*/jsxs("div", {
|
|
26
|
-
children: [headerLogo && /*#__PURE__*/jsx("div", {
|
|
27
|
-
className: "w3a-header__logo",
|
|
28
|
-
children: /*#__PURE__*/jsx("img", {
|
|
29
|
-
src: headerLogo,
|
|
30
|
-
alt: ""
|
|
31
|
-
})
|
|
32
|
-
}), /*#__PURE__*/jsx("div", {
|
|
33
|
-
className: "w3a-header__title",
|
|
34
|
-
children: t("modal.header-title")
|
|
35
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
36
|
-
className: "w3a-header__subtitle",
|
|
37
|
-
children: [subtitle, /*#__PURE__*/jsxs("div", {
|
|
38
|
-
className: "w3a--relative w3a--flex w3a--flex-col w3a--items-center w3a--group w3a--cursor-pointer",
|
|
39
|
-
children: [/*#__PURE__*/jsx(Icon, {
|
|
40
|
-
iconName: "information-circle-light",
|
|
41
|
-
darkIconName: "information-circle"
|
|
42
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
43
|
-
className: "w3a--absolute w3a--top-4 w3a--z-20 w3a--flex-col w3a--items-center w3a--hidden w3a--mb-5 group-hover:w3a--flex",
|
|
44
|
-
children: [/*#__PURE__*/jsx("div", {
|
|
45
|
-
className: "w3a--w-3 w3a--h-3 w3a--ml-[3px] -w3a--mb-2 w3a--rotate-45 w3a--bg-app-gray-50 dark:w3a--bg-app-gray-600"
|
|
46
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
47
|
-
className: `w3a--relative w3a--p-4 w3a--w-[270px] w3a--translate-x-[-16px] w3a--text-xs w3a--leading-none w3a--text-app-white w3a--rounded-md w3a--bg-app-gray-50 dark:w3a--bg-app-gray-600 w3a--shadow-lg ${subtitle.length > 34 ? "-w3a--ml-[100px]" : ""}`,
|
|
48
|
-
children: [/*#__PURE__*/jsx("div", {
|
|
49
|
-
className: "w3a--text-xs w3a--font-medium w3a--mb-1 w3a--text-app-gray-900 dark:w3a--text-app-white",
|
|
50
|
-
children: t("modal.header-tooltip-title")
|
|
51
|
-
}), /*#__PURE__*/jsx("div", {
|
|
52
|
-
className: "w3a--text-xs w3a--text-app-gray-400",
|
|
53
|
-
children: t("modal.header-tooltip-desc")
|
|
54
|
-
})]
|
|
55
|
-
})]
|
|
56
|
-
})]
|
|
57
|
-
})]
|
|
58
|
-
})]
|
|
59
|
-
})
|
|
60
|
-
}), /*#__PURE__*/jsx("button", {
|
|
61
|
-
type: "button",
|
|
62
|
-
onClick: onClose,
|
|
63
|
-
className: "w3a-header__button w3ajs-close-btn ",
|
|
64
|
-
children: /*#__PURE__*/jsx(Icon, {
|
|
65
|
-
iconName: "x-light",
|
|
66
|
-
darkIconName: "x-dark"
|
|
67
|
-
})
|
|
68
|
-
})]
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
const memoizedHeader = /*#__PURE__*/memo(Header, (prevProps, nextProps) => {
|
|
72
|
-
if (prevProps.appLogo !== nextProps.appLogo) {
|
|
73
|
-
return true;
|
|
74
|
-
}
|
|
75
|
-
return false;
|
|
76
|
-
});
|
|
77
|
-
memoizedHeader.displayName = "Header";
|
|
78
|
-
|
|
79
|
-
export { memoizedHeader as default };
|