@xyo-network/react-module 2.75.6 → 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.
Files changed (169) hide show
  1. package/dist/browser/ModuleRenderProps.d.cts +1 -1
  2. package/dist/browser/ModuleRenderProps.d.cts.map +1 -1
  3. package/dist/browser/ModuleRenderProps.d.mts +1 -1
  4. package/dist/browser/ModuleRenderProps.d.mts.map +1 -1
  5. package/dist/browser/ModuleRenderProps.d.ts +1 -1
  6. package/dist/browser/ModuleRenderProps.d.ts.map +1 -1
  7. package/dist/browser/components/Card/Module/components/DiscoverDialog.d.cts +1 -1
  8. package/dist/browser/components/Card/Module/components/DiscoverDialog.d.cts.map +1 -1
  9. package/dist/browser/components/Card/Module/components/DiscoverDialog.d.mts +1 -1
  10. package/dist/browser/components/Card/Module/components/DiscoverDialog.d.mts.map +1 -1
  11. package/dist/browser/components/Card/Module/components/DiscoverDialog.d.ts +1 -1
  12. package/dist/browser/components/Card/Module/components/DiscoverDialog.d.ts.map +1 -1
  13. package/dist/browser/index.cjs +34 -34
  14. package/dist/browser/index.cjs.map +1 -1
  15. package/dist/browser/index.js +34 -34
  16. package/dist/browser/index.js.map +1 -1
  17. package/dist/neutral/ModuleRenderProps.d.cts +7 -0
  18. package/dist/neutral/ModuleRenderProps.d.cts.map +1 -0
  19. package/dist/neutral/ModuleRenderProps.d.mts +7 -0
  20. package/dist/neutral/ModuleRenderProps.d.mts.map +1 -0
  21. package/dist/neutral/ModuleRenderProps.d.ts +7 -0
  22. package/dist/neutral/ModuleRenderProps.d.ts.map +1 -0
  23. package/dist/neutral/components/Card/Diviner/Card.d.cts +6 -0
  24. package/dist/neutral/components/Card/Diviner/Card.d.cts.map +1 -0
  25. package/dist/neutral/components/Card/Diviner/Card.d.mts +6 -0
  26. package/dist/neutral/components/Card/Diviner/Card.d.mts.map +1 -0
  27. package/dist/neutral/components/Card/Diviner/Card.d.ts +6 -0
  28. package/dist/neutral/components/Card/Diviner/Card.d.ts.map +1 -0
  29. package/dist/neutral/components/Card/Diviner/CardActions.d.cts +6 -0
  30. package/dist/neutral/components/Card/Diviner/CardActions.d.cts.map +1 -0
  31. package/dist/neutral/components/Card/Diviner/CardActions.d.mts +6 -0
  32. package/dist/neutral/components/Card/Diviner/CardActions.d.mts.map +1 -0
  33. package/dist/neutral/components/Card/Diviner/CardActions.d.ts +6 -0
  34. package/dist/neutral/components/Card/Diviner/CardActions.d.ts.map +1 -0
  35. package/dist/neutral/components/Card/Diviner/CardContent.d.cts +6 -0
  36. package/dist/neutral/components/Card/Diviner/CardContent.d.cts.map +1 -0
  37. package/dist/neutral/components/Card/Diviner/CardContent.d.mts +6 -0
  38. package/dist/neutral/components/Card/Diviner/CardContent.d.mts.map +1 -0
  39. package/dist/neutral/components/Card/Diviner/CardContent.d.ts +6 -0
  40. package/dist/neutral/components/Card/Diviner/CardContent.d.ts.map +1 -0
  41. package/dist/neutral/components/Card/Diviner/CardHeader.d.cts +6 -0
  42. package/dist/neutral/components/Card/Diviner/CardHeader.d.cts.map +1 -0
  43. package/dist/neutral/components/Card/Diviner/CardHeader.d.mts +6 -0
  44. package/dist/neutral/components/Card/Diviner/CardHeader.d.mts.map +1 -0
  45. package/dist/neutral/components/Card/Diviner/CardHeader.d.ts +6 -0
  46. package/dist/neutral/components/Card/Diviner/CardHeader.d.ts.map +1 -0
  47. package/dist/neutral/components/Card/Diviner/index.d.cts +4 -0
  48. package/dist/neutral/components/Card/Diviner/index.d.cts.map +1 -0
  49. package/dist/neutral/components/Card/Diviner/index.d.mts +4 -0
  50. package/dist/neutral/components/Card/Diviner/index.d.mts.map +1 -0
  51. package/dist/neutral/components/Card/Diviner/index.d.ts +4 -0
  52. package/dist/neutral/components/Card/Diviner/index.d.ts.map +1 -0
  53. package/dist/neutral/components/Card/Module/Card.d.cts +5 -0
  54. package/dist/neutral/components/Card/Module/Card.d.cts.map +1 -0
  55. package/dist/neutral/components/Card/Module/Card.d.mts +5 -0
  56. package/dist/neutral/components/Card/Module/Card.d.mts.map +1 -0
  57. package/dist/neutral/components/Card/Module/Card.d.ts +5 -0
  58. package/dist/neutral/components/Card/Module/Card.d.ts.map +1 -0
  59. package/dist/neutral/components/Card/Module/CardActions.d.cts +5 -0
  60. package/dist/neutral/components/Card/Module/CardActions.d.cts.map +1 -0
  61. package/dist/neutral/components/Card/Module/CardActions.d.mts +5 -0
  62. package/dist/neutral/components/Card/Module/CardActions.d.mts.map +1 -0
  63. package/dist/neutral/components/Card/Module/CardActions.d.ts +5 -0
  64. package/dist/neutral/components/Card/Module/CardActions.d.ts.map +1 -0
  65. package/dist/neutral/components/Card/Module/CardContent.d.cts +5 -0
  66. package/dist/neutral/components/Card/Module/CardContent.d.cts.map +1 -0
  67. package/dist/neutral/components/Card/Module/CardContent.d.mts +5 -0
  68. package/dist/neutral/components/Card/Module/CardContent.d.mts.map +1 -0
  69. package/dist/neutral/components/Card/Module/CardContent.d.ts +5 -0
  70. package/dist/neutral/components/Card/Module/CardContent.d.ts.map +1 -0
  71. package/dist/neutral/components/Card/Module/CardHeader.d.cts +5 -0
  72. package/dist/neutral/components/Card/Module/CardHeader.d.cts.map +1 -0
  73. package/dist/neutral/components/Card/Module/CardHeader.d.mts +5 -0
  74. package/dist/neutral/components/Card/Module/CardHeader.d.mts.map +1 -0
  75. package/dist/neutral/components/Card/Module/CardHeader.d.ts +5 -0
  76. package/dist/neutral/components/Card/Module/CardHeader.d.ts.map +1 -0
  77. package/dist/neutral/components/Card/Module/components/DiscoverDialog.d.cts +9 -0
  78. package/dist/neutral/components/Card/Module/components/DiscoverDialog.d.cts.map +1 -0
  79. package/dist/neutral/components/Card/Module/components/DiscoverDialog.d.mts +9 -0
  80. package/dist/neutral/components/Card/Module/components/DiscoverDialog.d.mts.map +1 -0
  81. package/dist/neutral/components/Card/Module/components/DiscoverDialog.d.ts +9 -0
  82. package/dist/neutral/components/Card/Module/components/DiscoverDialog.d.ts.map +1 -0
  83. package/dist/neutral/components/Card/Module/components/index.d.cts +2 -0
  84. package/dist/neutral/components/Card/Module/components/index.d.cts.map +1 -0
  85. package/dist/neutral/components/Card/Module/components/index.d.mts +2 -0
  86. package/dist/neutral/components/Card/Module/components/index.d.mts.map +1 -0
  87. package/dist/neutral/components/Card/Module/components/index.d.ts +2 -0
  88. package/dist/neutral/components/Card/Module/components/index.d.ts.map +1 -0
  89. package/dist/neutral/components/Card/Module/index.d.cts +5 -0
  90. package/dist/neutral/components/Card/Module/index.d.cts.map +1 -0
  91. package/dist/neutral/components/Card/Module/index.d.mts +5 -0
  92. package/dist/neutral/components/Card/Module/index.d.mts.map +1 -0
  93. package/dist/neutral/components/Card/Module/index.d.ts +5 -0
  94. package/dist/neutral/components/Card/Module/index.d.ts.map +1 -0
  95. package/dist/neutral/components/Card/index.d.cts +3 -0
  96. package/dist/neutral/components/Card/index.d.cts.map +1 -0
  97. package/dist/neutral/components/Card/index.d.mts +3 -0
  98. package/dist/neutral/components/Card/index.d.mts.map +1 -0
  99. package/dist/neutral/components/Card/index.d.ts +3 -0
  100. package/dist/neutral/components/Card/index.d.ts.map +1 -0
  101. package/dist/neutral/components/DetailsBox.d.cts +5 -0
  102. package/dist/neutral/components/DetailsBox.d.cts.map +1 -0
  103. package/dist/neutral/components/DetailsBox.d.mts +5 -0
  104. package/dist/neutral/components/DetailsBox.d.mts.map +1 -0
  105. package/dist/neutral/components/DetailsBox.d.ts +5 -0
  106. package/dist/neutral/components/DetailsBox.d.ts.map +1 -0
  107. package/dist/neutral/components/TableCell.d.cts +5 -0
  108. package/dist/neutral/components/TableCell.d.cts.map +1 -0
  109. package/dist/neutral/components/TableCell.d.mts +5 -0
  110. package/dist/neutral/components/TableCell.d.mts.map +1 -0
  111. package/dist/neutral/components/TableCell.d.ts +5 -0
  112. package/dist/neutral/components/TableCell.d.ts.map +1 -0
  113. package/dist/neutral/components/index.d.cts +4 -0
  114. package/dist/neutral/components/index.d.cts.map +1 -0
  115. package/dist/neutral/components/index.d.mts +4 -0
  116. package/dist/neutral/components/index.d.mts.map +1 -0
  117. package/dist/neutral/components/index.d.ts +4 -0
  118. package/dist/neutral/components/index.d.ts.map +1 -0
  119. package/dist/neutral/hooks/index.d.cts +2 -0
  120. package/dist/neutral/hooks/index.d.cts.map +1 -0
  121. package/dist/neutral/hooks/index.d.mts +2 -0
  122. package/dist/neutral/hooks/index.d.mts.map +1 -0
  123. package/dist/neutral/hooks/index.d.ts +2 -0
  124. package/dist/neutral/hooks/index.d.ts.map +1 -0
  125. package/dist/neutral/hooks/useRefresh.d.cts +4 -0
  126. package/dist/neutral/hooks/useRefresh.d.cts.map +1 -0
  127. package/dist/neutral/hooks/useRefresh.d.mts +4 -0
  128. package/dist/neutral/hooks/useRefresh.d.mts.map +1 -0
  129. package/dist/neutral/hooks/useRefresh.d.ts +4 -0
  130. package/dist/neutral/hooks/useRefresh.d.ts.map +1 -0
  131. package/dist/neutral/index.cjs +202 -0
  132. package/dist/neutral/index.cjs.map +1 -0
  133. package/dist/neutral/index.d.cts +4 -0
  134. package/dist/neutral/index.d.cts.map +1 -0
  135. package/dist/neutral/index.d.mts +4 -0
  136. package/dist/neutral/index.d.mts.map +1 -0
  137. package/dist/neutral/index.d.ts +4 -0
  138. package/dist/neutral/index.d.ts.map +1 -0
  139. package/dist/neutral/index.js +179 -0
  140. package/dist/neutral/index.js.map +1 -0
  141. package/dist/node/ModuleRenderProps.d.cts +1 -1
  142. package/dist/node/ModuleRenderProps.d.cts.map +1 -1
  143. package/dist/node/ModuleRenderProps.d.mts +1 -1
  144. package/dist/node/ModuleRenderProps.d.mts.map +1 -1
  145. package/dist/node/ModuleRenderProps.d.ts +1 -1
  146. package/dist/node/ModuleRenderProps.d.ts.map +1 -1
  147. package/dist/node/components/Card/Module/components/DiscoverDialog.d.cts +1 -1
  148. package/dist/node/components/Card/Module/components/DiscoverDialog.d.cts.map +1 -1
  149. package/dist/node/components/Card/Module/components/DiscoverDialog.d.mts +1 -1
  150. package/dist/node/components/Card/Module/components/DiscoverDialog.d.mts.map +1 -1
  151. package/dist/node/components/Card/Module/components/DiscoverDialog.d.ts +1 -1
  152. package/dist/node/components/Card/Module/components/DiscoverDialog.d.ts.map +1 -1
  153. package/dist/node/index.cjs +34 -34
  154. package/dist/node/index.cjs.map +1 -1
  155. package/dist/node/index.js +34 -34
  156. package/dist/node/index.js.map +1 -1
  157. package/package.json +16 -16
  158. package/src/ModuleRenderProps.tsx +1 -1
  159. package/src/components/Card/Diviner/Card.stories.tsx +4 -4
  160. package/src/components/Card/Diviner/Card.tsx +4 -4
  161. package/src/components/Card/Diviner/CardHeader.tsx +2 -2
  162. package/src/components/Card/Module/Card.stories.tsx +4 -4
  163. package/src/components/Card/Module/Card.tsx +4 -4
  164. package/src/components/Card/Module/CardActions.tsx +4 -4
  165. package/src/components/Card/Module/CardHeader.tsx +7 -7
  166. package/src/components/Card/Module/components/DiscoverDialog.tsx +5 -5
  167. package/src/components/DetailsBox.stories.tsx +3 -3
  168. package/src/components/DetailsBox.tsx +7 -7
  169. package/src/components/TableCell.tsx +2 -2
