polkahub 0.2.2 → 0.3.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/AddressInput.js +2 -10
- package/dist/AddressInput.js.map +1 -1
- package/dist/src/index.d.ts +0 -1
- package/index.css +2 -0
- package/package.json +14 -14
package/dist/AddressInput.js
CHANGED
|
@@ -3,7 +3,7 @@ import { useAvailableAccounts, AddressIdentity } from '@polkahub/context';
|
|
|
3
3
|
import { AddressInput as AddressInput$1 } from '@polkahub/ui-components';
|
|
4
4
|
import { useMemo } from 'react';
|
|
5
5
|
|
|
6
|
-
const AddressInput = (
|
|
6
|
+
const AddressInput = (props) => {
|
|
7
7
|
const availableAccounts = useAvailableAccounts();
|
|
8
8
|
const hints = useMemo(() => {
|
|
9
9
|
const addressToAccounts = {};
|
|
@@ -22,19 +22,11 @@ const AddressInput = ({ maxAddrLength, ...props }) => {
|
|
|
22
22
|
AddressInput$1,
|
|
23
23
|
{
|
|
24
24
|
hinted: Object.values(hints).flat(),
|
|
25
|
-
renderAddress: (account) => typeof account === "string" ? /* @__PURE__ */ jsx(
|
|
26
|
-
AddressIdentity,
|
|
27
|
-
{
|
|
28
|
-
addr: account,
|
|
29
|
-
maxAddrLength,
|
|
30
|
-
copyable: false
|
|
31
|
-
}
|
|
32
|
-
) : /* @__PURE__ */ jsx(
|
|
25
|
+
renderAddress: (account) => typeof account === "string" ? /* @__PURE__ */ jsx(AddressIdentity, { addr: account, copyable: false }) : /* @__PURE__ */ jsx(
|
|
33
26
|
AddressIdentity,
|
|
34
27
|
{
|
|
35
28
|
addr: account.address,
|
|
36
29
|
name: account?.name,
|
|
37
|
-
maxAddrLength,
|
|
38
30
|
copyable: false
|
|
39
31
|
}
|
|
40
32
|
),
|
package/dist/AddressInput.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddressInput.js","sources":["../src/AddressInput.tsx"],"sourcesContent":["import { AddressIdentity, useAvailableAccounts } from \"@polkahub/context\";\nimport { Account, AccountAddress } from \"@polkahub/plugin\";\nimport { AddressInput as AddressInputComponent } from \"@polkahub/ui-components\";\nimport { FC, useMemo } from \"react\";\n\nexport const AddressInput: FC<{\n value?: AccountAddress | null;\n onChange?: (value: AccountAddress | null) => void;\n disableClear?: boolean;\n className?: string;\n triggerClassName?: string;\n
|
|
1
|
+
{"version":3,"file":"AddressInput.js","sources":["../src/AddressInput.tsx"],"sourcesContent":["import { AddressIdentity, useAvailableAccounts } from \"@polkahub/context\";\nimport { Account, AccountAddress } from \"@polkahub/plugin\";\nimport { AddressInput as AddressInputComponent } from \"@polkahub/ui-components\";\nimport { FC, useMemo } from \"react\";\n\nexport const AddressInput: FC<{\n value?: AccountAddress | null;\n onChange?: (value: AccountAddress | null) => void;\n disableClear?: boolean;\n className?: string;\n triggerClassName?: string;\n}> = (props) => {\n const availableAccounts = useAvailableAccounts();\n\n const hints = useMemo(() => {\n const addressToAccounts: Record<AccountAddress, Account[]> = {};\n Object.values(availableAccounts)\n .flat()\n .forEach((acc) => {\n addressToAccounts[acc.address] ??= [];\n addressToAccounts[acc.address].push(acc);\n });\n\n return Object.values(addressToAccounts).map((group) =>\n group.reduce((acc, v) =>\n (v.name?.length ?? 0) > (acc.name?.length ?? 0) ? v : acc\n )\n );\n }, [availableAccounts]);\n\n return (\n <AddressInputComponent\n hinted={Object.values(hints).flat()}\n renderAddress={(account: Account | string) =>\n typeof account === \"string\" ? (\n <AddressIdentity addr={account} copyable={false} />\n ) : (\n <AddressIdentity\n addr={account.address}\n name={account?.name}\n copyable={false}\n />\n )\n }\n {...props}\n />\n );\n};\n"],"names":["AddressInputComponent"],"mappings":";;;;;AAKO,MAAM,YAAA,GAMR,CAAC,KAAA,KAAU;AACd,EAAA,MAAM,oBAAoB,oBAAA,EAAqB;AAE/C,EAAA,MAAM,KAAA,GAAQ,QAAQ,MAAM;AAC1B,IAAA,MAAM,oBAAuD,EAAC;AAC9D,IAAA,MAAA,CAAO,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|
1
1
|
{
|
|
2
2
|
"name": "polkahub",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
@@ -26,19 +26,19 @@
|
|
|
26
26
|
"@react-rxjs/core": "^0.10.8",
|
|
27
27
|
"@react-rxjs/utils": "^0.9.7",
|
|
28
28
|
"lucide-react": "^0.552.0",
|
|
29
|
-
"@polkahub/
|
|
30
|
-
"@polkahub/
|
|
31
|
-
"@polkahub/
|
|
32
|
-
"@polkahub/
|
|
33
|
-
"@polkahub/
|
|
34
|
-
"@polkahub/
|
|
35
|
-
"@polkahub/
|
|
36
|
-
"@polkahub/
|
|
37
|
-
"@polkahub/
|
|
38
|
-
"@polkahub/
|
|
39
|
-
"@polkahub/
|
|
40
|
-
"@polkahub/
|
|
41
|
-
"@polkahub/
|
|
29
|
+
"@polkahub/context": "0.3.0",
|
|
30
|
+
"@polkahub/pjs-wallet": "0.3.0",
|
|
31
|
+
"@polkahub/read-only": "0.3.0",
|
|
32
|
+
"@polkahub/ledger": "0.3.0",
|
|
33
|
+
"@polkahub/proxy": "0.3.0",
|
|
34
|
+
"@polkahub/vault": "0.3.0",
|
|
35
|
+
"@polkahub/mimir": "0.3.0",
|
|
36
|
+
"@polkahub/multisig": "0.3.0",
|
|
37
|
+
"@polkahub/select-account": "0.3.0",
|
|
38
|
+
"@polkahub/ui-components": "0.3.0",
|
|
39
|
+
"@polkahub/wallet-connect": "0.3.0",
|
|
40
|
+
"@polkahub/plugin": "0.3.0",
|
|
41
|
+
"@polkahub/state": "0.3.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@types/react": "^19.2.2",
|