@xyo-network/react-chain-boundwitness 1.2.6 → 1.2.8

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 (200) hide show
  1. package/dist/browser/index.mjs +3 -1239
  2. package/dist/browser/index.mjs.map +1 -1
  3. package/dist/types/index.d.ts +2 -2
  4. package/dist/types/index.d.ts.map +1 -1
  5. package/package.json +3 -35
  6. package/src/index.ts +1 -2
  7. package/dist/types/Plugin.d.ts +0 -3
  8. package/dist/types/Plugin.d.ts.map +0 -1
  9. package/dist/types/components/Card/Card.d.ts +0 -9
  10. package/dist/types/components/Card/Card.d.ts.map +0 -1
  11. package/dist/types/components/Card/CardContent/AddressAvatarGroup.d.ts +0 -8
  12. package/dist/types/components/Card/CardContent/AddressAvatarGroup.d.ts.map +0 -1
  13. package/dist/types/components/Card/CardContent/CardContent.d.ts +0 -14
  14. package/dist/types/components/Card/CardContent/CardContent.d.ts.map +0 -1
  15. package/dist/types/components/Card/CardContent/SchemaAvatarGroup.d.ts +0 -9
  16. package/dist/types/components/Card/CardContent/SchemaAvatarGroup.d.ts.map +0 -1
  17. package/dist/types/components/Card/CardContent/index.d.ts +0 -3
  18. package/dist/types/components/Card/CardContent/index.d.ts.map +0 -1
  19. package/dist/types/components/Card/CardContent/layout/CardColumnTitle.d.ts +0 -5
  20. package/dist/types/components/Card/CardContent/layout/CardColumnTitle.d.ts.map +0 -1
  21. package/dist/types/components/Card/CardContent/layout/CardColumnsFlex.d.ts +0 -2
  22. package/dist/types/components/Card/CardContent/layout/CardColumnsFlex.d.ts.map +0 -1
  23. package/dist/types/components/Card/CardContent/layout/CardContentFlex.d.ts +0 -5
  24. package/dist/types/components/Card/CardContent/layout/CardContentFlex.d.ts.map +0 -1
  25. package/dist/types/components/Card/CardContent/layout/index.d.ts +0 -4
  26. package/dist/types/components/Card/CardContent/layout/index.d.ts.map +0 -1
  27. package/dist/types/components/Card/CardHeader/CardHeader.d.ts +0 -20
  28. package/dist/types/components/Card/CardHeader/CardHeader.d.ts.map +0 -1
  29. package/dist/types/components/Card/CardHeader/index.d.ts +0 -2
  30. package/dist/types/components/Card/CardHeader/index.d.ts.map +0 -1
  31. package/dist/types/components/Card/index.d.ts +0 -4
  32. package/dist/types/components/Card/index.d.ts.map +0 -1
  33. package/dist/types/components/Details/BoundWitnessLinksDetails.d.ts +0 -8
  34. package/dist/types/components/Details/BoundWitnessLinksDetails.d.ts.map +0 -1
  35. package/dist/types/components/Details/Box/DetailsBox.d.ts +0 -6
  36. package/dist/types/components/Details/Box/DetailsBox.d.ts.map +0 -1
  37. package/dist/types/components/Details/Box/index.d.ts +0 -2
  38. package/dist/types/components/Details/Box/index.d.ts.map +0 -1
  39. package/dist/types/components/Details/Card/DetailsCard.d.ts +0 -11
  40. package/dist/types/components/Details/Card/DetailsCard.d.ts.map +0 -1
  41. package/dist/types/components/Details/Card/DetailsCardContent.d.ts +0 -16
  42. package/dist/types/components/Details/Card/DetailsCardContent.d.ts.map +0 -1
  43. package/dist/types/components/Details/Card/DetailsCardInner.d.ts +0 -11
  44. package/dist/types/components/Details/Card/DetailsCardInner.d.ts.map +0 -1
  45. package/dist/types/components/Details/Card/Navigation/BottomNavigation.d.ts +0 -17
  46. package/dist/types/components/Details/Card/Navigation/BottomNavigation.d.ts.map +0 -1
  47. package/dist/types/components/Details/Card/Navigation/NavigationTabs.d.ts +0 -11
  48. package/dist/types/components/Details/Card/Navigation/NavigationTabs.d.ts.map +0 -1
  49. package/dist/types/components/Details/Card/Navigation/index.d.ts +0 -3
  50. package/dist/types/components/Details/Card/Navigation/index.d.ts.map +0 -1
  51. package/dist/types/components/Details/Card/index.d.ts +0 -2
  52. package/dist/types/components/Details/Card/index.d.ts.map +0 -1
  53. package/dist/types/components/Details/Details.d.ts +0 -16
  54. package/dist/types/components/Details/Details.d.ts.map +0 -1
  55. package/dist/types/components/Details/ValidationDetails.d.ts +0 -8
  56. package/dist/types/components/Details/ValidationDetails.d.ts.map +0 -1
  57. package/dist/types/components/Details/index.d.ts +0 -5
  58. package/dist/types/components/Details/index.d.ts.map +0 -1
  59. package/dist/types/components/_shared/Actions/BWActions.d.ts +0 -15
  60. package/dist/types/components/_shared/Actions/BWActions.d.ts.map +0 -1
  61. package/dist/types/components/_shared/Actions/Verification.d.ts +0 -9
  62. package/dist/types/components/_shared/Actions/Verification.d.ts.map +0 -1
  63. package/dist/types/components/_shared/Actions/_shared/ActionMenuItemProps.d.ts +0 -7
  64. package/dist/types/components/_shared/Actions/_shared/ActionMenuItemProps.d.ts.map +0 -1
  65. package/dist/types/components/_shared/Actions/_shared/MenuItemDialog.d.ts +0 -7
  66. package/dist/types/components/_shared/Actions/_shared/MenuItemDialog.d.ts.map +0 -1
  67. package/dist/types/components/_shared/Actions/_shared/index.d.ts +0 -3
  68. package/dist/types/components/_shared/Actions/_shared/index.d.ts.map +0 -1
  69. package/dist/types/components/_shared/Actions/index.d.ts +0 -5
  70. package/dist/types/components/_shared/Actions/index.d.ts.map +0 -1
  71. package/dist/types/components/_shared/Actions/json/MenuItem.d.ts +0 -6
  72. package/dist/types/components/_shared/Actions/json/MenuItem.d.ts.map +0 -1
  73. package/dist/types/components/_shared/Actions/json/index.d.ts +0 -2
  74. package/dist/types/components/_shared/Actions/json/index.d.ts.map +0 -1
  75. package/dist/types/components/_shared/Actions/previous-hash/DialogContent.d.ts +0 -8
  76. package/dist/types/components/_shared/Actions/previous-hash/DialogContent.d.ts.map +0 -1
  77. package/dist/types/components/_shared/Actions/previous-hash/MenuItem.d.ts +0 -6
  78. package/dist/types/components/_shared/Actions/previous-hash/MenuItem.d.ts.map +0 -1
  79. package/dist/types/components/_shared/Actions/previous-hash/QuickTipButton.d.ts +0 -8
  80. package/dist/types/components/_shared/Actions/previous-hash/QuickTipButton.d.ts.map +0 -1
  81. package/dist/types/components/_shared/Actions/previous-hash/index.d.ts +0 -4
  82. package/dist/types/components/_shared/Actions/previous-hash/index.d.ts.map +0 -1
  83. package/dist/types/components/_shared/Heading/HashHeadingPaper/Adornment/BackPaperAdornment.d.ts +0 -6
  84. package/dist/types/components/_shared/Heading/HashHeadingPaper/Adornment/BackPaperAdornment.d.ts.map +0 -1
  85. package/dist/types/components/_shared/Heading/HashHeadingPaper/Adornment/PaperAdornment.d.ts +0 -6
  86. package/dist/types/components/_shared/Heading/HashHeadingPaper/Adornment/PaperAdornment.d.ts.map +0 -1
  87. package/dist/types/components/_shared/Heading/HashHeadingPaper/Adornment/PaperAdornmentIconButton.d.ts +0 -6
  88. package/dist/types/components/_shared/Heading/HashHeadingPaper/Adornment/PaperAdornmentIconButton.d.ts.map +0 -1
  89. package/dist/types/components/_shared/Heading/HashHeadingPaper/Adornment/index.d.ts +0 -4
  90. package/dist/types/components/_shared/Heading/HashHeadingPaper/Adornment/index.d.ts.map +0 -1
  91. package/dist/types/components/_shared/Heading/HashHeadingPaper/HashHeadingPaper.d.ts +0 -15
  92. package/dist/types/components/_shared/Heading/HashHeadingPaper/HashHeadingPaper.d.ts.map +0 -1
  93. package/dist/types/components/_shared/Heading/HashHeadingPaper/index.d.ts +0 -2
  94. package/dist/types/components/_shared/Heading/HashHeadingPaper/index.d.ts.map +0 -1
  95. package/dist/types/components/_shared/Heading/Heading.d.ts +0 -4
  96. package/dist/types/components/_shared/Heading/Heading.d.ts.map +0 -1
  97. package/dist/types/components/_shared/Heading/HeadingPaper/HeadingPaper.d.ts +0 -14
  98. package/dist/types/components/_shared/Heading/HeadingPaper/HeadingPaper.d.ts.map +0 -1
  99. package/dist/types/components/_shared/Heading/HeadingPaper/index.d.ts +0 -2
  100. package/dist/types/components/_shared/Heading/HeadingPaper/index.d.ts.map +0 -1
  101. package/dist/types/components/_shared/Heading/HeadingProps.d.ts +0 -14
  102. package/dist/types/components/_shared/Heading/HeadingProps.d.ts.map +0 -1
  103. package/dist/types/components/_shared/Heading/index.d.ts +0 -5
  104. package/dist/types/components/_shared/Heading/index.d.ts.map +0 -1
  105. package/dist/types/components/_shared/Payloads/PayloadsPropertyGroup.d.ts +0 -10
  106. package/dist/types/components/_shared/Payloads/PayloadsPropertyGroup.d.ts.map +0 -1
  107. package/dist/types/components/_shared/Payloads/PayloadsTable.d.ts +0 -11
  108. package/dist/types/components/_shared/Payloads/PayloadsTable.d.ts.map +0 -1
  109. package/dist/types/components/_shared/Payloads/index.d.ts +0 -3
  110. package/dist/types/components/_shared/Payloads/index.d.ts.map +0 -1
  111. package/dist/types/components/_shared/Payloads/payloads-table/TableBody.d.ts +0 -11
  112. package/dist/types/components/_shared/Payloads/payloads-table/TableBody.d.ts.map +0 -1
  113. package/dist/types/components/_shared/Payloads/payloads-table/TableBodyFiltered.d.ts +0 -8
  114. package/dist/types/components/_shared/Payloads/payloads-table/TableBodyFiltered.d.ts.map +0 -1
  115. package/dist/types/components/_shared/Payloads/payloads-table/TableHead.d.ts +0 -4
  116. package/dist/types/components/_shared/Payloads/payloads-table/TableHead.d.ts.map +0 -1
  117. package/dist/types/components/_shared/Payloads/payloads-table/index.d.ts +0 -4
  118. package/dist/types/components/_shared/Payloads/payloads-table/index.d.ts.map +0 -1
  119. package/dist/types/components/_shared/Signatures/SignatureDetails.d.ts +0 -8
  120. package/dist/types/components/_shared/Signatures/SignatureDetails.d.ts.map +0 -1
  121. package/dist/types/components/_shared/Signatures/SignatureTable.d.ts +0 -8
  122. package/dist/types/components/_shared/Signatures/SignatureTable.d.ts.map +0 -1
  123. package/dist/types/components/_shared/Signatures/SignatureTableRow.d.ts +0 -14
  124. package/dist/types/components/_shared/Signatures/SignatureTableRow.d.ts.map +0 -1
  125. package/dist/types/components/_shared/Signatures/index.d.ts +0 -3
  126. package/dist/types/components/_shared/Signatures/index.d.ts.map +0 -1
  127. package/dist/types/components/_shared/index.d.ts +0 -5
  128. package/dist/types/components/_shared/index.d.ts.map +0 -1
  129. package/dist/types/components/index.d.ts +0 -4
  130. package/dist/types/components/index.d.ts.map +0 -1
  131. package/src/Plugin.ts +0 -21
  132. package/src/components/Card/Card.stories.tsx +0 -22
  133. package/src/components/Card/Card.tsx +0 -25
  134. package/src/components/Card/CardContent/AddressAvatarGroup.tsx +0 -27
  135. package/src/components/Card/CardContent/CardContent.tsx +0 -36
  136. package/src/components/Card/CardContent/SchemaAvatarGroup.tsx +0 -43
  137. package/src/components/Card/CardContent/index.ts +0 -2
  138. package/src/components/Card/CardContent/layout/CardColumnTitle.tsx +0 -10
  139. package/src/components/Card/CardContent/layout/CardColumnsFlex.tsx +0 -8
  140. package/src/components/Card/CardContent/layout/CardContentFlex.tsx +0 -19
  141. package/src/components/Card/CardContent/layout/index.ts +0 -3
  142. package/src/components/Card/CardHeader/CardHeader.tsx +0 -89
  143. package/src/components/Card/CardHeader/index.ts +0 -1
  144. package/src/components/Card/index.ts +0 -3
  145. package/src/components/Details/BoundWitnessLinksDetails.tsx +0 -38
  146. package/src/components/Details/Box/DetailsBox.stories.tsx +0 -65
  147. package/src/components/Details/Box/DetailsBox.tsx +0 -70
  148. package/src/components/Details/Box/index.ts +0 -1
  149. package/src/components/Details/Card/DetailsCard.stories.tsx +0 -37
  150. package/src/components/Details/Card/DetailsCard.tsx +0 -20
  151. package/src/components/Details/Card/DetailsCardContent.tsx +0 -63
  152. package/src/components/Details/Card/DetailsCardInner.tsx +0 -53
  153. package/src/components/Details/Card/Navigation/BottomNavigation.stories.tsx +0 -24
  154. package/src/components/Details/Card/Navigation/BottomNavigation.tsx +0 -47
  155. package/src/components/Details/Card/Navigation/NavigationTabs.stories.tsx +0 -26
  156. package/src/components/Details/Card/Navigation/NavigationTabs.tsx +0 -53
  157. package/src/components/Details/Card/Navigation/index.ts +0 -2
  158. package/src/components/Details/Card/index.ts +0 -1
  159. package/src/components/Details/Details.stories.tsx +0 -77
  160. package/src/components/Details/Details.tsx +0 -35
  161. package/src/components/Details/ValidationDetails.tsx +0 -43
  162. package/src/components/Details/index.ts +0 -4
  163. package/src/components/_shared/Actions/BWActions.tsx +0 -55
  164. package/src/components/_shared/Actions/Verification.tsx +0 -46
  165. package/src/components/_shared/Actions/_shared/ActionMenuItemProps.ts +0 -7
  166. package/src/components/_shared/Actions/_shared/MenuItemDialog.tsx +0 -28
  167. package/src/components/_shared/Actions/_shared/index.ts +0 -2
  168. package/src/components/_shared/Actions/index.ts +0 -4
  169. package/src/components/_shared/Actions/json/MenuItem.tsx +0 -43
  170. package/src/components/_shared/Actions/json/index.ts +0 -1
  171. package/src/components/_shared/Actions/previous-hash/DialogContent.tsx +0 -44
  172. package/src/components/_shared/Actions/previous-hash/MenuItem.tsx +0 -37
  173. package/src/components/_shared/Actions/previous-hash/QuickTipButton.tsx +0 -32
  174. package/src/components/_shared/Actions/previous-hash/index.ts +0 -3
  175. package/src/components/_shared/Heading/HashHeadingPaper/Adornment/BackPaperAdornment.tsx +0 -13
  176. package/src/components/_shared/Heading/HashHeadingPaper/Adornment/PaperAdornment.tsx +0 -15
  177. package/src/components/_shared/Heading/HashHeadingPaper/Adornment/PaperAdornmentIconButton.tsx +0 -13
  178. package/src/components/_shared/Heading/HashHeadingPaper/Adornment/index.ts +0 -3
  179. package/src/components/_shared/Heading/HashHeadingPaper/HashHeadingPaper.stories.tsx +0 -33
  180. package/src/components/_shared/Heading/HashHeadingPaper/HashHeadingPaper.tsx +0 -45
  181. package/src/components/_shared/Heading/HashHeadingPaper/index.ts +0 -1
  182. package/src/components/_shared/Heading/Heading.tsx +0 -49
  183. package/src/components/_shared/Heading/HeadingPaper/HeadingPaper.tsx +0 -50
  184. package/src/components/_shared/Heading/HeadingPaper/index.ts +0 -1
  185. package/src/components/_shared/Heading/HeadingProps.tsx +0 -15
  186. package/src/components/_shared/Heading/index.ts +0 -4
  187. package/src/components/_shared/Payloads/PayloadsPropertyGroup.tsx +0 -26
  188. package/src/components/_shared/Payloads/PayloadsTable.tsx +0 -53
  189. package/src/components/_shared/Payloads/index.ts +0 -2
  190. package/src/components/_shared/Payloads/payloads-table/TableBody.tsx +0 -66
  191. package/src/components/_shared/Payloads/payloads-table/TableBodyFiltered.tsx +0 -52
  192. package/src/components/_shared/Payloads/payloads-table/TableHead.tsx +0 -24
  193. package/src/components/_shared/Payloads/payloads-table/index.ts +0 -3
  194. package/src/components/_shared/Signatures/SignatureDetails.tsx +0 -22
  195. package/src/components/_shared/Signatures/SignatureTable.stories.tsx +0 -29
  196. package/src/components/_shared/Signatures/SignatureTable.tsx +0 -92
  197. package/src/components/_shared/Signatures/SignatureTableRow.tsx +0 -88
  198. package/src/components/_shared/Signatures/index.ts +0 -2
  199. package/src/components/_shared/index.ts +0 -4
  200. package/src/components/index.ts +0 -3
