@xyo-network/react-module 2.56.1 → 2.56.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/cjs/components/Card/Diviner/CardContent.js +2 -2
  2. package/dist/cjs/components/Card/Diviner/CardContent.js.map +1 -1
  3. package/dist/cjs/components/Card/Module/CardActions.js +3 -3
  4. package/dist/cjs/components/Card/Module/CardActions.js.map +1 -1
  5. package/dist/cjs/components/Card/Module/components/DiscoverDialog.js +1 -1
  6. package/dist/cjs/components/Card/Module/components/DiscoverDialog.js.map +1 -1
  7. package/dist/cjs/components/DetailsBox.js +1 -1
  8. package/dist/cjs/components/DetailsBox.js.map +1 -1
  9. package/dist/cjs/hooks/WrappedModuleHookFactory.js +36 -0
  10. package/dist/cjs/hooks/WrappedModuleHookFactory.js.map +1 -0
  11. package/dist/cjs/hooks/WrappedModulesHookFactory.js +36 -0
  12. package/dist/cjs/hooks/WrappedModulesHookFactory.js.map +1 -0
  13. package/dist/cjs/hooks/index.js +9 -0
  14. package/dist/cjs/hooks/index.js.map +1 -0
  15. package/dist/cjs/hooks/useRefresh.js +18 -0
  16. package/dist/cjs/hooks/useRefresh.js.map +1 -0
  17. package/dist/cjs/hooks/useWrappedModule.js +7 -0
  18. package/dist/cjs/hooks/useWrappedModule.js.map +1 -0
  19. package/dist/cjs/hooks/useWrappedModules.js +7 -0
  20. package/dist/cjs/hooks/useWrappedModules.js.map +1 -0
  21. package/dist/cjs/index.js +1 -0
  22. package/dist/cjs/index.js.map +1 -1
  23. package/dist/docs.json +5326 -850
  24. package/dist/esm/components/Card/Diviner/CardContent.js +2 -2
  25. package/dist/esm/components/Card/Diviner/CardContent.js.map +1 -1
  26. package/dist/esm/components/Card/Module/CardActions.js +2 -2
  27. package/dist/esm/components/Card/Module/CardActions.js.map +1 -1
  28. package/dist/esm/hooks/WrappedModuleHookFactory.js +33 -0
  29. package/dist/esm/hooks/WrappedModuleHookFactory.js.map +1 -0
  30. package/dist/esm/hooks/WrappedModulesHookFactory.js +33 -0
  31. package/dist/esm/hooks/WrappedModulesHookFactory.js.map +1 -0
  32. package/dist/esm/hooks/index.js +6 -0
  33. package/dist/esm/hooks/index.js.map +1 -0
  34. package/dist/esm/hooks/useRefresh.js +14 -0
  35. package/dist/esm/hooks/useRefresh.js.map +1 -0
  36. package/dist/esm/hooks/useWrappedModule.js +4 -0
  37. package/dist/esm/hooks/useWrappedModule.js.map +1 -0
  38. package/dist/esm/hooks/useWrappedModules.js +4 -0
  39. package/dist/esm/hooks/useWrappedModules.js.map +1 -0
  40. package/dist/esm/index.js +1 -0
  41. package/dist/esm/index.js.map +1 -1
  42. package/dist/types/ModuleRenderProps.d.ts +4 -2
  43. package/dist/types/ModuleRenderProps.d.ts.map +1 -1
  44. package/dist/types/components/Card/Diviner/CardContent.d.ts.map +1 -1
  45. package/dist/types/components/Card/Module/CardActions.d.ts.map +1 -1
  46. package/dist/types/hooks/WrappedModuleHookFactory.d.ts +35 -0
  47. package/dist/types/hooks/WrappedModuleHookFactory.d.ts.map +1 -0
  48. package/dist/types/hooks/WrappedModulesHookFactory.d.ts +35 -0
  49. package/dist/types/hooks/WrappedModulesHookFactory.d.ts.map +1 -0
  50. package/dist/types/hooks/index.d.ts +6 -0
  51. package/dist/types/hooks/index.d.ts.map +1 -0
  52. package/dist/types/hooks/useRefresh.d.ts +4 -0
  53. package/dist/types/hooks/useRefresh.d.ts.map +1 -0
  54. package/dist/types/hooks/useWrappedModule.d.ts +59 -0
  55. package/dist/types/hooks/useWrappedModule.d.ts.map +1 -0
  56. package/dist/types/hooks/useWrappedModules.d.ts +59 -0
  57. package/dist/types/hooks/useWrappedModules.d.ts.map +1 -0
  58. package/dist/types/index.d.ts +1 -0
  59. package/dist/types/index.d.ts.map +1 -1
  60. package/package.json +7 -4
  61. package/src/ModuleRenderProps.tsx +3 -1
  62. package/src/components/Card/Diviner/CardContent.tsx +2 -6
  63. package/src/components/Card/Module/CardActions.tsx +3 -2
  64. package/src/hooks/WrappedModuleHookFactory.tsx +41 -0
  65. package/src/hooks/WrappedModulesHookFactory.tsx +41 -0
  66. package/src/hooks/index.ts +5 -0
  67. package/src/hooks/useRefresh.tsx +17 -0
  68. package/src/hooks/useWrappedModule.tsx +5 -0
  69. package/src/hooks/useWrappedModules.tsx +5 -0
  70. package/src/index.ts +1 -0
