@dynamic-labs/sdk-react-core 1.1.0-alpha.24 → 1.1.0-alpha.26
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 +27 -0
- package/package.cjs +3 -3
- package/package.js +3 -3
- package/package.json +12 -12
- package/src/index.cjs +4 -0
- package/src/index.d.ts +1 -1
- package/src/index.js +2 -0
- package/src/lib/components/Icon/Icon.cjs +1 -0
- package/src/lib/components/Icon/Icon.js +1 -0
- package/src/lib/components/Icon/Icon.types.d.ts +1 -1
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.cjs +1 -1
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.js +1 -1
- package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +13 -60
- package/src/lib/components/OTPVerificationView/OTPVerificationView.d.ts +1 -0
- package/src/lib/components/OTPVerificationView/OTPVerificationView.js +13 -60
- package/src/lib/components/RetrySendVerificationCodeSection/RetrySendVerificationCodeSection.cjs +97 -0
- package/src/lib/components/RetrySendVerificationCodeSection/RetrySendVerificationCodeSection.d.ts +9 -0
- package/src/lib/components/RetrySendVerificationCodeSection/RetrySendVerificationCodeSection.js +93 -0
- package/src/lib/components/RetrySendVerificationCodeSection/index.d.ts +1 -0
- package/src/lib/components/SocialSignIn/SocialSignIn.cjs +2 -2
- package/src/lib/components/SocialSignIn/SocialSignIn.js +2 -2
- package/src/lib/context/DynamicContext/DynamicContext.cjs +3 -3
- package/src/lib/context/DynamicContext/DynamicContext.js +3 -3
- package/src/lib/context/DynamicContext/helpers/helpers.cjs +1 -0
- package/src/lib/context/DynamicContext/helpers/helpers.js +1 -0
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.cjs +1 -0
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.js +1 -0
- package/src/lib/context/DynamicContext/hooks/useTieCallbacksToEvents/useTieCallbacksToEvents.cjs +4 -0
- package/src/lib/context/DynamicContext/hooks/useTieCallbacksToEvents/useTieCallbacksToEvents.js +4 -0
- package/src/lib/context/DynamicContext/types/index.d.ts +3 -2
- package/src/lib/context/DynamicContext/useCustomerCallbacks/types.d.ts +2 -4
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.cjs +4 -50
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.d.ts +1 -1
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.js +4 -50
- package/src/lib/events/dynamicEvents.d.ts +2 -0
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +1 -2
- package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +1 -2
- package/src/lib/shared/utils/functions/index.d.ts +1 -0
- package/src/lib/shared/utils/functions/providerLabel/index.d.ts +1 -0
- package/src/lib/shared/utils/functions/providerLabel/providerLabel.cjs +15 -0
- package/src/lib/shared/utils/functions/providerLabel/providerLabel.d.ts +2 -0
- package/src/lib/shared/utils/functions/providerLabel/providerLabel.js +11 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/findEmbeddedWalletFromVerifiedCredentials/findEmbeddedWalletFromVerifiedCredentials.cjs +1 -0
- package/src/lib/utils/functions/findEmbeddedWalletFromVerifiedCredentials/findEmbeddedWalletFromVerifiedCredentials.js +1 -0
- package/src/lib/utils/functions/getOauthLoginUrl/getOauthLoginUrl.cjs +4 -0
- package/src/lib/utils/functions/getOauthLoginUrl/getOauthLoginUrl.js +4 -0
- package/src/lib/utils/functions/getReferencedAccount/getReferencedAccount.cjs +1 -0
- package/src/lib/utils/functions/getReferencedAccount/getReferencedAccount.js +1 -0
- package/src/lib/utils/functions/getUserWalletsFromVerifiedCredentials/getUserWalletsFromVerifiedCredentials.cjs +1 -0
- package/src/lib/utils/functions/getUserWalletsFromVerifiedCredentials/getUserWalletsFromVerifiedCredentials.js +1 -0
- package/src/lib/utils/functions/handleUnlinkHelper/handleUnlinkHelper.cjs +1 -1
- package/src/lib/utils/functions/handleUnlinkHelper/handleUnlinkHelper.js +1 -1
- package/src/lib/utils/functions/index.d.ts +0 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +6 -6
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +6 -6
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs +4 -5
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js +4 -5
- package/src/lib/utils/hooks/index.d.ts +1 -0
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +38 -5
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.d.ts +16 -5
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +39 -6
- package/src/lib/utils/hooks/useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.cjs +1 -1
- package/src/lib/utils/hooks/useCreateUserProfileByJWTCallback/useCreateUserProfileByJWTCallback.js +1 -1
- package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.cjs +1 -1
- package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.js +1 -1
- package/src/lib/utils/hooks/useEmbeddedWalletAuthenticator/index.d.ts +1 -0
- package/src/lib/utils/hooks/useEmbeddedWalletAuthenticator/useEmbeddedWalletAuthenticator.cjs +21 -0
- package/src/lib/utils/hooks/useEmbeddedWalletAuthenticator/useEmbeddedWalletAuthenticator.d.ts +4 -0
- package/src/lib/utils/hooks/useEmbeddedWalletAuthenticator/useEmbeddedWalletAuthenticator.js +17 -0
- package/src/lib/utils/hooks/useIsLoggedIn/useIsLoggedIn.cjs +3 -2
- package/src/lib/utils/hooks/useIsLoggedIn/useIsLoggedIn.js +3 -2
- package/src/lib/utils/hooks/useSetWalletConnectorVerifiedCredentials/useSetWalletConnectorVerifiedCredentials.cjs +1 -0
- package/src/lib/utils/hooks/useSetWalletConnectorVerifiedCredentials/useSetWalletConnectorVerifiedCredentials.js +1 -0
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +1 -0
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +1 -0
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs +1 -1
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js +1 -1
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +1 -1
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +1 -1
- package/src/lib/views/AccountExistsView/AccountExistsView.cjs +1 -1
- package/src/lib/views/AccountExistsView/AccountExistsView.js +1 -1
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.cjs +1 -1
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.js +1 -1
- package/src/lib/views/EmailVerification/EmailVerification.cjs +6 -14
- package/src/lib/views/EmailVerification/EmailVerification.js +6 -14
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +1 -1
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +1 -1
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +1 -1
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +1 -1
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.cjs +1 -0
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.js +1 -0
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.cjs +1 -1
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.js +1 -1
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.cjs +1 -1
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.js +1 -1
- package/src/lib/views/Passkey/utils/createEmbeddedWalletWithPasskey/createEmbeddedWalletWithPasskey.cjs +1 -1
- package/src/lib/views/Passkey/utils/createEmbeddedWalletWithPasskey/createEmbeddedWalletWithPasskey.js +1 -1
- package/src/lib/views/Passkey/utils/createPregeneratedWallet/createPregeneratedWallet.cjs +1 -1
- package/src/lib/views/Passkey/utils/createPregeneratedWallet/createPregeneratedWallet.js +1 -1
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.cjs +1 -1
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.js +1 -1
- package/src/lib/views/SendBalanceView/components/TransactionStage/TransactionStage.cjs +1 -2
- package/src/lib/views/SendBalanceView/components/TransactionStage/TransactionStage.js +1 -2
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +6 -1
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +6 -1
- package/src/lib/views/TransactionConfirmationView/helpers/transactionErrorMessage.cjs +1 -1
- package/src/lib/views/TransactionConfirmationView/helpers/transactionErrorMessage.js +1 -1
- package/src/lib/views/WalletUsedView/WalletUsedView.cjs +1 -1
- package/src/lib/views/WalletUsedView/WalletUsedView.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/WalletSettingsView/WalletSettingsView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/WalletSettingsView/WalletSettingsView.js +1 -1
- package/src/lib/utils/functions/sendTransactionWithAutoNonce/index.d.ts +0 -1
- package/src/lib/utils/functions/sendTransactionWithAutoNonce/sendTransactionWithAutoNonce.cjs +0 -49
- package/src/lib/utils/functions/sendTransactionWithAutoNonce/sendTransactionWithAutoNonce.d.ts +0 -18
- package/src/lib/utils/functions/sendTransactionWithAutoNonce/sendTransactionWithAutoNonce.js +0 -44
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,31 @@
|
|
|
1
1
|
|
|
2
|
+
## [1.1.0-alpha.26](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.25...v1.1.0-alpha.26) (2024-02-07)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add retry when using magic ([#4579](https://github.com/dynamic-labs/DynamicAuth/issues/4579)) ([183561c](https://github.com/dynamic-labs/DynamicAuth/commit/183561cc64f083fd1489c38a8cc8b1c4c51d2924))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* bug where deprecated fields were still being used in the SDK ([#4604](https://github.com/dynamic-labs/DynamicAuth/issues/4604)) ([4fd15fc](https://github.com/dynamic-labs/DynamicAuth/commit/4fd15fc4daa9c5b7bbc81ce05a3b046c80a6d5b4))
|
|
13
|
+
* log magic RPC error and update magic network error ([#4606](https://github.com/dynamic-labs/DynamicAuth/issues/4606)) ([2206961](https://github.com/dynamic-labs/DynamicAuth/commit/22069618a317bc40b1a17fd521eadf0956983de4))
|
|
14
|
+
* onConnect is properly called for additional connected wallets ([#4607](https://github.com/dynamic-labs/DynamicAuth/issues/4607)) ([23241f4](https://github.com/dynamic-labs/DynamicAuth/commit/23241f4d5dc91ac9ca1251710161efbfce42dc40))
|
|
15
|
+
|
|
16
|
+
## [1.1.0-alpha.25](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.24...v1.1.0-alpha.25) (2024-02-05)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* add signin with coinbase to sdk ([#4581](https://github.com/dynamic-labs/DynamicAuth/issues/4581)) ([08a31ed](https://github.com/dynamic-labs/DynamicAuth/commit/08a31ed3552c48645b398881f184440800af21ec))
|
|
22
|
+
* exposing hook for creating either one-time code or passkeys authenticators ([#4591](https://github.com/dynamic-labs/DynamicAuth/issues/4591)) ([864d755](https://github.com/dynamic-labs/DynamicAuth/commit/864d75576152a10f73f5901bc06e2d66892b63ab))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* solana wallet sign message with one-time code session ([#4588](https://github.com/dynamic-labs/DynamicAuth/issues/4588)) ([a738d10](https://github.com/dynamic-labs/DynamicAuth/commit/a738d10814dc5058158b9c0c59a399a375c69c10))
|
|
28
|
+
|
|
2
29
|
## [1.1.0-alpha.24](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.23...v1.1.0-alpha.24) (2024-02-02)
|
|
3
30
|
|
|
4
31
|
|
package/package.cjs
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var version = "1.1.0-alpha.
|
|
5
|
+
var version = "1.1.0-alpha.26";
|
|
6
6
|
var dependencies = {
|
|
7
|
-
"@dynamic-labs/iconic": "0.1.
|
|
8
|
-
"@dynamic-labs/sdk-api": "0.0.
|
|
7
|
+
"@dynamic-labs/iconic": "0.1.52",
|
|
8
|
+
"@dynamic-labs/sdk-api": "0.0.363",
|
|
9
9
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
10
10
|
"country-list": "2.3.0",
|
|
11
11
|
formik: "2.2.9",
|
package/package.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var version = "1.1.0-alpha.
|
|
1
|
+
var version = "1.1.0-alpha.26";
|
|
2
2
|
var dependencies = {
|
|
3
|
-
"@dynamic-labs/iconic": "0.1.
|
|
4
|
-
"@dynamic-labs/sdk-api": "0.0.
|
|
3
|
+
"@dynamic-labs/iconic": "0.1.52",
|
|
4
|
+
"@dynamic-labs/sdk-api": "0.0.363",
|
|
5
5
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
6
6
|
"country-list": "2.3.0",
|
|
7
7
|
formik: "2.2.9",
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "1.1.0-alpha.
|
|
3
|
+
"version": "1.1.0-alpha.26",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
7
7
|
"directory": "packages/sdk-react-core"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@dynamic-labs/iconic": "0.1.
|
|
11
|
-
"@dynamic-labs/sdk-api": "0.0.
|
|
10
|
+
"@dynamic-labs/iconic": "0.1.52",
|
|
11
|
+
"@dynamic-labs/sdk-api": "0.0.363",
|
|
12
12
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
13
13
|
"country-list": "2.3.0",
|
|
14
14
|
"formik": "2.2.9",
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
"react-focus-lock": "2.9.2",
|
|
18
18
|
"react-i18next": "^13.2.0",
|
|
19
19
|
"yup": "0.32.11",
|
|
20
|
-
"@dynamic-labs/ethereum": "1.1.0-alpha.
|
|
21
|
-
"@dynamic-labs/logger": "1.1.0-alpha.
|
|
22
|
-
"@dynamic-labs/multi-wallet": "1.1.0-alpha.
|
|
23
|
-
"@dynamic-labs/rpc-providers": "1.1.0-alpha.
|
|
24
|
-
"@dynamic-labs/types": "1.1.0-alpha.
|
|
25
|
-
"@dynamic-labs/utils": "1.1.0-alpha.
|
|
26
|
-
"@dynamic-labs/viem-utils": "1.1.0-alpha.
|
|
27
|
-
"@dynamic-labs/wallet-book": "1.1.0-alpha.
|
|
28
|
-
"@dynamic-labs/wallet-connector-core": "1.1.0-alpha.
|
|
20
|
+
"@dynamic-labs/ethereum": "1.1.0-alpha.26",
|
|
21
|
+
"@dynamic-labs/logger": "1.1.0-alpha.26",
|
|
22
|
+
"@dynamic-labs/multi-wallet": "1.1.0-alpha.26",
|
|
23
|
+
"@dynamic-labs/rpc-providers": "1.1.0-alpha.26",
|
|
24
|
+
"@dynamic-labs/types": "1.1.0-alpha.26",
|
|
25
|
+
"@dynamic-labs/utils": "1.1.0-alpha.26",
|
|
26
|
+
"@dynamic-labs/viem-utils": "1.1.0-alpha.26",
|
|
27
|
+
"@dynamic-labs/wallet-book": "1.1.0-alpha.26",
|
|
28
|
+
"@dynamic-labs/wallet-connector-core": "1.1.0-alpha.26",
|
|
29
29
|
"eventemitter3": "5.0.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
package/src/index.cjs
CHANGED
|
@@ -32,6 +32,7 @@ var getWalletListItemLabel = require('./lib/shared/utils/functions/getWalletList
|
|
|
32
32
|
var formatBigNumber = require('./lib/shared/utils/functions/formatBigNumber/formatBigNumber.cjs');
|
|
33
33
|
var trimEnd = require('./lib/shared/utils/functions/trimEnd/trimEnd.cjs');
|
|
34
34
|
var ceil = require('./lib/shared/utils/functions/ceil/ceil.cjs');
|
|
35
|
+
var providerLabel = require('./lib/shared/utils/functions/providerLabel/providerLabel.cjs');
|
|
35
36
|
var useEffectOnce = require('./lib/shared/utils/hooks/useEffectOnce/useEffectOnce.cjs');
|
|
36
37
|
var useForwardedRef = require('./lib/shared/utils/hooks/useForwardedRef/useForwardedRef.cjs');
|
|
37
38
|
var useGlobalLoading = require('./lib/shared/utils/hooks/useGlobalLoading/useGlobalLoading.cjs');
|
|
@@ -169,6 +170,7 @@ require('./lib/context/PasskeyContext/PasskeyContext.cjs');
|
|
|
169
170
|
require('@dynamic-labs/viem-utils');
|
|
170
171
|
require('./lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
171
172
|
var useEmbeddedReveal = require('./lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.cjs');
|
|
173
|
+
var useEmbeddedWalletAuthenticator = require('./lib/utils/hooks/useEmbeddedWalletAuthenticator/useEmbeddedWalletAuthenticator.cjs');
|
|
172
174
|
var DynamicConnectButton = require('./lib/components/DynamicConnectButton/DynamicConnectButton.cjs');
|
|
173
175
|
require('./lib/components/InlineWidget/InlineWidget.cjs');
|
|
174
176
|
var IsBrowser = require('./lib/components/IsBrowser/IsBrowser.cjs');
|
|
@@ -233,6 +235,7 @@ exports.getWalletListItemLabel = getWalletListItemLabel.getWalletListItemLabel;
|
|
|
233
235
|
exports.formatBigNumber = formatBigNumber.formatBigNumber;
|
|
234
236
|
exports.trimEnd = trimEnd.trimEnd;
|
|
235
237
|
exports.ceil = ceil.ceil;
|
|
238
|
+
exports.providerLabel = providerLabel.providerLabel;
|
|
236
239
|
exports.useEffectOnce = useEffectOnce.useEffectOnce;
|
|
237
240
|
exports.useForwardedRef = useForwardedRef.useForwardedRef;
|
|
238
241
|
exports.useGlobalLoading = useGlobalLoading.useGlobalLoading;
|
|
@@ -347,6 +350,7 @@ exports.ShadowDOM = ShadowDOM.ShadowDOM;
|
|
|
347
350
|
exports.useEmailVerificationRequest = useEmailVerificationRequest.useEmailVerificationRequest;
|
|
348
351
|
exports.DynamicWidgetContextProvider = DynamicWidgetContext.DynamicWidgetContextProvider;
|
|
349
352
|
exports.useEmbeddedReveal = useEmbeddedReveal.useEmbeddedReveal;
|
|
353
|
+
exports.useEmbeddedWalletAuthenticator = useEmbeddedWalletAuthenticator.useEmbeddedWalletAuthenticator;
|
|
350
354
|
exports.DynamicConnectButton = DynamicConnectButton.DynamicConnectButton;
|
|
351
355
|
exports.IsBrowser = IsBrowser.IsBrowser;
|
|
352
356
|
exports.WalletList = WalletList.WalletList;
|
package/src/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export { getNetwork } from './lib/utils/functions/getNetwork';
|
|
|
25
25
|
export { createWalletClientFromWallet } from './lib/utils/functions/createWalletClientFromWallet';
|
|
26
26
|
export * from './lib/utils/functions/walletFilters';
|
|
27
27
|
export { DynamicWidgetContextProvider } from './lib/widgets/DynamicWidget/context';
|
|
28
|
-
export { useWalletItemActions, useAuthenticateConnectedUser, useSocialAccounts, useEmbeddedWallet, usePasskeyRecovery, useEmbeddedReveal, useIsLoggedIn, } from './lib/utils/hooks';
|
|
28
|
+
export { useWalletItemActions, useAuthenticateConnectedUser, useSocialAccounts, useEmbeddedWallet, useEmbeddedWalletAuthenticator, usePasskeyRecovery, useEmbeddedReveal, useIsLoggedIn, } from './lib/utils/hooks';
|
|
29
29
|
export { useUserUpdateRequest, useWalletConnectorEvent, } from './lib/utils/hooks';
|
|
30
30
|
export { type VerifyEmailCallback, useEmailVerificationRequest, } from './lib/utils/hooks/authenticationHooks/';
|
|
31
31
|
export type { UpdateUserFieldsArg } from './lib/utils/hooks/';
|
package/src/index.js
CHANGED
|
@@ -28,6 +28,7 @@ export { getWalletListItemLabel } from './lib/shared/utils/functions/getWalletLi
|
|
|
28
28
|
export { formatBigNumber } from './lib/shared/utils/functions/formatBigNumber/formatBigNumber.js';
|
|
29
29
|
export { trimEnd } from './lib/shared/utils/functions/trimEnd/trimEnd.js';
|
|
30
30
|
export { ceil } from './lib/shared/utils/functions/ceil/ceil.js';
|
|
31
|
+
export { providerLabel } from './lib/shared/utils/functions/providerLabel/providerLabel.js';
|
|
31
32
|
export { useEffectOnce } from './lib/shared/utils/hooks/useEffectOnce/useEffectOnce.js';
|
|
32
33
|
export { useForwardedRef } from './lib/shared/utils/hooks/useForwardedRef/useForwardedRef.js';
|
|
33
34
|
export { useGlobalLoading } from './lib/shared/utils/hooks/useGlobalLoading/useGlobalLoading.js';
|
|
@@ -165,6 +166,7 @@ import './lib/context/PasskeyContext/PasskeyContext.js';
|
|
|
165
166
|
import '@dynamic-labs/viem-utils';
|
|
166
167
|
import './lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
167
168
|
export { useEmbeddedReveal } from './lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.js';
|
|
169
|
+
export { useEmbeddedWalletAuthenticator } from './lib/utils/hooks/useEmbeddedWalletAuthenticator/useEmbeddedWalletAuthenticator.js';
|
|
168
170
|
export { DynamicConnectButton } from './lib/components/DynamicConnectButton/DynamicConnectButton.js';
|
|
169
171
|
import './lib/components/InlineWidget/InlineWidget.js';
|
|
170
172
|
export { IsBrowser } from './lib/components/IsBrowser/IsBrowser.js';
|
|
@@ -8,6 +8,7 @@ var classNames = require('../../utils/functions/classNames/classNames.cjs');
|
|
|
8
8
|
const Icon = ({ children, className = '', color, size, }) => {
|
|
9
9
|
const colorClassNameMap = {
|
|
10
10
|
'brand-primary': 'icon--color-brand-primary',
|
|
11
|
+
'success-1': 'icon--color-success-1',
|
|
11
12
|
'text-error': 'icon--color-text-error',
|
|
12
13
|
'text-primary': 'icon--color-text-primary',
|
|
13
14
|
'text-secondary': 'icon--color-text-secondary',
|
|
@@ -4,6 +4,7 @@ import { classNames } from '../../utils/functions/classNames/classNames.js';
|
|
|
4
4
|
const Icon = ({ children, className = '', color, size, }) => {
|
|
5
5
|
const colorClassNameMap = {
|
|
6
6
|
'brand-primary': 'icon--color-brand-primary',
|
|
7
|
+
'success-1': 'icon--color-success-1',
|
|
7
8
|
'text-error': 'icon--color-text-error',
|
|
8
9
|
'text-primary': 'icon--color-text-primary',
|
|
9
10
|
'text-secondary': 'icon--color-text-secondary',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC, ReactElement } from 'react';
|
|
2
|
-
export type IconColor = 'text-primary' | 'text-secondary' | 'text-tertiary' | 'text-error' | 'brand-primary';
|
|
2
|
+
export type IconColor = 'text-primary' | 'text-secondary' | 'text-tertiary' | 'text-error' | 'brand-primary' | 'success-1';
|
|
3
3
|
export type IconSize = 'xsmall' | 'small' | 'medium' | 'large' | 'mini';
|
|
4
4
|
export type IconProps = {
|
|
5
5
|
children: ReactElement;
|
|
@@ -18,6 +18,7 @@ require('../../../../utils/constants/colors.cjs');
|
|
|
18
18
|
require('../../../../utils/constants/values.cjs');
|
|
19
19
|
require('../../../../shared/utils/classes/storage/localStorage.cjs');
|
|
20
20
|
require('viem');
|
|
21
|
+
var capitalize = require('../../../../shared/utils/functions/capitalize/capitalize.cjs');
|
|
21
22
|
require('@dynamic-labs/iconic');
|
|
22
23
|
require('../../../../context/ViewContext/ViewContext.cjs');
|
|
23
24
|
require('../../../../shared/consts/index.cjs');
|
|
@@ -67,7 +68,6 @@ require('../../../InlineWidget/InlineWidget.cjs');
|
|
|
67
68
|
require('../../../MenuList/Dropdown/Dropdown.cjs');
|
|
68
69
|
require('../../../Popper/Popper/Popper.cjs');
|
|
69
70
|
require('../../../Popper/PopperContext/PopperContext.cjs');
|
|
70
|
-
var capitalize = require('../../../../shared/utils/functions/capitalize/capitalize.cjs');
|
|
71
71
|
require('../../../../views/WalletList/WalletList.cjs');
|
|
72
72
|
require('@hcaptcha/react-hcaptcha');
|
|
73
73
|
require('../../../../context/SocialRedirectContext/SocialRedirectContext.cjs');
|
|
@@ -14,6 +14,7 @@ import '../../../../utils/constants/colors.js';
|
|
|
14
14
|
import '../../../../utils/constants/values.js';
|
|
15
15
|
import '../../../../shared/utils/classes/storage/localStorage.js';
|
|
16
16
|
import 'viem';
|
|
17
|
+
import { capitalize } from '../../../../shared/utils/functions/capitalize/capitalize.js';
|
|
17
18
|
import '@dynamic-labs/iconic';
|
|
18
19
|
import '../../../../context/ViewContext/ViewContext.js';
|
|
19
20
|
import '../../../../shared/consts/index.js';
|
|
@@ -63,7 +64,6 @@ import '../../../InlineWidget/InlineWidget.js';
|
|
|
63
64
|
import '../../../MenuList/Dropdown/Dropdown.js';
|
|
64
65
|
import '../../../Popper/Popper/Popper.js';
|
|
65
66
|
import '../../../Popper/PopperContext/PopperContext.js';
|
|
66
|
-
import { capitalize } from '../../../../shared/utils/functions/capitalize/capitalize.js';
|
|
67
67
|
import '../../../../views/WalletList/WalletList.js';
|
|
68
68
|
import '@hcaptcha/react-hcaptcha';
|
|
69
69
|
import '../../../../context/SocialRedirectContext/SocialRedirectContext.js';
|
|
@@ -5,11 +5,14 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var reactI18next = require('react-i18next');
|
|
8
|
-
var
|
|
9
|
-
require('
|
|
10
|
-
require('
|
|
11
|
-
require('
|
|
12
|
-
require('
|
|
8
|
+
var IconButton = require('../IconButton/IconButton.cjs');
|
|
9
|
+
var IconWithSpinner = require('../IconWithSpinner/IconWithSpinner.cjs');
|
|
10
|
+
var ModalHeader = require('../ModalHeader/ModalHeader.cjs');
|
|
11
|
+
var Typography = require('../Typography/Typography.cjs');
|
|
12
|
+
var PinField = require('../PinField/PinField.cjs');
|
|
13
|
+
var IconWithStatus = require('../IconWithStatus/IconWithStatus.cjs');
|
|
14
|
+
var ModalHeaderBanner = require('../ModalHeaderBanner/ModalHeaderBanner.cjs');
|
|
15
|
+
var Icon = require('../Icon/Icon.cjs');
|
|
13
16
|
require('@dynamic-labs/sdk-api');
|
|
14
17
|
require('../../shared/logger.cjs');
|
|
15
18
|
require('@dynamic-labs/iconic');
|
|
@@ -24,63 +27,13 @@ require('../../utils/constants/colors.cjs');
|
|
|
24
27
|
require('../../utils/constants/values.cjs');
|
|
25
28
|
require('../../shared/utils/classes/storage/localStorage.cjs');
|
|
26
29
|
require('viem');
|
|
30
|
+
require('@dynamic-labs/utils');
|
|
27
31
|
require('../../shared/consts/index.cjs');
|
|
28
|
-
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
29
|
-
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
30
|
-
require('@dynamic-labs/multi-wallet');
|
|
31
|
-
require('viem/chains');
|
|
32
|
-
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
33
|
-
require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
34
|
-
require('../../config/ApiEndpoint.cjs');
|
|
35
|
-
require('../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
36
|
-
require('react-dom');
|
|
37
|
-
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
38
|
-
require('@dynamic-labs/types');
|
|
39
|
-
require('yup');
|
|
40
|
-
require('../../context/MockContext/MockContext.cjs');
|
|
41
|
-
require('../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
42
|
-
require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
43
|
-
require('@dynamic-labs/rpc-providers');
|
|
44
|
-
require('../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
45
|
-
require('../Transition/ZoomTransition/ZoomTransition.cjs');
|
|
46
|
-
require('../Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
47
|
-
require('../Transition/OpacityTransition/OpacityTransition.cjs');
|
|
48
|
-
require('../ShadowDOM/ShadowDOM.cjs');
|
|
49
|
-
require('../OverlayCard/OverlayCard.context.cjs');
|
|
50
|
-
require('../../context/FooterAnimationContext/index.cjs');
|
|
51
|
-
var Typography = require('../Typography/Typography.cjs');
|
|
52
|
-
require('../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
53
|
-
require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
54
|
-
require('react-focus-lock');
|
|
55
|
-
var IconWithSpinner = require('../IconWithSpinner/IconWithSpinner.cjs');
|
|
56
|
-
require('../../context/LoadingContext/LoadingContext.cjs');
|
|
57
|
-
var IconWithStatus = require('../IconWithStatus/IconWithStatus.cjs');
|
|
58
|
-
require('i18next');
|
|
59
|
-
require('qrcode');
|
|
60
|
-
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
61
|
-
require('../UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
62
|
-
require('formik');
|
|
63
|
-
var ModalHeader = require('../ModalHeader/ModalHeader.cjs');
|
|
64
|
-
var IconButton = require('../IconButton/IconButton.cjs');
|
|
65
|
-
var Icon = require('../Icon/Icon.cjs');
|
|
66
|
-
require('../Alert/Alert.cjs');
|
|
67
|
-
require('../PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
|
|
68
|
-
require('../../context/PasskeyContext/PasskeyContext.cjs');
|
|
69
|
-
require('@dynamic-labs/viem-utils');
|
|
70
|
-
require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
71
|
-
require('../InlineWidget/InlineWidget.cjs');
|
|
72
|
-
require('../MenuList/Dropdown/Dropdown.cjs');
|
|
73
|
-
var ModalHeaderBanner = require('../ModalHeaderBanner/ModalHeaderBanner.cjs');
|
|
74
32
|
var shortenEmail = require('../../shared/utils/functions/shortenEmail/shortenEmail.cjs');
|
|
75
|
-
var
|
|
76
|
-
require('../
|
|
77
|
-
require('../Popper/PopperContext/PopperContext.cjs');
|
|
78
|
-
require('../../views/WalletList/WalletList.cjs');
|
|
79
|
-
require('@hcaptcha/react-hcaptcha');
|
|
80
|
-
require('../../context/SocialRedirectContext/SocialRedirectContext.cjs');
|
|
81
|
-
require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
33
|
+
var classNames = require('../../utils/functions/classNames/classNames.cjs');
|
|
34
|
+
var RetrySendVerificationCodeSection = require('../RetrySendVerificationCodeSection/RetrySendVerificationCodeSection.cjs');
|
|
82
35
|
|
|
83
|
-
const OTPVerificationView = ({ onClickBack, onClickEditEmail, isLoading, email, onPinComplete, isValid, error, onPinChange, successBannerTextKey, }) => {
|
|
36
|
+
const OTPVerificationView = ({ onClickBack, onClickEditEmail, isLoading, email, onPinComplete, isValid, error, retryHandler, onPinChange, successBannerTextKey, }) => {
|
|
84
37
|
const { t } = reactI18next.useTranslation();
|
|
85
38
|
const backButton = onClickBack && (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: onClickBack, "data-testid": 'back-button', children: jsxRuntime.jsx(chevronLeft.ReactComponent, {}) }));
|
|
86
39
|
const EmailIcon = React.useMemo(() => {
|
|
@@ -92,7 +45,7 @@ const OTPVerificationView = ({ onClickBack, onClickEditEmail, isLoading, email,
|
|
|
92
45
|
: 'dyn_otp_verification.confirm_code';
|
|
93
46
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { alignContent: 'bottom', leading: onClickBack && backButton, children: jsxRuntime.jsx("div", { className: 'otp-verification-view__status-header', children: jsxRuntime.jsx(Typography.Typography, { weight: 'medium', variant: 'title', color: 'primary', className: 'otp-verification-view__title', copykey: titleCopyKey(), children: t(titleCopyKey()) }) }) }), successBannerTextKey && (jsxRuntime.jsx(ModalHeaderBanner.ModalHeaderBanner, { type: 'notice', messageKey: successBannerTextKey, disableTruncate: true })), jsxRuntime.jsx(ModalHeaderBanner.ModalHeaderBanner, { type: 'error', messageKey: error === null || error === void 0 ? void 0 : error.message }), jsxRuntime.jsxs("div", { className: classNames.classNames('otp-verification-view', {
|
|
94
47
|
'otp-verification-view--message': Boolean(successBannerTextKey || error),
|
|
95
|
-
}), children: [isValid && (jsxRuntime.jsx(IconWithStatus.IconWithStatus, { Icon: EmailIcon, iconSize: 96, InnerIcon: check.ReactComponent })), !isValid && (jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: EmailIcon, iconSize: 96, isSpinning: isLoading, className: 'otp-verification-view__icon-with-spinner', treatAsFunctionComponent: true })), jsxRuntime.jsxs("div", { className: 'otp-verification-view__body', children: [isValid && (jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.hang_tight', children: t('dyn_otp_verification.hang_tight') })), !isValid && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.code_sent', children: t('dyn_otp_verification.code_sent') }), jsxRuntime.jsxs("div", { className: 'otp-verification-view__email-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: shortenEmail.shortenEmail(email) }), onClickEditEmail && (jsxRuntime.jsx(IconButton.IconButton, { onClick: onClickEditEmail, "data-testid": 'otp-verification-view__edit-button', children: jsxRuntime.jsx(Icon.Icon, { color: 'text-tertiary', children: jsxRuntime.jsx(pencilAltIcon.ReactComponent, {}) }) }))] })] }))] }), jsxRuntime.jsx(PinField.PinField, { initialValue: Array(6).join('.').split('.'), isLoading: isLoading, handleComplete: onPinComplete, isValidated: isValid, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: onPinChange })] })] }));
|
|
48
|
+
}), children: [isValid && (jsxRuntime.jsx(IconWithStatus.IconWithStatus, { Icon: EmailIcon, iconSize: 96, InnerIcon: check.ReactComponent })), !isValid && (jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: EmailIcon, iconSize: 96, isSpinning: isLoading, className: 'otp-verification-view__icon-with-spinner', treatAsFunctionComponent: true })), jsxRuntime.jsxs("div", { className: 'otp-verification-view__body', children: [isValid && (jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.hang_tight', children: t('dyn_otp_verification.hang_tight') })), !isValid && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.code_sent', children: t('dyn_otp_verification.code_sent') }), jsxRuntime.jsxs("div", { className: 'otp-verification-view__email-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: shortenEmail.shortenEmail(email) }), onClickEditEmail && (jsxRuntime.jsx(IconButton.IconButton, { onClick: onClickEditEmail, "data-testid": 'otp-verification-view__edit-button', children: jsxRuntime.jsx(Icon.Icon, { color: 'text-tertiary', children: jsxRuntime.jsx(pencilAltIcon.ReactComponent, {}) }) }))] })] }))] }), jsxRuntime.jsx(PinField.PinField, { initialValue: Array(6).join('.').split('.'), isLoading: isLoading, handleComplete: onPinComplete, isValidated: isValid, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: onPinChange }), jsxRuntime.jsx(RetrySendVerificationCodeSection.RetrySendVerificationCodeSection, { className: 'otp-verification-view__retry-container', retryHandler: retryHandler })] })] }));
|
|
96
49
|
};
|
|
97
50
|
|
|
98
51
|
exports.OTPVerificationView = OTPVerificationView;
|
|
@@ -7,6 +7,7 @@ type OtpVerificationLayoutProps = {
|
|
|
7
7
|
onClickBack?: MouseEventHandler<HTMLButtonElement>;
|
|
8
8
|
onClickEditEmail?: MouseEventHandler<HTMLButtonElement>;
|
|
9
9
|
onPinChange?: (value: string) => void;
|
|
10
|
+
retryHandler: () => Promise<void> | void;
|
|
10
11
|
onPinComplete: (value: string) => void;
|
|
11
12
|
successBannerTextKey?: string;
|
|
12
13
|
};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import {
|
|
5
|
-
import '
|
|
6
|
-
import '
|
|
7
|
-
import '
|
|
8
|
-
import '
|
|
4
|
+
import { IconButton } from '../IconButton/IconButton.js';
|
|
5
|
+
import { IconWithSpinner } from '../IconWithSpinner/IconWithSpinner.js';
|
|
6
|
+
import { ModalHeader } from '../ModalHeader/ModalHeader.js';
|
|
7
|
+
import { Typography } from '../Typography/Typography.js';
|
|
8
|
+
import { PinField } from '../PinField/PinField.js';
|
|
9
|
+
import { IconWithStatus } from '../IconWithStatus/IconWithStatus.js';
|
|
10
|
+
import { ModalHeaderBanner } from '../ModalHeaderBanner/ModalHeaderBanner.js';
|
|
11
|
+
import { Icon } from '../Icon/Icon.js';
|
|
9
12
|
import '@dynamic-labs/sdk-api';
|
|
10
13
|
import '../../shared/logger.js';
|
|
11
14
|
import '@dynamic-labs/iconic';
|
|
@@ -20,63 +23,13 @@ import '../../utils/constants/colors.js';
|
|
|
20
23
|
import '../../utils/constants/values.js';
|
|
21
24
|
import '../../shared/utils/classes/storage/localStorage.js';
|
|
22
25
|
import 'viem';
|
|
26
|
+
import '@dynamic-labs/utils';
|
|
23
27
|
import '../../shared/consts/index.js';
|
|
24
|
-
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
25
|
-
import '../../context/ErrorContext/ErrorContext.js';
|
|
26
|
-
import '@dynamic-labs/multi-wallet';
|
|
27
|
-
import 'viem/chains';
|
|
28
|
-
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
29
|
-
import '../../context/AccountExistsContext/AccountExistsContext.js';
|
|
30
|
-
import '../../config/ApiEndpoint.js';
|
|
31
|
-
import '../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
32
|
-
import 'react-dom';
|
|
33
|
-
import '../../context/ThemeContext/ThemeContext.js';
|
|
34
|
-
import '@dynamic-labs/types';
|
|
35
|
-
import 'yup';
|
|
36
|
-
import '../../context/MockContext/MockContext.js';
|
|
37
|
-
import '../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
38
|
-
import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
39
|
-
import '@dynamic-labs/rpc-providers';
|
|
40
|
-
import '../../context/UserWalletsContext/UserWalletsContext.js';
|
|
41
|
-
import '../Transition/ZoomTransition/ZoomTransition.js';
|
|
42
|
-
import '../Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
43
|
-
import '../Transition/OpacityTransition/OpacityTransition.js';
|
|
44
|
-
import '../ShadowDOM/ShadowDOM.js';
|
|
45
|
-
import '../OverlayCard/OverlayCard.context.js';
|
|
46
|
-
import '../../context/FooterAnimationContext/index.js';
|
|
47
|
-
import { Typography } from '../Typography/Typography.js';
|
|
48
|
-
import '../../context/WalletGroupContext/WalletGroupContext.js';
|
|
49
|
-
import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
50
|
-
import 'react-focus-lock';
|
|
51
|
-
import { IconWithSpinner } from '../IconWithSpinner/IconWithSpinner.js';
|
|
52
|
-
import '../../context/LoadingContext/LoadingContext.js';
|
|
53
|
-
import { IconWithStatus } from '../IconWithStatus/IconWithStatus.js';
|
|
54
|
-
import 'i18next';
|
|
55
|
-
import 'qrcode';
|
|
56
|
-
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
57
|
-
import '../UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
58
|
-
import 'formik';
|
|
59
|
-
import { ModalHeader } from '../ModalHeader/ModalHeader.js';
|
|
60
|
-
import { IconButton } from '../IconButton/IconButton.js';
|
|
61
|
-
import { Icon } from '../Icon/Icon.js';
|
|
62
|
-
import '../Alert/Alert.js';
|
|
63
|
-
import '../PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
|
|
64
|
-
import '../../context/PasskeyContext/PasskeyContext.js';
|
|
65
|
-
import '@dynamic-labs/viem-utils';
|
|
66
|
-
import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
67
|
-
import '../InlineWidget/InlineWidget.js';
|
|
68
|
-
import '../MenuList/Dropdown/Dropdown.js';
|
|
69
|
-
import { ModalHeaderBanner } from '../ModalHeaderBanner/ModalHeaderBanner.js';
|
|
70
28
|
import { shortenEmail } from '../../shared/utils/functions/shortenEmail/shortenEmail.js';
|
|
71
|
-
import {
|
|
72
|
-
import '../
|
|
73
|
-
import '../Popper/PopperContext/PopperContext.js';
|
|
74
|
-
import '../../views/WalletList/WalletList.js';
|
|
75
|
-
import '@hcaptcha/react-hcaptcha';
|
|
76
|
-
import '../../context/SocialRedirectContext/SocialRedirectContext.js';
|
|
77
|
-
import '../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
29
|
+
import { classNames } from '../../utils/functions/classNames/classNames.js';
|
|
30
|
+
import { RetrySendVerificationCodeSection } from '../RetrySendVerificationCodeSection/RetrySendVerificationCodeSection.js';
|
|
78
31
|
|
|
79
|
-
const OTPVerificationView = ({ onClickBack, onClickEditEmail, isLoading, email, onPinComplete, isValid, error, onPinChange, successBannerTextKey, }) => {
|
|
32
|
+
const OTPVerificationView = ({ onClickBack, onClickEditEmail, isLoading, email, onPinComplete, isValid, error, retryHandler, onPinChange, successBannerTextKey, }) => {
|
|
80
33
|
const { t } = useTranslation();
|
|
81
34
|
const backButton = onClickBack && (jsx(IconButton, { type: 'button', onClick: onClickBack, "data-testid": 'back-button', children: jsx(SvgChevronLeft, {}) }));
|
|
82
35
|
const EmailIcon = useMemo(() => {
|
|
@@ -88,7 +41,7 @@ const OTPVerificationView = ({ onClickBack, onClickEditEmail, isLoading, email,
|
|
|
88
41
|
: 'dyn_otp_verification.confirm_code';
|
|
89
42
|
return (jsxs(Fragment, { children: [jsx(ModalHeader, { alignContent: 'bottom', leading: onClickBack && backButton, children: jsx("div", { className: 'otp-verification-view__status-header', children: jsx(Typography, { weight: 'medium', variant: 'title', color: 'primary', className: 'otp-verification-view__title', copykey: titleCopyKey(), children: t(titleCopyKey()) }) }) }), successBannerTextKey && (jsx(ModalHeaderBanner, { type: 'notice', messageKey: successBannerTextKey, disableTruncate: true })), jsx(ModalHeaderBanner, { type: 'error', messageKey: error === null || error === void 0 ? void 0 : error.message }), jsxs("div", { className: classNames('otp-verification-view', {
|
|
90
43
|
'otp-verification-view--message': Boolean(successBannerTextKey || error),
|
|
91
|
-
}), children: [isValid && (jsx(IconWithStatus, { Icon: EmailIcon, iconSize: 96, InnerIcon: SvgCheck })), !isValid && (jsx(IconWithSpinner, { Icon: EmailIcon, iconSize: 96, isSpinning: isLoading, className: 'otp-verification-view__icon-with-spinner', treatAsFunctionComponent: true })), jsxs("div", { className: 'otp-verification-view__body', children: [isValid && (jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.hang_tight', children: t('dyn_otp_verification.hang_tight') })), !isValid && (jsxs(Fragment, { children: [jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.code_sent', children: t('dyn_otp_verification.code_sent') }), jsxs("div", { className: 'otp-verification-view__email-container', children: [jsx(Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: shortenEmail(email) }), onClickEditEmail && (jsx(IconButton, { onClick: onClickEditEmail, "data-testid": 'otp-verification-view__edit-button', children: jsx(Icon, { color: 'text-tertiary', children: jsx(SvgPencilAltIcon, {}) }) }))] })] }))] }), jsx(PinField, { initialValue: Array(6).join('.').split('.'), isLoading: isLoading, handleComplete: onPinComplete, isValidated: isValid, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: onPinChange })] })] }));
|
|
44
|
+
}), children: [isValid && (jsx(IconWithStatus, { Icon: EmailIcon, iconSize: 96, InnerIcon: SvgCheck })), !isValid && (jsx(IconWithSpinner, { Icon: EmailIcon, iconSize: 96, isSpinning: isLoading, className: 'otp-verification-view__icon-with-spinner', treatAsFunctionComponent: true })), jsxs("div", { className: 'otp-verification-view__body', children: [isValid && (jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.hang_tight', children: t('dyn_otp_verification.hang_tight') })), !isValid && (jsxs(Fragment, { children: [jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.code_sent', children: t('dyn_otp_verification.code_sent') }), jsxs("div", { className: 'otp-verification-view__email-container', children: [jsx(Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: shortenEmail(email) }), onClickEditEmail && (jsx(IconButton, { onClick: onClickEditEmail, "data-testid": 'otp-verification-view__edit-button', children: jsx(Icon, { color: 'text-tertiary', children: jsx(SvgPencilAltIcon, {}) }) }))] })] }))] }), jsx(PinField, { initialValue: Array(6).join('.').split('.'), isLoading: isLoading, handleComplete: onPinComplete, isValidated: isValid, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: onPinChange }), jsx(RetrySendVerificationCodeSection, { className: 'otp-verification-view__retry-container', retryHandler: retryHandler })] })] }));
|
|
92
45
|
};
|
|
93
46
|
|
|
94
47
|
export { OTPVerificationView };
|
package/src/lib/components/RetrySendVerificationCodeSection/RetrySendVerificationCodeSection.cjs
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var reactI18next = require('react-i18next');
|
|
8
|
+
require('../../events/dynamicEvents.cjs');
|
|
9
|
+
require('../../../../_virtual/_tslib.cjs');
|
|
10
|
+
require('@dynamic-labs/utils');
|
|
11
|
+
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
12
|
+
require('@dynamic-labs/sdk-api');
|
|
13
|
+
require('../../shared/logger.cjs');
|
|
14
|
+
require('@dynamic-labs/iconic');
|
|
15
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
16
|
+
require('../../context/ViewContext/ViewContext.cjs');
|
|
17
|
+
var checkCircle = require('../../shared/assets/check-circle.cjs');
|
|
18
|
+
require('@dynamic-labs/wallet-book');
|
|
19
|
+
require('../../utils/constants/colors.cjs');
|
|
20
|
+
require('../../utils/constants/values.cjs');
|
|
21
|
+
require('../../shared/utils/classes/storage/localStorage.cjs');
|
|
22
|
+
require('viem');
|
|
23
|
+
require('../../shared/consts/index.cjs');
|
|
24
|
+
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
25
|
+
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
26
|
+
require('@dynamic-labs/multi-wallet');
|
|
27
|
+
require('viem/chains');
|
|
28
|
+
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
29
|
+
require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
30
|
+
require('../../config/ApiEndpoint.cjs');
|
|
31
|
+
require('../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
32
|
+
require('react-dom');
|
|
33
|
+
var useCountdown = require('../../utils/hooks/useCountdown/useCountdown.cjs');
|
|
34
|
+
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
35
|
+
var useMutation = require('../../utils/hooks/useMutation/useMutation.cjs');
|
|
36
|
+
require('@dynamic-labs/types');
|
|
37
|
+
require('yup');
|
|
38
|
+
require('../../context/MockContext/MockContext.cjs');
|
|
39
|
+
require('../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
40
|
+
require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
41
|
+
require('@dynamic-labs/rpc-providers');
|
|
42
|
+
require('../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
43
|
+
var classNames = require('../../utils/functions/classNames/classNames.cjs');
|
|
44
|
+
require('../Alert/Alert.cjs');
|
|
45
|
+
var Typography = require('../Typography/Typography.cjs');
|
|
46
|
+
var TextButton = require('../TextButton/TextButton.cjs');
|
|
47
|
+
require('../ShadowDOM/ShadowDOM.cjs');
|
|
48
|
+
var Icon = require('../Icon/Icon.cjs');
|
|
49
|
+
require('../IconButton/IconButton.cjs');
|
|
50
|
+
require('../InlineWidget/InlineWidget.cjs');
|
|
51
|
+
require('../MenuList/Dropdown/Dropdown.cjs');
|
|
52
|
+
require('../Transition/ZoomTransition/ZoomTransition.cjs');
|
|
53
|
+
require('../Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
54
|
+
require('../Transition/OpacityTransition/OpacityTransition.cjs');
|
|
55
|
+
require('../Popper/Popper/Popper.cjs');
|
|
56
|
+
require('../Popper/PopperContext/PopperContext.cjs');
|
|
57
|
+
require('react-focus-lock');
|
|
58
|
+
require('formik');
|
|
59
|
+
require('i18next');
|
|
60
|
+
require('../OverlayCard/OverlayCard.context.cjs');
|
|
61
|
+
require('../PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
|
|
62
|
+
require('../../context/PasskeyContext/PasskeyContext.cjs');
|
|
63
|
+
require('../../views/WalletList/WalletList.cjs');
|
|
64
|
+
require('qrcode');
|
|
65
|
+
require('@hcaptcha/react-hcaptcha');
|
|
66
|
+
require('../../context/LoadingContext/LoadingContext.cjs');
|
|
67
|
+
require('../../context/SocialRedirectContext/SocialRedirectContext.cjs');
|
|
68
|
+
require('../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
69
|
+
require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
70
|
+
require('../../context/FooterAnimationContext/index.cjs');
|
|
71
|
+
require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
72
|
+
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
73
|
+
require('../UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
74
|
+
require('@dynamic-labs/viem-utils');
|
|
75
|
+
require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
76
|
+
|
|
77
|
+
const RetrySendVerificationCodeSection = ({ retryHandler, secondsToRetry = 15, disabled = false, className }) => {
|
|
78
|
+
const { t } = reactI18next.useTranslation();
|
|
79
|
+
const [retried, setRetried] = React.useState(false);
|
|
80
|
+
const { remainingSeconds, startCountdown } = useCountdown.useCountdown({
|
|
81
|
+
callback: () => setRetried(false),
|
|
82
|
+
seconds: secondsToRetry,
|
|
83
|
+
});
|
|
84
|
+
const { isLoading, mutate: retry } = useMutation.useMutation(retryHandler, {
|
|
85
|
+
onSuccess: () => {
|
|
86
|
+
setRetried(true);
|
|
87
|
+
startCountdown();
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
const containerClassName = classNames.classNames('retry-send-verification-code-section', className);
|
|
91
|
+
if (retried) {
|
|
92
|
+
return (jsxRuntime.jsxs("div", { className: containerClassName, children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', copykey: 'dyn_email_verification.resend_code_in', children: t('dyn_email_verification.resend_code_in', { remainingSeconds }) }), jsxRuntime.jsxs("span", { className: 'retry-send-verification-code-section__confirmation', children: [jsxRuntime.jsx(Icon.Icon, { color: 'success-1', children: jsxRuntime.jsx(checkCircle.ReactComponent, {}) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', weight: 'medium', color: 'primary', copykey: 'dyn_email_verification.code_sent', children: t('dyn_email_verification.code_sent') })] })] }));
|
|
93
|
+
}
|
|
94
|
+
return (jsxRuntime.jsxs("div", { className: containerClassName, children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', weight: 'medium', color: 'secondary', copykey: 'dyn_email_verification.code_not_received', children: t('dyn_email_verification.code_not_received') }), jsxRuntime.jsx(TextButton.TextButton, { className: 'email-verification__text-button', disabled: isLoading || disabled, onClick: () => retry(), copykey: 'dyn_email_verification.resend_code', children: t('dyn_email_verification.resend_code') })] }));
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
exports.RetrySendVerificationCodeSection = RetrySendVerificationCodeSection;
|
package/src/lib/components/RetrySendVerificationCodeSection/RetrySendVerificationCodeSection.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
type RetrySendVerificationCodeSectionProps = {
|
|
3
|
+
retryHandler: () => Promise<void> | void;
|
|
4
|
+
secondsToRetry?: number;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const RetrySendVerificationCodeSection: FC<RetrySendVerificationCodeSectionProps>;
|
|
9
|
+
export {};
|