@web3auth/modal 10.5.0 → 10.5.1

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  var noModal = require('@web3auth/no-modal');
4
4
 
5
- const version = "10.5.0";
5
+ const version = "10.5.1";
6
6
  const defaultConnectorsModalConfig = {
7
7
  hideWalletDiscovery: false,
8
8
  connectors: {
@@ -12,8 +12,6 @@ const defaultConnectorsModalConfig = {
12
12
  }
13
13
  }
14
14
  };
15
- const walletRegistryUrl = "https://assets.web3auth.io/v1/wallet-registry.json";
16
15
 
17
16
  exports.defaultConnectorsModalConfig = defaultConnectorsModalConfig;
18
17
  exports.version = version;
19
- exports.walletRegistryUrl = walletRegistryUrl;
@@ -8,7 +8,6 @@ var noModal = require('@web3auth/no-modal');
8
8
 
9
9
  exports.defaultConnectorsModalConfig = config.defaultConnectorsModalConfig;
10
10
  exports.version = config.version;
11
- exports.walletRegistryUrl = config.walletRegistryUrl;
12
11
  exports.Web3Auth = modalManager.Web3Auth;
13
12
  Object.keys(noModal).forEach(function (k) {
14
13
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
@@ -296,7 +296,7 @@ class Web3Auth extends noModal.Web3AuthNoModal {
296
296
  web3AuthNetwork: this.options.web3AuthNetwork,
297
297
  aaProvider: (_this$options$account = this.options.accountAbstractionConfig) === null || _this$options$account === void 0 ? void 0 : _this$options$account.smartAccountType,
298
298
  authBuildEnv: this.options.authBuildEnv
299
- }), noModal.fetchWalletRegistry(config.walletRegistryUrl)]);
299
+ }), noModal.fetchWalletRegistry(noModal.WALLET_REGISTRY_URL)]);
300
300
  // handle project config result
301
301
  if (projectConfigResult.status === "rejected") {
302
302
  const error = await auth.serializeError(projectConfigResult.reason);
@@ -8,6 +8,7 @@ var reactI18next = require('react-i18next');
8
8
  var reactQrcodeLogo = require('react-qrcode-logo');
9
9
  var constants = require('../../../constants.js');
10
10
  var RootContext = require('../../../context/RootContext.js');
11
+ var interfaces = require('../../../interfaces.js');
11
12
  var localeImport = require('../../../localeImport.js');
12
13
  var Image = require('../../Image/Image.js');
13
14
 
@@ -18,7 +19,8 @@ function ConnectWalletQrCode(props) {
18
19
  });
19
20
  const {
20
21
  bodyState,
21
- setBodyState
22
+ setBodyState,
23
+ setToast
22
24
  } = react.useContext(RootContext.RootContext);