@@ -5,8 +5,8 @@ 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 DivinerCardContent = (_a) => {
8
- var { children, module } = _a, props = tslib_1.__rest(_a, ["children", "module"]);
9
- return ((0, jsx_runtime_1.jsx)(Module_1.ModuleCardContent, Object.assign({ module: module }, props, { children: children })));
8
+ var { children } = _a, props = tslib_1.__rest(_a, ["children"]);
9
+ return (0, jsx_runtime_1.jsx)(Module_1.ModuleCardContent, Object.assign({}, props, { children: children }));
10
10
  };
11
11
  exports.DivinerCardContent = DivinerCardContent;
12
12
  //# sourceMappingURL=CardContent.js.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"CardContent.js","sourceRoot":"","sources":["../../../../../src/components/Card/Diviner/CardContent.tsx"],"names":[],"mappings":";;;;;AAIA,sCAA6C;AAEtC,MAAM,kBAAkB,GAAkE,CAAC,EAAsB,EAAE,EAAE;QAA1B,EAAE,QAAQ,OAAY,EAAP,KAAK,sBAApB,YAAsB,CAAF;IACpH,OAAO,uBAAC,0BAAiB,oBAAK,KAAK,cAAG,QAAQ,IAAqB,CAAA;AACrE,CAAC,CAAA;AAFY,QAAA,kBAAkB,sBAE9B"}
@@ -6,15 +6,15 @@ 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
8
  const react_flexbox_1 = require("@xylabs/react-flexbox");
9
- const module_1 = require("@xyo-network/module");
10
9
  const react_1 = require("react");
10
+ const hooks_1 = require("../../../hooks");
11
11
  const components_1 = require("./components");
