@xyo-network/react-module 7.5.8 → 7.5.12

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.
@@ -1,7 +1,7 @@
1
1
  import type { ModuleInstance } from '@xyo-network/module-model';
2
- export type ModuleRenderProps<T extends ModuleInstance = ModuleInstance> = {
2
+ export interface ModuleRenderProps<T extends ModuleInstance = ModuleInstance> {
3
3
  address?: string;
4
4
  mod?: T;
5
5
  name?: string;
6
- };
6
+ }
7
7
  //# sourceMappingURL=ModuleRenderProps.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ModuleRenderProps.d.ts","sourceRoot":"","sources":["../../src/ModuleRenderProps.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE/D,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,IAAI;IACzE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,GAAG,CAAC,EAAE,CAAC,CAAA;IACP,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA"}
1
+ {"version":3,"file":"ModuleRenderProps.d.ts","sourceRoot":"","sources":["../../src/ModuleRenderProps.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE/D,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,GAAG,CAAC,EAAE,CAAC,CAAA;IACP,IAAI,CAAC,EAAE,MAAM,CAAA;CACd"}
@@ -1 +1 @@
1
- {"version":3,"file":"DetailsBox.d.ts","sourceRoot":"","sources":["../../../src/components/DetailsBox.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAIzD,OAAO,KAAmB,MAAM,OAAO,CAAA;AAEvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAMjE,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,GAAG,YAAY,CA8BvE,CAAA"}
1
+ {"version":3,"file":"DetailsBox.d.ts","sourceRoot":"","sources":["../../../src/components/DetailsBox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAKzD,OAAO,KAAmB,MAAM,OAAO,CAAA;AAEvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAMjE,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,GAAG,YAAY,CA8BvE,CAAA"}
@@ -1,195 +1,210 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
1
  // src/components/Card/Diviner/Card.tsx
5
2
  import { Card as Card2 } from "@mui/material";
6
- import React8 from "react";
7
3
 
8
4
  // src/components/Card/Module/Card.tsx
9
5
  import { Card } from "@mui/material";
10
- import React5 from "react";
11
6
 
12
7
  // src/components/Card/Module/CardActions.tsx
13
8
  import { CardActions, Chip } from "@mui/material";
14
9
  import { ButtonEx } from "@xylabs/react-button";
15
10
  import { FlexRow } from "@xylabs/react-flexbox";
16
- import React2, { useState } from "react";
11
+ import { useState } from "react";
17
12
 
18
13
  // src/components/Card/Module/components/DiscoverDialog.tsx
19
- import { Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, Paper } from "@mui/material";
14
+ import {
15
+ Button,
16
+ Dialog,
17
+ DialogActions,
18
+ DialogContent,
19
+ DialogContentText,
20
+ DialogTitle,
21
+ Divider,
22
+ Paper
23
+ } from "@mui/material";
20
24
  import { usePromise } from "@xylabs/react-promise";
21
- import React from "react";
22
- var DiscoverDialog = /* @__PURE__ */ __name(({ mod, setOpen, ...props }) => {
25
+ import { jsx, jsxs } from "react/jsx-runtime";
26
+ var DiscoverDialog = ({
27
+ mod,
28
+ setOpen,
29
+ ...props
30
+ }) => {
23
31
  const [discoverPayloads] = usePromise(async () => {
24
32
  return await mod?.state();
25
- }, [
26
- mod
27
- ]);
28
- return /* @__PURE__ */ React.createElement(Dialog, props, /* @__PURE__ */ React.createElement(DialogTitle, null, "Supported Queries for", mod?.config.name || mod?.address), /* @__PURE__ */ React.createElement(Divider, null), /* @__PURE__ */ React.createElement(DialogContent, null, /* @__PURE__ */ React.createElement(Paper, {
29
- sx: {
30
- p: 1
31
- }
32
- }, /* @__PURE__ */ React.createElement(DialogContentText, null, "All modules share a set of base queries along with ones specific to the module."), /* @__PURE__ */ React.createElement("pre", null, JSON.stringify(discoverPayloads, null, 2)))), /* @__PURE__ */ React.createElement(DialogActions, null, /* @__PURE__ */ React.createElement(Button, {
33
- onClick: /* @__PURE__ */ __name(() => setOpen?.(false), "onClick"),
34
- variant: "outlined"
35
- }, "Close")));
36
- }, "DiscoverDialog");
33
+ }, [mod]);
34
+ return /* @__PURE__ */ jsxs(Dialog, { ...props, children: [
35
+ /* @__PURE__ */ jsxs(DialogTitle, { children: [
36
+ "Supported Queries for",
37
+ mod?.config.name || mod?.address
38
+ ] }),
39
+ /* @__PURE__ */ jsx(Divider, {}),
40
+ /* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsxs(Paper, { sx: { p: 1 }, children: [
41
+ /* @__PURE__ */ jsx(DialogContentText, { children: "All modules share a set of base queries along with ones specific to the module." }),
42
+ /* @__PURE__ */ jsx("pre", { children: JSON.stringify(discoverPayloads, null, 2) })
43
+ ] }) }),
44
+ /* @__PURE__ */ jsx(DialogActions, { children: /* @__PURE__ */ jsx(Button, { onClick: () => setOpen?.(false), variant: "outlined", children: "Close" }) })
45
+ ] });
46
+ };
37
47
 
38
48
  // src/components/Card/Module/CardActions.tsx
39
- var ModuleCardActions = /* @__PURE__ */ __name(({ children, mod, sx, ...props }) => {
49
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
50
+ var ModuleCardActions = ({
51
+ children,
52
+ mod,
53
+ sx,
54
+ ...props
55
+ }) => {
40
56
  const [discoverDialogOpen, setDiscoverDialogOpen] = useState(false);
41
57
  const config = mod?.config;
42
- return /* @__PURE__ */ React2.createElement(CardActions, {
43
- sx: {
44
- alignItems: "stretch",
45
- flexDirection: "column",
46
- ml: 1,
47
- ...sx
48
- },
49
- ...props
50
- }, /* @__PURE__ */ React2.createElement(FlexRow, {
51
- justifyContent: "space-between",
52
- gap: 1,
53
- alignItems: "center"
54
- }, mod ? /* @__PURE__ */ React2.createElement(Chip, {
55
- label: config?.schema,
56
- size: "small"
57
- }) : null, children, /* @__PURE__ */ React2.createElement(ButtonEx, {
58
- onClick: /* @__PURE__ */ __name(() => setDiscoverDialogOpen(true), "onClick"),
59
- size: "small",
60
- variant: "outlined"
61
- }, "Discover")), /* @__PURE__ */ React2.createElement(DiscoverDialog, {
62
- fullWidth: true,
63
- maxWidth: "md",
64
- mod,
65
- open: discoverDialogOpen,
66
- setOpen: setDiscoverDialogOpen
67
- }));
68
- }, "ModuleCardActions");
58
+ return /* @__PURE__ */ jsxs2(
59
+ CardActions,
60
+ {
61
+ sx: {
62
+ alignItems: "stretch",
63
+ flexDirection: "column",
64
+ ml: 1,
65
+ ...sx
66
+ },
67
+ ...props,
68
+ children: [
69
+ /* @__PURE__ */ jsxs2(FlexRow, { justifyContent: "space-between", gap: 1, alignItems: "center", children: [
70
+ mod ? /* @__PURE__ */ jsx2(Chip, { label: config?.schema, size: "small" }) : null,
71
+ children,
72
+ /* @__PURE__ */ jsx2(ButtonEx, { onClick: () => setDiscoverDialogOpen(true), size: "small", variant: "outlined", children: "Discover" })
73
+ ] }),
74
+ /* @__PURE__ */ jsx2(DiscoverDialog, { fullWidth: true, maxWidth: "md", mod, open: discoverDialogOpen, setOpen: setDiscoverDialogOpen })
75
+ ]
76
+ }
77
+ );
78
+ };
69
79
 
70
80
  // src/components/Card/Module/CardContent.tsx
71
81
  import { CardContent } from "@mui/material";
72
- import React3 from "react";
73
- var ModuleCardContent = /* @__PURE__ */ __name(({ children, ...props }) => {
74
- return /* @__PURE__ */ React3.createElement(CardContent, props, children);
75
- }, "ModuleCardContent");
82
+ import { jsx as jsx3 } from "react/jsx-runtime";
83
+ var ModuleCardContent = ({ children, ...props }) => {
84
+ return /* @__PURE__ */ jsx3(CardContent, { ...props, children });
85
+ };
76
86
 
77
87
  // src/components/Card/Module/CardHeader.tsx
78
88
  import { CardHeader } from "@mui/material";
79
89
  import { findNetworkComponent } from "@xyo-network/react-shared";
80
- import React4 from "react";
81
- var moduleTypes = [
82
- "sentinel",
83
- "bridge",
84
- "archivist",
85
- "diviner",
86
- "node",
87
- "witness"
88
- ];
89
- var getModuleIcons = /* @__PURE__ */ __name((moduleType, mod) => {
90
+ import { Fragment, jsx as jsx4 } from "react/jsx-runtime";
91
+ var moduleTypes = ["sentinel", "bridge", "archivist", "diviner", "node", "witness"];
92
+ var getModuleIcons = (moduleType, mod) => {
90
93
  return mod?.queries.find((query) => query.startsWith(`network.xyo.query.${moduleType}`)) ? findNetworkComponent(moduleType)?.icon : null;
91
- }, "getModuleIcons");
92
- var ModuleCardHeader = /* @__PURE__ */ __name(({ subheader, avatar, title, mod, ...props }) => {
93
- return /* @__PURE__ */ React4.createElement(CardHeader, {
94
- title: title ?? mod?.config.name ?? "Module",
95
- subheader: subheader ?? mod?.address,
96
- avatar: avatar ?? /* @__PURE__ */ React4.createElement(React4.Fragment, null, mod ? moduleTypes.map((moduleType) => {
97
- const Icon = getModuleIcons(moduleType, mod);
98
- return Icon ? /* @__PURE__ */ React4.createElement(Icon, {
99
- key: moduleType,
100
- fontSize: "large",
101
- color: "primary"
102
- }) : null;
103
- }) : null),
104
- ...props
105
- });
106
- }, "ModuleCardHeader");
94
+ };
95
+ var ModuleCardHeader = ({
96
+ subheader,
97
+ avatar,
98
+ title,
99
+ mod,
100
+ ...props
101
+ }) => {
102
+ return /* @__PURE__ */ jsx4(
103
+ CardHeader,
104
+ {
105
+ title: title ?? mod?.config.name ?? "Module",
106
+ subheader: subheader ?? mod?.address,
107
+ avatar: avatar ?? /* @__PURE__ */ jsx4(Fragment, { children: mod ? moduleTypes.map((moduleType) => {
108
+ const Icon = getModuleIcons(moduleType, mod);
109
+ return Icon ? /* @__PURE__ */ jsx4(Icon, { fontSize: "large", color: "primary" }, moduleType) : null;
110
+ }) : null }),
111
+ ...props
112
+ }
113
+ );
114
+ };
107
115
 
