@web3auth/modal 10.0.0-alpha.1 → 10.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib.cjs/packages/modal/src/config.js +3 -57
- package/dist/lib.cjs/packages/modal/src/index.js +1 -5
- package/dist/lib.cjs/packages/modal/src/modalManager.js +142 -106
- package/dist/lib.cjs/packages/modal/src/react/context/Web3AuthInnerContext.js +1 -12
- package/dist/lib.cjs/packages/modal/src/ui/components/AdapterLoader.js +24 -24
- package/dist/lib.cjs/packages/modal/src/ui/components/Button/Button.js +3 -4
- package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallet/ExternalWalletButton.js +6 -6
- package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallet/ExternalWalletChainNamespace.js +91 -0
- package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallet/ExternalWalletConnect.js +12 -12
- package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallet/ExternalWalletDetails.js +14 -5
- package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallet/ExternalWalletHeader.js +9 -9
- package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallet/ExternalWalletInstall.js +16 -16
- package/dist/lib.cjs/packages/modal/src/ui/components/ExternalWallets.js +48 -42
- package/dist/lib.cjs/packages/modal/src/ui/components/Footer.js +6 -6
- package/dist/lib.cjs/packages/modal/src/ui/components/Header.js +17 -17
- package/dist/lib.cjs/packages/modal/src/ui/components/Icon.js +4 -4
- package/dist/lib.cjs/packages/modal/src/ui/components/Image.js +4 -4
- package/dist/lib.cjs/packages/modal/src/ui/components/Loader.js +11 -11
- package/dist/lib.cjs/packages/modal/src/ui/components/Modal.js +62 -28
- package/dist/lib.cjs/packages/modal/src/ui/components/SelfCustodyViaWeb3Auth.js +5 -5
- package/dist/lib.cjs/packages/modal/src/ui/components/SocialLoginPasswordless.js +31 -22
- package/dist/lib.cjs/packages/modal/src/ui/components/SocialLogins.js +31 -26
- package/dist/lib.cjs/packages/modal/src/ui/components/WalletConnect.js +9 -9
- package/dist/lib.cjs/packages/modal/src/ui/config.js +3 -4
- package/dist/lib.cjs/packages/modal/src/ui/css/web3auth.css.js +1 -1
- package/dist/lib.cjs/packages/modal/src/ui/i18n/dutch.json.js +3 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/english.json.js +3 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/french.json.js +3 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/german.json.js +3 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/japanese.json.js +3 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/korean.json.js +3 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/mandarin.json.js +3 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/portuguese.json.js +3 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/spanish.json.js +3 -0
- package/dist/lib.cjs/packages/modal/src/ui/i18n/turkish.json.js +3 -0
- package/dist/lib.cjs/packages/modal/src/ui/interfaces.js +2 -4
- package/dist/lib.cjs/packages/modal/src/ui/loginModal.js +18 -15
- package/dist/lib.cjs/packages/modal/src/ui/utils.js +0 -21
- package/dist/lib.cjs/packages/modal/src/vue/Web3AuthProvider.js +1 -13
- package/dist/lib.cjs/types/config.d.ts +3 -0
- package/dist/{types → lib.cjs/types}/interface.d.ts +2 -6
- package/dist/{types → lib.cjs/types}/modalManager.d.ts +7 -3
- package/dist/{types → lib.cjs/types}/react/interfaces.d.ts +1 -6
- package/dist/lib.cjs/types/ui/components/ExternalWallet/ExternalWalletChainNamespace.d.ts +9 -0
- package/dist/{types → lib.cjs/types}/ui/components/ExternalWallet/ExternalWalletDetails.d.ts +2 -1
- package/dist/{types → lib.cjs/types}/ui/components/ExternalWallets.d.ts +4 -6
- package/dist/{types → lib.cjs/types}/ui/components/Modal.d.ts +1 -1
- package/dist/{types → lib.cjs/types}/ui/components/SocialLoginPasswordless.d.ts +3 -5
- package/dist/{types → lib.cjs/types}/ui/components/SocialLogins.d.ts +2 -6
- package/dist/lib.cjs/types/ui/config.d.ts +4 -0
- package/dist/{types → lib.cjs/types}/ui/interfaces.d.ts +10 -8
- package/dist/{types → lib.cjs/types}/ui/loginModal.d.ts +1 -1
- package/dist/{types → lib.cjs/types}/ui/utils.d.ts +1 -3
- package/dist/{types → lib.cjs/types}/vue/interfaces.d.ts +1 -6
- package/dist/lib.esm/packages/modal/src/config.js +4 -54
- package/dist/lib.esm/packages/modal/src/index.js +1 -1
- package/dist/lib.esm/packages/modal/src/modalManager.js +154 -95
- package/dist/lib.esm/packages/modal/src/react/context/Web3AuthInnerContext.js +1 -12
- package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallet/ExternalWalletChainNamespace.js +90 -0
- package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallet/ExternalWalletDetails.js +13 -1
- package/dist/lib.esm/packages/modal/src/ui/components/ExternalWallets.js +29 -19
- package/dist/lib.esm/packages/modal/src/ui/components/Modal.js +47 -12
- package/dist/lib.esm/packages/modal/src/ui/components/SocialLoginPasswordless.js +18 -9
- package/dist/lib.esm/packages/modal/src/ui/components/SocialLogins.js +18 -12
- package/dist/lib.esm/packages/modal/src/ui/config.js +5 -5
- package/dist/lib.esm/packages/modal/src/ui/css/web3auth.css.js +1 -1
- package/dist/lib.esm/packages/modal/src/ui/i18n/dutch.json.js +3 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/english.json.js +3 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/french.json.js +3 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/german.json.js +3 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/japanese.json.js +3 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/korean.json.js +3 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/mandarin.json.js +3 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/portuguese.json.js +3 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/spanish.json.js +3 -0
- package/dist/lib.esm/packages/modal/src/ui/i18n/turkish.json.js +3 -0
- package/dist/lib.esm/packages/modal/src/ui/interfaces.js +2 -1
- package/dist/lib.esm/packages/modal/src/ui/loginModal.js +15 -9
- package/dist/lib.esm/packages/modal/src/ui/utils.js +2 -22
- package/dist/lib.esm/packages/modal/src/vue/Web3AuthProvider.js +1 -12
- package/dist/modal.umd.min.js +1 -1
- package/package.json +18 -18
- package/dist/modal.cjs.js +0 -5884
- package/dist/types/config.d.ts +0 -7
- package/dist/types/ui/config.d.ts +0 -4
- /package/dist/{types → lib.cjs/types}/index.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/react/Web3AuthProvider.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/react/context/Web3AuthInnerContext.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/react/context/index.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/react/hooks/index.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/react/hooks/useWeb3Auth.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/react/index.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/ui/components/AdapterLoader.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/ui/components/Button/Button.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/ui/components/Button/index.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/ui/components/ExternalWallet/ExternalWalletButton.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/ui/components/ExternalWallet/ExternalWalletConnect.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/ui/components/ExternalWallet/ExternalWalletHeader.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/ui/components/ExternalWallet/ExternalWalletInstall.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/ui/components/Footer.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/ui/components/Header.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/ui/components/Icon.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/ui/components/Image.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/ui/components/Loader.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/ui/components/SelfCustodyViaWeb3Auth.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/ui/components/WalletConnect.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/ui/context/ThemeContext.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/ui/helper/countryData.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/ui/i18n/index.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/ui/index.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/ui/localeImport.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/vue/Web3AuthProvider.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/vue/composables/index.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/vue/composables/useWeb3Auth.d.ts +0 -0
- /package/dist/{types → lib.cjs/types}/vue/index.d.ts +0 -0
|
@@ -2,58 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var noModal = require('@web3auth/no-modal');
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
connectors: {
|
|
8
|
-
[noModal.SOLANA_CONNECTORS.AUTH]: {
|
|
9
|
-
label: "Auth",
|
|
10
|
-
showOnModal: true,
|
|
11
|
-
showOnMobile: true,
|
|
12
|
-
showOnDesktop: true
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
const defaultEvmDappModalConfig = {
|
|
17
|
-
chainNamespace: noModal.CHAIN_NAMESPACES.EIP155,
|
|
18
|
-
connectors: {
|
|
19
|
-
[noModal.EVM_CONNECTORS.AUTH]: {
|
|
20
|
-
label: "Auth",
|
|
21
|
-
showOnModal: true,
|
|
22
|
-
showOnMobile: true,
|
|
23
|
-
showOnDesktop: true
|
|
24
|
-
},
|
|
25
|
-
[noModal.EVM_CONNECTORS.WALLET_CONNECT_V2]: {
|
|
26
|
-
label: "Wallet Connect",
|
|
27
|
-
showOnModal: true,
|
|
28
|
-
showOnMobile: true,
|
|
29
|
-
showOnDesktop: true
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
const defaultSolanaWalletModalConfig = {
|
|
34
|
-
chainNamespace: noModal.CHAIN_NAMESPACES.SOLANA,
|
|
35
|
-
connectors: {
|
|
36
|
-
[noModal.SOLANA_CONNECTORS.AUTH]: {
|
|
37
|
-
label: "Auth",
|
|
38
|
-
showOnModal: true,
|
|
39
|
-
showOnMobile: true,
|
|
40
|
-
showOnDesktop: true
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
const defaultEvmWalletModalConfig = {
|
|
45
|
-
chainNamespace: noModal.CHAIN_NAMESPACES.EIP155,
|
|
46
|
-
connectors: {
|
|
47
|
-
[noModal.EVM_CONNECTORS.AUTH]: {
|
|
48
|
-
label: "Auth",
|
|
49
|
-
showOnModal: true,
|
|
50
|
-
showOnMobile: true,
|
|
51
|
-
showOnDesktop: true
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
const defaultOtherModalConfig = {
|
|
56
|
-
chainNamespace: noModal.CHAIN_NAMESPACES.OTHER,
|
|
5
|
+
const defaultConnectorsModalConfig = {
|
|
6
|
+
hideWalletDiscovery: false,
|
|
57
7
|
connectors: {
|
|
58
8
|
[noModal.EVM_CONNECTORS.AUTH]: {
|
|
59
9
|
label: "Auth",
|
|
@@ -65,9 +15,5 @@ const defaultOtherModalConfig = {
|
|
|
65
15
|
};
|
|
66
16
|
const walletRegistryUrl = "https://assets.web3auth.io/v1/wallet-registry.json";
|
|
67
17
|
|
|
68
|
-
exports.
|
|
69
|
-
exports.defaultEvmWalletModalConfig = defaultEvmWalletModalConfig;
|
|
70
|
-
exports.defaultOtherModalConfig = defaultOtherModalConfig;
|
|
71
|
-
exports.defaultSolanaDappModalConfig = defaultSolanaDappModalConfig;
|
|
72
|
-
exports.defaultSolanaWalletModalConfig = defaultSolanaWalletModalConfig;
|
|
18
|
+
exports.defaultConnectorsModalConfig = defaultConnectorsModalConfig;
|
|
73
19
|
exports.walletRegistryUrl = walletRegistryUrl;
|
|
@@ -6,11 +6,7 @@ var noModal = require('@web3auth/no-modal');
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
exports.
|
|
10
|
-
exports.defaultEvmWalletModalConfig = config.defaultEvmWalletModalConfig;
|
|
11
|
-
exports.defaultOtherModalConfig = config.defaultOtherModalConfig;
|
|
12
|
-
exports.defaultSolanaDappModalConfig = config.defaultSolanaDappModalConfig;
|
|
13
|
-
exports.defaultSolanaWalletModalConfig = config.defaultSolanaWalletModalConfig;
|
|
9
|
+
exports.defaultConnectorsModalConfig = config.defaultConnectorsModalConfig;
|
|
14
10
|
exports.walletRegistryUrl = config.walletRegistryUrl;
|
|
15
11
|
exports.Web3Auth = modalManager.Web3Auth;
|
|
16
12
|
Object.keys(noModal).forEach(function (k) {
|
|
@@ -15,50 +15,52 @@ class Web3Auth extends noModal.Web3AuthNoModal {
|
|
|
15
15
|
super(options);
|
|
16
16
|
_defineProperty(this, "loginModal", void 0);
|
|
17
17
|
_defineProperty(this, "options", void 0);
|
|
18
|
-
_defineProperty(this, "modalConfig", noModal.cloneDeep(config.
|
|
18
|
+
_defineProperty(this, "modalConfig", noModal.cloneDeep(config.defaultConnectorsModalConfig));
|
|
19
19
|
this.options = _objectSpread({}, options);
|
|
20
20
|
if (!this.options.uiConfig) this.options.uiConfig = {};
|
|
21
|
+
if (this.options.modalConfig) this.modalConfig = this.options.modalConfig;
|
|
22
|
+
noModal.log.info("modalConfig", this.modalConfig);
|
|
21
23
|
}
|
|
22
|
-
|
|
24
|
+
async initModal() {
|
|
25
|
+
var _this$coreOptions$cha;
|
|
23
26
|
super.checkInitRequirements();
|
|
24
|
-
this.modalConfig = modalConfig;
|
|
25
|
-
}
|
|
26
|
-
async initModal(params) {
|
|
27
|
-
super.checkInitRequirements();
|
|
28
|
-
super.initCachedConnectorAndChainId();
|
|
29
27
|
// get project config and wallet registry
|
|
30
28
|
const {
|
|
31
29
|
projectConfig,
|
|
32
30
|
walletRegistry
|
|
33
|
-
} = await this.getProjectAndWalletConfig(
|
|
31
|
+
} = await this.getProjectAndWalletConfig();
|
|
34
32
|
this.options.uiConfig = deepmerge(noModal.cloneDeep(projectConfig.whitelabel || {}), this.options.uiConfig || {});
|
|
35
33
|
if (!this.options.uiConfig.defaultLanguage) this.options.uiConfig.defaultLanguage = utils.getUserLanguage(this.options.uiConfig.defaultLanguage);
|
|
36
34
|
if (!this.options.uiConfig.mode) this.options.uiConfig.mode = "light";
|
|
37
|
-
|
|
35
|
+
// init config
|
|
36
|
+
super.initAccountAbstractionConfig(projectConfig);
|
|
37
|
+
super.initChainsConfig(projectConfig);
|
|
38
|
+
super.initCachedConnectorAndChainId();
|
|
38
39
|
// init login modal
|
|
40
|
+
const {
|
|
41
|
+
filteredWalletRegistry,
|
|
42
|
+
disabledExternalWallets
|
|
43
|
+
} = this.filterWalletRegistry(walletRegistry, projectConfig);
|
|
39
44
|
this.loginModal = new loginModal.LoginModal(_objectSpread(_objectSpread({}, this.options.uiConfig), {}, {
|
|
40
45
|
connectorListener: this,
|
|
41
|
-
|
|
42
|
-
walletRegistry
|
|
46
|
+
chainNamespaces: [...new Set(((_this$coreOptions$cha = this.coreOptions.chains) === null || _this$coreOptions$cha === void 0 ? void 0 : _this$coreOptions$cha.map(x => x.chainNamespace)) || [])],
|
|
47
|
+
walletRegistry: filteredWalletRegistry
|
|
43
48
|
}));
|
|
44
49
|
this.subscribeToLoginModalEvents();
|
|
45
50
|
await this.loginModal.initModal();
|
|
46
|
-
|
|
47
51
|
// setup common JRPC provider
|
|
48
52
|
await this.setupCommonJRPCProvider();
|
|
49
|
-
|
|
50
53
|
// initialize connectors
|
|
51
54
|
this.on(noModal.CONNECTOR_EVENTS.CONNECTORS_UPDATED, ({
|
|
52
55
|
connectors: newConnectors
|
|
53
56
|
}) => this.initConnectors({
|
|
54
57
|
connectors: newConnectors,
|
|
55
58
|
projectConfig,
|
|
56
|
-
|
|
59
|
+
disabledExternalWallets
|
|
57
60
|
}));
|
|
58
61
|
await this.loadConnectors({
|
|
59
62
|
projectConfig
|
|
60
63
|
});
|
|
61
|
-
|
|
62
64
|
// initialize plugins
|
|
63
65
|
await this.initPlugins();
|
|
64
66
|
}
|
|
@@ -82,7 +84,33 @@ class Web3Auth extends noModal.Web3AuthNoModal {
|
|
|
82
84
|
});
|
|
83
85
|
});
|
|
84
86
|
}
|
|
85
|
-
|
|
87
|
+
filterWalletRegistry(walletRegistry, projectConfig) {
|
|
88
|
+
const {
|
|
89
|
+
disableAllRecommendedWallets,
|
|
90
|
+
disableAllOtherWallets,
|
|
91
|
+
disabledWallets
|
|
92
|
+
} = projectConfig.externalWalletAuth || {};
|
|
93
|
+
// add disabled wallets to set
|
|
94
|
+
const disabledExternalWallets = new Set(disabledWallets || []);
|
|
95
|
+
if (disableAllRecommendedWallets) {
|
|
96
|
+
Object.keys(walletRegistry.default).forEach(wallet => disabledExternalWallets.add(wallet));
|
|
97
|
+
}
|
|
98
|
+
if (disableAllOtherWallets) {
|
|
99
|
+
Object.keys(walletRegistry.others).forEach(wallet => disabledExternalWallets.add(wallet));
|
|
100
|
+
}
|
|
101
|
+
// remove wallets that are disabled in project config from wallet registry
|
|
102
|
+
const filteredWalletRegistry = noModal.cloneDeep(walletRegistry);
|
|
103
|
+
disabledExternalWallets.forEach(wallet => {
|
|
104
|
+
delete filteredWalletRegistry.default[wallet];
|
|
105
|
+
delete filteredWalletRegistry.others[wallet];
|
|
106
|
+
});
|
|
107
|
+
return {
|
|
108
|
+
disabledExternalWallets,
|
|
109
|
+
filteredWalletRegistry
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
async getProjectAndWalletConfig() {
|
|
113
|
+
var _this$modalConfig;
|
|
86
114
|
// get project config
|
|
87
115
|
let projectConfig;
|
|
88
116
|
try {
|
|
@@ -92,13 +120,13 @@ class Web3Auth extends noModal.Web3AuthNoModal {
|
|
|
92
120
|
noModal.log.error("Failed to fetch project configurations", e);
|
|
93
121
|
throw noModal.WalletInitializationError.notReady("failed to fetch project configurations", e);
|
|
94
122
|
}
|
|
95
|
-
|
|
96
123
|
// get wallet registry
|
|
97
124
|
let walletRegistry = {
|
|
98
125
|
others: {},
|
|
99
126
|
default: {}
|
|
100
127
|
};
|
|
101
|
-
|
|
128
|
+
const isExternalWalletEnabled = Boolean(projectConfig.externalWalletAuth);
|
|
129
|
+
if (isExternalWalletEnabled && !((_this$modalConfig = this.modalConfig) !== null && _this$modalConfig !== void 0 && _this$modalConfig.hideWalletDiscovery)) {
|
|
102
130
|
try {
|
|
103
131
|
walletRegistry = await noModal.fetchWalletRegistry(config.walletRegistryUrl);
|
|
104
132
|
} catch (e) {
|
|
@@ -113,16 +141,18 @@ class Web3Auth extends noModal.Web3AuthNoModal {
|
|
|
113
141
|
async initConnectors({
|
|
114
142
|
connectors,
|
|
115
143
|
projectConfig,
|
|
116
|
-
|
|
144
|
+
disabledExternalWallets
|
|
117
145
|
}) {
|
|
118
146
|
// filter connectors based on config
|
|
119
|
-
const filteredConnectorNames = await this.filterConnectors(
|
|
120
|
-
|
|
147
|
+
const filteredConnectorNames = await this.filterConnectors({
|
|
148
|
+
projectConfig,
|
|
149
|
+
disabledExternalWallets
|
|
150
|
+
});
|
|
121
151
|
// initialize connectors based on availability
|
|
122
152
|
const {
|
|
123
153
|
hasInAppConnectors,
|
|
124
154
|
hasExternalConnectors
|
|
125
|
-
} = await this.checkConnectorAvailability(filteredConnectorNames
|
|
155
|
+
} = await this.checkConnectorAvailability(filteredConnectorNames);
|
|
126
156
|
if (hasInAppConnectors) {
|
|
127
157
|
await this.initInAppAndCachedConnectors(connectors, filteredConnectorNames);
|
|
128
158
|
// show connect button if external wallets are available
|
|
@@ -133,113 +163,116 @@ class Web3Auth extends noModal.Web3AuthNoModal {
|
|
|
133
163
|
showExternalWalletsOnly: true
|
|
134
164
|
});
|
|
135
165
|
}
|
|
136
|
-
|
|
137
166
|
// emit ready event if connector is ready
|
|
138
167
|
if (this.status === noModal.CONNECTOR_STATUS.NOT_READY) {
|
|
139
168
|
this.status = noModal.CONNECTOR_STATUS.READY;
|
|
140
169
|
this.emit(noModal.CONNECTOR_EVENTS.READY);
|
|
141
170
|
}
|
|
142
171
|
}
|
|
143
|
-
async filterConnectors(
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
172
|
+
async filterConnectors({
|
|
173
|
+
projectConfig,
|
|
174
|
+
disabledExternalWallets
|
|
175
|
+
}) {
|
|
176
|
+
var _this$modalConfig2, _this$modalConfig3, _projectConfig$loginM, _projectConfig$loginM2;
|
|
177
|
+
// Auth connector config: merge code config with config from dashboard
|
|
178
|
+
const loginMethods = {};
|
|
179
|
+
for (const authConnectionConfig of projectConfig.embeddedWalletAuth || []) {
|
|
180
|
+
const {
|
|
181
|
+
isDefault,
|
|
182
|
+
authConnectionId,
|
|
183
|
+
groupedAuthConnectionId,
|
|
184
|
+
authConnection
|
|
185
|
+
} = authConnectionConfig;
|
|
186
|
+
// for custom auth connections, authConnectionId or groupedAuthConnectionId are required.
|
|
187
|
+
if (!isDefault && (!authConnectionId || !groupedAuthConnectionId)) return;
|
|
188
|
+
loginMethods[authConnection] = _objectSpread(_objectSpread({
|
|
189
|
+
name: authConnection
|
|
190
|
+
}, authConnectionConfig), {}, {
|
|
191
|
+
showOnModal: true,
|
|
192
|
+
showOnDesktop: true,
|
|
193
|
+
showOnMobile: true
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
const dashboardConnectorConfig = {
|
|
197
|
+
[noModal.WALLET_CONNECTORS.AUTH]: {
|
|
198
|
+
label: noModal.WALLET_CONNECTORS.AUTH,
|
|
199
|
+
loginMethods
|
|
170
200
|
}
|
|
171
|
-
|
|
201
|
+
};
|
|
202
|
+
if ((_this$modalConfig2 = this.modalConfig) !== null && _this$modalConfig2 !== void 0 && (_this$modalConfig2 = _this$modalConfig2.connectors) !== null && _this$modalConfig2 !== void 0 && _this$modalConfig2[noModal.WALLET_CONNECTORS.AUTH]) {
|
|
203
|
+
if (!this.modalConfig.connectors[noModal.WALLET_CONNECTORS.AUTH].loginMethods) this.modalConfig.connectors[noModal.WALLET_CONNECTORS.AUTH].loginMethods = {};
|
|
172
204
|
}
|
|
173
|
-
|
|
205
|
+
this.modalConfig.connectors = deepmerge(dashboardConnectorConfig, noModal.cloneDeep(this.modalConfig.connectors || {}));
|
|
206
|
+
// TODO: validate modal connector config here.!!
|
|
207
|
+
if ((_this$modalConfig3 = this.modalConfig) !== null && _this$modalConfig3 !== void 0 && (_this$modalConfig3 = _this$modalConfig3.connectors) !== null && _this$modalConfig3 !== void 0 && (_this$modalConfig3 = _this$modalConfig3[noModal.WALLET_CONNECTORS.AUTH]) !== null && _this$modalConfig3 !== void 0 && _this$modalConfig3.loginMethods) {
|
|
208
|
+
const authProviders = new Set(config$1.AUTH_PROVIDERS);
|
|
209
|
+
Object.keys(this.modalConfig.connectors[noModal.WALLET_CONNECTORS.AUTH].loginMethods).forEach(key => {
|
|
210
|
+
if (!authProviders.has(key)) {
|
|
211
|
+
throw noModal.WalletInitializationError.invalidParams(`Invalid auth connection: ${key}`);
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
// external wallets config
|
|
216
|
+
const isExternalWalletEnabled = Boolean(projectConfig.externalWalletAuth);
|
|
217
|
+
const isInstalledWalletWalletDisplayed = Boolean((_projectConfig$loginM = (_projectConfig$loginM2 = projectConfig.loginModal) === null || _projectConfig$loginM2 === void 0 ? void 0 : _projectConfig$loginM2.displayInstalledExternalWallets) !== null && _projectConfig$loginM !== void 0 ? _projectConfig$loginM : true);
|
|
174
218
|
// merge default connectors with the custom configured connectors.
|
|
175
219
|
const allConnectorNames = [...new Set([...Object.keys(this.modalConfig.connectors || {}), ...this.connectors.map(connector => connector.name)])];
|
|
176
|
-
const
|
|
177
|
-
var _this$
|
|
220
|
+
const connectorNames = allConnectorNames.map(connectorName => {
|
|
221
|
+
var _this$modalConfig4, _this$modalConfig$con, _this$modalConfig$con2;
|
|
178
222
|
// start with the default config of connector.
|
|
179
|
-
|
|
223
|
+
const defaultConnectorConfig = {
|
|
180
224
|
label: noModal.CONNECTOR_NAMES[connectorName] || connectorName.split("-").map(config$1.capitalizeFirstLetter).join(" "),
|
|
181
225
|
showOnModal: true,
|
|
182
226
|
showOnMobile: true,
|
|
183
227
|
showOnDesktop: true
|
|
184
228
|
};
|
|
185
|
-
|
|
186
|
-
if ((_params2 = params) !== null && _params2 !== void 0 && (_params2 = _params2.modalConfig) !== null && _params2 !== void 0 && _params2[connectorName]) {
|
|
187
|
-
connectorConfig = _objectSpread(_objectSpread({}, connectorConfig), params.modalConfig[connectorName]);
|
|
188
|
-
}
|
|
189
|
-
this.modalConfig.connectors[connectorName] = connectorConfig;
|
|
190
|
-
|
|
229
|
+
this.modalConfig.connectors[connectorName] = _objectSpread(_objectSpread({}, defaultConnectorConfig), ((_this$modalConfig4 = this.modalConfig) === null || _this$modalConfig4 === void 0 || (_this$modalConfig4 = _this$modalConfig4.connectors) === null || _this$modalConfig4 === void 0 ? void 0 : _this$modalConfig4[connectorName]) || {});
|
|
191
230
|
// check if connector is configured/added by user and exist in connectors map.
|
|
192
231
|
const connector = this.getConnector(connectorName);
|
|
193
|
-
noModal.log.debug("connector config", connectorName, (_this$modalConfig$
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
var _this$modalConfig$con5, _this$modalConfig$con6, _this$modalConfig$con7;
|
|
208
|
-
// override user specified config by hiding wallet connect
|
|
209
|
-
this.modalConfig.connectors = _objectSpread(_objectSpread({}, (_this$modalConfig$con5 = this.modalConfig.connectors) !== null && _this$modalConfig$con5 !== void 0 ? _this$modalConfig$con5 : {}), {}, {
|
|
210
|
-
[noModal.WALLET_CONNECTORS.WALLET_CONNECT_V2]: _objectSpread(_objectSpread({}, (_this$modalConfig$con6 = (_this$modalConfig$con7 = this.modalConfig.connectors) === null || _this$modalConfig$con7 === void 0 ? void 0 : _this$modalConfig$con7[noModal.WALLET_CONNECTORS.WALLET_CONNECT_V2]) !== null && _this$modalConfig$con6 !== void 0 ? _this$modalConfig$con6 : {}), {}, {
|
|
211
|
-
showOnModal: false
|
|
212
|
-
})
|
|
213
|
-
});
|
|
214
|
-
this.modalConfig.connectors[noModal.WALLET_CONNECTORS.WALLET_CONNECT_V2].showOnModal = false;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
return connectorName;
|
|
232
|
+
noModal.log.debug("connector config", connectorName, (_this$modalConfig$con = this.modalConfig.connectors) === null || _this$modalConfig$con === void 0 || (_this$modalConfig$con = _this$modalConfig$con[connectorName]) === null || _this$modalConfig$con === void 0 ? void 0 : _this$modalConfig$con.showOnModal, connector);
|
|
233
|
+
// check if connector is configured/added by user and exist in connectors map.
|
|
234
|
+
const connectorConfig = (_this$modalConfig$con2 = this.modalConfig.connectors) === null || _this$modalConfig$con2 === void 0 ? void 0 : _this$modalConfig$con2[connectorName];
|
|
235
|
+
if (!connector) {
|
|
236
|
+
if (connectorConfig.showOnModal) throw noModal.WalletInitializationError.invalidParams(`Connector ${connectorName} is not configured`);
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
// skip connector if it is hidden by user
|
|
240
|
+
if (!connectorConfig.showOnModal) return;
|
|
241
|
+
// skip external connector if external wallets are disabled or it is disabled or displayInstalledExternalWallets is false
|
|
242
|
+
if (connector.type === noModal.CONNECTOR_CATEGORY.EXTERNAL) {
|
|
243
|
+
if (!isExternalWalletEnabled) return;
|
|
244
|
+
if (disabledExternalWallets.has(connectorName)) return;
|
|
245
|
+
if (!isInstalledWalletWalletDisplayed) return;
|
|
218
246
|
}
|
|
247
|
+
// skip WC connector if external wallets are disabled or hideWalletDiscovery is true
|
|
248
|
+
if (connectorName === noModal.WALLET_CONNECTORS.WALLET_CONNECT_V2) {
|
|
249
|
+
var _this$modalConfig5;
|
|
250
|
+
if (!isExternalWalletEnabled) return;
|
|
251
|
+
if ((_this$modalConfig5 = this.modalConfig) !== null && _this$modalConfig5 !== void 0 && _this$modalConfig5.hideWalletDiscovery) return;
|
|
252
|
+
}
|
|
253
|
+
this.modalConfig.connectors[connectorName] = connectorConfig;
|
|
254
|
+
return connectorName;
|
|
219
255
|
});
|
|
220
|
-
const connectorNames = await Promise.all(connectorConfigurationPromises);
|
|
256
|
+
// const connectorNames = await Promise.all(connectorConfigurationPromises);
|
|
221
257
|
return connectorNames.filter(name => name !== undefined);
|
|
222
258
|
}
|
|
223
|
-
async checkConnectorAvailability(connectorNames
|
|
259
|
+
async checkConnectorAvailability(connectorNames) {
|
|
224
260
|
// currently all default in app and external wallets can be hidden or shown based on config.
|
|
225
261
|
// check if in app connectors are available
|
|
226
262
|
const hasInAppConnectors = this.connectors.some(connector => {
|
|
227
|
-
var _this$modalConfig$
|
|
263
|
+
var _this$modalConfig$con3, _this$modalConfig$con4;
|
|
228
264
|
if (connector.type !== noModal.CONNECTOR_CATEGORY.IN_APP) return false;
|
|
229
|
-
if (((_this$modalConfig$
|
|
230
|
-
if (!((_this$modalConfig$
|
|
231
|
-
|
|
232
|
-
if (Object.values(mergedLoginMethods).some(method => method.showOnModal)) return true;
|
|
265
|
+
if (((_this$modalConfig$con3 = this.modalConfig.connectors) === null || _this$modalConfig$con3 === void 0 || (_this$modalConfig$con3 = _this$modalConfig$con3[connector.name]) === null || _this$modalConfig$con3 === void 0 ? void 0 : _this$modalConfig$con3.showOnModal) !== true) return false;
|
|
266
|
+
if (!((_this$modalConfig$con4 = this.modalConfig.connectors) !== null && _this$modalConfig$con4 !== void 0 && (_this$modalConfig$con4 = _this$modalConfig$con4[connector.name]) !== null && _this$modalConfig$con4 !== void 0 && _this$modalConfig$con4.loginMethods)) return true;
|
|
267
|
+
if (Object.values(this.modalConfig.connectors[connector.name].loginMethods).some(method => method.showOnModal)) return true;
|
|
233
268
|
return false;
|
|
234
269
|
});
|
|
235
270
|
noModal.log.debug(hasInAppConnectors, this.connectors, connectorNames, "hasInAppWallets");
|
|
236
|
-
|
|
237
271
|
// check if external connectors are available
|
|
238
272
|
const hasExternalConnectors = connectorNames.some(connectorName => {
|
|
239
|
-
var _this$getConnector, _this$modalConfig$
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
return ((_this$getConnector = this.getConnector(connectorName)) === null || _this$getConnector === void 0 ? void 0 : _this$getConnector.type) === noModal.CONNECTOR_CATEGORY.EXTERNAL && ((_this$modalConfig$con10 = this.modalConfig.connectors) === null || _this$modalConfig$con10 === void 0 ? void 0 : _this$modalConfig$con10[connectorName].showOnModal);
|
|
273
|
+
var _this$getConnector, _this$modalConfig$con5;
|
|
274
|
+
if (connectorName === noModal.WALLET_CONNECTORS.WALLET_CONNECT_V2) return true;
|
|
275
|
+
return ((_this$getConnector = this.getConnector(connectorName)) === null || _this$getConnector === void 0 ? void 0 : _this$getConnector.type) === noModal.CONNECTOR_CATEGORY.EXTERNAL && ((_this$modalConfig$con5 = this.modalConfig.connectors) === null || _this$modalConfig$con5 === void 0 ? void 0 : _this$modalConfig$con5[connectorName].showOnModal);
|
|
243
276
|
});
|
|
244
277
|
return {
|
|
245
278
|
hasInAppConnectors,
|
|
@@ -253,10 +286,8 @@ class Web3Auth extends noModal.Web3AuthNoModal {
|
|
|
253
286
|
try {
|
|
254
287
|
// skip if connector is already initialized
|
|
255
288
|
if (connector.status !== noModal.CONNECTOR_STATUS.NOT_READY) return;
|
|
256
|
-
|
|
257
289
|
// only initialize a external connectors here if it is a cached connector.
|
|
258
|
-
if (this.cachedConnector !== connectorName && connector.type === noModal.CONNECTOR_CATEGORY.EXTERNAL) return;
|
|
259
|
-
|
|
290
|
+
if (this.cachedConnector !== connectorName && connectorName !== noModal.WALLET_CONNECTORS.METAMASK && connector.type === noModal.CONNECTOR_CATEGORY.EXTERNAL) return;
|
|
260
291
|
// in-app wallets or cached wallet (being connected or already connected) are initialized first.
|
|
261
292
|
// if connector is configured then only initialize in app or cached connector.
|
|
262
293
|
// external wallets are initialized on INIT_EXTERNAL_WALLET event.
|
|
@@ -266,13 +297,12 @@ class Web3Auth extends noModal.Web3AuthNoModal {
|
|
|
266
297
|
autoConnect: this.cachedConnector === connectorName,
|
|
267
298
|
chainId: initialChain.chainId
|
|
268
299
|
});
|
|
269
|
-
|
|
270
300
|
// note: not adding cachedWallet to modal if it is external wallet.
|
|
271
301
|
// adding it later if no in-app wallets are available.
|
|
272
302
|
if (connector.type === noModal.CONNECTOR_CATEGORY.IN_APP) {
|
|
273
|
-
var
|
|
303
|
+
var _this$modalConfig$con6, _this$options$uiConfi, _this$options$uiConfi2, _this$options$uiConfi3;
|
|
274
304
|
noModal.log.info("connectorInitResults", connectorName);
|
|
275
|
-
const loginMethods =
|
|
305
|
+
const loginMethods = ((_this$modalConfig$con6 = this.modalConfig.connectors[connectorName]) === null || _this$modalConfig$con6 === void 0 ? void 0 : _this$modalConfig$con6.loginMethods) || {};
|
|
276
306
|
this.loginModal.addSocialLogins(connectorName, loginMethods, ((_this$options$uiConfi = this.options.uiConfig) === null || _this$options$uiConfi === void 0 ? void 0 : _this$options$uiConfi.loginMethodsOrder) || config$1.AUTH_PROVIDERS, _objectSpread(_objectSpread({}, this.options.uiConfig), {}, {
|
|
277
307
|
loginGridCol: ((_this$options$uiConfi2 = this.options.uiConfig) === null || _this$options$uiConfi2 === void 0 ? void 0 : _this$options$uiConfi2.loginGridCol) || 3,
|
|
278
308
|
primaryButton: ((_this$options$uiConfi3 = this.options.uiConfig) === null || _this$options$uiConfi3 === void 0 ? void 0 : _this$options$uiConfi3.primaryButton) || "socialLogin"
|
|
@@ -327,7 +357,14 @@ class Web3Auth extends noModal.Web3AuthNoModal {
|
|
|
327
357
|
});
|
|
328
358
|
}
|
|
329
359
|
subscribeToLoginModalEvents() {
|
|
330
|
-
this.loginModal.on(interfaces.LOGIN_MODAL_EVENTS.
|
|
360
|
+
this.loginModal.on(interfaces.LOGIN_MODAL_EVENTS.EXTERNAL_WALLET_LOGIN, async params => {
|
|
361
|
+
try {
|
|
362
|
+
await this.connectTo(params.connector);
|
|
363
|
+
} catch (error) {
|
|
364
|
+
noModal.log.error(`Error while connecting to connector: ${params.connector}`, error);
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
this.loginModal.on(interfaces.LOGIN_MODAL_EVENTS.SOCIAL_LOGIN, async params => {
|
|
331
368
|
try {
|
|
332
369
|
await this.connectTo(params.connector, params.loginParams);
|
|
333
370
|
} catch (error) {
|
|
@@ -353,7 +390,6 @@ class Web3Auth extends noModal.Web3AuthNoModal {
|
|
|
353
390
|
noModal.log.debug("trying refreshing wc session", visibility, walletConnectStatus);
|
|
354
391
|
if (visibility && (walletConnectStatus === noModal.CONNECTOR_STATUS.READY || walletConnectStatus === noModal.CONNECTOR_STATUS.CONNECTING)) {
|
|
355
392
|
noModal.log.debug("refreshing wc session");
|
|
356
|
-
|
|
357
393
|
// refreshing session for wallet connect whenever modal is opened.
|
|
358
394
|
try {
|
|
359
395
|
const initialChain = this.getInitialChainIdForConnector(wcConnector);
|
|
@@ -87,18 +87,7 @@ function Web3AuthInnerProvider(params) {
|
|
|
87
87
|
try {
|
|
88
88
|
setInitError(null);
|
|
89
89
|
setIsInitializing(true);
|
|
90
|
-
|
|
91
|
-
modalConfig,
|
|
92
|
-
hideWalletDiscovery
|
|
93
|
-
} = config;
|
|
94
|
-
if (modalConfig) {
|
|
95
|
-
await web3Auth.initModal({
|
|
96
|
-
modalConfig,
|
|
97
|
-
hideWalletDiscovery
|
|
98
|
-
});
|
|
99
|
-
} else {
|
|
100
|
-
await web3Auth.initModal();
|
|
101
|
-
}
|
|
90
|
+
await web3Auth.initModal();
|
|
102
91
|
} catch (error) {
|
|
103
92
|
setInitError(error);
|
|
104
93
|
} finally {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
3
4
|
var noModal = require('@web3auth/no-modal');
|
|
4
5
|
var React = require('react');
|
|
5
6
|
var reactI18next = require('react-i18next');
|
|
@@ -7,9 +8,8 @@ var interfaces = require('../interfaces.js');
|
|
|
7
8
|
var localeImport = require('../localeImport.js');
|
|
8
9
|
var Icon = require('./Icon.js');
|
|
9
10
|
var Image = require('./Image.js');
|
|
10
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
11
11
|
|
|
12
|
-
const closeIcon =
|
|
12
|
+
const closeIcon = jsxRuntime.jsx(Icon, {
|
|
13
13
|
iconName: "x-light",
|
|
14
14
|
darkIconName: "close"
|
|
15
15
|
});
|
|
@@ -22,9 +22,9 @@ function DetailedLoader(props) {
|
|
|
22
22
|
connectorName,
|
|
23
23
|
onClose
|
|
24
24
|
} = props;
|
|
25
|
-
const providerIcon = connector === "twitter" ?
|
|
25
|
+
const providerIcon = connector === "twitter" ? jsxRuntime.jsx(Image, {
|
|
26
26
|
imageId: "login-x-dark"
|
|
27
|
-
}) :
|
|
27
|
+
}) : jsxRuntime.jsx(Image, {
|
|
28
28
|
imageId: `login-${connector}`,
|
|
29
29
|
height: "30",
|
|
30
30
|
width: "30"
|
|
@@ -40,63 +40,63 @@ function DetailedLoader(props) {
|
|
|
40
40
|
}, 3000);
|
|
41
41
|
}
|
|
42
42
|
}, [modalStatus, onClose]);
|
|
43
|
-
return modalStatus !== interfaces.MODAL_STATUS.INITIALIZED ?
|
|
43
|
+
return modalStatus !== interfaces.MODAL_STATUS.INITIALIZED ? jsxRuntime.jsxs("div", {
|
|
44
44
|
className: "w3ajs-modal-loader w3a-modal__loader w3a--h-full",
|
|
45
|
-
children: [
|
|
45
|
+
children: [jsxRuntime.jsx("div", {
|
|
46
46
|
className: "w3a-modal__loader-content",
|
|
47
|
-
children:
|
|
47
|
+
children: jsxRuntime.jsxs("div", {
|
|
48
48
|
className: "w3a-modal__loader-info",
|
|
49
|
-
children: [modalStatus === interfaces.MODAL_STATUS.CONNECTING &&
|
|
50
|
-
children: [
|
|
49
|
+
children: [modalStatus === interfaces.MODAL_STATUS.CONNECTING && jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
50
|
+
children: [jsxRuntime.jsxs("div", {
|
|
51
51
|
className: "w3a-modal__loader-bridge",
|
|
52
|
-
children: [
|
|
52
|
+
children: [jsxRuntime.jsxs("div", {
|
|
53
53
|
className: "w3a-modal__loader-app-logo",
|
|
54
|
-
children: [
|
|
54
|
+
children: [jsxRuntime.jsx("img", {
|
|
55
55
|
src: appLogo,
|
|
56
56
|
className: "w3a--block dark:w3a--hidden w3a--h-10 w3a--w-10",
|
|
57
57
|
alt: ""
|
|
58
|
-
}),
|
|
58
|
+
}), jsxRuntime.jsx("img", {
|
|
59
59
|
src: appLogo,
|
|
60
60
|
className: "w3a--hidden dark:w3a--block w3a--h-10 w3a--w-10",
|
|
61
61
|
alt: ""
|
|
62
62
|
})]
|
|
63
|
-
}),
|
|
63
|
+
}), jsxRuntime.jsx("div", {
|
|
64
64
|
className: "w3a-modal__connector",
|
|
65
|
-
children:
|
|
65
|
+
children: jsxRuntime.jsxs("div", {
|
|
66
66
|
className: "w3a-modal__connector-beat",
|
|
67
|
-
children: [
|
|
67
|
+
children: [jsxRuntime.jsx("div", {}), jsxRuntime.jsx("div", {}), jsxRuntime.jsx("div", {}), jsxRuntime.jsx("div", {}), jsxRuntime.jsx("div", {})]
|
|
68
68
|
})
|
|
69
|
-
}),
|
|
69
|
+
}), jsxRuntime.jsx("div", {
|
|
70
70
|
className: "w3a-modal__loader-social-logo",
|
|
71
71
|
children: providerIcon
|
|
72
72
|
})]
|
|
73
|
-
}),
|
|
74
|
-
children: [
|
|
73
|
+
}), jsxRuntime.jsxs("div", {
|
|
74
|
+
children: [jsxRuntime.jsx("div", {
|
|
75
75
|
className: "w3a-modal__loader-bridge-message",
|
|
76
76
|
children: t("modal.adapter-loader.message1", {
|
|
77
77
|
adapter: connectorName
|
|
78
78
|
})
|
|
79
|
-
}),
|
|
79
|
+
}), jsxRuntime.jsx("div", {
|
|
80
80
|
className: "w3a-modal__loader-bridge-message",
|
|
81
81
|
children: t("modal.adapter-loader.message2", {
|
|
82
82
|
adapter: connectorName
|
|
83
83
|
})
|
|
84
84
|
})]
|
|
85
85
|
})]
|
|
86
|
-
}), modalStatus === noModal.CONNECTOR_STATUS.CONNECTED &&
|
|
86
|
+
}), modalStatus === noModal.CONNECTOR_STATUS.CONNECTED && jsxRuntime.jsxs("div", {
|
|
87
87
|
className: "w3a--flex w3a--flex-col w3a--items-center",
|
|
88
|
-
children: [
|
|
88
|
+
children: [jsxRuntime.jsx(Icon, {
|
|
89
89
|
iconName: "connected"
|
|
90
|
-
}),
|
|
90
|
+
}), jsxRuntime.jsx("div", {
|
|
91
91
|
className: "w3ajs-modal-loader__message w3a-spinner-message w3a--mt-4",
|
|
92
92
|
children: message
|
|
93
93
|
})]
|
|
94
|
-
}), modalStatus === noModal.CONNECTOR_STATUS.ERRORED &&
|
|
94
|
+
}), modalStatus === noModal.CONNECTOR_STATUS.ERRORED && jsxRuntime.jsx("div", {
|
|
95
95
|
className: "w3ajs-modal-loader__message w3a-spinner-message w3a-spinner-message--error",
|
|
96
96
|
children: message
|
|
97
97
|
})]
|
|
98
98
|
})
|
|
99
|
-
}), (modalStatus === noModal.CONNECTOR_STATUS.CONNECTED || modalStatus === noModal.CONNECTOR_STATUS.ERRORED) &&
|
|
99
|
+
}), (modalStatus === noModal.CONNECTOR_STATUS.CONNECTED || modalStatus === noModal.CONNECTOR_STATUS.ERRORED) && jsxRuntime.jsx("button", {
|
|
100
100
|
type: "button",
|
|
101
101
|
className: "w3a-header__button w3ajs-loader-close-btn",
|
|
102
102
|
onClick: onClose,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
3
4
|
require('./styles.css.js');
|
|
4
5
|
var React = require('react');
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
|
|
7
7
|
function Button(props) {
|
|
8
8
|
const {
|
|
@@ -17,10 +17,9 @@ function Button(props) {
|
|
|
17
17
|
type = "button"
|
|
18
18
|
} = props;
|
|
19
19
|
const sizeClass = `size-${size}`;
|
|
20
|
-
return
|
|
21
|
-
disabled: disabled
|
|
20
|
+
return jsxRuntime.jsx("button", {
|
|
21
|
+
disabled: disabled,
|
|
22
22
|
// eslint-disable-next-line react/button-has-type
|
|
23
|
-
,
|
|
24
23
|
type: type,
|
|
25
24
|
className: `t-btn t-btn-${variant} w3a--rounded-full ${sizeClass} ${className}`,
|
|
26
25
|
onClick: onClick,
|