12
12
  const ModuleCardActions = (_a) => {
13
13
  var { children, module, sx } = _a, props = tslib_1.__rest(_a, ["children", "module", "sx"]);
14
14
  const [discoverDialogOpen, setDiscoverDialogOpen] = (0, react_1.useState)(false);
15
- const wrapper = module ? module_1.ModuleWrapper.wrap(module) : undefined;
15
+ const [wrapper] = (0, hooks_1.useWrappedModule)(module);
16
16
  const config = wrapper === null || wrapper === void 0 ? void 0 : wrapper.config;
17
- 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.jsxs)(react_flexbox_1.FlexGrowRow, { justifyContent: "space-between", alignItems: "center", children: [wrapper ? (0, jsx_runtime_1.jsx)(material_1.Chip, { label: config === null || config === void 0 ? void 0 : config.schema, size: 'small' }) : null, (0, jsx_runtime_1.jsx)(react_button_1.ButtonEx, { onClick: () => setDiscoverDialogOpen(true), size: 'small', variant: 'outlined', children: "Discover" }), (0, jsx_runtime_1.jsx)(components_1.DiscoverDialog, { fullWidth: true, maxWidth: 'md', module: module, open: discoverDialogOpen, setOpen: setDiscoverDialogOpen, wrapper: wrapper })] }), children] })));
17
+ 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.jsxs)(react_flexbox_1.FlexGrowRow, Object.assign({ justifyContent: "space-between", alignItems: "center" }, { children: [wrapper ? (0, jsx_runtime_1.jsx)(material_1.Chip, { label: config === null || config === void 0 ? void 0 : config.schema, size: 'small' }) : 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', module: module, open: discoverDialogOpen, setOpen: setDiscoverDialogOpen, wrapper: wrapper })] })), children] })));
18
18
  };
19
19
  exports.ModuleCardActions = ModuleCardActions;
20
20
  //# sourceMappingURL=CardActions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CardActions.js","sourceRoot":"","sources":["../../../../../src/components/Card/Module/CardActions.tsx"],"names":[],"mappings":";;;;;AAAA,4CAAmE;AACnE,uDAA+C;AAC/C,yDAAmD;AACnD,gDAAmD;AACnD,iCAAgC;AAGhC,6CAA6C;AAEtC,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,eAC1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AU,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,IAAK,EAAE,KAAQ,KAAK,eAC1F,wBAAC,2BAAW,kBAAC,cAAc,EAAC,eAAe,EAAC,UAAU,EAAC,QAAQ,iBAC5D,OAAO,CAAC,CAAC,CAAC,uBAAC,eAAI,IAAC,KAAK,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAI,CAAC,CAAC,CAAC,IAAI,EAChE,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,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,qBAAqB,EAAE,OAAO,EAAE,OAAO,GAAI,KAC5H,EACb,QAAQ,KACG,CACf,CAAA;AACH,CAAC,CAAA;AAlBY,QAAA,iBAAiB,qBAkB7B"}
@@ -19,7 +19,7 @@ const DiscoverDialog = (_a) => {
19
19
  setDiscoverPayloads(payloads);
20
20
  }
21
21
  }), [wrapper]);
