@xyo-network/react-archivist 2.75.7 → 2.76.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/browser/index.cjs +21 -21
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js +21 -21
- package/dist/browser/index.js.map +1 -1
- package/dist/neutral/components/Card/Card.d.cts +6 -0
- package/dist/neutral/components/Card/Card.d.cts.map +1 -0
- package/dist/neutral/components/Card/Card.d.mts +6 -0
- package/dist/neutral/components/Card/Card.d.mts.map +1 -0
- package/dist/neutral/components/Card/Card.d.ts +6 -0
- package/dist/neutral/components/Card/Card.d.ts.map +1 -0
- package/dist/neutral/components/Card/CardActions.d.cts +6 -0
- package/dist/neutral/components/Card/CardActions.d.cts.map +1 -0
- package/dist/neutral/components/Card/CardActions.d.mts +6 -0
- package/dist/neutral/components/Card/CardActions.d.mts.map +1 -0
- package/dist/neutral/components/Card/CardActions.d.ts +6 -0
- package/dist/neutral/components/Card/CardActions.d.ts.map +1 -0
- package/dist/neutral/components/Card/CardContent.d.cts +6 -0
- package/dist/neutral/components/Card/CardContent.d.cts.map +1 -0
- package/dist/neutral/components/Card/CardContent.d.mts +6 -0
- package/dist/neutral/components/Card/CardContent.d.mts.map +1 -0
- package/dist/neutral/components/Card/CardContent.d.ts +6 -0
- package/dist/neutral/components/Card/CardContent.d.ts.map +1 -0
- package/dist/neutral/components/Card/CardHeader.d.cts +6 -0
- package/dist/neutral/components/Card/CardHeader.d.cts.map +1 -0
- package/dist/neutral/components/Card/CardHeader.d.mts +6 -0
- package/dist/neutral/components/Card/CardHeader.d.mts.map +1 -0
- package/dist/neutral/components/Card/CardHeader.d.ts +6 -0
- package/dist/neutral/components/Card/CardHeader.d.ts.map +1 -0
- package/dist/neutral/components/Card/components/ArchivistParent.d.cts +7 -0
- package/dist/neutral/components/Card/components/ArchivistParent.d.cts.map +1 -0
- package/dist/neutral/components/Card/components/ArchivistParent.d.mts +7 -0
- package/dist/neutral/components/Card/components/ArchivistParent.d.mts.map +1 -0
- package/dist/neutral/components/Card/components/ArchivistParent.d.ts +7 -0
- package/dist/neutral/components/Card/components/ArchivistParent.d.ts.map +1 -0
- package/dist/neutral/components/Card/components/ArchivistParents.d.cts +8 -0
- package/dist/neutral/components/Card/components/ArchivistParents.d.cts.map +1 -0
- package/dist/neutral/components/Card/components/ArchivistParents.d.mts +8 -0
- package/dist/neutral/components/Card/components/ArchivistParents.d.mts.map +1 -0
- package/dist/neutral/components/Card/components/ArchivistParents.d.ts +8 -0
- package/dist/neutral/components/Card/components/ArchivistParents.d.ts.map +1 -0
- package/dist/neutral/components/Card/components/Stats/ArchivistStats.d.cts +10 -0
- package/dist/neutral/components/Card/components/Stats/ArchivistStats.d.cts.map +1 -0
- package/dist/neutral/components/Card/components/Stats/ArchivistStats.d.mts +10 -0
- package/dist/neutral/components/Card/components/Stats/ArchivistStats.d.mts.map +1 -0
- package/dist/neutral/components/Card/components/Stats/ArchivistStats.d.ts +10 -0
- package/dist/neutral/components/Card/components/Stats/ArchivistStats.d.ts.map +1 -0
- package/dist/neutral/components/Card/components/Stats/MemoryArchivistStats.d.cts +7 -0
- package/dist/neutral/components/Card/components/Stats/MemoryArchivistStats.d.cts.map +1 -0
- package/dist/neutral/components/Card/components/Stats/MemoryArchivistStats.d.mts +7 -0
- package/dist/neutral/components/Card/components/Stats/MemoryArchivistStats.d.mts.map +1 -0
- package/dist/neutral/components/Card/components/Stats/MemoryArchivistStats.d.ts +7 -0
- package/dist/neutral/components/Card/components/Stats/MemoryArchivistStats.d.ts.map +1 -0
- package/dist/neutral/components/Card/components/Stats/index.d.cts +3 -0
- package/dist/neutral/components/Card/components/Stats/index.d.cts.map +1 -0
- package/dist/neutral/components/Card/components/Stats/index.d.mts +3 -0
- package/dist/neutral/components/Card/components/Stats/index.d.mts.map +1 -0
- package/dist/neutral/components/Card/components/Stats/index.d.ts +3 -0
- package/dist/neutral/components/Card/components/Stats/index.d.ts.map +1 -0
- package/dist/neutral/components/Card/components/index.d.cts +4 -0
- package/dist/neutral/components/Card/components/index.d.cts.map +1 -0
- package/dist/neutral/components/Card/components/index.d.mts +4 -0
- package/dist/neutral/components/Card/components/index.d.mts.map +1 -0
- package/dist/neutral/components/Card/components/index.d.ts +4 -0
- package/dist/neutral/components/Card/components/index.d.ts.map +1 -0
- package/dist/neutral/components/Card/index.d.cts +4 -0
- package/dist/neutral/components/Card/index.d.cts.map +1 -0
- package/dist/neutral/components/Card/index.d.mts +4 -0
- package/dist/neutral/components/Card/index.d.mts.map +1 -0
- package/dist/neutral/components/Card/index.d.ts +4 -0
- package/dist/neutral/components/Card/index.d.ts.map +1 -0
- package/dist/neutral/components/Details/Details.d.cts +7 -0
- package/dist/neutral/components/Details/Details.d.cts.map +1 -0
- package/dist/neutral/components/Details/Details.d.mts +7 -0
- package/dist/neutral/components/Details/Details.d.mts.map +1 -0
- package/dist/neutral/components/Details/Details.d.ts +7 -0
- package/dist/neutral/components/Details/Details.d.ts.map +1 -0
- package/dist/neutral/components/Details/index.d.cts +2 -0
- package/dist/neutral/components/Details/index.d.cts.map +1 -0
- package/dist/neutral/components/Details/index.d.mts +2 -0
- package/dist/neutral/components/Details/index.d.mts.map +1 -0
- package/dist/neutral/components/Details/index.d.ts +2 -0
- package/dist/neutral/components/Details/index.d.ts.map +1 -0
- package/dist/neutral/components/index.d.cts +3 -0
- package/dist/neutral/components/index.d.cts.map +1 -0
- package/dist/neutral/components/index.d.mts +3 -0
- package/dist/neutral/components/index.d.mts.map +1 -0
- package/dist/neutral/components/index.d.ts +3 -0
- package/dist/neutral/components/index.d.ts.map +1 -0
- package/dist/neutral/hooks/index.d.cts +3 -0
- package/dist/neutral/hooks/index.d.cts.map +1 -0
- package/dist/neutral/hooks/index.d.mts +3 -0
- package/dist/neutral/hooks/index.d.mts.map +1 -0
- package/dist/neutral/hooks/index.d.ts +3 -0
- package/dist/neutral/hooks/index.d.ts.map +1 -0
- package/dist/neutral/hooks/node/index.d.cts +5 -0
- package/dist/neutral/hooks/node/index.d.cts.map +1 -0
- package/dist/neutral/hooks/node/index.d.mts +5 -0
- package/dist/neutral/hooks/node/index.d.mts.map +1 -0
- package/dist/neutral/hooks/node/index.d.ts +5 -0
- package/dist/neutral/hooks/node/index.d.ts.map +1 -0
- package/dist/neutral/hooks/node/useArchivistFromNode.d.cts +5 -0
- package/dist/neutral/hooks/node/useArchivistFromNode.d.cts.map +1 -0
- package/dist/neutral/hooks/node/useArchivistFromNode.d.mts +5 -0
- package/dist/neutral/hooks/node/useArchivistFromNode.d.mts.map +1 -0
- package/dist/neutral/hooks/node/useArchivistFromNode.d.ts +5 -0
- package/dist/neutral/hooks/node/useArchivistFromNode.d.ts.map +1 -0
- package/dist/neutral/hooks/node/useArchivistsFromNode.d.cts +6 -0
- package/dist/neutral/hooks/node/useArchivistsFromNode.d.cts.map +1 -0
- package/dist/neutral/hooks/node/useArchivistsFromNode.d.mts +6 -0
- package/dist/neutral/hooks/node/useArchivistsFromNode.d.mts.map +1 -0
- package/dist/neutral/hooks/node/useArchivistsFromNode.d.ts +6 -0
- package/dist/neutral/hooks/node/useArchivistsFromNode.d.ts.map +1 -0
- package/dist/neutral/hooks/node/useWeakArchivistFromNode.d.cts +4 -0
- package/dist/neutral/hooks/node/useWeakArchivistFromNode.d.cts.map +1 -0
- package/dist/neutral/hooks/node/useWeakArchivistFromNode.d.mts +4 -0
- package/dist/neutral/hooks/node/useWeakArchivistFromNode.d.mts.map +1 -0
- package/dist/neutral/hooks/node/useWeakArchivistFromNode.d.ts +4 -0
- package/dist/neutral/hooks/node/useWeakArchivistFromNode.d.ts.map +1 -0
- package/dist/neutral/hooks/node/useWeakArchivistsFromNode.d.cts +5 -0
- package/dist/neutral/hooks/node/useWeakArchivistsFromNode.d.cts.map +1 -0
- package/dist/neutral/hooks/node/useWeakArchivistsFromNode.d.mts +5 -0
- package/dist/neutral/hooks/node/useWeakArchivistsFromNode.d.mts.map +1 -0
- package/dist/neutral/hooks/node/useWeakArchivistsFromNode.d.ts +5 -0
- package/dist/neutral/hooks/node/useWeakArchivistsFromNode.d.ts.map +1 -0
- package/dist/neutral/hooks/queries/index.d.cts +5 -0
- package/dist/neutral/hooks/queries/index.d.cts.map +1 -0
- package/dist/neutral/hooks/queries/index.d.mts +5 -0
- package/dist/neutral/hooks/queries/index.d.mts.map +1 -0
- package/dist/neutral/hooks/queries/index.d.ts +5 -0
- package/dist/neutral/hooks/queries/index.d.ts.map +1 -0
- package/dist/neutral/hooks/queries/useArchivistAll.d.cts +5 -0
- package/dist/neutral/hooks/queries/useArchivistAll.d.cts.map +1 -0
- package/dist/neutral/hooks/queries/useArchivistAll.d.mts +5 -0
- package/dist/neutral/hooks/queries/useArchivistAll.d.mts.map +1 -0
- package/dist/neutral/hooks/queries/useArchivistAll.d.ts +5 -0
- package/dist/neutral/hooks/queries/useArchivistAll.d.ts.map +1 -0
- package/dist/neutral/hooks/queries/useArchivistGet.d.cts +9 -0
- package/dist/neutral/hooks/queries/useArchivistGet.d.cts.map +1 -0
- package/dist/neutral/hooks/queries/useArchivistGet.d.mts +9 -0
- package/dist/neutral/hooks/queries/useArchivistGet.d.mts.map +1 -0
- package/dist/neutral/hooks/queries/useArchivistGet.d.ts +9 -0
- package/dist/neutral/hooks/queries/useArchivistGet.d.ts.map +1 -0
- package/dist/neutral/hooks/queries/useWeakArchivistAll.d.cts +5 -0
- package/dist/neutral/hooks/queries/useWeakArchivistAll.d.cts.map +1 -0
- package/dist/neutral/hooks/queries/useWeakArchivistAll.d.mts +5 -0
- package/dist/neutral/hooks/queries/useWeakArchivistAll.d.mts.map +1 -0
- package/dist/neutral/hooks/queries/useWeakArchivistAll.d.ts +5 -0
- package/dist/neutral/hooks/queries/useWeakArchivistAll.d.ts.map +1 -0
- package/dist/neutral/hooks/queries/useWeakArchivistGet.d.cts +9 -0
- package/dist/neutral/hooks/queries/useWeakArchivistGet.d.cts.map +1 -0
- package/dist/neutral/hooks/queries/useWeakArchivistGet.d.mts +9 -0
- package/dist/neutral/hooks/queries/useWeakArchivistGet.d.mts.map +1 -0
- package/dist/neutral/hooks/queries/useWeakArchivistGet.d.ts +9 -0
- package/dist/neutral/hooks/queries/useWeakArchivistGet.d.ts.map +1 -0
- package/dist/neutral/index.cjs +415 -0
- package/dist/neutral/index.cjs.map +1 -0
- package/dist/neutral/index.d.cts +3 -0
- package/dist/neutral/index.d.cts.map +1 -0
- package/dist/neutral/index.d.mts +3 -0
- package/dist/neutral/index.d.mts.map +1 -0
- package/dist/neutral/index.d.ts +3 -0
- package/dist/neutral/index.d.ts.map +1 -0
- package/dist/neutral/index.js +392 -0
- package/dist/neutral/index.js.map +1 -0
- package/dist/node/index.cjs +21 -21
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +21 -21
- package/dist/node/index.js.map +1 -1
- package/package.json +18 -18
- package/src/components/Card/Card.stories.tsx +4 -4
- package/src/components/Card/Card.tsx +4 -4
- package/src/components/Card/CardContent.tsx +5 -5
- package/src/components/Card/CardHeader.tsx +3 -3
- package/src/components/Card/components/Stats/MemoryArchivistStats.stories.tsx +4 -4
- package/src/hooks/node/useArchivistFromNode.tsx +4 -4
- package/src/hooks/node/useArchivistsFromNode.tsx +3 -3
- package/src/hooks/node/useWeakArchivistsFromNode.tsx +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWeakArchivistsFromNode.d.ts","sourceRoot":"","sources":["../../../../src/hooks/node/useWeakArchivistsFromNode.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAuB,MAAM,8BAA8B,CAAA;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,oBAAoB,EAA0B,MAAM,yBAAyB,CAAA;AAEtF,eAAO,MAAM,yBAAyB,YAC3B,YAAY,WACZ,oBAAoB,KAC5B,CAAC,QAAQ,iBAAiB,CAAC,EAAE,GAAG,IAAI,GAAG,SAAS,EAAE,KAAK,GAAG,SAAS,CAgBrE,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ArchivistInstance } from '@xyo-network/archivist-model';
|
|
2
|
+
import { ModuleFilter } from '@xyo-network/module-model';
|
|
3
|
+
import { ModuleFromNodeConfig } from '@xyo-network/react-node';
|
|
4
|
+
export declare const useWeakArchivistsFromNode: (filter?: ModuleFilter, config?: ModuleFromNodeConfig) => [WeakRef<ArchivistInstance>[] | null | undefined, Error | undefined];
|
|
5
|
+
//# sourceMappingURL=useWeakArchivistsFromNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWeakArchivistsFromNode.d.ts","sourceRoot":"","sources":["../../../../src/hooks/node/useWeakArchivistsFromNode.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAuB,MAAM,8BAA8B,CAAA;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,oBAAoB,EAA0B,MAAM,yBAAyB,CAAA;AAEtF,eAAO,MAAM,yBAAyB,YAC3B,YAAY,WACZ,oBAAoB,KAC5B,CAAC,QAAQ,iBAAiB,CAAC,EAAE,GAAG,IAAI,GAAG,SAAS,EAAE,KAAK,GAAG,SAAS,CAgBrE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/queries/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/queries/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/queries/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ArchivistInstance } from '@xyo-network/archivist-model';
|
|
2
|
+
export declare const useArchivistAll: (archivist: ArchivistInstance) => (Error | import("@xyo-network/react-module").RefreshCallback | [import("@xyo-network/payload-model").WithMeta<{
|
|
3
|
+
schema: string;
|
|
4
|
+
} & import("@xyo-network/payload-model").PayloadFields>[] | undefined, Error | undefined, import("@xylabs/react-promise").State | undefined] | undefined)[];
|
|
5
|
+
//# sourceMappingURL=useArchivistAll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useArchivistAll.d.ts","sourceRoot":"","sources":["../../../../src/hooks/queries/useArchivistAll.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAIhE,eAAO,MAAM,eAAe,cAAe,iBAAiB;;2JAgB3D,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ArchivistInstance } from '@xyo-network/archivist-model';
|
|
2
|
+
export declare const useArchivistAll: (archivist: ArchivistInstance) => (Error | import("@xyo-network/react-module").RefreshCallback | [import("@xyo-network/payload-model").WithMeta<{
|
|
3
|
+
schema: string;
|
|
4
|
+
} & import("@xyo-network/payload-model").PayloadFields>[] | undefined, Error | undefined, import("@xylabs/react-promise").State | undefined] | undefined)[];
|
|
5
|
+
//# sourceMappingURL=useArchivistAll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useArchivistAll.d.ts","sourceRoot":"","sources":["../../../../src/hooks/queries/useArchivistAll.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAIhE,eAAO,MAAM,eAAe,cAAe,iBAAiB;;2JAgB3D,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ArchivistInstance } from '@xyo-network/archivist-model';
|
|
2
|
+
export declare const useArchivistAll: (archivist: ArchivistInstance) => (Error | import("@xyo-network/react-module").RefreshCallback | [import("@xyo-network/payload-model").WithMeta<{
|
|
3
|
+
schema: string;
|
|
4
|
+
} & import("@xyo-network/payload-model").PayloadFields>[] | undefined, Error | undefined, import("@xylabs/react-promise").State | undefined] | undefined)[];
|
|
5
|
+
//# sourceMappingURL=useArchivistAll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useArchivistAll.d.ts","sourceRoot":"","sources":["../../../../src/hooks/queries/useArchivistAll.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAIhE,eAAO,MAAM,eAAe,cAAe,iBAAiB;;2JAgB3D,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Hash } from '@xylabs/hex';
|
|
2
|
+
import { ArchivistInstance } from '@xyo-network/archivist-model';
|
|
3
|
+
import { RefreshCallback } from '@xyo-network/react-module';
|
|
4
|
+
export declare const useArchivistGet: <T extends {
|
|
5
|
+
schema: string;
|
|
6
|
+
} & import("@xyo-network/payload-model").PayloadFields = {
|
|
7
|
+
schema: string;
|
|
8
|
+
} & import("@xyo-network/payload-model").PayloadFields>(archivist?: ArchivistInstance | null, hashes?: Hash[]) => [T[] | undefined, Error | undefined, RefreshCallback];
|
|
9
|
+
//# sourceMappingURL=useArchivistGet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useArchivistGet.d.ts","sourceRoot":"","sources":["../../../../src/hooks/queries/useArchivistGet.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAElC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAEhE,OAAO,EAAE,eAAe,EAAc,MAAM,2BAA2B,CAAA;AAEvE,eAAO,MAAM,eAAe;;;;oEACd,iBAAiB,GAAG,IAAI,WAC3B,IAAI,EAAE,0DAWhB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Hash } from '@xylabs/hex';
|
|
2
|
+
import { ArchivistInstance } from '@xyo-network/archivist-model';
|
|
3
|
+
import { RefreshCallback } from '@xyo-network/react-module';
|
|
4
|
+
export declare const useArchivistGet: <T extends {
|
|
5
|
+
schema: string;
|
|
6
|
+
} & import("@xyo-network/payload-model").PayloadFields = {
|
|
7
|
+
schema: string;
|
|
8
|
+
} & import("@xyo-network/payload-model").PayloadFields>(archivist?: ArchivistInstance | null, hashes?: Hash[]) => [T[] | undefined, Error | undefined, RefreshCallback];
|
|
9
|
+
//# sourceMappingURL=useArchivistGet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useArchivistGet.d.ts","sourceRoot":"","sources":["../../../../src/hooks/queries/useArchivistGet.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAElC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAEhE,OAAO,EAAE,eAAe,EAAc,MAAM,2BAA2B,CAAA;AAEvE,eAAO,MAAM,eAAe;;;;oEACd,iBAAiB,GAAG,IAAI,WAC3B,IAAI,EAAE,0DAWhB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Hash } from '@xylabs/hex';
|
|
2
|
+
import { ArchivistInstance } from '@xyo-network/archivist-model';
|
|
3
|
+
import { RefreshCallback } from '@xyo-network/react-module';
|
|
4
|
+
export declare const useArchivistGet: <T extends {
|
|
5
|
+
schema: string;
|
|
6
|
+
} & import("@xyo-network/payload-model").PayloadFields = {
|
|
7
|
+
schema: string;
|
|
8
|
+
} & import("@xyo-network/payload-model").PayloadFields>(archivist?: ArchivistInstance | null, hashes?: Hash[]) => [T[] | undefined, Error | undefined, RefreshCallback];
|
|
9
|
+
//# sourceMappingURL=useArchivistGet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useArchivistGet.d.ts","sourceRoot":"","sources":["../../../../src/hooks/queries/useArchivistGet.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAElC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAEhE,OAAO,EAAE,eAAe,EAAc,MAAM,2BAA2B,CAAA;AAEvE,eAAO,MAAM,eAAe;;;;oEACd,iBAAiB,GAAG,IAAI,WAC3B,IAAI,EAAE,0DAWhB,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ArchivistInstance } from '@xyo-network/archivist-model';
|
|
2
|
+
export declare const useWeakArchivistAll: (archivist: WeakRef<ArchivistInstance>) => (Error | import("@xyo-network/react-module").RefreshCallback | [import("@xyo-network/payload-model").WithMeta<{
|
|
3
|
+
schema: string;
|
|
4
|
+
} & import("@xyo-network/payload-model").PayloadFields>[] | undefined, Error | undefined, import("@xylabs/react-promise").State | undefined] | undefined)[];
|
|
5
|
+
//# sourceMappingURL=useWeakArchivistAll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWeakArchivistAll.d.ts","sourceRoot":"","sources":["../../../../src/hooks/queries/useWeakArchivistAll.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAIhE,eAAO,MAAM,mBAAmB,cAAe,QAAQ,iBAAiB,CAAC;;2JAgBxE,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ArchivistInstance } from '@xyo-network/archivist-model';
|
|
2
|
+
export declare const useWeakArchivistAll: (archivist: WeakRef<ArchivistInstance>) => (Error | import("@xyo-network/react-module").RefreshCallback | [import("@xyo-network/payload-model").WithMeta<{
|
|
3
|
+
schema: string;
|
|
4
|
+
} & import("@xyo-network/payload-model").PayloadFields>[] | undefined, Error | undefined, import("@xylabs/react-promise").State | undefined] | undefined)[];
|
|
5
|
+
//# sourceMappingURL=useWeakArchivistAll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWeakArchivistAll.d.ts","sourceRoot":"","sources":["../../../../src/hooks/queries/useWeakArchivistAll.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAIhE,eAAO,MAAM,mBAAmB,cAAe,QAAQ,iBAAiB,CAAC;;2JAgBxE,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ArchivistInstance } from '@xyo-network/archivist-model';
|
|
2
|
+
export declare const useWeakArchivistAll: (archivist: WeakRef<ArchivistInstance>) => (Error | import("@xyo-network/react-module").RefreshCallback | [import("@xyo-network/payload-model").WithMeta<{
|
|
3
|
+
schema: string;
|
|
4
|
+
} & import("@xyo-network/payload-model").PayloadFields>[] | undefined, Error | undefined, import("@xylabs/react-promise").State | undefined] | undefined)[];
|
|
5
|
+
//# sourceMappingURL=useWeakArchivistAll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWeakArchivistAll.d.ts","sourceRoot":"","sources":["../../../../src/hooks/queries/useWeakArchivistAll.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAIhE,eAAO,MAAM,mBAAmB,cAAe,QAAQ,iBAAiB,CAAC;;2JAgBxE,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Hash } from '@xylabs/hex';
|
|
2
|
+
import { ArchivistInstance } from '@xyo-network/archivist-model';
|
|
3
|
+
import { RefreshCallback } from '@xyo-network/react-module';
|
|
4
|
+
export declare const useWeakArchivistGet: <T extends {
|
|
5
|
+
schema: string;
|
|
6
|
+
} & import("@xyo-network/payload-model").PayloadFields = {
|
|
7
|
+
schema: string;
|
|
8
|
+
} & import("@xyo-network/payload-model").PayloadFields>(archivist?: WeakRef<ArchivistInstance> | null, hashes?: Hash[]) => [T[] | undefined, Error | undefined, RefreshCallback];
|
|
9
|
+
//# sourceMappingURL=useWeakArchivistGet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWeakArchivistGet.d.ts","sourceRoot":"","sources":["../../../../src/hooks/queries/useWeakArchivistGet.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAElC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAEhE,OAAO,EAAE,eAAe,EAAc,MAAM,2BAA2B,CAAA;AAEvE,eAAO,MAAM,mBAAmB;;;;oEAClB,QAAQ,iBAAiB,CAAC,GAAG,IAAI,WACpC,IAAI,EAAE,0DAYhB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Hash } from '@xylabs/hex';
|
|
2
|
+
import { ArchivistInstance } from '@xyo-network/archivist-model';
|
|
3
|
+
import { RefreshCallback } from '@xyo-network/react-module';
|
|
4
|
+
export declare const useWeakArchivistGet: <T extends {
|
|
5
|
+
schema: string;
|
|
6
|
+
} & import("@xyo-network/payload-model").PayloadFields = {
|
|
7
|
+
schema: string;
|
|
8
|
+
} & import("@xyo-network/payload-model").PayloadFields>(archivist?: WeakRef<ArchivistInstance> | null, hashes?: Hash[]) => [T[] | undefined, Error | undefined, RefreshCallback];
|
|
9
|
+
//# sourceMappingURL=useWeakArchivistGet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWeakArchivistGet.d.ts","sourceRoot":"","sources":["../../../../src/hooks/queries/useWeakArchivistGet.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAElC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAEhE,OAAO,EAAE,eAAe,EAAc,MAAM,2BAA2B,CAAA;AAEvE,eAAO,MAAM,mBAAmB;;;;oEAClB,QAAQ,iBAAiB,CAAC,GAAG,IAAI,WACpC,IAAI,EAAE,0DAYhB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Hash } from '@xylabs/hex';
|
|
2
|
+
import { ArchivistInstance } from '@xyo-network/archivist-model';
|
|
3
|
+
import { RefreshCallback } from '@xyo-network/react-module';
|
|
4
|
+
export declare const useWeakArchivistGet: <T extends {
|
|
5
|
+
schema: string;
|
|
6
|
+
} & import("@xyo-network/payload-model").PayloadFields = {
|
|
7
|
+
schema: string;
|
|
8
|
+
} & import("@xyo-network/payload-model").PayloadFields>(archivist?: WeakRef<ArchivistInstance> | null, hashes?: Hash[]) => [T[] | undefined, Error | undefined, RefreshCallback];
|
|
9
|
+
//# sourceMappingURL=useWeakArchivistGet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useWeakArchivistGet.d.ts","sourceRoot":"","sources":["../../../../src/hooks/queries/useWeakArchivistGet.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAElC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAEhE,OAAO,EAAE,eAAe,EAAc,MAAM,2BAA2B,CAAA;AAEvE,eAAO,MAAM,mBAAmB;;;;oEAClB,QAAQ,iBAAiB,CAAC,GAAG,IAAI,WACpC,IAAI,EAAE,0DAYhB,CAAA"}
|
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
ArchivistCard: () => ArchivistCard,
|
|
24
|
+
ArchivistCardContent: () => ArchivistCardContent,
|
|
25
|
+
ArchivistCardHeader: () => ArchivistCardHeader,
|
|
26
|
+
ArchivistDetails: () => ArchivistDetails,
|
|
27
|
+
useArchivistAll: () => useArchivistAll,
|
|
28
|
+
useArchivistFromNode: () => useArchivistFromNode,
|
|
29
|
+
useArchivistGet: () => useArchivistGet,
|
|
30
|
+
useArchivistsFromNode: () => useArchivistsFromNode,
|
|
31
|
+
useWeakArchivistAll: () => useWeakArchivistAll,
|
|
32
|
+
useWeakArchivistFromNode: () => useWeakArchivistFromNode,
|
|
33
|
+
useWeakArchivistGet: () => useWeakArchivistGet,
|
|
34
|
+
useWeakArchivistsFromNode: () => useWeakArchivistsFromNode
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(src_exports);
|
|
37
|
+
|
|
38
|
+
// src/components/Card/Card.tsx
|
|
39
|
+
var import_material4 = require("@mui/material");
|
|
40
|
+
var import_react_module3 = require("@xyo-network/react-module");
|
|
41
|
+
|
|
42
|
+
// src/components/Card/CardContent.tsx
|
|
43
|
+
var import_react_async_effect2 = require("@xylabs/react-async-effect");
|
|
44
|
+
var import_react_flexbox3 = require("@xylabs/react-flexbox");
|
|
45
|
+
var import_module_wrapper = require("@xyo-network/module-wrapper");
|
|
46
|
+
var import_react_module = require("@xyo-network/react-module");
|
|
47
|
+
var import_react_wallet = require("@xyo-network/react-wallet");
|
|
48
|
+
var import_react3 = require("react");
|
|
49
|
+
|
|
50
|
+
// src/components/Card/components/ArchivistParent.tsx
|
|
51
|
+
var import_material = require("@mui/material");
|
|
52
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
53
|
+
var ArchivistParent = ({ archivistType, parentArchivists }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: parentArchivists?.map((address) => {
|
|
54
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.ListItem, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_material.Typography, { variant: "subtitle2", children: [
|
|
55
|
+
archivistType,
|
|
56
|
+
":",
|
|
57
|
+
" ",
|
|
58
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "caption", sx: { ml: 0.5 }, children: address })
|
|
59
|
+
] }) }, address);
|
|
60
|
+
}) });
|
|
61
|
+
|
|
62
|
+
// src/components/Card/components/ArchivistParents.tsx
|
|
63
|
+
var import_icons_material = require("@mui/icons-material");
|
|
64
|
+
var import_material2 = require("@mui/material");
|
|
65
|
+
var import_react_flexbox = require("@xylabs/react-flexbox");
|
|
66
|
+
var import_react = require("react");
|
|
67
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
68
|
+
var ArchivistParents = ({ config, ...props }) => {
|
|
69
|
+
const [parentArchivistCollapse, setParentArchivistCollapse] = (0, import_react.useState)(false);
|
|
70
|
+
const { commit, read, write } = config?.parents ?? {};
|
|
71
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: commit || read || write ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react_flexbox.FlexCol, { alignItems: "start", ...props, children: [
|
|
72
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { onClick: () => setParentArchivistCollapse(!parentArchivistCollapse), children: [
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.Typography, { variant: "subtitle2", sx: { cursor: "pointer", display: "inline-block" }, children: "Parents" }),
|
|
74
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.IconButton, { size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material.ArrowRightRounded, { sx: { rotate: parentArchivistCollapse ? "90deg" : "0deg", transition: "all .25s" } }) })
|
|
75
|
+
] }),
|
|
76
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.Collapse, { in: parentArchivistCollapse, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.Paper, { elevation: 2, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material2.List, { children: [
|
|
77
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ArchivistParent, { archivistType: "Commit", parentArchivists: commit }),
|
|
78
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ArchivistParent, { archivistType: "Read", parentArchivists: read }),
|
|
79
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ArchivistParent, { archivistType: "Write", parentArchivists: write })
|
|
80
|
+
] }) }) })
|
|
81
|
+
] }) : null });
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// src/components/Card/components/Stats/ArchivistStats.tsx
|
|
85
|
+
var import_material3 = require("@mui/material");
|
|
86
|
+
var import_react_flexbox2 = require("@xylabs/react-flexbox");
|
|
87
|
+
var import_bs = require("react-icons/bs");
|
|
88
|
+
var import_vsc = require("react-icons/vsc");
|
|
89
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
90
|
+
var ArchivistStats = ({ addresses = {}, boundWitnesses, payloads, schemas = {} }) => {
|
|
91
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_flexbox2.FlexRow, { gap: 2, mr: 0.5, children: [
|
|
92
|
+
payloads?.length ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.Tooltip, { title: "Payloads", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.Badge, { badgeContent: payloads?.length, color: "primary", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_vsc.VscSymbolNamespace, { size: 20 }) }) }) : null,
|
|
93
|
+
boundWitnesses?.length ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.Tooltip, { title: "Blocks", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.Badge, { badgeContent: boundWitnesses?.length, color: "primary", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_vsc.VscSymbolMethod, { size: 20 }) }) }) : null,
|
|
94
|
+
Object.entries(schemas).length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.Tooltip, { title: "Schemas", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.Badge, { badgeContent: Object.entries(schemas).length, color: "primary", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_bs.BsFileEarmarkCode, { size: 20 }) }) }) : null,
|
|
95
|
+
Object.entries(addresses).length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.Tooltip, { title: "Addresses", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.Badge, { badgeContent: Object.entries(addresses).length, color: "primary", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_vsc.VscOrganization, { size: 20 }) }) }) : null
|
|
96
|
+
] });
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
// src/components/Card/components/Stats/MemoryArchivistStats.tsx
|
|
100
|
+
var import_react_async_effect = require("@xylabs/react-async-effect");
|
|
101
|
+
var import_archivist_model = require("@xyo-network/archivist-model");
|
|
102
|
+
var import_boundwitness_model = require("@xyo-network/boundwitness-model");
|
|
103
|
+
var import_react2 = require("react");
|
|
104
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
105
|
+
var MemoryArchivistsStats = ({ archivist }) => {
|
|
106
|
+
const [all, setAll] = (0, import_react2.useState)();
|
|
107
|
+
const getAll = (0, import_react2.useCallback)(async (archivist2) => {
|
|
108
|
+
const all2 = await archivist2?.all?.();
|
|
109
|
+
setAll(all2);
|
|
110
|
+
}, []);
|
|
111
|
+
(0, import_react2.useEffect)(() => {
|
|
112
|
+
const listeners = [];
|
|
113
|
+
if (archivist?.queries.includes(import_archivist_model.ArchivistAllQuerySchema)) {
|
|
114
|
+
const insertListener = archivist.on("inserted", async () => {
|
|
115
|
+
await getAll(archivist);
|
|
116
|
+
});
|
|
117
|
+
listeners.push(insertListener);
|
|
118
|
+
const clearListener = archivist.on("cleared", async () => {
|
|
119
|
+
await getAll(archivist);
|
|
120
|
+
});
|
|
121
|
+
listeners.push(clearListener);
|
|
122
|
+
}
|
|
123
|
+
return () => {
|
|
124
|
+
for (const listener of listeners)
|
|
125
|
+
listener?.();
|
|
126
|
+
};
|
|
127
|
+
}, [archivist, getAll]);
|
|
128
|
+
(0, import_react_async_effect.useAsyncEffect)(
|
|
129
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
130
|
+
async () => {
|
|
131
|
+
if (archivist?.queries.includes(import_archivist_model.ArchivistAllQuerySchema)) {
|
|
132
|
+
await getAll(archivist);
|
|
133
|
+
} else {
|
|
134
|
+
setAll(null);
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
[archivist, getAll]
|
|
138
|
+
);
|
|
139
|
+
const payloads = (0, import_react2.useMemo)(() => all === null ? [] : all?.filter((payload) => payload.schema !== import_boundwitness_model.BoundWitnessSchema), [all]);
|
|
140
|
+
const boundWitnesses = (0, import_react2.useMemo)(() => all === null ? [] : all?.filter((payload) => payload.schema === import_boundwitness_model.BoundWitnessSchema), [all]);
|
|
141
|
+
const addresses = (0, import_react2.useMemo)(
|
|
142
|
+
() => all?.reduce(
|
|
143
|
+
(prev, payload) => {
|
|
144
|
+
const w = (0, import_boundwitness_model.asBoundWitness)(payload);
|
|
145
|
+
if (w?.addresses)
|
|
146
|
+
for (const address of w?.addresses ?? []) {
|
|
147
|
+
prev[address] = (prev[address] ?? 0) + 1;
|
|
148
|
+
}
|
|
149
|
+
return prev;
|
|
150
|
+
},
|
|
151
|
+
{}
|
|
152
|
+
) ?? {},
|
|
153
|
+
[all]
|
|
154
|
+
);
|
|
155
|
+
const schemas = (0, import_react2.useMemo)(
|
|
156
|
+
() => all?.reduce(
|
|
157
|
+
(prev, payload) => {
|
|
158
|
+
prev[payload.schema] = (prev[payload.schema] ?? 0) + 1;
|
|
159
|
+
return prev;
|
|
160
|
+
},
|
|
161
|
+
{}
|
|
162
|
+
) ?? {},
|
|
163
|
+
[all]
|
|
164
|
+
);
|
|
165
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ArchivistStats, { addresses, boundWitnesses, payloads, schemas });
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
// src/components/Card/CardContent.tsx
|
|
169
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
170
|
+
var ArchivistCardContent = ({ children, mod, ...props }) => {
|
|
171
|
+
const [config, setConfig] = (0, import_react3.useState)();
|
|
172
|
+
const [wallet] = (0, import_react_wallet.useWallet)();
|
|
173
|
+
(0, import_react_async_effect2.useAsyncEffect)(
|
|
174
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
175
|
+
async (mounted) => {
|
|
176
|
+
if (wallet && mod) {
|
|
177
|
+
const wrapper = import_module_wrapper.ModuleWrapper.wrap(mod, wallet);
|
|
178
|
+
const payloads = await wrapper?.state();
|
|
179
|
+
if (mounted()) {
|
|
180
|
+
setConfig(payloads?.[0]);
|
|
181
|
+
}
|
|
182
|
+
} else {
|
|
183
|
+
setConfig(void 0);
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
[mod, wallet]
|
|
187
|
+
);
|
|
188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_module.ModuleCardContent, { mod, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react_flexbox3.FlexGrowRow, { flexWrap: "wrap", justifyContent: "start", gap: 2, children: [
|
|
189
|
+
children,
|
|
190
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ArchivistParents, { config })
|
|
191
|
+
] }) });
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
// src/components/Card/CardHeader.tsx
|
|
195
|
+
var import_archivist_memory = require("@xyo-network/archivist-memory");
|
|
196
|
+
var import_react_module2 = require("@xyo-network/react-module");
|
|
197
|
+
var import_react4 = require("react");
|
|
198
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
199
|
+
var ArchivistStats2 = (archivist) => {
|
|
200
|
+
switch (archivist?.config.schema) {
|
|
201
|
+
case import_archivist_memory.MemoryArchivistConfigSchema: {
|
|
202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(MemoryArchivistsStats, { archivist });
|
|
203
|
+
}
|
|
204
|
+
default: {
|
|
205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, {});
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
var ArchivistCardHeader = ({ title, mod, ...props }) => {
|
|
210
|
+
const Stats = (0, import_react4.useMemo)(() => ArchivistStats2(mod), [mod]);
|
|
211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_module2.ModuleCardHeader, { mod, title: title ?? mod?.config.name ?? "Archivist", action: Stats, ...props });
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
// src/components/Card/Card.tsx
|
|
215
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
216
|
+
var ArchivistCard = ({ children, mod, ...props }) => {
|
|
217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material4.Card, { ...props, children: [
|
|
218
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ArchivistCardHeader, { mod }),
|
|
219
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ArchivistCardContent, { mod }),
|
|
220
|
+
children,
|
|
221
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_module3.ModuleCardActions, { mod })
|
|
222
|
+
] });
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
// src/components/Details/Details.tsx
|
|
226
|
+
var import_material5 = require("@mui/material");
|
|
227
|
+
var import_react_async_effect3 = require("@xylabs/react-async-effect");
|
|
228
|
+
var import_react_button = require("@xylabs/react-button");
|
|
229
|
+
var import_react_flexbox4 = require("@xylabs/react-flexbox");
|
|
230
|
+
var import_archivist_model6 = require("@xyo-network/archivist-model");
|
|
231
|
+
var import_boundwitness_builder = require("@xyo-network/boundwitness-builder");
|
|
232
|
+
var import_react7 = require("react");
|
|
233
|
+
|
|
234
|
+
// src/hooks/node/useArchivistFromNode.tsx
|
|
235
|
+
var import_archivist_model2 = require("@xyo-network/archivist-model");
|
|
236
|
+
var import_react_node = require("@xyo-network/react-node");
|
|
237
|
+
var useArchivistFromNode = (nameOrAddressOrInstance, config) => {
|
|
238
|
+
const [mod, error] = (0, import_react_node.useModuleFromNode)(nameOrAddressOrInstance, config);
|
|
239
|
+
const instance = (0, import_archivist_model2.asArchivistInstance)(mod);
|
|
240
|
+
if (mod && !instance) {
|
|
241
|
+
const error2 = new Error(`Resolved module is not a ArchivistInstance [${mod.config?.schema}:${mod.config?.name}:${mod.address}]`);
|
|
242
|
+
console.error(error2.message);
|
|
243
|
+
return [void 0, error2];
|
|
244
|
+
}
|
|
245
|
+
return [instance, error];
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
// src/hooks/node/useArchivistsFromNode.tsx
|
|
249
|
+
var import_archivist_model3 = require("@xyo-network/archivist-model");
|
|
250
|
+
var import_react_node2 = require("@xyo-network/react-node");
|
|
251
|
+
var useArchivistsFromNode = (filter, config) => {
|
|
252
|
+
const [modules, error] = (0, import_react_node2.useModulesFromNode)(filter, config);
|
|
253
|
+
if (error) {
|
|
254
|
+
return [null, error];
|
|
255
|
+
}
|
|
256
|
+
return modules ? [
|
|
257
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
258
|
+
modules.reduce((prev, mod) => {
|
|
259
|
+
if ((0, import_archivist_model3.isArchivistInstance)(mod)) {
|
|
260
|
+
prev.push(mod);
|
|
261
|
+
}
|
|
262
|
+
return prev;
|
|
263
|
+
}, []),
|
|
264
|
+
void 0
|
|
265
|
+
] : [modules, error];
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
// src/hooks/node/useWeakArchivistFromNode.tsx
|
|
269
|
+
var import_archivist_model4 = require("@xyo-network/archivist-model");
|
|
270
|
+
var import_react_node3 = require("@xyo-network/react-node");
|
|
271
|
+
var useWeakArchivistFromNode = (nameOrAddressOrInstance, config) => {
|
|
272
|
+
return (0, import_react_node3.useWeakModuleFromNode)(nameOrAddressOrInstance, { identity: import_archivist_model4.isArchivistInstance, ...config });
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
// src/hooks/node/useWeakArchivistsFromNode.tsx
|
|
276
|
+
var import_exists = require("@xylabs/exists");
|
|
277
|
+
var import_archivist_model5 = require("@xyo-network/archivist-model");
|
|
278
|
+
var import_react_node4 = require("@xyo-network/react-node");
|
|
279
|
+
var useWeakArchivistsFromNode = (filter, config) => {
|
|
280
|
+
const [modules, error] = (0, import_react_node4.useWeakModulesFromNode)(filter, config);
|
|
281
|
+
if (error) {
|
|
282
|
+
return [null, error];
|
|
283
|
+
}
|
|
284
|
+
return [
|
|
285
|
+
modules?.map((mod) => {
|
|
286
|
+
const instance = (0, import_archivist_model5.asArchivistInstance)(mod?.deref());
|
|
287
|
+
if (instance) {
|
|
288
|
+
return new WeakRef(instance);
|
|
289
|
+
}
|
|
290
|
+
}).filter(import_exists.exists) ?? [],
|
|
291
|
+
void 0
|
|
292
|
+
];
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
// src/hooks/queries/useArchivistAll.tsx
|
|
296
|
+
var import_react_promise = require("@xylabs/react-promise");
|
|
297
|
+
var import_react_module4 = require("@xyo-network/react-module");
|
|
298
|
+
var import_react5 = require("react");
|
|
299
|
+
var useArchivistAll = (archivist) => {
|
|
300
|
+
const [error, setError] = (0, import_react5.useState)();
|
|
301
|
+
const [enabled, refresh] = (0, import_react_module4.useRefresh)();
|
|
302
|
+
const payloads = (0, import_react_promise.usePromise)(async () => {
|
|
303
|
+
try {
|
|
304
|
+
if (enabled) {
|
|
305
|
+
return await archivist?.all?.();
|
|
306
|
+
}
|
|
307
|
+
} catch (ex) {
|
|
308
|
+
const error2 = ex;
|
|
309
|
+
setError(error2);
|
|
310
|
+
}
|
|
311
|
+
}, [archivist, enabled]);
|
|
312
|
+
return [payloads, error, refresh];
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
// src/hooks/queries/useArchivistGet.tsx
|
|
316
|
+
var import_react_promise2 = require("@xylabs/react-promise");
|
|
317
|
+
var import_react_module5 = require("@xyo-network/react-module");
|
|
318
|
+
var useArchivistGet = (archivist, hashes) => {
|
|
319
|
+
const [enabled, refresh] = (0, import_react_module5.useRefresh)();
|
|
320
|
+
const [payloads, error] = (0, import_react_promise2.usePromise)(async () => {
|
|
321
|
+
if (enabled && archivist && hashes) {
|
|
322
|
+
return await archivist.get(hashes);
|
|
323
|
+
}
|
|
324
|
+
}, [archivist, hashes, enabled]);
|
|
325
|
+
return [payloads, error, refresh];
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
// src/hooks/queries/useWeakArchivistAll.tsx
|
|
329
|
+
var import_react_promise3 = require("@xylabs/react-promise");
|
|
330
|
+
var import_react_module6 = require("@xyo-network/react-module");
|
|
331
|
+
var import_react6 = require("react");
|
|
332
|
+
var useWeakArchivistAll = (archivist) => {
|
|
333
|
+
const [error, setError] = (0, import_react6.useState)();
|
|
334
|
+
const [enabled, refresh] = (0, import_react_module6.useRefresh)();
|
|
335
|
+
const payloads = (0, import_react_promise3.usePromise)(async () => {
|
|
336
|
+
try {
|
|
337
|
+
if (enabled) {
|
|
338
|
+
return await archivist?.deref()?.all?.();
|
|
339
|
+
}
|
|
340
|
+
} catch (ex) {
|
|
341
|
+
const error2 = ex;
|
|
342
|
+
setError(error2);
|
|
343
|
+
}
|
|
344
|
+
}, [archivist, enabled]);
|
|
345
|
+
return [payloads, error, refresh];
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
// src/hooks/queries/useWeakArchivistGet.tsx
|
|
349
|
+
var import_react_promise4 = require("@xylabs/react-promise");
|
|
350
|
+
var import_react_module7 = require("@xyo-network/react-module");
|
|
351
|
+
var useWeakArchivistGet = (archivist, hashes) => {
|
|
352
|
+
const [enabled, refresh] = (0, import_react_module7.useRefresh)();
|
|
353
|
+
const [payloads, error] = (0, import_react_promise4.usePromise)(async () => {
|
|
354
|
+
const archivistInstance = archivist?.deref();
|
|
355
|
+
if (enabled && archivistInstance && hashes) {
|
|
356
|
+
return await archivistInstance.get(hashes);
|
|
357
|
+
}
|
|
358
|
+
}, [archivist, hashes, enabled]);
|
|
359
|
+
return [payloads, error, refresh];
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
// src/components/Details/Details.tsx
|
|
363
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
364
|
+
var testQueryCommit = { schema: import_archivist_model6.ArchivistCommitQuerySchema };
|
|
365
|
+
var testQueryCommitBoundWitnessBuilder = new import_boundwitness_builder.QueryBoundWitnessBuilder().query(testQueryCommit);
|
|
366
|
+
var testQueryClear = { schema: import_archivist_model6.ArchivistClearQuerySchema };
|
|
367
|
+
var testQueryClearBoundWitnessBuilder = new import_boundwitness_builder.QueryBoundWitnessBuilder().query(testQueryClear);
|
|
368
|
+
var ArchivistDetails = ({ address, ...props }) => {
|
|
369
|
+
const [archivist] = useWeakArchivistFromNode(address);
|
|
370
|
+
const [payloads, setPayloads] = (0, import_react7.useState)();
|
|
371
|
+
const [refresh, setRefresh] = (0, import_react7.useState)(0);
|
|
372
|
+
const [queryableCommit, setQueryableCommit] = (0, import_react7.useState)(false);
|
|
373
|
+
const [queryableClear, setQueryableClear] = (0, import_react7.useState)(false);
|
|
374
|
+
(0, import_react_async_effect3.useAsyncEffect)(
|
|
375
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
376
|
+
async () => {
|
|
377
|
+
const instance = archivist?.deref();
|
|
378
|
+
if (instance) {
|
|
379
|
+
const [commitBW] = await (await testQueryCommitBoundWitnessBuilder).build();
|
|
380
|
+
const [clearBW] = await (await testQueryClearBoundWitnessBuilder).build();
|
|
381
|
+
setQueryableCommit(await instance?.queryable(commitBW, [testQueryCommit]));
|
|
382
|
+
setQueryableClear(await instance?.queryable(clearBW, [testQueryClear]));
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
[archivist]
|
|
386
|
+
);
|
|
387
|
+
(0, import_react_async_effect3.useAsyncEffect)(
|
|
388
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
389
|
+
async (mounted) => {
|
|
390
|
+
const payloads2 = await archivist?.deref()?.all?.();
|
|
391
|
+
if (mounted()) {
|
|
392
|
+
setPayloads(payloads2);
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
[archivist, refresh]
|
|
396
|
+
);
|
|
397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_flexbox4.FlexCol, { ...props, children: [
|
|
398
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material5.Typography, { children: `Payloads: ${payloads ? payloads.length : "-"}` }),
|
|
399
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material5.ButtonGroup, { children: [
|
|
400
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_button.ButtonEx, { disabled: payloads?.length === 0 || !archivist || !queryableCommit, onClick: () => archivist?.deref()?.commit?.(), children: "Commit" }),
|
|
401
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_button.ButtonEx, { disabled: !archivist || !queryableClear, onClick: () => archivist?.deref()?.clear?.(), children: "Clear" }),
|
|
402
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
403
|
+
import_react_button.ButtonEx,
|
|
404
|
+
{
|
|
405
|
+
disabled: !archivist,
|
|
406
|
+
onClick: () => {
|
|
407
|
+
setRefresh(refresh + 1);
|
|
408
|
+
},
|
|
409
|
+
children: "Refresh"
|
|
410
|
+
}
|
|
411
|
+
)
|
|
412
|
+
] })
|
|
413
|
+
] });
|
|
414
|
+
};
|
|
415
|
+
//# sourceMappingURL=index.cjs.map
|