108
116
  // src/components/Card/Module/Card.tsx
109
- var ModuleCard = /* @__PURE__ */ __name(({ mod, ...props }) => {
110
- return /* @__PURE__ */ React5.createElement(Card, props, /* @__PURE__ */ React5.createElement(ModuleCardHeader, {
111
- mod
112
- }), /* @__PURE__ */ React5.createElement(ModuleCardContent, {
113
- mod
114
- }), /* @__PURE__ */ React5.createElement(ModuleCardActions, {
115
- mod
116
- }));
117
- }, "ModuleCard");
117
+ import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
118
+ var ModuleCard = ({ mod, ...props }) => {
119
+ return /* @__PURE__ */ jsxs3(Card, { ...props, children: [
120
+ /* @__PURE__ */ jsx5(ModuleCardHeader, { mod }),
121
+ /* @__PURE__ */ jsx5(ModuleCardContent, { mod }),
122
+ /* @__PURE__ */ jsx5(ModuleCardActions, { mod })
123
+ ] });
124
+ };
118
125
 
119
126
  // src/components/Card/Diviner/CardContent.tsx
120
- import React6 from "react";
121
- var DivinerCardContent = /* @__PURE__ */ __name(({ children, ...props }) => {
122
- return /* @__PURE__ */ React6.createElement(ModuleCardContent, props, children);
123
- }, "DivinerCardContent");
127
+ import { jsx as jsx6 } from "react/jsx-runtime";
128
+ var DivinerCardContent = ({ children, ...props }) => {
129
+ return /* @__PURE__ */ jsx6(ModuleCardContent, { ...props, children });
130
+ };
124
131
 
125
132
  // src/components/Card/Diviner/CardHeader.tsx
126
- import React7 from "react";
127
- var DivinerCardHeader = /* @__PURE__ */ __name(({ title, mod, ...props }) => {
128
- return /* @__PURE__ */ React7.createElement(ModuleCardHeader, {
129
- mod,
130
- title: title ?? mod?.config.name ?? "Diviner",
131
- ...props
132
- });
133
- }, "DivinerCardHeader");
133
+ import { jsx as jsx7 } from "react/jsx-runtime";
134
+ var DivinerCardHeader = ({
135
+ title,
136
+ mod,
137
+ ...props
138
+ }) => {
139
+ return /* @__PURE__ */ jsx7(ModuleCardHeader, { mod, title: title ?? mod?.config.name ?? "Diviner", ...props });
140
+ };
134
141
 
135
142
  // src/components/Card/Diviner/Card.tsx
136
- var DivinerCard = /* @__PURE__ */ __name(({ children, mod, ...props }) => {
137
- return /* @__PURE__ */ React8.createElement(Card2, props, /* @__PURE__ */ React8.createElement(DivinerCardHeader, {
138
- mod
139
- }), /* @__PURE__ */ React8.createElement(DivinerCardContent, {
140
- mod
141
- }), children, /* @__PURE__ */ React8.createElement(ModuleCardActions, {
142
- mod
143
- }));
144
- }, "DivinerCard");
143
+ import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
144
+ var DivinerCard = ({
145
+ children,
146
+ mod,
147
+ ...props
148
+ }) => {
149
+ return /* @__PURE__ */ jsxs4(Card2, { ...props, children: [
150
+ /* @__PURE__ */ jsx8(DivinerCardHeader, { mod }),
151
+ /* @__PURE__ */ jsx8(DivinerCardContent, { mod }),
152
+ children,
153
+ /* @__PURE__ */ jsx8(ModuleCardActions, { mod })
154
+ ] });
155
+ };
145
156
 
146
157
  // src/components/DetailsBox.tsx
147
- import { EthAddressWrapper } from "@xylabs/eth-address";
148
158
  import { ButtonEx as ButtonEx2 } from "@xylabs/react-button";
149
159
  import { EthAccountBox } from "@xylabs/react-crypto";
150
160
  import { FlexCol, FlexRow as FlexRow2 } from "@xylabs/react-flexbox";
161
+ import { EthAddressWrapper } from "@xylabs/sdk-js";
151
162
  import { findNetworkComponent as findNetworkComponent2 } from "@xyo-network/react-shared";
152
- import React9, { useState as useState2 } from "react";
153
- var getModuleIcon = /* @__PURE__ */ __name((moduleType, mod) => {
163
+ import { useState as useState2 } from "react";
164
+ import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
165
+ var getModuleIcon = (moduleType, mod) => {
154
166
  return mod?.queries.find((query) => query.startsWith(`network.xyo.query.${moduleType}`)) ? findNetworkComponent2(moduleType)?.icon() : null;
155
- }, "getModuleIcon");
156
- var ModuleDetailsBox = /* @__PURE__ */ __name(({ children, mod, ...props }) => {
167
+ };
168
+ var ModuleDetailsBox = ({
169
+ children,
170
+ mod,
171
+ ...props
172
+ }) => {
157
173
  const [showQueries, setShowQueries] = useState2(false);
158
- return /* @__PURE__ */ React9.createElement(FlexCol, props, /* @__PURE__ */ React9.createElement(FlexRow2, null, mod ? [
159
- "sentinel",
160
- "bridge",
161
- "archivist",
162
- "diviner",
163
- "node"
164
- ].map((moduleType) => {
165
- const icon = getModuleIcon(moduleType, mod);
166
- return icon ? /* @__PURE__ */ React9.createElement(ButtonEx2, {
167
- onClick: /* @__PURE__ */ __name(() => setShowQueries(!showQueries), "onClick"),
168
- key: moduleType
169
- }, icon) : null;
170
- }) : null, /* @__PURE__ */ React9.createElement(EthAccountBox, {
171
- address: EthAddressWrapper.fromString(mod?.address)
172
- })), showQueries ? mod?.queries.map((query) => {
173
- return /* @__PURE__ */ React9.createElement(FlexRow2, {
174
- key: query
175
- }, query);
176
- }) : null, children);
177
- }, "ModuleDetailsBox");
174
+ return /* @__PURE__ */ jsxs5(FlexCol, { ...props, children: [
175
+ /* @__PURE__ */ jsxs5(FlexRow2, { children: [
176
+ mod ? ["sentinel", "bridge", "archivist", "diviner", "node"].map((moduleType) => {
177
+ const icon = getModuleIcon(moduleType, mod);
178
+ return icon ? /* @__PURE__ */ jsx9(ButtonEx2, { onClick: () => setShowQueries(!showQueries), children: icon }, moduleType) : null;
179
+ }) : null,
180
+ /* @__PURE__ */ jsx9(EthAccountBox, { address: EthAddressWrapper.fromString(mod?.address) })
181
+ ] }),
182
+ showQueries ? mod?.queries.map((query) => {
183
+ return /* @__PURE__ */ jsx9(FlexRow2, { children: query }, query);
184
+ }) : null,
185
+ children
186
+ ] });
187
+ };
178
188
 
179
189
  // src/components/TableCell.tsx
180
190
  import { TableCell } from "@mui/material";
181
- import { EthAddressWrapper as EthAddressWrapper2 } from "@xylabs/eth-address";
182
191
  import { EthAccountBox as EthAccountBox2 } from "@xylabs/react-crypto";
183
- import React10 from "react";
184
- var ModuleTableCell = /* @__PURE__ */ __name(({ children, mod, ...props }) => {
185
- return /* @__PURE__ */ React10.createElement(TableCell, props, /* @__PURE__ */ React10.createElement(EthAccountBox2, {
186
- address: EthAddressWrapper2.fromString(mod?.address)
187
- }), children);
188
- }, "ModuleTableCell");
192
+ import { EthAddressWrapper as EthAddressWrapper2 } from "@xylabs/sdk-js";
193
+ import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
194
+ var ModuleTableCell = ({
195
+ children,
196
+ mod,
197
+ ...props
198
+ }) => {
199
+ return /* @__PURE__ */ jsxs6(TableCell, { ...props, children: [
200
+ /* @__PURE__ */ jsx10(EthAccountBox2, { address: EthAddressWrapper2.fromString(mod?.address) }),
201
+ children
202
+ ] });
203
+ };
189
204
 
190
205
  // src/hooks/useRefresh.tsx
191
206
  import { useState as useState3 } from "react";