@@ -6,15 +6,15 @@ import { useState } from 'react'
6
6
  import { ModuleRenderProps } from '../../../ModuleRenderProps'
7
7
  import { DiscoverDialog } from './components'
8
8
 
9
- export const ModuleCardActions: React.FC<CardActionsProps & ModuleRenderProps> = ({ children, module, sx, ...props }) => {
9
+ export const ModuleCardActions: React.FC<CardActionsProps & ModuleRenderProps> = ({ children, mod, sx, ...props }) => {
10
10
  const [discoverDialogOpen, setDiscoverDialogOpen] = useState(false)
11
11
 
12
- const config = module?.config
12
+ const config = mod?.config
13
13
 
14
14
  return (
15
15
  <CardActions sx={{ alignItems: 'stretch', flexDirection: 'column', ml: 1, ...sx }} {...props}>
16
16
  <FlexRow justifyContent="space-between" gap={1} alignItems="center">
17
- {module ?
17
+ {mod ?
18
18
  <Chip label={config?.schema} size={'small'} />
19
19
  : null}
20
20
  {children}
@@ -22,7 +22,7 @@ export const ModuleCardActions: React.FC<CardActionsProps & ModuleRenderProps> =
22
22
  Discover
23
23
  </ButtonEx>
24
24
  </FlexRow>
25
- <DiscoverDialog fullWidth maxWidth={'md'} module={module} open={discoverDialogOpen} setOpen={setDiscoverDialogOpen} />
25
+ <DiscoverDialog fullWidth maxWidth={'md'} mod={mod} open={discoverDialogOpen} setOpen={setDiscoverDialogOpen} />
26
26
  </CardActions>
27
27
  )
28
28
  }
@@ -6,21 +6,21 @@ import { ModuleRenderProps } from '../../../ModuleRenderProps'
6
6
 
7
7
  const moduleTypes = ['sentinel', 'bridge', 'archivist', 'diviner', 'node', 'witness']
8
8
 
9
- const getModuleIcons = (moduleType: string, module: Module) => {
10
- return module?.queries.find((query) => query.startsWith(`network.xyo.query.${moduleType}`)) ? findNetworkComponent(moduleType)?.icon : null
9
+ const getModuleIcons = (moduleType: string, mod: Module) => {
10
+ return mod?.queries.find((query) => query.startsWith(`network.xyo.query.${moduleType}`)) ? findNetworkComponent(moduleType)?.icon : null
11
11
  }
12
12
 
13
- export const ModuleCardHeader: React.FC<ModuleRenderProps & CardHeaderProps> = ({ subheader, avatar, title, module, ...props }) => {
13
+ export const ModuleCardHeader: React.FC<ModuleRenderProps & CardHeaderProps> = ({ subheader, avatar, title, mod, ...props }) => {
14
14
  return (
15
15
  <CardHeader
16
- title={title ?? module?.config.name ?? 'Module'}
17
- subheader={subheader ?? module?.address}
16
+ title={title ?? mod?.config.name ?? 'Module'}
17
+ subheader={subheader ?? mod?.address}
18
18
  avatar={
19
19
  avatar ?? (
20
20
  <>
21
- {module ?
21
+ {mod ?
22
22
  moduleTypes.map((moduleType) => {
23
- const Icon = getModuleIcons(moduleType, module)
23
+ const Icon = getModuleIcons(moduleType, mod)
24
24
  return Icon ? <Icon key={moduleType} fontSize={'large'} color="primary" /> : null
25
25
  })
26
26
  : null}
@@ -4,20 +4,20 @@ import { ModuleInstance } from '@xyo-network/module-model'
4
4
  import { Dispatch, SetStateAction } from 'react'
5
5
 
6
6
  export interface DiscoverDialogProps extends DialogProps {
7
- module?: ModuleInstance
7
+ mod?: ModuleInstance
8
8
  setOpen?: Dispatch<SetStateAction<boolean>>
9
9
  }
10
10
 
11
11
  // Add a dialogue title and quick tip to show description of discover query
12
12
 
13
- export const DiscoverDialog: React.FC<DiscoverDialogProps> = ({ module, setOpen, ...props }) => {
13
+ export const DiscoverDialog: React.FC<DiscoverDialogProps> = ({ mod, setOpen, ...props }) => {
14
14
  const [discoverPayloads] = usePromise(async () => {
15
- return await module?.state()
16
- }, [module])
15
+ return await mod?.state()
16
+ }, [mod])
17
17
 
18
18
  return (
19
19
  <Dialog {...props}>
20
- <DialogTitle>Supported Queries for {module?.config.name || module?.address}</DialogTitle>
20
+ <DialogTitle>Supported Queries for {mod?.config.name || mod?.address}</DialogTitle>
21
21
  <Divider />
22
22
  <DialogContent>
23
23
  <Paper sx={{ p: 1 }}>
@@ -34,7 +34,7 @@ const NodeTemplate: StoryFn<typeof ModuleDetailsBox> = (args) => {
34
34
  )
35
35
  return (
36
36
  <FlexCol minHeight="80vh" alignItems="stretch">
37
- <ModuleDetailsBox module={node} {...args} />
37
+ <ModuleDetailsBox mod={node} {...args} />
38
38
  </FlexCol>
39
39
  )
40
40
  }
@@ -56,7 +56,7 @@ const ArchivistTemplate: StoryFn<typeof ModuleDetailsBox> = (args) => {
56
56
  )
57
57
  return (
58
58
  <FlexCol minHeight="80vh" alignItems="stretch">
59
- <ModuleDetailsBox module={archivist} {...args} />
59
+ <ModuleDetailsBox mod={archivist} {...args} />
60
60
  </FlexCol>
61
61
  )
62
62
  }
@@ -78,7 +78,7 @@ const DivinerTemplate: StoryFn<typeof ModuleDetailsBox> = (args) => {
78
78
  )
79
79
  return (
80
80
  <FlexCol minHeight="80vh" alignItems="stretch">
81
- <ModuleDetailsBox module={diviner} {...args} />
81
+ <ModuleDetailsBox mod={diviner} {...args} />
82
82
  </FlexCol>
83
83
  )
84
84
  }
@@ -8,18 +8,18 @@ import { useState } from 'react'
8
8
 
9
9
  import { ModuleRenderProps } from '../ModuleRenderProps'
10
10
 
11
- const getModuleIcon = (moduleType: string, module: Module) => {
12
- return module?.queries.find((query) => query.startsWith(`network.xyo.query.${moduleType}`)) ? findNetworkComponent(moduleType)?.icon() : null
11
+ const getModuleIcon = (moduleType: string, mod: Module) => {
12
+ return mod?.queries.find((query) => query.startsWith(`network.xyo.query.${moduleType}`)) ? findNetworkComponent(moduleType)?.icon() : null
13
13
  }
14
14
 
15
- export const ModuleDetailsBox: React.FC<ModuleRenderProps & FlexBoxProps> = ({ children, module, ...props }) => {
15
+ export const ModuleDetailsBox: React.FC<ModuleRenderProps & FlexBoxProps> = ({ children, mod, ...props }) => {
16
16
  const [showQueries, setShowQueries] = useState(false)
17
17
  return (
18
18
  <FlexCol {...props}>
19
19
  <FlexRow>
20
- {module ?
20
+ {mod ?
21
21
  ['sentinel', 'bridge', 'archivist', 'diviner', 'node'].map((moduleType) => {
22
- const icon = getModuleIcon(moduleType, module)
22
+ const icon = getModuleIcon(moduleType, mod)
23
23
  return icon ?
24
24
  <ButtonEx onClick={() => setShowQueries(!showQueries)} key={moduleType}>
25
25
  {icon}
@@ -27,11 +27,11 @@ export const ModuleDetailsBox: React.FC<ModuleRenderProps & FlexBoxProps> = ({ c
27
27
  : null
28
28
  })
29
29
  : null}
30
- <EthAccountBox address={EthAddress.fromString(module?.address)} />
30
+ <EthAccountBox address={EthAddress.fromString(mod?.address)} />
31
31
  </FlexRow>
32
32
 
33
33
  {showQueries ?
34
- module?.queries.map((query) => {
34
+ mod?.queries.map((query) => {
35
35
  return <FlexRow key={query}>{query}</FlexRow>
36
36
  })
37
37
  : null}
@@ -4,10 +4,10 @@ import { EthAccountBox } from '@xylabs/react-crypto'
4
4
 
5
5
  import { ModuleRenderProps } from '../ModuleRenderProps'
6
6
 
7
- export const ModuleTableCell: React.FC<ModuleRenderProps & TableCellProps> = ({ children, module, ...props }) => {
7
+ export const ModuleTableCell: React.FC<ModuleRenderProps & TableCellProps> = ({ children, mod, ...props }) => {
8
8
  return (
9
9
  <TableCell {...props}>
10
- <EthAccountBox address={EthAddress.fromString(module?.address)} />
10
+ <EthAccountBox address={EthAddress.fromString(mod?.address)} />
11
11
  {children}
12
12
  </TableCell>
13
13
  )