@@ -1,1242 +1,6 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
- // src/components/_shared/Actions/BWActions.tsx
5
- import { DataObject as DataObjectIcon } from "@mui/icons-material";
6
- import { ellipsize as ellipsize2 } from "@xylabs/eth-address";
7
- import { FlexRow as FlexRow2 } from "@xylabs/react-flexbox";
8
- import { QuickTipButton as QuickTipButton3 } from "@xylabs/react-quick-tip-button";
9
- import { usePayloadHash } from "@xyo-network/react-shared";
10
- import React6 from "react";
11
-
12
- // src/components/_shared/Actions/previous-hash/DialogContent.tsx
13
- import { ContentCopy } from "@mui/icons-material";
14
- import { Alert, AlertTitle, Collapse, DialogContent } from "@mui/material";
15
- import { FlexGrowRow, FlexRow } from "@xylabs/react-flexbox";
16
- import { EllipsizeBox } from "@xyo-network/react-shared";
17
- import React, { useState } from "react";
18
- var PreviousHashDialogContent = /* @__PURE__ */ __name(({ boundwitness, ...props }) => {
19
- const [copied, setCopied] = useState(false);
20
- const onCopy = /* @__PURE__ */ __name(async () => {
21
- await navigator.clipboard.writeText(boundwitness?.previous_hashes[0] ?? "");
22
- setCopied(true);
23
- setTimeout(() => {
24
- setCopied(false);
25
- }, 5e3);
26
- }, "onCopy");
27
- return /* @__PURE__ */ React.createElement(DialogContent, props, /* @__PURE__ */ React.createElement(FlexGrowRow, {
28
- columnGap: 2
29
- }, /* @__PURE__ */ React.createElement(ContentCopy, {
30
- sx: {
31
- cursor: "pointer"
32
- },
33
- onClick: /* @__PURE__ */ __name(() => void onCopy(), "onClick")
34
- }), /* @__PURE__ */ React.createElement(EllipsizeBox, {
35
- flexGrow: "1",
36
- typographyProps: {
37
- variant: "body1"
38
- }
39
- }, boundwitness?.previous_hashes.join(","))), /* @__PURE__ */ React.createElement(FlexRow, null, /* @__PURE__ */ React.createElement(Collapse, {
40
- in: copied,
41
- unmountOnExit: true
42
- }, /* @__PURE__ */ React.createElement(Alert, null, /* @__PURE__ */ React.createElement(AlertTitle, null, "Previous hash copied to clipboard")))));
43
- }, "PreviousHashDialogContent");
44
-
45
- // src/components/_shared/Actions/previous-hash/MenuItem.tsx
46
- import { Link } from "@mui/icons-material";
47
- import { ListItemIcon, MenuItem } from "@mui/material";
48
- import React3, { useState as useState2 } from "react";
49
-
50
- // src/components/_shared/Actions/_shared/MenuItemDialog.tsx
51
- import { Button, Dialog, DialogActions, DialogContent as DialogContent2, DialogTitle } from "@mui/material";
52
- import React2 from "react";
53
- var MenuItemDialog = /* @__PURE__ */ __name(({ children, dialogTitle, open, onClose, ...props }) => {
54
- return /* @__PURE__ */ React2.createElement(Dialog, {
55
- open,
56
- onClose,
57
- sx: {
58
- "& .MuiPaper-root": {
59
- minWidth: "75%"
60
- }
61
- },
62
- ...props
63
- }, /* @__PURE__ */ React2.createElement(DialogTitle, null, dialogTitle), /* @__PURE__ */ React2.createElement(DialogContent2, null, children), /* @__PURE__ */ React2.createElement(DialogActions, {
64
- sx: {
65
- display: "flex",
66
- flexDirection: "row",
67
- justifyContent: "end"
68
- }
69
- }, /* @__PURE__ */ React2.createElement(Button, {
70
- variant: "contained",
71
- onClick: /* @__PURE__ */ __name((e) => onClose?.(e, "escapeKeyDown"), "onClick")
72
- }, "Close")));
73
- }, "MenuItemDialog");
74
-
75
- // src/components/_shared/Actions/previous-hash/MenuItem.tsx
76
- var BWPreviousHashMenuItem = /* @__PURE__ */ __name(({ boundwitness, onClick, onDialogClose, ...props }) => {
77
- const [open, setOpen] = useState2(false);
78
- const onClose = /* @__PURE__ */ __name(() => {
79
- onDialogClose?.();
80
- setOpen(false);
81
- }, "onClose");
82
- const handleMenuClick = /* @__PURE__ */ __name((e) => {
83
- onClick?.(e);
84
- setOpen(true);
85
- }, "handleMenuClick");
86
- return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(MenuItem, {
87
- onClick: handleMenuClick,
88
- ...props
89
- }, /* @__PURE__ */ React3.createElement(ListItemIcon, null, /* @__PURE__ */ React3.createElement(Link, null)), "Previous Hash"), /* @__PURE__ */ React3.createElement(MenuItemDialog, {
90
- open,
91
- onClose,
92
- dialogTitle: "Previous Hash"
93
- }, /* @__PURE__ */ React3.createElement(PreviousHashDialogContent, {
94
- boundwitness
95
- })));
96
- }, "BWPreviousHashMenuItem");
97
-
98
- // src/components/_shared/Actions/previous-hash/QuickTipButton.tsx
99
- import { LinkRounded as LinkRoundedIcon } from "@mui/icons-material";
100
- import { ellipsize } from "@xylabs/eth-address";
101
- import { QuickTipButton } from "@xylabs/react-quick-tip-button";
102
- import React4 from "react";
103
- var BWPreviousHashQuickTipButton = /* @__PURE__ */ __name(({ boundwitness, ...props }) => {
104
- const previousHash = boundwitness?.previous_hashes[0] ?? null;
105
- const formattedPreviousHash = previousHash === null ? "No Previous Hash" : `Previous Hash - ${ellipsize(previousHash, 8)}`;
106
- return /* @__PURE__ */ React4.createElement(QuickTipButton, {
107
- Icon: LinkRoundedIcon,
108
- disabled: previousHash === null,
109
- hoverText: formattedPreviousHash,
110
- disableDialog: previousHash === null,
111
- dialogProps: {
112
- fullWidth: true,
113
- maxWidth: "md"
114
- },
115
- ...props
116
- }, previousHash === null ? null : /* @__PURE__ */ React4.createElement(PreviousHashDialogContent, {
117
- boundwitness
118
- }));
119
- }, "BWPreviousHashQuickTipButton");
120
-
121
- // src/components/_shared/Actions/Verification.tsx
122
- import { CancelRounded as CancelRoundedIcon, CheckCircleOutlineRounded as CheckCircleOutlineRoundedIcon } from "@mui/icons-material";
123
- import { Typography } from "@mui/material";
124
- import { FlexCol } from "@xylabs/react-flexbox";
125
- import { usePromise } from "@xylabs/react-promise";
126
- import { QuickTipButton as QuickTipButton2 } from "@xylabs/react-quick-tip-button";
127
- import { BoundWitnessValidator } from "@xyo-network/boundwitness-validator";
128
- import React5 from "react";
129
- var InvalidIcon = /* @__PURE__ */ __name(({ ref, ...props }) => /* @__PURE__ */ React5.createElement(CancelRoundedIcon, {
130
- color: "error",
131
- ref,
132
- ...props
133
- }), "InvalidIcon");
134
- InvalidIcon.displayName = "InvalidIcon";
135
- var BWVerification = /* @__PURE__ */ __name(({ boundwitness, iconColors }) => {
136
- const [errors = []] = usePromise(async () => await (boundwitness ? new BoundWitnessValidator(boundwitness) : void 0)?.validate(), [
137
- boundwitness
138
- ]);
139
- return /* @__PURE__ */ React5.createElement(QuickTipButton2, {
140
- Icon: errors.length > 0 ? ({ ref, ...props }) => {
141
- return /* @__PURE__ */ React5.createElement(InvalidIcon, {
142
- color: iconColors ? "error" : void 0,
143
- ref,
144
- ...props
145
- });
146
- } : ({ ref, ...props }) => {
147
- return /* @__PURE__ */ React5.createElement(CheckCircleOutlineRoundedIcon, {
148
- color: iconColors ? "success" : void 0,
149
- ref,
150
- ...props
151
- });
152
- },
153
- hoverText: errors.length > 0 ? "Invalid Bound Witness" : "Valid"
154
- }, errors.length > 0 ? /* @__PURE__ */ React5.createElement(FlexCol, {
155
- flexWrap: "wrap",
156
- alignItems: "start"
157
- }, errors.map((error) => {
158
- return /* @__PURE__ */ React5.createElement(Typography, {
159
- key: error.name
160
- }, error.toString());
161
- })) : /* @__PURE__ */ React5.createElement(Typography, null, "No Errors"));
162
- }, "BWVerification");
163
-
164
- // src/components/_shared/Actions/BWActions.tsx
165
- var BWActions = /* @__PURE__ */ __name(({ additionalActions, boundwitness, hideJSONButton, hideValidation, hidePreviousHash, priorActions, validationIconColors, ...props }) => {
166
- const hash = usePayloadHash(boundwitness);
167
- return /* @__PURE__ */ React6.createElement(FlexRow2, props, priorActions, hidePreviousHash || boundwitness?.previous_hashes.length === 0 ? null : /* @__PURE__ */ React6.createElement(BWPreviousHashQuickTipButton, {
168
- boundwitness
169
- }), hideValidation ? null : /* @__PURE__ */ React6.createElement(BWVerification, {
170
- iconColors: validationIconColors,
171
- boundwitness
172
- }), hideJSONButton ? null : /* @__PURE__ */ React6.createElement(QuickTipButton3, {
173
- Icon: DataObjectIcon,
174
- title: `JSON for ${ellipsize2(hash ?? "", 8)}`,
175
- dialogProps: {
176
- fullWidth: true,
177
- maxWidth: "md"
178
- }
179
- }, /* @__PURE__ */ React6.createElement("pre", {
180
- style: {
181
- wordBreak: "break-all"
182
- }
183
- }, boundwitness ? JSON.stringify(boundwitness, null, 2) : null)), additionalActions);
184
- }, "BWActions");
185
-
186
- // src/components/_shared/Actions/json/MenuItem.tsx
187
- import { Code } from "@mui/icons-material";
188
- import { ListItemIcon as ListItemIcon2, MenuItem as MenuItem2 } from "@mui/material";
189
- import { ellipsize as ellipsize3 } from "@xylabs/eth-address";
190
- import { JsonViewerEx } from "@xyo-network/react-payload-raw-info";
191
- import { usePayloadHash as usePayloadHash2 } from "@xyo-network/react-shared";
192
- import React7, { useState as useState3 } from "react";
193
- var BWJsonMenuItem = /* @__PURE__ */ __name(({ boundwitness, onClick, onDialogClose, ...props }) => {
194
- const hash = usePayloadHash2(boundwitness);
195
- const [open, setOpen] = useState3(false);
196
- const onClose = /* @__PURE__ */ __name(() => {
197
- onDialogClose?.();
198
- setOpen(false);
199
- }, "onClose");
200
- const handleMenuClick = /* @__PURE__ */ __name((e) => {
201
- onClick?.(e);
202
- setOpen(true);
203
- }, "handleMenuClick");
204
- const title = hash ? `JSON for ${ellipsize3(hash, 5)}` : "JSON";
205
- return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(MenuItem2, {
206
- onClick: handleMenuClick,
207
- ...props
208
- }, /* @__PURE__ */ React7.createElement(ListItemIcon2, null, /* @__PURE__ */ React7.createElement(Code, null)), "JSON"), /* @__PURE__ */ React7.createElement(MenuItemDialog, {
209
- open,
210
- onClose,
211
- dialogTitle: title
212
- }, /* @__PURE__ */ React7.createElement(JsonViewerEx, {
213
- value: boundwitness
214
- })));
215
- }, "BWJsonMenuItem");
216
-
217
- // src/components/_shared/Heading/HashHeadingPaper/HashHeadingPaper.tsx
218
- import { useTheme } from "@mui/material";
219
- import { Identicon } from "@xylabs/react-identicon";
220
- import React10 from "react";
221
-
222
- // src/components/_shared/Heading/HeadingPaper/HeadingPaper.tsx
223
- import { Paper, styled } from "@mui/material";
224
- import React9 from "react";
225
-
226
- // src/components/_shared/Heading/Heading.tsx
227
- import { FlexGrowRow as FlexGrowRow2 } from "@xylabs/react-flexbox";
228
- import { EllipsizeBox as EllipsizeBox2 } from "@xyo-network/react-shared";
229
- import React8, { useRef } from "react";
230
- var BWHeading = /* @__PURE__ */ __name(({ AdornmentEnd, AdornmentStart, heading, headingProps, IconComponent, size = "medium", fallbackText = "No heading Provided", ...props }) => {
231
- const ellipsizeRef = useRef(null);
232
- const headingText = heading ?? fallbackText;
233
- const sizeParser = /* @__PURE__ */ __name((size2) => {
234
- const map = {
235
- large: "h4",
236
- medium: "body1",
237
- small: "caption"
238
- };
239
- const mappedSize = map[size2];
240
- if (mappedSize === void 0) {
241
- throw new Error(`${size2} is not a recognized TextSize`);
242
- }
243
- return mappedSize;
244
- }, "sizeParser");
245
- return /* @__PURE__ */ React8.createElement(FlexGrowRow2, {
246
- columnGap: 2,
247
- ...props
248
- }, AdornmentStart, IconComponent, /* @__PURE__ */ React8.createElement(EllipsizeBox2, {
249
- title: headingText,
250
- width: "100%",
251
- typographyProps: {
252
- variant: sizeParser(size),
253
- ...headingProps
254
- },
255
- ref: ellipsizeRef
256
- }, headingText), AdornmentEnd);
257
- }, "BWHeading");
258
-
259
- // src/components/_shared/Heading/HeadingPaper/HeadingPaper.tsx
260
- var HeadingPaper = /* @__PURE__ */ __name(({ ref, ...props }) => {
261
- const { AdornmentStart, AdornmentEnd, paperProps } = props;
262
- const { paperProps: excludedPaperProps, ...bwHeadingProps } = props;
263
- return /* @__PURE__ */ React9.createElement(StyledHeadingPaper, {
264
- hasAdornmentStart: !!AdornmentStart,
265
- hasAdornmentEnd: !!AdornmentEnd,
266
- elevation: 4,
267
- ref,
268
- ...paperProps
269
- }, /* @__PURE__ */ React9.createElement(BWHeading, bwHeadingProps));
270
- }, "HeadingPaper");
271
- HeadingPaper.displayName = "HeadingPaper";
272
- var StyledHeadingPaper = styled(Paper, {
273
- name: "StyledHeadingPaper",
274
- shouldForwardProp: /* @__PURE__ */ __name((prop) => ![
275
- "hasAdornmentEnd",
276
- "hasAdornmentStart",
277
- "paperProps"
278
- ].includes(prop), "shouldForwardProp")
279
- })(({ hasAdornmentEnd, hasAdornmentStart, theme }) => ({
280
- alignItems: "center",
281
- columnGap: theme.spacing(2),
282
- display: "flex",
283
- flexDirection: "row",
284
- overflow: "hidden",
285
- padding: theme.spacing(1),
286
- ...hasAdornmentStart && {
287
- paddingLeft: 0
288
- },
289
- ...hasAdornmentEnd && {
290
- paddingRight: 0
291
- },
292
- ...(hasAdornmentStart || hasAdornmentEnd) && {
293
- paddingBottom: 0,
294
- paddingTop: 0
295
- },
296
- paddingRight: theme.spacing(1)
297
- }));
298
-
299
- // src/components/_shared/Heading/HashHeadingPaper/HashHeadingPaper.tsx
300
- var HashHeadingPaper = /* @__PURE__ */ __name(({ ref, hash, identiconProps, ...props }) => {
301
- const theme = useTheme();
302
- return /* @__PURE__ */ React10.createElement(HeadingPaper, {
303
- heading: hash,
304
- fallbackText: "No hash provided",
305
- ref,
306
- IconComponent: hash ? /* @__PURE__ */ React10.createElement(Identicon, {
307
- size: Number.parseInt(theme.spacing(3).replace("px", "")),
308
- p: 0.25,
309
- value: hash,
310
- sx: {
311
- background: theme.palette.background.paper
312
- },
313
- ...identiconProps
314
- }) : null,
315
- sx: {
316
- columnGap: 1
317
- },
318
- ...props
319
- });
320
- }, "HashHeadingPaper");
321
- HashHeadingPaper.displayName = "HashHeadingPaper";
322
-
323
- // src/components/_shared/Payloads/PayloadsPropertyGroup.tsx
324
- import { PropertyGroup } from "@xyo-network/react-property";
325
- import React15 from "react";
326
-
327
- // src/components/_shared/Payloads/PayloadsTable.tsx
328
- import { BoundWitnessSchema } from "@xyo-network/boundwitness-model";
329
- import { usePayloadHash as usePayloadHash3 } from "@xyo-network/react-shared";
330
- import { TableEx } from "@xyo-network/react-table";
331
- import React14 from "react";
332
-
333
- // src/components/_shared/Payloads/payloads-table/TableBody.tsx
334
- import { TableBody, TableCell, TableRow } from "@mui/material";
335
- import { useEvent } from "@xyo-network/react-event";
336
- import { TableRowNoData } from "@xyo-network/react-payload-table";
337
- import { HashTableCell } from "@xyo-network/react-shared";
338
- import { useTableHeight } from "@xyo-network/react-table";
339
- import React11, { useLayoutEffect, useRef as useRef2 } from "react";
340
- var BoundWitnessPayloadTableBody = /* @__PURE__ */ __name(({ boundwitnessHash, eventNoun = "payload", payloadHashes, payloadSchemas, ...props }) => {
341
- const { payloads, archive, maxSchemaDepth, onRowClick, exploreDomain, emptyRows, noResults, NoResultRowComponent, ...tableProps } = props;
342
- const ref = useRef2(null);
343
- const [tableRef, dispatch] = useEvent(void 0, ref);
344
- const { setRowHeight } = useTableHeight();
345
- const tableRowRef = useRef2(null);
346
- const handleOnClick = /* @__PURE__ */ __name((hash) => {
347
- dispatch(eventNoun, "click", hash);
348
- }, "handleOnClick");
349
- useLayoutEffect(() => {
350
- if (tableRowRef.current) {
351
- setRowHeight?.(tableRowRef.current.offsetHeight);
352
- }
353
- });
354
- return /* @__PURE__ */ React11.createElement(TableBody, {
355
- ref: tableRef,
356
- ...tableProps
357
- }, noResults && NoResultRowComponent ? /* @__PURE__ */ React11.createElement(NoResultRowComponent, null) : null, payloadHashes && payloadSchemas && payloadHashes.length > 0 && payloadHashes?.map((hash, index) => {
358
- return /* @__PURE__ */ React11.createElement(TableRow, {
359
- ref: tableRowRef,
360
- key: boundwitnessHash + hash,
361
- onClick: /* @__PURE__ */ __name(() => handleOnClick(hash), "onClick"),
362
- sx: {
363
- cursor: "pointer"
364
- }
365
- }, /* @__PURE__ */ React11.createElement(TableCell, {
366
- title: payloadSchemas[index]
367
- }, payloadSchemas[index]), /* @__PURE__ */ React11.createElement(HashTableCell, {
368
- title: hash
369
- }, hash));
370
- }) || /* @__PURE__ */ React11.createElement(TableRowNoData, {
371
- additionalCells: 1
372
- }));
373
- }, "BoundWitnessPayloadTableBody");
374
-
375
- // src/components/_shared/Payloads/payloads-table/TableBodyFiltered.tsx
376
- import React12, { useMemo, useState as useState4 } from "react";
377
- var BoundWitnessFilteredPayloadTableBody = /* @__PURE__ */ __name(({ bwFilterType = "equal", eventNoun = "payload", payloadHashes, payloadSchemas, schemaFilter, ...props }) => {
378
- const [bwPayloadHashes, setBWPayloadHashes] = useState4();
379
- const [bwPayloadSchemas, setBWPayloadSchemas] = useState4();
380
- useMemo(() => {
381
- if (!schemaFilter) {
382
- setBWPayloadHashes(payloadHashes);
383
- setBWPayloadSchemas(payloadSchemas);
384
- }
385
- }, [
386
- payloadHashes,
387
- payloadSchemas,
388
- schemaFilter
389
- ]);
390
- useMemo(() => {
391
- if (payloadSchemas && schemaFilter) {
392
- const filteredSchemas = payloadSchemas.filter((schema) => {
393
- return bwFilterType === "equal" ? schema === schemaFilter : schema !== schemaFilter;
394
- });
395
- setBWPayloadSchemas(filteredSchemas);
396
- }
397
- }, [
398
- bwFilterType,
399
- payloadSchemas,
400
- schemaFilter
401
- ]);
402
- useMemo(() => {
403
- if (payloadHashes && payloadSchemas && schemaFilter) {
404
- const filteredHashes = payloadSchemas.reduce((acc, schema, index) => {
405
- if (bwFilterType === "equal" ? schema === schemaFilter : schema !== schemaFilter) {
406
- acc.push(payloadHashes[index]);
407
- }
408
- return acc;
409
- }, []);
410
- setBWPayloadHashes(filteredHashes);
411
- }
412
- }, [
413
- bwFilterType,
414
- payloadHashes,
415
- payloadSchemas,
416
- schemaFilter
417
- ]);
418
- return /* @__PURE__ */ React12.createElement(BoundWitnessPayloadTableBody, {
419
- payloadHashes: bwPayloadHashes,
420
- payloadSchemas: bwPayloadSchemas,
421
- eventNoun,
422
- ...props
423
- });
424
- }, "BoundWitnessFilteredPayloadTableBody");
425
-
426
- // src/components/_shared/Payloads/payloads-table/TableHead.tsx
427
- import { styled as styled2, TableHead, TableRow as TableRow2, Typography as Typography2 } from "@mui/material";
428
- import { TableCellEx } from "@xyo-network/react-table";
429
- import React13 from "react";
430
- var BoundWitnessPayloadTableHead = /* @__PURE__ */ __name((props) => {
431
- const { columns, ...tableHeadProps } = props;
432
- return /* @__PURE__ */ React13.createElement(TableHead, tableHeadProps, /* @__PURE__ */ React13.createElement(TableRow2, null, /* @__PURE__ */ React13.createElement(TableCellEx, null, /* @__PURE__ */ React13.createElement(TableCellTypography, {
433
- variant: "caption"
434
- }, "Schema")), /* @__PURE__ */ React13.createElement(TableCellEx, null, /* @__PURE__ */ React13.createElement(TableCellTypography, {
435
- variant: "caption"
436
- }, "Hash"))));
437
- }, "BoundWitnessPayloadTableHead");
438
- var TableCellTypography = styled2(Typography2, {
439
- name: "TableCellTypography"
440
- })(() => ({
441
- fontWeight: "bold"
442
- }));
443
-
444
- // src/components/_shared/Payloads/PayloadsTable.tsx
445
- var BoundWitnessPayloadsTable = /* @__PURE__ */ __name(({ boundwitness, ...props }) => {
446
- const hash = usePayloadHash3(boundwitness);
447
- return /* @__PURE__ */ React14.createElement(BoundWitnessPayloadsTableInner, props, /* @__PURE__ */ React14.createElement(BoundWitnessFilteredPayloadTableBody, {
448
- eventNoun: "payload",
449
- schemaFilter: BoundWitnessSchema,
450
- bwFilterType: "notEqual",
451
- noResults: boundwitness?.payload_hashes.length === 0,
452
- payloadHashes: boundwitness?.payload_hashes,
453
- payloadSchemas: boundwitness?.payload_schemas,
454
- boundwitnessHash: boundwitness ? hash : ""
455
- }));
456
- }, "BoundWitnessPayloadsTable");
457
- var BoundWitnessPayloadsTableForBWs = /* @__PURE__ */ __name(({ boundwitness, ...props }) => {
458
- const hash = usePayloadHash3(boundwitness);
459
- return /* @__PURE__ */ React14.createElement(BoundWitnessPayloadsTableInner, props, /* @__PURE__ */ React14.createElement(BoundWitnessFilteredPayloadTableBody, {
460
- eventNoun: "boundwitness",
461
- schemaFilter: BoundWitnessSchema,
462
- noResults: boundwitness?.payload_hashes.length === 0,
463
- payloadHashes: boundwitness?.payload_hashes,
464
- payloadSchemas: boundwitness?.payload_schemas,
465
- boundwitnessHash: boundwitness ? hash : ""
466
- }));
467
- }, "BoundWitnessPayloadsTableForBWs");
468
- var BoundWitnessPayloadsTableInner = /* @__PURE__ */ __name(({ children, ...props }) => /* @__PURE__ */ React14.createElement(TableEx, props, /* @__PURE__ */ React14.createElement(BoundWitnessPayloadTableHead, null), children), "BoundWitnessPayloadsTableInner");
469
-
470
- // src/components/_shared/Payloads/PayloadsPropertyGroup.tsx
471
- var BoundWitnessPayloads = /* @__PURE__ */ __name(({ payload: boundwitness, payloadTableProps, ...props }) => {
472
- let elevation = 2;
473
- if (props.paper) {
474
- elevation += props.elevation ?? 0;
475
- }
476
- return /* @__PURE__ */ React15.createElement(PropertyGroup, {
477
- titleProps: {
478
- elevation
479
- },
480
- title: "Payloads",
481
- tip: "The hash and schema for each payload witnessed",
482
- ...props
483
- }, /* @__PURE__ */ React15.createElement(BoundWitnessPayloadsTable, {
484
- boundwitness,
485
- ...payloadTableProps
486
- }));
487
- }, "BoundWitnessPayloads");
488
-
489
- // src/components/_shared/Signatures/SignatureDetails.tsx
490
- import { PropertyGroup as PropertyGroup2 } from "@xyo-network/react-property";
491
- import React18 from "react";
492
-
493
- // src/components/_shared/Signatures/SignatureTable.tsx
494
- import { TableBody as TableBody2, TableHead as TableHead2, TableRow as TableRow4, Typography as Typography4 } from "@mui/material";
495
- import { TableRowNoData as TableRowNoData2 } from "@xyo-network/react-payload-table";
496
- import { usePayloadHash as usePayloadHash4 } from "@xyo-network/react-shared";
497
- import { TableCellEx as TableCellEx2, TableEx as TableEx2 } from "@xyo-network/react-table";
498
- import React17 from "react";
499
-
500
- // src/components/_shared/Signatures/SignatureTableRow.tsx
501
- import { Link as Link2, TableCell as TableCell2, TableRow as TableRow3, Typography as Typography3 } from "@mui/material";
502
- import { toUint8Array } from "@xylabs/arraybuffer";
503
- import { ellipsize as ellipsize4 } from "@xylabs/eth-address";
504
- import { usePromise as usePromise2 } from "@xylabs/react-promise";
505
- import { BoundWitnessValidator as BoundWitnessValidator2 } from "@xyo-network/boundwitness-validator";
506
- import { useEvent as useEvent2 } from "@xyo-network/react-event";
507
- import { AddressTableCell } from "@xyo-network/react-shared";
508
- import React16 from "react";
509
- import { MdClear, MdDone } from "react-icons/md";
510
- var BoundWitnessSignatureTableRow = /* @__PURE__ */ __name(({ address, archive, clickableFields, hash, previousHash, signature, ...props }) => {
511
- const [errors] = usePromise2(async () => hash && address ? await BoundWitnessValidator2.validateSignature(toUint8Array(hash).buffer, toUint8Array(address).buffer, toUint8Array(signature)?.buffer) : [], [
512
- hash,
513
- address,
514
- signature
515
- ]);
516
- const [addressRef, addressDispatch] = useEvent2();
517
- const [signatureRef, signatureDispatch] = useEvent2();
518
- const formattedHash = /* @__PURE__ */ __name((hash2) => hash2 ? ellipsize4(hash2, 8) : "-", "formattedHash");
519
- return /* @__PURE__ */ React16.createElement(TableRow3, props, /* @__PURE__ */ React16.createElement(AddressTableCell, {
520
- ref: addressRef,
521
- archive,
522
- value: address,
523
- onClick: /* @__PURE__ */ __name(() => addressDispatch("address", "click", address), "onClick"),
524
- link: clickableFields?.includes("address")
525
- }), /* @__PURE__ */ React16.createElement(TableCell2, {
526
- sx: {
527
- display: {
528
- md: "table-cell",
529
- xs: "none"
530
- }
531
- },
532
- align: "center"
533
- }, /* @__PURE__ */ React16.createElement(Typography3, {
534
- variant: "body2",
535
- fontFamily: "monospace"
536
- }, formattedHash(previousHash))), /* @__PURE__ */ React16.createElement(TableCell2, {
537
- sx: {
538
- display: {
539
- sm: "table-cell",
540
- xs: "none"
541
- }
542
- },
543
- align: "center"
544
- }, /* @__PURE__ */ React16.createElement(Typography3, {
545
- variant: "body2",
546
- fontFamily: "monospace",
547
- ref: signatureRef,
548
- onClick: /* @__PURE__ */ __name(() => signatureDispatch("signature", "click", signature), "onClick")
549
- }, clickableFields?.includes("signature") ? /* @__PURE__ */ React16.createElement(Link2, null, formattedHash(signature)) : formattedHash(signature))), /* @__PURE__ */ React16.createElement(TableCell2, {
550
- key: "valid",
551
- align: "center"
552
- }, errors === void 0 ? /* @__PURE__ */ React16.createElement(MdDone, {
553
- fontSize: 18,
554
- color: "gray"
555
- }) : errors?.length === 0 ? /* @__PURE__ */ React16.createElement(MdDone, {
556
- fontSize: 18,
557
- color: "green"
558
- }) : /* @__PURE__ */ React16.createElement(MdClear, {
559
- color: "red",
560
- fontSize: 18
561
- })));
562
- }, "BoundWitnessSignatureTableRow");
563
-
564
- // src/components/_shared/Signatures/SignatureTable.tsx
565
- var signatureDataFromBoundWitness = /* @__PURE__ */ __name((boundWitness) => {
566
- const result = [];
567
- for (let i = 0; i < boundWitness.addresses.length; i++) {
568
- result.push({
569
- address: boundWitness.addresses[i],
570
- previous_hash: boundWitness.previous_hashes?.[i],
571
- signature: boundWitness.$signatures?.[i] ?? []
572
- });
573
- }
574
- return result;
575
- }, "signatureDataFromBoundWitness");
576
- var BoundWitnessSignatureTable = /* @__PURE__ */ __name(({ block, ...props }) => {
577
- const signatureData = block ? signatureDataFromBoundWitness(block) : [];
578
- const hash = usePayloadHash4(block);
579
- return /* @__PURE__ */ React17.createElement(TableEx2, props, /* @__PURE__ */ React17.createElement(TableHead2, null, /* @__PURE__ */ React17.createElement(TableRow4, null, /* @__PURE__ */ React17.createElement(TableCellEx2, {
580
- align: "left"
581
- }, /* @__PURE__ */ React17.createElement(Typography4, {
582
- variant: "caption"
583
- }, /* @__PURE__ */ React17.createElement("strong", null, "Address"))), /* @__PURE__ */ React17.createElement(TableCellEx2, {
584
- sx: {
585
- display: {
586
- md: "table-cell",
587
- xs: "none"
588
- }
589
- },
590
- align: "center",
591
- width: "10px"
592
- }, /* @__PURE__ */ React17.createElement(Typography4, {
593
- variant: "caption"
594
- }, /* @__PURE__ */ React17.createElement("strong", null, "Previous"))), /* @__PURE__ */ React17.createElement(TableCellEx2, {
595
- sx: {
596
- display: {
597
- sm: "table-cell",
598
- xs: "none"
599
- }
600
- },
601
- align: "center",
602
- width: "10px"
603
- }, /* @__PURE__ */ React17.createElement(Typography4, {
604
- variant: "caption"
605
- }, /* @__PURE__ */ React17.createElement("strong", null, "Signature"))), /* @__PURE__ */ React17.createElement(TableCellEx2, {
606
- align: "center",
607
- width: "10px"
608
- }, /* @__PURE__ */ React17.createElement(Typography4, {
609
- variant: "caption"
610
- }, /* @__PURE__ */ React17.createElement("strong", null, "Valid"))))), /* @__PURE__ */ React17.createElement(TableBody2, null, !signatureData || signatureData.length === 0 ? /* @__PURE__ */ React17.createElement(TableRowNoData2, {
611
- additionalCells: 3
612
- }) : null, signatureData.map((data) => {
613
- return /* @__PURE__ */ React17.createElement(BoundWitnessSignatureTableRow, {
614
- key: `${data.signature}-${data.previous_hash}`,
615
- address: data.address,
616
- previousHash: data.previous_hash,
617
- hash,
618
- signature: data.signature,
619
- clickableFields: [
620
- "address"
621
- ]
622
- });
623
- })));
624
- }, "BoundWitnessSignatureTable");
625
-
626
- // src/components/_shared/Signatures/SignatureDetails.tsx
627
- var BoundWitnessSignatureDetails = /* @__PURE__ */ __name(({ block, ...props }) => {
628
- let elevation = 2;
629
- if (props.paper) {
630
- elevation += props.elevation ?? 0;
631
- }
632
- return /* @__PURE__ */ React18.createElement(PropertyGroup2, {
633
- titleProps: {
634
- elevation
635
- },
636
- title: "Signatures",
637
- tip: "The list of signatures for this block",
638
- ...props
639
- }, /* @__PURE__ */ React18.createElement(BoundWitnessSignatureTable, {
640
- block
641
- }));
642
- }, "BoundWitnessSignatureDetails");
643
-
644
- // src/components/Card/Card.tsx
645
- import { Card } from "@mui/material";
646
- import React24 from "react";
647
-
648
- // src/components/Card/CardContent/CardContent.tsx
649
- import React22 from "react";
650
-
651
- // src/components/Card/CardContent/AddressAvatarGroup.tsx
652
- import { Avatar, AvatarGroup } from "@mui/material";
653
- import { Identicon as Identicon2 } from "@xylabs/react-identicon";
654
- import React19, { useRef as useRef3 } from "react";
655
- var AddressAvatarGroup = /* @__PURE__ */ __name(({ addresses, maxAvatars = 4, ...props }) => {
656
- const ref = useRef3(null);
657
- const size = ref.current ? ref.current.clientWidth * 0.65 : void 0;
658
- return /* @__PURE__ */ React19.createElement(AvatarGroup, {
659
- max: maxAvatars,
660
- total: addresses?.length,
661
- ...props
662
- }, addresses?.map((address) => /* @__PURE__ */ React19.createElement(Avatar, {
663
- key: address,
664
- title: address,
665
- ref,
666
- sx: {
667
- bgcolor: "background.paper"
668
- }
669
- }, /* @__PURE__ */ React19.createElement(Identicon2, {
670
- value: address,
671
- position: "absolute",
672
- p: 0.25,
673
- top: 0,
674
- bottom: 0,
675
- left: 0,
676
- right: 0,
677
- size
678
- }))));
679
- }, "AddressAvatarGroup");
680
-
681
- // src/components/Card/CardContent/layout/CardColumnsFlex.tsx
682
- import { styled as styled3 } from "@mui/material";
683
- import { FlexCol as FlexCol2 } from "@xylabs/react-flexbox";
684
- var CardColumnsFlex = styled3(FlexCol2, {
685
- name: "CardColumnsFlex"
686
- })(({ theme }) => ({
687
- ["@media only screen and (min-width: 333px)"]: {
688
- minWidth: "50%"
689
- },
690
- minWidth: "100%",
691
- rowGap: theme.spacing(1)
692
- }));
693
-
694
- // src/components/Card/CardContent/layout/CardColumnTitle.tsx
695
- import { styled as styled4, Typography as Typography5 } from "@mui/material";
696
- import React20 from "react";
697
- var CardColumnTitle = styled4(Typography5, {
698
- name: "CardColumnTitle"
699
- })(({ theme }) => ({
700
- color: theme.palette.text.primary,
701
- fontWeight: 500
702
- }));
703
- var CardColumnTitleH2 = /* @__PURE__ */ __name((props) => /* @__PURE__ */ React20.createElement(CardColumnTitle, props), "CardColumnTitleH2");
704
-
705
- // src/components/Card/CardContent/layout/CardContentFlex.tsx
706
- import { alpha, CardContent, styled as styled5 } from "@mui/material";
707
- var CardContentFlex = styled5(CardContent, {
708
- name: "CardContentFlex",
709
- shouldForwardProp: /* @__PURE__ */ __name((prop) => prop !== "active", "shouldForwardProp")
710
- })(({ theme, active }) => ({
711
- [":last-child"]: {
712
- paddingBottom: theme.spacing(1)
713
- },
714
- ...active && {
715
- background: alpha(theme.palette.secondary.dark, 0.33)
716
- },
717
- display: "flex",
718
- flexDirection: "row",
719
- flexWrap: "wrap",
720
- justifyContent: "center",
721
- rowGap: theme.spacing(1)
722
- }));
723
-
724
- // src/components/Card/CardContent/SchemaAvatarGroup.tsx
725
- import { Avatar as Avatar2, AvatarGroup as AvatarGroup2 } from "@mui/material";
726
- import { BoundWitnessSchema as BoundWitnessSchema2 } from "@xyo-network/boundwitness-model";
727
- import { usePayloadRenderPluginResolver } from "@xyo-network/react-payload-plugin-resolver";
728
- import React21, { useCallback } from "react";
729
- import { VscSymbolMethod, VscSymbolNamespace } from "react-icons/vsc";
730
- var SchemaAvatarGroup = /* @__PURE__ */ __name(({ schemas, maxAvatars = 4, ...props }) => {
731
- const { resolver } = usePayloadRenderPluginResolver();
732
- const resolveSchemaToIcon = useCallback((schema, index) => {
733
- const SchemaAvatar = resolver?.resolve({
734
- schema
735
- })?.components.avatar.image;
736
- return SchemaAvatar ? /* @__PURE__ */ React21.createElement(SchemaAvatar, {
737
- key: index + schema
738
- }) : /* @__PURE__ */ React21.createElement(Avatar2, {
739
- key: index + schema,
740
- title: schema,
741
- sx: {
742
- bgcolor: "primary.main",
743
- color: "primary.contrastText"
744
- }
745
- }, schema === BoundWitnessSchema2 ? /* @__PURE__ */ React21.createElement(VscSymbolMethod, null) : /* @__PURE__ */ React21.createElement(VscSymbolNamespace, null));
746
- }, [
747
- resolver
748
- ]);
749
- return /* @__PURE__ */ React21.createElement(AvatarGroup2, {
750
- max: maxAvatars,
751
- total: schemas?.length,
752
- ...props
753
- }, schemas?.map((schema, index) => resolveSchemaToIcon(schema, index)));
754
- }, "SchemaAvatarGroup");
755
-
756
- // src/components/Card/CardContent/CardContent.tsx
757
- var BoundWitnessCardContent = /* @__PURE__ */ __name(({ ref, payload, active, ...props }) => {
758
- const boundwitness = payload;
759
- return /* @__PURE__ */ React22.createElement(CardContentFlex, {
760
- ref,
761
- active,
762
- ...props
763
- }, /* @__PURE__ */ React22.createElement(CardColumnsFlex, null, /* @__PURE__ */ React22.createElement(CardColumnTitleH2, null, "Payloads"), /* @__PURE__ */ React22.createElement(SchemaAvatarGroup, {
764
- schemas: boundwitness?.payload_schemas
765
- })), /* @__PURE__ */ React22.createElement(CardColumnsFlex, null, /* @__PURE__ */ React22.createElement(CardColumnTitleH2, null, "Signers"), /* @__PURE__ */ React22.createElement(AddressAvatarGroup, {
766
- addresses: boundwitness?.addresses
767
- })));
768
- }, "BoundWitnessCardContent");
769
- BoundWitnessCardContent.displayName = "BoundWitnessCardContent";
770
-
771
- // src/components/Card/CardHeader/CardHeader.tsx
772
- import { CardHeader, styled as styled6, useTheme as useTheme2 } from "@mui/material";
773
- import { Identicon as Identicon3 } from "@xylabs/react-identicon";
774
- import { usePayloadHash as usePayloadHash5 } from "@xyo-network/react-shared";
775
- import React23 from "react";
776
- var BoundWitnessCardHeader = /* @__PURE__ */ __name(({ ref, active = false, activeBgColor = true, additionalActions, hideJSONButton, hidePreviousHash, hideValidation, payload, ...props }) => {
777
- const boundwitness = payload;
778
- const theme = useTheme2();
779
- const hash = usePayloadHash5(boundwitness);
780
- return /* @__PURE__ */ React23.createElement(CardHeaderHash, {
781
- ref,
782
- active,
783
- activeBgColor,
784
- title: /* @__PURE__ */ React23.createElement(BWHeading, {
785
- heading: hash,
786
- IconComponent: /* @__PURE__ */ React23.createElement(Identicon3, {
787
- size: Number.parseInt(theme.spacing(2.5).replace("px", "")),
788
- p: 0.5,
789
- value: hash,
790
- sx: {
791
- background: theme.palette.background.paper
792
- }
793
- })
794
- }),
795
- action: /* @__PURE__ */ React23.createElement(BWActions, {
796
- hideJSONButton,
797
- hideValidation,
798
- hidePreviousHash,
799
- boundwitness,
800
- additionalActions
801
- }),
802
- ...props
803
- });
804
- }, "BoundWitnessCardHeader");
805
- BoundWitnessCardHeader.displayName = "BoundWitnessCardHeader";
806
- var CardHeaderHash = styled6(CardHeader, {
807
- name: "CardHeaderHash",
808
- shouldForwardProp: /* @__PURE__ */ __name((prop) => ![
809
- "active",
810
- "activeBgColor"
811
- ].includes(prop), "shouldForwardProp")
812
- })(({ theme, active, activeBgColor }) => ({
813
- "& .MuiCardHeader-action": {
814
- marginBottom: 0,
815
- marginTop: 0
816
- },
817
- "& .MuiCardHeader-content": {
818
- overflow: "visible"
819
- },
820
- "&.MuiCardHeader-root": {
821
- ...active && activeBgColor && {
822
- backgroundColor: theme.palette.info
823
- },
824
- borderBottom: `1px solid ${theme.palette.divider}`,
825
- paddingBottom: theme.spacing(1),
826
- paddingTop: theme.spacing(1)
827
- },
828
- "padding": `${theme.spacing(0.5)} ${theme.spacing(2)}`
829
- }));
830
-
831
- // src/components/Card/Card.tsx
832
- var BoundWitnessRendererCard = /* @__PURE__ */ __name(({ payload, active, ...props }) => {
833
- const boundwitness = payload;
834
- return /* @__PURE__ */ React24.createElement(Card, props, /* @__PURE__ */ React24.createElement(BoundWitnessCardHeader, {
835
- payload: boundwitness,
836
- active,
837
- hideJSONButton: true,
838
- hidePreviousHash: true,
839
- hideValidation: true
840
- }), /* @__PURE__ */ React24.createElement(BoundWitnessCardContent, {
841
- payload: boundwitness,
842
- active
843
- }));
844
- }, "BoundWitnessRendererCard");
845
-
846
- // src/components/Details/Box/DetailsBox.tsx
847
- import { Divider } from "@mui/material";
848
- import { FlexCol as FlexCol3 } from "@xylabs/react-flexbox";
849
- import { BoundWitnessSchema as BoundWitnessSchema3 } from "@xyo-network/boundwitness-model";
850
- import { usePayloadHash as usePayloadHash6 } from "@xyo-network/react-shared";
851
- import { TableHeightProvider } from "@xyo-network/react-table";
852
- import React25, { useMemo as useMemo2 } from "react";
853
- import { FaSignature } from "react-icons/fa";
854
- import { VscSymbolMethod as VscSymbolMethod2, VscSymbolNamespace as VscSymbolNamespace2 } from "react-icons/vsc";
855
- var BoundWitnessDetailsBox = /* @__PURE__ */ __name(({ visibleRows, ...props }) => {
856
- return /* @__PURE__ */ React25.createElement(TableHeightProvider, {
857
- defaultVisibleRows: visibleRows,
858
- additionalRows: 1
859
- }, /* @__PURE__ */ React25.createElement(BoundWitnessDetailsBoxInner, props));
860
- }, "BoundWitnessDetailsBox");
861
- BoundWitnessDetailsBox.displayName = "BoundWitnessDetailsBox";
862
- var BoundWitnessDetailsBoxInner = /* @__PURE__ */ __name(({ payload, ...props }) => {
863
- const boundWitness = payload;
864
- const partialBoundWitness = boundWitness;
865
- const hash = usePayloadHash6(payload);
866
- const hasBWPayloads = useMemo2(() => partialBoundWitness ? partialBoundWitness.payload_schemas?.includes(BoundWitnessSchema3) : false, [
867
- partialBoundWitness
868
- ]);
869
- return /* @__PURE__ */ React25.createElement(FlexCol3, {
870
- alignItems: "stretch",
871
- rowGap: 4,
872
- ...props
873
- }, /* @__PURE__ */ React25.createElement(HashHeadingPaper, {
874
- hash,
875
- paperProps: {
876
- sx: {
877
- p: 2
878
- }
879
- },
880
- AdornmentEnd: /* @__PURE__ */ React25.createElement(BWActions, {
881
- boundwitness: boundWitness
882
- }),
883
- identiconProps: {
884
- p: 0.75,
885
- size: 24
886
- }
887
- }), /* @__PURE__ */ React25.createElement(Divider, {
888
- flexItem: true
889
- }), /* @__PURE__ */ React25.createElement(FlexCol3, {
890
- alignItems: "stretch",
891
- rowGap: 1,
892
- mb: 1
893
- }, /* @__PURE__ */ React25.createElement(HeadingPaper, {
894
- IconComponent: /* @__PURE__ */ React25.createElement(VscSymbolNamespace2, null),
895
- heading: "Payloads"
896
- }), /* @__PURE__ */ React25.createElement(BoundWitnessPayloadsTable, {
897
- boundwitness: boundWitness
898
- })), hasBWPayloads ? /* @__PURE__ */ React25.createElement(FlexCol3, {
899
- alignItems: "stretch",
900
- rowGap: 1,
901
- mb: 1
902
- }, /* @__PURE__ */ React25.createElement(HeadingPaper, {
903
- IconComponent: /* @__PURE__ */ React25.createElement(VscSymbolMethod2, null),
904
- heading: "Bound Witnesses"
905
- }), /* @__PURE__ */ React25.createElement(BoundWitnessPayloadsTableForBWs, {
906
- boundwitness: boundWitness
907
- })) : null, /* @__PURE__ */ React25.createElement(FlexCol3, {
908
- alignItems: "stretch",
909
- rowGap: 1,
910
- mb: 1
911
- }, /* @__PURE__ */ React25.createElement(HeadingPaper, {
912
- IconComponent: /* @__PURE__ */ React25.createElement(FaSignature, null),
913
- heading: "Signatures"
914
- }), /* @__PURE__ */ React25.createElement(BoundWitnessSignatureTable, {
915
- block: boundWitness
916
- })));
917
- }, "BoundWitnessDetailsBoxInner");
918
- BoundWitnessDetailsBoxInner.displayName = "BoundWitnessDetailsBoxInner";
919
-
920
- // src/components/Details/Card/DetailsCard.tsx
921
- import { TableHeightProvider as TableHeightProvider2 } from "@xyo-network/react-table";
922
- import React30 from "react";
923
-
924
- // src/components/Details/Card/DetailsCardInner.tsx
925
- import { ExpandLessRounded as ExpandLessRoundedIcon, ExpandMoreRounded as ExpandMoreRoundedIcon } from "@mui/icons-material";
926
- import { Card as Card2, Divider as Divider2, IconButton } from "@mui/material";
927
- import { useResetState } from "@xylabs/react-hooks";
928
- import React29 from "react";
929
-
930
- // src/components/Details/Card/DetailsCardContent.tsx
931
- import { Collapse as Collapse2 } from "@mui/material";
932
- import { FlexGrowCol, FlexRow as FlexRow3 } from "@xylabs/react-flexbox";
933
- import { CardContentEx } from "@xyo-network/react-card";
934
- import { useTableHeight as useTableHeight2 } from "@xyo-network/react-table";
935
- import React28, { useState as useState5 } from "react";
936
-
937
- // src/components/Details/Card/Navigation/BottomNavigation.tsx
938
- import { BottomNavigation, BottomNavigationAction, styled as styled7 } from "@mui/material";
939
- import { BoundWitnessSchema as BoundWitnessSchema4 } from "@xyo-network/boundwitness-model";
940
- import React26 from "react";
941
- import { FaSignature as FaSignature2 } from "react-icons/fa";
942
- import { VscSymbolMethod as VscSymbolMethod3, VscSymbolNamespace as VscSymbolNamespace3 } from "react-icons/vsc";
943
- var BoundWitnessBottomNavigation = /* @__PURE__ */ __name(({ ref, activeTab = 0, setActiveTab, boundWitness, ...props }) => {
944
- const payloadCount = boundWitness?.payload_schemas.filter((schema) => schema !== BoundWitnessSchema4).length ?? 0;
945
- const boundWitnessCount = boundWitness?.payload_schemas.filter((schema) => schema === BoundWitnessSchema4).length ?? 0;
946
- const signers = boundWitness?.addresses.length ?? 0;
947
- return /* @__PURE__ */ React26.createElement(StyledBottomNavigation, {
948
- showLabels: true,
949
- value: activeTab,
950
- onChange: /* @__PURE__ */ __name((_event, newValue) => {
951
- setActiveTab?.(newValue);
952
- }, "onChange"),
953
- ref,
954
- ...props
955
- }, /* @__PURE__ */ React26.createElement(BottomNavigationAction, {
956
- label: `Payloads - ${payloadCount}`,
957
- icon: /* @__PURE__ */ React26.createElement(VscSymbolNamespace3, null)
958
- }), /* @__PURE__ */ React26.createElement(BottomNavigationAction, {
959
- label: `Bound Witnesses - ${boundWitnessCount}`,
960
- icon: /* @__PURE__ */ React26.createElement(VscSymbolMethod3, null)
961
- }), /* @__PURE__ */ React26.createElement(BottomNavigationAction, {
962
- label: `Signatures - ${signers}`,
963
- icon: /* @__PURE__ */ React26.createElement(FaSignature2, null)
964
- }));
965
- }, "BoundWitnessBottomNavigation");
966
- BoundWitnessBottomNavigation.displayName = "BoundWitnessBottomNavigation";
967
- var StyledBottomNavigation = styled7(BottomNavigation, {
968
- name: "StyledBottomNavigation"
969
- })(() => ({
970
- background: "inherit"
971
- }));
972
-
973
- // src/components/Details/Card/Navigation/NavigationTabs.tsx
974
- import { Paper as Paper2, Tab, Tabs, useTheme as useTheme3 } from "@mui/material";
975
- import { BoundWitnessSchema as BoundWitnessSchema5 } from "@xyo-network/boundwitness-model";
976
- import React27 from "react";
977
- import { FaSignature as FaSignature3 } from "react-icons/fa";
978
- import { VscSymbolMethod as VscSymbolMethod4, VscSymbolNamespace as VscSymbolNamespace4 } from "react-icons/vsc";
979
- var BWNavigationTabs = /* @__PURE__ */ __name(({ setValue, value, boundWitness, ...props }) => {
980
- const payloadCount = boundWitness?.payload_schemas.filter((schema) => schema !== BoundWitnessSchema5).length ?? 0;
981
- const boundWitnessCount = boundWitness?.payload_schemas.filter((schema) => schema === BoundWitnessSchema5).length ?? 0;
982
- const signers = boundWitness?.addresses.length ?? 0;
983
- const theme = useTheme3();
984
- const handleChange = /* @__PURE__ */ __name((_event, newValue) => {
985
- setValue?.(newValue);
986
- }, "handleChange");
987
- const tabProps = {
988
- iconPosition: "start",
989
- sx: {
990
- boxShadow: "none",
991
- fontSize: theme.spacing(1.75),
992
- justifyContent: "start",
993
- lineHeight: 3,
994
- minHeight: 0,
995
- overflow: "hidden"
996
- }
997
- };
998
- return /* @__PURE__ */ React27.createElement(Tabs, {
999
- orientation: "vertical",
1000
- value,
1001
- onChange: handleChange,
1002
- "aria-label": "BW Vertical tabs",
1003
- ...props
1004
- }, /* @__PURE__ */ React27.createElement(Tab, {
1005
- component: Paper2,
1006
- elevation: value === 0 ? 3 : 0,
1007
- ...tabProps,
1008
- label: `Payloads - ${payloadCount}`,
1009
- icon: /* @__PURE__ */ React27.createElement(VscSymbolNamespace4, null)
1010
- }), /* @__PURE__ */ React27.createElement(Tab, {
1011
- component: Paper2,
1012
- elevation: value === 1 ? 3 : 0,
1013
- ...tabProps,
1014
- label: `Bound Witnesses - ${boundWitnessCount}`,
1015
- icon: /* @__PURE__ */ React27.createElement(VscSymbolMethod4, null)
1016
- }), /* @__PURE__ */ React27.createElement(Tab, {
1017
- component: Paper2,
1018
- elevation: value === 2 ? 3 : 0,
1019
- ...tabProps,
1020
- label: `Signatures - ${signers}`,
1021
- icon: /* @__PURE__ */ React27.createElement(FaSignature3, null)
1022
- }));
1023
- }, "BWNavigationTabs");
1024
-
1025
- // src/components/Details/Card/DetailsCardContent.tsx
1026
- var DetailsCardContent = /* @__PURE__ */ __name(({ ref, collapsed, boundwitness, setCollapsed, ...props }) => {
1027
- const { height } = useTableHeight2();
1028
- const [activeTab, setActiveTab] = useState5(0);
1029
- return /* @__PURE__ */ React28.createElement(CardContentEx, {
1030
- removePadding: true
1031
- }, /* @__PURE__ */ React28.createElement(FlexGrowCol, {
1032
- alignItems: "stretch",
1033
- height: height !== void 0 && collapsed ? height : "auto",
1034
- justifyContent: "start",
1035
- ref
1036
- }, /* @__PURE__ */ React28.createElement(Collapse2, {
1037
- in: collapsed
1038
- }, /* @__PURE__ */ React28.createElement(FlexRow3, {
1039
- alignItems: "stretch",
1040
- height: height !== void 0 && collapsed ? height : "auto",
1041
- ...props
1042
- }, /* @__PURE__ */ React28.createElement(BWNavigationTabs, {
1043
- value: activeTab,
1044
- setValue: setActiveTab,
1045
- boundWitness: boundwitness
1046
- }), /* @__PURE__ */ React28.createElement(FlexGrowCol, {
1047
- justifyContent: "start",
1048
- overflow: "scroll",
1049
- sx: {
1050
- borderLeft: "1px solid",
1051
- borderLeftColor: "divider"
1052
- }
1053
- }, activeTab === 0 ? /* @__PURE__ */ React28.createElement(BoundWitnessPayloadsTable, {
1054
- boundwitness,
1055
- variant: "scrollable"
1056
- }) : null, activeTab === 1 ? /* @__PURE__ */ React28.createElement(BoundWitnessPayloadsTableForBWs, {
1057
- boundwitness,
1058
- variant: "scrollable"
1059
- }) : null, activeTab === 2 ? /* @__PURE__ */ React28.createElement(BoundWitnessSignatureTable, {
1060
- block: boundwitness,
1061
- variant: "scrollable"
1062
- }) : null)))), /* @__PURE__ */ React28.createElement(Collapse2, {
1063
- in: !collapsed,
1064
- unmountOnExit: true
1065
- }, /* @__PURE__ */ React28.createElement(BoundWitnessBottomNavigation, {
1066
- onClick: /* @__PURE__ */ __name(() => setCollapsed?.(true), "onClick"),
1067
- activeTab,
1068
- setActiveTab,
1069
- boundWitness: boundwitness
1070
- })));
1071
- }, "DetailsCardContent");
1072
- DetailsCardContent.displayName = "DetailsCardContent";
1073
-
1074
- // src/components/Details/Card/DetailsCardInner.tsx
1075
- var BoundWitnessDetailsCardInner = /* @__PURE__ */ __name(({ ref, payload, active, ...props }) => {
1076
- const boundwitness = payload;
1077
- const [collapsed, setCollapsed] = useResetState(!active);
1078
- return /* @__PURE__ */ React29.createElement(Card2, {
1079
- ref,
1080
- ...props
1081
- }, /* @__PURE__ */ React29.createElement(BoundWitnessCardHeader, {
1082
- payload,
1083
- active,
1084
- activeBgColor: false,
1085
- hideJSONButton: false,
1086
- hideValidation: false,
1087
- hidePreviousHash: false,
1088
- additionalActions: /* @__PURE__ */ React29.createElement(React29.Fragment, null, /* @__PURE__ */ React29.createElement(Divider2, {
1089
- flexItem: true,
1090
- orientation: "vertical",
1091
- sx: {
1092
- ml: 2,
1093
- mr: 1
1094
- }
1095
- }), /* @__PURE__ */ React29.createElement(IconButton, {
1096
- onClick: /* @__PURE__ */ __name(() => setCollapsed(!collapsed), "onClick")
1097
- }, collapsed ? /* @__PURE__ */ React29.createElement(ExpandMoreRoundedIcon, null) : /* @__PURE__ */ React29.createElement(ExpandLessRoundedIcon, null))),
1098
- sx: {
1099
- columnGap: 2
1100
- }
1101
- }), /* @__PURE__ */ React29.createElement(DetailsCardContent, {
1102
- boundwitness,
1103
- collapsed,
1104
- setCollapsed,
1105
- ref
1106
- }));
1107
- }, "BoundWitnessDetailsCardInner");
1108
- BoundWitnessDetailsCardInner.displayName = "BoundWitnessDetailsCardInner";
1109
-
1110
- // src/components/Details/Card/DetailsCard.tsx
1111
- var BoundWitnessDetailsCard = /* @__PURE__ */ __name(({ ref, visibleRows, ...props }) => {
1112
- return /* @__PURE__ */ React30.createElement(TableHeightProvider2, {
1113
- defaultVisibleRows: visibleRows,
1114
- additionalRows: 1
1115
- }, /* @__PURE__ */ React30.createElement(BoundWitnessDetailsCardInner, {
1116
- ref,
1117
- ...props
1118
- }));
1119
- }, "BoundWitnessDetailsCard");
1120
- BoundWitnessDetailsCard.displayName = "BoundWitnessDetailsCard";
1121
-
1122
- // src/components/Details/Details.tsx
1123
- import { FlexCol as FlexCol5 } from "@xylabs/react-flexbox";
1124
- import { PayloadDataDetails, PayloadJsonDetails } from "@xyo-network/react-payload-details";
1125
- import React32 from "react";
1126
-
1127
- // src/components/Details/ValidationDetails.tsx
1128
- import { Typography as Typography6 } from "@mui/material";
1129
- import { FlexCol as FlexCol4 } from "@xylabs/react-flexbox";
1130
- import { usePromise as usePromise3 } from "@xylabs/react-promise";
1131
- import { BoundWitnessValidator as BoundWitnessValidator3 } from "@xyo-network/boundwitness-validator";
1132
- import { Property, PropertyGroup as PropertyGroup3 } from "@xyo-network/react-property";
1133
- import React31 from "react";
1134
- var BoundWitnessValidationDetails = /* @__PURE__ */ __name(({ value, ...props }) => {
1135
- const [errors = []] = usePromise3(async () => await (value ? new BoundWitnessValidator3(value).validate() : void 0), [
1136
- value
1137
- ]);
1138
- let elevation = 2;
1139
- if (props.paper) {
1140
- elevation += props.elevation ?? 0;
1141
- }
1142
- return /* @__PURE__ */ React31.createElement(PropertyGroup3, {
1143
- titleProps: {
1144
- elevation
1145
- },
1146
- title: "Validation",
1147
- tip: "The results from validating the block",
1148
- ...props
1149
- }, /* @__PURE__ */ React31.createElement(Property, {
1150
- titleProps: {
1151
- elevation
1152
- },
1153
- flexGrow: 1,
1154
- title: "Valid",
1155
- value: errors.length === 0 ? "True" : "False",
1156
- tip: errors.length > 0 ? /* @__PURE__ */ React31.createElement(FlexCol4, {
1157
- flexWrap: "wrap"
1158
- }, errors.map((error) => {
1159
- return /* @__PURE__ */ React31.createElement(Typography6, {
1160
- key: error.name
1161
- }, error.toString());
1162
- })) : /* @__PURE__ */ React31.createElement(Typography6, null, "No Errors")
1163
- }));
1164
- }, "BoundWitnessValidationDetails");
1165
-
1166
- // src/components/Details/Details.tsx
1167
- var BoundWitnessDetails = /* @__PURE__ */ __name(({ ref, paper, payload, children, ...props }) => {
1168
- const boundwitness = payload;
1169
- return /* @__PURE__ */ React32.createElement(FlexCol5, {
1170
- justifyContent: "flex-start",
1171
- alignItems: "stretch",
1172
- gap: 1,
1173
- ref,
1174
- ...props
1175
- }, /* @__PURE__ */ React32.createElement(PayloadDataDetails, {
1176
- paper,
1177
- payload: boundwitness,
1178
- size: "large",
1179
- badge: true
1180
- }), /* @__PURE__ */ React32.createElement(BoundWitnessPayloads, {
1181
- paper,
1182
- payload: boundwitness
1183
- }), /* @__PURE__ */ React32.createElement(BoundWitnessSignatureDetails, {
1184
- paper,
1185
- block: boundwitness
1186
- }), /* @__PURE__ */ React32.createElement(BoundWitnessValidationDetails, {
1187
- paper,
1188
- value: boundwitness
1189
- }), /* @__PURE__ */ React32.createElement(PayloadJsonDetails, {
1190
- paper,
1191
- payload: boundwitness
1192
- }), children);
1193
- }, "BoundWitnessDetails");
1194
- BoundWitnessDetails.displayName = "BoundWitnessDetails [XYO]";
1195
-
1196
- // src/Plugin.ts
1197
- import { createPayloadRenderPlugin } from "@xyo-network/react-payload-plugin";
1198
- var BoundWitnessRenderPlugin = {
1199
- ...createPayloadRenderPlugin({
1200
- canRender: /* @__PURE__ */ __name((payload) => payload?.schema === "network.xyo.boundwitness", "canRender"),
1201
- components: {
1202
- box: {
1203
- detailsBox: BoundWitnessDetailsBox
1204
- },
1205
- card: {
1206
- content: BoundWitnessCardContent,
1207
- header: BoundWitnessCardHeader
1208
- }
1209
- },
1210
- name: "BoundWitness"
1211
- })
1212
- };
1
+ // src/index.ts
2
+ var index_default = {};
1213
3
  export {
1214
- BWActions,
1215
- BWHeading,
1216
- BWJsonMenuItem,
1217
- BWPreviousHashMenuItem,
1218
- BWPreviousHashQuickTipButton,
1219
- BWVerification,
1220
- BoundWitnessCardContent,
1221
- BoundWitnessCardHeader,
1222
- BoundWitnessDetails,
1223
- BoundWitnessDetailsBox,
1224
- BoundWitnessDetailsCard,
1225
- BoundWitnessPayloads,
1226
- BoundWitnessPayloadsTable,
1227
- BoundWitnessPayloadsTableForBWs,
1228
- BoundWitnessPayloadsTableInner,
1229
- BoundWitnessRenderPlugin,
1230
- BoundWitnessRendererCard,
1231
- BoundWitnessSignatureDetails,
1232
- BoundWitnessSignatureTable,
1233
- BoundWitnessValidationDetails,
1234
- CardColumnTitle,
1235
- CardColumnTitleH2,
1236
- CardColumnsFlex,
1237
- CardContentFlex,
1238
- HashHeadingPaper,
1239
- HeadingPaper,
1240
- PreviousHashDialogContent
4
+ index_default as default
1241
5
  };
1242
6
  //# sourceMappingURL=index.mjs.map