@onekeyfe/inpage-providers-hub 2.1.21 → 2.1.22
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/cjs/connectButtonHack/universal/config.js +294 -81
- package/dist/cjs/connectButtonHack/universal/findIconAndName.js +6 -6
- package/dist/cjs/connectButtonHack/universal/imgUtils.js +6 -6
- package/dist/cjs/connectButtonHack/universal/index.js +9 -3
- package/dist/connectButtonHack/universal/config.d.ts +1 -1
- package/dist/connectButtonHack/universal/config.js +295 -82
- package/dist/connectButtonHack/universal/findIconAndName.d.ts +1 -1
- package/dist/connectButtonHack/universal/findIconAndName.js +6 -6
- package/dist/connectButtonHack/universal/imgUtils.js +6 -6
- package/dist/connectButtonHack/universal/index.js +9 -3
- package/dist/connectButtonHack/universal/type.d.ts +1 -1
- package/package.json +22 -22
|
@@ -54,15 +54,15 @@ export function findWalletIconByParent(parent, constraints) {
|
|
|
54
54
|
universalLog.warn(`no icon node found for parent`, parent);
|
|
55
55
|
return null;
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
const filteredIconNodes = iconNodes.filter((icon) => constraints.every((f) => f(icon)));
|
|
58
|
+
if (filteredIconNodes.length === 0) {
|
|
59
|
+
throw new Error('it doesnt satisfy the constraints');
|
|
60
|
+
}
|
|
61
|
+
if (filteredIconNodes.length > 1) {
|
|
58
62
|
universalLog.warn(`more than one icon node found`, iconNodes.length, iconNodes);
|
|
59
63
|
throw new Error('more than one icon node found');
|
|
60
64
|
}
|
|
61
|
-
|
|
62
|
-
if (constraints.some((f) => !f(icon))) {
|
|
63
|
-
throw new Error('it doesnt satisfy the constraints');
|
|
64
|
-
}
|
|
65
|
-
return icon;
|
|
65
|
+
return filteredIconNodes[0];
|
|
66
66
|
}
|
|
67
67
|
//NOTE: use function isWalletIconLessEqualThan with lazy loading image
|
|
68
68
|
export function isWalletIconSizeMatch(walletIcon, min = ICON_MIN_SIZE, max = ICON_MAX_SIZE) {
|
|
@@ -54,10 +54,16 @@ function hackWalletConnectButton(sites) {
|
|
|
54
54
|
continue;
|
|
55
55
|
}
|
|
56
56
|
const { textNode, iconNode } = result;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
let newText = null;
|
|
58
|
+
let newIconElement = null;
|
|
59
|
+
if (textNode) {
|
|
60
|
+
newText = updateName(textNode, updatedName);
|
|
61
|
+
}
|
|
62
|
+
if (iconNode) {
|
|
63
|
+
newIconElement = updateIcon(iconNode, updatedIcon);
|
|
60
64
|
walletId.updateFlag(newIconElement);
|
|
65
|
+
}
|
|
66
|
+
if (newText || newIconElement) {
|
|
61
67
|
afterUpdate === null || afterUpdate === void 0 ? void 0 : afterUpdate(newText, newIconElement);
|
|
62
68
|
}
|
|
63
69
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/inpage-providers-hub",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.22",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"cross-inpage-provider"
|
|
6
6
|
],
|
|
@@ -30,26 +30,26 @@
|
|
|
30
30
|
"start": "tsc --watch"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@onekeyfe/cross-inpage-provider-core": "2.1.
|
|
34
|
-
"@onekeyfe/cross-inpage-provider-types": "2.1.
|
|
35
|
-
"@onekeyfe/onekey-algo-provider": "2.1.
|
|
36
|
-
"@onekeyfe/onekey-alph-provider": "2.1.
|
|
37
|
-
"@onekeyfe/onekey-aptos-provider": "2.1.
|
|
38
|
-
"@onekeyfe/onekey-bfc-provider": "2.1.
|
|
39
|
-
"@onekeyfe/onekey-btc-provider": "2.1.
|
|
40
|
-
"@onekeyfe/onekey-cardano-provider": "2.1.
|
|
41
|
-
"@onekeyfe/onekey-conflux-provider": "2.1.
|
|
42
|
-
"@onekeyfe/onekey-cosmos-provider": "2.1.
|
|
43
|
-
"@onekeyfe/onekey-eth-provider": "2.1.
|
|
44
|
-
"@onekeyfe/onekey-nostr-provider": "2.1.
|
|
45
|
-
"@onekeyfe/onekey-polkadot-provider": "2.1.
|
|
46
|
-
"@onekeyfe/onekey-private-provider": "2.1.
|
|
47
|
-
"@onekeyfe/onekey-scdo-provider": "2.1.
|
|
48
|
-
"@onekeyfe/onekey-solana-provider": "2.1.
|
|
49
|
-
"@onekeyfe/onekey-sui-provider": "2.1.
|
|
50
|
-
"@onekeyfe/onekey-ton-provider": "2.1.
|
|
51
|
-
"@onekeyfe/onekey-tron-provider": "2.1.
|
|
52
|
-
"@onekeyfe/onekey-webln-provider": "2.1.
|
|
33
|
+
"@onekeyfe/cross-inpage-provider-core": "2.1.22",
|
|
34
|
+
"@onekeyfe/cross-inpage-provider-types": "2.1.22",
|
|
35
|
+
"@onekeyfe/onekey-algo-provider": "2.1.22",
|
|
36
|
+
"@onekeyfe/onekey-alph-provider": "2.1.22",
|
|
37
|
+
"@onekeyfe/onekey-aptos-provider": "2.1.22",
|
|
38
|
+
"@onekeyfe/onekey-bfc-provider": "2.1.22",
|
|
39
|
+
"@onekeyfe/onekey-btc-provider": "2.1.22",
|
|
40
|
+
"@onekeyfe/onekey-cardano-provider": "2.1.22",
|
|
41
|
+
"@onekeyfe/onekey-conflux-provider": "2.1.22",
|
|
42
|
+
"@onekeyfe/onekey-cosmos-provider": "2.1.22",
|
|
43
|
+
"@onekeyfe/onekey-eth-provider": "2.1.22",
|
|
44
|
+
"@onekeyfe/onekey-nostr-provider": "2.1.22",
|
|
45
|
+
"@onekeyfe/onekey-polkadot-provider": "2.1.22",
|
|
46
|
+
"@onekeyfe/onekey-private-provider": "2.1.22",
|
|
47
|
+
"@onekeyfe/onekey-scdo-provider": "2.1.22",
|
|
48
|
+
"@onekeyfe/onekey-solana-provider": "2.1.22",
|
|
49
|
+
"@onekeyfe/onekey-sui-provider": "2.1.22",
|
|
50
|
+
"@onekeyfe/onekey-ton-provider": "2.1.22",
|
|
51
|
+
"@onekeyfe/onekey-tron-provider": "2.1.22",
|
|
52
|
+
"@onekeyfe/onekey-webln-provider": "2.1.22",
|
|
53
53
|
"web3": "^1.7.3"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"@types/node": "^20.12.7",
|
|
58
58
|
"playwright": "^1.43.1"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "b3d85c2d0ce4425abbedc33119e0b7dafe8d3872"
|
|
61
61
|
}
|