@xyo-network/react-archivist 2.67.5 → 2.67.7
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/browser/components/Card/CardHeader.d.cts.map +1 -1
- package/dist/browser/components/Card/CardHeader.d.mts.map +1 -1
- package/dist/browser/components/Card/CardHeader.d.ts.map +1 -1
- package/dist/browser/components/Card/components/Stats/MemoryArchivistStats.d.cts.map +1 -1
- package/dist/browser/components/Card/components/Stats/MemoryArchivistStats.d.mts.map +1 -1
- package/dist/browser/components/Card/components/Stats/MemoryArchivistStats.d.ts.map +1 -1
- package/dist/browser/hooks/node/useArchivistsFromNode.d.cts.map +1 -1
- package/dist/browser/hooks/node/useArchivistsFromNode.d.mts.map +1 -1
- package/dist/browser/hooks/node/useArchivistsFromNode.d.ts.map +1 -1
- package/dist/browser/hooks/queries/useArchivistAll.d.cts +1 -1
- package/dist/browser/hooks/queries/useArchivistAll.d.cts.map +1 -1
- package/dist/browser/hooks/queries/useArchivistAll.d.mts +1 -1
- package/dist/browser/hooks/queries/useArchivistAll.d.mts.map +1 -1
- package/dist/browser/hooks/queries/useArchivistAll.d.ts +1 -1
- package/dist/browser/hooks/queries/useArchivistAll.d.ts.map +1 -1
- package/dist/browser/hooks/queries/useArchivistGet.d.cts +2 -2
- package/dist/browser/hooks/queries/useArchivistGet.d.cts.map +1 -1
- package/dist/browser/hooks/queries/useArchivistGet.d.mts +2 -2
- package/dist/browser/hooks/queries/useArchivistGet.d.mts.map +1 -1
- package/dist/browser/hooks/queries/useArchivistGet.d.ts +2 -2
- package/dist/browser/hooks/queries/useArchivistGet.d.ts.map +1 -1
- package/dist/browser/index.cjs +24 -21
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js +24 -21
- package/dist/browser/index.js.map +1 -1
- package/dist/node/components/Card/CardHeader.d.cts.map +1 -1
- package/dist/node/components/Card/CardHeader.d.mts.map +1 -1
- package/dist/node/components/Card/CardHeader.d.ts.map +1 -1
- package/dist/node/components/Card/components/Stats/MemoryArchivistStats.d.cts.map +1 -1
- package/dist/node/components/Card/components/Stats/MemoryArchivistStats.d.mts.map +1 -1
- package/dist/node/components/Card/components/Stats/MemoryArchivistStats.d.ts.map +1 -1
- package/dist/node/hooks/node/useArchivistsFromNode.d.cts.map +1 -1
- package/dist/node/hooks/node/useArchivistsFromNode.d.mts.map +1 -1
- package/dist/node/hooks/node/useArchivistsFromNode.d.ts.map +1 -1
- package/dist/node/hooks/queries/useArchivistAll.d.cts +1 -1
- package/dist/node/hooks/queries/useArchivistAll.d.cts.map +1 -1
- package/dist/node/hooks/queries/useArchivistAll.d.mts +1 -1
- package/dist/node/hooks/queries/useArchivistAll.d.mts.map +1 -1
- package/dist/node/hooks/queries/useArchivistAll.d.ts +1 -1
- package/dist/node/hooks/queries/useArchivistAll.d.ts.map +1 -1
- package/dist/node/hooks/queries/useArchivistGet.d.cts +2 -2
- package/dist/node/hooks/queries/useArchivistGet.d.cts.map +1 -1
- package/dist/node/hooks/queries/useArchivistGet.d.mts +2 -2
- package/dist/node/hooks/queries/useArchivistGet.d.mts.map +1 -1
- package/dist/node/hooks/queries/useArchivistGet.d.ts +2 -2
- package/dist/node/hooks/queries/useArchivistGet.d.ts.map +1 -1
- package/dist/node/index.cjs +24 -22
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +24 -22
- package/dist/node/index.js.map +1 -1
- package/package.json +18 -18
- package/src/components/Card/CardHeader.tsx +4 -2
- package/src/components/Card/components/Stats/ArchivistStats.tsx +2 -2
- package/src/components/Card/components/Stats/MemoryArchivistStats.tsx +7 -4
- package/src/hooks/node/useArchivistsFromNode.tsx +12 -13
package/package.json
CHANGED
|
@@ -13,15 +13,15 @@
|
|
|
13
13
|
"@xylabs/react-button": "^3.0.35",
|
|
14
14
|
"@xylabs/react-flexbox": "^3.0.35",
|
|
15
15
|
"@xylabs/react-promise": "^3.0.35",
|
|
16
|
-
"@xyo-network/archivist-model": "^2.
|
|
17
|
-
"@xyo-network/boundwitness-model": "^2.
|
|
18
|
-
"@xyo-network/boundwitness-wrapper": "^2.
|
|
19
|
-
"@xyo-network/module-events": "^2.
|
|
20
|
-
"@xyo-network/module-model": "^2.
|
|
21
|
-
"@xyo-network/module-wrapper": "^2.
|
|
22
|
-
"@xyo-network/react-module": "~2.67.
|
|
23
|
-
"@xyo-network/react-node": "~2.67.
|
|
24
|
-
"@xyo-network/react-wallet": "~2.67.
|
|
16
|
+
"@xyo-network/archivist-model": "^2.85.4",
|
|
17
|
+
"@xyo-network/boundwitness-model": "^2.85.4",
|
|
18
|
+
"@xyo-network/boundwitness-wrapper": "^2.85.4",
|
|
19
|
+
"@xyo-network/module-events": "^2.85.4",
|
|
20
|
+
"@xyo-network/module-model": "^2.85.4",
|
|
21
|
+
"@xyo-network/module-wrapper": "^2.85.4",
|
|
22
|
+
"@xyo-network/react-module": "~2.67.7",
|
|
23
|
+
"@xyo-network/react-node": "~2.67.7",
|
|
24
|
+
"@xyo-network/react-wallet": "~2.67.7",
|
|
25
25
|
"react-icons": "^4.12.0"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
},
|
|
34
34
|
"description": "Common React library for all XYO projects that use React",
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@storybook/react": "^7.6.
|
|
36
|
+
"@storybook/react": "^7.6.6",
|
|
37
37
|
"@xylabs/react-async-effect": "^3.0.35",
|
|
38
|
-
"@xylabs/ts-scripts-yarn3": "^3.2.
|
|
39
|
-
"@xylabs/tsconfig-react": "^3.2.
|
|
40
|
-
"@xyo-network/account": "^2.
|
|
41
|
-
"@xyo-network/archivist": "^2.
|
|
42
|
-
"@xyo-network/boundwitness-builder": "^2.
|
|
43
|
-
"@xyo-network/node-memory": "^2.
|
|
44
|
-
"@xyo-network/payload-model": "^2.
|
|
38
|
+
"@xylabs/ts-scripts-yarn3": "^3.2.25",
|
|
39
|
+
"@xylabs/tsconfig-react": "^3.2.25",
|
|
40
|
+
"@xyo-network/account": "^2.85.4",
|
|
41
|
+
"@xyo-network/archivist": "^2.85.4",
|
|
42
|
+
"@xyo-network/boundwitness-builder": "^2.85.4",
|
|
43
|
+
"@xyo-network/node-memory": "^2.85.4",
|
|
44
|
+
"@xyo-network/payload-model": "^2.85.4",
|
|
45
45
|
"typescript": "^5.3.3"
|
|
46
46
|
},
|
|
47
47
|
"docs": "dist/docs.json",
|
|
@@ -94,6 +94,6 @@
|
|
|
94
94
|
},
|
|
95
95
|
"sideEffects": false,
|
|
96
96
|
"types": "dist/browser/index.d.ts",
|
|
97
|
-
"version": "2.67.
|
|
97
|
+
"version": "2.67.7",
|
|
98
98
|
"type": "module"
|
|
99
99
|
}
|
|
@@ -7,10 +7,12 @@ import { MemoryArchivistsStats } from './components'
|
|
|
7
7
|
|
|
8
8
|
const ArchivistStats = (archivist?: ArchivistInstance) => {
|
|
9
9
|
switch (archivist?.config.schema) {
|
|
10
|
-
case MemoryArchivistConfigSchema:
|
|
10
|
+
case MemoryArchivistConfigSchema: {
|
|
11
11
|
return <MemoryArchivistsStats archivist={archivist} />
|
|
12
|
-
|
|
12
|
+
}
|
|
13
|
+
default: {
|
|
13
14
|
return <></>
|
|
15
|
+
}
|
|
14
16
|
}
|
|
15
17
|
}
|
|
16
18
|
|
|
@@ -30,14 +30,14 @@ export const ArchivistStats: React.FC<ArchivistStatsProps> = ({ addresses = {},
|
|
|
30
30
|
</Badge>
|
|
31
31
|
</Tooltip>
|
|
32
32
|
) : null}
|
|
33
|
-
{Object.entries(schemas).length ? (
|
|
33
|
+
{Object.entries(schemas).length > 0 ? (
|
|
34
34
|
<Tooltip title="Schemas">
|
|
35
35
|
<Badge badgeContent={Object.entries(schemas).length} color="primary">
|
|
36
36
|
<BsFileEarmarkCode size={20} />
|
|
37
37
|
</Badge>
|
|
38
38
|
</Tooltip>
|
|
39
39
|
) : null}
|
|
40
|
-
{Object.entries(addresses).length ? (
|
|
40
|
+
{Object.entries(addresses).length > 0 ? (
|
|
41
41
|
<Tooltip title="Addresses">
|
|
42
42
|
<Badge badgeContent={Object.entries(addresses).length} color="primary">
|
|
43
43
|
<VscOrganization size={20} />
|
|
@@ -35,7 +35,9 @@ export const MemoryArchivistsStats: React.FC<MemoryArchivistStatsProps> = ({ arc
|
|
|
35
35
|
listeners.push(clearListener)
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
return () =>
|
|
38
|
+
return () => {
|
|
39
|
+
for (const listener of listeners) listener?.()
|
|
40
|
+
}
|
|
39
41
|
}, [archivist, getAll])
|
|
40
42
|
|
|
41
43
|
useAsyncEffect(
|
|
@@ -57,9 +59,10 @@ export const MemoryArchivistsStats: React.FC<MemoryArchivistStatsProps> = ({ arc
|
|
|
57
59
|
all?.reduce(
|
|
58
60
|
(prev, payload) => {
|
|
59
61
|
const w = BoundWitnessWrapper.tryParse(payload) as BoundWitnessWrapper | undefined
|
|
60
|
-
w?.addresses
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
if (w?.addresses)
|
|
63
|
+
for (const address of w?.addresses ?? []) {
|
|
64
|
+
prev[address] = (prev[address] ?? 0) + 1
|
|
65
|
+
}
|
|
63
66
|
return prev
|
|
64
67
|
},
|
|
65
68
|
{} as Record<string, number>,
|
|
@@ -10,17 +10,16 @@ export const useArchivistsFromNode = (
|
|
|
10
10
|
if (error) {
|
|
11
11
|
return [null, error]
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
13
|
+
return modules
|
|
14
|
+
? [
|
|
15
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
16
|
+
modules.reduce<ArchivistInstance[]>((prev, module) => {
|
|
17
|
+
if (isArchivistInstance(module)) {
|
|
18
|
+
prev.push(module)
|
|
19
|
+
}
|
|
20
|
+
return prev
|
|
21
|
+
}, []),
|
|
22
|
+
undefined,
|
|
23
|
+
]
|
|
24
|
+
: [modules, error]
|
|
26
25
|
}
|