@dynamic-labs/sdk-react-core 0.18.100-viem.1 → 0.18.100-viem.10

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.
Files changed (106) hide show
  1. package/CHANGELOG.md +86 -0
  2. package/package.cjs +3 -3
  3. package/package.js +3 -3
  4. package/package.json +10 -10
  5. package/src/index.cjs +2 -0
  6. package/src/index.js +1 -0
  7. package/src/lib/components/MenuList/Dropdown/Dropdown.cjs +1 -1
  8. package/src/lib/components/MenuList/Dropdown/Dropdown.js +1 -1
  9. package/src/lib/components/ModalHeaderBanner/ModalHeaderBanner.cjs +6 -2
  10. package/src/lib/components/ModalHeaderBanner/ModalHeaderBanner.d.ts +2 -1
  11. package/src/lib/components/ModalHeaderBanner/ModalHeaderBanner.js +6 -2
  12. package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +2 -2
  13. package/src/lib/components/OTPVerificationView/OTPVerificationView.d.ts +1 -0
  14. package/src/lib/components/OTPVerificationView/OTPVerificationView.js +2 -2
  15. package/src/lib/components/Typography/Typography.cjs +1 -0
  16. package/src/lib/components/Typography/Typography.js +1 -0
  17. package/src/lib/components/Typography/Typography.types.d.ts +1 -1
  18. package/src/lib/components/UserProfile/UserProfile.cjs +1 -1
  19. package/src/lib/components/UserProfile/UserProfile.js +1 -1
  20. package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +1 -1
  21. package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +1 -1
  22. package/src/lib/context/DynamicContext/DynamicContext.cjs +8 -2
  23. package/src/lib/context/DynamicContext/DynamicContext.js +9 -3
  24. package/src/lib/context/DynamicContext/internalEvents/index.d.ts +2 -0
  25. package/src/lib/context/DynamicContext/internalEvents/internalEvents.cjs +14 -0
  26. package/src/lib/context/DynamicContext/internalEvents/internalEvents.d.ts +8 -0
  27. package/src/lib/context/DynamicContext/internalEvents/internalEvents.js +6 -0
  28. package/src/lib/context/DynamicContext/types/index.d.ts +4 -1
  29. package/src/lib/context/DynamicContext/useDynamicContext.cjs +2 -1
  30. package/src/lib/context/DynamicContext/useDynamicContext.d.ts +1 -1
  31. package/src/lib/context/DynamicContext/useDynamicContext.js +2 -1
  32. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +2 -1
  33. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +2 -1
  34. package/src/lib/data/api.cjs +17 -1
  35. package/src/lib/data/api.d.ts +2 -1
  36. package/src/lib/data/api.js +17 -2
  37. package/src/lib/main.global.cjs +1 -1
  38. package/src/lib/main.global.js +1 -1
  39. package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.cjs +2 -1
  40. package/src/lib/modals/TransactionConfirmationModal/TransactionConfirmationModal.js +2 -1
  41. package/src/lib/shared/utils/hooks/usePreventPageScroll/usePreventPageScroll.cjs +28 -2
  42. package/src/lib/shared/utils/hooks/usePreventPageScroll/usePreventPageScroll.js +28 -2
  43. package/src/lib/styles/index.shadow.cjs +1 -1
  44. package/src/lib/styles/index.shadow.js +1 -1
  45. package/src/lib/utils/functions/createUserProfile/createUserProfile.cjs +1 -1
  46. package/src/lib/utils/functions/createUserProfile/createUserProfile.js +1 -1
  47. package/src/lib/utils/functions/digestSHA256/digestSHA256.cjs +11 -0
  48. package/src/lib/utils/functions/digestSHA256/digestSHA256.d.ts +1 -0
  49. package/src/lib/utils/functions/digestSHA256/digestSHA256.js +7 -0
  50. package/src/lib/utils/functions/digestSHA256/index.d.ts +1 -0
  51. package/src/lib/utils/functions/encodeBase64URL/encodeBase64URL.cjs +14 -0
  52. package/src/lib/utils/functions/encodeBase64URL/encodeBase64URL.d.ts +1 -0
  53. package/src/lib/utils/functions/encodeBase64URL/encodeBase64URL.js +10 -0
  54. package/src/lib/utils/functions/encodeBase64URL/index.d.ts +1 -0
  55. package/src/lib/utils/functions/getRedirectURIOrigin/getRedirectURIOrigin.cjs +33 -0
  56. package/src/lib/utils/functions/getRedirectURIOrigin/getRedirectURIOrigin.d.ts +1 -0
  57. package/src/lib/utils/functions/getRedirectURIOrigin/getRedirectURIOrigin.js +29 -0
  58. package/src/lib/utils/functions/getRedirectURIOrigin/index.d.ts +1 -0
  59. package/src/lib/utils/functions/index.d.ts +6 -0
  60. package/src/lib/utils/functions/randomString/index.d.ts +1 -0
  61. package/src/lib/utils/functions/randomString/randomString.cjs +14 -0
  62. package/src/lib/utils/functions/randomString/randomString.d.ts +1 -0
  63. package/src/lib/utils/functions/randomString/randomString.js +10 -0
  64. package/src/lib/utils/functions/sendTransactionWithAutoNonce/index.d.ts +1 -0
  65. package/src/lib/utils/functions/sendTransactionWithAutoNonce/sendTransactionWithAutoNonce.cjs +48 -0
  66. package/src/lib/utils/functions/sendTransactionWithAutoNonce/sendTransactionWithAutoNonce.d.ts +18 -0
  67. package/src/lib/utils/functions/sendTransactionWithAutoNonce/sendTransactionWithAutoNonce.js +43 -0
  68. package/src/lib/utils/functions/stringifyURIQuery/index.d.ts +1 -0
  69. package/src/lib/utils/functions/stringifyURIQuery/stringifyURIQuery.cjs +13 -0
  70. package/src/lib/utils/functions/stringifyURIQuery/stringifyURIQuery.d.ts +1 -0
  71. package/src/lib/utils/functions/stringifyURIQuery/stringifyURIQuery.js +9 -0
  72. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +8 -2
  73. package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +9 -3
  74. package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs +4 -0
  75. package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js +4 -0
  76. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +14 -16
  77. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +15 -17
  78. package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.cjs +7 -6
  79. package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.js +7 -6
  80. package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.cjs +6 -2
  81. package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.d.ts +2 -1
  82. package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.js +6 -2
  83. package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.cjs +128 -23
  84. package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.d.ts +5 -1
  85. package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.js +130 -25
  86. package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.cjs +9 -3
  87. package/src/lib/views/CaptchaVerifyUser/CaptchaVerifyUser.js +9 -3
  88. package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +1 -1
  89. package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +1 -1
  90. package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +3 -2
  91. package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +3 -2
  92. package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +3 -2
  93. package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +3 -2
  94. package/src/lib/views/SendBalanceView/components/TransactionStage/TransactionStage.cjs +4 -10
  95. package/src/lib/views/SendBalanceView/components/TransactionStage/TransactionStage.js +4 -10
  96. package/src/lib/views/WalletGroupView/components/WalletGroupItem/WalletGroupItem.cjs +1 -0
  97. package/src/lib/views/WalletGroupView/components/WalletGroupItem/WalletGroupItem.js +1 -0
  98. package/src/lib/views/WalletList/WalletListItem/WalletListItem.cjs +1 -1
  99. package/src/lib/views/WalletList/WalletListItem/WalletListItem.js +1 -1
  100. package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.cjs +4 -1
  101. package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.js +4 -1
  102. package/src/lib/widgets/OAuthIFrameContainer/OAuthIFrameContainer.cjs +13 -0
  103. package/src/lib/widgets/OAuthIFrameContainer/OAuthIFrameContainer.d.ts +2 -0
  104. package/src/lib/widgets/OAuthIFrameContainer/OAuthIFrameContainer.js +9 -0
  105. package/src/lib/widgets/OAuthIFrameContainer/index.d.ts +1 -0
  106. package/src/lib/widgets/index.d.ts +1 -0
package/CHANGELOG.md CHANGED
@@ -1,4 +1,90 @@
1
1
 
