@xyo-network/react-archivist 2.49.4 → 2.49.6

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.
Files changed (29) hide show
  1. package/dist/cjs/components/Card/CardContent.js +7 -6
  2. package/dist/cjs/components/Card/CardContent.js.map +1 -1
  3. package/dist/cjs/components/Card/CardHeader.js +2 -1
  4. package/dist/cjs/components/Card/CardHeader.js.map +1 -1
  5. package/dist/cjs/components/Card/components/ArchivistParent.js +10 -0
  6. package/dist/cjs/components/Card/components/ArchivistParent.js.map +1 -0
  7. package/dist/cjs/components/Card/components/index.js +5 -0
  8. package/dist/cjs/components/Card/components/index.js.map +1 -0
  9. package/dist/docs.json +513 -513
  10. package/dist/esm/components/Card/CardContent.js +7 -6
  11. package/dist/esm/components/Card/CardContent.js.map +1 -1
  12. package/dist/esm/components/Card/CardHeader.js +1 -1
  13. package/dist/esm/components/Card/CardHeader.js.map +1 -1
  14. package/dist/esm/components/Card/components/ArchivistParent.js +6 -0
  15. package/dist/esm/components/Card/components/ArchivistParent.js.map +1 -0
  16. package/dist/esm/components/Card/components/index.js +2 -0
  17. package/dist/esm/components/Card/components/index.js.map +1 -0
  18. package/dist/types/components/Card/CardContent.d.ts +1 -1
  19. package/dist/types/components/Card/CardContent.d.ts.map +1 -1
  20. package/dist/types/components/Card/components/ArchivistParent.d.ts +7 -0
  21. package/dist/types/components/Card/components/ArchivistParent.d.ts.map +1 -0
  22. package/dist/types/components/Card/components/index.d.ts +2 -0
  23. package/dist/types/components/Card/components/index.d.ts.map +1 -0
  24. package/package.json +4 -4
  25. package/src/components/Card/Card.stories.tsx +1 -6
  26. package/src/components/Card/CardContent.tsx +30 -8
  27. package/src/components/Card/CardHeader.tsx +1 -1
  28. package/src/components/Card/components/ArchivistParent.tsx +23 -0
  29. package/src/components/Card/components/index.ts +1 -0
@@ -1,13 +1,15 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Typography } from '@mui/material';
3
- import { EthAddress } from '@xylabs/eth-address';
2
+ import ArrowRightRoundedIcon from '@mui/icons-material/ArrowRightRounded';
3
+ import { Collapse, IconButton, List, Paper, Typography } from '@mui/material';
4
4
  import { useAsyncEffect } from '@xylabs/react-async-effect';
5
- import { EthAccountBox } from '@xylabs/react-crypto';
5
+ import { FlexCol } from '@xylabs/react-flexbox';
6
6
  import { ModuleWrapper } from '@xyo-network/module';
7
7
  import { ModuleCardContent } from '@xyo-network/react-module';
8
8
  import { useState } from 'react';
9
+ import { ArchivistParent } from './components';
9
10
  export const ArchivistCardContent = ({ children, module, ...props }) => {
10
11
  const [config, setConfig] = useState();
12
+ const [parentArchivistCollapse, setParentArchivistCollapse] = useState(false);
11
13
  useAsyncEffect(
12
14
  // eslint-disable-next-line react-hooks/exhaustive-deps
13
15
  async (mounted) => {
@@ -18,8 +20,7 @@ export const ArchivistCardContent = ({ children, module, ...props }) => {
18
20
  setConfig(payloads?.[0]);
19
21
  }
20
22
  }, [module]);
21
- return (_jsxs(ModuleCardContent, { module: module, ...props, children: [_jsx(Typography, { children: "Parents" }), config?.parents?.commit?.map((address) => {
22
- return _jsx(EthAccountBox, { address: EthAddress.fromString(address) }, address);
23
- }), children] }));
23
+ const { commit, read, write } = config?.parents ?? {};
24
+ return (_jsxs(ModuleCardContent, { module: module, ...props, children: [commit || read || write ? (_jsxs(FlexCol, { alignItems: "start", children: [_jsxs("span", { onClick: () => setParentArchivistCollapse(!parentArchivistCollapse), children: [_jsx(Typography, { variant: "subtitle2", sx: { cursor: 'pointer', display: 'inline-block' }, children: "Parents" }), _jsx(IconButton, { size: "small", children: _jsx(ArrowRightRoundedIcon, { sx: { rotate: parentArchivistCollapse ? '90deg' : '0deg', transition: 'all .25s' } }) })] }), _jsx(Collapse, { in: parentArchivistCollapse, children: _jsx(Paper, { elevation: 2, children: _jsxs(List, { children: [_jsx(ArchivistParent, { archivistType: "Commit", parentArchivists: commit }), _jsx(ArchivistParent, { archivistType: "Read", parentArchivists: read }), _jsx(ArchivistParent, { archivistType: "Write", parentArchivists: write })] }) }) })] })) : null, children] }));
24
25
  };
