@xyo-network/react-module 6.1.4 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/components/Card/Diviner/Card.stories.d.ts.map +1 -1
- package/dist/browser/index.d.ts +4 -36
- package/dist/browser/index.mjs +4 -4
- package/dist/browser/index.mjs.map +1 -1
- package/package.json +25 -20
- package/src/components/Card/Diviner/Card.stories.tsx +2 -1
- package/src/components/DetailsBox.tsx +2 -2
- package/src/components/TableCell.tsx +2 -2
- package/typedoc.json +0 -5
- package/xy.config.ts +0 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Card/Diviner/Card.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"Card.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Card/Diviner/Card.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAW,MAAM,uBAAuB,CAAA;AAI1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,KAAmB,MAAM,OAAO,CAAA;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC,QAAA,MAAM,cAAc,EAA+C,IAAI,CAAC,OAAO,WAAW,CAAC,CAAA;AA2B3F,QAAA,MAAM,YAAY;;sYAAoB,CAAA;AAEtC,OAAO,EAAE,YAAY,EAAE,CAAA;AAEvB,eAAe,cAAc,CAAA"}
|
package/dist/browser/index.d.ts
CHANGED
|
@@ -1,36 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { FlexBoxProps } from '@xylabs/react-flexbox';
|
|
6
|
-
|
|
7
|
-
type ModuleRenderProps<T extends ModuleInstance = ModuleInstance> = {
|
|
8
|
-
address?: string;
|
|
9
|
-
mod?: T;
|
|
10
|
-
name?: string;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
declare const DivinerCard: React.FC<CardProps & ModuleRenderProps<DivinerInstance>>;
|
|
14
|
-
|
|
15
|
-
declare const DivinerCardContent: React.FC<ModuleRenderProps<DivinerInstance> & CardContentProps>;
|
|
16
|
-
|
|
17
|
-
declare const DivinerCardHeader: React.FC<ModuleRenderProps<DivinerInstance> & CardHeaderProps>;
|
|
18
|
-
|
|
19
|
-
declare const ModuleCard: React.FC<CardProps & ModuleRenderProps>;
|
|
20
|
-
|
|
21
|
-
declare const ModuleCardActions: React.FC<CardActionsProps & ModuleRenderProps>;
|
|
22
|
-
|
|
23
|
-
declare const ModuleCardContent: React.FC<ModuleRenderProps & CardContentProps>;
|
|
24
|
-
|
|
25
|
-
declare const ModuleCardHeader: React.FC<ModuleRenderProps & CardHeaderProps>;
|
|
26
|
-
|
|
27
|
-
declare const ModuleDetailsBox: React.FC<ModuleRenderProps & FlexBoxProps>;
|
|
28
|
-
|
|
29
|
-
declare const ModuleTableCell: React.FC<ModuleRenderProps & TableCellProps>;
|
|
30
|
-
|
|
31
|
-
type RefreshCallback = () => number;
|
|
32
|
-
type DisableCallback = () => void;
|
|
33
|
-
declare const useRefresh: () => [number, RefreshCallback, DisableCallback];
|
|
34
|
-
|
|
35
|
-
export { DivinerCard, DivinerCardContent, DivinerCardHeader, ModuleCard, ModuleCardActions, ModuleCardContent, ModuleCardHeader, ModuleDetailsBox, ModuleTableCell, useRefresh };
|
|
36
|
-
export type { DisableCallback, ModuleRenderProps, RefreshCallback };
|
|
1
|
+
export * from './components/index.ts';
|
|
2
|
+
export * from './hooks/index.ts';
|
|
3
|
+
export * from './ModuleRenderProps.tsx';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/browser/index.mjs
CHANGED
|
@@ -144,7 +144,7 @@ var DivinerCard = /* @__PURE__ */ __name(({ children, mod, ...props }) => {
|
|
|
144
144
|
}, "DivinerCard");
|
|
145
145
|
|
|
146
146
|
// src/components/DetailsBox.tsx
|
|
147
|
-
import {
|
|
147
|
+
import { EthAddressWrapper } from "@xylabs/eth-address";
|
|
148
148
|
import { ButtonEx as ButtonEx2 } from "@xylabs/react-button";
|
|
149
149
|
import { EthAccountBox } from "@xylabs/react-crypto";
|
|
150
150
|
import { FlexCol, FlexRow as FlexRow2 } from "@xylabs/react-flexbox";
|
|
@@ -168,7 +168,7 @@ var ModuleDetailsBox = /* @__PURE__ */ __name(({ children, mod, ...props }) => {
|
|
|
168
168
|
key: moduleType
|
|
169
169
|
}, icon) : null;
|
|
170
170
|
}) : null, /* @__PURE__ */ React9.createElement(EthAccountBox, {
|
|
171
|
-
address:
|
|
171
|
+
address: EthAddressWrapper.fromString(mod?.address)
|
|
172
172
|
})), showQueries ? mod?.queries.map((query) => {
|
|
173
173
|
return /* @__PURE__ */ React9.createElement(FlexRow2, {
|
|
174
174
|
key: query
|
|
@@ -178,12 +178,12 @@ var ModuleDetailsBox = /* @__PURE__ */ __name(({ children, mod, ...props }) => {
|
|
|
178
178
|
|
|
179
179
|
// src/components/TableCell.tsx
|
|
180
180
|
import { TableCell } from "@mui/material";
|
|
181
|
-
import {
|
|
181
|
+
import { EthAddressWrapper as EthAddressWrapper2 } from "@xylabs/eth-address";
|
|
182
182
|
import { EthAccountBox as EthAccountBox2 } from "@xylabs/react-crypto";
|
|
183
183
|
import React10 from "react";
|
|
184
184
|
var ModuleTableCell = /* @__PURE__ */ __name(({ children, mod, ...props }) => {
|
|
185
185
|
return /* @__PURE__ */ React10.createElement(TableCell, props, /* @__PURE__ */ React10.createElement(EthAccountBox2, {
|
|
186
|
-
address:
|
|
186
|
+
address: EthAddressWrapper2.fromString(mod?.address)
|
|
187
187
|
}), children);
|
|
188
188
|
}, "ModuleTableCell");
|
|
189
189
|
|
|
@@ -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 { EthAddress } 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={EthAddress.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 { EthAddress } 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={EthAddress.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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,OAAOC,aAAW;AAIX,IAAMC,kBAAgE,wBAAC,EAC5EC,UAAUC,KAAK,GAAGC,MAAAA,MACnB;AACC,SACE,gBAAAC,QAAA,cAACC,WAAcF,OACb,gBAAAC,QAAA,cAACE,gBAAAA;IAAcC,SAASC,YAAWC,WAAWP,KAAKK,OAAAA;MAClDN,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","EthAddress","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","EthAddress","fromString","TableCell","EthAddress","EthAccountBox","React","ModuleTableCell","children","mod","props","React","TableCell","EthAccountBox","address","EthAddress","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 { 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,IA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OACzDO,IAAAA,IAGL;EACN,CAAA,IACA,MACJ,gBAAAO,OAAA,cAACO,eAAAA;IAAcC,SAASC,kBAAkBC,WAAWvB,KAAKqB,OAAAA;OAG3DX,cACGV,KAAKC,QAAQe,IAAI,CAACb,UAAAA;AAChB,WAAO,gBAAAU,OAAA,cAACE,UAAAA;MAAQI,KAAKhB;OAAQA,KAAAA;EAC/B,CAAA,IACA,MACHK,QAAAA;AAGP,GA9B4E;;;ACd5E,SAASgB,iBAAiB;AAC1B,SAASC,qBAAAA,0BAAyB;AAClC,SAASC,iBAAAA,sBAAqB;AAC9B,OAAOC,aAAW;AAIX,IAAMC,kBAAgE,wBAAC,EAC5EC,UAAUC,KAAK,GAAGC,MAAAA,MACnB;AACC,SACE,gBAAAC,QAAA,cAACC,WAAcF,OACb,gBAAAC,QAAA,cAACE,gBAAAA;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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/react-module",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "Common React library for all XYO projects that use React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"xyo",
|
|
@@ -38,31 +38,36 @@
|
|
|
38
38
|
},
|
|
39
39
|
"module": "dist/browser/index.mjs",
|
|
40
40
|
"types": "dist/browser/index.d.ts",
|
|
41
|
+
"files": [
|
|
42
|
+
"dist",
|
|
43
|
+
"src"
|
|
44
|
+
],
|
|
41
45
|
"dependencies": {
|
|
42
|
-
"@xylabs/eth-address": "^
|
|
43
|
-
"@xylabs/react-button": "^
|
|
44
|
-
"@xylabs/react-crypto": "^
|
|
45
|
-
"@xylabs/react-flexbox": "^
|
|
46
|
-
"@xylabs/react-promise": "^
|
|
47
|
-
"@xyo-network/diviner-model": "^
|
|
48
|
-
"@xyo-network/module-model": "^
|
|
49
|
-
"@xyo-network/react-shared": "^
|
|
46
|
+
"@xylabs/eth-address": "^5.0.0",
|
|
47
|
+
"@xylabs/react-button": "^7.0.0",
|
|
48
|
+
"@xylabs/react-crypto": "^7.0.0",
|
|
49
|
+
"@xylabs/react-flexbox": "^7.0.0",
|
|
50
|
+
"@xylabs/react-promise": "^7.0.0",
|
|
51
|
+
"@xyo-network/diviner-model": "^5.0.0",
|
|
52
|
+
"@xyo-network/module-model": "^5.0.0",
|
|
53
|
+
"@xyo-network/react-shared": "^7.0.0"
|
|
50
54
|
},
|
|
51
55
|
"devDependencies": {
|
|
52
56
|
"@mui/icons-material": "^7.2.0",
|
|
53
57
|
"@mui/material": "^7.2.0",
|
|
54
58
|
"@storybook/react-vite": "^9.0.18",
|
|
55
|
-
"@types/react": "^19.1.
|
|
56
|
-
"@xylabs/
|
|
57
|
-
"@xylabs/
|
|
58
|
-
"@xylabs/
|
|
59
|
-
"@
|
|
60
|
-
"@xyo-network/archivist
|
|
61
|
-
"@xyo-network/
|
|
62
|
-
"@xyo-network/
|
|
63
|
-
"@xyo-network/
|
|
64
|
-
"
|
|
65
|
-
"react
|
|
59
|
+
"@types/react": "^19.1.9",
|
|
60
|
+
"@xylabs/hex": "^5.0.0",
|
|
61
|
+
"@xylabs/react-async-effect": "^7.0.0",
|
|
62
|
+
"@xylabs/ts-scripts-yarn3": "^7.0.2",
|
|
63
|
+
"@xylabs/tsconfig-react": "^7.0.2",
|
|
64
|
+
"@xyo-network/archivist": "^5.0.0",
|
|
65
|
+
"@xyo-network/archivist-memory": "^5.0.0",
|
|
66
|
+
"@xyo-network/crypto-asset-plugin": "^5.0.0",
|
|
67
|
+
"@xyo-network/diviner-address-history": "^5.0.0",
|
|
68
|
+
"@xyo-network/node-memory": "^5.0.0",
|
|
69
|
+
"react": "^19.1.1",
|
|
70
|
+
"react-dom": "^19.1.1",
|
|
66
71
|
"storybook": "^9.0.18",
|
|
67
72
|
"typescript": "^5.8.3"
|
|
68
73
|
},
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryFn } from '@storybook/react-vite'
|
|
2
|
+
import type { Address } from '@xylabs/hex'
|
|
2
3
|
import { useAsyncEffect } from '@xylabs/react-async-effect'
|
|
3
4
|
import { AddressHistoryDiviner, AddressHistoryDivinerConfigSchema } from '@xyo-network/diviner-address-history'
|
|
4
5
|
import type { DivinerInstance } from '@xyo-network/diviner-model'
|
|
@@ -17,7 +18,7 @@ const Template: StoryFn<typeof DivinerCard> = () => {
|
|
|
17
18
|
if (!mod) {
|
|
18
19
|
const newModule = (await AddressHistoryDiviner.create({
|
|
19
20
|
config: {
|
|
20
|
-
address: '',
|
|
21
|
+
address: '' as Address,
|
|
21
22
|
name: 'AddressHistoryDiviner',
|
|
22
23
|
schema: AddressHistoryDivinerConfigSchema,
|
|
23
24
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EthAddressWrapper } from '@xylabs/eth-address'
|
|
2
2
|
import { ButtonEx } from '@xylabs/react-button'
|
|
3
3
|
import { EthAccountBox } from '@xylabs/react-crypto'
|
|
4
4
|
import type { FlexBoxProps } from '@xylabs/react-flexbox'
|
|
@@ -32,7 +32,7 @@ export const ModuleDetailsBox: React.FC<ModuleRenderProps & FlexBoxProps> = ({
|
|
|
32
32
|
: null
|
|
33
33
|
})
|
|
34
34
|
: null}
|
|
35
|
-
<EthAccountBox address={
|
|
35
|
+
<EthAccountBox address={EthAddressWrapper.fromString(mod?.address)} />
|
|
36
36
|
</FlexRow>
|
|
37
37
|
|
|
38
38
|
{showQueries
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TableCellProps } from '@mui/material'
|
|
2
2
|
import { TableCell } from '@mui/material'
|
|
3
|
-
import {
|
|
3
|
+
import { EthAddressWrapper } from '@xylabs/eth-address'
|
|
4
4
|
import { EthAccountBox } from '@xylabs/react-crypto'
|
|
5
5
|
import React from 'react'
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ export const ModuleTableCell: React.FC<ModuleRenderProps & TableCellProps> = ({
|
|
|
11
11
|
}) => {
|
|
12
12
|
return (
|
|
13
13
|
<TableCell {...props}>
|
|
14
|
-
<EthAccountBox address={
|
|
14
|
+
<EthAccountBox address={EthAddressWrapper.fromString(mod?.address)} />
|
|
15
15
|
{children}
|
|
16
16
|
</TableCell>
|
|
17
17
|
)
|
package/typedoc.json
DELETED