@web3auth/modal 4.3.3-beta.0 → 4.5.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/modal.cjs.js +6 -6
- package/dist/modal.cjs.js.map +1 -1
- package/dist/modal.esm.js +6 -6
- package/dist/modal.esm.js.map +1 -1
- package/dist/modal.umd.min.js +1 -1
- package/dist/modal.umd.min.js.map +1 -1
- package/dist/types/modalManager.d.ts +2 -41
- package/package.json +11 -11
- package/src/modalManager.ts +4 -48
|
@@ -1,40 +1,7 @@
|
|
|
1
1
|
import { SafeEventEmitterProvider, WALLET_ADAPTER_TYPE } from "@web3auth/base";
|
|
2
2
|
import { Web3AuthCore, Web3AuthCoreOptions } from "@web3auth/core";
|
|
3
|
-
import { LoginModal } from "@web3auth/ui";
|
|
3
|
+
import { LoginModal, UIConfig } from "@web3auth/ui";
|
|
4
4
|
import { IWeb3AuthModal, ModalConfig } from "./interface";
|
|
5
|
-
export interface UIConfig {
|
|
6
|
-
/**
|
|
7
|
-
* App name to display in the UI.
|
|
8
|
-
*/
|
|
9
|
-
appName?: string;
|
|
10
|
-
/**
|
|
11
|
-
* Logo for your app.
|
|
12
|
-
*/
|
|
13
|
-
appLogo?: string;
|
|
14
|
-
/**
|
|
15
|
-
* theme for the modal
|
|
16
|
-
*
|
|
17
|
-
* @defaultValue `light`
|
|
18
|
-
*/
|
|
19
|
-
theme?: "light" | "dark";
|
|
20
|
-
/**
|
|
21
|
-
* order of how login methods are shown
|
|
22
|
-
*
|
|
23
|
-
* @defaultValue `["google", "facebook", "twitter", "reddit", "discord", "twitch", "apple", "line", "github", "kakao", "linkedin", "weibo", "wechat", "email_passwordless"]`
|
|
24
|
-
*/
|
|
25
|
-
loginMethodsOrder?: string[];
|
|
26
|
-
/**
|
|
27
|
-
* language which will be used by web3auth. app will use browser language if not specified. if language is not supported it will use "en"
|
|
28
|
-
* en: english
|
|
29
|
-
* de: german
|
|
30
|
-
* ja: japanese
|
|
31
|
-
* ko: korean
|
|
32
|
-
* zh: mandarin
|
|
33
|
-
* es: spanish
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
36
|
-
defaultLanguage?: string;
|
|
37
|
-
}
|
|
38
5
|
export interface Web3AuthOptions extends Web3AuthCoreOptions {
|
|
39
6
|
/**
|
|
40
7
|
* web3auth instance provides different adapters for different type of usages. If you are dapp and want to
|
|
@@ -48,13 +15,7 @@ export interface Web3AuthOptions extends Web3AuthCoreOptions {
|
|
|
48
15
|
/**
|
|
49
16
|
* Config for configuring modal ui display properties
|
|
50
17
|
*/
|
|
51
|
-
uiConfig?: UIConfig
|
|
52
|
-
/**
|
|
53
|
-
* Whether to show errors on Web3Auth modal.
|
|
54
|
-
*
|
|
55
|
-
* @defaultValue `true`
|
|
56
|
-
*/
|
|
57
|
-
displayErrorsOnModal?: boolean;
|
|
18
|
+
uiConfig?: Omit<UIConfig, "adapterListener">;
|
|
58
19
|
}
|
|
59
20
|
export declare class Web3Auth extends Web3AuthCore implements IWeb3AuthModal {
|
|
60
21
|
loginModal: LoginModal;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@web3auth/modal",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0-beta.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": "^4.
|
|
23
|
-
"@web3auth/core": "^4.
|
|
24
|
-
"@web3auth/metamask-adapter": "^4.
|
|
25
|
-
"@web3auth/openlogin-adapter": "^4.
|
|
26
|
-
"@web3auth/phantom-adapter": "^4.
|
|
27
|
-
"@web3auth/torus-evm-adapter": "^4.
|
|
28
|
-
"@web3auth/torus-solana-adapter": "^4.
|
|
29
|
-
"@web3auth/ui": "^4.
|
|
30
|
-
"@web3auth/wallet-connect-v1-adapter": "^4.
|
|
22
|
+
"@web3auth/base": "^4.5.0-beta.0",
|
|
23
|
+
"@web3auth/core": "^4.5.0-beta.0",
|
|
24
|
+
"@web3auth/metamask-adapter": "^4.5.0-beta.0",
|
|
25
|
+
"@web3auth/openlogin-adapter": "^4.5.0-beta.0",
|
|
26
|
+
"@web3auth/phantom-adapter": "^4.5.0-beta.0",
|
|
27
|
+
"@web3auth/torus-evm-adapter": "^4.5.0-beta.0",
|
|
28
|
+
"@web3auth/torus-solana-adapter": "^4.5.0-beta.0",
|
|
29
|
+
"@web3auth/ui": "^4.5.0-beta.0",
|
|
30
|
+
"@web3auth/wallet-connect-v1-adapter": "^4.5.0-beta.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@svgr/webpack": "^6.5.1",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "abc2bae449212019a2ab116a9fdc46f11b87646e"
|
|
67
67
|
}
|
package/src/modalManager.ts
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
WALLET_ADAPTERS,
|
|
13
13
|
} from "@web3auth/base";
|
|
14
14
|
import { Web3AuthCore, Web3AuthCoreOptions } from "@web3auth/core";
|
|
15
|
-
import { getAdapterSocialLogins, LOGIN_MODAL_EVENTS, LoginModal, OPENLOGIN_PROVIDERS } from "@web3auth/ui";
|
|
15
|
+
import { getAdapterSocialLogins, LOGIN_MODAL_EVENTS, LoginModal, OPENLOGIN_PROVIDERS, UIConfig } from "@web3auth/ui";
|
|
16
16
|
|
|
17
17
|
import {
|
|
18
18
|
defaultEvmDappModalConfig,
|
|
@@ -25,43 +25,6 @@ import { getDefaultAdapterModule } from "./default";
|
|
|
25
25
|
import { AdaptersModalConfig, IWeb3AuthModal, ModalConfig } from "./interface";
|
|
26
26
|
import { getUserLanguage } from "./utils";
|
|
27
27
|
|
|
28
|
-
export interface UIConfig {
|
|
29
|
-
/**
|
|
30
|
-
* App name to display in the UI.
|
|
31
|
-
*/
|
|
32
|
-
appName?: string;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Logo for your app.
|
|
36
|
-
*/
|
|
37
|
-
appLogo?: string;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* theme for the modal
|
|
41
|
-
*
|
|
42
|
-
* @defaultValue `light`
|
|
43
|
-
*/
|
|
44
|
-
theme?: "light" | "dark";
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* order of how login methods are shown
|
|
48
|
-
*
|
|
49
|
-
* @defaultValue `["google", "facebook", "twitter", "reddit", "discord", "twitch", "apple", "line", "github", "kakao", "linkedin", "weibo", "wechat", "email_passwordless"]`
|
|
50
|
-
*/
|
|
51
|
-
loginMethodsOrder?: string[];
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* language which will be used by web3auth. app will use browser language if not specified. if language is not supported it will use "en"
|
|
55
|
-
* en: english
|
|
56
|
-
* de: german
|
|
57
|
-
* ja: japanese
|
|
58
|
-
* ko: korean
|
|
59
|
-
* zh: mandarin
|
|
60
|
-
* es: spanish
|
|
61
|
-
*
|
|
62
|
-
*/
|
|
63
|
-
defaultLanguage?: string;
|
|
64
|
-
}
|
|
65
28
|
export interface Web3AuthOptions extends Web3AuthCoreOptions {
|
|
66
29
|
/**
|
|
67
30
|
* web3auth instance provides different adapters for different type of usages. If you are dapp and want to
|
|
@@ -75,14 +38,7 @@ export interface Web3AuthOptions extends Web3AuthCoreOptions {
|
|
|
75
38
|
/**
|
|
76
39
|
* Config for configuring modal ui display properties
|
|
77
40
|
*/
|
|
78
|
-
uiConfig?: UIConfig
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Whether to show errors on Web3Auth modal.
|
|
82
|
-
*
|
|
83
|
-
* @defaultValue `true`
|
|
84
|
-
*/
|
|
85
|
-
displayErrorsOnModal?: boolean;
|
|
41
|
+
uiConfig?: Omit<UIConfig, "adapterListener">;
|
|
86
42
|
}
|
|
87
43
|
export class Web3Auth extends Web3AuthCore implements IWeb3AuthModal {
|
|
88
44
|
public loginModal: LoginModal;
|
|
@@ -124,10 +80,10 @@ export class Web3Auth extends Web3AuthCore implements IWeb3AuthModal {
|
|
|
124
80
|
theme: this.options.uiConfig?.theme,
|
|
125
81
|
appName: this.options.uiConfig?.appName || "blockchain",
|
|
126
82
|
appLogo: this.options.uiConfig?.appLogo || "",
|
|
127
|
-
version: "",
|
|
128
83
|
adapterListener: this,
|
|
129
|
-
displayErrorsOnModal: this.options.displayErrorsOnModal,
|
|
84
|
+
displayErrorsOnModal: this.options.uiConfig?.displayErrorsOnModal,
|
|
130
85
|
defaultLanguage,
|
|
86
|
+
modalZIndex: this.options.uiConfig?.modalZIndex || "99998",
|
|
131
87
|
});
|
|
132
88
|
this.subscribeToLoginModalEvents();
|
|
133
89
|
}
|