25
26
  //# sourceMappingURL=CardContent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CardContent.js","sourceRoot":"","sources":["../../../../src/components/Card/CardContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAoB,UAAU,EAAE,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,iBAAiB,EAAqB,MAAM,2BAA2B,CAAA;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEhC,MAAM,CAAC,MAAM,oBAAoB,GAAoE,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACtI,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,EAAmB,CAAA;IAEvD,cAAc;IACZ,uDAAuD;IACvD,KAAK,EAAE,OAAO,EAAE,EAAE;QAChB,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QAC/D,MAAM,QAAQ,GAAG,MAAM,OAAO,EAAE,QAAQ,EAAE,CAAA;QAC1C,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAA;QAC7D,IAAI,OAAO,EAAE,EAAE;YACb,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAoB,CAAC,CAAA;SAC5C;IACH,CAAC,EACD,CAAC,MAAM,CAAC,CAC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,EAAE,MAAM,GAAI,EACpE,KAAC,eAAe,IAAC,aAAa,EAAC,MAAM,EAAC,gBAAgB,EAAE,IAAI,GAAI,EAChE,KAAC,eAAe,IAAC,aAAa,EAAC,OAAO,EAAC,gBAAgB,EAAE,KAAK,GAAI,IAC7D,GACD,GACC,IACH,CACX,CAAC,CAAC,CAAC,IAAI,EACP,QAAQ,IACS,CACrB,CAAA;AACH,CAAC,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { ModuleCardHeader } from '@xyo-network/react-module';
3
3
  export const ArchivistCardHeader = ({ title, module, ...props }) => {
4
- return _jsx(ModuleCardHeader, { module: module, title: title ?? 'Archivist', ...props });
4
+ return _jsx(ModuleCardHeader, { module: module, title: title ?? module?.config.name ?? 'Archivist', ...props });
5
5
  };
6
6
  //# sourceMappingURL=CardHeader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CardHeader.js","sourceRoot":"","sources":["../../../../src/components/Card/CardHeader.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,gBAAgB,EAAqB,MAAM,2BAA2B,CAAA;AAE/E,MAAM,CAAC,MAAM,mBAAmB,GAAmE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACjI,OAAO,KAAC,gBAAgB,IAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,IAAI,WAAW,KAAM,KAAK,GAAI,CAAA;AACrF,CAAC,CAAA"}