22
- return ((0, jsx_runtime_1.jsxs)(material_1.Dialog, Object.assign({}, props, { children: [(0, jsx_runtime_1.jsxs)(material_1.DialogTitle, { children: ["Supported Queries for ", (module === null || module === void 0 ? void 0 : module.config.name) || (module === null || module === void 0 ? void 0 : module.address)] }), (0, jsx_runtime_1.jsx)(material_1.Divider, {}), (0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsxs)(material_1.Paper, { sx: { p: 1 }, children: [(0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: "All modules share a set of base queries along with ones specific to the module." }), (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, { onClick: () => setOpen === null || setOpen === void 0 ? void 0 : setOpen(false), variant: 'outlined', children: "Close" }) })] })));
22
+ return ((0, jsx_runtime_1.jsxs)(material_1.Dialog, Object.assign({}, props, { children: [(0, jsx_runtime_1.jsxs)(material_1.DialogTitle, { children: ["Supported Queries for ", (module === null || module === void 0 ? void 0 : module.config.name) || (module === null || module === void 0 ? void 0 : module.address)] }), (0, jsx_runtime_1.jsx)(material_1.Divider, {}), (0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsxs)(material_1.Paper, Object.assign({ sx: { p: 1 } }, { children: [(0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: "All modules share a set of base queries along with ones specific to the module." }), (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" })) })] })));
23
23
  };
24
24
  exports.DiscoverDialog = DiscoverDialog;
25
25
  //# sourceMappingURL=DiscoverDialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DiscoverDialog.js","sourceRoot":"","sources":["../../../../../../src/components/Card/Module/components/DiscoverDialog.tsx"],"names":[],"mappings":";;;;;AAAA,4CAAyI;AACzI,mEAA2D;AAG3D,iCAA0D;AAQ1D,2EAA2E;AAEpE,MAAM,cAAc,GAAkC,CAAC,EAAsC,EAAE,EAAE;QAA1C,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,OAAY,EAAP,KAAK,sBAApC,gCAAsC,CAAF;IAChG,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,wBAAC,sBAAW,yCAAwB,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAC,IAAI,MAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,CAAA,IAAe,EACzF,uBAAC,kBAAO,KAAG,EACX,uBAAC,wBAAa,cACZ,wBAAC,gBAAK,IAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,aACjB,uBAAC,4BAAiB,kGAAoG,EACtH,0CAAM,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC,GAAO,IAChD,GACM,EAChB,uBAAC,wBAAa,cACZ,uBAAC,iBAAM,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,KAAK,CAAC,EAAE,OAAO,EAAE,UAAU,sBAEnD,GACK,KACT,CACV,CAAA;AACH,CAAC,CAAA;AA/BY,QAAA,cAAc,kBA+B1B"}
1
+ {"version":3,"file":"DiscoverDialog.js","sourceRoot":"","sources":["../../../../../../src/components/Card/Module/components/DiscoverDialog.tsx"],"names":[],"mappings":";;;;;AAAA,4CAAyI;AACzI,mEAA2D;AAG3D,iCAA0D;AAQ1D,2EAA2E;AAEpE,MAAM,cAAc,GAAkC,CAAC,EAAsC,EAAE,EAAE;QAA1C,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,OAAY,EAAP,KAAK,sBAApC,gCAAsC,CAAF;IAChG,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,wBAAC,sBAAW,yCAAwB,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAC,IAAI,MAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,CAAA,IAAe,EACzF,uBAAC,kBAAO,KAAG,EACX,uBAAC,wBAAa,cACZ,wBAAC,gBAAK,kBAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,iBACjB,uBAAC,4BAAiB,kGAAoG,EACtH,0CAAM,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC,GAAO,KAChD,GACM,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;AA/BY,QAAA,cAAc,kBA+B1B"}
@@ -21,7 +21,7 @@ const ModuleDetailsBox = (_a) => {
21
21
  return ((0, jsx_runtime_1.jsxs)(react_flexbox_1.FlexCol, Object.assign({}, props, { children: [(0, jsx_runtime_1.jsxs)(react_flexbox_1.FlexRow, { children: [wrapper
22
22
  ? ['sentinel', 'bridge', 'archivist', 'diviner', 'node'].map((moduleType) => {
23
23
  const icon = getModuleIcon(moduleType, wrapper);
24
- return icon ? ((0, jsx_runtime_1.jsx)(react_button_1.ButtonEx, { onClick: () => setShowQueries(!showQueries), children: icon }, moduleType)) : null;
24
+ return icon ? ((0, jsx_runtime_1.jsx)(react_button_1.ButtonEx, Object.assign({ onClick: () => setShowQueries(!showQueries) }, { children: icon }), moduleType)) : null;
25
25
  })
26
26
  : null, (0, jsx_runtime_1.jsx)(react_crypto_1.EthAccountBox, { address: eth_address_1.EthAddress.fromString(wrapper === null || wrapper === void 0 ? void 0 : wrapper.address) })] }), showQueries
27
27
  ? wrapper === null || wrapper === void 0 ? void 0 : wrapper.queries.map((query) => {
@@ -1 +1 @@
1
- {"version":3,"file":"DetailsBox.js","sourceRoot":"","sources":["../../../src/components/DetailsBox.tsx"],"names":[],"mappings":";;;;;AAAA,qDAAgD;AAChD,uDAA+C;AAC/C,uDAAoD;AACpD,yDAAsE;AACtE,gDAAmD;AACnD,4DAAgE;AAChE,iCAAgC;AAIhC,MAAM,aAAa,GAAG,CAAC,UAAkB,EAAE,OAAsB,EAAE,EAAE;;IACnE,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,gBAAgB,GAA+C,CAAC,EAA8B,EAAE,EAAE;QAAlC,EAAE,QAAQ,EAAE,MAAM,OAAY,EAAP,KAAK,sBAA5B,sBAA8B,CAAF;IACvG,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,sBAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAC/D,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,IAAA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,GAAI,IAC3D,EAET,WAAW;gBACV,CAAC,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;oBAC7B,OAAO,uBAAC,uBAAO,cAAc,KAAK,IAAb,KAAK,CAAmB,CAAA;gBAC/C,CAAC,CAAC;gBACJ,CAAC,CAAC,IAAI,EACP,QAAQ,KACD,CACX,CAAA;AACH,CAAC,CAAA;AA3BY,QAAA,gBAAgB,oBA2B5B"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WrappedModuleHookFactory = void 0;
4
+ const react_wallet_1 = require("@xyo-network/react-wallet");
5
+ const react_1 = require("react");
6
+ exports.WrappedModuleHookFactory = {
7
+ create: (wrapperObject, name) => {
8
+ const useHook = (module, account, logger) => {
9
+ logger === null || logger === void 0 ? void 0 : logger.debug(`Render: ${name}`);
10
+ const wrapperAccount = (0, react_wallet_1.useWrapperAccount)();
11
+ const [wrapper, setWrapper] = (0, react_1.useState)();
12
+ const [error, setError] = (0, react_1.useState)();
13
+ (0, react_1.useEffect)(() => {
14
+ const walletToUse = account || wrapperAccount;
15
+ if (module && walletToUse) {
16
+ try {
17
+ const wrapper = wrapperObject.wrap(module, walletToUse);
18
+ setWrapper(wrapper);
19
+ setError(undefined);
20
+ }
21
+ catch (ex) {
22
+ setWrapper(undefined);
23
+ setError(ex);
24
+ }
25
+ }
26
+ else {
27
+ setWrapper(undefined);
28
+ setError(undefined);
29
+ }
30
+ }, [module, account, wrapperAccount]);
31
+ return [wrapper, error];
32
+ };
33
+ return useHook;
34
+ },
35
+ };
36
+ //# sourceMappingURL=WrappedModuleHookFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WrappedModuleHookFactory.js","sourceRoot":"","sources":["../../../src/hooks/WrappedModuleHookFactory.tsx"],"names":[],"mappings":";;;AAGA,4DAA6D;AAC7D,iCAA2C;AAE9B,QAAA,wBAAwB,GAAG;IACtC,MAAM,EAAE,CAAuC,aAAyD,EAAE,IAAa,EAAE,EAAE;QACzH,MAAM,OAAO,GAAG,CACd,MAAiC,EACjC,OAAyB,EACzB,MAAe,EACkC,EAAE;YACnD,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAC,WAAW,IAAI,EAAE,CAAC,CAAA;YAChC,MAAM,cAAc,GAAG,IAAA,gCAAiB,GAAE,CAAA;YAE1C,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,GAAkB,CAAA;YACxD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,GAAS,CAAA;YAE3C,IAAA,iBAAS,EAAC,GAAG,EAAE;gBACb,MAAM,WAAW,GAAG,OAAO,IAAI,cAAc,CAAA;gBAC7C,IAAI,MAAM,IAAI,WAAW,EAAE;oBACzB,IAAI;wBACF,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;wBACvD,UAAU,CAAC,OAAO,CAAC,CAAA;wBACnB,QAAQ,CAAC,SAAS,CAAC,CAAA;qBACpB;oBAAC,OAAO,EAAE,EAAE;wBACX,UAAU,CAAC,SAAS,CAAC,CAAA;wBACrB,QAAQ,CAAC,EAAW,CAAC,CAAA;qBACtB;iBACF;qBAAM;oBACL,UAAU,CAAC,SAAS,CAAC,CAAA;oBACrB,QAAQ,CAAC,SAAS,CAAC,CAAA;iBACpB;YACH,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC,CAAA;YAErC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QACzB,CAAC,CAAA;QACD,OAAO,OAAO,CAAA;IAChB,CAAC;CACF,CAAA"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WrappedModulesHookFactory = void 0;
4
+ const react_wallet_1 = require("@xyo-network/react-wallet");
5
+ const react_1 = require("react");
6
+ exports.WrappedModulesHookFactory = {
7
+ create: (wrapperObject, name) => {
8
+ const useHook = (modules, account, logger) => {
9
+ logger === null || logger === void 0 ? void 0 : logger.debug(`Render: ${name}`);
10
+ const wrapperAccount = (0, react_wallet_1.useWrapperAccount)();
11
+ const [wrappers, setWrappers] = (0, react_1.useState)();
12
+ const [error, setError] = (0, react_1.useState)();
13
+ (0, react_1.useEffect)(() => {
14
+ const walletToUse = account || wrapperAccount;
15
+ if (module && walletToUse) {
16
+ try {
17
+ const wrappers = modules === null || modules === void 0 ? void 0 : modules.map((module) => wrapperObject.wrap(module, walletToUse));
18
+ setWrappers(wrappers);
19
+ setError(undefined);
20
+ }
21
+ catch (ex) {
22
+ setWrappers(undefined);
23
+ setError(ex);
24
+ }
25
+ }
26
+ else {
27
+ setWrappers(undefined);
28
+ setError(undefined);
29
+ }
30
+ }, [modules, account, wrapperAccount]);
31
+ return [wrappers, error];
32
+ };
33
+ return useHook;
34
+ },
35
+ };
36
+ //# sourceMappingURL=WrappedModulesHookFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WrappedModulesHookFactory.js","sourceRoot":"","sources":["../../../src/hooks/WrappedModulesHookFactory.tsx"],"names":[],"mappings":";;;AAGA,4DAA6D;AAC7D,iCAA2C;AAE9B,QAAA,yBAAyB,GAAG;IACvC,MAAM,EAAE,CAAuC,aAAyD,EAAE,IAAa,EAAE,EAAE;QACzH,MAAM,OAAO,GAAG,CACd,OAAoC,EACpC,OAAyB,EACzB,MAAe,EACoC,EAAE;YACrD,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAC,WAAW,IAAI,EAAE,CAAC,CAAA;YAChC,MAAM,cAAc,GAAG,IAAA,gCAAiB,GAAE,CAAA;YAE1C,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,IAAA,gBAAQ,GAAoB,CAAA;YAC5D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,GAAS,CAAA;YAE3C,IAAA,iBAAS,EAAC,GAAG,EAAE;gBACb,MAAM,WAAW,GAAG,OAAO,IAAI,cAAc,CAAA;gBAC7C,IAAI,MAAM,IAAI,WAAW,EAAE;oBACzB,IAAI;wBACF,MAAM,QAAQ,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAA;wBAClF,WAAW,CAAC,QAAQ,CAAC,CAAA;wBACrB,QAAQ,CAAC,SAAS,CAAC,CAAA;qBACpB;oBAAC,OAAO,EAAE,EAAE;wBACX,WAAW,CAAC,SAAS,CAAC,CAAA;wBACtB,QAAQ,CAAC,EAAW,CAAC,CAAA;qBACtB;iBACF;qBAAM;oBACL,WAAW,CAAC,SAAS,CAAC,CAAA;oBACtB,QAAQ,CAAC,SAAS,CAAC,CAAA;iBACpB;YACH,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC,CAAA;YAEtC,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;QAC1B,CAAC,CAAA;QACD,OAAO,OAAO,CAAA;IAChB,CAAC;CACF,CAAA"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./useRefresh"), exports);
5
+ tslib_1.__exportStar(require("./useWrappedModule"), exports);
6
+ tslib_1.__exportStar(require("./useWrappedModules"), exports);
7
+ tslib_1.__exportStar(require("./WrappedModuleHookFactory"), exports);
8
+ tslib_1.__exportStar(require("./WrappedModulesHookFactory"), exports);
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":";;;AAAA,uDAA4B;AAC5B,6DAAkC;AAClC,8DAAmC;AACnC,qEAA0C;AAC1C,sEAA2C"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useRefresh = void 0;
4
+ const react_1 = require("react");
5
+ const useRefresh = () => {
6
+ const [enabled, setEnabled] = (0, react_1.useState)(1);
7
+ return [
8
+ !!enabled,
9
+ () => {
10
+ const enabledCount = enabled + 1;
11
+ setEnabled(enabledCount);
12
+ return !!enabledCount;
13
+ },
14
+ () => setEnabled(0),
15
+ ];
16
+ };
17
+ exports.useRefresh = useRefresh;
18
+ //# sourceMappingURL=useRefresh.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRefresh.js","sourceRoot":"","sources":["../../../src/hooks/useRefresh.tsx"],"names":[],"mappings":";;;AAAA,iCAAgC;AAKzB,MAAM,UAAU,GAAG,GAAgD,EAAE;IAC1E,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,CAAC,CAAA;IACzC,OAAO;QACL,CAAC,CAAC,OAAO;QACT,GAAG,EAAE;YACH,MAAM,YAAY,GAAG,OAAO,GAAG,CAAC,CAAA;YAChC,UAAU,CAAC,YAAY,CAAC,CAAA;YACxB,OAAO,CAAC,CAAC,YAAY,CAAA;QACvB,CAAC;QACD,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;KACpB,CAAA;AACH,CAAC,CAAA;AAXY,QAAA,UAAU,cAWtB"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useWrappedModule = void 0;
4
+ const module_1 = require("@xyo-network/module");
5
+ const WrappedModuleHookFactory_1 = require("./WrappedModuleHookFactory");
6
+ exports.useWrappedModule = WrappedModuleHookFactory_1.WrappedModuleHookFactory.create(module_1.ModuleWrapper, 'useWrappedModule');
7
+ //# sourceMappingURL=useWrappedModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useWrappedModule.js","sourceRoot":"","sources":["../../../src/hooks/useWrappedModule.tsx"],"names":[],"mappings":";;;AAAA,gDAAmD;AAEnD,yEAAqE;AAExD,QAAA,gBAAgB,GAAG,mDAAwB,CAAC,MAAM,CAAC,sBAAa,EAAE,kBAAkB,CAAC,CAAA"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useWrappedModules = void 0;
4
+ const module_1 = require("@xyo-network/module");
5
+ const WrappedModulesHookFactory_1 = require("./WrappedModulesHookFactory");
6
+ exports.useWrappedModules = WrappedModulesHookFactory_1.WrappedModulesHookFactory.create(module_1.ModuleWrapper, 'useWrappedModules');
7
+ //# sourceMappingURL=useWrappedModules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useWrappedModules.js","sourceRoot":"","sources":["../../../src/hooks/useWrappedModules.tsx"],"names":[],"mappings":";;;AAAA,gDAAmD;AAEnD,2EAAuE;AAE1D,QAAA,iBAAiB,GAAG,qDAAyB,CAAC,MAAM,CAAC,sBAAa,EAAE,mBAAmB,CAAC,CAAA"}
package/dist/cjs/index.js CHANGED
@@ -2,5 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./components"), exports);
5
+ tslib_1.__exportStar(require("./hooks"), exports);
5
6
  tslib_1.__exportStar(require("./ModuleRenderProps"), exports);
6
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,uDAA4B;AAC5B,8DAAmC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,uDAA4B;AAC5B,kDAAuB;AACvB,8DAAmC"}