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.
@@ -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 = ({ maxAddrLength, ...props }) => {
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
  ),
@@ -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 maxAddrLength?: number;\n}> = ({ maxAddrLength, ...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\n addr={account}\n maxAddrLength={maxAddrLength}\n copyable={false}\n />\n ) : (\n <AddressIdentity\n addr={account.address}\n name={account?.name}\n maxAddrLength={maxAddrLength}\n copyable={false}\n />\n )\n }\n {...props}\n />\n );\n};\n"],"names":["AddressInputComponent"],"mappings":";;;;;AAKO,MAAM,eAOR,CAAC,EAAE,aAAA,EAAe,GAAG,OAAM,KAAM;AACpC,EAAA,MAAM,oBAAoB,oBAAA,EAAqB;AAE/C,EAAA,MAAM,KAAA,GAAQ,QAAQ,MAAM;AAC1B,IAAA,MAAM,oBAAuD,EAAC;AAC9D,IAAA,MAAA,CAAO,OAAO,iBAAiB,CAAA,CAC5B,MAAK,CACL,OAAA,CAAQ,CAAC,GAAA,KAAQ;AAnBxB,MAAA,IAAA,EAAA;AAoBQ,MAAA,iBAAA,CAAA,EAAA,GAAkB,GAAA,CAAI,OAAA,CAAA,KAAtB,iBAAA,CAAA,EAAA,CAAA,GAAmC,EAAC,CAAA;AACpC,MAAA,iBAAA,CAAkB,GAAA,CAAI,OAAO,CAAA,CAAE,IAAA,CAAK,GAAG,CAAA;AAAA,IACzC,CAAC,CAAA;AAEH,IAAA,OAAO,MAAA,CAAO,MAAA,CAAO,iBAAiB,CAAA,CAAE,GAAA;AAAA,MAAI,CAAC,UAC3C,KAAA,CAAM,MAAA;AAAA,QAAO,CAAC,GAAA,EAAK,CAAA,KAAA,CAChB,CAAA,CAAE,IAAA,EAAM,MAAA,IAAU,CAAA,KAAM,GAAA,CAAI,IAAA,EAAM,MAAA,IAAU,CAAA,CAAA,GAAK,CAAA,GAAI;AAAA;AACxD,KACF;AAAA,EACF,CAAA,EAAG,CAAC,iBAAiB,CAAC,CAAA;AAEtB,EAAA,uBACE,GAAA;AAAA,IAACA,cAAA;AAAA,IAAA;AAAA,MACC,MAAA,EAAQ,MAAA,CAAO,MAAA,CAAO,KAAK,EAAE,IAAA,EAAK;AAAA,MAClC,aAAA,EAAe,CAAC,OAAA,KACd,OAAO,YAAY,QAAA,mBACjB,GAAA;AAAA,QAAC,eAAA;AAAA,QAAA;AAAA,UACC,IAAA,EAAM,OAAA;AAAA,UACN,aAAA;AAAA,UACA,QAAA,EAAU;AAAA;AAAA,OACZ,mBAEA,GAAA;AAAA,QAAC,eAAA;AAAA,QAAA;AAAA,UACC,MAAM,OAAA,CAAQ,OAAA;AAAA,UACd,MAAM,OAAA,EAAS,IAAA;AAAA,UACf,aAAA;AAAA,UACA,QAAA,EAAU;AAAA;AAAA,OACZ;AAAA,MAGH,GAAG;AAAA;AAAA,GACN;AAEJ;;;;"}
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,OAAO,iBAAiB,CAAA,CAC5B,MAAK,CACL,OAAA,CAAQ,CAAC,GAAA,KAAQ;AAlBxB,MAAA,IAAA,EAAA;AAmBQ,MAAA,iBAAA,CAAA,EAAA,GAAkB,GAAA,CAAI,OAAA,CAAA,KAAtB,iBAAA,CAAA,EAAA,CAAA,GAAmC,EAAC,CAAA;AACpC,MAAA,iBAAA,CAAkB,GAAA,CAAI,OAAO,CAAA,CAAE,IAAA,CAAK,GAAG,CAAA;AAAA,IACzC,CAAC,CAAA;AAEH,IAAA,OAAO,MAAA,CAAO,MAAA,CAAO,iBAAiB,CAAA,CAAE,GAAA;AAAA,MAAI,CAAC,UAC3C,KAAA,CAAM,MAAA;AAAA,QAAO,CAAC,GAAA,EAAK,CAAA,KAAA,CAChB,CAAA,CAAE,IAAA,EAAM,MAAA,IAAU,CAAA,KAAM,GAAA,CAAI,IAAA,EAAM,MAAA,IAAU,CAAA,CAAA,GAAK,CAAA,GAAI;AAAA;AACxD,KACF;AAAA,EACF,CAAA,EAAG,CAAC,iBAAiB,CAAC,CAAA;AAEtB,EAAA,uBACE,GAAA;AAAA,IAACA,cAAA;AAAA,IAAA;AAAA,MACC,MAAA,EAAQ,MAAA,CAAO,MAAA,CAAO,KAAK,EAAE,IAAA,EAAK;AAAA,MAClC,aAAA,EAAe,CAAC,OAAA,KACd,OAAO,OAAA,KAAY,QAAA,mBACjB,GAAA,CAAC,eAAA,EAAA,EAAgB,IAAA,EAAM,OAAA,EAAS,QAAA,EAAU,KAAA,EAAO,CAAA,mBAEjD,GAAA;AAAA,QAAC,eAAA;AAAA,QAAA;AAAA,UACC,MAAM,OAAA,CAAQ,OAAA;AAAA,UACd,MAAM,OAAA,EAAS,IAAA;AAAA,UACf,QAAA,EAAU;AAAA;AAAA,OACZ;AAAA,MAGH,GAAG;AAAA;AAAA,GACN;AAEJ;;;;"}
@@ -41,7 +41,6 @@ declare const AddressInput: FC<{
41
41
  disableClear?: boolean;
42
42
  className?: string;
43
43
  triggerClassName?: string;
44
- maxAddrLength?: number;
45
44
  }>;
46
45
 
47
46
  export { AddressInput, PolkaHubModal, PolkaHubModalTrigger, openSelectAccount, usePolkaHubModalState };
package/index.css CHANGED
@@ -4,4 +4,6 @@
4
4
  @import "@polkahub/select-account";
5
5
  @import "@polkahub/ui-components";
6
6
  @import "@polkahub/vault";
7
+ @import "@polkahub/proxy";
8
+ @import "@polkahub/multisig";
7
9
  @source "./dist";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polkahub",
3
- "version": "0.2.2",
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/mimir": "0.2.2",
30
- "@polkahub/ledger": "0.2.2",
31
- "@polkahub/multisig": "0.2.2",
32
- "@polkahub/context": "0.2.2",
33
- "@polkahub/plugin": "0.2.2",
34
- "@polkahub/pjs-wallet": "0.2.2",
35
- "@polkahub/proxy": "0.2.2",
36
- "@polkahub/read-only": "0.2.2",
37
- "@polkahub/state": "0.2.2",
38
- "@polkahub/select-account": "0.2.2",
39
- "@polkahub/vault": "0.2.2",
40
- "@polkahub/ui-components": "0.2.2",
41
- "@polkahub/wallet-connect": "0.2.2"
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",