1
+ {"version":3,"file":"CardHeader.js","sourceRoot":"","sources":["../../../../src/components/Card/CardHeader.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,gBAAgB,EAAqB,MAAM,2BAA2B,CAAA;AAE/E,MAAM,CAAC,MAAM,mBAAmB,GAAmE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACjI,OAAO,KAAC,gBAAgB,IAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,CAAC,IAAI,IAAI,WAAW,KAAM,KAAK,GAAI,CAAA;AAC5G,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { ListItem, Typography } from '@mui/material';
3
+ export const ArchivistParent = ({ archivistType, parentArchivists }) => (_jsx(_Fragment, { children: parentArchivists?.map((address) => {
4
+ return (_jsx(ListItem, { children: _jsxs(Typography, { variant: "subtitle2", children: [archivistType, ":", ' ', _jsx(Typography, { variant: 'caption', sx: { ml: 0.5 }, children: address })] }) }, address));
5
+ }) }));
6
+ //# sourceMappingURL=ArchivistParent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArchivistParent.js","sourceRoot":"","sources":["../../../../../src/components/Card/components/ArchivistParent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAOpD,MAAM,CAAC,MAAM,eAAe,GAAiC,CAAC,EAAE,aAAa,EAAE,gBAAgB,EAAE,EAAE,EAAE,CAAC,CACpG,4BACG,gBAAgB,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QACjC,OAAO,CACL,KAAC,QAAQ,cACP,MAAC,UAAU,IAAC,OAAO,EAAC,WAAW,aAC5B,aAAa,OAAG,GAAG,EACpB,KAAC,UAAU,IAAC,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,YAC5C,OAAO,GACG,IACF,IANA,OAAO,CAOX,CACZ,CAAA;IACH,CAAC,CAAC,GACD,CACJ,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './ArchivistParent';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/Card/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA"}
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
2
1
  import { CardContentProps } from '@mui/material';
3
2
  import { ArchivistModule } from '@xyo-network/archivist';
4
3
  import { ModuleRenderProps } from '@xyo-network/react-module';
4
+ import React from 'react';
5
5
  export declare const ArchivistCardContent: React.FC<ModuleRenderProps<ArchivistModule> & CardContentProps>;
6
6
  //# sourceMappingURL=CardContent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CardContent.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/CardContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAc,MAAM,eAAe,CAAA;AAI5D,OAAO,EAAmB,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAEzE,OAAO,EAAqB,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAGhF,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,eAAe,CAAC,GAAG,gBAAgB,CAyBhG,CAAA"}
1
+ {"version":3,"file":"CardContent.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/CardContent.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAiD,MAAM,eAAe,CAAA;AAG/F,OAAO,EAAmB,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAEzE,OAAO,EAAqB,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAChF,OAAO,KAAmB,MAAM,OAAO,CAAA;AAIvC,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,eAAe,CAAC,GAAG,gBAAgB,CA6ChG,CAAA"}
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ export interface ArchivistTypeProps {
3
+ archivistType?: 'Commit' | 'Read' | 'Write';
4
+ parentArchivists?: string[];
5
+ }
6
+ export declare const ArchivistParent: React.FC<ArchivistTypeProps>;
7
+ //# sourceMappingURL=ArchivistParent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArchivistParent.d.ts","sourceRoot":"","sources":["../../../../../src/components/Card/components/ArchivistParent.tsx"],"names":[],"mappings":";AAEA,MAAM,WAAW,kBAAkB;IACjC,aAAa,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;IAC3C,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;CAC5B;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAexD,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './ArchivistParent';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Card/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA"}
package/package.json CHANGED
@@ -14,8 +14,8 @@
14
14
  "@xylabs/react-button": "^2.17.2",
15
15
  "@xylabs/react-crypto": "^2.17.2",
16
16
  "@xylabs/react-flexbox": "^2.17.2",
17
- "@xyo-network/react-module": "^2.49.4",
18
- "@xyo-network/react-node": "^2.49.4"
17
+ "@xyo-network/react-module": "^2.49.6",
18
+ "@xyo-network/react-node": "^2.49.6"
19
19
  },
20
20
  "peerDependencies": {
21
21
  "@mui/icons-material": "^5",
@@ -36,7 +36,7 @@
36
36
  "@xyo-network/archivist-wrapper": "^2.56.2",
37
37
  "@xyo-network/module": "^2.56.2",
38
38
  "@xyo-network/payload-model": "^2.56.2",
39
- "@xyo-network/react-storybook": "^2.49.4",
39
+ "@xyo-network/react-storybook": "^2.49.6",
40
40
  "typescript": "^5.0.4"
41
41
  },
42
42
  "browser": "dist/esm/index.js",
@@ -81,5 +81,5 @@
81
81
  },
82
82
  "sideEffects": false,
83
83
  "types": "dist/types/index.d.ts",
84
- "version": "2.49.4"
84
+ "version": "2.49.6"
85
85
  }
@@ -6,12 +6,6 @@ import { useState } from 'react'
6
6
  import { ArchivistCard } from './Card'
7
7
 
