@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.
- package/dist/browser/index.mjs +3 -1239
- package/dist/browser/index.mjs.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +3 -35
- package/src/index.ts +1 -2
- package/dist/types/Plugin.d.ts +0 -3
- package/dist/types/Plugin.d.ts.map +0 -1
- package/dist/types/components/Card/Card.d.ts +0 -9
- package/dist/types/components/Card/Card.d.ts.map +0 -1
- package/dist/types/components/Card/CardContent/AddressAvatarGroup.d.ts +0 -8
- package/dist/types/components/Card/CardContent/AddressAvatarGroup.d.ts.map +0 -1
- package/dist/types/components/Card/CardContent/CardContent.d.ts +0 -14
- package/dist/types/components/Card/CardContent/CardContent.d.ts.map +0 -1
- package/dist/types/components/Card/CardContent/SchemaAvatarGroup.d.ts +0 -9
- package/dist/types/components/Card/CardContent/SchemaAvatarGroup.d.ts.map +0 -1
- package/dist/types/components/Card/CardContent/index.d.ts +0 -3
- package/dist/types/components/Card/CardContent/index.d.ts.map +0 -1
- package/dist/types/components/Card/CardContent/layout/CardColumnTitle.d.ts +0 -5
- package/dist/types/components/Card/CardContent/layout/CardColumnTitle.d.ts.map +0 -1
- package/dist/types/components/Card/CardContent/layout/CardColumnsFlex.d.ts +0 -2
- package/dist/types/components/Card/CardContent/layout/CardColumnsFlex.d.ts.map +0 -1
- package/dist/types/components/Card/CardContent/layout/CardContentFlex.d.ts +0 -5
- package/dist/types/components/Card/CardContent/layout/CardContentFlex.d.ts.map +0 -1
- package/dist/types/components/Card/CardContent/layout/index.d.ts +0 -4
- package/dist/types/components/Card/CardContent/layout/index.d.ts.map +0 -1
- package/dist/types/components/Card/CardHeader/CardHeader.d.ts +0 -20
- package/dist/types/components/Card/CardHeader/CardHeader.d.ts.map +0 -1
- package/dist/types/components/Card/CardHeader/index.d.ts +0 -2
- package/dist/types/components/Card/CardHeader/index.d.ts.map +0 -1
- package/dist/types/components/Card/index.d.ts +0 -4
- package/dist/types/components/Card/index.d.ts.map +0 -1
- package/dist/types/components/Details/BoundWitnessLinksDetails.d.ts +0 -8
- package/dist/types/components/Details/BoundWitnessLinksDetails.d.ts.map +0 -1
- package/dist/types/components/Details/Box/DetailsBox.d.ts +0 -6
- package/dist/types/components/Details/Box/DetailsBox.d.ts.map +0 -1
- package/dist/types/components/Details/Box/index.d.ts +0 -2
- package/dist/types/components/Details/Box/index.d.ts.map +0 -1
- package/dist/types/components/Details/Card/DetailsCard.d.ts +0 -11
- package/dist/types/components/Details/Card/DetailsCard.d.ts.map +0 -1
- package/dist/types/components/Details/Card/DetailsCardContent.d.ts +0 -16
- package/dist/types/components/Details/Card/DetailsCardContent.d.ts.map +0 -1
- package/dist/types/components/Details/Card/DetailsCardInner.d.ts +0 -11
- package/dist/types/components/Details/Card/DetailsCardInner.d.ts.map +0 -1
- package/dist/types/components/Details/Card/Navigation/BottomNavigation.d.ts +0 -17
- package/dist/types/components/Details/Card/Navigation/BottomNavigation.d.ts.map +0 -1
- package/dist/types/components/Details/Card/Navigation/NavigationTabs.d.ts +0 -11
- package/dist/types/components/Details/Card/Navigation/NavigationTabs.d.ts.map +0 -1
- package/dist/types/components/Details/Card/Navigation/index.d.ts +0 -3
- package/dist/types/components/Details/Card/Navigation/index.d.ts.map +0 -1
- package/dist/types/components/Details/Card/index.d.ts +0 -2
- package/dist/types/components/Details/Card/index.d.ts.map +0 -1
- package/dist/types/components/Details/Details.d.ts +0 -16
- package/dist/types/components/Details/Details.d.ts.map +0 -1
- package/dist/types/components/Details/ValidationDetails.d.ts +0 -8
- package/dist/types/components/Details/ValidationDetails.d.ts.map +0 -1
- package/dist/types/components/Details/index.d.ts +0 -5
- package/dist/types/components/Details/index.d.ts.map +0 -1
- package/dist/types/components/_shared/Actions/BWActions.d.ts +0 -15
- package/dist/types/components/_shared/Actions/BWActions.d.ts.map +0 -1
- package/dist/types/components/_shared/Actions/Verification.d.ts +0 -9
- package/dist/types/components/_shared/Actions/Verification.d.ts.map +0 -1
- package/dist/types/components/_shared/Actions/_shared/ActionMenuItemProps.d.ts +0 -7
- package/dist/types/components/_shared/Actions/_shared/ActionMenuItemProps.d.ts.map +0 -1
- package/dist/types/components/_shared/Actions/_shared/MenuItemDialog.d.ts +0 -7
- package/dist/types/components/_shared/Actions/_shared/MenuItemDialog.d.ts.map +0 -1
- package/dist/types/components/_shared/Actions/_shared/index.d.ts +0 -3
- package/dist/types/components/_shared/Actions/_shared/index.d.ts.map +0 -1
- package/dist/types/components/_shared/Actions/index.d.ts +0 -5
- package/dist/types/components/_shared/Actions/index.d.ts.map +0 -1
- package/dist/types/components/_shared/Actions/json/MenuItem.d.ts +0 -6
- package/dist/types/components/_shared/Actions/json/MenuItem.d.ts.map +0 -1
- package/dist/types/components/_shared/Actions/json/index.d.ts +0 -2
- package/dist/types/components/_shared/Actions/json/index.d.ts.map +0 -1
- package/dist/types/components/_shared/Actions/previous-hash/DialogContent.d.ts +0 -8
- package/dist/types/components/_shared/Actions/previous-hash/DialogContent.d.ts.map +0 -1
- package/dist/types/components/_shared/Actions/previous-hash/MenuItem.d.ts +0 -6
- package/dist/types/components/_shared/Actions/previous-hash/MenuItem.d.ts.map +0 -1
- package/dist/types/components/_shared/Actions/previous-hash/QuickTipButton.d.ts +0 -8
- package/dist/types/components/_shared/Actions/previous-hash/QuickTipButton.d.ts.map +0 -1
- package/dist/types/components/_shared/Actions/previous-hash/index.d.ts +0 -4
- package/dist/types/components/_shared/Actions/previous-hash/index.d.ts.map +0 -1
- package/dist/types/components/_shared/Heading/HashHeadingPaper/Adornment/BackPaperAdornment.d.ts +0 -6
- package/dist/types/components/_shared/Heading/HashHeadingPaper/Adornment/BackPaperAdornment.d.ts.map +0 -1
- package/dist/types/components/_shared/Heading/HashHeadingPaper/Adornment/PaperAdornment.d.ts +0 -6
- package/dist/types/components/_shared/Heading/HashHeadingPaper/Adornment/PaperAdornment.d.ts.map +0 -1
- package/dist/types/components/_shared/Heading/HashHeadingPaper/Adornment/PaperAdornmentIconButton.d.ts +0 -6
- package/dist/types/components/_shared/Heading/HashHeadingPaper/Adornment/PaperAdornmentIconButton.d.ts.map +0 -1
- package/dist/types/components/_shared/Heading/HashHeadingPaper/Adornment/index.d.ts +0 -4
- package/dist/types/components/_shared/Heading/HashHeadingPaper/Adornment/index.d.ts.map +0 -1
- package/dist/types/components/_shared/Heading/HashHeadingPaper/HashHeadingPaper.d.ts +0 -15
- package/dist/types/components/_shared/Heading/HashHeadingPaper/HashHeadingPaper.d.ts.map +0 -1
- package/dist/types/components/_shared/Heading/HashHeadingPaper/index.d.ts +0 -2
- package/dist/types/components/_shared/Heading/HashHeadingPaper/index.d.ts.map +0 -1
- package/dist/types/components/_shared/Heading/Heading.d.ts +0 -4
- package/dist/types/components/_shared/Heading/Heading.d.ts.map +0 -1
- package/dist/types/components/_shared/Heading/HeadingPaper/HeadingPaper.d.ts +0 -14
- package/dist/types/components/_shared/Heading/HeadingPaper/HeadingPaper.d.ts.map +0 -1
- package/dist/types/components/_shared/Heading/HeadingPaper/index.d.ts +0 -2
- package/dist/types/components/_shared/Heading/HeadingPaper/index.d.ts.map +0 -1
- package/dist/types/components/_shared/Heading/HeadingProps.d.ts +0 -14
- package/dist/types/components/_shared/Heading/HeadingProps.d.ts.map +0 -1
- package/dist/types/components/_shared/Heading/index.d.ts +0 -5
- package/dist/types/components/_shared/Heading/index.d.ts.map +0 -1
- package/dist/types/components/_shared/Payloads/PayloadsPropertyGroup.d.ts +0 -10
- package/dist/types/components/_shared/Payloads/PayloadsPropertyGroup.d.ts.map +0 -1
- package/dist/types/components/_shared/Payloads/PayloadsTable.d.ts +0 -11
- package/dist/types/components/_shared/Payloads/PayloadsTable.d.ts.map +0 -1
- package/dist/types/components/_shared/Payloads/index.d.ts +0 -3
- package/dist/types/components/_shared/Payloads/index.d.ts.map +0 -1
- package/dist/types/components/_shared/Payloads/payloads-table/TableBody.d.ts +0 -11
- package/dist/types/components/_shared/Payloads/payloads-table/TableBody.d.ts.map +0 -1
- package/dist/types/components/_shared/Payloads/payloads-table/TableBodyFiltered.d.ts +0 -8
- package/dist/types/components/_shared/Payloads/payloads-table/TableBodyFiltered.d.ts.map +0 -1
- package/dist/types/components/_shared/Payloads/payloads-table/TableHead.d.ts +0 -4
- package/dist/types/components/_shared/Payloads/payloads-table/TableHead.d.ts.map +0 -1
- package/dist/types/components/_shared/Payloads/payloads-table/index.d.ts +0 -4
- package/dist/types/components/_shared/Payloads/payloads-table/index.d.ts.map +0 -1
- package/dist/types/components/_shared/Signatures/SignatureDetails.d.ts +0 -8
- package/dist/types/components/_shared/Signatures/SignatureDetails.d.ts.map +0 -1
- package/dist/types/components/_shared/Signatures/SignatureTable.d.ts +0 -8
- package/dist/types/components/_shared/Signatures/SignatureTable.d.ts.map +0 -1
- package/dist/types/components/_shared/Signatures/SignatureTableRow.d.ts +0 -14
- package/dist/types/components/_shared/Signatures/SignatureTableRow.d.ts.map +0 -1
- package/dist/types/components/_shared/Signatures/index.d.ts +0 -3
- package/dist/types/components/_shared/Signatures/index.d.ts.map +0 -1
- package/dist/types/components/_shared/index.d.ts +0 -5
- package/dist/types/components/_shared/index.d.ts.map +0 -1
- package/dist/types/components/index.d.ts +0 -4
- package/dist/types/components/index.d.ts.map +0 -1
- package/src/Plugin.ts +0 -21
- package/src/components/Card/Card.stories.tsx +0 -22
- package/src/components/Card/Card.tsx +0 -25
- package/src/components/Card/CardContent/AddressAvatarGroup.tsx +0 -27
- package/src/components/Card/CardContent/CardContent.tsx +0 -36
- package/src/components/Card/CardContent/SchemaAvatarGroup.tsx +0 -43
- package/src/components/Card/CardContent/index.ts +0 -2
- package/src/components/Card/CardContent/layout/CardColumnTitle.tsx +0 -10
- package/src/components/Card/CardContent/layout/CardColumnsFlex.tsx +0 -8
- package/src/components/Card/CardContent/layout/CardContentFlex.tsx +0 -19
- package/src/components/Card/CardContent/layout/index.ts +0 -3
- package/src/components/Card/CardHeader/CardHeader.tsx +0 -89
- package/src/components/Card/CardHeader/index.ts +0 -1
- package/src/components/Card/index.ts +0 -3
- package/src/components/Details/BoundWitnessLinksDetails.tsx +0 -38
- package/src/components/Details/Box/DetailsBox.stories.tsx +0 -65
- package/src/components/Details/Box/DetailsBox.tsx +0 -70
- package/src/components/Details/Box/index.ts +0 -1
- package/src/components/Details/Card/DetailsCard.stories.tsx +0 -37
- package/src/components/Details/Card/DetailsCard.tsx +0 -20
- package/src/components/Details/Card/DetailsCardContent.tsx +0 -63
- package/src/components/Details/Card/DetailsCardInner.tsx +0 -53
- package/src/components/Details/Card/Navigation/BottomNavigation.stories.tsx +0 -24
- package/src/components/Details/Card/Navigation/BottomNavigation.tsx +0 -47
- package/src/components/Details/Card/Navigation/NavigationTabs.stories.tsx +0 -26
- package/src/components/Details/Card/Navigation/NavigationTabs.tsx +0 -53
- package/src/components/Details/Card/Navigation/index.ts +0 -2
- package/src/components/Details/Card/index.ts +0 -1
- package/src/components/Details/Details.stories.tsx +0 -77
- package/src/components/Details/Details.tsx +0 -35
- package/src/components/Details/ValidationDetails.tsx +0 -43
- package/src/components/Details/index.ts +0 -4
- package/src/components/_shared/Actions/BWActions.tsx +0 -55
- package/src/components/_shared/Actions/Verification.tsx +0 -46
- package/src/components/_shared/Actions/_shared/ActionMenuItemProps.ts +0 -7
- package/src/components/_shared/Actions/_shared/MenuItemDialog.tsx +0 -28
- package/src/components/_shared/Actions/_shared/index.ts +0 -2
- package/src/components/_shared/Actions/index.ts +0 -4
- package/src/components/_shared/Actions/json/MenuItem.tsx +0 -43
- package/src/components/_shared/Actions/json/index.ts +0 -1
- package/src/components/_shared/Actions/previous-hash/DialogContent.tsx +0 -44
- package/src/components/_shared/Actions/previous-hash/MenuItem.tsx +0 -37
- package/src/components/_shared/Actions/previous-hash/QuickTipButton.tsx +0 -32
- package/src/components/_shared/Actions/previous-hash/index.ts +0 -3
- package/src/components/_shared/Heading/HashHeadingPaper/Adornment/BackPaperAdornment.tsx +0 -13
- package/src/components/_shared/Heading/HashHeadingPaper/Adornment/PaperAdornment.tsx +0 -15
- package/src/components/_shared/Heading/HashHeadingPaper/Adornment/PaperAdornmentIconButton.tsx +0 -13
- package/src/components/_shared/Heading/HashHeadingPaper/Adornment/index.ts +0 -3
- package/src/components/_shared/Heading/HashHeadingPaper/HashHeadingPaper.stories.tsx +0 -33
- package/src/components/_shared/Heading/HashHeadingPaper/HashHeadingPaper.tsx +0 -45
- package/src/components/_shared/Heading/HashHeadingPaper/index.ts +0 -1
- package/src/components/_shared/Heading/Heading.tsx +0 -49
- package/src/components/_shared/Heading/HeadingPaper/HeadingPaper.tsx +0 -50
- package/src/components/_shared/Heading/HeadingPaper/index.ts +0 -1
- package/src/components/_shared/Heading/HeadingProps.tsx +0 -15
- package/src/components/_shared/Heading/index.ts +0 -4
- package/src/components/_shared/Payloads/PayloadsPropertyGroup.tsx +0 -26
- package/src/components/_shared/Payloads/PayloadsTable.tsx +0 -53
- package/src/components/_shared/Payloads/index.ts +0 -2
- package/src/components/_shared/Payloads/payloads-table/TableBody.tsx +0 -66
- package/src/components/_shared/Payloads/payloads-table/TableBodyFiltered.tsx +0 -52
- package/src/components/_shared/Payloads/payloads-table/TableHead.tsx +0 -24
- package/src/components/_shared/Payloads/payloads-table/index.ts +0 -3
- package/src/components/_shared/Signatures/SignatureDetails.tsx +0 -22
- package/src/components/_shared/Signatures/SignatureTable.stories.tsx +0 -29
- package/src/components/_shared/Signatures/SignatureTable.tsx +0 -92
- package/src/components/_shared/Signatures/SignatureTableRow.tsx +0 -88
- package/src/components/_shared/Signatures/index.ts +0 -2
- package/src/components/_shared/index.ts +0 -4
- package/src/components/index.ts +0 -3
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { TableRowProps } from '@mui/material';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
type clickableFields = 'address' | 'signature';
|
|
4
|
-
export interface BoundWitnessSignatureTableRowProps extends TableRowProps {
|
|
5
|
-
address?: string;
|
|
6
|
-
archive?: string;
|
|
7
|
-
clickableFields?: clickableFields[];
|
|
8
|
-
hash?: string;
|
|
9
|
-
previousHash?: string | null;
|
|
10
|
-
signature?: string;
|
|
11
|
-
}
|
|
12
|
-
export declare const BoundWitnessSignatureTableRow: React.FC<BoundWitnessSignatureTableRowProps>;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=SignatureTableRow.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SignatureTableRow.d.ts","sourceRoot":"","sources":["../../../../../src/components/_shared/Signatures/SignatureTableRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAWlD,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,KAAK,eAAe,GAAG,SAAS,GAAG,WAAW,CAAA;AAE9C,MAAM,WAAW,kCAAmC,SAAQ,aAAa;IACvE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,eAAe,CAAC,EAAE,eAAe,EAAE,CAAA;IACnC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,6BAA6B,EAAE,KAAK,CAAC,EAAE,CAAC,kCAAkC,CA8DtF,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/_shared/Signatures/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/_shared/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA"}
|
package/src/Plugin.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Payload } from '@xyo-network/payload-model'
|
|
2
|
-
import type { PayloadRenderPlugin } from '@xyo-network/react-payload-plugin'
|
|
3
|
-
import { createPayloadRenderPlugin } from '@xyo-network/react-payload-plugin'
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
BoundWitnessCardContent, BoundWitnessCardHeader, BoundWitnessDetailsBox,
|
|
7
|
-
} from './components/index.ts'
|
|
8
|
-
|
|
9
|
-
export const BoundWitnessRenderPlugin: PayloadRenderPlugin = {
|
|
10
|
-
...createPayloadRenderPlugin({
|
|
11
|
-
canRender: (payload?: Payload) => payload?.schema === 'network.xyo.boundwitness',
|
|
12
|
-
components: {
|
|
13
|
-
box: { detailsBox: BoundWitnessDetailsBox },
|
|
14
|
-
card: {
|
|
15
|
-
content: BoundWitnessCardContent,
|
|
16
|
-
header: BoundWitnessCardHeader,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
name: 'BoundWitness',
|
|
20
|
-
}),
|
|
21
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryFn } from '@storybook/react'
|
|
2
|
-
import { sampleBlock } from '@xyo-network/react-storybook'
|
|
3
|
-
import React from 'react'
|
|
4
|
-
|
|
5
|
-
import { BoundWitnessRendererCard } from './Card.tsx'
|
|
6
|
-
|
|
7
|
-
export default {
|
|
8
|
-
component: BoundWitnessRendererCard,
|
|
9
|
-
title: 'plugin/boundwitness/CardRenderer',
|
|
10
|
-
} as Meta
|
|
11
|
-
|
|
12
|
-
const Template: StoryFn<typeof BoundWitnessRendererCard> = (props) => {
|
|
13
|
-
return <BoundWitnessRendererCard {...props} />
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const Default = Template.bind({})
|
|
17
|
-
Default.args = { payload: sampleBlock }
|
|
18
|
-
|
|
19
|
-
const WithActive = Template.bind({})
|
|
20
|
-
WithActive.args = { active: true, payload: sampleBlock }
|
|
21
|
-
|
|
22
|
-
export { Default, WithActive }
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { CardProps } from '@mui/material'
|
|
2
|
-
import { Card } from '@mui/material'
|
|
3
|
-
import type { BoundWitness } from '@xyo-network/boundwitness-model'
|
|
4
|
-
import type { Payload } from '@xyo-network/payload-model'
|
|
5
|
-
import React from 'react'
|
|
6
|
-
|
|
7
|
-
import { BoundWitnessCardContent } from './CardContent/index.ts'
|
|
8
|
-
import { BoundWitnessCardHeader } from './CardHeader/index.ts'
|
|
9
|
-
|
|
10
|
-
export interface BoundWitnessCardProps extends CardProps {
|
|
11
|
-
active?: boolean
|
|
12
|
-
payload?: Payload
|
|
13
|
-
}
|
|
14
|
-
export const BoundWitnessRendererCard: React.FC<BoundWitnessCardProps> = ({
|
|
15
|
-
payload, active, ...props
|
|
16
|
-
}) => {
|
|
17
|
-
const boundwitness = payload as BoundWitness
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<Card {...props}>
|
|
21
|
-
<BoundWitnessCardHeader payload={boundwitness} active={active} hideJSONButton hidePreviousHash hideValidation />
|
|
22
|
-
<BoundWitnessCardContent payload={boundwitness} active={active} />
|
|
23
|
-
</Card>
|
|
24
|
-
)
|
|
25
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { AvatarGroupProps } from '@mui/material'
|
|
2
|
-
import { Avatar, AvatarGroup } from '@mui/material'
|
|
3
|
-
import { Identicon } from '@xylabs/react-identicon'
|
|
4
|
-
import React, { useRef } from 'react'
|
|
5
|
-
|
|
6
|
-
export interface AddressAvatarGroupProps extends AvatarGroupProps {
|
|
7
|
-
addresses?: string[]
|
|
8
|
-
maxAvatars?: number
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const AddressAvatarGroup: React.FC<AddressAvatarGroupProps> = ({
|
|
12
|
-
addresses, maxAvatars = 4, ...props
|
|
13
|
-
}) => {
|
|
14
|
-
const ref = useRef<HTMLDivElement | null>(null)
|
|
15
|
-
|
|
16
|
-
const size = ref.current ? ref.current.clientWidth * 0.65 : undefined
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<AvatarGroup max={maxAvatars} total={addresses?.length} {...props}>
|
|
20
|
-
{addresses?.map(address => (
|
|
21
|
-
<Avatar key={address} title={address} ref={ref} sx={{ bgcolor: 'background.paper' }}>
|
|
22
|
-
<Identicon value={address} position="absolute" p={0.25} top={0} bottom={0} left={0} right={0} size={size} />
|
|
23
|
-
</Avatar>
|
|
24
|
-
))}
|
|
25
|
-
</AvatarGroup>
|
|
26
|
-
)
|
|
27
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { CardContentProps } from '@mui/material'
|
|
2
|
-
import type { BoundWitness } from '@xyo-network/boundwitness-model'
|
|
3
|
-
import type { Payload } from '@xyo-network/payload-model'
|
|
4
|
-
import React from 'react'
|
|
5
|
-
|
|
6
|
-
import { AddressAvatarGroup } from './AddressAvatarGroup.tsx'
|
|
7
|
-
import {
|
|
8
|
-
CardColumnsFlex, CardColumnTitleH2, CardContentFlex,
|
|
9
|
-
} from './layout/index.ts'
|
|
10
|
-
import { SchemaAvatarGroup } from './SchemaAvatarGroup.tsx'
|
|
11
|
-
|
|
12
|
-
export interface BoundWitnessCardContentProps extends CardContentProps {
|
|
13
|
-
active?: boolean
|
|
14
|
-
payload?: Payload
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const BoundWitnessCardContent = ({
|
|
18
|
-
ref, payload, active, ...props
|
|
19
|
-
}: BoundWitnessCardContentProps & { ref?: React.Ref<HTMLDivElement | null> }) => {
|
|
20
|
-
const boundwitness = payload as Payload<BoundWitness>
|
|
21
|
-
|
|
22
|
-
return (
|
|
23
|
-
<CardContentFlex ref={ref} active={active} {...props}>
|
|
24
|
-
<CardColumnsFlex>
|
|
25
|
-
<CardColumnTitleH2>Payloads</CardColumnTitleH2>
|
|
26
|
-
<SchemaAvatarGroup schemas={boundwitness?.payload_schemas} />
|
|
27
|
-
</CardColumnsFlex>
|
|
28
|
-
<CardColumnsFlex>
|
|
29
|
-
<CardColumnTitleH2>Signers</CardColumnTitleH2>
|
|
30
|
-
<AddressAvatarGroup addresses={boundwitness?.addresses} />
|
|
31
|
-
</CardColumnsFlex>
|
|
32
|
-
</CardContentFlex>
|
|
33
|
-
)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
BoundWitnessCardContent.displayName = 'BoundWitnessCardContent'
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { AvatarGroupProps } from '@mui/material'
|
|
2
|
-
import { Avatar, AvatarGroup } from '@mui/material'
|
|
3
|
-
import { BoundWitnessSchema } from '@xyo-network/boundwitness-model'
|
|
4
|
-
import { usePayloadRenderPluginResolver } from '@xyo-network/react-payload-plugin-resolver'
|
|
5
|
-
import React, { useCallback } from 'react'
|
|
6
|
-
import { VscSymbolMethod, VscSymbolNamespace } from 'react-icons/vsc'
|
|
7
|
-
|
|
8
|
-
interface SchemaAvatarGroupProps extends AvatarGroupProps {
|
|
9
|
-
maxAvatars?: number
|
|
10
|
-
schemas?: string[]
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const SchemaAvatarGroup: React.FC<SchemaAvatarGroupProps> = ({
|
|
14
|
-
schemas, maxAvatars = 4, ...props
|
|
15
|
-
}) => {
|
|
16
|
-
const { resolver } = usePayloadRenderPluginResolver()
|
|
17
|
-
|
|
18
|
-
const resolveSchemaToIcon = useCallback(
|
|
19
|
-
(schema: string, index: number) => {
|
|
20
|
-
const SchemaAvatar = resolver?.resolve({ schema })?.components.avatar.image
|
|
21
|
-
return SchemaAvatar
|
|
22
|
-
? <SchemaAvatar key={index + schema} />
|
|
23
|
-
: (
|
|
24
|
-
<Avatar
|
|
25
|
-
key={index + schema}
|
|
26
|
-
title={schema}
|
|
27
|
-
sx={{ bgcolor: 'primary.main', color: 'primary.contrastText' }}
|
|
28
|
-
>
|
|
29
|
-
{schema === BoundWitnessSchema
|
|
30
|
-
? <VscSymbolMethod />
|
|
31
|
-
: <VscSymbolNamespace />}
|
|
32
|
-
</Avatar>
|
|
33
|
-
)
|
|
34
|
-
},
|
|
35
|
-
[resolver],
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<AvatarGroup max={maxAvatars} total={schemas?.length} {...props}>
|
|
40
|
-
{schemas?.map((schema, index) => resolveSchemaToIcon(schema, index))}
|
|
41
|
-
</AvatarGroup>
|
|
42
|
-
)
|
|
43
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { TypographyProps } from '@mui/material'
|
|
2
|
-
import { styled, Typography } from '@mui/material'
|
|
3
|
-
import React from 'react'
|
|
4
|
-
|
|
5
|
-
export const CardColumnTitle = styled(Typography, { name: 'CardColumnTitle' })(({ theme }) => ({
|
|
6
|
-
color: theme.palette.text.primary,
|
|
7
|
-
fontWeight: 500,
|
|
8
|
-
}))
|
|
9
|
-
|
|
10
|
-
export const CardColumnTitleH2: React.FC<TypographyProps> = props => <CardColumnTitle {...props} />
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { styled } from '@mui/material'
|
|
2
|
-
import { FlexCol } from '@xylabs/react-flexbox'
|
|
3
|
-
|
|
4
|
-
export const CardColumnsFlex = styled(FlexCol, { name: 'CardColumnsFlex' })(({ theme }) => ({
|
|
5
|
-
['@media only screen and (min-width: 333px)']: { minWidth: '50%' },
|
|
6
|
-
minWidth: '100%',
|
|
7
|
-
rowGap: theme.spacing(1),
|
|
8
|
-
}))
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
alpha, CardContent, styled,
|
|
3
|
-
} from '@mui/material'
|
|
4
|
-
|
|
5
|
-
export interface CardContentFlexProps {
|
|
6
|
-
active?: boolean
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const CardContentFlex = styled(CardContent, { name: 'CardContentFlex', shouldForwardProp: prop => prop !== 'active' })<CardContentFlexProps>(
|
|
10
|
-
({ theme, active }) => ({
|
|
11
|
-
[':last-child']: { paddingBottom: theme.spacing(1) },
|
|
12
|
-
...(active && { background: alpha(theme.palette.secondary.dark, 0.33) }),
|
|
13
|
-
display: 'flex',
|
|
14
|
-
flexDirection: 'row',
|
|
15
|
-
flexWrap: 'wrap',
|
|
16
|
-
justifyContent: 'center',
|
|
17
|
-
rowGap: theme.spacing(1),
|
|
18
|
-
}),
|
|
19
|
-
)
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import type { CardHeaderProps } from '@mui/material'
|
|
2
|
-
import {
|
|
3
|
-
CardHeader,
|
|
4
|
-
styled, useTheme,
|
|
5
|
-
} from '@mui/material'
|
|
6
|
-
import { Identicon } from '@xylabs/react-identicon'
|
|
7
|
-
import type { BoundWitness } from '@xyo-network/boundwitness-model'
|
|
8
|
-
import type { Payload } from '@xyo-network/payload-model'
|
|
9
|
-
import { usePayloadHash } from '@xyo-network/react-shared'
|
|
10
|
-
import type { ReactNode } from 'react'
|
|
11
|
-
import React from 'react'
|
|
12
|
-
|
|
13
|
-
import { BWActions, BWHeading } from '../../_shared/index.ts'
|
|
14
|
-
|
|
15
|
-
export interface BoundWitnessCardHeaderProps extends CardHeaderProps {
|
|
16
|
-
active?: boolean
|
|
17
|
-
activeBgColor?: boolean
|
|
18
|
-
additionalActions?: ReactNode
|
|
19
|
-
hideJSONButton?: boolean
|
|
20
|
-
hidePreviousHash?: boolean
|
|
21
|
-
hideValidation?: boolean
|
|
22
|
-
payload?: Payload
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export const BoundWitnessCardHeader = ({
|
|
26
|
-
ref, active = false, activeBgColor = true, additionalActions, hideJSONButton, hidePreviousHash, hideValidation, payload, ...props
|
|
27
|
-
}: BoundWitnessCardHeaderProps & { ref?: React.Ref<HTMLDivElement | null> }) => {
|
|
28
|
-
const boundwitness = payload as BoundWitness
|
|
29
|
-
const theme = useTheme()
|
|
30
|
-
const hash = usePayloadHash(boundwitness)
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<CardHeaderHash
|
|
34
|
-
ref={ref}
|
|
35
|
-
active={active}
|
|
36
|
-
activeBgColor={activeBgColor}
|
|
37
|
-
title={(
|
|
38
|
-
<BWHeading
|
|
39
|
-
heading={hash}
|
|
40
|
-
IconComponent={(
|
|
41
|
-
<Identicon
|
|
42
|
-
size={Number.parseInt(theme.spacing(2.5).replace('px', ''))}
|
|
43
|
-
p={0.5}
|
|
44
|
-
value={hash}
|
|
45
|
-
sx={{ background: theme.palette.background.paper }}
|
|
46
|
-
/>
|
|
47
|
-
)}
|
|
48
|
-
/>
|
|
49
|
-
)}
|
|
50
|
-
action={(
|
|
51
|
-
<BWActions
|
|
52
|
-
hideJSONButton={hideJSONButton}
|
|
53
|
-
hideValidation={hideValidation}
|
|
54
|
-
hidePreviousHash={hidePreviousHash}
|
|
55
|
-
boundwitness={boundwitness}
|
|
56
|
-
additionalActions={additionalActions}
|
|
57
|
-
/>
|
|
58
|
-
)}
|
|
59
|
-
{...props}
|
|
60
|
-
/>
|
|
61
|
-
)
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
BoundWitnessCardHeader.displayName = 'BoundWitnessCardHeader'
|
|
65
|
-
|
|
66
|
-
interface CardHeaderHashProps extends CardHeaderProps {
|
|
67
|
-
active?: boolean
|
|
68
|
-
activeBgColor?: boolean
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const CardHeaderHash = styled(CardHeader, {
|
|
72
|
-
name: 'CardHeaderHash',
|
|
73
|
-
shouldForwardProp: prop => !['active', 'activeBgColor'].includes(prop as string),
|
|
74
|
-
})<CardHeaderHashProps>(({
|
|
75
|
-
theme, active, activeBgColor,
|
|
76
|
-
}) => ({
|
|
77
|
-
'& .MuiCardHeader-action': {
|
|
78
|
-
marginBottom: 0,
|
|
79
|
-
marginTop: 0,
|
|
80
|
-
},
|
|
81
|
-
'& .MuiCardHeader-content': { overflow: 'visible' },
|
|
82
|
-
'&.MuiCardHeader-root': {
|
|
83
|
-
...(active && activeBgColor && { backgroundColor: theme.palette.info }),
|
|
84
|
-
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
85
|
-
paddingBottom: theme.spacing(1),
|
|
86
|
-
paddingTop: theme.spacing(1),
|
|
87
|
-
},
|
|
88
|
-
'padding': `${theme.spacing(0.5)} ${theme.spacing(2)}`,
|
|
89
|
-
}))
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './CardHeader.tsx'
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Typography } from '@mui/material'
|
|
2
|
-
import { FlexRow } from '@xylabs/react-flexbox'
|
|
3
|
-
import type { BoundWitness } from '@xyo-network/boundwitness-model'
|
|
4
|
-
import { useEvent } from '@xyo-network/react-event'
|
|
5
|
-
import type { PropertyGroupProps } from '@xyo-network/react-property'
|
|
6
|
-
import { Property, PropertyGroup } from '@xyo-network/react-property'
|
|
7
|
-
import React from 'react'
|
|
8
|
-
|
|
9
|
-
export type BoundWitnessLinksDetails = PropertyGroupProps & {
|
|
10
|
-
value?: BoundWitness
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const BoundWitnessLinksDetails: React.FC<BoundWitnessLinksDetails> = ({ value, ...props }) => {
|
|
14
|
-
let elevation = 2
|
|
15
|
-
if (props.paper) {
|
|
16
|
-
elevation += props.elevation ?? 0
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const [ref, dispatch] = useEvent<HTMLDivElement>()
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<PropertyGroup titleProps={{ elevation }} title="Links" tip="Blocks that are linked to this block" {...props}>
|
|
23
|
-
{value?.previous_hashes.map((hash) => {
|
|
24
|
-
return (
|
|
25
|
-
<Property key={hash} titleProps={{ elevation }} flexGrow={1} title="Previous Hash" tip={hash}>
|
|
26
|
-
{hash
|
|
27
|
-
? (
|
|
28
|
-
<FlexRow ref={ref} onClick={() => dispatch?.('boundwitness', 'click', hash)}>
|
|
29
|
-
<Typography fontFamily="monospace">{hash}</Typography>
|
|
30
|
-
</FlexRow>
|
|
31
|
-
)
|
|
32
|
-
: 'None'}
|
|
33
|
-
</Property>
|
|
34
|
-
)
|
|
35
|
-
})}
|
|
36
|
-
</PropertyGroup>
|
|
37
|
-
)
|
|
38
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryFn } from '@storybook/react'
|
|
2
|
-
import type { Payload } from '@xyo-network/payload-model'
|
|
3
|
-
import { useEvent } from '@xyo-network/react-event'
|
|
4
|
-
import { sampleAddressHistory } from '@xyo-network/react-storybook'
|
|
5
|
-
import React, { useRef } from 'react'
|
|
6
|
-
|
|
7
|
-
import { BoundWitnessDetailsBox } from './DetailsBox.tsx'
|
|
8
|
-
|
|
9
|
-
const StorybookEntry = {
|
|
10
|
-
argTypes: {},
|
|
11
|
-
component: BoundWitnessDetailsBox,
|
|
12
|
-
parameters: { docs: { page: null } },
|
|
13
|
-
title: 'plugin/boundwitness/DetailsBox',
|
|
14
|
-
} as Meta<typeof BoundWitnessDetailsBox>
|
|
15
|
-
|
|
16
|
-
const Template: StoryFn<typeof BoundWitnessDetailsBox> = (args) => {
|
|
17
|
-
const sharedRef = useRef<HTMLDivElement>(null)
|
|
18
|
-
useEvent<HTMLDivElement>((noun, verb, data) => console.log(`[${noun}|${verb}|${data}]`), sharedRef)
|
|
19
|
-
useEvent<HTMLDivElement>(() => console.log('2nd Listener'), sharedRef)
|
|
20
|
-
useEvent<HTMLDivElement>(() => console.log('3rd Listener'), sharedRef)
|
|
21
|
-
|
|
22
|
-
return <BoundWitnessDetailsBox ref={sharedRef} {...args} />
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const Default = Template.bind({})
|
|
26
|
-
Default.args = {}
|
|
27
|
-
|
|
28
|
-
const WithNoData = Template.bind({})
|
|
29
|
-
WithNoData.args = {
|
|
30
|
-
payload: {
|
|
31
|
-
_signatures: [],
|
|
32
|
-
addresses: [],
|
|
33
|
-
payload_hashes: [],
|
|
34
|
-
payload_schemas: [],
|
|
35
|
-
previous_hashes: [],
|
|
36
|
-
schema: 'network.xyo.boundwitness',
|
|
37
|
-
} as Payload,
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const WithData = Template.bind({})
|
|
41
|
-
WithData.args = { payload: sampleAddressHistory[1] }
|
|
42
|
-
|
|
43
|
-
const WithNestedBWPayloads = Template.bind({})
|
|
44
|
-
WithNestedBWPayloads.args = {
|
|
45
|
-
payload: {
|
|
46
|
-
$signatures: ['2a6c7e55d2344ec4f839296fcdc88b11dd27b474e832e1227d956838247d7183c2d47c24b4fe1b07c623e039c78babb08f1f12131747673175475c1abf0f719f'],
|
|
47
|
-
addresses: ['db8af7b3084f5a03589af4915e37cbeb3f19afb0'],
|
|
48
|
-
payload_hashes: [
|
|
49
|
-
'1d31053d99a3392f717c7f775df5fc0f999725fb57d705ddcbc01ee4f7288b6d',
|
|
50
|
-
'29fd0b9b3207a55be2bff6022176c041863c7074eb573e103fe571295d263952',
|
|
51
|
-
'c8ab93c970f4ef0d68ee22efd0119f228c089ae77551eda6e707b24bcec589ec',
|
|
52
|
-
],
|
|
53
|
-
payload_schemas: ['network.xyo.boundwitness', 'network.xyo.id', 'network.xyo.query.archivist.insert'],
|
|
54
|
-
previous_hashes: ['d67b91381ca8015613361470ff3e5dad3618d0ba471af21a1db89b0024c9322e'],
|
|
55
|
-
query: 'c8ab93c970f4ef0d68ee22efd0119f228c089ae77551eda6e707b24bcec589ec',
|
|
56
|
-
schema: 'network.xyo.boundwitness.query',
|
|
57
|
-
timestamp: 1_676_043_487_737,
|
|
58
|
-
} as Payload,
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export {
|
|
62
|
-
Default, WithData, WithNestedBWPayloads, WithNoData,
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export default StorybookEntry
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { Divider } from '@mui/material'
|
|
2
|
-
import type { FlexBoxProps } from '@xylabs/react-flexbox'
|
|
3
|
-
import { FlexCol } from '@xylabs/react-flexbox'
|
|
4
|
-
import type { BoundWitness } from '@xyo-network/boundwitness-model'
|
|
5
|
-
import { BoundWitnessSchema } from '@xyo-network/boundwitness-model'
|
|
6
|
-
import type { PayloadDetailsListRenderProps, PayloadDetailsRenderProps } from '@xyo-network/react-payload-plugin'
|
|
7
|
-
import { usePayloadHash } from '@xyo-network/react-shared'
|
|
8
|
-
import { TableHeightProvider } from '@xyo-network/react-table'
|
|
9
|
-
import React, { useMemo } from 'react'
|
|
10
|
-
import { FaSignature } from 'react-icons/fa'
|
|
11
|
-
import { VscSymbolMethod, VscSymbolNamespace } from 'react-icons/vsc'
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
BoundWitnessPayloadsTable,
|
|
15
|
-
BoundWitnessPayloadsTableForBWs,
|
|
16
|
-
BoundWitnessSignatureTable,
|
|
17
|
-
BWActions,
|
|
18
|
-
HashHeadingPaper,
|
|
19
|
-
HeadingPaper,
|
|
20
|
-
} from '../../_shared/index.ts'
|
|
21
|
-
|
|
22
|
-
const BoundWitnessDetailsBox: React.FC<PayloadDetailsListRenderProps & FlexBoxProps> = ({ visibleRows, ...props }) => {
|
|
23
|
-
return (
|
|
24
|
-
<TableHeightProvider defaultVisibleRows={visibleRows} additionalRows={1}>
|
|
25
|
-
<BoundWitnessDetailsBoxInner {...props} />
|
|
26
|
-
</TableHeightProvider>
|
|
27
|
-
)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
BoundWitnessDetailsBox.displayName = 'BoundWitnessDetailsBox'
|
|
31
|
-
|
|
32
|
-
const BoundWitnessDetailsBoxInner: React.FC<PayloadDetailsRenderProps & FlexBoxProps> = ({ payload, ...props }) => {
|
|
33
|
-
const boundWitness = payload as BoundWitness
|
|
34
|
-
const partialBoundWitness = boundWitness as Partial<BoundWitness>
|
|
35
|
-
const hash = usePayloadHash(payload)
|
|
36
|
-
|
|
37
|
-
const hasBWPayloads = useMemo(() => (partialBoundWitness ? partialBoundWitness.payload_schemas?.includes(BoundWitnessSchema) : false), [partialBoundWitness])
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<FlexCol alignItems="stretch" rowGap={4} {...props}>
|
|
41
|
-
<HashHeadingPaper
|
|
42
|
-
hash={hash}
|
|
43
|
-
paperProps={{ sx: { p: 2 } }}
|
|
44
|
-
AdornmentEnd={<BWActions boundwitness={boundWitness} />}
|
|
45
|
-
identiconProps={{ p: 0.75, size: 24 }}
|
|
46
|
-
/>
|
|
47
|
-
<Divider flexItem />
|
|
48
|
-
<FlexCol alignItems="stretch" rowGap={1} mb={1}>
|
|
49
|
-
<HeadingPaper IconComponent={<VscSymbolNamespace />} heading="Payloads" />
|
|
50
|
-
<BoundWitnessPayloadsTable boundwitness={boundWitness} />
|
|
51
|
-
</FlexCol>
|
|
52
|
-
{hasBWPayloads
|
|
53
|
-
? (
|
|
54
|
-
<FlexCol alignItems="stretch" rowGap={1} mb={1}>
|
|
55
|
-
<HeadingPaper IconComponent={<VscSymbolMethod />} heading="Bound Witnesses" />
|
|
56
|
-
<BoundWitnessPayloadsTableForBWs boundwitness={boundWitness} />
|
|
57
|
-
</FlexCol>
|
|
58
|
-
)
|
|
59
|
-
: null}
|
|
60
|
-
<FlexCol alignItems="stretch" rowGap={1} mb={1}>
|
|
61
|
-
<HeadingPaper IconComponent={<FaSignature />} heading="Signatures" />
|
|
62
|
-
<BoundWitnessSignatureTable block={boundWitness} />
|
|
63
|
-
</FlexCol>
|
|
64
|
-
</FlexCol>
|
|
65
|
-
)
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
BoundWitnessDetailsBoxInner.displayName = 'BoundWitnessDetailsBoxInner'
|
|
69
|
-
|
|
70
|
-
export { BoundWitnessDetailsBox }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './DetailsBox.tsx'
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
Decorator, Meta, StoryFn,
|
|
3
|
-
} from '@storybook/react'
|
|
4
|
-
import { useEvent } from '@xyo-network/react-event'
|
|
5
|
-
import { sampleBlock } from '@xyo-network/react-storybook'
|
|
6
|
-
import React, { useRef } from 'react'
|
|
7
|
-
|
|
8
|
-
import { BoundWitnessDetailsCard } from './DetailsCard.tsx'
|
|
9
|
-
|
|
10
|
-
const WithEventDecorator: Decorator = (Story, args) => {
|
|
11
|
-
const ref = useRef<HTMLDivElement | null>(null)
|
|
12
|
-
const [tableRef] = useEvent<HTMLDivElement>((noun, verb, data) => console.log(`${noun}|${verb}|${data}`), ref)
|
|
13
|
-
args.args.ref = tableRef
|
|
14
|
-
|
|
15
|
-
return <Story {...args} />
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export default {
|
|
19
|
-
component: BoundWitnessDetailsCard,
|
|
20
|
-
title: 'plugin/boundwitness/DetailsCard',
|
|
21
|
-
} as Meta
|
|
22
|
-
|
|
23
|
-
const Template: StoryFn<typeof BoundWitnessDetailsCard> = props => <BoundWitnessDetailsCard {...props} />
|
|
24
|
-
|
|
25
|
-
const Default = Template.bind({})
|
|
26
|
-
Default.args = { payload: sampleBlock }
|
|
27
|
-
|
|
28
|
-
const WithRef = Template.bind({})
|
|
29
|
-
WithRef.decorators = [WithEventDecorator]
|
|
30
|
-
WithRef.args = { payload: sampleBlock }
|
|
31
|
-
|
|
32
|
-
const WithVisibleRows = Template.bind({})
|
|
33
|
-
WithVisibleRows.args = { payload: sampleBlock, visibleRows: 3 }
|
|
34
|
-
|
|
35
|
-
export {
|
|
36
|
-
Default, WithRef, WithVisibleRows,
|
|
37
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { CardProps } from '@mui/material'
|
|
2
|
-
import type { PayloadDetailsListRenderProps } from '@xyo-network/react-payload-plugin'
|
|
3
|
-
import { TableHeightProvider } from '@xyo-network/react-table'
|
|
4
|
-
import React from 'react'
|
|
5
|
-
|
|
6
|
-
import { BoundWitnessDetailsCardInner } from './DetailsCardInner.tsx'
|
|
7
|
-
|
|
8
|
-
const BoundWitnessDetailsCard = ({
|
|
9
|
-
ref, visibleRows, ...props
|
|
10
|
-
}: PayloadDetailsListRenderProps & CardProps & { ref?: React.Ref<HTMLDivElement | null> }) => {
|
|
11
|
-
return (
|
|
12
|
-
<TableHeightProvider defaultVisibleRows={visibleRows} additionalRows={1}>
|
|
13
|
-
<BoundWitnessDetailsCardInner ref={ref} {...props} />
|
|
14
|
-
</TableHeightProvider>
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
BoundWitnessDetailsCard.displayName = 'BoundWitnessDetailsCard'
|
|
19
|
-
|
|
20
|
-
export { BoundWitnessDetailsCard }
|