@xyo-network/react-node-renderer 2.76.2 → 2.76.4
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/package.json +26 -26
- package/src/components/module/graph/GraphFlexBox.stories.tsx +14 -12
- package/src/components/relational/graph/Graph.stories.tsx +15 -13
- package/src/components/relational/graph/GraphCola.stories.tsx +4 -4
- package/src/components/relational/graph/GraphCoseBilkent.stories.tsx +3 -3
- package/src/components/relational/graph/GraphDagre.stories.tsx +4 -4
- package/src/components/relational/graph/GraphEuler.stories.tsx +5 -5
package/package.json
CHANGED
|
@@ -10,25 +10,25 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xylabs/exists": "^3.3.
|
|
13
|
+
"@xylabs/exists": "^3.3.3",
|
|
14
14
|
"@xylabs/react-async-effect": "^3.1.7",
|
|
15
15
|
"@xylabs/react-flexbox": "^3.1.7",
|
|
16
16
|
"@xylabs/react-identicon": "^3.1.7",
|
|
17
17
|
"@xylabs/react-promise": "^3.1.7",
|
|
18
18
|
"@xylabs/react-shared": "^3.1.7",
|
|
19
|
-
"@xyo-network/account-model": "^2.
|
|
20
|
-
"@xyo-network/archivist-model": "^2.
|
|
21
|
-
"@xyo-network/bridge-model": "^2.
|
|
22
|
-
"@xyo-network/diviner-model": "^2.
|
|
23
|
-
"@xyo-network/module-events": "^2.
|
|
24
|
-
"@xyo-network/module-model": "^2.
|
|
25
|
-
"@xyo-network/node-model": "^2.
|
|
26
|
-
"@xyo-network/react-archivist": "~2.76.
|
|
27
|
-
"@xyo-network/react-module": "~2.76.
|
|
28
|
-
"@xyo-network/react-node": "~2.76.
|
|
29
|
-
"@xyo-network/react-shared": "~2.76.
|
|
30
|
-
"@xyo-network/sentinel-model": "^2.
|
|
31
|
-
"@xyo-network/witness-model": "^2.
|
|
19
|
+
"@xyo-network/account-model": "^2.102.5",
|
|
20
|
+
"@xyo-network/archivist-model": "^2.102.5",
|
|
21
|
+
"@xyo-network/bridge-model": "^2.102.5",
|
|
22
|
+
"@xyo-network/diviner-model": "^2.102.5",
|
|
23
|
+
"@xyo-network/module-events": "^2.102.5",
|
|
24
|
+
"@xyo-network/module-model": "^2.102.5",
|
|
25
|
+
"@xyo-network/node-model": "^2.102.5",
|
|
26
|
+
"@xyo-network/react-archivist": "~2.76.4",
|
|
27
|
+
"@xyo-network/react-module": "~2.76.4",
|
|
28
|
+
"@xyo-network/react-node": "~2.76.4",
|
|
29
|
+
"@xyo-network/react-shared": "~2.76.4",
|
|
30
|
+
"@xyo-network/sentinel-model": "^2.102.5",
|
|
31
|
+
"@xyo-network/witness-model": "^2.102.5",
|
|
32
32
|
"cytoscape": "^3.29.2",
|
|
33
33
|
"cytoscape-cola": "^2.5.1",
|
|
34
34
|
"cytoscape-cose-bilkent": "^4.1.0",
|
|
@@ -44,20 +44,20 @@
|
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@storybook/react": "^7.6.19",
|
|
47
|
-
"@types/cytoscape": "^3.21.
|
|
47
|
+
"@types/cytoscape": "^3.21.1",
|
|
48
48
|
"@types/cytoscape-dagre": "^2.3.3",
|
|
49
49
|
"@types/cytoscape-euler": "^1.2.3",
|
|
50
50
|
"@types/react-dom": "^18.3.0",
|
|
51
|
-
"@xylabs/ts-scripts-yarn3": "^3.10.
|
|
52
|
-
"@xylabs/tsconfig-react": "^3.10.
|
|
53
|
-
"@xyo-network/archivist": "^2.
|
|
54
|
-
"@xyo-network/bridge-
|
|
55
|
-
"@xyo-network/
|
|
56
|
-
"@xyo-network/id-plugin": "^2.
|
|
57
|
-
"@xyo-network/node-memory": "^2.
|
|
58
|
-
"@xyo-network/react-storybook": "~2.76.
|
|
59
|
-
"@xyo-network/react-wallet": "~2.76.
|
|
60
|
-
"@xyo-network/sentinel": "^2.
|
|
51
|
+
"@xylabs/ts-scripts-yarn3": "^3.10.4",
|
|
52
|
+
"@xylabs/tsconfig-react": "^3.10.4",
|
|
53
|
+
"@xyo-network/archivist": "^2.102.5",
|
|
54
|
+
"@xyo-network/bridge-http": "^2.102.5",
|
|
55
|
+
"@xyo-network/bridge-model": "^2.102.5",
|
|
56
|
+
"@xyo-network/id-plugin": "^2.95.2",
|
|
57
|
+
"@xyo-network/node-memory": "^2.102.5",
|
|
58
|
+
"@xyo-network/react-storybook": "~2.76.4",
|
|
59
|
+
"@xyo-network/react-wallet": "~2.76.4",
|
|
60
|
+
"@xyo-network/sentinel": "^2.102.5",
|
|
61
61
|
"typescript": "^5.4.5"
|
|
62
62
|
},
|
|
63
63
|
"description": "Common React library for all XYO projects that use React",
|
|
@@ -111,6 +111,6 @@
|
|
|
111
111
|
},
|
|
112
112
|
"sideEffects": false,
|
|
113
113
|
"types": "dist/browser/index.d.ts",
|
|
114
|
-
"version": "2.76.
|
|
114
|
+
"version": "2.76.4",
|
|
115
115
|
"type": "module"
|
|
116
116
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import { Button, ButtonGroup } from '@mui/material'
|
|
1
2
|
import { Decorator, Meta, StoryFn } from '@storybook/react'
|
|
2
3
|
import { useAsyncEffect } from '@xylabs/react-async-effect'
|
|
3
4
|
import { MemoryArchivist, MemoryArchivistConfigSchema } from '@xyo-network/archivist'
|
|
4
|
-
import { HttpBridge, HttpBridgeConfigSchema } from '@xyo-network/http
|
|
5
|
+
import { HttpBridge, HttpBridgeConfigSchema } from '@xyo-network/bridge-http'
|
|
5
6
|
import { MemoryNode } from '@xyo-network/node-memory'
|
|
6
7
|
import { NodeConfigSchema } from '@xyo-network/node-model'
|
|
7
|
-
import { NodeProvider,
|
|
8
|
+
import { NodeProvider, useWeakProvidedNode } from '@xyo-network/react-node'
|
|
8
9
|
import { DefaultSeedPhrase } from '@xyo-network/react-storybook'
|
|
9
10
|
import { useWallet, WalletProvider } from '@xyo-network/react-wallet'
|
|
10
11
|
import { MemorySentinel, SentinelConfigSchema } from '@xyo-network/sentinel'
|
|
11
12
|
import { useState } from 'react'
|
|
12
13
|
|
|
13
14
|
import { ModuleGraphFlexBoxWithProvider } from './GraphFlexBox'
|
|
14
|
-
import { Button, ButtonGroup } from '@mui/material'
|
|
15
15
|
|
|
16
16
|
const nodeUrl = 'http://localhost:8080/node'
|
|
17
17
|
|
|
@@ -77,15 +77,17 @@ const Template: StoryFn<typeof ModuleGraphFlexBoxWithProvider> = (props) => <Mod
|
|
|
77
77
|
const TemplateWithProvidedModule: StoryFn<typeof ModuleGraphFlexBoxWithProvider> = (props) => {
|
|
78
78
|
const [node] = useWeakProvidedNode()
|
|
79
79
|
const [layout, setLayout] = useState<'dagre' | 'euler' | 'cose-bilkent' | 'cola'>('euler')
|
|
80
|
-
return
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
80
|
+
return (
|
|
81
|
+
<div>
|
|
82
|
+
<ButtonGroup>
|
|
83
|
+
<Button onClick={() => setLayout('dagre')}>Dagre</Button>
|
|
84
|
+
<Button onClick={() => setLayout('euler')}>Euler</Button>
|
|
85
|
+
<Button onClick={() => setLayout('cose-bilkent')}>CoseBilkent</Button>
|
|
86
|
+
<Button onClick={() => setLayout('cola')}>Cola</Button>
|
|
87
|
+
</ButtonGroup>
|
|
88
|
+
<ModuleGraphFlexBoxWithProvider rootModule={node} {...props} layout={layout} />
|
|
89
|
+
</div>
|
|
90
|
+
)
|
|
89
91
|
}
|
|
90
92
|
|
|
91
93
|
const defaultProps = {
|
|
@@ -2,11 +2,11 @@ import { Button, ButtonGroup } from '@mui/material'
|
|
|
2
2
|
import { Decorator, Meta, StoryFn } from '@storybook/react'
|
|
3
3
|
import { useAsyncEffect } from '@xylabs/react-async-effect'
|
|
4
4
|
import { MemoryArchivist, MemoryArchivistConfigSchema } from '@xyo-network/archivist'
|
|
5
|
-
import { HttpBridge, HttpBridgeConfigSchema } from '@xyo-network/http
|
|
5
|
+
import { HttpBridge, HttpBridgeConfigSchema } from '@xyo-network/bridge-http'
|
|
6
6
|
import { IdWitness, IdWitnessConfigSchema } from '@xyo-network/id-plugin'
|
|
7
7
|
import { MemoryNode } from '@xyo-network/node-memory'
|
|
8
8
|
import { NodeConfigSchema } from '@xyo-network/node-model'
|
|
9
|
-
import { NodeProvider,
|
|
9
|
+
import { NodeProvider, useWeakNodeFromNode, useWeakProvidedNode } from '@xyo-network/react-node'
|
|
10
10
|
import { DefaultSeedPhrase } from '@xyo-network/react-storybook'
|
|
11
11
|
import { useWallet, WalletProvider } from '@xyo-network/react-wallet'
|
|
12
12
|
import { MemorySentinel, SentinelConfigSchema } from '@xyo-network/sentinel'
|
|
@@ -92,21 +92,23 @@ const TemplateCustomAddress: StoryFn<typeof NodeRelationalGraphFlexBox> = (props
|
|
|
92
92
|
const [node] = useWeakNodeFromNode('ChildNode')
|
|
93
93
|
const elements = useCytoscapeElements(node)
|
|
94
94
|
const options = useCytoscapeOptions(elements)
|
|
95
|
-
|
|
95
|
+
|
|
96
96
|
return <NodeRelationalGraphFlexBox options={options} {...props} />
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
const TemplateProvidedNodeRenderer: StoryFn<typeof ProvidedNodeRenderer> = (props) => {
|
|
100
100
|
const [layout, setLayout] = useState<'dagre' | 'euler' | 'cose-bilkent' | 'cola'>('euler')
|
|
101
|
-
return
|
|
102
|
-
<
|
|
103
|
-
<
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
101
|
+
return (
|
|
102
|
+
<div>
|
|
103
|
+
<ButtonGroup>
|
|
104
|
+
<Button onClick={() => setLayout('dagre')}>Dagre</Button>
|
|
105
|
+
<Button onClick={() => setLayout('euler')}>Euler</Button>
|
|
106
|
+
<Button onClick={() => setLayout('cose-bilkent')}>CoseBilkent</Button>
|
|
107
|
+
<Button onClick={() => setLayout('cola')}>Cola</Button>
|
|
108
|
+
</ButtonGroup>
|
|
109
|
+
<ProvidedNodeRenderer {...props} layout={layout} />
|
|
110
|
+
</div>
|
|
111
|
+
)
|
|
110
112
|
}
|
|
111
113
|
|
|
112
114
|
const TemplateAttachDetach: StoryFn<typeof NodeRelationalGraphFlexBox> = (props) => {
|
|
@@ -136,7 +138,7 @@ const TemplateAttachDetach: StoryFn<typeof NodeRelationalGraphFlexBox> = (props)
|
|
|
136
138
|
const handleRemoveWitness = async () => {
|
|
137
139
|
if (node && idWitness) {
|
|
138
140
|
const memoryNode = node.deref() as MemoryNode | undefined
|
|
139
|
-
if (memoryNode?.registered().includes(idWitness.address)) {
|
|
141
|
+
if (((await memoryNode?.registered()) ?? []).includes(idWitness.address)) {
|
|
140
142
|
await memoryNode?.unregister(idWitness)
|
|
141
143
|
}
|
|
142
144
|
}
|
|
@@ -2,11 +2,11 @@ import { Button, ButtonGroup } from '@mui/material'
|
|
|
2
2
|
import { Decorator, Meta, StoryFn } from '@storybook/react'
|
|
3
3
|
import { useAsyncEffect } from '@xylabs/react-async-effect'
|
|
4
4
|
import { MemoryArchivist, MemoryArchivistConfigSchema } from '@xyo-network/archivist'
|
|
5
|
-
import { HttpBridge, HttpBridgeConfigSchema } from '@xyo-network/http
|
|
5
|
+
import { HttpBridge, HttpBridgeConfigSchema } from '@xyo-network/bridge-http'
|
|
6
6
|
import { IdWitness, IdWitnessConfigSchema } from '@xyo-network/id-plugin'
|
|
7
7
|
import { MemoryNode } from '@xyo-network/node-memory'
|
|
8
8
|
import { NodeConfigSchema } from '@xyo-network/node-model'
|
|
9
|
-
import { NodeProvider,
|
|
9
|
+
import { NodeProvider, useWeakNodeFromNode, useWeakProvidedNode } from '@xyo-network/react-node'
|
|
10
10
|
import { DefaultSeedPhrase } from '@xyo-network/react-storybook'
|
|
11
11
|
import { useWallet, WalletProvider } from '@xyo-network/react-wallet'
|
|
12
12
|
import { MemorySentinel, SentinelConfigSchema } from '@xyo-network/sentinel'
|
|
@@ -14,10 +14,10 @@ import { useState } from 'react'
|
|
|
14
14
|
|
|
15
15
|
import { CytoscapeInstanceProvider } from '../../../contexts'
|
|
16
16
|
import { useCytoscapeElements, useCytoscapeOptions } from '../../../hooks'
|
|
17
|
+
import { WithExtensions } from '../../cytoscape-extensions'
|
|
17
18
|
import { NodeRelationalGraphFlexBox } from './Graph'
|
|
18
19
|
import { ProvidedNodeRenderer } from './ProvidedNodeRenderer'
|
|
19
20
|
import { options } from './story'
|
|
20
|
-
import { WithExtensions } from '../../cytoscape-extensions'
|
|
21
21
|
|
|
22
22
|
const nodeUrl = 'http://localhost:8080/node'
|
|
23
23
|
|
|
@@ -124,7 +124,7 @@ const TemplateAttachDetach: StoryFn<typeof NodeRelationalGraphFlexBox> = (props)
|
|
|
124
124
|
const handleRemoveWitness = async () => {
|
|
125
125
|
if (node && idWitness) {
|
|
126
126
|
const memoryNode = node.deref() as MemoryNode | undefined
|
|
127
|
-
if (memoryNode?.registered().includes(idWitness.address)) {
|
|
127
|
+
if (((await memoryNode?.registered()) ?? []).includes(idWitness.address)) {
|
|
128
128
|
await memoryNode?.unregister(idWitness)
|
|
129
129
|
}
|
|
130
130
|
}
|
|
@@ -2,7 +2,7 @@ import { Button, ButtonGroup } from '@mui/material'
|
|
|
2
2
|
import { Decorator, Meta, StoryFn } from '@storybook/react'
|
|
3
3
|
import { useAsyncEffect } from '@xylabs/react-async-effect'
|
|
4
4
|
import { MemoryArchivist, MemoryArchivistConfigSchema } from '@xyo-network/archivist'
|
|
5
|
-
import { HttpBridge, HttpBridgeConfigSchema } from '@xyo-network/http
|
|
5
|
+
import { HttpBridge, HttpBridgeConfigSchema } from '@xyo-network/bridge-http'
|
|
6
6
|
import { IdWitness, IdWitnessConfigSchema } from '@xyo-network/id-plugin'
|
|
7
7
|
import { MemoryNode } from '@xyo-network/node-memory'
|
|
8
8
|
import { NodeConfigSchema } from '@xyo-network/node-model'
|
|
@@ -14,10 +14,10 @@ import { useState } from 'react'
|
|
|
14
14
|
|
|
15
15
|
import { CytoscapeInstanceProvider } from '../../../contexts'
|
|
16
16
|
import { useCytoscapeElements, useCytoscapeOptions } from '../../../hooks'
|
|
17
|
+
import { WithExtensions } from '../../cytoscape-extensions'
|
|
17
18
|
import { NodeRelationalGraphFlexBox } from './Graph'
|
|
18
19
|
import { ProvidedNodeRenderer } from './ProvidedNodeRenderer'
|
|
19
20
|
import { options } from './story'
|
|
20
|
-
import { WithExtensions } from '../../cytoscape-extensions'
|
|
21
21
|
|
|
22
22
|
const nodeUrl = 'http://localhost:8080/node'
|
|
23
23
|
|
|
@@ -124,7 +124,7 @@ const TemplateAttachDetach: StoryFn<typeof NodeRelationalGraphFlexBox> = (props)
|
|
|
124
124
|
const handleRemoveWitness = async () => {
|
|
125
125
|
if (node && idWitness) {
|
|
126
126
|
const memoryNode = node.deref() as MemoryNode | undefined
|
|
127
|
-
if (memoryNode?.registered().includes(idWitness.address)) {
|
|
127
|
+
if (((await memoryNode?.registered()) ?? []).includes(idWitness.address)) {
|
|
128
128
|
await memoryNode?.unregister(idWitness)
|
|
129
129
|
}
|
|
130
130
|
}
|
|
@@ -2,11 +2,11 @@ import { Button, ButtonGroup } from '@mui/material'
|
|
|
2
2
|
import { Decorator, Meta, StoryFn } from '@storybook/react'
|
|
3
3
|
import { useAsyncEffect } from '@xylabs/react-async-effect'
|
|
4
4
|
import { MemoryArchivist, MemoryArchivistConfigSchema } from '@xyo-network/archivist'
|
|
5
|
-
import { HttpBridge, HttpBridgeConfigSchema } from '@xyo-network/http
|
|
5
|
+
import { HttpBridge, HttpBridgeConfigSchema } from '@xyo-network/bridge-http'
|
|
6
6
|
import { IdWitness, IdWitnessConfigSchema } from '@xyo-network/id-plugin'
|
|
7
7
|
import { MemoryNode } from '@xyo-network/node-memory'
|
|
8
8
|
import { NodeConfigSchema } from '@xyo-network/node-model'
|
|
9
|
-
import { NodeProvider,
|
|
9
|
+
import { NodeProvider, useWeakNodeFromNode, useWeakProvidedNode } from '@xyo-network/react-node'
|
|
10
10
|
import { DefaultSeedPhrase } from '@xyo-network/react-storybook'
|
|
11
11
|
import { useWallet, WalletProvider } from '@xyo-network/react-wallet'
|
|
12
12
|
import { MemorySentinel, SentinelConfigSchema } from '@xyo-network/sentinel'
|
|
@@ -14,10 +14,10 @@ import { useState } from 'react'
|
|
|
14
14
|
|
|
15
15
|
import { CytoscapeInstanceProvider } from '../../../contexts'
|
|
16
16
|
import { useCytoscapeElements, useCytoscapeOptions } from '../../../hooks'
|
|
17
|
+
import { WithExtensions } from '../../cytoscape-extensions'
|
|
17
18
|
import { NodeRelationalGraphFlexBox } from './Graph'
|
|
18
19
|
import { ProvidedNodeRenderer } from './ProvidedNodeRenderer'
|
|
19
20
|
import { options } from './story'
|
|
20
|
-
import { WithExtensions } from '../../cytoscape-extensions'
|
|
21
21
|
|
|
22
22
|
const nodeUrl = 'http://localhost:8080/node'
|
|
23
23
|
|
|
@@ -124,7 +124,7 @@ const TemplateAttachDetach: StoryFn<typeof NodeRelationalGraphFlexBox> = (props)
|
|
|
124
124
|
const handleRemoveWitness = async () => {
|
|
125
125
|
if (node && idWitness) {
|
|
126
126
|
const memoryNode = node?.deref() as MemoryNode | undefined
|
|
127
|
-
if (memoryNode?.registered().includes(idWitness.address)) {
|
|
127
|
+
if (((await memoryNode?.registered()) ?? []).includes(idWitness.address)) {
|
|
128
128
|
await memoryNode?.unregister(idWitness)
|
|
129
129
|
}
|
|
130
130
|
}
|
|
@@ -2,11 +2,11 @@ import { Button, ButtonGroup } from '@mui/material'
|
|
|
2
2
|
import { Decorator, Meta, StoryFn } from '@storybook/react'
|
|
3
3
|
import { useAsyncEffect } from '@xylabs/react-async-effect'
|
|
4
4
|
import { MemoryArchivist, MemoryArchivistConfigSchema } from '@xyo-network/archivist'
|
|
5
|
-
import { HttpBridge, HttpBridgeConfigSchema } from '@xyo-network/http
|
|
5
|
+
import { HttpBridge, HttpBridgeConfigSchema } from '@xyo-network/bridge-http'
|
|
6
6
|
import { IdWitness, IdWitnessConfigSchema } from '@xyo-network/id-plugin'
|
|
7
7
|
import { MemoryNode } from '@xyo-network/node-memory'
|
|
8
8
|
import { NodeConfigSchema } from '@xyo-network/node-model'
|
|
9
|
-
import { NodeProvider,
|
|
9
|
+
import { NodeProvider, useWeakNodeFromNode, useWeakProvidedNode } from '@xyo-network/react-node'
|
|
10
10
|
import { DefaultSeedPhrase } from '@xyo-network/react-storybook'
|
|
11
11
|
import { useWallet, WalletProvider } from '@xyo-network/react-wallet'
|
|
12
12
|
import { MemorySentinel, SentinelConfigSchema } from '@xyo-network/sentinel'
|
|
@@ -14,10 +14,10 @@ import { useState } from 'react'
|
|
|
14
14
|
|
|
15
15
|
import { CytoscapeInstanceProvider } from '../../../contexts'
|
|
16
16
|
import { useCytoscapeElements, useCytoscapeOptions } from '../../../hooks'
|
|
17
|
+
import { WithExtensions } from '../../cytoscape-extensions'
|
|
17
18
|
import { NodeRelationalGraphFlexBox } from './Graph'
|
|
18
19
|
import { ProvidedNodeRenderer } from './ProvidedNodeRenderer'
|
|
19
20
|
import { options } from './story'
|
|
20
|
-
import { WithExtensions } from '../../cytoscape-extensions'
|
|
21
21
|
|
|
22
22
|
const nodeUrl = 'http://localhost:8080/node'
|
|
23
23
|
|
|
@@ -124,8 +124,8 @@ const TemplateAttachDetach: StoryFn<typeof NodeRelationalGraphFlexBox> = (props)
|
|
|
124
124
|
const handleRemoveWitness = async () => {
|
|
125
125
|
if (node && idWitness) {
|
|
126
126
|
const memoryNode = node.deref() as MemoryNode | undefined
|
|
127
|
-
if (memoryNode?.registered().includes(idWitness.address)) {
|
|
128
|
-
await memoryNode
|
|
127
|
+
if (((await memoryNode?.registered()) ?? []).includes(idWitness.address)) {
|
|
128
|
+
await memoryNode?.unregister(idWitness)
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
}
|