23
25
  const {
24
26
  qrCodeValue,
@@ -41,8 +43,16 @@ function ConnectWalletQrCode(props) {
41
43
  className: "w3a--contents",
42
44
  children: [qrCodeValue ? jsxRuntime.jsxs("div", {
43
45
  className: "w3a--flex w3a--flex-col w3a--items-center w3a--justify-center w3a--gap-y-4 w3a--rounded-2xl w3a--border w3a--border-app-gray-200 w3a--p-4 dark:w3a--border-app-gray-700",
44
- children: [jsxRuntime.jsx("div", {
45
- className: "w3a--relative w3a--flex w3a--size-[300px] w3a--items-center w3a--justify-center w3a--rounded-2xl",
46
+ children: [jsxRuntime.jsx("button", {
47
+ type: "button",
48
+ className: "w3a--relative w3a--flex w3a--size-[300px] w3a--appearance-none w3a--items-center w3a--justify-center w3a--rounded-2xl",
49
+ onClick: () => {
50
+ navigator.clipboard.writeText(qrCodeValue);
51
+ setToast({
52
+ message: t("modal.external.qr-code-copied-to-clipboard"),
53
+ type: interfaces.TOAST_TYPE.SUCCESS
54
+ });
55
+ },
46
56
  children: jsxRuntime.jsx(reactQrcodeLogo.QRCode, {
47
57
  size: isDesktop ? 300 : 260,
48
58
  eyeRadius: 5,
@@ -55,14 +55,11 @@ const Toast = () => {
55
55
  fill: "currentColor"
56
56
  })
57
57
  })
58
- }), jsxRuntime.jsxs("div", {
58
+ }), jsxRuntime.jsx("div", {
59
59
  className: "w3a--flex w3a--items-center w3a--gap-2",
60
- children: [jsxRuntime.jsx("p", {
61
- className: toastIconClass[toast.type],
62
- children: "x"
63
- }), jsxRuntime.jsx("p", {
60
+ children: jsxRuntime.jsx("p", {
64
61
  children: toast.message
65
- })]
62
+ })
66
63
  })]
67
64
  });
68
65
  };
@@ -1,4 +1,3 @@
1
1
  import { ConnectorsModalConfig } from "./interface";
2
2
  export declare const version: string;
3
3
  export declare const defaultConnectorsModalConfig: ConnectorsModalConfig;
4
- export declare const walletRegistryUrl = "https://assets.web3auth.io/v1/wallet-registry.json";
@@ -1,6 +1,6 @@
1
1
  import { EVM_CONNECTORS } from '@web3auth/no-modal';
2
2
 
3
- const version = "10.5.0";
3
+ const version = "10.5.1";
4
4
  const defaultConnectorsModalConfig = {
5
5
  hideWalletDiscovery: false,
6
6
  connectors: {
@@ -10,6 +10,5 @@ const defaultConnectorsModalConfig = {
10
10
  }
11
11
  }
12
12
  };
13
- const walletRegistryUrl = "https://assets.web3auth.io/v1/wallet-registry.json";
14
13
 
15
- export { defaultConnectorsModalConfig, version, walletRegistryUrl };
14
+ export { defaultConnectorsModalConfig, version };
@@ -1,3 +1,3 @@
1
- export { defaultConnectorsModalConfig, version, walletRegistryUrl } from './config.js';
1
+ export { defaultConnectorsModalConfig, version } from './config.js';
2
2
  export { Web3Auth } from './modalManager.js';
3
3
  export * from '@web3auth/no-modal';
@@ -1,9 +1,9 @@
1
1
  import _objectSpread from '@babel/runtime/helpers/objectSpread2';
2
2
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
3
3
  import { serializeError } from '@web3auth/auth';
4
- import { Web3AuthNoModal, cloneDeep, WALLET_CONNECTORS, LOGIN_MODE, log, CONNECTOR_STATUS, sdkVersion, ANALYTICS_SDK_TYPE, withAbort, CONNECTOR_EVENTS, ANALYTICS_EVENTS, getErrorAnalyticsProperties, WalletInitializationError, fetchProjectConfig, fetchWalletRegistry, CONNECTOR_CATEGORY, CONNECTOR_NAMES, CONNECTOR_NAMESPACES } from '@web3auth/no-modal';
4
+ import { Web3AuthNoModal, cloneDeep, WALLET_CONNECTORS, LOGIN_MODE, log, CONNECTOR_STATUS, sdkVersion, ANALYTICS_SDK_TYPE, withAbort, CONNECTOR_EVENTS, ANALYTICS_EVENTS, getErrorAnalyticsProperties, WalletInitializationError, fetchProjectConfig, fetchWalletRegistry, WALLET_REGISTRY_URL, CONNECTOR_CATEGORY, CONNECTOR_NAMES, CONNECTOR_NAMESPACES } from '@web3auth/no-modal';
5
5
  import deepmerge from 'deepmerge';
6
- import { defaultConnectorsModalConfig, walletRegistryUrl } from './config.js';
6
+ import { defaultConnectorsModalConfig } from './config.js';
7
7
  import { AUTH_PROVIDERS_NAMES, AUTH_PROVIDERS, capitalizeFirstLetter } from './ui/config.js';
8
8
  import { LOGIN_MODAL_EVENTS } from './ui/interfaces.js';
9
9
  import { LoginModal } from './ui/loginModal.js';
@@ -306,7 +306,7 @@ class Web3Auth extends Web3AuthNoModal {
306
306
  web3AuthNetwork: this.options.web3AuthNetwork,
307
307
  aaProvider: (_this$options$account = this.options.accountAbstractionConfig) === null || _this$options$account === void 0 ? void 0 : _this$options$account.smartAccountType,
308
308
  authBuildEnv: this.options.authBuildEnv
309
- }), fetchWalletRegistry(walletRegistryUrl)]);
309
+ }), fetchWalletRegistry(WALLET_REGISTRY_URL)]);
310
310
 
