@xyo-network/react-chain-blockchain 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.mjs +175 -147
- package/dist/browser/index.mjs.map +1 -1
- package/dist/types/components/FeatureNotAvailable.d.ts +6 -0
- package/dist/types/components/FeatureNotAvailable.d.ts.map +1 -0
- package/dist/types/components/block/table/cell/Hash.d.ts +1 -0
- package/dist/types/components/block/table/cell/Hash.d.ts.map +1 -1
- package/dist/types/components/block/table/cell/JsonView.d.ts.map +1 -1
- package/dist/types/components/block/table/cell/Producer.d.ts +1 -0
- package/dist/types/components/block/table/cell/Producer.d.ts.map +1 -1
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/index.d.ts.map +1 -1
- package/package.json +21 -21
- package/src/components/FeatureNotAvailable.tsx +20 -0
- package/src/components/block/table/cell/Hash.tsx +9 -2
- package/src/components/block/table/cell/JsonView.tsx +2 -0
- package/src/components/block/table/cell/Producer.tsx +8 -2
- package/src/components/block/table/row/TableRow.tsx +2 -2
- package/src/components/index.ts +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeatureNotAvailable.d.ts","sourceRoot":"","sources":["../../../src/components/FeatureNotAvailable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEiC,KAAK,WAAW,EACvD,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG/B,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,WAAW,GAAG;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAY1E,CAAA"}
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import type { BlockTableCellProps } from './lib/index.ts';
|
|
4
4
|
export interface BlockHashTableCellProps extends BlockTableCellProps {
|
|
5
5
|
identiconProps?: IdenticonProps;
|
|
6
|
+
notAvailableDialog?: boolean;
|
|
6
7
|
}
|
|
7
8
|
export declare const BlockHashTableCell: React.FC<BlockHashTableCellProps>;
|
|
8
9
|
//# sourceMappingURL=Hash.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hash.d.ts","sourceRoot":"","sources":["../../../../../../src/components/block/table/cell/Hash.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAG7D,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Hash.d.ts","sourceRoot":"","sources":["../../../../../../src/components/block/table/cell/Hash.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAG7D,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAEzD,MAAM,WAAW,uBAAwB,SAAQ,mBAAmB;IAClE,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B;AAED,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAqChE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonView.d.ts","sourceRoot":"","sources":["../../../../../../src/components/block/table/cell/JsonView.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"JsonView.d.ts","sourceRoot":"","sources":["../../../../../../src/components/block/table/cell/JsonView.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAEvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAEzD,MAAM,WAAW,2BAA4B,SAAQ,mBAAmB;CAAG;AAE3E,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CA6BxE,CAAA"}
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { BlockProducerChipProps } from '../../ProducerChip.tsx';
|
|
3
3
|
import type { BlockTableCellProps } from './lib/index.ts';
|
|
4
4
|
export interface BlockProducerTableCell extends BlockTableCellProps {
|
|
5
|
+
notAvailableDialog?: boolean;
|
|
5
6
|
producerChipProps?: BlockProducerChipProps;
|
|
6
7
|
}
|
|
7
8
|
export declare const BlockProducerTableCell: React.FC<BlockProducerTableCell>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Producer.d.ts","sourceRoot":"","sources":["../../../../../../src/components/block/table/cell/Producer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Producer.d.ts","sourceRoot":"","sources":["../../../../../../src/components/block/table/cell/Producer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAGpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAEzD,MAAM,WAAW,sBAAuB,SAAQ,mBAAmB;IACjE,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,iBAAiB,CAAC,EAAE,sBAAsB,CAAA;CAC3C;AAED,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAmBnE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,yBAAyB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,2BAA2B,CAAA;AACzC,cAAc,oBAAoB,CAAA;AAClC,cAAc,yBAAyB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@xyo-network/react-chain-blockchain",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.3",
|
|
5
5
|
"description": "XYO Layer One React SDK Blockchain",
|
|
6
6
|
"homepage": "https://xylabs.com",
|
|
7
7
|
"bugs": {
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
"module": "dist/browser/index.mjs",
|
|
35
35
|
"types": "dist/types/index.d.ts",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@xylabs/assert": "^4.8.
|
|
38
|
-
"@xylabs/axios": "^4.8.
|
|
39
|
-
"@xylabs/eth-address": "^4.8.
|
|
40
|
-
"@xylabs/exists": "^4.8.
|
|
41
|
-
"@xylabs/hex": "^4.8.
|
|
42
|
-
"@xylabs/promise": "^4.8.
|
|
37
|
+
"@xylabs/assert": "^4.8.5",
|
|
38
|
+
"@xylabs/axios": "^4.8.5",
|
|
39
|
+
"@xylabs/eth-address": "^4.8.5",
|
|
40
|
+
"@xylabs/exists": "^4.8.5",
|
|
41
|
+
"@xylabs/hex": "^4.8.5",
|
|
42
|
+
"@xylabs/promise": "^4.8.5",
|
|
43
43
|
"@xylabs/react-animation": "^6.1.15",
|
|
44
44
|
"@xylabs/react-error": "^6.1.15",
|
|
45
45
|
"@xylabs/react-flexbox": "^6.1.15",
|
|
@@ -52,20 +52,20 @@
|
|
|
52
52
|
"@xyo-network/boundwitness-builder": "^3.12.3",
|
|
53
53
|
"@xyo-network/boundwitness-model": "^3.12.3",
|
|
54
54
|
"@xyo-network/bridge-http": "^3.12.3",
|
|
55
|
-
"@xyo-network/chain-ethereum": "^1.2.
|
|
56
|
-
"@xyo-network/chain-protocol": "^1.2.
|
|
57
|
-
"@xyo-network/chain-services": "^1.2.
|
|
55
|
+
"@xyo-network/chain-ethereum": "^1.2.3",
|
|
56
|
+
"@xyo-network/chain-protocol": "^1.2.3",
|
|
57
|
+
"@xyo-network/chain-services": "^1.2.3",
|
|
58
58
|
"@xyo-network/module-model": "^3.12.3",
|
|
59
59
|
"@xyo-network/payload-builder": "^3.12.3",
|
|
60
60
|
"@xyo-network/payload-model": "^3.12.3",
|
|
61
|
-
"@xyo-network/react-chain-blockies": "^1.2.
|
|
62
|
-
"@xyo-network/react-chain-boundwitness": "^1.2.
|
|
63
|
-
"@xyo-network/react-event": "^5.1.
|
|
64
|
-
"@xyo-network/react-payload-raw-info": "^5.1.
|
|
65
|
-
"@xyo-network/react-payload-table": "^5.1.
|
|
66
|
-
"@xyo-network/react-shared": "^5.1.
|
|
67
|
-
"@xyo-network/react-table": "^5.1.
|
|
68
|
-
"@xyo-network/xl1-model": "^1.2.
|
|
61
|
+
"@xyo-network/react-chain-blockies": "^1.2.3",
|
|
62
|
+
"@xyo-network/react-chain-boundwitness": "^1.2.3",
|
|
63
|
+
"@xyo-network/react-event": "^5.1.4",
|
|
64
|
+
"@xyo-network/react-payload-raw-info": "^5.1.4",
|
|
65
|
+
"@xyo-network/react-payload-table": "^5.1.4",
|
|
66
|
+
"@xyo-network/react-shared": "^5.1.4",
|
|
67
|
+
"@xyo-network/react-table": "^5.1.4",
|
|
68
|
+
"@xyo-network/xl1-model": "^1.2.3"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@emotion/react": "^11.14.0",
|
|
@@ -74,12 +74,12 @@
|
|
|
74
74
|
"@mui/material": "^7.0.2",
|
|
75
75
|
"@storybook/react": "^8.6.12",
|
|
76
76
|
"@types/react": "^19.1.1",
|
|
77
|
-
"@xylabs/delay": "^4.8.
|
|
78
|
-
"@xylabs/hex": "^4.8.
|
|
77
|
+
"@xylabs/delay": "^4.8.5",
|
|
78
|
+
"@xylabs/hex": "^4.8.5",
|
|
79
79
|
"@xylabs/ts-scripts-yarn3": "^6.2.1",
|
|
80
80
|
"@xylabs/tsconfig-react": "^6.2.1",
|
|
81
81
|
"@xyo-network/archivist-memory": "^3.12.3",
|
|
82
|
-
"@xyo-network/chain-utils": "^1.2.
|
|
82
|
+
"@xyo-network/chain-utils": "^1.2.3",
|
|
83
83
|
"react": "^19.1.0",
|
|
84
84
|
"react-dom": "^19.1.0",
|
|
85
85
|
"react-router-dom": "^7.5.0",
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Button,
|
|
3
|
+
Dialog, DialogActions, DialogContent, type DialogProps, DialogTitle,
|
|
4
|
+
} from '@mui/material'
|
|
5
|
+
import type { FC } from 'react'
|
|
6
|
+
import React from 'react'
|
|
7
|
+
|
|
8
|
+
export const FeatureNotAvailable: FC<DialogProps & { featureName?: string }> = ({ featureName = 'Feature', ...props }) => (
|
|
9
|
+
<Dialog {...props}>
|
|
10
|
+
<DialogTitle>
|
|
11
|
+
{`${featureName} Not Available`}
|
|
12
|
+
</DialogTitle>
|
|
13
|
+
<DialogContent>This feature is not currently available. Either you do not have access to it or it is currently undergoing maintenance.</DialogContent>
|
|
14
|
+
<DialogActions>
|
|
15
|
+
<Button onClick={e => props.onClose?.(e, 'backdropClick')}>
|
|
16
|
+
Close
|
|
17
|
+
</Button>
|
|
18
|
+
</DialogActions>
|
|
19
|
+
</Dialog>
|
|
20
|
+
)
|
|
@@ -8,19 +8,22 @@ import { Identicon } from '@xylabs/react-identicon'
|
|
|
8
8
|
import { usePayloadHash } from '@xyo-network/react-shared'
|
|
9
9
|
import React from 'react'
|
|
10
10
|
|
|
11
|
+
import { FeatureNotAvailable } from '../../../FeatureNotAvailable.tsx'
|
|
11
12
|
import { useLinkedBlockItem } from './hooks/index.ts'
|
|
12
13
|
import type { BlockTableCellProps } from './lib/index.ts'
|
|
13
14
|
|
|
14
15
|
export interface BlockHashTableCellProps extends BlockTableCellProps {
|
|
15
16
|
identiconProps?: IdenticonProps
|
|
17
|
+
notAvailableDialog?: boolean
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
export const BlockHashTableCell: React.FC<BlockHashTableCellProps> = ({
|
|
19
|
-
block, identiconProps, linked, ...props
|
|
21
|
+
block, identiconProps, notAvailableDialog, linked, ...props
|
|
20
22
|
}) => {
|
|
21
23
|
const hash = usePayloadHash(block?.[0])
|
|
22
24
|
|
|
23
25
|
const [ref, handleClick] = useLinkedBlockItem('block-hash', hash)
|
|
26
|
+
const [notAvailable, setNotAvailable] = React.useState(false)
|
|
24
27
|
|
|
25
28
|
const shortenedHash = hash ? `${hash.slice(0, 4)}...${hash.slice(-5, -1)}` : ''
|
|
26
29
|
|
|
@@ -39,12 +42,16 @@ export const BlockHashTableCell: React.FC<BlockHashTableCellProps> = ({
|
|
|
39
42
|
/>
|
|
40
43
|
</Avatar>
|
|
41
44
|
)}
|
|
45
|
+
sx={{ cursor: 'pointer' }}
|
|
42
46
|
label={shortenedHash}
|
|
43
|
-
onClick={linked ? handleClick :
|
|
47
|
+
onClick={linked ? handleClick : () => setNotAvailable(true)}
|
|
44
48
|
/>
|
|
45
49
|
</Tooltip>
|
|
46
50
|
)
|
|
47
51
|
: null}
|
|
52
|
+
{(notAvailableDialog && notAvailable)
|
|
53
|
+
? <FeatureNotAvailable featureName="Block Details" open={notAvailable} onClick={() => setNotAvailable(false)} />
|
|
54
|
+
: null}
|
|
48
55
|
</TableCell>
|
|
49
56
|
)
|
|
50
57
|
}
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
} from '@mui/material'
|
|
6
6
|
import { ellipsize } from '@xylabs/eth-address'
|
|
7
7
|
import { FlexRow } from '@xylabs/react-flexbox'
|
|
8
|
+
import { useIsDark } from '@xylabs/react-theme'
|
|
8
9
|
import { JsonViewerEx } from '@xyo-network/react-payload-raw-info'
|
|
9
10
|
import { usePayloadHash } from '@xyo-network/react-shared'
|
|
10
11
|
import React, { useState } from 'react'
|
|
@@ -16,6 +17,7 @@ export interface BlockJsonViewTableCellProps extends BlockTableCellProps {}
|
|
|
16
17
|
export const BlockJsonViewTableCell: React.FC<BlockJsonViewTableCellProps> = ({ block, ...props }) => {
|
|
17
18
|
const [open, setOpen] = useState(false)
|
|
18
19
|
const onClose = () => setOpen(false)
|
|
20
|
+
const isDark = useIsDark()
|
|
19
21
|
|
|
20
22
|
const hash = usePayloadHash(block?.[0])
|
|
21
23
|
const title = hash ? `JSON for ${ellipsize(hash, 5)}` : 'JSON'
|
|
@@ -2,6 +2,7 @@ import { TableCell, Tooltip } from '@mui/material'
|
|
|
2
2
|
import { FlexRow } from '@xylabs/react-flexbox'
|
|
3
3
|
import React from 'react'
|
|
4
4
|
|
|
5
|
+
import { FeatureNotAvailable } from '../../../FeatureNotAvailable.tsx'
|
|
5
6
|
import { useBlockProducer } from '../../hooks/index.ts'
|
|
6
7
|
import type { BlockProducerChipProps } from '../../ProducerChip.tsx'
|
|
7
8
|
import { BlockProducerChip } from '../../ProducerChip.tsx'
|
|
@@ -9,22 +10,27 @@ import { useLinkedBlockItem } from './hooks/index.ts'
|
|
|
9
10
|
import type { BlockTableCellProps } from './lib/index.ts'
|
|
10
11
|
|
|
11
12
|
export interface BlockProducerTableCell extends BlockTableCellProps {
|
|
13
|
+
notAvailableDialog?: boolean
|
|
12
14
|
producerChipProps?: BlockProducerChipProps
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
export const BlockProducerTableCell: React.FC<BlockProducerTableCell> = ({
|
|
16
|
-
block, linked, producerChipProps, ...props
|
|
18
|
+
block, linked, notAvailableDialog, producerChipProps, ...props
|
|
17
19
|
}) => {
|
|
18
20
|
const [ref, handleClick] = useLinkedBlockItem('block-producer', JSON.stringify(block))
|
|
19
21
|
const producer = useBlockProducer(block)
|
|
22
|
+
const [notAvailable, setNotAvailable] = React.useState(false)
|
|
20
23
|
|
|
21
24
|
return (
|
|
22
25
|
<TableCell ref={ref} {...props}>
|
|
23
26
|
<Tooltip title={`Block Producer: ${producer}`}>
|
|
24
27
|
<FlexRow sx={{ width: '100%' }}>
|
|
25
|
-
<BlockProducerChip onClick={linked ? handleClick :
|
|
28
|
+
<BlockProducerChip sx={{ cursor: 'pointer' }} onClick={linked ? handleClick : () => setNotAvailable(true)} block={block} {...producerChipProps} />
|
|
26
29
|
</FlexRow>
|
|
27
30
|
</Tooltip>
|
|
31
|
+
{(notAvailableDialog && notAvailable)
|
|
32
|
+
? <FeatureNotAvailable featureName="Producer Details" open={notAvailable} onClick={() => setNotAvailable(false)} />
|
|
33
|
+
: null}
|
|
28
34
|
</TableCell>
|
|
29
35
|
)
|
|
30
36
|
}
|
|
@@ -20,10 +20,10 @@ export const BlockChainTableRow: React.FC<BlockChainTableRowProps> = ({
|
|
|
20
20
|
const defaultTableCellProps = useMemo(() => ({ block }), [block])
|
|
21
21
|
return (
|
|
22
22
|
<TableRow sx={{ overflowY: 'scroll', ...sx }} {...props}>
|
|
23
|
-
<BlockHashTableCell {...
|
|
23
|
+
<BlockHashTableCell {...linkedTableCellProps} />
|
|
24
24
|
<BlockNumberTableCell {...linkedTableCellProps} />
|
|
25
25
|
<BlockTransactionCountTableCell {...linkedTableCellProps} />
|
|
26
|
-
<BlockProducerTableCell {...
|
|
26
|
+
<BlockProducerTableCell {...linkedTableCellProps} />
|
|
27
27
|
<BlockVerificationTableCell {...defaultTableCellProps} />
|
|
28
28
|
<BlockJsonViewTableCell {...defaultTableCellProps} />
|
|
29
29
|
</TableRow>
|