8
8
  const StorybookEntry = {
9
- argTypes: {
10
- authState: {
11
- jwtToken: 'badToken',
12
- loggedInAccount: 'none@none.com',
13
- },
14
- },
15
9
  component: ArchivistCard,
16
10
  parameters: {
17
11
  docs: {
@@ -31,6 +25,7 @@ const Template: StoryFn<typeof ArchivistCard> = () => {
31
25
  const newParentModule = await MemoryArchivist.create()
32
26
  const newModule = await MemoryArchivist.create({
33
27
  config: {
28
+ name: 'MemoryArchivist',
34
29
  parents: { commit: [newParentModule.address], read: [newParentModule.address], write: [newParentModule.address] },
35
30
  schema: MemoryArchivistConfigSchema,
36
31
  },
@@ -1,14 +1,17 @@
1
- import { CardContentProps, Typography } from '@mui/material'
2
- import { EthAddress } from '@xylabs/eth-address'
1
+ import ArrowRightRoundedIcon from '@mui/icons-material/ArrowRightRounded'
2
+ import { CardContentProps, Collapse, IconButton, List, Paper, Typography } from '@mui/material'
3
3
  import { useAsyncEffect } from '@xylabs/react-async-effect'
4
- import { EthAccountBox } from '@xylabs/react-crypto'
4
+ import { FlexCol } from '@xylabs/react-flexbox'
5
5
  import { ArchivistConfig, ArchivistModule } from '@xyo-network/archivist'
6
6
  import { ModuleWrapper } from '@xyo-network/module'
7
7
  import { ModuleCardContent, ModuleRenderProps } from '@xyo-network/react-module'
8
- import { useState } from 'react'
8
+ import React, { useState } from 'react'
9
+
10
+ import { ArchivistParent } from './components'
9
11
 
10
12
  export const ArchivistCardContent: React.FC<ModuleRenderProps<ArchivistModule> & CardContentProps> = ({ children, module, ...props }) => {
11
13
  const [config, setConfig] = useState<ArchivistConfig>()
14
+ const [parentArchivistCollapse, setParentArchivistCollapse] = useState(false)
12
15
 
13
16
  useAsyncEffect(
14
17
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -23,12 +26,31 @@ export const ArchivistCardContent: React.FC<ModuleRenderProps<ArchivistModule> &
23
26
  [module],
24
27
  )
25
28
 
29
+ const { commit, read, write } = config?.parents ?? {}
30
+
26
31
  return (
27
32
  <ModuleCardContent module={module} {...props}>
28
- <Typography>Parents</Typography>
29
- {config?.parents?.commit?.map((address) => {
30
- return <EthAccountBox key={address} address={EthAddress.fromString(address)} />
31
- })}
33
+ {commit || read || write ? (
34
+ <FlexCol alignItems="start">
35
+ <span onClick={() => setParentArchivistCollapse(!parentArchivistCollapse)}>
36
+ <Typography variant="subtitle2" sx={{ cursor: 'pointer', display: 'inline-block' }}>
37
+ Parents
38
+ </Typography>
39
+ <IconButton size="small">
40
+ <ArrowRightRoundedIcon sx={{ rotate: parentArchivistCollapse ? '90deg' : '0deg', transition: 'all .25s' }} />
41
+ </IconButton>
42
+ </span>
43
+ <Collapse in={parentArchivistCollapse}>
44
+ <Paper elevation={2}>
45
+ <List>
46
+ <ArchivistParent archivistType="Commit" parentArchivists={commit} />
47
+ <ArchivistParent archivistType="Read" parentArchivists={read} />
48
+ <ArchivistParent archivistType="Write" parentArchivists={write} />
49
+ </List>
50
+ </Paper>
51
+ </Collapse>
52
+ </FlexCol>
53
+ ) : null}
32
54
  {children}
33
55
  </ModuleCardContent>
34
56
  )
@@ -3,5 +3,5 @@ import { ArchivistModule } from '@xyo-network/archivist'
3
3
  import { ModuleCardHeader, ModuleRenderProps } from '@xyo-network/react-module'
4
4
 
5
5
  export const ArchivistCardHeader: React.FC<ModuleRenderProps<ArchivistModule> & CardHeaderProps> = ({ title, module, ...props }) => {
6
- return <ModuleCardHeader module={module} title={title ?? 'Archivist'} {...props} />
6
+ return <ModuleCardHeader module={module} title={title ?? module?.config.name ?? 'Archivist'} {...props} />
7
7
  }
@@ -0,0 +1,23 @@
1
+ import { ListItem, Typography } from '@mui/material'
2
+
3
+ export interface ArchivistTypeProps {
4
+ archivistType?: 'Commit' | 'Read' | 'Write'
5
+ parentArchivists?: string[]
6
+ }
7
+
8
+ export const ArchivistParent: React.FC<ArchivistTypeProps> = ({ archivistType, parentArchivists }) => (
9
+ <>
10
+ {parentArchivists?.map((address) => {
11
+ return (
12
+ <ListItem key={address}>
13
+ <Typography variant="subtitle2">
14
+ {archivistType}:{' '}
15
+ <Typography variant={'caption'} sx={{ ml: 0.5 }}>
16
+ {address}
17
+ </Typography>
18
+ </Typography>
19
+ </ListItem>
20
+ )
21
+ })}
22
+ </>
23
+ )
@@ -0,0 +1 @@
1
+ export * from './ArchivistParent'