@dynamic-labs/sdk-react-core 2.1.2-alpha.1 → 2.1.3
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 +32 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +13 -13
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.cjs +1 -1
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.js +1 -1
- package/src/lib/components/PhoneNumberField/PhoneNumberField.cjs +3 -0
- package/src/lib/components/PhoneNumberField/PhoneNumberField.js +3 -0
- package/src/lib/components/PhoneNumberField/usePhoneInputLogic/usePhoneInputLogic.cjs +10 -19
- package/src/lib/components/PhoneNumberField/usePhoneInputLogic/usePhoneInputLogic.d.ts +3 -2
- package/src/lib/components/PhoneNumberField/usePhoneInputLogic/usePhoneInputLogic.js +12 -21
- package/src/lib/components/PhoneNumberField/utils/parseDefaultCountry/index.d.ts +1 -0
- package/src/lib/components/PhoneNumberField/utils/parseDefaultCountry/parseDefaultCountry.cjs +57 -0
- package/src/lib/components/PhoneNumberField/utils/parseDefaultCountry/parseDefaultCountry.d.ts +8 -0
- package/src/lib/components/PhoneNumberField/utils/parseDefaultCountry/parseDefaultCountry.js +53 -0
- package/src/lib/components/SignMessagePreview/SignMessagePreview.cjs +13 -5
- package/src/lib/components/SignMessagePreview/SignMessagePreview.js +13 -5
- package/src/lib/components/SignMessagePreview/SignMessagePreview.types.d.ts +3 -0
- package/src/lib/components/SignMessagePreview/utils/containsSpecialCharacters/containsSpecialCharacters.cjs +12 -0
- package/src/lib/components/SignMessagePreview/utils/containsSpecialCharacters/containsSpecialCharacters.d.ts +1 -0
- package/src/lib/components/SignMessagePreview/utils/containsSpecialCharacters/containsSpecialCharacters.js +8 -0
- package/src/lib/components/SignMessagePreview/utils/containsSpecialCharacters/index.d.ts +1 -0
- package/src/lib/components/SignMessagePreview/utils/index.d.ts +1 -0
- package/src/lib/components/SignMessagePreview/utils/isRawMessage/index.d.ts +1 -0
- package/src/lib/components/SignMessagePreview/utils/isRawMessage/isRawMessage.cjs +13 -0
- package/src/lib/components/SignMessagePreview/utils/isRawMessage/isRawMessage.d.ts +2 -0
- package/src/lib/components/SignMessagePreview/utils/isRawMessage/isRawMessage.js +9 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +6 -4
- package/src/lib/context/DynamicContext/DynamicContext.d.ts +5 -0
- package/src/lib/context/DynamicContext/DynamicContext.js +6 -4
- package/src/lib/context/DynamicContext/types/index.d.ts +2 -0
- package/src/lib/shared/types/wallets.d.ts +1 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/createOwnerWallet/createOwnerWallet.cjs +1 -0
- package/src/lib/utils/functions/createOwnerWallet/createOwnerWallet.js +1 -0
- package/src/lib/utils/functions/getOauthLoginUrl/getOauthLoginUrl.cjs +0 -1
- package/src/lib/utils/functions/getOauthLoginUrl/getOauthLoginUrl.js +0 -1
- package/src/lib/utils/functions/walletListBuilder/utils/applyMultiWalletFilters/applyMultiWalletFilters.cjs +24 -0
- package/src/lib/utils/functions/walletListBuilder/utils/applyMultiWalletFilters/applyMultiWalletFilters.d.ts +6 -0
- package/src/lib/utils/functions/walletListBuilder/utils/applyMultiWalletFilters/applyMultiWalletFilters.js +20 -0
- package/src/lib/utils/functions/walletListBuilder/utils/applyMultiWalletFilters/index.d.ts +1 -0
- package/src/lib/utils/functions/walletListBuilder/utils/filterConnectedWallets/filterConnectedWallets.cjs +2 -2
- package/src/lib/utils/functions/walletListBuilder/utils/filterConnectedWallets/filterConnectedWallets.d.ts +2 -2
- package/src/lib/utils/functions/walletListBuilder/utils/filterConnectedWallets/filterConnectedWallets.js +2 -2
- package/src/lib/utils/functions/walletListBuilder/utils/filterWalletConnectWallets/filterWalletConnectWallets.cjs +20 -0
- package/src/lib/utils/functions/walletListBuilder/utils/filterWalletConnectWallets/filterWalletConnectWallets.d.ts +9 -0
- package/src/lib/utils/functions/walletListBuilder/utils/filterWalletConnectWallets/filterWalletConnectWallets.js +16 -0
- package/src/lib/utils/functions/walletListBuilder/utils/filterWalletConnectWallets/index.d.ts +1 -0
- package/src/lib/utils/functions/walletListBuilder/utils/staticLinkedWalletFilter/index.d.ts +1 -0
- package/src/lib/utils/functions/walletListBuilder/utils/staticLinkedWalletFilter/staticLinkedWalletFilter.cjs +30 -0
- package/src/lib/utils/functions/walletListBuilder/utils/staticLinkedWalletFilter/staticLinkedWalletFilter.d.ts +6 -0
- package/src/lib/utils/functions/walletListBuilder/utils/staticLinkedWalletFilter/staticLinkedWalletFilter.js +26 -0
- package/src/lib/utils/functions/walletListBuilder/walletListBuilder.cjs +6 -5
- package/src/lib/utils/functions/walletListBuilder/walletListBuilder.d.ts +2 -2
- package/src/lib/utils/functions/walletListBuilder/walletListBuilder.js +6 -5
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +1 -0
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +1 -0
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.cjs +1 -0
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.js +1 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.cjs +7 -3
- package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.js +7 -3
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.cjs +5 -1
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.js +5 -1
- package/src/lib/utils/hooks/useNetworkNotSupported/useNetworkNotSupported.cjs +14 -8
- package/src/lib/utils/hooks/useNetworkNotSupported/useNetworkNotSupported.js +14 -8
- package/src/lib/utils/hooks/useSwitchWallet/useSwitchWallet.cjs +1 -1
- package/src/lib/utils/hooks/useSwitchWallet/useSwitchWallet.js +1 -1
- package/src/lib/utils/hooks/useWalletConnectors/utils/createLinkedWalletsFromWalletOptions/createLinkedWalletsFromWalletOptions.cjs +2 -0
- package/src/lib/utils/hooks/useWalletConnectors/utils/createLinkedWalletsFromWalletOptions/createLinkedWalletsFromWalletOptions.js +2 -0
- package/src/lib/utils/hooks/useWalletConnectors/utils/findWallet/findWallet.cjs +4 -1
- package/src/lib/utils/hooks/useWalletConnectors/utils/findWallet/findWallet.js +4 -1
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +1 -1
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +1 -1
- package/src/lib/views/EmailVerification/EmailVerification.cjs +35 -42
- package/src/lib/views/EmailVerification/EmailVerification.js +35 -42
- package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSimpleSignIn/WalletSimpleSignIn.cjs +4 -3
- package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSimpleSignIn/WalletSimpleSignIn.js +4 -3
- package/src/lib/views/WalletList/WalletList.cjs +4 -3
- package/src/lib/views/WalletList/WalletList.js +4 -3
- package/src/lib/widgets/DynamicMultiWalletPromptsWidget/DynamicMultiWalletPromptsWidget.cjs +9 -2
- package/src/lib/widgets/DynamicMultiWalletPromptsWidget/DynamicMultiWalletPromptsWidget.js +9 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,36 @@
|
|
|
1
1
|
|
|
2
|
+
### [2.1.3](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.2...v2.1.3) (2024-06-14)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add in-app browser navigation support for sats-connect ([#5990](https://github.com/dynamic-labs/DynamicAuth/issues/5990)) ([7ea15b9](https://github.com/dynamic-labs/DynamicAuth/commit/7ea15b93d1864164acb82c1e73aae7f9130e1d44))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* cache getGenesisHash call to prevent over calling ([#5966](https://github.com/dynamic-labs/DynamicAuth/issues/5966)) ([#5970](https://github.com/dynamic-labs/DynamicAuth/issues/5970)) ([b624b2e](https://github.com/dynamic-labs/DynamicAuth/commit/b624b2ea5b398bf464d3098e7d81d83c7b5bf659))
|
|
13
|
+
* improvements to embedded solana wallet ([#6001](https://github.com/dynamic-labs/DynamicAuth/issues/6001)) ([a6437c9](https://github.com/dynamic-labs/DynamicAuth/commit/a6437c93e1946bca609d3d99d282123275022376)) ([#5815](https://github.com/dynamic-labs/DynamicAuth/issues/5815)) ([#5978](https://github.com/dynamic-labs/DynamicAuth/issues/5978)) ([dd92973](https://github.com/dynamic-labs/DynamicAuth/commit/dd9297365f0ccbee1217325328e173ae7ee9a922))
|
|
14
|
+
* show linked wallets with unavailable providers in user wallets list ([#6005](https://github.com/dynamic-labs/DynamicAuth/issues/6005)) ([79796d1](https://github.com/dynamic-labs/DynamicAuth/commit/79796d1b73670265ca9897314252b620afaa2e8a))
|
|
15
|
+
* close switch network modal after switching to a supported network ([#5987](https://github.com/dynamic-labs/DynamicAuth/issues/5987)) ([a7e762e](https://github.com/dynamic-labs/DynamicAuth/commit/a7e762ef63a72492d0c083a344111589a6fbc455))
|
|
16
|
+
|
|
17
|
+
### [2.1.2](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.2-alpha.1...v2.1.2) (2024-06-10)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* hide wallets from wallet list that can't have multiple accounts linked ([#5935](https://github.com/dynamic-labs/DynamicAuth/issues/5935)) ([20f9b15](https://github.com/dynamic-labs/DynamicAuth/commit/20f9b15b145cbc57519155691b3640149eec3689))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* ensure sign message will not show 2 times ([#5938](https://github.com/dynamic-labs/DynamicAuth/issues/5938)) ([#5941](https://github.com/dynamic-labs/DynamicAuth/issues/5941)) ([2c5a156](https://github.com/dynamic-labs/DynamicAuth/commit/2c5a156ead565bd25067b3bc2b23cbc704f9b314))
|
|
28
|
+
* improve logic related to embedded wallets and emailVerifcation ([#5947](https://github.com/dynamic-labs/DynamicAuth/issues/5947)) ([b885a14](https://github.com/dynamic-labs/DynamicAuth/commit/b885a14dcf200f05233e4ab42b8b518d877d291a))
|
|
29
|
+
* init coinbase provider adhoc ([#5907](https://github.com/dynamic-labs/DynamicAuth/issues/5907)) ([#5933](https://github.com/dynamic-labs/DynamicAuth/issues/5933)) ([2fa1f52](https://github.com/dynamic-labs/DynamicAuth/commit/2fa1f528b27113ee108252ee874ee7f5ead88329))
|
|
30
|
+
* remove force consent and account selection even for returning google users ([#5912](https://github.com/dynamic-labs/DynamicAuth/issues/5912)) ([26a07f2](https://github.com/dynamic-labs/DynamicAuth/commit/26a07f29bdb8bf32a080396906a21d8b084c202f))
|
|
31
|
+
* resolve the default phone country based on enabled countries ([#5](https://github.com/dynamic-labs/DynamicAuth/issues/5)… ([#5916](https://github.com/dynamic-labs/DynamicAuth/issues/5916)) ([8f27c00](https://github.com/dynamic-labs/DynamicAuth/commit/8f27c0082edb77b964b8402cfa75c6a896b061d3)), closes [#5910](https://github.com/dynamic-labs/DynamicAuth/issues/5910)
|
|
32
|
+
* versioned tx needs address lookup table ([#5909](https://github.com/dynamic-labs/DynamicAuth/issues/5909)) ([#5919](https://github.com/dynamic-labs/DynamicAuth/issues/5919)) ([22e3ca2](https://github.com/dynamic-labs/DynamicAuth/commit/22e3ca2d0b27d15efb50e3092a7bc3a0c0d255a5))
|
|
33
|
+
|
|
2
34
|
### [2.1.2-alpha.1](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.2-alpha.0...v2.1.2-alpha.1) (2024-06-07)
|
|
3
35
|
|
|
4
36
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
@@ -17,18 +17,18 @@
|
|
|
17
17
|
"react-i18next": "13.5.0",
|
|
18
18
|
"yup": "0.32.11",
|
|
19
19
|
"react-international-phone": "4.2.5",
|
|
20
|
-
"@dynamic-labs/iconic": "2.1.
|
|
21
|
-
"@dynamic-labs/logger": "2.1.
|
|
22
|
-
"@dynamic-labs/multi-wallet": "2.1.
|
|
23
|
-
"@dynamic-labs/rpc-provider-ethereum": "2.1.
|
|
24
|
-
"@dynamic-labs/rpc-provider-solana": "2.1.
|
|
25
|
-
"@dynamic-labs/rpc-providers": "2.1.
|
|
26
|
-
"@dynamic-labs/store": "2.1.
|
|
27
|
-
"@dynamic-labs/types": "2.1.
|
|
28
|
-
"@dynamic-labs/utils": "2.1.
|
|
29
|
-
"@dynamic-labs/viem-utils": "2.1.
|
|
30
|
-
"@dynamic-labs/wallet-book": "2.1.
|
|
31
|
-
"@dynamic-labs/wallet-connector-core": "2.1.
|
|
20
|
+
"@dynamic-labs/iconic": "2.1.3",
|
|
21
|
+
"@dynamic-labs/logger": "2.1.3",
|
|
22
|
+
"@dynamic-labs/multi-wallet": "2.1.3",
|
|
23
|
+
"@dynamic-labs/rpc-provider-ethereum": "2.1.3",
|
|
24
|
+
"@dynamic-labs/rpc-provider-solana": "2.1.3",
|
|
25
|
+
"@dynamic-labs/rpc-providers": "2.1.3",
|
|
26
|
+
"@dynamic-labs/store": "2.1.3",
|
|
27
|
+
"@dynamic-labs/types": "2.1.3",
|
|
28
|
+
"@dynamic-labs/utils": "2.1.3",
|
|
29
|
+
"@dynamic-labs/viem-utils": "2.1.3",
|
|
30
|
+
"@dynamic-labs/wallet-book": "2.1.3",
|
|
31
|
+
"@dynamic-labs/wallet-connector-core": "2.1.3",
|
|
32
32
|
"eventemitter3": "5.0.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
@@ -150,7 +150,7 @@ const AuthProviderIcon = ({ iconSize = 64, showStatus, wallet, }) => {
|
|
|
150
150
|
if (MagicEmailOrSocialIcon) {
|
|
151
151
|
return showStatus ? (jsxRuntime.jsx(IconWithStatus.IconWithStatus, { iconSize: iconSize, Icon: MagicEmailOrSocialIcon, variant: walletForIcon.connected ? 'green' : 'red' })) : (jsxRuntime.jsx(MagicEmailOrSocialIcon, { style: { height: pixelToRem.pixelToRem(iconSize), width: pixelToRem.pixelToRem(iconSize) } }));
|
|
152
152
|
}
|
|
153
|
-
return showStatus ? (jsxRuntime.jsx(WalletIconWithStatus.WalletIconWithStatus, { iconSize: iconSize, walletKey: walletForIcon.
|
|
153
|
+
return showStatus ? (jsxRuntime.jsx(WalletIconWithStatus.WalletIconWithStatus, { iconSize: iconSize, walletKey: walletForIcon.key, connected: walletForIcon.connected, variant: 'secondary' })) : (jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: walletForIcon.key, style: { height: pixelToRem.pixelToRem(iconSize), width: pixelToRem.pixelToRem(iconSize) } }));
|
|
154
154
|
};
|
|
155
155
|
|
|
156
156
|
exports.AuthProviderIcon = AuthProviderIcon;
|
|
@@ -146,7 +146,7 @@ const AuthProviderIcon = ({ iconSize = 64, showStatus, wallet, }) => {
|
|
|
146
146
|
if (MagicEmailOrSocialIcon) {
|
|
147
147
|
return showStatus ? (jsx(IconWithStatus, { iconSize: iconSize, Icon: MagicEmailOrSocialIcon, variant: walletForIcon.connected ? 'green' : 'red' })) : (jsx(MagicEmailOrSocialIcon, { style: { height: pixelToRem(iconSize), width: pixelToRem(iconSize) } }));
|
|
148
148
|
}
|
|
149
|
-
return showStatus ? (jsx(WalletIconWithStatus, { iconSize: iconSize, walletKey: walletForIcon.
|
|
149
|
+
return showStatus ? (jsx(WalletIconWithStatus, { iconSize: iconSize, walletKey: walletForIcon.key, connected: walletForIcon.connected, variant: 'secondary' })) : (jsx(WalletIcon, { walletKey: walletForIcon.key, style: { height: pixelToRem(iconSize), width: pixelToRem(iconSize) } }));
|
|
150
150
|
};
|
|
151
151
|
|
|
152
152
|
export { AuthProviderIcon };
|
|
@@ -23,6 +23,7 @@ require('../../utils/constants/colors.cjs');
|
|
|
23
23
|
require('../../utils/constants/values.cjs');
|
|
24
24
|
require('../../shared/utils/classes/storage/localStorage.cjs');
|
|
25
25
|
require('../../shared/consts/index.cjs');
|
|
26
|
+
var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
26
27
|
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
27
28
|
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
28
29
|
require('@dynamic-labs/multi-wallet');
|
|
@@ -87,10 +88,12 @@ const PhoneNumberField = ({ isLoading, disabled, error, label, onUpdate, appendR
|
|
|
87
88
|
const countryInputRef = React.useRef(null);
|
|
88
89
|
const [countryDropdownOpen, setCountryDropdownOpen] = React.useState(false);
|
|
89
90
|
const anchorRef = React.useRef(null);
|
|
91
|
+
const { defaultPhoneInputIso2 } = useInternalDynamicContext.useInternalDynamicContext();
|
|
90
92
|
const [invalidNumberMessage, setInvalidNumberMessage] = React.useState(undefined);
|
|
91
93
|
const { formattedPhone, currentCountry, handleCountryInput, handlePhoneInput, hasInput, inputRef, countryInput, onBlurCountry, filteredCountries, openDropdown, handleCountryKeyDown, closeDropdown, setCountry, onMenuDisplayToggle, onFocusCountry, countryFontSize, } = usePhoneInputLogic.usePhoneInputLogic({
|
|
92
94
|
countries,
|
|
93
95
|
countryInputRef,
|
|
96
|
+
defaultIso2: defaultPhoneInputIso2,
|
|
94
97
|
initialPhone,
|
|
95
98
|
onUpdate,
|
|
96
99
|
setCountryDropdownOpen,
|
|
@@ -19,6 +19,7 @@ import '../../utils/constants/colors.js';
|
|
|
19
19
|
import '../../utils/constants/values.js';
|
|
20
20
|
import '../../shared/utils/classes/storage/localStorage.js';
|
|
21
21
|
import '../../shared/consts/index.js';
|
|
22
|
+
import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
22
23
|
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
23
24
|
import '../../context/ErrorContext/ErrorContext.js';
|
|
24
25
|
import '@dynamic-labs/multi-wallet';
|
|
@@ -83,10 +84,12 @@ const PhoneNumberField = ({ isLoading, disabled, error, label, onUpdate, appendR
|
|
|
83
84
|
const countryInputRef = useRef(null);
|
|
84
85
|
const [countryDropdownOpen, setCountryDropdownOpen] = useState(false);
|
|
85
86
|
const anchorRef = useRef(null);
|
|
87
|
+
const { defaultPhoneInputIso2 } = useInternalDynamicContext();
|
|
86
88
|
const [invalidNumberMessage, setInvalidNumberMessage] = useState(undefined);
|
|
87
89
|
const { formattedPhone, currentCountry, handleCountryInput, handlePhoneInput, hasInput, inputRef, countryInput, onBlurCountry, filteredCountries, openDropdown, handleCountryKeyDown, closeDropdown, setCountry, onMenuDisplayToggle, onFocusCountry, countryFontSize, } = usePhoneInputLogic({
|
|
88
90
|
countries,
|
|
89
91
|
countryInputRef,
|
|
92
|
+
defaultIso2: defaultPhoneInputIso2,
|
|
90
93
|
initialPhone,
|
|
91
94
|
onUpdate,
|
|
92
95
|
setCountryDropdownOpen,
|
|
@@ -9,33 +9,24 @@ var localStorage = require('../../../shared/utils/classes/storage/localStorage.c
|
|
|
9
9
|
var useThrottle = require('../../../shared/utils/hooks/useThrottle/useThrottle.cjs');
|
|
10
10
|
var localStorage$1 = require('../../../utils/constants/localStorage.cjs');
|
|
11
11
|
var modulo = require('../../../utils/functions/modulo/modulo.cjs');
|
|
12
|
+
var parseDefaultCountry = require('../utils/parseDefaultCountry/parseDefaultCountry.cjs');
|
|
12
13
|
|
|
13
14
|
const MENU_DISPLAY_THROTTLE = 50;
|
|
14
15
|
const COUNTRY_INPUT_SCROLL_DELAY = 20;
|
|
15
|
-
const usePhoneInputLogic = ({ countryInputRef, setCountryDropdownOpen, setInvalidNumberMessage, onUpdate, initialPhone, countries, }) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return countries
|
|
22
|
-
.map(reactInternationalPhone.parseCountry)
|
|
23
|
-
.find(({ iso2 }) => iso2 === defaultCountryIso2);
|
|
24
|
-
};
|
|
25
|
-
const { country: initialCountry } = initialPhone
|
|
26
|
-
? reactInternationalPhone.guessCountryByPartialPhoneNumber({
|
|
27
|
-
countries,
|
|
28
|
-
phone: initialPhone,
|
|
29
|
-
})
|
|
30
|
-
: { country: undefined };
|
|
16
|
+
const usePhoneInputLogic = ({ countryInputRef, setCountryDropdownOpen, setInvalidNumberMessage, onUpdate, initialPhone, countries, defaultIso2, }) => {
|
|
17
|
+
const defaultCountry = React.useMemo(() => parseDefaultCountry.parseDefaultCountry({
|
|
18
|
+
countries,
|
|
19
|
+
defaultIso2,
|
|
20
|
+
initialPhone,
|
|
21
|
+
}), [countries, defaultIso2, initialPhone]);
|
|
31
22
|
const { inputValue: formattedPhone, phone, country: currentCountry, setCountry: setSelectedCountry, handlePhoneValueChange: handlePhoneInput, inputRef, } = reactInternationalPhone.usePhoneInput({
|
|
32
23
|
countries,
|
|
33
|
-
defaultCountry:
|
|
24
|
+
defaultCountry: defaultCountry.iso2,
|
|
34
25
|
disableDialCodeAndPrefix: true,
|
|
35
26
|
value: initialPhone,
|
|
36
27
|
});
|
|
37
28
|
/** What is currently displayed on the country input */
|
|
38
|
-
const [countryInput, setCountryInput] = React.useState(
|
|
29
|
+
const [countryInput, setCountryInput] = React.useState(defaultCountry.dialCode);
|
|
39
30
|
/**
|
|
40
31
|
* This is the same value as phone, except for the following scenario:
|
|
41
32
|
* Since the phone number field hides the "+" char and the country code, when the field
|
|
@@ -93,7 +84,7 @@ const usePhoneInputLogic = ({ countryInputRef, setCountryDropdownOpen, setInvali
|
|
|
93
84
|
// COUNTRY INPUT
|
|
94
85
|
// =================================================================
|
|
95
86
|
/** The last inputted value for country that was valid */
|
|
96
|
-
const lastValidCountry = React.useRef(
|
|
87
|
+
const lastValidCountry = React.useRef(defaultCountry);
|
|
97
88
|
const handleCountryInput = ({ target, }) => {
|
|
98
89
|
const value = target.value.slice(0, 4);
|
|
99
90
|
setCountryInput(value);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChangeEventHandler, Dispatch, KeyboardEventHandler, RefObject, SetStateAction } from 'react';
|
|
2
|
-
import { CountryData, ParsedCountry } from 'react-international-phone';
|
|
2
|
+
import { CountryData, CountryIso2, ParsedCountry } from 'react-international-phone';
|
|
3
3
|
export type OnUpdatePhoneData = (values: {
|
|
4
4
|
phone: string;
|
|
5
5
|
formattedPhone: string;
|
|
@@ -12,8 +12,9 @@ type UsePhoneLogicProps = {
|
|
|
12
12
|
countries: CountryData[];
|
|
13
13
|
onUpdate?: OnUpdatePhoneData;
|
|
14
14
|
initialPhone?: string;
|
|
15
|
+
defaultIso2?: CountryIso2;
|
|
15
16
|
};
|
|
16
|
-
export declare const usePhoneInputLogic: ({ countryInputRef, setCountryDropdownOpen, setInvalidNumberMessage, onUpdate, initialPhone, countries, }: UsePhoneLogicProps) => {
|
|
17
|
+
export declare const usePhoneInputLogic: ({ countryInputRef, setCountryDropdownOpen, setInvalidNumberMessage, onUpdate, initialPhone, countries, defaultIso2, }: UsePhoneLogicProps) => {
|
|
17
18
|
closeDropdown: () => void;
|
|
18
19
|
countryFontSize: string;
|
|
19
20
|
countryInput: string;
|
|
@@ -1,37 +1,28 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useMemo, useState, useEffect, useCallback, useRef } from 'react';
|
|
3
|
+
import { usePhoneInput, parseCountry, removeDialCode, guessCountryByPartialPhoneNumber } from 'react-international-phone';
|
|
4
4
|
import { LocalStorage } from '../../../shared/utils/classes/storage/localStorage.js';
|
|
5
5
|
import { useThrottle } from '../../../shared/utils/hooks/useThrottle/useThrottle.js';
|
|
6
6
|
import { PHONE_INPUT_DEFAULT_COUNTRY } from '../../../utils/constants/localStorage.js';
|
|
7
7
|
import { modulo } from '../../../utils/functions/modulo/modulo.js';
|
|
8
|
+
import { parseDefaultCountry } from '../utils/parseDefaultCountry/parseDefaultCountry.js';
|
|
8
9
|
|
|
9
10
|
const MENU_DISPLAY_THROTTLE = 50;
|
|
10
11
|
const COUNTRY_INPUT_SCROLL_DELAY = 20;
|
|
11
|
-
const usePhoneInputLogic = ({ countryInputRef, setCountryDropdownOpen, setInvalidNumberMessage, onUpdate, initialPhone, countries, }) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return countries
|
|
18
|
-
.map(parseCountry)
|
|
19
|
-
.find(({ iso2 }) => iso2 === defaultCountryIso2);
|
|
20
|
-
};
|
|
21
|
-
const { country: initialCountry } = initialPhone
|
|
22
|
-
? guessCountryByPartialPhoneNumber({
|
|
23
|
-
countries,
|
|
24
|
-
phone: initialPhone,
|
|
25
|
-
})
|
|
26
|
-
: { country: undefined };
|
|
12
|
+
const usePhoneInputLogic = ({ countryInputRef, setCountryDropdownOpen, setInvalidNumberMessage, onUpdate, initialPhone, countries, defaultIso2, }) => {
|
|
13
|
+
const defaultCountry = useMemo(() => parseDefaultCountry({
|
|
14
|
+
countries,
|
|
15
|
+
defaultIso2,
|
|
16
|
+
initialPhone,
|
|
17
|
+
}), [countries, defaultIso2, initialPhone]);
|
|
27
18
|
const { inputValue: formattedPhone, phone, country: currentCountry, setCountry: setSelectedCountry, handlePhoneValueChange: handlePhoneInput, inputRef, } = usePhoneInput({
|
|
28
19
|
countries,
|
|
29
|
-
defaultCountry:
|
|
20
|
+
defaultCountry: defaultCountry.iso2,
|
|
30
21
|
disableDialCodeAndPrefix: true,
|
|
31
22
|
value: initialPhone,
|
|
32
23
|
});
|
|
33
24
|
/** What is currently displayed on the country input */
|
|
34
|
-
const [countryInput, setCountryInput] = useState(
|
|
25
|
+
const [countryInput, setCountryInput] = useState(defaultCountry.dialCode);
|
|
35
26
|
/**
|
|
36
27
|
* This is the same value as phone, except for the following scenario:
|
|
37
28
|
* Since the phone number field hides the "+" char and the country code, when the field
|
|
@@ -89,7 +80,7 @@ const usePhoneInputLogic = ({ countryInputRef, setCountryDropdownOpen, setInvali
|
|
|
89
80
|
// COUNTRY INPUT
|
|
90
81
|
// =================================================================
|
|
91
82
|
/** The last inputted value for country that was valid */
|
|
92
|
-
const lastValidCountry = useRef(
|
|
83
|
+
const lastValidCountry = useRef(defaultCountry);
|
|
93
84
|
const handleCountryInput = ({ target, }) => {
|
|
94
85
|
const value = target.value.slice(0, 4);
|
|
95
86
|
setCountryInput(value);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { parseDefaultCountry } from './parseDefaultCountry';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var reactInternationalPhone = require('react-international-phone');
|
|
7
|
+
require('@dynamic-labs/sdk-api-core');
|
|
8
|
+
require('../../../../shared/logger.cjs');
|
|
9
|
+
require('@dynamic-labs/iconic');
|
|
10
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
11
|
+
require('react/jsx-runtime');
|
|
12
|
+
require('../../../../context/ViewContext/ViewContext.cjs');
|
|
13
|
+
require('react');
|
|
14
|
+
require('@dynamic-labs/wallet-book');
|
|
15
|
+
var localStorage$1 = require('../../../../utils/constants/localStorage.cjs');
|
|
16
|
+
require('../../../../utils/constants/colors.cjs');
|
|
17
|
+
require('../../../../utils/constants/values.cjs');
|
|
18
|
+
var localStorage = require('../../../../shared/utils/classes/storage/localStorage.cjs');
|
|
19
|
+
require('@dynamic-labs/utils');
|
|
20
|
+
require('../../../../shared/consts/index.cjs');
|
|
21
|
+
|
|
22
|
+
const parseDefaultCountry = ({ defaultIso2, countries, initialPhone, }) => {
|
|
23
|
+
// Return the country inferred from the phone number if possible
|
|
24
|
+
if (initialPhone) {
|
|
25
|
+
const { country } = reactInternationalPhone.guessCountryByPartialPhoneNumber({
|
|
26
|
+
countries,
|
|
27
|
+
phone: initialPhone,
|
|
28
|
+
});
|
|
29
|
+
if (country) {
|
|
30
|
+
return country;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const parsedCountries = countries.map(reactInternationalPhone.parseCountry);
|
|
34
|
+
// If the user has previously selected a country, use that as the default
|
|
35
|
+
const lastUsedCountryIso2 = localStorage.LocalStorage.getFromLS(localStorage$1.PHONE_INPUT_DEFAULT_COUNTRY);
|
|
36
|
+
const lastUsedCountry = parsedCountries.find(({ iso2 }) => iso2 === lastUsedCountryIso2);
|
|
37
|
+
if (lastUsedCountry) {
|
|
38
|
+
return lastUsedCountry;
|
|
39
|
+
}
|
|
40
|
+
// Use default country setting if found in enabled countries
|
|
41
|
+
const defaultCountry = parsedCountries.find(({ iso2 }) => iso2 === defaultIso2);
|
|
42
|
+
if (defaultCountry) {
|
|
43
|
+
return defaultCountry;
|
|
44
|
+
}
|
|
45
|
+
// Return US if it is enabled
|
|
46
|
+
const countryUS = parsedCountries.find(({ iso2 }) => iso2 === 'us');
|
|
47
|
+
if (countryUS) {
|
|
48
|
+
return countryUS;
|
|
49
|
+
}
|
|
50
|
+
// Return the first country in the list as a last resort
|
|
51
|
+
if (parsedCountries[0]) {
|
|
52
|
+
return parsedCountries[0];
|
|
53
|
+
}
|
|
54
|
+
throw new Error('No country list was provided');
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
exports.parseDefaultCountry = parseDefaultCountry;
|
package/src/lib/components/PhoneNumberField/utils/parseDefaultCountry/parseDefaultCountry.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CountryData, CountryIso2, ParsedCountry } from 'react-international-phone';
|
|
2
|
+
type ParseDefaultCountryProps = {
|
|
3
|
+
initialPhone: string | undefined;
|
|
4
|
+
defaultIso2: CountryIso2 | undefined;
|
|
5
|
+
countries: CountryData[];
|
|
6
|
+
};
|
|
7
|
+
export declare const parseDefaultCountry: ({ defaultIso2, countries, initialPhone, }: ParseDefaultCountryProps) => ParsedCountry;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { guessCountryByPartialPhoneNumber, parseCountry } from 'react-international-phone';
|
|
3
|
+
import '@dynamic-labs/sdk-api-core';
|
|
4
|
+
import '../../../../shared/logger.js';
|
|
5
|
+
import '@dynamic-labs/iconic';
|
|
6
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
7
|
+
import 'react/jsx-runtime';
|
|
8
|
+
import '../../../../context/ViewContext/ViewContext.js';
|
|
9
|
+
import 'react';
|
|
10
|
+
import '@dynamic-labs/wallet-book';
|
|
11
|
+
import { PHONE_INPUT_DEFAULT_COUNTRY } from '../../../../utils/constants/localStorage.js';
|
|
12
|
+
import '../../../../utils/constants/colors.js';
|
|
13
|
+
import '../../../../utils/constants/values.js';
|
|
14
|
+
import { LocalStorage } from '../../../../shared/utils/classes/storage/localStorage.js';
|
|
15
|
+
import '@dynamic-labs/utils';
|
|
16
|
+
import '../../../../shared/consts/index.js';
|
|
17
|
+
|
|
18
|
+
const parseDefaultCountry = ({ defaultIso2, countries, initialPhone, }) => {
|
|
19
|
+
// Return the country inferred from the phone number if possible
|
|
20
|
+
if (initialPhone) {
|
|
21
|
+
const { country } = guessCountryByPartialPhoneNumber({
|
|
22
|
+
countries,
|
|
23
|
+
phone: initialPhone,
|
|
24
|
+
});
|
|
25
|
+
if (country) {
|
|
26
|
+
return country;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const parsedCountries = countries.map(parseCountry);
|
|
30
|
+
// If the user has previously selected a country, use that as the default
|
|
31
|
+
const lastUsedCountryIso2 = LocalStorage.getFromLS(PHONE_INPUT_DEFAULT_COUNTRY);
|
|
32
|
+
const lastUsedCountry = parsedCountries.find(({ iso2 }) => iso2 === lastUsedCountryIso2);
|
|
33
|
+
if (lastUsedCountry) {
|
|
34
|
+
return lastUsedCountry;
|
|
35
|
+
}
|
|
36
|
+
// Use default country setting if found in enabled countries
|
|
37
|
+
const defaultCountry = parsedCountries.find(({ iso2 }) => iso2 === defaultIso2);
|
|
38
|
+
if (defaultCountry) {
|
|
39
|
+
return defaultCountry;
|
|
40
|
+
}
|
|
41
|
+
// Return US if it is enabled
|
|
42
|
+
const countryUS = parsedCountries.find(({ iso2 }) => iso2 === 'us');
|
|
43
|
+
if (countryUS) {
|
|
44
|
+
return countryUS;
|
|
45
|
+
}
|
|
46
|
+
// Return the first country in the list as a last resort
|
|
47
|
+
if (parsedCountries[0]) {
|
|
48
|
+
return parsedCountries[0];
|
|
49
|
+
}
|
|
50
|
+
throw new Error('No country list was provided');
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export { parseDefaultCountry };
|
|
@@ -5,24 +5,32 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var React = require('react');
|
|
8
|
+
var utils = require('@dynamic-labs/utils');
|
|
8
9
|
var Typography = require('../Typography/Typography.cjs');
|
|
9
10
|
var isSignTypedData = require('./utils/isSignTypedData/isSignTypedData.cjs');
|
|
11
|
+
var isRawMessage = require('./utils/isRawMessage/isRawMessage.cjs');
|
|
10
12
|
var SignTypedDataPreview = require('./components/SignTypedDataPreview/SignTypedDataPreview.cjs');
|
|
13
|
+
var containsSpecialCharacters = require('./utils/containsSpecialCharacters/containsSpecialCharacters.cjs');
|
|
11
14
|
|
|
12
15
|
const SignMessagePreview = ({ message, }) => {
|
|
13
|
-
const
|
|
16
|
+
const jsonMessage = React.useMemo(() => {
|
|
14
17
|
try {
|
|
15
18
|
const json = JSON.parse(message);
|
|
16
|
-
return
|
|
19
|
+
return json;
|
|
17
20
|
}
|
|
18
21
|
catch (e) {
|
|
19
22
|
return undefined;
|
|
20
23
|
}
|
|
21
24
|
}, [message]);
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
const messageText = React.useMemo(() => {
|
|
26
|
+
const text = isRawMessage.isRawMessage(jsonMessage) ? jsonMessage.raw : message;
|
|
27
|
+
const readableText = utils.isHex(text) ? utils.hexToString(text) : text;
|
|
28
|
+
return !containsSpecialCharacters.containsSpecialCharacters(readableText) ? readableText : text;
|
|
29
|
+
}, [jsonMessage, message]);
|
|
30
|
+
if (isSignTypedData.isSignTypedData(jsonMessage)) {
|
|
31
|
+
return (jsxRuntime.jsx(SignTypedDataPreview.SignTypedDataPreview, { currentType: jsonMessage.primaryType, types: jsonMessage.types, showTypeName: true, data: jsonMessage.message }));
|
|
24
32
|
}
|
|
25
|
-
return (jsxRuntime.jsx(Typography.Typography, { color: 'primary', variant: 'body_normal', children: jsxRuntime.jsx("span", { style: { whiteSpace: 'pre-line' }, children:
|
|
33
|
+
return (jsxRuntime.jsx(Typography.Typography, { color: 'primary', variant: 'body_normal', children: jsxRuntime.jsx("span", { style: { whiteSpace: 'pre-line' }, children: messageText }) }));
|
|
26
34
|
};
|
|
27
35
|
|
|
28
36
|
exports.SignMessagePreview = SignMessagePreview;
|
|
@@ -1,24 +1,32 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
|
+
import { isHex, hexToString } from '@dynamic-labs/utils';
|
|
4
5
|
import { Typography } from '../Typography/Typography.js';
|
|
5
6
|
import { isSignTypedData } from './utils/isSignTypedData/isSignTypedData.js';
|
|
7
|
+
import { isRawMessage } from './utils/isRawMessage/isRawMessage.js';
|
|
6
8
|
import { SignTypedDataPreview } from './components/SignTypedDataPreview/SignTypedDataPreview.js';
|
|
9
|
+
import { containsSpecialCharacters } from './utils/containsSpecialCharacters/containsSpecialCharacters.js';
|
|
7
10
|
|
|
8
11
|
const SignMessagePreview = ({ message, }) => {
|
|
9
|
-
const
|
|
12
|
+
const jsonMessage = useMemo(() => {
|
|
10
13
|
try {
|
|
11
14
|
const json = JSON.parse(message);
|
|
12
|
-
return
|
|
15
|
+
return json;
|
|
13
16
|
}
|
|
14
17
|
catch (e) {
|
|
15
18
|
return undefined;
|
|
16
19
|
}
|
|
17
20
|
}, [message]);
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
const messageText = useMemo(() => {
|
|
22
|
+
const text = isRawMessage(jsonMessage) ? jsonMessage.raw : message;
|
|
23
|
+
const readableText = isHex(text) ? hexToString(text) : text;
|
|
24
|
+
return !containsSpecialCharacters(readableText) ? readableText : text;
|
|
25
|
+
}, [jsonMessage, message]);
|
|
26
|
+
if (isSignTypedData(jsonMessage)) {
|
|
27
|
+
return (jsx(SignTypedDataPreview, { currentType: jsonMessage.primaryType, types: jsonMessage.types, showTypeName: true, data: jsonMessage.message }));
|
|
20
28
|
}
|
|
21
|
-
return (jsx(Typography, { color: 'primary', variant: 'body_normal', children: jsx("span", { style: { whiteSpace: 'pre-line' }, children:
|
|
29
|
+
return (jsx(Typography, { color: 'primary', variant: 'body_normal', children: jsx("span", { style: { whiteSpace: 'pre-line' }, children: messageText }) }));
|
|
22
30
|
};
|
|
23
31
|
|
|
24
32
|
export { SignMessagePreview };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
const containsSpecialCharacters = (value) => {
|
|
7
|
+
// This regex checks for any characters outside the standard ASCII printable range and common control characters
|
|
8
|
+
const regex = /[^ -~\s]/;
|
|
9
|
+
return regex.test(value);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
exports.containsSpecialCharacters = containsSpecialCharacters;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const containsSpecialCharacters: (value: string) => boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
const containsSpecialCharacters = (value) => {
|
|
3
|
+
// This regex checks for any characters outside the standard ASCII printable range and common control characters
|
|
4
|
+
const regex = /[^ -~\s]/;
|
|
5
|
+
return regex.test(value);
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export { containsSpecialCharacters };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { containsSpecialCharacters } from './containsSpecialCharacters';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { isRawMessage } from './isRawMessage';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
const isRawMessage = (data) => {
|
|
7
|
+
if (typeof data !== 'object' || data === null) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
return typeof data.raw === 'string';
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
exports.isRawMessage = isRawMessage;
|
|
@@ -136,8 +136,8 @@ const PUBLIC_PROJECT_LIVE_ENVIRONMENT_ID = '2762a57b-faa4-41ce-9f16-abff9300e2c9
|
|
|
136
136
|
const DynamicContext = React.createContext(undefined);
|
|
137
137
|
/** The context provider itself we only use internally */
|
|
138
138
|
const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, locale: locale$1, }) => {
|
|
139
|
-
var _a, _b, _c, _d, _e, _f;
|
|
140
|
-
const { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, apiBaseUrl, coinbaseWalletPreference, enableConnectOnlyFallback = false, deepLinkPreference: deepLinkPreferenceProp = 'native', bridgeChains, cssOverrides, defaultNumberOfWalletsToShow = values.DEFAULT_NUMBER_OF_WALLETS_TO_SHOW, flowNetwork, initialAuthenticationMode = 'connect-and-sign', debugError = false, displaySiweStatement = true, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly = true, environmentId, walletsFilter, logLevel = 'WARN', mobileExperience = 'in-app-browser', notInTheListImageUrl, onboardingImageUrl, policiesConsentInnerComponent, customPrivacyPolicy, privacyPolicyUrl, signWithEmailWalletName, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, customTermsOfServices, termsOfServiceUrl, toolkitEnabled, siweStatement, shadowDOMEnabled = true, walletConnectors: walletConnectorsProp, socialProvidersFilter, showLockedWalletView = false, walletConnectPreferredChains, walletConnectorExtensions, recommendedWallets, hideEmbeddedWalletTransactionUIs, handlers, headless = false, } = settings$1;
|
|
139
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
140
|
+
const { accessDeniedMessagePrimary, accessDeniedMessageSecondary, accessDeniedButton, defaultPhoneInputIso2, apiBaseUrl, coinbaseWalletPreference, enableConnectOnlyFallback = false, deepLinkPreference: deepLinkPreferenceProp = 'native', bridgeChains, cssOverrides, defaultNumberOfWalletsToShow = values.DEFAULT_NUMBER_OF_WALLETS_TO_SHOW, flowNetwork, initialAuthenticationMode = 'connect-and-sign', debugError = false, displaySiweStatement = true, newToWeb3WalletChainMap, enableVisitTrackingOnConnectOnly = true, environmentId, walletsFilter, logLevel = 'WARN', mobileExperience = 'in-app-browser', notInTheListImageUrl, onboardingImageUrl, policiesConsentInnerComponent, customPrivacyPolicy, privacyPolicyUrl, signWithEmailWalletName, socialMediaLinkText, socialMediaIconUrl, socialMediaUrl, customTermsOfServices, termsOfServiceUrl, toolkitEnabled, siweStatement, shadowDOMEnabled = true, walletConnectors: walletConnectorsProp, socialProvidersFilter, showLockedWalletView = false, walletConnectPreferredChains, walletConnectorExtensions, recommendedWallets, hideEmbeddedWalletTransactionUIs, handlers, headless = false, } = settings$1;
|
|
141
141
|
localStorage.LocalStorage.setSuffix(settings$1.localStorageSuffix);
|
|
142
142
|
/**
|
|
143
143
|
* initialize global store
|
|
@@ -219,7 +219,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
219
219
|
appLogoUrl,
|
|
220
220
|
appName,
|
|
221
221
|
getAppOrigin: () => window.location.origin,
|
|
222
|
-
hideEmbeddedWalletTransactionUIs,
|
|
222
|
+
hideEmbeddedWalletTransactionUIs: hideEmbeddedWalletTransactionUIs !== null && hideEmbeddedWalletTransactionUIs !== void 0 ? hideEmbeddedWalletTransactionUIs : !((_g = (_f = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _f === void 0 ? void 0 : _f.embeddedWallets) === null || _g === void 0 ? void 0 : _g.showEmbeddedWalletActionsUI),
|
|
223
223
|
});
|
|
224
224
|
const { walletConnectorOptions } = useWalletConnectorOptions.useWalletConnectorOptions({
|
|
225
225
|
appLogoUrl,
|
|
@@ -441,6 +441,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
441
441
|
customTermsOfServices,
|
|
442
442
|
debugError,
|
|
443
443
|
defaultNumberOfWalletsToShow,
|
|
444
|
+
defaultPhoneInputIso2,
|
|
444
445
|
defaultTabIndex,
|
|
445
446
|
desktopUri,
|
|
446
447
|
disconnectWallet,
|
|
@@ -545,6 +546,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
545
546
|
accessDeniedMessageSecondary,
|
|
546
547
|
accountSwitchState,
|
|
547
548
|
handlers,
|
|
549
|
+
defaultPhoneInputIso2,
|
|
548
550
|
appLogoUrl,
|
|
549
551
|
appName,
|
|
550
552
|
defaultTabIndex,
|
|
@@ -683,7 +685,7 @@ const InnerDynamicContextProvider = ({ children, theme, settings: settings$1, lo
|
|
|
683
685
|
}
|
|
684
686
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
685
687
|
}, [multiWallet, multiWalletWidgetState, showDynamicUserProfile]);
|
|
686
|
-
return (jsxRuntime.jsx(reactI18next.I18nextProvider, { i18n: i18nSDKInstance, children: jsxRuntime.jsx(DynamicContext.Provider, { value: value, children: jsxRuntime.jsx(walletBook.WalletBookContextProvider, { walletBook: walletBook$1, children: jsxRuntime.jsx(ThemeContext.ThemeContextProvider, { customerTheme: parseTheme.parseTheme(theme, ((
|
|
688
|
+
return (jsxRuntime.jsx(reactI18next.I18nextProvider, { i18n: i18nSDKInstance, children: jsxRuntime.jsx(DynamicContext.Provider, { value: value, children: jsxRuntime.jsx(walletBook.WalletBookContextProvider, { walletBook: walletBook$1, children: jsxRuntime.jsx(ThemeContext.ThemeContextProvider, { customerTheme: parseTheme.parseTheme(theme, ((_h = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design) === null || _h === void 0 ? void 0 : _h.modal) || undefined), designSettings: projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.design, children: jsxRuntime.jsx(LoadingContext.LoadingContextProvider, { children: jsxRuntime.jsxs(ViewContext.ViewContextProvider, { initialView: helpers.getInitialView({
|
|
687
689
|
bridgeOnboardingCompleted,
|
|
688
690
|
connectedWallets,
|
|
689
691
|
isAuthenticated: isAuthenticated || Boolean(primaryWallet),
|