@web3auth/modal 10.1.0 → 10.2.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 +1 -1
- package/dist/lib.cjs/packages/modal/src/modalManager.js +9 -2
- package/dist/lib.cjs/types/modalManager.d.ts +10 -1
- package/dist/lib.cjs/types/react/wagmi/constants.d.ts +1 -0
- package/dist/lib.cjs/types/vue/wagmi/constants.d.ts +1 -0
- package/dist/lib.esm/packages/modal/src/config.js +1 -1
- package/dist/lib.esm/packages/modal/src/modalManager.js +9 -2
- package/dist/modal.umd.min.js +1 -1
- package/package.json +19 -19
|
@@ -81,7 +81,10 @@ class Web3Auth extends noModal.Web3AuthNoModal {
|
|
|
81
81
|
return [...new Set(((_this$coreOptions$cha = this.coreOptions.chains) === null || _this$coreOptions$cha === void 0 ? void 0 : _this$coreOptions$cha.map(x => x.chainNamespace)) || [])];
|
|
82
82
|
});
|
|
83
83
|
this.options = _objectSpread({}, options);
|
|
84
|
-
if (!this.options.uiConfig) this.options.uiConfig = {
|
|
84
|
+
if (!this.options.uiConfig) this.options.uiConfig = {
|
|
85
|
+
logoLight: "",
|
|
86
|
+
logoDark: ""
|
|
87
|
+
};
|
|
85
88
|
if (this.options.modalConfig) this.modalConfig = this.options.modalConfig;
|
|
86
89
|
noModal.log.info("modalConfig", this.modalConfig);
|
|
87
90
|
}
|
|
@@ -224,9 +227,13 @@ class Web3Auth extends noModal.Web3AuthNoModal {
|
|
|
224
227
|
this.options.uiConfig = deepmerge(noModal.cloneDeep(projectConfig.whitelabel || {}), this.options.uiConfig || {});
|
|
225
228
|
if (!this.options.uiConfig.defaultLanguage) this.options.uiConfig.defaultLanguage = utils.getUserLanguage(this.options.uiConfig.defaultLanguage);
|
|
226
229
|
if (!this.options.uiConfig.mode) this.options.uiConfig.mode = "light";
|
|
227
|
-
|
|
230
|
+
const uiConfig = deepmerge.all([projectConfig.loginModal || {}, this.options.uiConfig], {
|
|
228
231
|
arrayMerge: (_, sourceArray) => sourceArray
|
|
229
232
|
});
|
|
233
|
+
this.options.uiConfig = _objectSpread(_objectSpread({}, uiConfig), {}, {
|
|
234
|
+
logoLight: uiConfig.logoLight || "",
|
|
235
|
+
logoDark: uiConfig.logoDark || ""
|
|
236
|
+
});
|
|
230
237
|
// merge login methods order from project config and user config, with user config taking precedence
|
|
231
238
|
const defaultAuthConnections = projectConfig.embeddedWalletAuth.filter(x => x.isDefault).map(x => x.authConnection);
|
|
232
239
|
const mergedAuthConnections = [...(this.options.uiConfig.loginMethodsOrder || []), ...defaultAuthConnections];
|
|
@@ -5,7 +5,16 @@ export interface Web3AuthOptions extends IWeb3AuthCoreOptions {
|
|
|
5
5
|
/**
|
|
6
6
|
* Config for configuring modal ui display properties
|
|
7
7
|
*/
|
|
8
|
-
uiConfig
|
|
8
|
+
uiConfig: Omit<UIConfig, "connectorListener" | "logoLight" | "logoDark"> & {
|
|
9
|
+
/**
|
|
10
|
+
* App logo to use in light mode
|
|
11
|
+
*/
|
|
12
|
+
logoLight: string;
|
|
13
|
+
/**
|
|
14
|
+
* App logo to use in dark mode
|
|
15
|
+
*/
|
|
16
|
+
logoDark: string;
|
|
17
|
+
};
|
|
9
18
|
/**
|
|
10
19
|
* Config for configuring modal ui display properties
|
|
11
20
|
*/
|
|
@@ -28,6 +28,7 @@ export declare const defaultWagmiConfig: import("wagmi").Config<readonly [{
|
|
|
28
28
|
readonly symbol: "ETH";
|
|
29
29
|
readonly decimals: 18;
|
|
30
30
|
};
|
|
31
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
31
32
|
rpcUrls: {
|
|
32
33
|
readonly default: {
|
|
33
34
|
readonly http: readonly ["https://eth.merkle.io"];
|
|
@@ -28,6 +28,7 @@ export declare const defaultWagmiConfig: import("wagmi").Config<readonly [{
|
|
|
28
28
|
readonly symbol: "ETH";
|
|
29
29
|
readonly decimals: 18;
|
|
30
30
|
};
|
|
31
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
31
32
|
rpcUrls: {
|
|
32
33
|
readonly default: {
|
|
33
34
|
readonly http: readonly ["https://eth.merkle.io"];
|
|
@@ -81,7 +81,10 @@ class Web3Auth extends Web3AuthNoModal {
|
|
|
81
81
|
return [...new Set(((_this$coreOptions$cha = this.coreOptions.chains) === null || _this$coreOptions$cha === void 0 ? void 0 : _this$coreOptions$cha.map(x => x.chainNamespace)) || [])];
|
|
82
82
|
});
|
|
83
83
|
this.options = _objectSpread({}, options);
|
|
84
|
-
if (!this.options.uiConfig) this.options.uiConfig = {
|
|
84
|
+
if (!this.options.uiConfig) this.options.uiConfig = {
|
|
85
|
+
logoLight: "",
|
|
86
|
+
logoDark: ""
|
|
87
|
+
};
|
|
85
88
|
if (this.options.modalConfig) this.modalConfig = this.options.modalConfig;
|
|
86
89
|
log.info("modalConfig", this.modalConfig);
|
|
87
90
|
}
|
|
@@ -231,9 +234,13 @@ class Web3Auth extends Web3AuthNoModal {
|
|
|
231
234
|
this.options.uiConfig = deepmerge(cloneDeep(projectConfig.whitelabel || {}), this.options.uiConfig || {});
|
|
232
235
|
if (!this.options.uiConfig.defaultLanguage) this.options.uiConfig.defaultLanguage = getUserLanguage(this.options.uiConfig.defaultLanguage);
|
|
233
236
|
if (!this.options.uiConfig.mode) this.options.uiConfig.mode = "light";
|
|
234
|
-
|
|
237
|
+
const uiConfig = deepmerge.all([projectConfig.loginModal || {}, this.options.uiConfig], {
|
|
235
238
|
arrayMerge: (_, sourceArray) => sourceArray
|
|
236
239
|
});
|
|
240
|
+
this.options.uiConfig = _objectSpread(_objectSpread({}, uiConfig), {}, {
|
|
241
|
+
logoLight: uiConfig.logoLight || "",
|
|
242
|
+
logoDark: uiConfig.logoDark || ""
|
|
243
|
+
});
|
|
237
244
|
|
|
238
245
|
// merge login methods order from project config and user config, with user config taking precedence
|
|
239
246
|
const defaultAuthConnections = projectConfig.embeddedWalletAuth.filter(x => x.isDefault).map(x => x.authConnection);
|