192
- var useRefresh = /* @__PURE__ */ __name(() => {
207
+ var useRefresh = () => {
193
208
  const [count, setCount] = useState3(1);
194
209
  return [
195
210
  count,
@@ -200,7 +215,7 @@ var useRefresh = /* @__PURE__ */ __name(() => {
200
215
  },
201
216
  () => setCount(0)
202
217
  ];
203
- }, "useRefresh");
218
+ };
204
219
  export {
205
220
  DivinerCard,
206
221
  DivinerCardContent,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/Card/Diviner/Card.tsx","../../src/components/Card/Module/Card.tsx","../../src/components/Card/Module/CardActions.tsx","../../src/components/Card/Module/components/DiscoverDialog.tsx","../../src/components/Card/Module/CardContent.tsx","../../src/components/Card/Module/CardHeader.tsx","../../src/components/Card/Diviner/CardContent.tsx","../../src/components/Card/Diviner/CardHeader.tsx","../../src/components/DetailsBox.tsx","../../src/components/TableCell.tsx","../../src/hooks/useRefresh.tsx"],"sourcesContent":["import type { CardProps } from '@mui/material'\nimport { Card } from '@mui/material'\nimport type { DivinerInstance } from '@xyo-network/diviner-model'\nimport React from 'react'\n\nimport type { ModuleRenderProps } from '../../../ModuleRenderProps.tsx'\nimport { ModuleCardActions } from '../Module/index.ts'\nimport { DivinerCardContent } from './CardContent.tsx'\nimport { DivinerCardHeader } from './CardHeader.tsx'\n\nexport const DivinerCard: React.FC<CardProps & ModuleRenderProps<DivinerInstance>> = ({\n children, mod, ...props\n}) => {\n return (\n <Card {...props}>\n <DivinerCardHeader mod={mod} />\n <DivinerCardContent mod={mod} />\n {children}\n <ModuleCardActions mod={mod} />\n </Card>\n )\n}\n","import type { CardProps } from '@mui/material'\nimport { Card } from '@mui/material'\nimport React from 'react'\n\nimport type { ModuleRenderProps } from '../../../ModuleRenderProps.tsx'\nimport { ModuleCardActions } from './CardActions.tsx'\nimport { ModuleCardContent } from './CardContent.tsx'\nimport { ModuleCardHeader } from './CardHeader.tsx'\n\nexport const ModuleCard: React.FC<CardProps & ModuleRenderProps> = ({ mod, ...props }) => {\n return (\n <Card {...props}>\n <ModuleCardHeader mod={mod} />\n <ModuleCardContent mod={mod} />\n <ModuleCardActions mod={mod} />\n </Card>\n )\n}\n","import type { CardActionsProps } from '@mui/material'\nimport { CardActions, Chip } from '@mui/material'\nimport { ButtonEx } from '@xylabs/react-button'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport React, { useState } from 'react'\n\nimport type { ModuleRenderProps } from '../../../ModuleRenderProps.tsx'\nimport { DiscoverDialog } from './components/index.ts'\n\nexport const ModuleCardActions: React.FC<CardActionsProps & ModuleRenderProps> = ({\n children, mod, sx, ...props\n}) => {\n const [discoverDialogOpen, setDiscoverDialogOpen] = useState(false)\n\n const config = mod?.config\n\n return (\n <CardActions\n sx={{\n alignItems: 'stretch', flexDirection: 'column', ml: 1, ...sx,\n }}\n {...props}\n >\n <FlexRow justifyContent=\"space-between\" gap={1} alignItems=\"center\">\n {mod\n ? <Chip label={config?.schema} size=\"small\" />\n : null}\n {children}\n <ButtonEx onClick={() => setDiscoverDialogOpen(true)} size=\"small\" variant=\"outlined\">\n Discover\n </ButtonEx>\n </FlexRow>\n <DiscoverDialog fullWidth maxWidth=\"md\" mod={mod} open={discoverDialogOpen} setOpen={setDiscoverDialogOpen} />\n </CardActions>\n )\n}\n","import type { DialogProps } from '@mui/material'\nimport {\n Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, Paper,\n} from '@mui/material'\nimport { usePromise } from '@xylabs/react-promise'\nimport type { ModuleInstance } from '@xyo-network/module-model'\nimport type { Dispatch, SetStateAction } from 'react'\nimport React from 'react'\n\nexport interface DiscoverDialogProps extends DialogProps {\n mod?: ModuleInstance\n setOpen?: Dispatch<SetStateAction<boolean>>\n}\n\n// Add a dialogue title and quick tip to show description of discover query\n\nexport const DiscoverDialog: React.FC<DiscoverDialogProps> = ({\n mod, setOpen, ...props\n}) => {\n const [discoverPayloads] = usePromise(async () => {\n return await mod?.state()\n }, [mod])\n\n return (\n <Dialog {...props}>\n <DialogTitle>\n Supported Queries for\n {mod?.config.name || mod?.address}\n </DialogTitle>\n <Divider />\n <DialogContent>\n <Paper sx={{ p: 1 }}>\n <DialogContentText>All modules share a set of base queries along with ones specific to the module.</DialogContentText>\n <pre>{JSON.stringify(discoverPayloads, null, 2)}</pre>\n </Paper>\n </DialogContent>\n <DialogActions>\n <Button onClick={() => setOpen?.(false)} variant=\"outlined\">\n Close\n </Button>\n </DialogActions>\n </Dialog>\n )\n}\n","import type { CardContentProps } from '@mui/material'\nimport { CardContent } from '@mui/material'\nimport React from 'react'\n\nimport type { ModuleRenderProps } from '../../../ModuleRenderProps.tsx'\n\nexport const ModuleCardContent: React.FC<ModuleRenderProps & CardContentProps> = ({ children, ...props }) => {\n return <CardContent {...props}>{children}</CardContent>\n}\n","import type { CardHeaderProps } from '@mui/material'\nimport { CardHeader } from '@mui/material'\nimport type { Module } from '@xyo-network/module-model'\nimport { findNetworkComponent } from '@xyo-network/react-shared'\nimport React from 'react'\n\nimport type { ModuleRenderProps } from '../../../ModuleRenderProps.tsx'\n\nconst moduleTypes = ['sentinel', 'bridge', 'archivist', 'diviner', 'node', 'witness']\n\nconst getModuleIcons = (moduleType: string, mod: Module) => {\n return mod?.queries.find(query => query.startsWith(`network.xyo.query.${moduleType}`)) ? findNetworkComponent(moduleType)?.icon : null\n}\n\nexport const ModuleCardHeader: React.FC<ModuleRenderProps & CardHeaderProps> = ({\n subheader, avatar, title, mod, ...props\n}) => {\n return (\n <CardHeader\n title={title ?? mod?.config.name ?? 'Module'}\n subheader={subheader ?? mod?.address}\n avatar={\n avatar ?? (\n <>\n {mod\n ? moduleTypes.map((moduleType) => {\n const Icon = getModuleIcons(moduleType, mod)\n return Icon ? <Icon key={moduleType} fontSize=\"large\" color=\"primary\" /> : null\n })\n : null}\n </>\n )\n }\n {...props}\n />\n )\n}\n","import type { CardContentProps } from '@mui/material'\nimport type { DivinerInstance } from '@xyo-network/diviner-model'\nimport React from 'react'\n\nimport type { ModuleRenderProps } from '../../../ModuleRenderProps.tsx'\nimport { ModuleCardContent } from '../Module/index.ts'\n\nexport const DivinerCardContent: React.FC<ModuleRenderProps<DivinerInstance> & CardContentProps> = ({ children, ...props }) => {\n return <ModuleCardContent {...props}>{children}</ModuleCardContent>\n}\n","import type { CardHeaderProps } from '@mui/material'\nimport type { DivinerInstance } from '@xyo-network/diviner-model'\nimport React from 'react'\n\nimport type { ModuleRenderProps } from '../../../ModuleRenderProps.tsx'\nimport { ModuleCardHeader } from '../Module/index.ts'\n\nexport const DivinerCardHeader: React.FC<ModuleRenderProps<DivinerInstance> & CardHeaderProps> = ({\n title, mod, ...props\n}) => {\n return <ModuleCardHeader mod={mod} title={title ?? mod?.config.name ?? 'Diviner'} {...props} />\n}\n","import { EthAddressWrapper } from '@xylabs/eth-address'\nimport { ButtonEx } from '@xylabs/react-button'\nimport { EthAccountBox } from '@xylabs/react-crypto'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexCol, FlexRow } from '@xylabs/react-flexbox'\nimport type { Module } from '@xyo-network/module-model'\nimport { findNetworkComponent } from '@xyo-network/react-shared'\nimport React, { useState } from 'react'\n\nimport type { ModuleRenderProps } from '../ModuleRenderProps.tsx'\n\nconst getModuleIcon = (moduleType: string, mod: Module) => {\n return mod?.queries.find(query => query.startsWith(`network.xyo.query.${moduleType}`)) ? findNetworkComponent(moduleType)?.icon() : null\n}\n\nexport const ModuleDetailsBox: React.FC<ModuleRenderProps & FlexBoxProps> = ({\n children, mod, ...props\n}) => {\n const [showQueries, setShowQueries] = useState(false)\n return (\n <FlexCol {...props}>\n <FlexRow>\n {mod\n ? ['sentinel', 'bridge', 'archivist', 'diviner', 'node'].map((moduleType) => {\n const icon = getModuleIcon(moduleType, mod)\n return icon\n ? (\n <ButtonEx onClick={() => setShowQueries(!showQueries)} key={moduleType}>\n {icon}\n </ButtonEx>\n )\n : null\n })\n : null}\n <EthAccountBox address={EthAddressWrapper.fromString(mod?.address)} />\n </FlexRow>\n\n {showQueries\n ? mod?.queries.map((query) => {\n return <FlexRow key={query}>{query}</FlexRow>\n })\n : null}\n {children}\n </FlexCol>\n )\n}\n","import type { TableCellProps } from '@mui/material'\nimport { TableCell } from '@mui/material'\nimport { EthAddressWrapper } from '@xylabs/eth-address'\nimport { EthAccountBox } from '@xylabs/react-crypto'\nimport React from 'react'\n\nimport type { ModuleRenderProps } from '../ModuleRenderProps.tsx'\n\nexport const ModuleTableCell: React.FC<ModuleRenderProps & TableCellProps> = ({\n children, mod, ...props\n}) => {\n return (\n <TableCell {...props}>\n <EthAccountBox address={EthAddressWrapper.fromString(mod?.address)} />\n {children}\n </TableCell>\n )\n}\n","import { useState } from 'react'\n\nexport type RefreshCallback = () => number\nexport type DisableCallback = () => void\n\nexport const useRefresh = (): [number, RefreshCallback, DisableCallback] => {\n const [count, setCount] = useState(1)\n return [\n count,\n () => {\n const newCount = count + 1\n setCount(newCount)\n return newCount\n },\n () => setCount(0),\n ]\n}\n"],"mappings":";;;;AACA,SAASA,QAAAA,aAAY;AAErB,OAAOC,YAAW;;;ACFlB,SAASC,YAAY;AACrB,OAAOC,YAAW;;;ACDlB,SAASC,aAAaC,YAAY;AAClC,SAASC,gBAAgB;AACzB,SAASC,eAAe;AACxB,OAAOC,UAASC,gBAAgB;;;ACHhC,SACEC,QAAQC,QAAQC,eAAeC,eAAeC,mBAAmBC,aAAaC,SAASC,aAClF;AACP,SAASC,kBAAkB;AAG3B,OAAOC,WAAW;AASX,IAAMC,iBAAgD,wBAAC,EAC5DC,KAAKC,SAAS,GAAGC,MAAAA,MAClB;AACC,QAAM,CAACC,gBAAAA,IAAoBC,WAAW,YAAA;AACpC,WAAO,MAAMJ,KAAKK,MAAAA;EACpB,GAAG;IAACL;GAAI;AAER,SACE,sBAAA,cAACM,QAAWJ,OACV,sBAAA,cAACK,aAAAA,MAAY,yBAEVP,KAAKQ,OAAOC,QAAQT,KAAKU,OAAAA,GAE5B,sBAAA,cAACC,SAAAA,IAAAA,GACD,sBAAA,cAACC,eAAAA,MACC,sBAAA,cAACC,OAAAA;IAAMC,IAAI;MAAEC,GAAG;IAAE;KAChB,sBAAA,cAACC,mBAAAA,MAAkB,iFAAA,GACnB,sBAAA,cAACC,OAAAA,MAAKC,KAAKC,UAAUhB,kBAAkB,MAAM,CAAA,CAAA,CAAA,CAAA,GAGjD,sBAAA,cAACiB,eAAAA,MACC,sBAAA,cAACC,QAAAA;IAAOC,SAAS,6BAAMrB,UAAU,KAAA,GAAhB;IAAwBsB,SAAQ;KAAW,OAAA,CAAA,CAAA;AAMpE,GA3B6D;;;ADPtD,IAAMC,oBAAoE,wBAAC,EAChFC,UAAUC,KAAKC,IAAI,GAAGC,MAAAA,MACvB;AACC,QAAM,CAACC,oBAAoBC,qBAAAA,IAAyBC,SAAS,KAAA;AAE7D,QAAMC,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AAAA;IAAcC,SAASC,mBAAkBC,WAAWP,KAAKK,OAAAA;MACzDN,QAAAA;AAGP,GAT6E;;;ACR7E,SAASS,YAAAA,iBAAgB;AAKlB,IAAMC,aAAa,6BAAA;AACxB,QAAM,CAACC,OAAOC,QAAAA,IAAYC,UAAS,CAAA;AACnC,SAAO;IACLF;IACA,MAAA;AACE,YAAMG,WAAWH,QAAQ;AACzBC,eAASE,QAAAA;AACT,aAAOA;IACT;IACA,MAAMF,SAAS,CAAA;;AAEnB,GAX0B;","names":["Card","React","Card","React","CardActions","Chip","ButtonEx","FlexRow","React","useState","Button","Dialog","DialogActions","DialogContent","DialogContentText","DialogTitle","Divider","Paper","usePromise","React","DiscoverDialog","mod","setOpen","props","discoverPayloads","usePromise","state","Dialog","DialogTitle","config","name","address","Divider","DialogContent","Paper","sx","p","DialogContentText","pre","JSON","stringify","DialogActions","Button","onClick","variant","ModuleCardActions","children","mod","sx","props","discoverDialogOpen","setDiscoverDialogOpen","useState","config","React","CardActions","alignItems","flexDirection","ml","FlexRow","justifyContent","gap","Chip","label","schema","size","ButtonEx","onClick","variant","DiscoverDialog","fullWidth","maxWidth","open","setOpen","CardContent","React","ModuleCardContent","children","props","React","CardContent","CardHeader","findNetworkComponent","React","moduleTypes","getModuleIcons","moduleType","mod","queries","find","query","startsWith","findNetworkComponent","icon","ModuleCardHeader","subheader","avatar","title","props","React","CardHeader","config","name","address","map","Icon","key","fontSize","color","ModuleCard","mod","props","React","Card","ModuleCardHeader","ModuleCardContent","ModuleCardActions","React","DivinerCardContent","children","props","React","ModuleCardContent","React","DivinerCardHeader","title","mod","props","React","ModuleCardHeader","config","name","DivinerCard","children","mod","props","React","Card","DivinerCardHeader","DivinerCardContent","ModuleCardActions","EthAddressWrapper","ButtonEx","EthAccountBox","FlexCol","FlexRow","findNetworkComponent","React","useState","getModuleIcon","moduleType","mod","queries","find","query","startsWith","findNetworkComponent","icon","ModuleDetailsBox","children","props","showQueries","setShowQueries","useState","React","FlexCol","FlexRow","map","ButtonEx","onClick","key","EthAccountBox","address","EthAddressWrapper","fromString","TableCell","EthAddressWrapper","EthAccountBox","React","ModuleTableCell","children","mod","props","React","TableCell","EthAccountBox","address","EthAddressWrapper","fromString","useState","useRefresh","count","setCount","useState","newCount"]}
1
+ {"version":3,"sources":["../../src/components/Card/Diviner/Card.tsx","../../src/components/Card/Module/Card.tsx","../../src/components/Card/Module/CardActions.tsx","../../src/components/Card/Module/components/DiscoverDialog.tsx","../../src/components/Card/Module/CardContent.tsx","../../src/components/Card/Module/CardHeader.tsx","../../src/components/Card/Diviner/CardContent.tsx","../../src/components/Card/Diviner/CardHeader.tsx","../../src/components/DetailsBox.tsx","../../src/components/TableCell.tsx","../../src/hooks/useRefresh.tsx"],"sourcesContent":["import type { CardProps } from '@mui/material'\nimport { Card } from '@mui/material'\nimport type { DivinerInstance } from '@xyo-network/diviner-model'\nimport React from 'react'\n\nimport type { ModuleRenderProps } from '../../../ModuleRenderProps.tsx'\nimport { ModuleCardActions } from '../Module/index.ts'\nimport { DivinerCardContent } from './CardContent.tsx'\nimport { DivinerCardHeader } from './CardHeader.tsx'\n\nexport const DivinerCard: React.FC<CardProps & ModuleRenderProps<DivinerInstance>> = ({\n children, mod, ...props\n}) => {\n return (\n <Card {...props}>\n <DivinerCardHeader mod={mod} />\n <DivinerCardContent mod={mod} />\n {children}\n <ModuleCardActions mod={mod} />\n </Card>\n )\n}\n","import type { CardProps } from '@mui/material'\nimport { Card } from '@mui/material'\nimport React from 'react'\n\nimport type { ModuleRenderProps } from '../../../ModuleRenderProps.tsx'\nimport { ModuleCardActions } from './CardActions.tsx'\nimport { ModuleCardContent } from './CardContent.tsx'\nimport { ModuleCardHeader } from './CardHeader.tsx'\n\nexport const ModuleCard: React.FC<CardProps & ModuleRenderProps> = ({ mod, ...props }) => {\n return (\n <Card {...props}>\n <ModuleCardHeader mod={mod} />\n <ModuleCardContent mod={mod} />\n <ModuleCardActions mod={mod} />\n </Card>\n )\n}\n","import type { CardActionsProps } from '@mui/material'\nimport { CardActions, Chip } from '@mui/material'\nimport { ButtonEx } from '@xylabs/react-button'\nimport { FlexRow } from '@xylabs/react-flexbox'\nimport React, { useState } from 'react'\n\nimport type { ModuleRenderProps } from '../../../ModuleRenderProps.tsx'\nimport { DiscoverDialog } from './components/index.ts'\n\nexport const ModuleCardActions: React.FC<CardActionsProps & ModuleRenderProps> = ({\n children, mod, sx, ...props\n}) => {\n const [discoverDialogOpen, setDiscoverDialogOpen] = useState(false)\n\n const config = mod?.config\n\n return (\n <CardActions\n sx={{\n alignItems: 'stretch', flexDirection: 'column', ml: 1, ...sx,\n }}\n {...props}\n >\n <FlexRow justifyContent=\"space-between\" gap={1} alignItems=\"center\">\n {mod\n ? <Chip label={config?.schema} size=\"small\" />\n : null}\n {children}\n <ButtonEx onClick={() => setDiscoverDialogOpen(true)} size=\"small\" variant=\"outlined\">\n Discover\n </ButtonEx>\n </FlexRow>\n <DiscoverDialog fullWidth maxWidth=\"md\" mod={mod} open={discoverDialogOpen} setOpen={setDiscoverDialogOpen} />\n </CardActions>\n )\n}\n","import type { DialogProps } from '@mui/material'\nimport {\n Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, Paper,\n} from '@mui/material'\nimport { usePromise } from '@xylabs/react-promise'\nimport type { ModuleInstance } from '@xyo-network/module-model'\nimport type { Dispatch, SetStateAction } from 'react'\nimport React from 'react'\n\nexport interface DiscoverDialogProps extends DialogProps {\n mod?: ModuleInstance\n setOpen?: Dispatch<SetStateAction<boolean>>\n}\n\n// Add a dialogue title and quick tip to show description of discover query\n\nexport const DiscoverDialog: React.FC<DiscoverDialogProps> = ({\n mod, setOpen, ...props\n}) => {\n const [discoverPayloads] = usePromise(async () => {\n return await mod?.state()\n }, [mod])\n\n return (\n <Dialog {...props}>\n <DialogTitle>\n Supported Queries for\n {mod?.config.name || mod?.address}\n </DialogTitle>\n <Divider />\n <DialogContent>\n <Paper sx={{ p: 1 }}>\n <DialogContentText>All modules share a set of base queries along with ones specific to the module.</DialogContentText>\n <pre>{JSON.stringify(discoverPayloads, null, 2)}</pre>\n </Paper>\n </DialogContent>\n <DialogActions>\n <Button onClick={() => setOpen?.(false)} variant=\"outlined\">\n Close\n </Button>\n </DialogActions>\n </Dialog>\n )\n}\n","import type { CardContentProps } from '@mui/material'\nimport { CardContent } from '@mui/material'\nimport React from 'react'\n\nimport type { ModuleRenderProps } from '../../../ModuleRenderProps.tsx'\n\nexport const ModuleCardContent: React.FC<ModuleRenderProps & CardContentProps> = ({ children, ...props }) => {\n return <CardContent {...props}>{children}</CardContent>\n}\n","import type { CardHeaderProps } from '@mui/material'\nimport { CardHeader } from '@mui/material'\nimport type { Module } from '@xyo-network/module-model'\nimport { findNetworkComponent } from '@xyo-network/react-shared'\nimport React from 'react'\n\nimport type { ModuleRenderProps } from '../../../ModuleRenderProps.tsx'\n\nconst moduleTypes = ['sentinel', 'bridge', 'archivist', 'diviner', 'node', 'witness']\n\nconst getModuleIcons = (moduleType: string, mod: Module) => {\n return mod?.queries.find(query => query.startsWith(`network.xyo.query.${moduleType}`)) ? findNetworkComponent(moduleType)?.icon : null\n}\n\nexport const ModuleCardHeader: React.FC<ModuleRenderProps & CardHeaderProps> = ({\n subheader, avatar, title, mod, ...props\n}) => {\n return (\n <CardHeader\n title={title ?? mod?.config.name ?? 'Module'}\n subheader={subheader ?? mod?.address}\n avatar={\n avatar ?? (\n <>\n {mod\n ? moduleTypes.map((moduleType) => {\n const Icon = getModuleIcons(moduleType, mod)\n return Icon ? <Icon key={moduleType} fontSize=\"large\" color=\"primary\" /> : null\n })\n : null}\n </>\n )\n }\n {...props}\n />\n )\n}\n","import type { CardContentProps } from '@mui/material'\nimport type { DivinerInstance } from '@xyo-network/diviner-model'\nimport React from 'react'\n\nimport type { ModuleRenderProps } from '../../../ModuleRenderProps.tsx'\nimport { ModuleCardContent } from '../Module/index.ts'\n\nexport const DivinerCardContent: React.FC<ModuleRenderProps<DivinerInstance> & CardContentProps> = ({ children, ...props }) => {\n return <ModuleCardContent {...props}>{children}</ModuleCardContent>\n}\n","import type { CardHeaderProps } from '@mui/material'\nimport type { DivinerInstance } from '@xyo-network/diviner-model'\nimport React from 'react'\n\nimport type { ModuleRenderProps } from '../../../ModuleRenderProps.tsx'\nimport { ModuleCardHeader } from '../Module/index.ts'\n\nexport const DivinerCardHeader: React.FC<ModuleRenderProps<DivinerInstance> & CardHeaderProps> = ({\n title, mod, ...props\n}) => {\n return <ModuleCardHeader mod={mod} title={title ?? mod?.config.name ?? 'Diviner'} {...props} />\n}\n","import { ButtonEx } from '@xylabs/react-button'\nimport { EthAccountBox } from '@xylabs/react-crypto'\nimport type { FlexBoxProps } from '@xylabs/react-flexbox'\nimport { FlexCol, FlexRow } from '@xylabs/react-flexbox'\nimport { EthAddressWrapper } from '@xylabs/sdk-js'\nimport type { Module } from '@xyo-network/module-model'\nimport { findNetworkComponent } from '@xyo-network/react-shared'\nimport React, { useState } from 'react'\n\nimport type { ModuleRenderProps } from '../ModuleRenderProps.tsx'\n\nconst getModuleIcon = (moduleType: string, mod: Module) => {\n return mod?.queries.find(query => query.startsWith(`network.xyo.query.${moduleType}`)) ? findNetworkComponent(moduleType)?.icon() : null\n}\n\nexport const ModuleDetailsBox: React.FC<ModuleRenderProps & FlexBoxProps> = ({\n children, mod, ...props\n}) => {\n const [showQueries, setShowQueries] = useState(false)\n return (\n <FlexCol {...props}>\n <FlexRow>\n {mod\n ? ['sentinel', 'bridge', 'archivist', 'diviner', 'node'].map((moduleType) => {\n const icon = getModuleIcon(moduleType, mod)\n return icon\n ? (\n <ButtonEx onClick={() => setShowQueries(!showQueries)} key={moduleType}>\n {icon}\n </ButtonEx>\n )\n : null\n })\n : null}\n <EthAccountBox address={EthAddressWrapper.fromString(mod?.address)} />\n </FlexRow>\n\n {showQueries\n ? mod?.queries.map((query) => {\n return <FlexRow key={query}>{query}</FlexRow>\n })\n : null}\n {children}\n </FlexCol>\n )\n}\n","import type { TableCellProps } from '@mui/material'\nimport { TableCell } from '@mui/material'\nimport { EthAccountBox } from '@xylabs/react-crypto'\nimport { EthAddressWrapper } from '@xylabs/sdk-js'\nimport React from 'react'\n\nimport type { ModuleRenderProps } from '../ModuleRenderProps.tsx'\n\nexport const ModuleTableCell: React.FC<ModuleRenderProps & TableCellProps> = ({\n children, mod, ...props\n}) => {\n return (\n <TableCell {...props}>\n <EthAccountBox address={EthAddressWrapper.fromString(mod?.address)} />\n {children}\n </TableCell>\n )\n}\n","import { useState } from 'react'\n\nexport type RefreshCallback = () => number\nexport type DisableCallback = () => void\n\nexport const useRefresh = (): [number, RefreshCallback, DisableCallback] => {\n const [count, setCount] = useState(1)\n return [\n count,\n () => {\n const newCount = count + 1\n setCount(newCount)\n return newCount\n },\n () => setCount(0),\n ]\n}\n"],"mappings":";AACA,SAAS,QAAAA,aAAY;;;ACArB,SAAS,YAAY;;;ACArB,SAAS,aAAa,YAAY;AAClC,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,SAAgB,gBAAgB;;;ACHhC;AAAA,EACE;AAAA,EAAQ;AAAA,EAAQ;AAAA,EAAe;AAAA,EAAe;AAAA,EAAmB;AAAA,EAAa;AAAA,EAAS;AAAA,OAClF;AACP,SAAS,kBAAkB;AAqBrB,SAIA,KAJA;AATC,IAAM,iBAAgD,CAAC;AAAA,EAC5D;AAAA,EAAK;AAAA,EAAS,GAAG;AACnB,MAAM;AACJ,QAAM,CAAC,gBAAgB,IAAI,WAAW,YAAY;AAChD,WAAO,MAAM,KAAK,MAAM;AAAA,EAC1B,GAAG,CAAC,GAAG,CAAC;AAER,SACE,qBAAC,UAAQ,GAAG,OACV;AAAA,yBAAC,eAAY;AAAA;AAAA,MAEV,KAAK,OAAO,QAAQ,KAAK;AAAA,OAC5B;AAAA,IACA,oBAAC,WAAQ;AAAA,IACT,oBAAC,iBACC,+BAAC,SAAM,IAAI,EAAE,GAAG,EAAE,GAChB;AAAA,0BAAC,qBAAkB,6FAA+E;AAAA,MAClG,oBAAC,SAAK,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cACG,KAAK,QAAQ,IAAI,CAAC,UAAU;AAC1B,aAAO,gBAAAA,KAACH,UAAA,EAAqB,mBAAR,KAAc;AAAA,IACrC,CAAC,IACD;AAAA,IACH;AAAA,KACH;AAEJ;;;AC5CA,SAAS,iBAAiB;AAC1B,SAAS,iBAAAK,sBAAqB;AAC9B,SAAS,qBAAAC,0BAAyB;AAS9B,SACE,OAAAC,OADF,QAAAC,aAAA;AAJG,IAAM,kBAAgE,CAAC;AAAA,EAC5E;AAAA,EAAU;AAAA,EAAK,GAAG;AACpB,MAAM;AACJ,SACE,gBAAAA,MAAC,aAAW,GAAG,OACb;AAAA,oBAAAD,MAACF,gBAAA,EAAc,SAASC,mBAAkB,WAAW,KAAK,OAAO,GAAG;AAAA,IACnE;AAAA,KACH;AAEJ;;;ACjBA,SAAS,YAAAG,iBAAgB;AAKlB,IAAM,aAAa,MAAkD;AAC1E,QAAM,CAAC,OAAO,QAAQ,IAAIA,UAAS,CAAC;AACpC,SAAO;AAAA,IACL;AAAA,IACA,MAAM;AACJ,YAAM,WAAW,QAAQ;AACzB,eAAS,QAAQ;AACjB,aAAO;AAAA,IACT;AAAA,IACA,MAAM,SAAS,CAAC;AAAA,EAClB;AACF;","names":["Card","jsx","jsxs","jsx","jsx","jsx","jsxs","jsx","jsx","jsx","jsxs","Card","ButtonEx","FlexRow","findNetworkComponent","useState","jsx","jsxs","EthAccountBox","EthAddressWrapper","jsx","jsxs","useState"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/react-module",
3
- "version": "7.5.8",
3
+ "version": "7.5.12",
4
4
  "description": "Common React library for all XYO projects that use React",
5
5
  "keywords": [
6
6
  "xyo",
@@ -36,57 +36,148 @@
36
36
  },
37
37
  "./package.json": "./package.json"
38
38
  },
39
- "module": "dist/browser/index.mjs",
40
- "types": "dist/browser/index.d.ts",
41
39
  "files": [
42
40
  "dist",
43
- "src"
41
+ "README.md"
44
42
  ],
45
43
  "dependencies": {
46
- "@xylabs/eth-address": "~5.0.90",
47
- "@xylabs/react-button": "~7.1.17",
48
- "@xylabs/react-crypto": "~7.1.17",
49
- "@xylabs/react-flexbox": "~7.1.17",
50
- "@xylabs/react-promise": "~7.1.17",
51
- "@xyo-network/diviner-model": "~5.3.17",
52
- "@xyo-network/module-model": "~5.3.17",
53
- "@xyo-network/react-shared": "7.5.8"
44
+ "@xyo-network/react-shared": "~7.5.12"
54
45
  },
55
46
  "devDependencies": {
56
- "@mui/icons-material": "~7.3.9",
57
- "@mui/material": "~7.3.9",
58
- "@storybook/react-vite": "~10.3.3",
47
+ "@bitauth/libauth": "~3.0.0",
48
+ "@metamask/providers": "^22.1.1",
49
+ "@mui/icons-material": "^7.3.10",
50
+ "@mui/material": "^7.3.10",
51
+ "@opentelemetry/api": "^1.9.1",
52
+ "@opentelemetry/sdk-trace-base": "^2.7.0",
53
+ "@scure/base": "~2.2.0",
54
+ "@scure/bip39": "~2.2.0",
55
+ "@storybook/react-vite": "~10.3.5",
56
+ "@types/node": "~25.6.0",
59
57
  "@types/react": "^19.2.14",
60
- "@xylabs/react-async-effect": "~7.1.17",
61
- "@xylabs/sdk-js": "~5.0.90",
62
- "@xylabs/ts-scripts-common": "~7.5.6",
63
- "@xylabs/ts-scripts-yarn3": "~7.5.6",
64
- "@xylabs/tsconfig": "~7.5.6",
65
- "@xylabs/tsconfig-dom": "~7.5.6",
66
- "@xylabs/tsconfig-react": "~7.5.6",
67
- "@xyo-network/archivist": "~5.3.17",
68
- "@xyo-network/archivist-memory": "~5.3.17",
69
- "@xyo-network/crypto-asset-plugin": "~5.3.1",
70
- "@xyo-network/diviner-address-history": "~5.3.17",
71
- "@xyo-network/node-memory": "~5.3.17",
72
- "react": "^19.2.4",
73
- "react-dom": "^19.2.4",
74
- "react-router-dom": "^7.13.2",
75
- "storybook": "~10.3.3",
58
+ "@xylabs/geo": "^5.0.100",
59
+ "@xylabs/react-async-effect": "~7.1.20",
60
+ "@xylabs/react-button": "~7.1.20",
61
+ "@xylabs/react-crypto": "~7.1.20",
62
+ "@xylabs/react-dialogs": "~7.1.20",
63
+ "@xylabs/react-flexbox": "~7.1.20",
64
+ "@xylabs/react-hooks": "~7.1.20",
65
+ "@xylabs/react-identicon": "~7.1.20",
66
+ "@xylabs/react-link": "~7.1.20",
67
+ "@xylabs/react-promise": "~7.1.20",
68
+ "@xylabs/react-quick-tip-button": "~7.1.20",
69
+ "@xylabs/react-shared": "~7.1.20",
70
+ "@xylabs/react-theme": "~7.1.20",
71
+ "@xylabs/sdk-js": "^5.0.100",
72
+ "@xylabs/threads": "~5.0.100",
73
+ "@xylabs/toolchain": "~7.11.9",
74
+ "@xylabs/tsconfig": "^7.11.9",
75
+ "@xylabs/tsconfig-dom": "^7.11.9",
76
+ "@xylabs/tsconfig-react": "~7.11.9",
77
+ "@xylabs/zod": "~5.0.100",
78
+ "@xyo-network/account": "~5.5.1",
79
+ "@xyo-network/account-model": "^5.5.1",
80
+ "@xyo-network/api": "~5.5.1",
81
+ "@xyo-network/api-models": "~5.5.1",
82
+ "@xyo-network/archivist": "~5.5.5",
83
+ "@xyo-network/archivist-memory": "~5.5.5",
84
+ "@xyo-network/boundwitness-builder": "^5.5.1",
85
+ "@xyo-network/boundwitness-model": "^5.5.1",
86
+ "@xyo-network/boundwitness-validator": "^5.5.1",
87
+ "@xyo-network/boundwitness-wrapper": "~5.5.1",
88
+ "@xyo-network/config-payload-plugin": "~5.5.1",
89
+ "@xyo-network/crypto-asset-plugin": "~5.4.9",
90
+ "@xyo-network/diviner-abstract": "^5.5.5",
91
+ "@xyo-network/diviner-address-history": "~5.5.5",
92
+ "@xyo-network/diviner-model": "^5.5.5",
93
+ "@xyo-network/huri": "^5.5.1",
94
+ "@xyo-network/manifest-model": "~5.5.1",
95
+ "@xyo-network/module-model": "^5.5.5",
96
+ "@xyo-network/node-memory": "~5.5.5",
97
+ "@xyo-network/payload-builder": "^5.5.1",
98
+ "@xyo-network/payload-model": "^5.5.1",
99
+ "@xyo-network/payload-plugin": "^5.5.1",
100
+ "@xyo-network/payload-wrapper": "~5.5.1",
101
+ "@xyo-network/query-payload-plugin": "~5.5.1",
102
+ "@xyo-network/sdk-js": "^5.5.5",
103
+ "@xyo-network/sdk-protocol-js": "~5.5.1",
104
+ "@xyo-network/wallet": "~5.5.1",
105
+ "@xyo-network/wallet-model": "^5.5.1",
106
+ "ajv": "^8.18.0",
107
+ "async-mutex": "^0.5.0",
108
+ "axios": "^1.15.2",
109
+ "bn.js": "^5.2.3",
110
+ "bowser": "^2.14.1",
111
+ "buffer": "^6.0.3",
112
+ "chalk": "^5.6.2",
113
+ "debug": "~4.4.3",
114
+ "esbuild": "~0.28.0",
115
+ "eslint": "^10.2.1",
116
+ "ethers": "^6.16.0",
117
+ "fast-deep-equal": "~3.1.3",
118
+ "hash-wasm": "~4.12.0",
119
+ "idb": "^8.0.3",
120
+ "js-cookie": "~3.0.5",
121
+ "lru-cache": "^11.3.5",
122
+ "mapbox-gl": "^3.22.0",
123
+ "observable-fns": "~0.6.1",
124
+ "pako": "^2.1.0",
125
+ "react": "^19.2.5",
126
+ "react-dom": "^19.2.5",
127
+ "react-router-dom": "^7.14.2",
128
+ "spark-md5": "~3.0.2",
129
+ "store2": "~2.14.4",
130
+ "storybook": "^10.3.5",
76
131
  "typescript": "^5.9.3",
77
- "vite": "~8.0.3",
132
+ "vite": "^8.0.10",
133
+ "wasm-feature-detect": "~1.8.0",
134
+ "webextension-polyfill": "^0.12.0",
78
135
  "zod": "^4.3.6"
79
136
  },
80
137
  "peerDependencies": {
81
- "@mui/icons-material": ">=6 <8",
82
- "@mui/material": ">=6 <8",
83
- "react": "^19",
84
- "react-dom": "^19",
85
- "react-router-dom": "^7",
86
- "zod": "^4"
138
+ "@mui/icons-material": "^7.3.10",
139
+ "@mui/material": "^7.3.10",
140
+ "@opentelemetry/api": "^1.9.1",
141
+ "@opentelemetry/sdk-trace-base": "^2.7.0",
142
+ "@scure/base": "~2.2.0",
143
+ "@xylabs/react-async-effect": "~7.1.20",
144
+ "@xylabs/react-button": "~7.1.20",
145
+ "@xylabs/react-crypto": "~7.1.20",
146
+ "@xylabs/react-flexbox": "~7.1.20",
147
+ "@xylabs/react-hooks": "~7.1.20",
148
+ "@xylabs/react-identicon": "~7.1.20",
149
+ "@xylabs/react-link": "~7.1.20",
150
+ "@xylabs/react-promise": "~7.1.20",
151
+ "@xylabs/react-quick-tip-button": "~7.1.20",
152
+ "@xylabs/react-shared": "~7.1.20",
153
+ "@xylabs/react-theme": "~7.1.20",
154
+ "@xylabs/sdk-js": "^5.0.100",
155
+ "@xylabs/zod": "~5.0.100",
156
+ "@xyo-network/account-model": "^5.5.1",
157
+ "@xyo-network/boundwitness-model": "^5.5.1",
158
+ "@xyo-network/boundwitness-validator": "^5.5.1",
159
+ "@xyo-network/diviner-model": "^5.5.5",
160
+ "@xyo-network/module-model": "^5.5.5",
161
+ "@xyo-network/payload-builder": "^5.5.1",
162
+ "@xyo-network/payload-model": "^5.5.1",
163
+ "async-mutex": "^0.5.0",
164
+ "axios": "^1.15.2",
165
+ "bn.js": "^5.2.3",
166
+ "bowser": "^2.14.1",
167
+ "buffer": "^6.0.3",
168
+ "chalk": "^5.6.2",
169
+ "ethers": "^6.16.0",
170
+ "fast-deep-equal": "~3.1.3",
171
+ "js-cookie": "~3.0.5",
172
+ "pako": "^2.1.0",
173
+ "react": "^19.2.5",
174
+ "react-dom": "^19.2.5",
175
+ "react-router-dom": "^7.14.2",
176
+ "spark-md5": "~3.0.2",
177
+ "zod": "^4.3.6"
87
178
  },
88
179
  "publishConfig": {
89
180
  "access": "public"
90
181
  },
91
182
  "docs": "dist/docs.json"
92
- }
183
+ }
@@ -1,7 +0,0 @@
1
- import type { ModuleInstance } from '@xyo-network/module-model'
2
-
3
- export type ModuleRenderProps<T extends ModuleInstance = ModuleInstance> = {
4
- address?: string
5
- mod?: T
6
- name?: string
7
- }
@@ -1,41 +0,0 @@
1
- import type { Meta, StoryFn } from '@storybook/react-vite'
2
- import { useAsyncEffect } from '@xylabs/react-async-effect'
3
- import type { Address } from '@xylabs/sdk-js'
4
- import { AddressHistoryDiviner, AddressHistoryDivinerConfigSchema } from '@xyo-network/diviner-address-history'
5
- import type { DivinerInstance } from '@xyo-network/diviner-model'
6
- import React, { useState } from 'react'
7
-
8
- import { DivinerCard } from './Card.tsx'
9
-
10
- const StorybookEntry = { title: 'modules/diviner/DivinerCard' } as Meta<typeof DivinerCard>
11
-
12
- const Template: StoryFn<typeof DivinerCard> = () => {
13
- const [mod, setMod] = useState<DivinerInstance>()
14
-
15
- useAsyncEffect(
16
-
17
- async (mounted) => {
18
- if (!mod) {
19
- const newModule = (await AddressHistoryDiviner.create({
20
- config: {
21
- address: '' as Address,
22
- name: 'AddressHistoryDiviner',
23
- schema: AddressHistoryDivinerConfigSchema,
24
- },
25
- })) as DivinerInstance
26
- if (mounted()) {
27
- setMod(newModule)
28
- }
29
- }
30
- },
31
- [mod],
32
- )
33
-
34
- return <DivinerCard mod={mod} />
35
- }
36
-
37
- const SingleModule = Template.bind({})
38
-
39
- export { SingleModule }
40
-
41
- export default StorybookEntry
@@ -1,22 +0,0 @@
1
- import type { CardProps } from '@mui/material'
2
- import { Card } from '@mui/material'
3
- import type { DivinerInstance } from '@xyo-network/diviner-model'
4
- import React from 'react'
5
-
6
- import type { ModuleRenderProps } from '../../../ModuleRenderProps.tsx'
7
- import { ModuleCardActions } from '../Module/index.ts'
8
- import { DivinerCardContent } from './CardContent.tsx'
9
- import { DivinerCardHeader } from './CardHeader.tsx'
10
-
11
- export const DivinerCard: React.FC<CardProps & ModuleRenderProps<DivinerInstance>> = ({
12
- children, mod, ...props
13
- }) => {
14
- return (
15
- <Card {...props}>
16
- <DivinerCardHeader mod={mod} />
17
- <DivinerCardContent mod={mod} />
18
- {children}
19
- <ModuleCardActions mod={mod} />
20
- </Card>
21
- )
22
- }
@@ -1,10 +0,0 @@
1
- import type { CardActionsProps } from '@mui/material'
2
- import type { DivinerInstance } from '@xyo-network/diviner-model'
3
- import React from 'react'
4
-
5
- import type { ModuleRenderProps } from '../../../ModuleRenderProps.tsx'
6
- import { ModuleCardActions } from '../Module/index.ts'
7
-
8
- export const DivinerCardActions: React.FC<ModuleRenderProps<DivinerInstance> & CardActionsProps> = (props) => {
9
- return <ModuleCardActions {...props} />
10
- }
@@ -1,10 +0,0 @@
1
- import type { CardContentProps } from '@mui/material'
2
- import type { DivinerInstance } from '@xyo-network/diviner-model'
3
- import React from 'react'
4
-
5
- import type { ModuleRenderProps } from '../../../ModuleRenderProps.tsx'
6
- import { ModuleCardContent } from '../Module/index.ts'
7
-
8
- export const DivinerCardContent: React.FC<ModuleRenderProps<DivinerInstance> & CardContentProps> = ({ children, ...props }) => {
9
- return <ModuleCardContent {...props}>{children}</ModuleCardContent>
10
- }
@@ -1,12 +0,0 @@
1
- import type { CardHeaderProps } from '@mui/material'
2
- import type { DivinerInstance } from '@xyo-network/diviner-model'
3
- import React from 'react'
4
-
5
- import type { ModuleRenderProps } from '../../../ModuleRenderProps.tsx'
6
- import { ModuleCardHeader } from '../Module/index.ts'
7
-
8
- export const DivinerCardHeader: React.FC<ModuleRenderProps<DivinerInstance> & CardHeaderProps> = ({
9
- title, mod, ...props
10
- }) => {
11
- return <ModuleCardHeader mod={mod} title={title ?? mod?.config.name ?? 'Diviner'} {...props} />
12
- }
@@ -1,3 +0,0 @@
1
- export * from './Card.tsx'
2
- export * from './CardContent.tsx'
3
- export * from './CardHeader.tsx'
@@ -1,44 +0,0 @@
1
- import type { Meta, StoryFn } from '@storybook/react-vite'
2
- import { useAsyncEffect } from '@xylabs/react-async-effect'
3
- import type { ArchivistInstance } from '@xyo-network/archivist'
4
- import { MemoryArchivist } from '@xyo-network/archivist-memory'
5
- import React, { useState } from 'react'
6
-
7
- import { ModuleCard } from './Card.tsx'
8
-
9
- const StorybookEntry = {
10
- argTypes: {
11
- authState: {
12
- jwtToken: 'badToken',
13
- loggedInAccount: 'none@none.com',
14
- },
15
- },
16
- component: ModuleCard,
17
- parameters: { docs: { page: null } },
18
- title: 'modules/module/ModuleCard',
19
- } as Meta<typeof ModuleCard>
20
-
21
- const Template: StoryFn<typeof ModuleCard> = () => {
22
- const [mod, setMod] = useState<ArchivistInstance>()
23
-
24
- useAsyncEffect(
25
-
26
- async (mounted) => {
27
- if (!mod) {
28
- const newModule = await MemoryArchivist.create({})
29
- if (mounted()) {
30
- setMod(newModule)
31
- }
32
- }
33
- },
34
- [mod],
35
- )
36
-
37
- return <ModuleCard mod={mod} />
38
- }
39
-
40
- const SingleModule = Template.bind({})
41
-
42
- export { SingleModule }
43
-
44
- export default StorybookEntry
@@ -1,18 +0,0 @@
1
- import type { CardProps } from '@mui/material'
2
- import { Card } from '@mui/material'
3
- import React from 'react'
4
-
5
- import type { ModuleRenderProps } from '../../../ModuleRenderProps.tsx'
6
- import { ModuleCardActions } from './CardActions.tsx'
7
- import { ModuleCardContent } from './CardContent.tsx'
8
- import { ModuleCardHeader } from './CardHeader.tsx'
9
-
10
- export const ModuleCard: React.FC<CardProps & ModuleRenderProps> = ({ mod, ...props }) => {
11
- return (
12
- <Card {...props}>
13
- <ModuleCardHeader mod={mod} />
14
- <ModuleCardContent mod={mod} />
15
- <ModuleCardActions mod={mod} />
16
- </Card>
17
- )
18
- }
@@ -1,36 +0,0 @@
1
- import type { CardActionsProps } from '@mui/material'
2
- import { CardActions, Chip } from '@mui/material'
3
- import { ButtonEx } from '@xylabs/react-button'
4
- import { FlexRow } from '@xylabs/react-flexbox'
5
- import React, { useState } from 'react'
6
-
7
- import type { ModuleRenderProps } from '../../../ModuleRenderProps.tsx'
8
- import { DiscoverDialog } from './components/index.ts'
9
-
10
- export const ModuleCardActions: React.FC<CardActionsProps & ModuleRenderProps> = ({
11
- children, mod, sx, ...props
12
- }) => {
13
- const [discoverDialogOpen, setDiscoverDialogOpen] = useState(false)
14
-
15
- const config = mod?.config
16
-
17
- return (
18
- <CardActions
19
- sx={{
20
- alignItems: 'stretch', flexDirection: 'column', ml: 1, ...sx,
21
- }}
22
- {...props}
23
- >
24
- <FlexRow justifyContent="space-between" gap={1} alignItems="center">
25
- {mod
26
- ? <Chip label={config?.schema} size="small" />
27
- : null}
28
- {children}
29
- <ButtonEx onClick={() => setDiscoverDialogOpen(true)} size="small" variant="outlined">
30
- Discover
31
- </ButtonEx>
32
- </FlexRow>
33
- <DiscoverDialog fullWidth maxWidth="md" mod={mod} open={discoverDialogOpen} setOpen={setDiscoverDialogOpen} />
34
- </CardActions>
35
- )
36
- }
@@ -1,9 +0,0 @@
1
- import type { CardContentProps } from '@mui/material'
2
- import { CardContent } from '@mui/material'
3
- import React from 'react'
4
-
5
- import type { ModuleRenderProps } from '../../../ModuleRenderProps.tsx'
6
-
7
- export const ModuleCardContent: React.FC<ModuleRenderProps & CardContentProps> = ({ children, ...props }) => {
8
- return <CardContent {...props}>{children}</CardContent>
9
- }
@@ -1,37 +0,0 @@
1
- import type { CardHeaderProps } from '@mui/material'
2
- import { CardHeader } from '@mui/material'
3
- import type { Module } from '@xyo-network/module-model'
4
- import { findNetworkComponent } from '@xyo-network/react-shared'
5
- import React from 'react'
6
-
7
- import type { ModuleRenderProps } from '../../../ModuleRenderProps.tsx'
8
-
9
- const moduleTypes = ['sentinel', 'bridge', 'archivist', 'diviner', 'node', 'witness']
10
-
11
- const getModuleIcons = (moduleType: string, mod: Module) => {
12
- return mod?.queries.find(query => query.startsWith(`network.xyo.query.${moduleType}`)) ? findNetworkComponent(moduleType)?.icon : null
13
- }
14
-
15
- export const ModuleCardHeader: React.FC<ModuleRenderProps & CardHeaderProps> = ({
16
- subheader, avatar, title, mod, ...props
17
- }) => {
18
- return (
19
- <CardHeader
20
- title={title ?? mod?.config.name ?? 'Module'}
21
- subheader={subheader ?? mod?.address}
22
- avatar={
23
- avatar ?? (
24
- <>
25
- {mod
26
- ? moduleTypes.map((moduleType) => {
27
- const Icon = getModuleIcons(moduleType, mod)
28
- return Icon ? <Icon key={moduleType} fontSize="large" color="primary" /> : null
29
- })
30
- : null}
31
- </>
32
- )
33
- }
34
- {...props}
35
- />
36
- )
37
- }
@@ -1,44 +0,0 @@
1
- import type { DialogProps } from '@mui/material'
2
- import {
3
- Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, Divider, Paper,
4
- } from '@mui/material'
5
- import { usePromise } from '@xylabs/react-promise'
6
- import type { ModuleInstance } from '@xyo-network/module-model'
7
- import type { Dispatch, SetStateAction } from 'react'
8
- import React from 'react'
9
-
10
- export interface DiscoverDialogProps extends DialogProps {
11
- mod?: ModuleInstance
12
- setOpen?: Dispatch<SetStateAction<boolean>>
13
- }
14
-
15
- // Add a dialogue title and quick tip to show description of discover query
16
-
17
- export const DiscoverDialog: React.FC<DiscoverDialogProps> = ({
18
- mod, setOpen, ...props
19
- }) => {
20
- const [discoverPayloads] = usePromise(async () => {
21
- return await mod?.state()
22
- }, [mod])
23
-
24
- return (
25
- <Dialog {...props}>
26
- <DialogTitle>
27
- Supported Queries for
28
- {mod?.config.name || mod?.address}
29
- </DialogTitle>
30
- <Divider />
31
- <DialogContent>
32
- <Paper sx={{ p: 1 }}>
33
- <DialogContentText>All modules share a set of base queries along with ones specific to the module.</DialogContentText>
34
- <pre>{JSON.stringify(discoverPayloads, null, 2)}</pre>
35
- </Paper>
36
- </DialogContent>
37
- <DialogActions>
38
- <Button onClick={() => setOpen?.(false)} variant="outlined">
39
- Close
40
- </Button>
41
- </DialogActions>
42
- </Dialog>
43
- )
44
- }
@@ -1 +0,0 @@
1
- export * from './DiscoverDialog.tsx'
@@ -1,4 +0,0 @@
1
- export * from './Card.tsx'
2
- export * from './CardActions.tsx'
3
- export * from './CardContent.tsx'
4
- export * from './CardHeader.tsx'
@@ -1,2 +0,0 @@
1
- export * from './Diviner/index.ts'
2
- export * from './Module/index.ts'
@@ -1,89 +0,0 @@
1
- import type { Meta, StoryFn } from '@storybook/react-vite'
2
- import { useAsyncEffect } from '@xylabs/react-async-effect'
3
- import { FlexCol } from '@xylabs/react-flexbox'
4
- import { MemoryArchivist } from '@xyo-network/archivist-memory'
5
- import { CryptoMarketAssetDiviner } from '@xyo-network/crypto-asset-plugin'
6
- import type { DivinerInstance } from '@xyo-network/diviner-model'
7
- import { MemoryNode } from '@xyo-network/node-memory'
8
- import React, { useState } from 'react'
9
-
10
- import { ModuleDetailsBox } from './DetailsBox.tsx'
11
-
12
- const StorybookEntry = {
13
- argTypes: {},
14
- component: ModuleDetailsBox,
15
- parameters: { docs: { page: null } },
16
- title: 'modules/module/DetailsBox',
17
- } as Meta<typeof ModuleDetailsBox>
18
-
19
- const NodeTemplate: StoryFn<typeof ModuleDetailsBox> = (args) => {
20
- const [node, setNode] = useState<MemoryNode>()
21
- useAsyncEffect(
22
-
23
- async (mounted) => {
24
- const node = await MemoryNode.create({})
25
- if (mounted()) {
26
- setNode(node)
27
- }
28
- },
29
- [],
30
- )
31
- return (
32
- <FlexCol minHeight="80vh" alignItems="stretch">
33
- <ModuleDetailsBox mod={node} {...args} />
34
- </FlexCol>
35
- )
36
- }
37
-
38
- const NodeDetails = NodeTemplate.bind({})
39
- NodeDetails.args = {}
40
-
41
- const ArchivistTemplate: StoryFn<typeof ModuleDetailsBox> = (args) => {
42
- const [archivist, setArchivist] = useState<MemoryArchivist>()
43
- useAsyncEffect(
44
-
45
- async (mounted) => {
46
- const archivist = await MemoryArchivist.create({})
47
- if (mounted()) {
48
- setArchivist(archivist)
49
- }
50
- },
51
- [],
52
- )
53
- return (
54
- <FlexCol minHeight="80vh" alignItems="stretch">
55
- <ModuleDetailsBox mod={archivist} {...args} />
56
- </FlexCol>
57
- )
58
- }
59
-
60
- const ArchivistDetails = ArchivistTemplate.bind({})
61
- ArchivistDetails.args = {}
62
-
63
- const DivinerTemplate: StoryFn<typeof ModuleDetailsBox> = (args) => {
64
- const [diviner, setDiviner] = useState<DivinerInstance>()
65
- useAsyncEffect(
66
-
67
- async (mounted) => {
68
- const diviner = (await CryptoMarketAssetDiviner.create({})) as unknown as DivinerInstance
69
- if (mounted()) {
70
- setDiviner(diviner)
71
- }
72
- },
73
- [],
74
- )
75
- return (
76
- <FlexCol minHeight="80vh" alignItems="stretch">
77
- <ModuleDetailsBox mod={diviner} {...args} />
78
- </FlexCol>
79
- )
80
- }
81
-
82
- const DivinerDetails = DivinerTemplate.bind({})
83
- DivinerDetails.args = {}
84
-
85
- export {
86
- ArchivistDetails, DivinerDetails, NodeDetails,
87
- }
88
-
89
- export default StorybookEntry
@@ -1,46 +0,0 @@
1
- import { EthAddressWrapper } from '@xylabs/eth-address'
2
- import { ButtonEx } from '@xylabs/react-button'
3
- import { EthAccountBox } from '@xylabs/react-crypto'
4
- import type { FlexBoxProps } from '@xylabs/react-flexbox'
5
- import { FlexCol, FlexRow } from '@xylabs/react-flexbox'
6
- import type { Module } from '@xyo-network/module-model'
7
- import { findNetworkComponent } from '@xyo-network/react-shared'
8
- import React, { useState } from 'react'
9
-
10
- import type { ModuleRenderProps } from '../ModuleRenderProps.tsx'
11
-
12
- const getModuleIcon = (moduleType: string, mod: Module) => {
13
- return mod?.queries.find(query => query.startsWith(`network.xyo.query.${moduleType}`)) ? findNetworkComponent(moduleType)?.icon() : null
14
- }
15
-
16
- export const ModuleDetailsBox: React.FC<ModuleRenderProps & FlexBoxProps> = ({
17
- children, mod, ...props
18
- }) => {
19
- const [showQueries, setShowQueries] = useState(false)
20
- return (
21
- <FlexCol {...props}>
22
- <FlexRow>
23
- {mod
24
- ? ['sentinel', 'bridge', 'archivist', 'diviner', 'node'].map((moduleType) => {
25
- const icon = getModuleIcon(moduleType, mod)
26
- return icon
27
- ? (
28
- <ButtonEx onClick={() => setShowQueries(!showQueries)} key={moduleType}>
29
- {icon}
30
- </ButtonEx>
31
- )
32
- : null
33
- })
34
- : null}
35
- <EthAccountBox address={EthAddressWrapper.fromString(mod?.address)} />
36
- </FlexRow>
37
-
38
- {showQueries
39
- ? mod?.queries.map((query) => {
40
- return <FlexRow key={query}>{query}</FlexRow>
41
- })
42
- : null}
43
- {children}
44
- </FlexCol>
45
- )
46
- }
@@ -1,18 +0,0 @@
1
- import type { TableCellProps } from '@mui/material'
2
- import { TableCell } from '@mui/material'
3
- import { EthAddressWrapper } from '@xylabs/eth-address'
4
- import { EthAccountBox } from '@xylabs/react-crypto'
5
- import React from 'react'
6
-
7
- import type { ModuleRenderProps } from '../ModuleRenderProps.tsx'
8
-
9
- export const ModuleTableCell: React.FC<ModuleRenderProps & TableCellProps> = ({
10
- children, mod, ...props
11
- }) => {
12
- return (
13
- <TableCell {...props}>
14
- <EthAccountBox address={EthAddressWrapper.fromString(mod?.address)} />
15
- {children}
16
- </TableCell>
17
- )
18
- }
@@ -1,3 +0,0 @@
1
- export * from './Card/index.ts'
2
- export * from './DetailsBox.tsx'
3
- export * from './TableCell.tsx'
@@ -1 +0,0 @@
1
- export * from './useRefresh.tsx'
@@ -1,17 +0,0 @@
1
- import { useState } from 'react'
2
-
3
- export type RefreshCallback = () => number
4
- export type DisableCallback = () => void
5
-
6
- export const useRefresh = (): [number, RefreshCallback, DisableCallback] => {
7
- const [count, setCount] = useState(1)
8
- return [
9
- count,
10
- () => {
11
- const newCount = count + 1
12
- setCount(newCount)
13
- return newCount
14
- },
15
- () => setCount(0),
16
- ]
17
- }
package/src/index.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from './components/index.ts'
2
- export * from './hooks/index.ts'
3
- export * from './ModuleRenderProps.tsx'