311
311
  // handle project config result
312
312
  if (projectConfigResult.status === "rejected") {
@@ -5,6 +5,7 @@ import { useTranslation } from 'react-i18next';
5
5
  import { QRCode } from 'react-qrcode-logo';
6
6
  import { WALLET_CONNECT_LOGO } from '../../../constants.js';
7
7
  import { RootContext } from '../../../context/RootContext.js';
8
+ import { TOAST_TYPE } from '../../../interfaces.js';
8
9
  import i18nInstance from '../../../localeImport.js';
9
10
  import Image from '../../Image/Image.js';
10
11
  import { jsxs, jsx } from 'react/jsx-runtime';
@@ -16,7 +17,8 @@ function ConnectWalletQrCode(props) {
16
17
  });
17
18
  const {
18
19
  bodyState,
19
- setBodyState
20
+ setBodyState,
21
+ setToast
20
22
  } = useContext(RootContext);
21
23
  const {
22
24
  qrCodeValue,
@@ -39,8 +41,16 @@ function ConnectWalletQrCode(props) {
39
41
  className: "w3a--contents",
40
42
  children: [qrCodeValue ? /*#__PURE__*/jsxs("div", {
41
43
  className: "w3a--flex w3a--flex-col w3a--items-center w3a--justify-center w3a--gap-y-4 w3a--rounded-2xl w3a--border w3a--border-app-gray-200 w3a--p-4 dark:w3a--border-app-gray-700",
42
- children: [/*#__PURE__*/jsx("div", {
43
- className: "w3a--relative w3a--flex w3a--size-[300px] w3a--items-center w3a--justify-center w3a--rounded-2xl",
44
+ children: [/*#__PURE__*/jsx("button", {
45
+ type: "button",
46
+ className: "w3a--relative w3a--flex w3a--size-[300px] w3a--appearance-none w3a--items-center w3a--justify-center w3a--rounded-2xl",
47
+ onClick: () => {
48
+ navigator.clipboard.writeText(qrCodeValue);
49
+ setToast({
50
+ message: t("modal.external.qr-code-copied-to-clipboard"),
51
+ type: TOAST_TYPE.SUCCESS
52
+ });
53
+ },
44
54
  children: /*#__PURE__*/jsx(QRCode, {
45
55
  size: isDesktop ? 300 : 260,
46
56
  eyeRadius: 5,
@@ -53,14 +53,11 @@ const Toast = () => {
53
53
  fill: "currentColor"
54
54
  })
55
55
  })
56
- }), /*#__PURE__*/jsxs("div", {
56
+ }), /*#__PURE__*/jsx("div", {
57
57
  className: "w3a--flex w3a--items-center w3a--gap-2",
58
- children: [/*#__PURE__*/jsx("p", {
59
- className: toastIconClass[toast.type],
60
- children: "x"
61
- }), /*#__PURE__*/jsx("p", {
58
+ children: /*#__PURE__*/jsx("p", {
62
59
  children: toast.message
63
- })]
60
+ })
64
61
  })]
65
62
  });
66
63
  };