2
+ ### [0.18.100-viem.10](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.100-viem.9...v0.18.100-viem.10) (2023-08-25)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * stop calling handleLogOut prematurely ([#3137](https://github.com/dynamic-labs/DynamicAuth/issues/3137)) ([3d029ba](https://github.com/dynamic-labs/DynamicAuth/commit/3d029ba3e34e3cb8a2b976dc5d3fb9ee1356d76c)), closes [#3135](https://github.com/dynamic-labs/DynamicAuth/issues/3135)
8
+
9
+ ### [0.18.100-viem.9](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.100-viem.8...v0.18.100-viem.9) (2023-08-25)
10
+
11
+
12
+ ### Features
13
+
14
+ * register connection of second wallet in bridge ([3e12cde](https://github.com/dynamic-labs/DynamicAuth/commit/3e12cdece4abd717280aeed442999aef4653e059)), closes [#3113](https://github.com/dynamic-labs/DynamicAuth/issues/3113)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * fix github social linking icon on dark mode ([#3130](https://github.com/dynamic-labs/DynamicAuth/issues/3130)) ([8db8aa7](https://github.com/dynamic-labs/DynamicAuth/commit/8db8aa7b9892f93f6fb6aa7772f99b747fe8f86b)), closes [#3126](https://github.com/dynamic-labs/DynamicAuth/issues/3126)
20
+ * fix issue with detecting oauth window closed before finishing linking ([#3128](https://github.com/dynamic-labs/DynamicAuth/issues/3128)) ([b108bf9](https://github.com/dynamic-labs/DynamicAuth/commit/b108bf9d9b3ca47202ca4a1993f155639fd032a8)), closes [#3124](https://github.com/dynamic-labs/DynamicAuth/issues/3124)
21
+
22
+ ### [0.18.100-viem.8](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.100-viem.7...v0.18.100-viem.8) (2023-08-24)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * allow overriding contracts on wagmi chains ([#3105](https://github.com/dynamic-labs/DynamicAuth/issues/3105)) ([acee314](https://github.com/dynamic-labs/DynamicAuth/commit/acee3147156c30957bdb690c56cfd10af13dc57f))
28
+ * send wagmi settings only once when DynamicWagmiConnector loads (v18-viem) ([#3109](https://github.com/dynamic-labs/DynamicAuth/issues/3109)) ([a6e2675](https://github.com/dynamic-labs/DynamicAuth/commit/a6e2675c49eab3c40dc9365b20ac2dd9eaf8e4ae)), closes [#3103](https://github.com/dynamic-labs/DynamicAuth/issues/3103)
29
+
30
+ ### [0.18.100-viem.7](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.100-viem.6...v0.18.100-viem.7) (2023-08-23)
31
+
32
+
33
+ ### Bug Fixes
34
+
35
+ * fix jumping when entering OTP code on IOS ([#3036](https://github.com/dynamic-labs/DynamicAuth/issues/3036)) ([#3094](https://github.com/dynamic-labs/DynamicAuth/issues/3094)) ([093ab9a](https://github.com/dynamic-labs/DynamicAuth/commit/093ab9aae2f8bba99622e1146d1dc54c077ae3cb))
36
+ * log user out when magic session expires ([#3085](https://github.com/dynamic-labs/DynamicAuth/issues/3085)) ([#3088](https://github.com/dynamic-labs/DynamicAuth/issues/3088)) ([d7d125c](https://github.com/dynamic-labs/DynamicAuth/commit/d7d125c93a652f26deeedce534f1e0472ad3377c))
37
+ * improvements to network switching in bridge flow ([#3080](https://github.com/dynamic-labs/DynamicAuth/issues/3080)) ([4137c05](https://github.com/dynamic-labs/DynamicAuth/commit/4137c0599a760d2ec8a6b9a6a5de7cce9987033b))
38
+ * fix could not replace transaction error ([#3058](https://github.com/dynamic-labs/DynamicAuth/issues/3058)) ([b36184e](https://github.com/dynamic-labs/DynamicAuth/commit/b36184e17a268d49bed100e81477df9f5e4b3731)), closes [#3049](https://github.com/dynamic-labs/DynamicAuth/issues/3049)
39
+ * update embedded wallet notice design ([529f90f](https://github.com/dynamic-labs/DynamicAuth/commit/529f90f323f712240dfd964d908b6ea59cacbd19)), closes [#2987](https://github.com/dynamic-labs/DynamicAuth/issues/2987) [#3082](https://github.com/dynamic-labs/DynamicAuth/issues/3082)
40
+
41
+ ### [0.18.100-viem.6](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.100-viem.5...v0.18.100-viem.6) (2023-08-21)
42
+
43
+
44
+ ### Bug Fixes
45
+
46
+ * detect when user closes oauth window when linking social account ([#3066](https://github.com/dynamic-labs/DynamicAuth/issues/3066)) ([428e9e8](https://github.com/dynamic-labs/DynamicAuth/commit/428e9e81d5473b2de03560f118c61baf3ee9e692))
47
+ * sync connected wallets with wagmi client ([#3073](https://github.com/dynamic-labs/DynamicAuth/issues/3073)) ([bce960d](https://github.com/dynamic-labs/DynamicAuth/commit/bce960d341ff55d3d660a8c34121c4348ca2908b))
48
+
49
+ ### [0.18.100-viem.5](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.100-viem.4...v0.18.100-viem.5) (2023-08-19)
50
+
51
+
52
+ ### Bug Fixes
53
+
54
+ * ensure social sign in embedded wallets sync correctly with wagmi ([5fdf11d](https://github.com/dynamic-labs/DynamicAuth/commit/5fdf11df19759b6e32b461802c0a32686365d890))
55
+
56
+ ### [0.18.100-viem.4](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.100-viem.3...v0.18.100-viem.4) (2023-08-17)
57
+
58
+
59
+ ### Bug Fixes
60
+
61
+ * always enable magic connectors when enabled ([#3014](https://github.com/dynamic-labs/DynamicAuth/issues/3014)) ([#3039](https://github.com/dynamic-labs/DynamicAuth/issues/3039)) ([6d4c473](https://github.com/dynamic-labs/DynamicAuth/commit/6d4c4738b92b40c903488c435fdd1bf69dc6c96e))
62
+ * guard against null or undefined provider value when logging in w… ([#3028](https://github.com/dynamic-labs/DynamicAuth/issues/3028)) ([050b62c](https://github.com/dynamic-labs/DynamicAuth/commit/050b62c7c91b6430eb350f7b49fa57260a08a756)), closes [#3021](https://github.com/dynamic-labs/DynamicAuth/issues/3021)
63
+ * issue where walletconnectors are instantiated without walletbook ([#3020](https://github.com/dynamic-labs/DynamicAuth/issues/3020)) ([#3033](https://github.com/dynamic-labs/DynamicAuth/issues/3033)) ([92394aa](https://github.com/dynamic-labs/DynamicAuth/commit/92394aa83cad497d805ac4d4ce8eb35d2b10690c))
64
+ * only use the production api environment of magicLink ([#3024](https://github.com/dynamic-labs/DynamicAuth/issues/3024)) ([25eea74](https://github.com/dynamic-labs/DynamicAuth/commit/25eea7438b0c2cb0279fb70d0be3c16f73b24573))
65
+ * switching network in connected state should update wallets to connect list ([#3038](https://github.com/dynamic-labs/DynamicAuth/issues/3038)) ([22837cb](https://github.com/dynamic-labs/DynamicAuth/commit/22837cb0af3a2dbdd7345b5cf92c23455bdd3cc4))
66
+
67
+ ### [0.18.100-viem.3](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.100-viem.2...v0.18.100-viem.3) (2023-08-16)
68
+
69
+
70
+ ### Bug Fixes
71
+
72
+ * fix twitter linking ([#2918](https://github.com/dynamic-labs/DynamicAuth/issues/2918)) ([#3003](https://github.com/dynamic-labs/DynamicAuth/issues/3003)) ([8f028dc](https://github.com/dynamic-labs/DynamicAuth/commit/8f028dc91434a44b4f2bcae82ad5f16a27c9e5b1))
73
+ * use ETH currency symbol for STARK chains ([#3005](https://github.com/dynamic-labs/DynamicAuth/issues/3005)) ([#3008](https://github.com/dynamic-labs/DynamicAuth/issues/3008)) ([6f0c66f](https://github.com/dynamic-labs/DynamicAuth/commit/6f0c66f63bbfdbb08d0c504d52565acd90070528))
74
+
75
+ ### [0.18.100-viem.2](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.100-viem.1...v0.18.100-viem.2) (2023-08-15)
76
+
77
+
78
+ ### Features
79
+
80
+ * re-enable bloctoevm ([#2992](https://github.com/dynamic-labs/DynamicAuth/issues/2992)) ([d027f39](https://github.com/dynamic-labs/DynamicAuth/commit/d027f39c8fb5bf477ce0da0c62d86cd812f0fda5))
81
+
82
+
83
+ ### Bug Fixes
84
+
85
+ * **captcha:** complete sign in with magic and blocto ([#2967](https://github.com/dynamic-labs/DynamicAuth/issues/2967)) ([#2985](https://github.com/dynamic-labs/DynamicAuth/issues/2985)) ([e7585f5](https://github.com/dynamic-labs/DynamicAuth/commit/e7585f525da29e7933871831fa6fd374f09618b7))
86
+ * sync wagmi correctly in connect-only mode ([#2990](https://github.com/dynamic-labs/DynamicAuth/issues/2990)) ([#2993](https://github.com/dynamic-labs/DynamicAuth/issues/2993)) ([74a4e62](https://github.com/dynamic-labs/DynamicAuth/commit/74a4e6216f3f9fb30e5312789fb18f77277e15ba))
87
+
2
88
  ## [0.18.0-beta.32](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-beta.31...v0.18.0-beta.32) (2023-08-09)
3
89
 
4
90
 
package/package.cjs CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = "0.18.100-viem.1";
5
+ var version = "0.18.100-viem.10";
6
6
  var dependencies = {
7
7
  "react-focus-lock": "2.9.2",
8
- "@dynamic-labs/iconic": "0.1.23",
9
- "@dynamic-labs/sdk-api": "0.0.256",
8
+ "@dynamic-labs/iconic": "0.1.27",
9
+ "@dynamic-labs/sdk-api": "0.0.270",
10
10
  "@hcaptcha/react-hcaptcha": "1.4.4",
11
11
  "country-list": "2.3.0",
12
12
  yup: "0.32.11",
package/package.js CHANGED
@@ -1,8 +1,8 @@
1
- var version = "0.18.100-viem.1";
1
+ var version = "0.18.100-viem.10";
2
2
  var dependencies = {
3
3
  "react-focus-lock": "2.9.2",
4
- "@dynamic-labs/iconic": "0.1.23",
5
- "@dynamic-labs/sdk-api": "0.0.256",
4
+ "@dynamic-labs/iconic": "0.1.27",
5
+ "@dynamic-labs/sdk-api": "0.0.270",
6
6
  "@hcaptcha/react-hcaptcha": "1.4.4",
7
7
  "country-list": "2.3.0",
8
8
  yup: "0.32.11",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-react-core",
3
- "version": "0.18.100-viem.1",
3
+ "version": "0.18.100-viem.10",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -8,20 +8,20 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "react-focus-lock": "2.9.2",
11
- "@dynamic-labs/iconic": "0.1.23",
12
- "@dynamic-labs/sdk-api": "0.0.256",
11
+ "@dynamic-labs/iconic": "0.1.27",
12
+ "@dynamic-labs/sdk-api": "0.0.270",
13
13
  "@hcaptcha/react-hcaptcha": "1.4.4",
14
14
  "country-list": "2.3.0",
15
15
  "yup": "0.32.11",
16
16
  "formik": "2.2.9",
17
17
  "qrcode": "1.5.1",
18
- "@dynamic-labs/logger": "0.18.100-viem.1",
19
- "@dynamic-labs/multi-wallet": "0.18.100-viem.1",
20
- "@dynamic-labs/rpc-providers": "0.18.100-viem.1",
21
- "@dynamic-labs/types": "0.18.100-viem.1",
22
- "@dynamic-labs/utils": "0.18.100-viem.1",
23
- "@dynamic-labs/wallet-book": "0.18.100-viem.1",
24
- "@dynamic-labs/wallet-connector-core": "0.18.100-viem.1",
18
+ "@dynamic-labs/logger": "0.18.100-viem.10",
19
+ "@dynamic-labs/multi-wallet": "0.18.100-viem.10",
20
+ "@dynamic-labs/rpc-providers": "0.18.100-viem.10",
21
+ "@dynamic-labs/types": "0.18.100-viem.10",
22
+ "@dynamic-labs/utils": "0.18.100-viem.10",
23
+ "@dynamic-labs/wallet-book": "0.18.100-viem.10",
24
+ "@dynamic-labs/wallet-connector-core": "0.18.100-viem.10",
25
25
  "eventemitter3": "5.0.1"
26
26
  },
27
27
  "devDependencies": {
package/src/index.cjs CHANGED
@@ -14,6 +14,7 @@ var DynamicNav = require('./lib/widgets/DynamicWidget/components/DynamicNav/Dyna
14
14
  var DynamicUserProfile = require('./lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.cjs');
15
15
  var FundingWidget = require('./lib/widgets/FundingWidget/FundingWidget.cjs');
16
16
  var DynamicBridgeWidget = require('./lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.cjs');
17
+ var OAuthIFrameContainer = require('./lib/widgets/OAuthIFrameContainer/OAuthIFrameContainer.cjs');
17
18
  require('react/jsx-runtime');
18
19
  require('react');
19
20
  var classNames = require('./lib/utils/functions/classNames/classNames.cjs');
@@ -147,6 +148,7 @@ exports.DynamicNav = DynamicNav.ShadowedDynamicNav;
147
148
  exports.DynamicUserProfile = DynamicUserProfile.ShadowedDynamicUserProfile;
148
149
  exports.FundingWidget = FundingWidget.FundingWidget;
149
150
  exports.DynamicBridgeWidget = DynamicBridgeWidget.DynamicBridgeWidget;
151
+ exports.OAuthIFrameContainer = OAuthIFrameContainer.OAuthIFrameContainer;
150
152
  exports.classNames = classNames.classNames;
151
153
  exports.decodeJwt = decodeJwt.decodeJwt;
152
154
  exports.validateType = validateType.validateType;
package/src/index.js CHANGED
@@ -10,6 +10,7 @@ export { ShadowedDynamicNav as DynamicNav } from './lib/widgets/DynamicWidget/co
10
10
  export { ShadowedDynamicUserProfile as DynamicUserProfile } from './lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.js';
11
11
  export { FundingWidget } from './lib/widgets/FundingWidget/FundingWidget.js';
12
12
  export { DynamicBridgeWidget } from './lib/widgets/DynamicBridgeWidget/DynamicBridgeWidget.js';
13
+ export { OAuthIFrameContainer } from './lib/widgets/OAuthIFrameContainer/OAuthIFrameContainer.js';
13
14
  import 'react/jsx-runtime';
14
15
  import 'react';
15
16
  export { classNames } from './lib/utils/functions/classNames/classNames.js';
@@ -12,13 +12,13 @@ var watchToScrollInHierarchy = require('../utils/watchToScrollInHierarchy/watchT
12
12
  require('../../../shared/logger.cjs');
13
13
  require('../../../shared/utils/classes/storage/localStorage.cjs');
14
14
  var index = require('../../../shared/utils/hooks/useOnClickOutside/index.cjs');
15
+ require('@dynamic-labs/utils');
15
16
  var useForwardedRef = require('../../../shared/utils/hooks/useForwardedRef/useForwardedRef.cjs');
16
17
  require('@dynamic-labs/sdk-api');
17
18
  require('@dynamic-labs/iconic');
18
19
  require('@dynamic-labs/wallet-connector-core');
19
20
  require('../../../context/ViewContext/ViewContext.cjs');
20
21
  require('@dynamic-labs/wallet-book');
21
- require('@dynamic-labs/utils');
22
22
  require('../../../utils/constants/colors.cjs');
23
23
  require('viem');
24
24
  require('../../../shared/consts/index.cjs');
@@ -8,13 +8,13 @@ import { watchToScrollInHierarchy } from '../utils/watchToScrollInHierarchy/watc
8
8
  import '../../../shared/logger.js';
9
9
  import '../../../shared/utils/classes/storage/localStorage.js';
10
10
  import { useOnClickOutside } from '../../../shared/utils/hooks/useOnClickOutside/index.js';
11
+ import '@dynamic-labs/utils';
11
12
  import { useForwardedRef } from '../../../shared/utils/hooks/useForwardedRef/useForwardedRef.js';
12
13
  import '@dynamic-labs/sdk-api';
13
14
  import '@dynamic-labs/iconic';
14
15
  import '@dynamic-labs/wallet-connector-core';
15
16
  import '../../../context/ViewContext/ViewContext.js';
16
17
  import '@dynamic-labs/wallet-book';
17
- import '@dynamic-labs/utils';
18
18
  import '../../../utils/constants/colors.js';
19
19
  import 'viem';
20
20
  import '../../../shared/consts/index.js';
@@ -13,9 +13,13 @@ var VerticalDrawerTransition = require('../Transition/VerticalDrawerTransition/V
13
13
 
14
14
  const typographyColor = {
15
15
  error: 'error-1',
16
+ notice: 'brand-primary',
17
+ success: 'green-1',
16
18
  };
17
- const ModalHeaderBanner = ({ message, type = 'error', }) => (jsxRuntime.jsx(AnimatePresence.AnimatePresence, { animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, { style: { width: '100%' } }), children: Boolean(message) && (jsxRuntime.jsx("div", { className: classNames.classNames('modal-header-banner', {
19
+ const ModalHeaderBanner = ({ message, type = 'error', disableTruncate = false, }) => (jsxRuntime.jsx(AnimatePresence.AnimatePresence, { animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, { style: { width: '100%' } }), children: Boolean(message) && (jsxRuntime.jsx("div", { className: classNames.classNames('modal-header-banner', {
18
20
  'modal-header-banner__error': type === 'error',
19
- }), children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: typographyColor[type], truncate: true, children: message }) })) }));
21
+ 'modal-header-banner__notice': type === 'notice',
22
+ 'modal-header-banner__success': type === 'success',
23
+ }), children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: typographyColor[type], truncate: disableTruncate === false, children: message }) })) }));
20
24
 
21
25
  exports.ModalHeaderBanner = ModalHeaderBanner;
@@ -1,8 +1,9 @@
1
1
  import { FC } from 'react';
2
- type ModalHeaderBannerType = 'error';
2
+ type ModalHeaderBannerType = 'error' | 'success' | 'notice';
3
3
  export type ModalHeaderBannerProps = {
4
4
  message?: string;
5
5
  type?: ModalHeaderBannerType;
6
+ disableTruncate?: boolean;
6
7
  };
7
8
  export declare const ModalHeaderBanner: FC<ModalHeaderBannerProps>;
8
9
  export {};
@@ -9,9 +9,13 @@ import { VerticalDrawerTransition } from '../Transition/VerticalDrawerTransition
9
9
 
10
10
  const typographyColor = {
11
11
  error: 'error-1',
12
+ notice: 'brand-primary',
13
+ success: 'green-1',
12
14
  };
13
- const ModalHeaderBanner = ({ message, type = 'error', }) => (jsx(AnimatePresence, { animationComponent: jsx(VerticalDrawerTransition, { style: { width: '100%' } }), children: Boolean(message) && (jsx("div", { className: classNames('modal-header-banner', {
15
+ const ModalHeaderBanner = ({ message, type = 'error', disableTruncate = false, }) => (jsx(AnimatePresence, { animationComponent: jsx(VerticalDrawerTransition, { style: { width: '100%' } }), children: Boolean(message) && (jsx("div", { className: classNames('modal-header-banner', {
14
16
  'modal-header-banner__error': type === 'error',
15
- }), children: jsx(Typography, { variant: 'body_small', color: typographyColor[type], truncate: true, children: message }) })) }));
17
+ 'modal-header-banner__notice': type === 'notice',
18
+ 'modal-header-banner__success': type === 'success',
19
+ }), children: jsx(Typography, { variant: 'body_small', color: typographyColor[type], truncate: disableTruncate === false, children: message }) })) }));
16
20
 
17
21
  export { ModalHeaderBanner };
@@ -55,10 +55,10 @@ require('yup');
55
55
  require('../InlineWidget/InlineWidget.cjs');
56
56
  require('../MenuList/Dropdown/Dropdown.cjs');
57
57
 
58
- const OTPVerificationView = ({ onClickBack, onClickEditEmail, isLoading, email, onPinComplete, isValid, error, onPinChange, onClickClose, displayPoweredByDynamic = false, }) => {
58
+ const OTPVerificationView = ({ onClickBack, onClickEditEmail, isLoading, email, onPinComplete, isValid, error, onPinChange, onClickClose, displayPoweredByDynamic = false, successBannerText, }) => {
59
59
  const backButton = onClickBack && (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: onClickBack, "data-testid": 'back-button', children: jsxRuntime.jsx(chevronLeft.ReactComponent, {}) }));
60
60
  const closeButton = (jsxRuntime.jsx(IconButton.IconButton, { onClick: onClickClose, type: 'button', "data-testid": 'close-button', children: jsxRuntime.jsx(close.ReactComponent, {}) }));
61
- return (jsxRuntime.jsxs("div", { className: 'otp-verification-view', children: [jsxRuntime.jsx(ModalHeaderBanner.ModalHeaderBanner, { type: 'error', message: error === null || error === void 0 ? void 0 : error.message }), jsxRuntime.jsx(ModalHeader.ModalHeader, { alignContent: 'bottom', leading: onClickBack && backButton, trailing: onClickClose && closeButton, children: jsxRuntime.jsxs("div", { className: 'otp-verification-view__status-header', children: [isValid && (jsxRuntime.jsx(IconWithStatus.IconWithStatus, { Icon: iconic.SignInWithEmailIcon, iconSize: 50, InnerIcon: check.ReactComponent })), !isValid && (jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: iconic.SignInWithEmailIcon, iconSize: 80, isSpinning: isLoading }))] }) }), jsxRuntime.jsx(Typography.Typography, { weight: 'medium', variant: 'title', color: 'primary', className: 'otp-verification-view__title', children: isValid ? 'Verification code confirmed' : 'Confirm verification code' }), jsxRuntime.jsxs("div", { className: 'otp-verification-view__body', children: [isValid && (jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', children: "Hang tight while we get things ready for you" })), !isValid && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', children: "We\u2019ve sent a verification code to" }), 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("div", { className: 'otp-verification-view__footer', children: displayPoweredByDynamic && jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, {}) })] }));
61
+ return (jsxRuntime.jsxs("div", { className: 'otp-verification-view', children: [successBannerText && (jsxRuntime.jsx(ModalHeaderBanner.ModalHeaderBanner, { type: 'notice', message: successBannerText, disableTruncate: true })), jsxRuntime.jsx(ModalHeaderBanner.ModalHeaderBanner, { type: 'error', message: error === null || error === void 0 ? void 0 : error.message }), jsxRuntime.jsx(ModalHeader.ModalHeader, { alignContent: 'bottom', leading: onClickBack && backButton, trailing: onClickClose && closeButton, children: jsxRuntime.jsxs("div", { className: 'otp-verification-view__status-header', children: [isValid && (jsxRuntime.jsx(IconWithStatus.IconWithStatus, { Icon: iconic.SignInWithEmailIcon, iconSize: 50, InnerIcon: check.ReactComponent })), !isValid && (jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: iconic.SignInWithEmailIcon, iconSize: 80, isSpinning: isLoading }))] }) }), jsxRuntime.jsx(Typography.Typography, { weight: 'medium', variant: 'title', color: 'primary', className: 'otp-verification-view__title', children: isValid ? 'Verification code confirmed' : 'Confirm verification code' }), jsxRuntime.jsxs("div", { className: 'otp-verification-view__body', children: [isValid && (jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', children: "Hang tight while we get things ready for you" })), !isValid && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', children: "We\u2019ve sent a verification code to" }), 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("div", { className: 'otp-verification-view__footer', children: displayPoweredByDynamic && jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, {}) })] }));
62
62
  };
63
63
 
64
64
  exports.OTPVerificationView = OTPVerificationView;
@@ -10,6 +10,7 @@ type OtpVerificationLayoutProps = {
10
10
  onClickEditEmail?: MouseEventHandler<HTMLButtonElement>;
11
11
  onPinChange?: (value: string) => void;
12
12
  onPinComplete: (value: string) => void;
13
+ successBannerText?: string;
13
14
  };
14
15
  export declare const OTPVerificationView: FC<OtpVerificationLayoutProps>;
15
16
  export {};
@@ -51,10 +51,10 @@ import 'yup';
51
51
  import '../InlineWidget/InlineWidget.js';
52
52
  import '../MenuList/Dropdown/Dropdown.js';
53
53
 
54
- const OTPVerificationView = ({ onClickBack, onClickEditEmail, isLoading, email, onPinComplete, isValid, error, onPinChange, onClickClose, displayPoweredByDynamic = false, }) => {
54
+ const OTPVerificationView = ({ onClickBack, onClickEditEmail, isLoading, email, onPinComplete, isValid, error, onPinChange, onClickClose, displayPoweredByDynamic = false, successBannerText, }) => {
55
55
  const backButton = onClickBack && (jsx(IconButton, { type: 'button', onClick: onClickBack, "data-testid": 'back-button', children: jsx(SvgChevronLeft, {}) }));
56
56
  const closeButton = (jsx(IconButton, { onClick: onClickClose, type: 'button', "data-testid": 'close-button', children: jsx(SvgClose, {}) }));
57
- return (jsxs("div", { className: 'otp-verification-view', children: [jsx(ModalHeaderBanner, { type: 'error', message: error === null || error === void 0 ? void 0 : error.message }), jsx(ModalHeader, { alignContent: 'bottom', leading: onClickBack && backButton, trailing: onClickClose && closeButton, children: jsxs("div", { className: 'otp-verification-view__status-header', children: [isValid && (jsx(IconWithStatus, { Icon: SignInWithEmailIcon, iconSize: 50, InnerIcon: SvgCheck })), !isValid && (jsx(IconWithSpinner, { Icon: SignInWithEmailIcon, iconSize: 80, isSpinning: isLoading }))] }) }), jsx(Typography, { weight: 'medium', variant: 'title', color: 'primary', className: 'otp-verification-view__title', children: isValid ? 'Verification code confirmed' : 'Confirm verification code' }), jsxs("div", { className: 'otp-verification-view__body', children: [isValid && (jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', children: "Hang tight while we get things ready for you" })), !isValid && (jsxs(Fragment, { children: [jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', children: "We\u2019ve sent a verification code to" }), 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("div", { className: 'otp-verification-view__footer', children: displayPoweredByDynamic && jsx(PoweredByDynamic, {}) })] }));
57
+ return (jsxs("div", { className: 'otp-verification-view', children: [successBannerText && (jsx(ModalHeaderBanner, { type: 'notice', message: successBannerText, disableTruncate: true })), jsx(ModalHeaderBanner, { type: 'error', message: error === null || error === void 0 ? void 0 : error.message }), jsx(ModalHeader, { alignContent: 'bottom', leading: onClickBack && backButton, trailing: onClickClose && closeButton, children: jsxs("div", { className: 'otp-verification-view__status-header', children: [isValid && (jsx(IconWithStatus, { Icon: SignInWithEmailIcon, iconSize: 50, InnerIcon: SvgCheck })), !isValid && (jsx(IconWithSpinner, { Icon: SignInWithEmailIcon, iconSize: 80, isSpinning: isLoading }))] }) }), jsx(Typography, { weight: 'medium', variant: 'title', color: 'primary', className: 'otp-verification-view__title', children: isValid ? 'Verification code confirmed' : 'Confirm verification code' }), jsxs("div", { className: 'otp-verification-view__body', children: [isValid && (jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', children: "Hang tight while we get things ready for you" })), !isValid && (jsxs(Fragment, { children: [jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', children: "We\u2019ve sent a verification code to" }), 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("div", { className: 'otp-verification-view__footer', children: displayPoweredByDynamic && jsx(PoweredByDynamic, {}) })] }));
58
58
  };
59
59
 
60
60
  export { OTPVerificationView };
@@ -29,6 +29,7 @@ const Typography = (_a) => {
29
29
  'brand-primary': 'typography--brand-primary',
30
30
  'error-1': 'typography--dynamic-error-1',
31
31
  'error-2': 'typography--dynamic-error-2',
32
+ 'green-1': 'typography--connection-green-1',
32
33
  link: 'typography--link',
33
34
  primary: 'typography--primary',
34
35
  secondary: 'typography--secondary',
@@ -25,6 +25,7 @@ const Typography = (_a) => {
25
25
  'brand-primary': 'typography--brand-primary',
26
26
  'error-1': 'typography--dynamic-error-1',
27
27
  'error-2': 'typography--dynamic-error-2',
28
+ 'green-1': 'typography--connection-green-1',
28
29
  link: 'typography--link',
29
30
  primary: 'typography--primary',
30
31
  secondary: 'typography--secondary',
@@ -1,7 +1,7 @@
1
1
  import { ComponentPropsWithoutRef, ElementType, ReactElement } from 'react';
2
2
  export type TypographyTag = ElementType;
3
3
  export type TypographyVariant = 'title' | 'body_normal' | 'body_small' | 'body_mini' | 'button_primary' | 'button_secondary' | 'button_tertiary' | 'numbers_big' | 'numbers_medium' | 'numbers_small';
4
- export type TypographyColor = 'primary' | 'secondary' | 'brand-primary' | 'tertiary' | 'link' | 'error-1' | 'error-2' | 'tooltip';
4
+ export type TypographyColor = 'primary' | 'secondary' | 'brand-primary' | 'tertiary' | 'link' | 'error-1' | 'error-2' | 'tooltip' | 'green-1';
5
5
  export type TypographyWeight = 'regular' | 'medium' | 'bold';
6
6
  export type TypographyTransform = 'uppercase';
7
7
  export type TypographyProps<TAG extends ElementType = 'p'> = {
@@ -43,7 +43,7 @@ const UserProfile = ({ rootClassName }) => {
43
43
  const { label } = index$1.getValueByKey(fieldsConfig.fieldsConfig, name);
44
44
  const value = mapFieldKeyToValue(name);
45
45
  return (jsxRuntime.jsx(UserProfileField.UserProfileField, { name: name, label: label, value: value }, name));
46
- }) }) })), (providers === null || providers === void 0 ? void 0 : providers.length) > 0 && (jsxRuntime.jsx(UserProfileSection.UserProfileSection, { title: 'Social accounts', children: jsxRuntime.jsx("div", { className: 'user-profile__social-accounts', children: providers.map(({ authorizationUrl, provider }) => (jsxRuntime.jsx(UserProfileSocialAccount.UserProfileSocialAccount, { provider: provider }, provider))) }) }))] }));
46
+ }) }) })), (providers === null || providers === void 0 ? void 0 : providers.length) > 0 && (jsxRuntime.jsx(UserProfileSection.UserProfileSection, { title: 'Social accounts', children: jsxRuntime.jsx("div", { className: 'user-profile__social-accounts', children: providers.map(({ provider }) => (jsxRuntime.jsx(UserProfileSocialAccount.UserProfileSocialAccount, { provider: provider }, provider))) }) }))] }));
47
47
  };
48
48
 
49
49
  exports.UserProfile = UserProfile;
@@ -39,7 +39,7 @@ const UserProfile = ({ rootClassName }) => {
39
39
  const { label } = getValueByKey(fieldsConfig, name);
40
40
  const value = mapFieldKeyToValue(name);
41
41
  return (jsx(UserProfileField, { name: name, label: label, value: value }, name));
42
- }) }) })), (providers === null || providers === void 0 ? void 0 : providers.length) > 0 && (jsx(UserProfileSection, { title: 'Social accounts', children: jsx("div", { className: 'user-profile__social-accounts', children: providers.map(({ authorizationUrl, provider }) => (jsx(UserProfileSocialAccount, { provider: provider }, provider))) }) }))] }));
42
+ }) }) })), (providers === null || providers === void 0 ? void 0 : providers.length) > 0 && (jsx(UserProfileSection, { title: 'Social accounts', children: jsx("div", { className: 'user-profile__social-accounts', children: providers.map(({ provider }) => (jsx(UserProfileSocialAccount, { provider: provider }, provider))) }) }))] }));
43
43
  };
44
44
 
45
45
  export { UserProfile };
@@ -57,7 +57,7 @@ const UserProfileSocialAccount = ({ provider, }) => {
57
57
  const isProviderLinked = isLinked(provider);
58
58
  const connectedAccountInfo = getLinkedAccountInformation(provider);
59
59
  const iconThemeVariant = useIconThemeVariant.useIconThemeVariant();
60
- return (jsxRuntime.jsxs("div", { className: 'user-profile-social-account', "data-testid": `social-account-${provider}`, children: [jsxRuntime.jsx("div", { className: 'user-profile-social-account__icon', children: isProviderLinked ? (jsxRuntime.jsx(ConnectedAccountAvatar.ConnectedAccountAvatar, { provider: provider, avatarUrl: connectedAccountInfo === null || connectedAccountInfo === void 0 ? void 0 : connectedAccountInfo.avatar, iconThemeVariant: iconThemeVariant })) : (jsxRuntime.jsx(iconic.SocialIcon, { name: provider, variant: iconThemeVariant })) }), jsxRuntime.jsx("div", { className: 'user-profile-social-account__label', children: jsxRuntime.jsx(Typography.Typography, { weight: 'medium', variant: 'body_normal', color: 'primary', children: (_a = connectedAccountInfo === null || connectedAccountInfo === void 0 ? void 0 : connectedAccountInfo.publicIdentifier) !== null && _a !== void 0 ? _a : helpers.capitalize(provider) }) }), isProviderLinked ? (jsxRuntime.jsx(Button.Button, { buttonClassName: 'user-profile-social-account__button', buttonVariant: 'secondary', buttonRounded: 'small', buttonPadding: 'none', onClick: () => unlinkSocialAccount(provider), loading: isProcessing, dataTestId: 'social-account-disconnect-button', typographyProps: {
60
+ return (jsxRuntime.jsxs("div", { className: 'user-profile-social-account', "data-testid": `social-account-${provider}`, children: [jsxRuntime.jsx("div", { className: 'user-profile-social-account__icon', children: isProviderLinked ? (jsxRuntime.jsx(ConnectedAccountAvatar.ConnectedAccountAvatar, { provider: provider, avatarUrl: connectedAccountInfo === null || connectedAccountInfo === void 0 ? void 0 : connectedAccountInfo.avatar })) : (jsxRuntime.jsx(iconic.SocialIcon, { name: provider, variant: iconThemeVariant })) }), jsxRuntime.jsx("div", { className: 'user-profile-social-account__label', children: jsxRuntime.jsx(Typography.Typography, { weight: 'medium', variant: 'body_normal', color: 'primary', children: (_a = connectedAccountInfo === null || connectedAccountInfo === void 0 ? void 0 : connectedAccountInfo.publicIdentifier) !== null && _a !== void 0 ? _a : helpers.capitalize(provider) }) }), isProviderLinked ? (jsxRuntime.jsx(Button.Button, { buttonClassName: 'user-profile-social-account__button', buttonVariant: 'secondary', buttonRounded: 'small', buttonPadding: 'none', onClick: () => unlinkSocialAccount(provider), loading: isProcessing, dataTestId: 'social-account-disconnect-button', typographyProps: {
61
61
  color: 'secondary',
62
62
  variant: 'button_tertiary',
63
63
  }, startSlot:
@@ -53,7 +53,7 @@ const UserProfileSocialAccount = ({ provider, }) => {
53
53
  const isProviderLinked = isLinked(provider);
54
54
  const connectedAccountInfo = getLinkedAccountInformation(provider);
55
55
  const iconThemeVariant = useIconThemeVariant();
56
- return (jsxs("div", { className: 'user-profile-social-account', "data-testid": `social-account-${provider}`, children: [jsx("div", { className: 'user-profile-social-account__icon', children: isProviderLinked ? (jsx(ConnectedAccountAvatar, { provider: provider, avatarUrl: connectedAccountInfo === null || connectedAccountInfo === void 0 ? void 0 : connectedAccountInfo.avatar, iconThemeVariant: iconThemeVariant })) : (jsx(SocialIcon, { name: provider, variant: iconThemeVariant })) }), jsx("div", { className: 'user-profile-social-account__label', children: jsx(Typography, { weight: 'medium', variant: 'body_normal', color: 'primary', children: (_a = connectedAccountInfo === null || connectedAccountInfo === void 0 ? void 0 : connectedAccountInfo.publicIdentifier) !== null && _a !== void 0 ? _a : capitalize(provider) }) }), isProviderLinked ? (jsx(Button, { buttonClassName: 'user-profile-social-account__button', buttonVariant: 'secondary', buttonRounded: 'small', buttonPadding: 'none', onClick: () => unlinkSocialAccount(provider), loading: isProcessing, dataTestId: 'social-account-disconnect-button', typographyProps: {
56
+ return (jsxs("div", { className: 'user-profile-social-account', "data-testid": `social-account-${provider}`, children: [jsx("div", { className: 'user-profile-social-account__icon', children: isProviderLinked ? (jsx(ConnectedAccountAvatar, { provider: provider, avatarUrl: connectedAccountInfo === null || connectedAccountInfo === void 0 ? void 0 : connectedAccountInfo.avatar })) : (jsx(SocialIcon, { name: provider, variant: iconThemeVariant })) }), jsx("div", { className: 'user-profile-social-account__label', children: jsx(Typography, { weight: 'medium', variant: 'body_normal', color: 'primary', children: (_a = connectedAccountInfo === null || connectedAccountInfo === void 0 ? void 0 : connectedAccountInfo.publicIdentifier) !== null && _a !== void 0 ? _a : capitalize(provider) }) }), isProviderLinked ? (jsx(Button, { buttonClassName: 'user-profile-social-account__button', buttonVariant: 'secondary', buttonRounded: 'small', buttonPadding: 'none', onClick: () => unlinkSocialAccount(provider), loading: isProcessing, dataTestId: 'social-account-disconnect-button', typographyProps: {
57
57
  color: 'secondary',
58
58
  variant: 'button_tertiary',
59
59
  }, startSlot:
@@ -79,6 +79,7 @@ require('../../views/CollectUserDataView/fieldsConfig.cjs');
79
79
  require('../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
80
80
  var FundingWidget = require('../../widgets/FundingWidget/FundingWidget.cjs');
81
81
  var DynamicBridgeWidgetContext = require('../../widgets/DynamicBridgeWidget/context/DynamicBridgeWidgetContext/DynamicBridgeWidgetContext.cjs');
82
+ var OAuthIFrameContainer = require('../../widgets/OAuthIFrameContainer/OAuthIFrameContainer.cjs');
82
83
  var EmailVerificationContext = require('../EmailVerificationContext/EmailVerificationContext.cjs');
83
84
  var FundingContext = require('../FundingContext/FundingContext.cjs');
84
85
  var SendBalanceContext = require('../SendBalanceContext/SendBalanceContext.cjs');
@@ -93,6 +94,7 @@ var useVerificationInProgress = require('./hooks/useVerificationInProgress/useVe
93
94
  var useCustomerCallbacks = require('./useCustomerCallbacks/useCustomerCallbacks.cjs');
94
95
  var useCustomerAuthFlowCallbacks = require('./useCustomerCallbacks/useCustomerAuthFlowCallbacks.cjs');
95
96
  var validators = require('./validators.cjs');
97
+ var internalEvents = require('./internalEvents/internalEvents.cjs');
96
98
 
97
99
  const PUBLIC_PROJECT_LIVE_ENVIRONMENT_ID = '2762a57b-faa4-41ce-9f16-abff9300e2c9';
98
100
  const EMPTY_INITIAL_USER = undefined;
@@ -100,6 +102,9 @@ const DynamicContext = React.createContext(undefined);
100
102
  const DynamicContextProvider = ({ children, theme, settings, }) => {
101
103
  var _a, _b, _c, _d, _e, _f, _g, _h;
102
104
  const { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, apiBaseUrl, walletsByChain, cssOverrides, defaultNumberOfWalletsToShow = values.DEFAULT_NUMBER_OF_WALLETS_TO_SHOW, flowNetwork, initialAuthenticationMode = 'connect-and-sign', debugError = false, displaySiweStatement = true, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly = true, environmentId, localStorageSuffix, eventsCallbacks, evmNetworks, walletsFilter, logLevel = 'WARN', notInTheListImageUrl, onboardingImageUrl, policiesConsentInnerComponent, customPrivacyPolicy, privacyPolicyUrl, signWithEmailWalletName, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, customTermsOfServices, termsOfServiceUrl, toolkitEnabled, siweStatement, shadowDOMEnabled = true, walletConnectors: walletConnectorsProp, socialProvidersFilter, } = settings;
105
+ // The following event related methods are temporary and should be removed after QNTM-180 is done
106
+ // ============ START REMOVE AFTER QNTM-180 ============
107
+ const internalEventsRef = React.useRef(internalEvents.getInternalEvents());
103
108
  let { walletConnectV1Bridge, appLogoUrl = 'https://demo.dynamic.xyz/assets/dynamic-logo.svg', appName = 'Dynamic Example', } = settings;
104
109
  if (!environmentId) {
105
110
  throw new utils.MissingEnvironmentIdError();
@@ -178,7 +183,7 @@ const DynamicContextProvider = ({ children, theme, settings, }) => {
178
183
  walletUiUtils,
179
184
  });
180
185
  const [authMode, setAuthMode] = useLocalStorage.useLocalStorage(localStorage$1.AUTH_MODE, initialAuthenticationMode);
181
- const { clearPrimaryWalletId, primaryWalletId, setPrimaryWalletId } = usePrimaryWalletId.usePrimaryWalletId();
186
+ const { clearPrimaryWalletId, primaryWalletId, setPrimaryWalletId } = usePrimaryWalletId.usePrimaryWalletId(internalEventsRef.current);
182
187
  const { connectWallet, removeConnectedWalletsInfo, connectedWalletsInfo, connectedWallet, getConnectedWalletById, connectedWallets, unlinkConnectedWallet, refreshConnectedWallet, } = useConnectWallet.useConnectWallet({
183
188
  authMode,
184
189
  clearPrimaryWalletId,
@@ -445,6 +450,7 @@ const DynamicContextProvider = ({ children, theme, settings, }) => {
445
450
  handleUnlinkWallet: authMode === 'connect-only'
446
451
  ? unlinkConnectedWallet
447
452
  : handleUnlinkWallet,
453
+ internalEvents: internalEventsRef,
448
454
  isAuthenticated,
449
455
  isBridgeFlow,
450
456
  isFullyConnected,
@@ -673,7 +679,7 @@ const DynamicContextProvider = ({ children, theme, settings, }) => {
673
679
  isBridgeFlow,
674
680
  isFullyConnected,
675
681
  loginWithEmail,
676
- }), children: jsxRuntime.jsx(AccountExistsContext.AccountExistsContextProvider, { children: jsxRuntime.jsx(WalletContext.WalletContextProvider, { canSync: didConnectedStateLoad, children: jsxRuntime.jsx(QrCodeContext.QrCodeContextProvider, { children: jsxRuntime.jsx(EmailVerificationContext.EmailVerificationContextProvider, { children: jsxRuntime.jsx(ErrorContext.ErrorContextProvider, { children: jsxRuntime.jsx(DynamicWidgetContext.DynamicWidgetContextProvider, { children: jsxRuntime.jsx(DynamicBridgeWidgetContext.DynamicBridgeWidgetContextProvider, { children: jsxRuntime.jsx(CaptchaContext.CaptchaContextProvider, { children: jsxRuntime.jsx(FundingContext.FundingContextProvider, { children: jsxRuntime.jsx(AccessDeniedContext.AccessDeniedContextProvider, { children: jsxRuntime.jsx(SendBalanceContext.SendBalanceContextProvider, { children: jsxRuntime.jsxs(WalletGroupContext.WalletGroupContextProvider, { children: [jsxRuntime.jsx(app.DynamicAuthFlow, {}), jsxRuntime.jsx(Toolkit.Toolkit, {}), jsxRuntime.jsx(FundingWidget.FundingWidget, {}), confirmationModal, children] }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }));
682
+ }), children: jsxRuntime.jsx(AccountExistsContext.AccountExistsContextProvider, { children: jsxRuntime.jsx(WalletContext.WalletContextProvider, { canSync: didConnectedStateLoad, children: jsxRuntime.jsx(QrCodeContext.QrCodeContextProvider, { children: jsxRuntime.jsx(EmailVerificationContext.EmailVerificationContextProvider, { children: jsxRuntime.jsx(ErrorContext.ErrorContextProvider, { children: jsxRuntime.jsx(DynamicWidgetContext.DynamicWidgetContextProvider, { children: jsxRuntime.jsx(DynamicBridgeWidgetContext.DynamicBridgeWidgetContextProvider, { children: jsxRuntime.jsx(CaptchaContext.CaptchaContextProvider, { children: jsxRuntime.jsx(FundingContext.FundingContextProvider, { children: jsxRuntime.jsx(AccessDeniedContext.AccessDeniedContextProvider, { children: jsxRuntime.jsx(SendBalanceContext.SendBalanceContextProvider, { children: jsxRuntime.jsxs(WalletGroupContext.WalletGroupContextProvider, { children: [jsxRuntime.jsx(app.DynamicAuthFlow, {}), jsxRuntime.jsx(Toolkit.Toolkit, {}), jsxRuntime.jsx(FundingWidget.FundingWidget, {}), jsxRuntime.jsx(OAuthIFrameContainer.OAuthIFrameContainer, {}), confirmationModal, children] }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }));
677
683
  };
678
684
 
679
685
  exports.DynamicContext = DynamicContext;
@@ -1,6 +1,6 @@
1
1
  import { __awaiter } from '../../../../_virtual/_tslib.js';
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
- import { createContext, useState, useEffect, useCallback, useMemo } from 'react';
3
+ import { createContext, useRef, useState, useEffect, useCallback, useMemo } from 'react';
4
4
  import { ICONIC_SPRITE_URL } from '@dynamic-labs/iconic';
5
5
  import { MissingEnvironmentIdError } from '@dynamic-labs/utils';
6
6
  import { useWalletBookCdn, getWalletBookCdnUrl, WalletBookContextProvider } from '@dynamic-labs/wallet-book';
@@ -75,6 +75,7 @@ import '../../views/CollectUserDataView/fieldsConfig.js';
75
75
  import '../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
76
76
  import { FundingWidget } from '../../widgets/FundingWidget/FundingWidget.js';
77
77
  import { DynamicBridgeWidgetContextProvider } from '../../widgets/DynamicBridgeWidget/context/DynamicBridgeWidgetContext/DynamicBridgeWidgetContext.js';
78
+ import { OAuthIFrameContainer } from '../../widgets/OAuthIFrameContainer/OAuthIFrameContainer.js';
78
79
  import { EmailVerificationContextProvider } from '../EmailVerificationContext/EmailVerificationContext.js';
79
80
  import { FundingContextProvider } from '../FundingContext/FundingContext.js';
80
81
  import { SendBalanceContextProvider } from '../SendBalanceContext/SendBalanceContext.js';
@@ -89,6 +90,7 @@ import { useVerificationInProgress } from './hooks/useVerificationInProgress/use
89
90
  import { useCustomerCallbacks } from './useCustomerCallbacks/useCustomerCallbacks.js';
90
91
  import { useCustomerAuthFlowCallbacks } from './useCustomerCallbacks/useCustomerAuthFlowCallbacks.js';
91
92
  import { validateAuthUser } from './validators.js';
93
+ import { getInternalEvents } from './internalEvents/internalEvents.js';
92
94
 
93
95
  const PUBLIC_PROJECT_LIVE_ENVIRONMENT_ID = '2762a57b-faa4-41ce-9f16-abff9300e2c9';
94
96
  const EMPTY_INITIAL_USER = undefined;
@@ -96,6 +98,9 @@ const DynamicContext = createContext(undefined);
96
98
  const DynamicContextProvider = ({ children, theme, settings, }) => {
97
99
  var _a, _b, _c, _d, _e, _f, _g, _h;
98
100
  const { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, apiBaseUrl, walletsByChain, cssOverrides, defaultNumberOfWalletsToShow = DEFAULT_NUMBER_OF_WALLETS_TO_SHOW, flowNetwork, initialAuthenticationMode = 'connect-and-sign', debugError = false, displaySiweStatement = true, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly = true, environmentId, localStorageSuffix, eventsCallbacks, evmNetworks, walletsFilter, logLevel = 'WARN', notInTheListImageUrl, onboardingImageUrl, policiesConsentInnerComponent, customPrivacyPolicy, privacyPolicyUrl, signWithEmailWalletName, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, customTermsOfServices, termsOfServiceUrl, toolkitEnabled, siweStatement, shadowDOMEnabled = true, walletConnectors: walletConnectorsProp, socialProvidersFilter, } = settings;
101
+ // The following event related methods are temporary and should be removed after QNTM-180 is done
102
+ // ============ START REMOVE AFTER QNTM-180 ============
103
+ const internalEventsRef = useRef(getInternalEvents());
99
104
  let { walletConnectV1Bridge, appLogoUrl = 'https://demo.dynamic.xyz/assets/dynamic-logo.svg', appName = 'Dynamic Example', } = settings;
100
105
  if (!environmentId) {
101
106
  throw new MissingEnvironmentIdError();
@@ -174,7 +179,7 @@ const DynamicContextProvider = ({ children, theme, settings, }) => {
174
179
  walletUiUtils,
175
180
  });
176
181
  const [authMode, setAuthMode] = useLocalStorage(AUTH_MODE, initialAuthenticationMode);
177
- const { clearPrimaryWalletId, primaryWalletId, setPrimaryWalletId } = usePrimaryWalletId();
182
+ const { clearPrimaryWalletId, primaryWalletId, setPrimaryWalletId } = usePrimaryWalletId(internalEventsRef.current);
178
183
  const { connectWallet, removeConnectedWalletsInfo, connectedWalletsInfo, connectedWallet, getConnectedWalletById, connectedWallets, unlinkConnectedWallet, refreshConnectedWallet, } = useConnectWallet({
179
184
  authMode,
180
185
  clearPrimaryWalletId,
@@ -441,6 +446,7 @@ const DynamicContextProvider = ({ children, theme, settings, }) => {
441
446
  handleUnlinkWallet: authMode === 'connect-only'
442
447
  ? unlinkConnectedWallet
443
448
  : handleUnlinkWallet,
449
+ internalEvents: internalEventsRef,
444
450
  isAuthenticated,
445
451
  isBridgeFlow,
446
452
  isFullyConnected,
@@ -669,7 +675,7 @@ const DynamicContextProvider = ({ children, theme, settings, }) => {
669
675
  isBridgeFlow,
670
676
  isFullyConnected,
671
677
  loginWithEmail,
672
- }), children: jsx(AccountExistsContextProvider, { children: jsx(WalletContextProvider, { canSync: didConnectedStateLoad, children: jsx(QrCodeContextProvider, { children: jsx(EmailVerificationContextProvider, { children: jsx(ErrorContextProvider, { children: jsx(DynamicWidgetContextProvider, { children: jsx(DynamicBridgeWidgetContextProvider, { children: jsx(CaptchaContextProvider, { children: jsx(FundingContextProvider, { children: jsx(AccessDeniedContextProvider, { children: jsx(SendBalanceContextProvider, { children: jsxs(WalletGroupContextProvider, { children: [jsx(DynamicAuthFlow, {}), jsx(Toolkit, {}), jsx(FundingWidget, {}), confirmationModal, children] }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }));
678
+ }), children: jsx(AccountExistsContextProvider, { children: jsx(WalletContextProvider, { canSync: didConnectedStateLoad, children: jsx(QrCodeContextProvider, { children: jsx(EmailVerificationContextProvider, { children: jsx(ErrorContextProvider, { children: jsx(DynamicWidgetContextProvider, { children: jsx(DynamicBridgeWidgetContextProvider, { children: jsx(CaptchaContextProvider, { children: jsx(FundingContextProvider, { children: jsx(AccessDeniedContextProvider, { children: jsx(SendBalanceContextProvider, { children: jsxs(WalletGroupContextProvider, { children: [jsx(DynamicAuthFlow, {}), jsx(Toolkit, {}), jsx(FundingWidget, {}), jsx(OAuthIFrameContainer, {}), confirmationModal, children] }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }));
673
679
  };
674
680
 
675
681
  export { DynamicContext, DynamicContextProvider, PUBLIC_PROJECT_LIVE_ENVIRONMENT_ID };
@@ -0,0 +1,2 @@
1
+ export { getInternalEvents } from './internalEvents';
2
+ export type { InternalEventEmitter } from './internalEvents';
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var EventEmitter = require('eventemitter3');
6
+
7
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
+
9
+ var EventEmitter__default = /*#__PURE__*/_interopDefaultLegacy(EventEmitter);
10
+
11
+ // This file is temporary and should be removed after QNTM-180 is done
12
+ const getInternalEvents = () => new EventEmitter__default["default"]();
13
+
14
+ exports.getInternalEvents = getInternalEvents;
@@ -0,0 +1,8 @@
1
+ import EventEmitter from 'eventemitter3';
2
+ /** Maps internal event names to their listeners */
3
+ export type InternalEventMap = {
4
+ emailVerificationResult: (param: boolean) => void;
5
+ clearPrimaryWallet: () => void;
6
+ };
7
+ export type InternalEventEmitter = EventEmitter<InternalEventMap>;
8
+ export declare const getInternalEvents: () => InternalEventEmitter;
@@ -0,0 +1,6 @@
1
+ import EventEmitter from 'eventemitter3';
2
+
3
+ // This file is temporary and should be removed after QNTM-180 is done
4
+ const getInternalEvents = () => new EventEmitter();
5
+
6
+ export { getInternalEvents };
@@ -1,4 +1,4 @@
1
- import { Dispatch, ReactNode, SetStateAction } from 'react';
1
+ import { Dispatch, MutableRefObject, ReactNode, SetStateAction } from 'react';
2
2
  import { DynamicJwt, NameServiceData, ProjectSettings } from '@dynamic-labs/sdk-api';
3
3
  import { NetworkConfigurationMap, SocialProviderFilter, WalletUiUtils } from '@dynamic-labs/types';
4
4
  import { Chain, FetchPublicAddressOpts, WalletConnector } from '@dynamic-labs/wallet-connector-core';
@@ -8,6 +8,7 @@ import { MultiWalletWidgetStateSetter } from '../../../utils/hooks/multiWallet';
8
8
  import { ThemeData, ThemeSetting } from '../../ThemeContext';
9
9
  import { DisplayOrder, SetDisplayOrderPriority } from '../hooks';
10
10
  import { Callback } from '../useCustomerCallbacks';
11
+ import { InternalEventEmitter } from '../internalEvents';
11
12
  export type ChainsToConnect = {
12
13
  chain: Chain;
13
14
  numberOfWallets: number;
@@ -143,4 +144,6 @@ export interface IDynamicContext {
143
144
  legacyIsVerifying: boolean;
144
145
  /** Legacy setter for legacyIsVerifying */
145
146
  setLegacyIsVerifying: Dispatch<SetStateAction<boolean>>;
147
+ /** Temporary workaround, until QNTM-180 is complete */
148
+ internalEvents: MutableRefObject<InternalEventEmitter>;
146
149
  }