@xyo-network/react-module 2.49.5 → 2.49.7
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/cjs/components/Card/Diviner/CardContent.js +1 -21
- package/dist/cjs/components/Card/Diviner/CardContent.js.map +1 -1
- package/dist/cjs/components/Card/Diviner/CardHeader.js +2 -1
- package/dist/cjs/components/Card/Diviner/CardHeader.js.map +1 -1
- package/dist/cjs/components/Card/Module/CardActions.js +12 -7
- package/dist/cjs/components/Card/Module/CardActions.js.map +1 -1
- package/dist/cjs/components/Card/Module/CardContent.js +2 -19
- package/dist/cjs/components/Card/Module/CardContent.js.map +1 -1
- package/dist/cjs/components/Card/Module/CardHeader.js +2 -1
- package/dist/cjs/components/Card/Module/CardHeader.js.map +1 -1
- package/dist/cjs/components/Card/Module/components/DiscoverDialog.js +24 -0
- package/dist/cjs/components/Card/Module/components/DiscoverDialog.js.map +1 -0
- package/dist/cjs/components/Card/Module/components/index.js +5 -0
- package/dist/cjs/components/Card/Module/components/index.js.map +1 -0
- package/dist/docs.json +77 -77
- package/dist/esm/components/Card/Diviner/CardContent.js +2 -21
- package/dist/esm/components/Card/Diviner/CardContent.js.map +1 -1
- package/dist/esm/components/Card/Diviner/CardHeader.js +1 -1
- package/dist/esm/components/Card/Diviner/CardHeader.js.map +1 -1
- package/dist/esm/components/Card/Module/CardActions.js +13 -8
- package/dist/esm/components/Card/Module/CardActions.js.map +1 -1
- package/dist/esm/components/Card/Module/CardContent.js +4 -21
- package/dist/esm/components/Card/Module/CardContent.js.map +1 -1
- package/dist/esm/components/Card/Module/CardHeader.js +1 -1
- package/dist/esm/components/Card/Module/CardHeader.js.map +1 -1
- package/dist/esm/components/Card/Module/components/DiscoverDialog.js +18 -0
- package/dist/esm/components/Card/Module/components/DiscoverDialog.js.map +1 -0
- package/dist/esm/components/Card/Module/components/index.js +2 -0
- package/dist/esm/components/Card/Module/components/index.js.map +1 -0
- package/dist/types/components/Card/Diviner/CardContent.d.ts.map +1 -1
- package/dist/types/components/Card/Module/CardActions.d.ts.map +1 -1
- package/dist/types/components/Card/Module/CardContent.d.ts.map +1 -1
- package/dist/types/components/Card/Module/components/DiscoverDialog.d.ts +9 -0
- package/dist/types/components/Card/Module/components/DiscoverDialog.d.ts.map +1 -0
- package/dist/types/components/Card/Module/components/index.d.ts +2 -0
- package/dist/types/components/Card/Module/components/index.d.ts.map +1 -0
- package/package.json +3 -2
- package/src/components/Card/Diviner/Card.stories.tsx +1 -12
- package/src/components/Card/Diviner/CardContent.tsx +1 -26
- package/src/components/Card/Diviner/CardHeader.tsx +1 -1
- package/src/components/Card/Module/CardActions.tsx +29 -10
- package/src/components/Card/Module/CardContent.tsx +3 -31
- package/src/components/Card/Module/CardHeader.tsx +1 -1
- package/src/components/Card/Module/components/DiscoverDialog.tsx +38 -0
- package/src/components/Card/Module/components/index.ts +1 -0
|
@@ -3,30 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DivinerCardContent = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const material_1 = require("@mui/material");
|
|
7
|
-
const eth_address_1 = require("@xylabs/eth-address");
|
|
8
|
-
const react_async_effect_1 = require("@xylabs/react-async-effect");
|
|
9
|
-
const react_crypto_1 = require("@xylabs/react-crypto");
|
|
10
|
-
const module_1 = require("@xyo-network/module");
|
|
11
|
-
const react_1 = require("react");
|
|
12
6
|
const Module_1 = require("../Module");
|
|
13
7
|
const DivinerCardContent = (_a) => {
|
|
14
|
-
var _b, _c;
|
|
15
8
|
var { children, module } = _a, props = tslib_1.__rest(_a, ["children", "module"]);
|
|
16
|
-
|
|
17
|
-
(0, react_async_effect_1.useAsyncEffect)(
|
|
18
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
19
|
-
(mounted) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
-
const wrapper = module ? module_1.ModuleWrapper.wrap(module) : undefined;
|
|
21
|
-
const payloads = yield (wrapper === null || wrapper === void 0 ? void 0 : wrapper.discover());
|
|
22
|
-
console.log(`Payloads: ${JSON.stringify(payloads, null, 2)}`);
|
|
23
|
-
if (mounted()) {
|
|
24
|
-
setConfig(payloads === null || payloads === void 0 ? void 0 : payloads[0]);
|
|
25
|
-
}
|
|
26
|
-
}), [module]);
|
|
27
|
-
return ((0, jsx_runtime_1.jsxs)(Module_1.ModuleCardContent, Object.assign({ module: module }, props, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: "Parents" }), (_c = (_b = config === null || config === void 0 ? void 0 : config.parents) === null || _b === void 0 ? void 0 : _b.commit) === null || _c === void 0 ? void 0 : _c.map((address) => {
|
|
28
|
-
return (0, jsx_runtime_1.jsx)(react_crypto_1.EthAccountBox, { address: eth_address_1.EthAddress.fromString(address) }, address);
|
|
29
|
-
}), children] })));
|
|
9
|
+
return ((0, jsx_runtime_1.jsx)(Module_1.ModuleCardContent, Object.assign({ module: module }, props, { children: children })));
|
|
30
10
|
};
|
|
31
11
|
exports.DivinerCardContent = DivinerCardContent;
|
|
32
12
|
//# sourceMappingURL=CardContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardContent.js","sourceRoot":"","sources":["../../../../../src/components/Card/Diviner/CardContent.tsx"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"CardContent.js","sourceRoot":"","sources":["../../../../../src/components/Card/Diviner/CardContent.tsx"],"names":[],"mappings":";;;;;AAIA,sCAA6C;AAEtC,MAAM,kBAAkB,GAAkE,CAAC,EAA8B,EAAE,EAAE;QAAlC,EAAE,QAAQ,EAAE,MAAM,OAAY,EAAP,KAAK,sBAA5B,sBAA8B,CAAF;IAC5H,OAAO,CACL,uBAAC,0BAAiB,kBAAC,MAAM,EAAE,MAAM,IAAM,KAAK,cACzC,QAAQ,IACS,CACrB,CAAA;AACH,CAAC,CAAA;AANY,QAAA,kBAAkB,sBAM9B"}
|
|
@@ -5,8 +5,9 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const Module_1 = require("../Module");
|
|
7
7
|
const DivinerCardHeader = (_a) => {
|
|
8
|
+
var _b;
|
|
8
9
|
var { title, module } = _a, props = tslib_1.__rest(_a, ["title", "module"]);
|
|
9
|
-
return (0, jsx_runtime_1.jsx)(Module_1.ModuleCardHeader, Object.assign({ module: module, title: title !== null && title !== void 0 ? title : '
|
|
10
|
+
return (0, jsx_runtime_1.jsx)(Module_1.ModuleCardHeader, Object.assign({ module: module, title: (_b = title !== null && title !== void 0 ? title : module === null || module === void 0 ? void 0 : module.config.name) !== null && _b !== void 0 ? _b : 'Diviner' }, props));
|
|
10
11
|
};
|
|
11
12
|
exports.DivinerCardHeader = DivinerCardHeader;
|
|
12
13
|
//# sourceMappingURL=CardHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardHeader.js","sourceRoot":"","sources":["../../../../../src/components/Card/Diviner/CardHeader.tsx"],"names":[],"mappings":";;;;;AAIA,sCAA4C;AAErC,MAAM,iBAAiB,GAAiE,CAAC,EAA2B,EAAE,EAAE
|
|
1
|
+
{"version":3,"file":"CardHeader.js","sourceRoot":"","sources":["../../../../../src/components/Card/Diviner/CardHeader.tsx"],"names":[],"mappings":";;;;;AAIA,sCAA4C;AAErC,MAAM,iBAAiB,GAAiE,CAAC,EAA2B,EAAE,EAAE;;QAA/B,EAAE,KAAK,EAAE,MAAM,OAAY,EAAP,KAAK,sBAAzB,mBAA2B,CAAF;IACvH,OAAO,uBAAC,yBAAgB,kBAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAA,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAC,IAAI,mCAAI,SAAS,IAAM,KAAK,EAAI,CAAA;AAC1G,CAAC,CAAA;AAFY,QAAA,iBAAiB,qBAE7B"}
|
|
@@ -5,21 +5,26 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const material_1 = require("@mui/material");
|
|
7
7
|
const react_button_1 = require("@xylabs/react-button");
|
|
8
|
+
const react_flexbox_1 = require("@xylabs/react-flexbox");
|
|
8
9
|
const module_1 = require("@xyo-network/module");
|
|
9
10
|
const react_shared_1 = require("@xyo-network/react-shared");
|
|
11
|
+
const react_1 = require("react");
|
|
12
|
+
const components_1 = require("./components");
|
|
10
13
|
const getModuleIcons = (moduleType, wrapper) => {
|
|
11
14
|
var _a;
|
|
12
15
|
return (wrapper === null || wrapper === void 0 ? void 0 : wrapper.queries.find((query) => query.startsWith(`network.xyo.query.${moduleType}`))) ? (_a = (0, react_shared_1.findNetworkComponent)(moduleType)) === null || _a === void 0 ? void 0 : _a.icon() : null;
|
|
13
16
|
};
|
|
14
17
|
const ModuleCardActions = (_a) => {
|
|
15
|
-
var { children, module } = _a, props = tslib_1.__rest(_a, ["children", "module"]);
|
|
18
|
+
var { children, module, sx } = _a, props = tslib_1.__rest(_a, ["children", "module", "sx"]);
|
|
19
|
+
const [discoverDialogOpen, setDiscoverDialogOpen] = (0, react_1.useState)(false);
|
|
16
20
|
const wrapper = module ? module_1.ModuleWrapper.wrap(module) : undefined;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
const config = wrapper === null || wrapper === void 0 ? void 0 : wrapper.config;
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.CardActions, Object.assign({ sx: Object.assign({ alignItems: 'stretch', flexDirection: 'column', ml: 1 }, sx) }, props, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "caption", fontFamily: "inherit", fontWeight: "500" }, { children: config === null || config === void 0 ? void 0 : config.schema })), (0, jsx_runtime_1.jsx)(material_1.Divider, { flexItem: true, sx: { my: 1 } }), (0, jsx_runtime_1.jsxs)(react_flexbox_1.FlexGrowRow, Object.assign({ justifyContent: "space-between", alignItems: "center" }, { children: [wrapper
|
|
23
|
+
? ['sentinel', 'bridge', 'archivist', 'diviner', 'node', 'witness'].map((moduleType) => {
|
|
24
|
+
const icon = getModuleIcons(moduleType, wrapper);
|
|
25
|
+
return icon ? ((0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ color: 'primary', title: moduleType.toLocaleUpperCase() }, { children: icon }), moduleType)) : null;
|
|
26
|
+
})
|
|
27
|
+
: null, (0, jsx_runtime_1.jsx)(react_button_1.ButtonEx, Object.assign({ onClick: () => setDiscoverDialogOpen(true), size: 'small', variant: 'outlined' }, { children: "Discover" })), (0, jsx_runtime_1.jsx)(components_1.DiscoverDialog, { fullWidth: true, maxWidth: 'md', open: discoverDialogOpen, setOpen: setDiscoverDialogOpen, wrapper: wrapper })] })), children] })));
|
|
23
28
|
};
|
|
24
29
|
exports.ModuleCardActions = ModuleCardActions;
|
|
25
30
|
//# sourceMappingURL=CardActions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardActions.js","sourceRoot":"","sources":["../../../../../src/components/Card/Module/CardActions.tsx"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"CardActions.js","sourceRoot":"","sources":["../../../../../src/components/Card/Module/CardActions.tsx"],"names":[],"mappings":";;;;;AAAA,4CAAwF;AACxF,uDAA+C;AAC/C,yDAAmD;AACnD,gDAAmD;AACnD,4DAAgE;AAChE,iCAAgC;AAGhC,6CAA6C;AAE7C,MAAM,cAAc,GAAG,CAAC,UAAkB,EAAE,OAAsB,EAAE,EAAE;;IACpE,OAAO,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,qBAAqB,UAAU,EAAE,CAAC,CAAC,EAAC,CAAC,CAAC,MAAA,IAAA,mCAAoB,EAAC,UAAU,CAAC,0CAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;AAChJ,CAAC,CAAA;AAEM,MAAM,iBAAiB,GAAmD,CAAC,EAAkC,EAAE,EAAE;QAAtC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,OAAY,EAAP,KAAK,sBAAhC,4BAAkC,CAAF;IAChH,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAA;IACnE,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,sBAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAC/D,MAAM,MAAM,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAA;IAE9B,OAAO,CACL,wBAAC,sBAAW,kBAAC,EAAE,kBAAI,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,IAAK,EAAE,KAAQ,KAAK,eAC1F,uBAAC,qBAAU,kBAAC,OAAO,EAAC,SAAS,EAAC,UAAU,EAAC,SAAS,EAAC,UAAU,EAAC,KAAK,gBAChE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,IACJ,EACb,uBAAC,kBAAO,IAAC,QAAQ,QAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,GAAI,EACnC,wBAAC,2BAAW,kBAAC,cAAc,EAAC,eAAe,EAAC,UAAU,EAAC,QAAQ,iBAC5D,OAAO;wBACN,CAAC,CAAC,CAAC,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;4BACnF,MAAM,IAAI,GAAG,cAAc,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;4BAChD,OAAO,IAAI,CAAC,CAAC,CAAC,CACZ,uBAAC,eAAI,kBAAC,KAAK,EAAE,SAAS,EAAmB,KAAK,EAAE,UAAU,CAAC,iBAAiB,EAAE,gBAC3E,IAAI,KADsB,UAAU,CAEhC,CACR,CAAC,CAAC,CAAC,IAAI,CAAA;wBACV,CAAC,CAAC;wBACJ,CAAC,CAAC,IAAI,EACR,uBAAC,uBAAQ,kBAAC,OAAO,EAAE,GAAG,EAAE,CAAC,qBAAqB,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,8BAE7E,EACX,uBAAC,2BAAc,IAAC,SAAS,QAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,qBAAqB,EAAE,OAAO,EAAE,OAAO,GAAI,KAC5G,EACb,QAAQ,KACG,CACf,CAAA;AACH,CAAC,CAAA;AA9BY,QAAA,iBAAiB,qBA8B7B"}
|
|
@@ -4,26 +4,9 @@ exports.ModuleCardContent = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const material_1 = require("@mui/material");
|
|
7
|
-
const eth_address_1 = require("@xylabs/eth-address");
|
|
8
|
-
const react_async_effect_1 = require("@xylabs/react-async-effect");
|
|
9
|
-
const react_crypto_1 = require("@xylabs/react-crypto");
|
|
10
|
-
const module_1 = require("@xyo-network/module");
|
|
11
|
-
const react_1 = require("react");
|
|
12
7
|
const ModuleCardContent = (_a) => {
|
|
13
|
-
var { children
|
|
14
|
-
|
|
15
|
-
const account = (module === null || module === void 0 ? void 0 : module.address) ? eth_address_1.EthAddress.fromString(module === null || module === void 0 ? void 0 : module.address) : undefined;
|
|
16
|
-
(0, react_async_effect_1.useAsyncEffect)(
|
|
17
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
18
|
-
(mounted) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
-
const wrapper = module ? module_1.ModuleWrapper.wrap(module) : undefined;
|
|
20
|
-
const payloads = yield (wrapper === null || wrapper === void 0 ? void 0 : wrapper.discover());
|
|
21
|
-
console.log(`Payloads: ${JSON.stringify(payloads, null, 2)}`);
|
|
22
|
-
if (mounted()) {
|
|
23
|
-
setConfig(payloads === null || payloads === void 0 ? void 0 : payloads[0]);
|
|
24
|
-
}
|
|
25
|
-
}), [module]);
|
|
26
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.CardContent, Object.assign({}, props, { children: [(0, jsx_runtime_1.jsx)(react_crypto_1.EthAccountBox, { address: account }), children, (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "subtitle2" }, { children: config === null || config === void 0 ? void 0 : config.schema }))] })));
|
|
8
|
+
var { children } = _a, props = tslib_1.__rest(_a, ["children"]);
|
|
9
|
+
return (0, jsx_runtime_1.jsx)(material_1.CardContent, Object.assign({}, props, { children: children }));
|
|
27
10
|
};
|
|
28
11
|
exports.ModuleCardContent = ModuleCardContent;
|
|
29
12
|
//# sourceMappingURL=CardContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardContent.js","sourceRoot":"","sources":["../../../../../src/components/Card/Module/CardContent.tsx"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"CardContent.js","sourceRoot":"","sources":["../../../../../src/components/Card/Module/CardContent.tsx"],"names":[],"mappings":";;;;;AAAA,4CAA6D;AAItD,MAAM,iBAAiB,GAAmD,CAAC,EAAsB,EAAE,EAAE;QAA1B,EAAE,QAAQ,OAAY,EAAP,KAAK,sBAApB,YAAsB,CAAF;IACpG,OAAO,uBAAC,sBAAW,oBAAK,KAAK,cAAG,QAAQ,IAAe,CAAA;AACzD,CAAC,CAAA;AAFY,QAAA,iBAAiB,qBAE7B"}
|
|
@@ -7,9 +7,10 @@ const material_1 = require("@mui/material");
|
|
|
7
7
|
const react_identicon_1 = require("@xylabs/react-identicon");
|
|
8
8
|
const module_1 = require("@xyo-network/module");
|
|
9
9
|
const ModuleCardHeader = (_a) => {
|
|
10
|
+
var _b;
|
|
10
11
|
var { subheader, avatar, title, module } = _a, props = tslib_1.__rest(_a, ["subheader", "avatar", "title", "module"]);
|
|
11
12
|
const wrapper = module ? module_1.ModuleWrapper.wrap(module) : undefined;
|
|
12
|
-
return ((0, jsx_runtime_1.jsx)(material_1.CardHeader, Object.assign({ title: title !== null && title !== void 0 ? title : 'Module', subheader: subheader !== null && subheader !== void 0 ? subheader : wrapper === null || wrapper === void 0 ? void 0 : wrapper.address, avatar: avatar !== null && avatar !== void 0 ? avatar : (0, jsx_runtime_1.jsx)(react_identicon_1.Identicon, { size: 24, value: wrapper === null || wrapper === void 0 ? void 0 : wrapper.address }) }, props)));
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)(material_1.CardHeader, Object.assign({ title: (_b = title !== null && title !== void 0 ? title : module === null || module === void 0 ? void 0 : module.config.name) !== null && _b !== void 0 ? _b : 'Module', subheader: subheader !== null && subheader !== void 0 ? subheader : wrapper === null || wrapper === void 0 ? void 0 : wrapper.address, avatar: avatar !== null && avatar !== void 0 ? avatar : (0, jsx_runtime_1.jsx)(react_identicon_1.Identicon, { size: 24, value: wrapper === null || wrapper === void 0 ? void 0 : wrapper.address }) }, props)));
|
|
13
14
|
};
|
|
14
15
|
exports.ModuleCardHeader = ModuleCardHeader;
|
|
15
16
|
//# sourceMappingURL=CardHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardHeader.js","sourceRoot":"","sources":["../../../../../src/components/Card/Module/CardHeader.tsx"],"names":[],"mappings":";;;;;AAAA,4CAA2D;AAC3D,6DAAmD;AACnD,gDAAmD;AAI5C,MAAM,gBAAgB,GAAkD,CAAC,EAA8C,EAAE,EAAE
|
|
1
|
+
{"version":3,"file":"CardHeader.js","sourceRoot":"","sources":["../../../../../src/components/Card/Module/CardHeader.tsx"],"names":[],"mappings":";;;;;AAAA,4CAA2D;AAC3D,6DAAmD;AACnD,gDAAmD;AAI5C,MAAM,gBAAgB,GAAkD,CAAC,EAA8C,EAAE,EAAE;;QAAlD,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,OAAY,EAAP,KAAK,sBAA5C,0CAA8C,CAAF;IAC1H,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,sBAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAC/D,OAAO,CACL,uBAAC,qBAAU,kBACT,KAAK,EAAE,MAAA,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAC,IAAI,mCAAI,QAAQ,EAC/C,SAAS,EAAE,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,EACxC,MAAM,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,uBAAC,2BAAS,IAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,GAAI,IAC9D,KAAK,EACT,CACH,CAAA;AACH,CAAC,CAAA;AAVY,QAAA,gBAAgB,oBAU5B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DiscoverDialog = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const react_async_effect_1 = require("@xylabs/react-async-effect");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const DiscoverDialog = (_a) => {
|
|
10
|
+
var { setOpen, wrapper } = _a, props = tslib_1.__rest(_a, ["setOpen", "wrapper"]);
|
|
11
|
+
const [discoverPayloads, setDiscoverPayloads] = (0, react_1.useState)([]);
|
|
12
|
+
(0, react_async_effect_1.useAsyncEffect)(
|
|
13
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
14
|
+
(mounted) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
+
if (wrapper) {
|
|
16
|
+
const payloads = yield wrapper.discover();
|
|
17
|
+
if (mounted())
|
|
18
|
+
setDiscoverPayloads(payloads);
|
|
19
|
+
}
|
|
20
|
+
}), [wrapper]);
|
|
21
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Dialog, Object.assign({}, props, { children: [(0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)("pre", { children: JSON.stringify(discoverPayloads, null, 2) }) }), (0, jsx_runtime_1.jsx)(material_1.DialogActions, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ onClick: () => setOpen === null || setOpen === void 0 ? void 0 : setOpen(false), variant: 'outlined' }, { children: "Close" })) })] })));
|
|
22
|
+
};
|
|
23
|
+
exports.DiscoverDialog = DiscoverDialog;
|
|
24
|
+
//# sourceMappingURL=DiscoverDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiscoverDialog.js","sourceRoot":"","sources":["../../../../../../src/components/Card/Module/components/DiscoverDialog.tsx"],"names":[],"mappings":";;;;;AAAA,4CAAyF;AACzF,mEAA2D;AAG3D,iCAA0D;AAOnD,MAAM,cAAc,GAAkC,CAAC,EAA8B,EAAE,EAAE;QAAlC,EAAE,OAAO,EAAE,OAAO,OAAY,EAAP,KAAK,sBAA5B,sBAA8B,CAAF;IACxF,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,IAAA,gBAAQ,EAAY,EAAE,CAAC,CAAA;IAEvE,IAAA,mCAAc;IACZ,uDAAuD;IACvD,CAAO,OAAO,EAAE,EAAE;QAChB,IAAI,OAAO,EAAE;YACX,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAA;YACzC,IAAI,OAAO,EAAE;gBAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAA;SAC7C;IACH,CAAC,CAAA,EACD,CAAC,OAAO,CAAC,CACV,CAAA;IAED,OAAO,CACL,wBAAC,iBAAM,oBAAK,KAAK,eACf,uBAAC,wBAAa,cACZ,0CAAM,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC,GAAO,GACxC,EAChB,uBAAC,wBAAa,cACZ,uBAAC,iBAAM,kBAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,KAAK,CAAC,EAAE,OAAO,EAAE,UAAU,2BAEnD,GACK,KACT,CACV,CAAA;AACH,CAAC,CAAA;AA1BY,QAAA,cAAc,kBA0B1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/Card/Module/components/index.ts"],"names":[],"mappings":";;;AAAA,2DAAgC"}
|
package/dist/docs.json
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"fileName": "packages/modules/packages/module/src/ModuleRenderProps.tsx",
|
|
27
27
|
"line": 4,
|
|
28
28
|
"character": 2,
|
|
29
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
|
29
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/b2b294de7/packages/modules/packages/module/src/ModuleRenderProps.tsx#L4"
|
|
30
30
|
}
|
|
31
31
|
],
|
|
32
32
|
"type": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"fileName": "packages/modules/packages/module/src/ModuleRenderProps.tsx",
|
|
50
50
|
"line": 3,
|
|
51
51
|
"character": 17,
|
|
52
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
|
52
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/b2b294de7/packages/modules/packages/module/src/ModuleRenderProps.tsx#L3"
|
|
53
53
|
}
|
|
54
54
|
],
|
|
55
55
|
"typeParameters": [
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"fileName": "packages/modules/packages/module/src/components/Card/Diviner/Card.tsx",
|
|
86
86
|
"line": 9,
|
|
87
87
|
"character": 13,
|
|
88
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
|
88
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/b2b294de7/packages/modules/packages/module/src/components/Card/Diviner/Card.tsx#L9"
|
|
89
89
|
}
|
|
90
90
|
],
|
|
91
91
|
"signatures": [
|
|
@@ -222,6 +222,24 @@
|
|
|
222
222
|
"type": "literal",
|
|
223
223
|
"value": "children"
|
|
224
224
|
},
|
|
225
|
+
{
|
|
226
|
+
"type": "literal",
|
|
227
|
+
"value": "slot"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"type": "literal",
|
|
231
|
+
"value": "title"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"type": "typeOperator",
|
|
235
|
+
"operator": "keyof",
|
|
236
|
+
"target": {
|
|
237
|
+
"type": "reference",
|
|
238
|
+
"name": "CommonProps",
|
|
239
|
+
"qualifiedName": "CommonProps",
|
|
240
|
+
"package": "@mui/material"
|
|
241
|
+
}
|
|
242
|
+
},
|
|
225
243
|
{
|
|
226
244
|
"type": "literal",
|
|
227
245
|
"value": "defaultChecked"
|
|
@@ -282,10 +300,6 @@
|
|
|
282
300
|
"type": "literal",
|
|
283
301
|
"value": "placeholder"
|
|
284
302
|
},
|
|
285
|
-
{
|
|
286
|
-
"type": "literal",
|
|
287
|
-
"value": "slot"
|
|
288
|
-
},
|
|
289
303
|
{
|
|
290
304
|
"type": "literal",
|
|
291
305
|
"value": "spellCheck"
|
|
@@ -294,10 +308,6 @@
|
|
|
294
308
|
"type": "literal",
|
|
295
309
|
"value": "tabIndex"
|
|
296
310
|
},
|
|
297
|
-
{
|
|
298
|
-
"type": "literal",
|
|
299
|
-
"value": "title"
|
|
300
|
-
},
|
|
301
311
|
{
|
|
302
312
|
"type": "literal",
|
|
303
313
|
"value": "translate"
|
|
@@ -1250,27 +1260,17 @@
|
|
|
1250
1260
|
"type": "literal",
|
|
1251
1261
|
"value": "onTransitionEndCapture"
|
|
1252
1262
|
},
|
|
1253
|
-
{
|
|
1254
|
-
"type": "literal",
|
|
1255
|
-
"value": "sx"
|
|
1256
|
-
},
|
|
1257
1263
|
{
|
|
1258
1264
|
"type": "literal",
|
|
1259
1265
|
"value": "ref"
|
|
1260
1266
|
},
|
|
1261
1267
|
{
|
|
1262
1268
|
"type": "literal",
|
|
1263
|
-
"value": "
|
|
1269
|
+
"value": "sx"
|
|
1264
1270
|
},
|
|
1265
1271
|
{
|
|
1266
|
-
"type": "
|
|
1267
|
-
"
|
|
1268
|
-
"target": {
|
|
1269
|
-
"type": "reference",
|
|
1270
|
-
"name": "CommonProps",
|
|
1271
|
-
"qualifiedName": "CommonProps",
|
|
1272
|
-
"package": "@mui/material"
|
|
1273
|
-
}
|
|
1272
|
+
"type": "literal",
|
|
1273
|
+
"value": "key"
|
|
1274
1274
|
},
|
|
1275
1275
|
{
|
|
1276
1276
|
"type": "literal",
|
|
@@ -1278,11 +1278,11 @@
|
|
|
1278
1278
|
},
|
|
1279
1279
|
{
|
|
1280
1280
|
"type": "literal",
|
|
1281
|
-
"value": "
|
|
1281
|
+
"value": "elevation"
|
|
1282
1282
|
},
|
|
1283
1283
|
{
|
|
1284
1284
|
"type": "literal",
|
|
1285
|
-
"value": "
|
|
1285
|
+
"value": "square"
|
|
1286
1286
|
},
|
|
1287
1287
|
{
|
|
1288
1288
|
"type": "literal",
|
|
@@ -1362,9 +1362,9 @@
|
|
|
1362
1362
|
"sources": [
|
|
1363
1363
|
{
|
|
1364
1364
|
"fileName": "packages/modules/packages/module/src/components/Card/Diviner/CardContent.tsx",
|
|
1365
|
-
"line":
|
|
1365
|
+
"line": 7,
|
|
1366
1366
|
"character": 13,
|
|
1367
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
|
1367
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/b2b294de7/packages/modules/packages/module/src/components/Card/Diviner/CardContent.tsx#L7"
|
|
1368
1368
|
}
|
|
1369
1369
|
],
|
|
1370
1370
|
"signatures": [
|
|
@@ -1492,10 +1492,6 @@
|
|
|
1492
1492
|
"type": "literal",
|
|
1493
1493
|
"value": "children"
|
|
1494
1494
|
},
|
|
1495
|
-
{
|
|
1496
|
-
"type": "literal",
|
|
1497
|
-
"value": "sx"
|
|
1498
|
-
},
|
|
1499
1495
|
{
|
|
1500
1496
|
"type": "typeOperator",
|
|
1501
1497
|
"operator": "keyof",
|
|
@@ -1505,6 +1501,10 @@
|
|
|
1505
1501
|
"qualifiedName": "CommonProps",
|
|
1506
1502
|
"package": "@mui/material"
|
|
1507
1503
|
}
|
|
1504
|
+
},
|
|
1505
|
+
{
|
|
1506
|
+
"type": "literal",
|
|
1507
|
+
"value": "sx"
|
|
1508
1508
|
}
|
|
1509
1509
|
]
|
|
1510
1510
|
}
|
|
@@ -1569,7 +1569,7 @@
|
|
|
1569
1569
|
"fileName": "packages/modules/packages/module/src/components/Card/Diviner/CardHeader.tsx",
|
|
1570
1570
|
"line": 7,
|
|
1571
1571
|
"character": 13,
|
|
1572
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
|
1572
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/b2b294de7/packages/modules/packages/module/src/components/Card/Diviner/CardHeader.tsx#L7"
|
|
1573
1573
|
}
|
|
1574
1574
|
],
|
|
1575
1575
|
"signatures": [
|
|
@@ -1697,10 +1697,6 @@
|
|
|
1697
1697
|
"type": "literal",
|
|
1698
1698
|
"value": "title"
|
|
1699
1699
|
},
|
|
1700
|
-
{
|
|
1701
|
-
"type": "literal",
|
|
1702
|
-
"value": "sx"
|
|
1703
|
-
},
|
|
1704
1700
|
{
|
|
1705
1701
|
"type": "typeOperator",
|
|
1706
1702
|
"operator": "keyof",
|
|
@@ -1711,6 +1707,10 @@
|
|
|
1711
1707
|
"package": "@mui/material"
|
|
1712
1708
|
}
|
|
1713
1709
|
},
|
|
1710
|
+
{
|
|
1711
|
+
"type": "literal",
|
|
1712
|
+
"value": "sx"
|
|
1713
|
+
},
|
|
1714
1714
|
{
|
|
1715
1715
|
"type": "literal",
|
|
1716
1716
|
"value": "action"
|
|
@@ -1798,7 +1798,7 @@
|
|
|
1798
1798
|
"fileName": "packages/modules/packages/module/src/components/Card/Module/Card.tsx",
|
|
1799
1799
|
"line": 8,
|
|
1800
1800
|
"character": 13,
|
|
1801
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
|
1801
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/b2b294de7/packages/modules/packages/module/src/components/Card/Module/Card.tsx#L8"
|
|
1802
1802
|
}
|
|
1803
1803
|
],
|
|
1804
1804
|
"signatures": [
|
|
@@ -1935,6 +1935,24 @@
|
|
|
1935
1935
|
"type": "literal",
|
|
1936
1936
|
"value": "children"
|
|
1937
1937
|
},
|
|
1938
|
+
{
|
|
1939
|
+
"type": "literal",
|
|
1940
|
+
"value": "slot"
|
|
1941
|
+
},
|
|
1942
|
+
{
|
|
1943
|
+
"type": "literal",
|
|
1944
|
+
"value": "title"
|
|
1945
|
+
},
|
|
1946
|
+
{
|
|
1947
|
+
"type": "typeOperator",
|
|
1948
|
+
"operator": "keyof",
|
|
1949
|
+
"target": {
|
|
1950
|
+
"type": "reference",
|
|
1951
|
+
"name": "CommonProps",
|
|
1952
|
+
"qualifiedName": "CommonProps",
|
|
1953
|
+
"package": "@mui/material"
|
|
1954
|
+
}
|
|
1955
|
+
},
|
|
1938
1956
|
{
|
|
1939
1957
|
"type": "literal",
|
|
1940
1958
|
"value": "defaultChecked"
|
|
@@ -1995,10 +2013,6 @@
|
|
|
1995
2013
|
"type": "literal",
|
|
1996
2014
|
"value": "placeholder"
|
|
1997
2015
|
},
|
|
1998
|
-
{
|
|
1999
|
-
"type": "literal",
|
|
2000
|
-
"value": "slot"
|
|
2001
|
-
},
|
|
2002
2016
|
{
|
|
2003
2017
|
"type": "literal",
|
|
2004
2018
|
"value": "spellCheck"
|
|
@@ -2007,10 +2021,6 @@
|
|
|
2007
2021
|
"type": "literal",
|
|
2008
2022
|
"value": "tabIndex"
|
|
2009
2023
|
},
|
|
2010
|
-
{
|
|
2011
|
-
"type": "literal",
|
|
2012
|
-
"value": "title"
|
|
2013
|
-
},
|
|
2014
2024
|
{
|
|
2015
2025
|
"type": "literal",
|
|
2016
2026
|
"value": "translate"
|
|
@@ -2963,27 +2973,17 @@
|
|
|
2963
2973
|
"type": "literal",
|
|
2964
2974
|
"value": "onTransitionEndCapture"
|
|
2965
2975
|
},
|
|
2966
|
-
{
|
|
2967
|
-
"type": "literal",
|
|
2968
|
-
"value": "sx"
|
|
2969
|
-
},
|
|
2970
2976
|
{
|
|
2971
2977
|
"type": "literal",
|
|
2972
2978
|
"value": "ref"
|
|
2973
2979
|
},
|
|
2974
2980
|
{
|
|
2975
2981
|
"type": "literal",
|
|
2976
|
-
"value": "
|
|
2982
|
+
"value": "sx"
|
|
2977
2983
|
},
|
|
2978
2984
|
{
|
|
2979
|
-
"type": "
|
|
2980
|
-
"
|
|
2981
|
-
"target": {
|
|
2982
|
-
"type": "reference",
|
|
2983
|
-
"name": "CommonProps",
|
|
2984
|
-
"qualifiedName": "CommonProps",
|
|
2985
|
-
"package": "@mui/material"
|
|
2986
|
-
}
|
|
2985
|
+
"type": "literal",
|
|
2986
|
+
"value": "key"
|
|
2987
2987
|
},
|
|
2988
2988
|
{
|
|
2989
2989
|
"type": "literal",
|
|
@@ -2991,11 +2991,11 @@
|
|
|
2991
2991
|
},
|
|
2992
2992
|
{
|
|
2993
2993
|
"type": "literal",
|
|
2994
|
-
"value": "
|
|
2994
|
+
"value": "elevation"
|
|
2995
2995
|
},
|
|
2996
2996
|
{
|
|
2997
2997
|
"type": "literal",
|
|
2998
|
-
"value": "
|
|
2998
|
+
"value": "square"
|
|
2999
2999
|
},
|
|
3000
3000
|
{
|
|
3001
3001
|
"type": "literal",
|
|
@@ -3075,9 +3075,9 @@
|
|
|
3075
3075
|
"sources": [
|
|
3076
3076
|
{
|
|
3077
3077
|
"fileName": "packages/modules/packages/module/src/components/Card/Module/CardActions.tsx",
|
|
3078
|
-
"line":
|
|
3078
|
+
"line": 15,
|
|
3079
3079
|
"character": 13,
|
|
3080
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
|
3080
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/b2b294de7/packages/modules/packages/module/src/components/Card/Module/CardActions.tsx#L15"
|
|
3081
3081
|
}
|
|
3082
3082
|
],
|
|
3083
3083
|
"signatures": [
|
|
@@ -3170,9 +3170,9 @@
|
|
|
3170
3170
|
"sources": [
|
|
3171
3171
|
{
|
|
3172
3172
|
"fileName": "packages/modules/packages/module/src/components/Card/Module/CardContent.tsx",
|
|
3173
|
-
"line":
|
|
3173
|
+
"line": 5,
|
|
3174
3174
|
"character": 13,
|
|
3175
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
|
3175
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/b2b294de7/packages/modules/packages/module/src/components/Card/Module/CardContent.tsx#L5"
|
|
3176
3176
|
}
|
|
3177
3177
|
],
|
|
3178
3178
|
"signatures": [
|
|
@@ -3300,10 +3300,6 @@
|
|
|
3300
3300
|
"type": "literal",
|
|
3301
3301
|
"value": "children"
|
|
3302
3302
|
},
|
|
3303
|
-
{
|
|
3304
|
-
"type": "literal",
|
|
3305
|
-
"value": "sx"
|
|
3306
|
-
},
|
|
3307
3303
|
{
|
|
3308
3304
|
"type": "typeOperator",
|
|
3309
3305
|
"operator": "keyof",
|
|
@@ -3313,6 +3309,10 @@
|
|
|
3313
3309
|
"qualifiedName": "CommonProps",
|
|
3314
3310
|
"package": "@mui/material"
|
|
3315
3311
|
}
|
|
3312
|
+
},
|
|
3313
|
+
{
|
|
3314
|
+
"type": "literal",
|
|
3315
|
+
"value": "sx"
|
|
3316
3316
|
}
|
|
3317
3317
|
]
|
|
3318
3318
|
}
|
|
@@ -3377,7 +3377,7 @@
|
|
|
3377
3377
|
"fileName": "packages/modules/packages/module/src/components/Card/Module/CardHeader.tsx",
|
|
3378
3378
|
"line": 7,
|
|
3379
3379
|
"character": 13,
|
|
3380
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
|
3380
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/b2b294de7/packages/modules/packages/module/src/components/Card/Module/CardHeader.tsx#L7"
|
|
3381
3381
|
}
|
|
3382
3382
|
],
|
|
3383
3383
|
"signatures": [
|
|
@@ -3505,10 +3505,6 @@
|
|
|
3505
3505
|
"type": "literal",
|
|
3506
3506
|
"value": "title"
|
|
3507
3507
|
},
|
|
3508
|
-
{
|
|
3509
|
-
"type": "literal",
|
|
3510
|
-
"value": "sx"
|
|
3511
|
-
},
|
|
3512
3508
|
{
|
|
3513
3509
|
"type": "typeOperator",
|
|
3514
3510
|
"operator": "keyof",
|
|
@@ -3519,6 +3515,10 @@
|
|
|
3519
3515
|
"package": "@mui/material"
|
|
3520
3516
|
}
|
|
3521
3517
|
},
|
|
3518
|
+
{
|
|
3519
|
+
"type": "literal",
|
|
3520
|
+
"value": "sx"
|
|
3521
|
+
},
|
|
3522
3522
|
{
|
|
3523
3523
|
"type": "literal",
|
|
3524
3524
|
"value": "action"
|
|
@@ -3606,7 +3606,7 @@
|
|
|
3606
3606
|
"fileName": "packages/modules/packages/module/src/components/DetailsBox.tsx",
|
|
3607
3607
|
"line": 15,
|
|
3608
3608
|
"character": 13,
|
|
3609
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
|
3609
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/b2b294de7/packages/modules/packages/module/src/components/DetailsBox.tsx#L15"
|
|
3610
3610
|
}
|
|
3611
3611
|
],
|
|
3612
3612
|
"signatures": [
|
|
@@ -3701,7 +3701,7 @@
|
|
|
3701
3701
|
"fileName": "packages/modules/packages/module/src/components/TableCell.tsx",
|
|
3702
3702
|
"line": 8,
|
|
3703
3703
|
"character": 13,
|
|
3704
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
|
3704
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/b2b294de7/packages/modules/packages/module/src/components/TableCell.tsx#L8"
|
|
3705
3705
|
}
|
|
3706
3706
|
],
|
|
3707
3707
|
"signatures": [
|
|
@@ -3813,7 +3813,7 @@
|
|
|
3813
3813
|
"fileName": "packages/modules/packages/module/src/index.ts",
|
|
3814
3814
|
"line": 1,
|
|
3815
3815
|
"character": 0,
|
|
3816
|
-
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/
|
|
3816
|
+
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/blob/b2b294de7/packages/modules/packages/module/src/index.ts#L1"
|
|
3817
3817
|
}
|
|
3818
3818
|
]
|
|
3819
3819
|
}
|
|
@@ -1,25 +1,6 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import { Typography } from '@mui/material';
|
|
3
|
-
import { EthAddress } from '@xylabs/eth-address';
|
|
4
|
-
import { useAsyncEffect } from '@xylabs/react-async-effect';
|
|
5
|
-
import { EthAccountBox } from '@xylabs/react-crypto';
|
|
6
|
-
import { ModuleWrapper } from '@xyo-network/module';
|
|
7
|
-
import { useState } from 'react';
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
2
|
import { ModuleCardContent } from '../Module';
|
|
9
3
|
export const DivinerCardContent = ({ children, module, ...props }) => {
|
|
10
|
-
|
|
11
|
-
useAsyncEffect(
|
|
12
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13
|
-
async (mounted) => {
|
|
14
|
-
const wrapper = module ? ModuleWrapper.wrap(module) : undefined;
|
|
15
|
-
const payloads = await wrapper?.discover();
|
|
16
|
-
console.log(`Payloads: ${JSON.stringify(payloads, null, 2)}`);
|
|
17
|
-
if (mounted()) {
|
|
18
|
-
setConfig(payloads?.[0]);
|
|
19
|
-
}
|
|
20
|
-
}, [module]);
|
|
21
|
-
return (_jsxs(ModuleCardContent, { module: module, ...props, children: [_jsx(Typography, { children: "Parents" }), config?.parents?.commit?.map((address) => {
|
|
22
|
-
return _jsx(EthAccountBox, { address: EthAddress.fromString(address) }, address);
|
|
23
|
-
}), children] }));
|
|
4
|
+
return (_jsx(ModuleCardContent, { module: module, ...props, children: children }));
|
|
24
5
|
};
|
|
25
6
|
//# sourceMappingURL=CardContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardContent.js","sourceRoot":"","sources":["../../../../../src/components/Card/Diviner/CardContent.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"CardContent.js","sourceRoot":"","sources":["../../../../../src/components/Card/Diviner/CardContent.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAE7C,MAAM,CAAC,MAAM,kBAAkB,GAAkE,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAClI,OAAO,CACL,KAAC,iBAAiB,IAAC,MAAM,EAAE,MAAM,KAAM,KAAK,YACzC,QAAQ,GACS,CACrB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { ModuleCardHeader } from '../Module';
|
|
3
3
|
export const DivinerCardHeader = ({ title, module, ...props }) => {
|
|
4
|
-
return _jsx(ModuleCardHeader, { module: module, title: title ?? '
|
|
4
|
+
return _jsx(ModuleCardHeader, { module: module, title: title ?? module?.config.name ?? 'Diviner', ...props });
|
|
5
5
|
};
|
|
6
6
|
//# sourceMappingURL=CardHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardHeader.js","sourceRoot":"","sources":["../../../../../src/components/Card/Diviner/CardHeader.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAE5C,MAAM,CAAC,MAAM,iBAAiB,GAAiE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAC7H,OAAO,KAAC,gBAAgB,IAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,IAAI,
|
|
1
|
+
{"version":3,"file":"CardHeader.js","sourceRoot":"","sources":["../../../../../src/components/Card/Diviner/CardHeader.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAE5C,MAAM,CAAC,MAAM,iBAAiB,GAAiE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAC7H,OAAO,KAAC,gBAAgB,IAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,CAAC,IAAI,IAAI,SAAS,KAAM,KAAK,GAAI,CAAA;AAC1G,CAAC,CAAA"}
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { CardActions } from '@mui/material';
|
|
2
|
+
import { CardActions, Divider, Icon, Typography } from '@mui/material';
|
|
3
3
|
import { ButtonEx } from '@xylabs/react-button';
|
|
4
|
+
import { FlexGrowRow } from '@xylabs/react-flexbox';
|
|
4
5
|
import { ModuleWrapper } from '@xyo-network/module';
|
|
5
6
|
import { findNetworkComponent } from '@xyo-network/react-shared';
|
|
7
|
+
import { useState } from 'react';
|
|
8
|
+
import { DiscoverDialog } from './components';
|
|
6
9
|
const getModuleIcons = (moduleType, wrapper) => {
|
|
7
10
|
return wrapper?.queries.find((query) => query.startsWith(`network.xyo.query.${moduleType}`)) ? findNetworkComponent(moduleType)?.icon() : null;
|
|
8
11
|
};
|
|
9
|
-
export const ModuleCardActions = ({ children, module, ...props }) => {
|
|
12
|
+
export const ModuleCardActions = ({ children, module, sx, ...props }) => {
|
|
13
|
+
const [discoverDialogOpen, setDiscoverDialogOpen] = useState(false);
|
|
10
14
|
const wrapper = module ? ModuleWrapper.wrap(module) : undefined;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
const config = wrapper?.config;
|
|
16
|
+
return (_jsxs(CardActions, { sx: { alignItems: 'stretch', flexDirection: 'column', ml: 1, ...sx }, ...props, children: [_jsx(Typography, { variant: "caption", fontFamily: "inherit", fontWeight: "500", children: config?.schema }), _jsx(Divider, { flexItem: true, sx: { my: 1 } }), _jsxs(FlexGrowRow, { justifyContent: "space-between", alignItems: "center", children: [wrapper
|
|
17
|
+
? ['sentinel', 'bridge', 'archivist', 'diviner', 'node', 'witness'].map((moduleType) => {
|
|
18
|
+
const icon = getModuleIcons(moduleType, wrapper);
|
|
19
|
+
return icon ? (_jsx(Icon, { color: 'primary', title: moduleType.toLocaleUpperCase(), children: icon }, moduleType)) : null;
|
|
20
|
+
})
|
|
21
|
+
: null, _jsx(ButtonEx, { onClick: () => setDiscoverDialogOpen(true), size: 'small', variant: 'outlined', children: "Discover" }), _jsx(DiscoverDialog, { fullWidth: true, maxWidth: 'md', open: discoverDialogOpen, setOpen: setDiscoverDialogOpen, wrapper: wrapper })] }), children] }));
|
|
17
22
|
};
|
|
18
23
|
//# sourceMappingURL=CardActions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardActions.js","sourceRoot":"","sources":["../../../../../src/components/Card/Module/CardActions.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAoB,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"CardActions.js","sourceRoot":"","sources":["../../../../../src/components/Card/Module/CardActions.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAoB,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AACxF,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAGhC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C,MAAM,cAAc,GAAG,CAAC,UAAkB,EAAE,OAAsB,EAAE,EAAE;IACpE,OAAO,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,qBAAqB,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;AAChJ,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAmD,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IACtH,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IACnE,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAC/D,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,CAAA;IAE9B,OAAO,CACL,MAAC,WAAW,IAAC,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,KAAM,KAAK,aAC1F,KAAC,UAAU,IAAC,OAAO,EAAC,SAAS,EAAC,UAAU,EAAC,SAAS,EAAC,UAAU,EAAC,KAAK,YAChE,MAAM,EAAE,MAAM,GACJ,EACb,KAAC,OAAO,IAAC,QAAQ,QAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,GAAI,EACnC,MAAC,WAAW,IAAC,cAAc,EAAC,eAAe,EAAC,UAAU,EAAC,QAAQ,aAC5D,OAAO;wBACN,CAAC,CAAC,CAAC,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;4BACnF,MAAM,IAAI,GAAG,cAAc,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;4BAChD,OAAO,IAAI,CAAC,CAAC,CAAC,CACZ,KAAC,IAAI,IAAC,KAAK,EAAE,SAAS,EAAmB,KAAK,EAAE,UAAU,CAAC,iBAAiB,EAAE,YAC3E,IAAI,IADsB,UAAU,CAEhC,CACR,CAAC,CAAC,CAAC,IAAI,CAAA;wBACV,CAAC,CAAC;wBACJ,CAAC,CAAC,IAAI,EACR,KAAC,QAAQ,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,qBAAqB,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,yBAE7E,EACX,KAAC,cAAc,IAAC,SAAS,QAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,qBAAqB,EAAE,OAAO,EAAE,OAAO,GAAI,IAC5G,EACb,QAAQ,IACG,CACf,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,23 +1,6 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import { CardContent
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { EthAccountBox } from '@xylabs/react-crypto';
|
|
6
|
-
import { ModuleWrapper } from '@xyo-network/module';
|
|
7
|
-
import { useState } from 'react';
|
|
8
|
-
export const ModuleCardContent = ({ children, module, ...props }) => {
|
|
9
|
-
const [config, setConfig] = useState();
|
|
10
|
-
const account = module?.address ? EthAddress.fromString(module?.address) : undefined;
|
|
11
|
-
useAsyncEffect(
|
|
12
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13
|
-
async (mounted) => {
|
|
14
|
-
const wrapper = module ? ModuleWrapper.wrap(module) : undefined;
|
|
15
|
-
const payloads = await wrapper?.discover();
|
|
16
|
-
console.log(`Payloads: ${JSON.stringify(payloads, null, 2)}`);
|
|
17
|
-
if (mounted()) {
|
|
18
|
-
setConfig(payloads?.[0]);
|
|
19
|
-
}
|
|
20
|
-
}, [module]);
|
|
21
|
-
return (_jsxs(CardContent, { ...props, children: [_jsx(EthAccountBox, { address: account }), children, _jsx(Typography, { variant: "subtitle2", children: config?.schema })] }));
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { CardContent } from '@mui/material';
|
|
3
|
+
export const ModuleCardContent = ({ children, ...props }) => {
|
|
4
|
+
return _jsx(CardContent, { ...props, children: children });
|
|
22
5
|
};
|
|
23
6
|
//# sourceMappingURL=CardContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardContent.js","sourceRoot":"","sources":["../../../../../src/components/Card/Module/CardContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAoB,
|
|
1
|
+
{"version":3,"file":"CardContent.js","sourceRoot":"","sources":["../../../../../src/components/Card/Module/CardContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAoB,MAAM,eAAe,CAAA;AAI7D,MAAM,CAAC,MAAM,iBAAiB,GAAmD,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAC1G,OAAO,KAAC,WAAW,OAAK,KAAK,YAAG,QAAQ,GAAe,CAAA;AACzD,CAAC,CAAA"}
|
|
@@ -4,6 +4,6 @@ import { Identicon } from '@xylabs/react-identicon';
|
|
|
4
4
|
import { ModuleWrapper } from '@xyo-network/module';
|
|
5
5
|
export const ModuleCardHeader = ({ subheader, avatar, title, module, ...props }) => {
|
|
6
6
|
const wrapper = module ? ModuleWrapper.wrap(module) : undefined;
|
|
7
|
-
return (_jsx(CardHeader, { title: title ?? 'Module', subheader: subheader ?? wrapper?.address, avatar: avatar ?? _jsx(Identicon, { size: 24, value: wrapper?.address }), ...props }));
|
|
7
|
+
return (_jsx(CardHeader, { title: title ?? module?.config.name ?? 'Module', subheader: subheader ?? wrapper?.address, avatar: avatar ?? _jsx(Identicon, { size: 24, value: wrapper?.address }), ...props }));
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=CardHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardHeader.js","sourceRoot":"","sources":["../../../../../src/components/Card/Module/CardHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAInD,MAAM,CAAC,MAAM,gBAAgB,GAAkD,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAChI,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAC/D,OAAO,CACL,KAAC,UAAU,IACT,KAAK,EAAE,KAAK,IAAI,QAAQ,
|
|
1
|
+
{"version":3,"file":"CardHeader.js","sourceRoot":"","sources":["../../../../../src/components/Card/Module/CardHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAInD,MAAM,CAAC,MAAM,gBAAgB,GAAkD,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAChI,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAC/D,OAAO,CACL,KAAC,UAAU,IACT,KAAK,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,CAAC,IAAI,IAAI,QAAQ,EAC/C,SAAS,EAAE,SAAS,IAAI,OAAO,EAAE,OAAO,EACxC,MAAM,EAAE,MAAM,IAAI,KAAC,SAAS,IAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAI,KAC9D,KAAK,GACT,CACH,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Dialog, DialogActions, DialogContent } from '@mui/material';
|
|
3
|
+
import { useAsyncEffect } from '@xylabs/react-async-effect';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
export const DiscoverDialog = ({ setOpen, wrapper, ...props }) => {
|
|
6
|
+
const [discoverPayloads, setDiscoverPayloads] = useState([]);
|
|
7
|
+
useAsyncEffect(
|
|
8
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
9
|
+
async (mounted) => {
|
|
10
|
+
if (wrapper) {
|
|
11
|
+
const payloads = await wrapper.discover();
|
|
12
|
+
if (mounted())
|
|
13
|
+
setDiscoverPayloads(payloads);
|
|
14
|
+
}
|
|
15
|
+
}, [wrapper]);
|
|
16
|
+
return (_jsxs(Dialog, { ...props, children: [_jsx(DialogContent, { children: _jsx("pre", { children: JSON.stringify(discoverPayloads, null, 2) }) }), _jsx(DialogActions, { children: _jsx(Button, { onClick: () => setOpen?.(false), variant: 'outlined', children: "Close" }) })] }));
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=DiscoverDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiscoverDialog.js","sourceRoot":"","sources":["../../../../../../src/components/Card/Module/components/DiscoverDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,EAAe,MAAM,eAAe,CAAA;AACzF,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAG3D,OAAO,EAA4B,QAAQ,EAAE,MAAM,OAAO,CAAA;AAO1D,MAAM,CAAC,MAAM,cAAc,GAAkC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAC9F,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAY,EAAE,CAAC,CAAA;IAEvE,cAAc;IACZ,uDAAuD;IACvD,KAAK,EAAE,OAAO,EAAE,EAAE;QAChB,IAAI,OAAO,EAAE;YACX,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAA;YACzC,IAAI,OAAO,EAAE;gBAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAA;SAC7C;IACH,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAA;IAED,OAAO,CACL,MAAC,MAAM,OAAK,KAAK,aACf,KAAC,aAAa,cACZ,wBAAM,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC,GAAO,GACxC,EAChB,KAAC,aAAa,cACZ,KAAC,MAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,UAAU,sBAEnD,GACK,IACT,CACV,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/Card/Module/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardContent.d.ts","sourceRoot":"","sources":["../../../../../src/components/Card/Diviner/CardContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"CardContent.d.ts","sourceRoot":"","sources":["../../../../../src/components/Card/Diviner/CardContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAG9D,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,aAAa,CAAC,GAAG,gBAAgB,CAM5F,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardActions.d.ts","sourceRoot":"","sources":["../../../../../src/components/Card/Module/CardActions.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAe,gBAAgB,
|
|
1
|
+
{"version":3,"file":"CardActions.d.ts","sourceRoot":"","sources":["../../../../../src/components/Card/Module/CardActions.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAe,gBAAgB,EAA6B,MAAM,eAAe,CAAA;AAOxF,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAO9D,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,GAAG,iBAAiB,CA8B5E,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardContent.d.ts","sourceRoot":"","sources":["../../../../../src/components/Card/Module/CardContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAe,gBAAgB,
|
|
1
|
+
{"version":3,"file":"CardContent.d.ts","sourceRoot":"","sources":["../../../../../src/components/Card/Module/CardContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAe,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAE7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAE9D,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,GAAG,gBAAgB,CAE5E,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DialogProps } from '@mui/material';
|
|
2
|
+
import { ModuleWrapper } from '@xyo-network/module';
|
|
3
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
4
|
+
export interface DiscoverDialogProps extends DialogProps {
|
|
5
|
+
setOpen?: Dispatch<SetStateAction<boolean>>;
|
|
6
|
+
wrapper?: ModuleWrapper;
|
|
7
|
+
}
|
|
8
|
+
export declare const DiscoverDialog: React.FC<DiscoverDialogProps>;
|
|
9
|
+
//# sourceMappingURL=DiscoverDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiscoverDialog.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Card/Module/components/DiscoverDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgD,WAAW,EAAE,MAAM,eAAe,CAAA;AAEzF,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAY,MAAM,OAAO,CAAA;AAE1D,MAAM,WAAW,mBAAoB,SAAQ,WAAW;IACtD,OAAO,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAA;IAC3C,OAAO,CAAC,EAAE,aAAa,CAAA;CACxB;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA0BxD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Card/Module/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
|
package/package.json
CHANGED
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"@xyo-network/archivist": "^2.56.2",
|
|
20
20
|
"@xyo-network/diviner": "^2.56.2",
|
|
21
21
|
"@xyo-network/module": "^2.56.2",
|
|
22
|
-
"@xyo-network/
|
|
22
|
+
"@xyo-network/payload-model": "^2.56.2",
|
|
23
|
+
"@xyo-network/react-shared": "^2.49.7"
|
|
23
24
|
},
|
|
24
25
|
"devDependencies": {
|
|
25
26
|
"@ethersproject/address": "^5.7.0",
|
|
@@ -90,5 +91,5 @@
|
|
|
90
91
|
},
|
|
91
92
|
"sideEffects": false,
|
|
92
93
|
"types": "dist/types/index.d.ts",
|
|
93
|
-
"version": "2.49.
|
|
94
|
+
"version": "2.49.7"
|
|
94
95
|
}
|
|
@@ -7,18 +7,6 @@ import { useState } from 'react'
|
|
|
7
7
|
import { DivinerCard } from './Card'
|
|
8
8
|
|
|
9
9
|
const StorybookEntry = {
|
|
10
|
-
argTypes: {
|
|
11
|
-
authState: {
|
|
12
|
-
jwtToken: 'badToken',
|
|
13
|
-
loggedInAccount: 'none@none.com',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
component: DivinerCard,
|
|
17
|
-
parameters: {
|
|
18
|
-
docs: {
|
|
19
|
-
page: null,
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
10
|
title: 'modules/diviner/DivinerCard',
|
|
23
11
|
} as Meta<typeof DivinerCard>
|
|
24
12
|
|
|
@@ -32,6 +20,7 @@ const Template: StoryFn<typeof DivinerCard> = () => {
|
|
|
32
20
|
const newModule = await AddressHistoryDiviner.create({
|
|
33
21
|
config: {
|
|
34
22
|
address: '',
|
|
23
|
+
name: 'AddressHistoryDiviner',
|
|
35
24
|
schema: AddressHistoryDivinerConfigSchema,
|
|
36
25
|
},
|
|
37
26
|
})
|
|
@@ -1,37 +1,12 @@
|
|
|
1
|
-
import { CardContentProps
|
|
2
|
-
import { EthAddress } from '@xylabs/eth-address'
|
|
3
|
-
import { useAsyncEffect } from '@xylabs/react-async-effect'
|
|
4
|
-
import { EthAccountBox } from '@xylabs/react-crypto'
|
|
5
|
-
import { ArchivistConfig } from '@xyo-network/archivist'
|
|
1
|
+
import { CardContentProps } from '@mui/material'
|
|
6
2
|
import { DivinerModule } from '@xyo-network/diviner'
|
|
7
|
-
import { AnyConfigSchema, ModuleWrapper } from '@xyo-network/module'
|
|
8
|
-
import { useState } from 'react'
|
|
9
3
|
|
|
10
4
|
import { ModuleRenderProps } from '../../../ModuleRenderProps'
|
|
11
5
|
import { ModuleCardContent } from '../Module'
|
|
12
6
|
|
|
13
7
|
export const DivinerCardContent: React.FC<ModuleRenderProps<DivinerModule> & CardContentProps> = ({ children, module, ...props }) => {
|
|
14
|
-
const [config, setConfig] = useState<AnyConfigSchema<ArchivistConfig>>()
|
|
15
|
-
|
|
16
|
-
useAsyncEffect(
|
|
17
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
18
|
-
async (mounted) => {
|
|
19
|
-
const wrapper = module ? ModuleWrapper.wrap(module) : undefined
|
|
20
|
-
const payloads = await wrapper?.discover()
|
|
21
|
-
console.log(`Payloads: ${JSON.stringify(payloads, null, 2)}`)
|
|
22
|
-
if (mounted()) {
|
|
23
|
-
setConfig(payloads?.[0])
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
[module],
|
|
27
|
-
)
|
|
28
|
-
|
|
29
8
|
return (
|
|
30
9
|
<ModuleCardContent module={module} {...props}>
|
|
31
|
-
<Typography>Parents</Typography>
|
|
32
|
-
{config?.parents?.commit?.map((address) => {
|
|
33
|
-
return <EthAccountBox key={address} address={EthAddress.fromString(address)} />
|
|
34
|
-
})}
|
|
35
10
|
{children}
|
|
36
11
|
</ModuleCardContent>
|
|
37
12
|
)
|
|
@@ -5,5 +5,5 @@ import { ModuleRenderProps } from '../../../ModuleRenderProps'
|
|
|
5
5
|
import { ModuleCardHeader } from '../Module'
|
|
6
6
|
|
|
7
7
|
export const DivinerCardHeader: React.FC<ModuleRenderProps<DivinerModule> & CardHeaderProps> = ({ title, module, ...props }) => {
|
|
8
|
-
return <ModuleCardHeader module={module} title={title ?? '
|
|
8
|
+
return <ModuleCardHeader module={module} title={title ?? module?.config.name ?? 'Diviner'} {...props} />
|
|
9
9
|
}
|
|
@@ -1,25 +1,44 @@
|
|
|
1
|
-
import { CardActions, CardActionsProps } from '@mui/material'
|
|
1
|
+
import { CardActions, CardActionsProps, Divider, Icon, Typography } from '@mui/material'
|
|
2
2
|
import { ButtonEx } from '@xylabs/react-button'
|
|
3
|
+
import { FlexGrowRow } from '@xylabs/react-flexbox'
|
|
3
4
|
import { ModuleWrapper } from '@xyo-network/module'
|
|
4
5
|
import { findNetworkComponent } from '@xyo-network/react-shared'
|
|
6
|
+
import { useState } from 'react'
|
|
5
7
|
|
|
6
8
|
import { ModuleRenderProps } from '../../../ModuleRenderProps'
|
|
9
|
+
import { DiscoverDialog } from './components'
|
|
7
10
|
|
|
8
11
|
const getModuleIcons = (moduleType: string, wrapper: ModuleWrapper) => {
|
|
9
12
|
return wrapper?.queries.find((query) => query.startsWith(`network.xyo.query.${moduleType}`)) ? findNetworkComponent(moduleType)?.icon() : null
|
|
10
13
|
}
|
|
11
14
|
|
|
12
|
-
export const ModuleCardActions: React.FC<CardActionsProps & ModuleRenderProps> = ({ children, module, ...props }) => {
|
|
15
|
+
export const ModuleCardActions: React.FC<CardActionsProps & ModuleRenderProps> = ({ children, module, sx, ...props }) => {
|
|
16
|
+
const [discoverDialogOpen, setDiscoverDialogOpen] = useState(false)
|
|
13
17
|
const wrapper = module ? ModuleWrapper.wrap(module) : undefined
|
|
18
|
+
const config = wrapper?.config
|
|
19
|
+
|
|
14
20
|
return (
|
|
15
|
-
<CardActions
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
<CardActions sx={{ alignItems: 'stretch', flexDirection: 'column', ml: 1, ...sx }} {...props}>
|
|
22
|
+
<Typography variant="caption" fontFamily="inherit" fontWeight="500">
|
|
23
|
+
{config?.schema}
|
|
24
|
+
</Typography>
|
|
25
|
+
<Divider flexItem sx={{ my: 1 }} />
|
|
26
|
+
<FlexGrowRow justifyContent="space-between" alignItems="center">
|
|
27
|
+
{wrapper
|
|
28
|
+
? ['sentinel', 'bridge', 'archivist', 'diviner', 'node', 'witness'].map((moduleType) => {
|
|
29
|
+
const icon = getModuleIcons(moduleType, wrapper)
|
|
30
|
+
return icon ? (
|
|
31
|
+
<Icon color={'primary'} key={moduleType} title={moduleType.toLocaleUpperCase()}>
|
|
32
|
+
{icon}
|
|
33
|
+
</Icon>
|
|
34
|
+
) : null
|
|
35
|
+
})
|
|
36
|
+
: null}
|
|
37
|
+
<ButtonEx onClick={() => setDiscoverDialogOpen(true)} size={'small'} variant={'outlined'}>
|
|
38
|
+
Discover
|
|
39
|
+
</ButtonEx>
|
|
40
|
+
<DiscoverDialog fullWidth maxWidth={'md'} open={discoverDialogOpen} setOpen={setDiscoverDialogOpen} wrapper={wrapper} />
|
|
41
|
+
</FlexGrowRow>
|
|
23
42
|
{children}
|
|
24
43
|
</CardActions>
|
|
25
44
|
)
|
|
@@ -1,35 +1,7 @@
|
|
|
1
|
-
import { CardContent, CardContentProps
|
|
2
|
-
import { EthAddress } from '@xylabs/eth-address'
|
|
3
|
-
import { useAsyncEffect } from '@xylabs/react-async-effect'
|
|
4
|
-
import { EthAccountBox } from '@xylabs/react-crypto'
|
|
5
|
-
import { AnyConfigSchema, ModuleConfig, ModuleWrapper } from '@xyo-network/module'
|
|
6
|
-
import { useState } from 'react'
|
|
1
|
+
import { CardContent, CardContentProps } from '@mui/material'
|
|
7
2
|
|
|
8
3
|
import { ModuleRenderProps } from '../../../ModuleRenderProps'
|
|
9
4
|
|
|
10
|
-
export const ModuleCardContent: React.FC<ModuleRenderProps & CardContentProps> = ({ children,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const account = module?.address ? EthAddress.fromString(module?.address) : undefined
|
|
14
|
-
|
|
15
|
-
useAsyncEffect(
|
|
16
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
17
|
-
async (mounted) => {
|
|
18
|
-
const wrapper = module ? ModuleWrapper.wrap(module) : undefined
|
|
19
|
-
const payloads = await wrapper?.discover()
|
|
20
|
-
console.log(`Payloads: ${JSON.stringify(payloads, null, 2)}`)
|
|
21
|
-
if (mounted()) {
|
|
22
|
-
setConfig(payloads?.[0])
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
[module],
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<CardContent {...props}>
|
|
30
|
-
<EthAccountBox address={account} />
|
|
31
|
-
{children}
|
|
32
|
-
<Typography variant="subtitle2">{config?.schema}</Typography>
|
|
33
|
-
</CardContent>
|
|
34
|
-
)
|
|
5
|
+
export const ModuleCardContent: React.FC<ModuleRenderProps & CardContentProps> = ({ children, ...props }) => {
|
|
6
|
+
return <CardContent {...props}>{children}</CardContent>
|
|
35
7
|
}
|
|
@@ -8,7 +8,7 @@ export const ModuleCardHeader: React.FC<ModuleRenderProps & CardHeaderProps> = (
|
|
|
8
8
|
const wrapper = module ? ModuleWrapper.wrap(module) : undefined
|
|
9
9
|
return (
|
|
10
10
|
<CardHeader
|
|
11
|
-
title={title ?? 'Module'}
|
|
11
|
+
title={title ?? module?.config.name ?? 'Module'}
|
|
12
12
|
subheader={subheader ?? wrapper?.address}
|
|
13
13
|
avatar={avatar ?? <Identicon size={24} value={wrapper?.address} />}
|
|
14
14
|
{...props}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Button, Dialog, DialogActions, DialogContent, DialogProps } from '@mui/material'
|
|
2
|
+
import { useAsyncEffect } from '@xylabs/react-async-effect'
|
|
3
|
+
import { ModuleWrapper } from '@xyo-network/module'
|
|
4
|
+
import { Payload } from '@xyo-network/payload-model'
|
|
5
|
+
import { Dispatch, SetStateAction, useState } from 'react'
|
|
6
|
+
|
|
7
|
+
export interface DiscoverDialogProps extends DialogProps {
|
|
8
|
+
setOpen?: Dispatch<SetStateAction<boolean>>
|
|
9
|
+
wrapper?: ModuleWrapper
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const DiscoverDialog: React.FC<DiscoverDialogProps> = ({ setOpen, wrapper, ...props }) => {
|
|
13
|
+
const [discoverPayloads, setDiscoverPayloads] = useState<Payload[]>([])
|
|
14
|
+
|
|
15
|
+
useAsyncEffect(
|
|
16
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
17
|
+
async (mounted) => {
|
|
18
|
+
if (wrapper) {
|
|
19
|
+
const payloads = await wrapper.discover()
|
|
20
|
+
if (mounted()) setDiscoverPayloads(payloads)
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
[wrapper],
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<Dialog {...props}>
|
|
28
|
+
<DialogContent>
|
|
29
|
+
<pre>{JSON.stringify(discoverPayloads, null, 2)}</pre>
|
|
30
|
+
</DialogContent>
|
|
31
|
+
<DialogActions>
|
|
32
|
+
<Button onClick={() => setOpen?.(false)} variant={'outlined'}>
|
|
33
|
+
Close
|
|
34
|
+
</Button>
|
|
35
|
+
</DialogActions>
|
|
36
|
+
</Dialog>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DiscoverDialog'
|