@web3auth/modal 4.6.2 → 5.0.0-alpha.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/README.md +2 -1
- package/dist/modal.cjs.js +15 -9
- package/dist/modal.cjs.js.map +1 -1
- package/dist/modal.esm.js +12 -6
- package/dist/modal.esm.js.map +1 -1
- package/dist/modal.umd.min.js +1 -1
- package/dist/modal.umd.min.js.LICENSE.txt +3 -0
- package/dist/modal.umd.min.js.map +1 -1
- package/dist/types/modalManager.d.ts +3 -3
- package/package.json +14 -13
- package/src/modalManager.ts +12 -4
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SafeEventEmitterProvider, WALLET_ADAPTER_TYPE } from "@web3auth/base";
|
|
2
|
-
import {
|
|
2
|
+
import { Web3AuthNoModal, Web3AuthNoModalOptions } from "@web3auth/no-modal";
|
|
3
3
|
import { LoginModal, UIConfig } from "@web3auth/ui";
|
|
4
4
|
import { IWeb3AuthModal, ModalConfig } from "./interface";
|
|
5
|
-
export interface Web3AuthOptions extends
|
|
5
|
+
export interface Web3AuthOptions extends Web3AuthNoModalOptions {
|
|
6
6
|
/**
|
|
7
7
|
* web3auth instance provides different adapters for different type of usages. If you are dapp and want to
|
|
8
8
|
* use external wallets like metamask, then you can use the `DAPP` authMode.
|
|
@@ -17,7 +17,7 @@ export interface Web3AuthOptions extends Web3AuthCoreOptions {
|
|
|
17
17
|
*/
|
|
18
18
|
uiConfig?: Omit<UIConfig, "adapterListener">;
|
|
19
19
|
}
|
|
20
|
-
export declare class Web3Auth extends
|
|
20
|
+
export declare class Web3Auth extends Web3AuthNoModal implements IWeb3AuthModal {
|
|
21
21
|
loginModal: LoginModal;
|
|
22
22
|
readonly options: Web3AuthOptions;
|
|
23
23
|
private modalConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@web3auth/modal",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-alpha.0",
|
|
4
4
|
"homepage": "https://github.com/Web3Auth/Web3Auth#readme",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"main": "dist/modal.cjs.js",
|
|
@@ -19,15 +19,15 @@
|
|
|
19
19
|
"pre-commit": "lint-staged --cwd ."
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@web3auth/base": "^
|
|
23
|
-
"@web3auth/
|
|
24
|
-
"@web3auth/
|
|
25
|
-
"@web3auth/openlogin-adapter": "^
|
|
26
|
-
"@web3auth/phantom-adapter": "^
|
|
27
|
-
"@web3auth/torus-evm-adapter": "^
|
|
28
|
-
"@web3auth/torus-solana-adapter": "^
|
|
29
|
-
"@web3auth/ui": "^
|
|
30
|
-
"@web3auth/wallet-connect-v1-adapter": "^
|
|
22
|
+
"@web3auth/base": "^5.0.0-alpha.0",
|
|
23
|
+
"@web3auth/metamask-adapter": "^5.0.0-alpha.0",
|
|
24
|
+
"@web3auth/no-modal": "^5.0.0-alpha.0",
|
|
25
|
+
"@web3auth/openlogin-adapter": "^5.0.0-alpha.0",
|
|
26
|
+
"@web3auth/phantom-adapter": "^5.0.0-alpha.0",
|
|
27
|
+
"@web3auth/torus-evm-adapter": "^5.0.0-alpha.0",
|
|
28
|
+
"@web3auth/torus-solana-adapter": "^5.0.0-alpha.0",
|
|
29
|
+
"@web3auth/ui": "^5.0.0-alpha.0",
|
|
30
|
+
"@web3auth/wallet-connect-v1-adapter": "^5.0.0-alpha.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@svgr/webpack": "^6.5.1",
|
|
@@ -36,11 +36,12 @@
|
|
|
36
36
|
"css-loader": "^6.7.3",
|
|
37
37
|
"postcss-prefix-selector": "^1.16.0",
|
|
38
38
|
"style-loader": "^3.3.1",
|
|
39
|
-
"tailwindcss": "^3.2.
|
|
39
|
+
"tailwindcss": "^3.2.7",
|
|
40
40
|
"url-loader": "^4.1.1"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@babel/runtime": "7.x"
|
|
43
|
+
"@babel/runtime": "7.x",
|
|
44
|
+
"@solana/web3.js": "^1.x"
|
|
44
45
|
},
|
|
45
46
|
"files": [
|
|
46
47
|
"dist",
|
|
@@ -63,5 +64,5 @@
|
|
|
63
64
|
"publishConfig": {
|
|
64
65
|
"access": "public"
|
|
65
66
|
},
|
|
66
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "f8efd80b6c25a5c9af2057ed723ca9fb7f3f8e40"
|
|
67
68
|
}
|
package/src/modalManager.ts
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
WALLET_ADAPTER_TYPE,
|
|
13
13
|
WALLET_ADAPTERS,
|
|
14
14
|
} from "@web3auth/base";
|
|
15
|
-
import {
|
|
15
|
+
import { Web3AuthNoModal, Web3AuthNoModalOptions } from "@web3auth/no-modal";
|
|
16
16
|
import { getAdapterSocialLogins, LOGIN_MODAL_EVENTS, LoginModal, OPENLOGIN_PROVIDERS, UIConfig } from "@web3auth/ui";
|
|
17
17
|
|
|
18
18
|
import {
|
|
@@ -26,7 +26,7 @@ import { getDefaultAdapterModule } from "./default";
|
|
|
26
26
|
import { AdaptersModalConfig, IWeb3AuthModal, ModalConfig } from "./interface";
|
|
27
27
|
import { getUserLanguage } from "./utils";
|
|
28
28
|
|
|
29
|
-
export interface Web3AuthOptions extends
|
|
29
|
+
export interface Web3AuthOptions extends Web3AuthNoModalOptions {
|
|
30
30
|
/**
|
|
31
31
|
* web3auth instance provides different adapters for different type of usages. If you are dapp and want to
|
|
32
32
|
* use external wallets like metamask, then you can use the `DAPP` authMode.
|
|
@@ -42,7 +42,7 @@ export interface Web3AuthOptions extends Web3AuthCoreOptions {
|
|
|
42
42
|
uiConfig?: Omit<UIConfig, "adapterListener">;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
export class Web3Auth extends
|
|
45
|
+
export class Web3Auth extends Web3AuthNoModal implements IWeb3AuthModal {
|
|
46
46
|
public loginModal: LoginModal;
|
|
47
47
|
|
|
48
48
|
readonly options: Web3AuthOptions;
|
|
@@ -86,6 +86,9 @@ export class Web3Auth extends Web3AuthCore implements IWeb3AuthModal {
|
|
|
86
86
|
displayErrorsOnModal: this.options.uiConfig?.displayErrorsOnModal,
|
|
87
87
|
defaultLanguage,
|
|
88
88
|
modalZIndex: this.options.uiConfig?.modalZIndex || "99998",
|
|
89
|
+
web3AuthNetwork: this.options.web3AuthNetwork,
|
|
90
|
+
loginGridCol: this.options.uiConfig?.loginGridCol || 3,
|
|
91
|
+
primaryButton: this.options.uiConfig?.primaryButton || "socialLogin",
|
|
89
92
|
});
|
|
90
93
|
this.subscribeToLoginModalEvents();
|
|
91
94
|
}
|
|
@@ -263,7 +266,12 @@ export class Web3Auth extends Web3AuthCore implements IWeb3AuthModal {
|
|
|
263
266
|
this.walletAdapters[adapterName],
|
|
264
267
|
(this.modalConfig.adapters as Record<WALLET_ADAPTER_TYPE, ModalConfig>)[adapterName]?.loginMethods
|
|
265
268
|
),
|
|
266
|
-
this.options.uiConfig?.loginMethodsOrder || OPENLOGIN_PROVIDERS
|
|
269
|
+
this.options.uiConfig?.loginMethodsOrder || OPENLOGIN_PROVIDERS,
|
|
270
|
+
{
|
|
271
|
+
...this.options.uiConfig,
|
|
272
|
+
loginGridCol: this.options.uiConfig?.loginGridCol || 3,
|
|
273
|
+
primaryButton: this.options.uiConfig?.primaryButton || "socialLogin",
|
|
274
|
+
}
|
|
267
275
|
);
|
|
268
276
|
}
|
|
269
277
|
}
|