@xyo-network/react-node-renderer 6.1.4 → 7.0.0

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.
@@ -1,158 +1,5 @@
1
- import { Address } from '@xylabs/hex';
2
- import { FlexBoxProps } from '@xylabs/react-flexbox';
3
- import { NodeInstance } from '@xyo-network/node-model';
4
- import * as cytoscape from 'cytoscape';
5
- import { CytoscapeOptions, Core, ElementDefinition, LayoutOptions, StylesheetCSS } from 'cytoscape';
6
- import * as react from 'react';
7
- import react__default, { PropsWithChildren, ReactNode, Dispatch, SetStateAction, ReactElement } from 'react';
8
- import * as _xyo_network_module_model from '@xyo-network/module-model';
9
- import { ModuleInstance } from '@xyo-network/module-model';
10
- import { AccountInstance } from '@xyo-network/account-model';
11
- import * as _xylabs_react_shared from '@xylabs/react-shared';
12
- import { ContextExState } from '@xylabs/react-shared';
13
- import { SvgIconComponent } from '@mui/icons-material';
14
-
15
- interface NodeRelationalGraphProps extends PropsWithChildren<FlexBoxProps> {
16
- actions?: ReactNode;
17
- detail?: ReactNode;
18
- layout?: 'dagre' | 'euler' | 'cose-bilkent' | 'cola';
19
- layoutOptions?: object;
20
- node?: WeakRef<NodeInstance>;
21
- onHover?: (address?: Address) => void;
22
- options?: CytoscapeOptions;
23
- showDetails?: boolean;
24
- }
25
-
26
- interface ModuleCardParserProps {
27
- mod?: ModuleInstance;
28
- }
29
- declare const ModuleCardParser: react__default.FC<ModuleCardParserProps>;
30
-
31
- interface ModuleGraphFlexBoxProps extends FlexBoxProps {
32
- disableModuleDetails?: boolean;
33
- hideActions?: boolean;
34
- layout?: 'dagre' | 'euler' | 'cose-bilkent' | 'cola';
35
- layoutOptions?: object;
36
- rootModule?: WeakRef<ModuleInstance> | null;
37
- }
38
- declare const ModuleGraphFlexBox: react__default.FC<ModuleGraphFlexBoxProps>;
39
- declare const ModuleGraphFlexBoxWithProvider: react__default.FC<ModuleGraphFlexBoxProps>;
40
-
41
- declare const NodeRelationalGraphFlexBox: react__default.FC<NodeRelationalGraphProps>;
42
- /** @deprecated */
43
- declare const NodeRelationalGraph: react__default.FC<NodeRelationalGraphProps>;
44
-
45
- interface ProvidedNodeRendererProps extends NodeRelationalGraphProps {
46
- account?: AccountInstance;
47
- layout?: 'dagre' | 'euler' | 'cose-bilkent' | 'cola';
48
- layoutOptions?: object;
49
- node?: WeakRef<NodeInstance>;
50
- }
51
- declare const ProvidedNodeRenderer: react__default.FC<ProvidedNodeRendererProps>;
52
-
53
- declare const CytoscapeInstanceContext: react.Context<({
54
- cy?: WeakRef<cytoscape.Core>;
55
- setCy?: react.Dispatch<react.SetStateAction<WeakRef<cytoscape.Core> | undefined>>;
56
- } & {
57
- provided: true;
58
- }) | (_xylabs_react_shared.FixedValues<_xylabs_react_shared.ProvidedContextExState<{
59
- cy?: WeakRef<cytoscape.Core>;
60
- setCy?: react.Dispatch<react.SetStateAction<WeakRef<cytoscape.Core> | undefined>>;
61
- }>, never> & {
62
- provided: false;
63
- }) | (_xylabs_react_shared.FixedValues<_xylabs_react_shared.NotProvidedContextExState<{
64
- cy?: WeakRef<cytoscape.Core>;
65
- setCy?: react.Dispatch<react.SetStateAction<WeakRef<cytoscape.Core> | undefined>>;
66
- }>, never> & {
67
- provided: false;
68
- })>;
69
-
70
- interface CytoscapeInstanceProviderProps extends PropsWithChildren {
71
- defaultInstance?: WeakRef<Core>;
72
- }
73
- declare const CytoscapeInstanceProvider: react__default.FC<CytoscapeInstanceProviderProps>;
74
-
75
- type CytoscapeInstanceState = ContextExState<{
76
- cy?: WeakRef<Core>;
77
- setCy?: Dispatch<SetStateAction<WeakRef<Core> | undefined>>;
78
- }>;
79
-
80
- declare const useCytoscapeInstance: (required?: boolean) => Omit<{
81
- cy?: WeakRef<cytoscape.Core>;
82
- setCy?: react.Dispatch<react.SetStateAction<WeakRef<cytoscape.Core> | undefined>>;
83
- } & {
84
- provided: true;
85
- }, "provided"> | Omit<_xylabs_react_shared.NotProvidedContextExState<CytoscapeInstanceState>, "provided">;
86
-
87
- interface ModuleInfo {
88
- children: ModuleInfo[];
89
- depth: number;
90
- mod: ModuleInstance;
91
- }
92
- declare const CytoscapeElements: {
93
- MaxNameLength: number;
94
- buildEdge(rootNode: ElementDefinition, newNode: ElementDefinition, properties?: {
95
- [key: string]: unknown;
96
- }): {
97
- data: {
98
- id: string;
99
- source: string | undefined;
100
- target: string | undefined;
101
- };
102
- };
103
- buildElements(mod: ModuleInstance): Promise<ElementDefinition[]>;
104
- buildElementsFromInfo(info: ModuleInfo, root?: ElementDefinition, classes?: string[]): Promise<ElementDefinition[]>;
105
- buildNode(mod: ModuleInstance, properties?: {
106
- [key: string]: unknown;
107
- }, classes?: string[]): ElementDefinition;
108
- buildRootNode: (mod: ModuleInstance) => ElementDefinition;
109
- normalizeName(name?: string): string | undefined;
110
- recurseNodes(root: ModuleInstance, maxDepth?: number, depth?: number): Promise<ModuleInfo>;
111
- };
112
-
113
- type CyNodeModuleTypes = 'archivist' | 'bridge' | 'diviner' | 'module' | 'node' | 'witness' | 'sentinel';
114
-
115
- declare const encodeSvg: (reactElement: ReactElement, color?: string) => string;
116
-
117
- declare const generateIconMap: () => Record<CyNodeModuleTypes, string>;
118
-
119
- declare const ColaLayout: {
120
- centerGraph: boolean;
121
- convergenceThreshold: number;
122
- name: string;
123
- };
124
-
125
- declare const ConcentricLayout: LayoutOptions;
126
-
127
- declare const parseModuleType: (mod?: ModuleInstance) => CyNodeModuleTypes;
128
-
129
- declare const CyIconSet: Record<CyNodeModuleTypes, SvgIconComponent>;
130
-
131
- declare const NodeWithName: (color?: string, outlineColor?: string) => StylesheetCSS;
132
- declare const Node: (icons: Record<CyNodeModuleTypes, string>, bgColor?: string, hideLabels?: boolean) => StylesheetCSS;
133
- declare const NodeAsRoot: (bgColor?: string) => StylesheetCSS;
134
- declare const EdgeStyled: (lineColor?: string, targetArrowColor?: string) => StylesheetCSS;
135
-
136
- declare const useCytoscapeElements: (mod?: WeakRef<ModuleInstance> | null) => ElementDefinition[];
137
-
138
- declare const useElements: (hideLabels: boolean) => {
139
- hoveredNode: cytoscape.NodeSingular | undefined;
140
- setHoveredNode: react.Dispatch<react.SetStateAction<cytoscape.NodeSingular | undefined>>;
141
- toggleSelectedElement: (address?: string) => void;
142
- };
143
-
144
- declare const useCytoscapeOptions: (elements: CytoscapeOptions["elements"], style?: CytoscapeOptions["style"], layout?: CytoscapeOptions["layout"]) => CytoscapeOptions | undefined;
145
-
146
- declare const useModuleDetails: (rootModule?: WeakRef<ModuleInstance> | null, onFoundModule?: () => void) => {
147
- mod: ModuleInstance<_xyo_network_module_model.ModuleParams<_xyo_network_module_model.AnyConfigSchema<_xyo_network_module_model.ModuleConfig>>, _xyo_network_module_model.ModuleEventData<object>> | null | undefined;
148
- onModuleDetails: (address?: string | null) => void;
149
- };
150
-
151
- declare const useRelationalGraphOptions: (mod?: WeakRef<ModuleInstance>) => {
152
- handleToggleLabels: () => void;
153
- hideLabels: boolean;
154
- options: cytoscape.CytoscapeOptions | undefined;
155
- };
156
-
157
- export { ColaLayout, ConcentricLayout, CyIconSet, CytoscapeElements, CytoscapeInstanceContext, CytoscapeInstanceProvider, EdgeStyled, ModuleCardParser, ModuleGraphFlexBox, ModuleGraphFlexBoxWithProvider, Node, NodeAsRoot, NodeRelationalGraph, NodeRelationalGraphFlexBox, NodeWithName, ProvidedNodeRenderer, encodeSvg, generateIconMap, parseModuleType, useCytoscapeElements, useCytoscapeInstance, useCytoscapeOptions, useElements, useModuleDetails, useRelationalGraphOptions };
158
- export type { CyNodeModuleTypes, CytoscapeInstanceProviderProps, CytoscapeInstanceState, ModuleCardParserProps, ModuleGraphFlexBoxProps, NodeRelationalGraphProps, ProvidedNodeRendererProps };
1
+ export * from './components/index.ts';
2
+ export * from './contexts/index.ts';
3
+ export * from './Cytoscape/index.ts';
4
+ export * from './hooks/index.ts';
5
+ //# sourceMappingURL=index.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/react-node-renderer",
3
- "version": "6.1.4",
3
+ "version": "7.0.0",
4
4
  "description": "Common React library for all XYO projects that use React",
5
5
  "keywords": [
6
6
  "xyo",
@@ -38,27 +38,31 @@
38
38
  },
39
39
  "module": "dist/browser/index.mjs",
40
40
  "types": "dist/browser/index.d.ts",
41
+ "files": [
42
+ "dist",
43
+ "src"
44
+ ],
41
45
  "dependencies": {
42
- "@xylabs/exists": "^4.13.23",
43
- "@xylabs/hex": "^4.13.23",
44
- "@xylabs/react-async-effect": "^6.3.13",
45
- "@xylabs/react-flexbox": "^6.3.13",
46
- "@xylabs/react-identicon": "^6.3.13",
47
- "@xylabs/react-promise": "^6.3.13",
48
- "@xylabs/react-shared": "^6.3.13",
49
- "@xylabs/react-theme": "^6.3.13",
50
- "@xyo-network/account-model": "^4.1.7",
51
- "@xyo-network/archivist-model": "^4.1.7",
52
- "@xyo-network/bridge-model": "^4.1.7",
53
- "@xyo-network/diviner-model": "^4.1.7",
54
- "@xyo-network/module-model": "^4.1.7",
55
- "@xyo-network/node-model": "^4.1.7",
56
- "@xyo-network/react-archivist": "^6.1.4",
57
- "@xyo-network/react-module": "^6.1.4",
58
- "@xyo-network/react-node": "^6.1.4",
59
- "@xyo-network/sentinel-model": "^4.1.7",
60
- "@xyo-network/witness-model": "^4.1.7",
61
- "cytoscape": "^3.32.1",
46
+ "@xylabs/exists": "^5.0.0",
47
+ "@xylabs/hex": "^5.0.0",
48
+ "@xylabs/react-async-effect": "^7.0.0",
49
+ "@xylabs/react-flexbox": "^7.0.0",
50
+ "@xylabs/react-identicon": "^7.0.0",
51
+ "@xylabs/react-promise": "^7.0.0",
52
+ "@xylabs/react-shared": "^7.0.0",
53
+ "@xylabs/react-theme": "^7.0.0",
54
+ "@xyo-network/account-model": "^5.0.0",
55
+ "@xyo-network/archivist-model": "^5.0.0",
56
+ "@xyo-network/bridge-model": "^5.0.0",
57
+ "@xyo-network/diviner-model": "^5.0.0",
58
+ "@xyo-network/module-model": "^5.0.0",
59
+ "@xyo-network/node-model": "^5.0.0",
60
+ "@xyo-network/react-archivist": "^7.0.0",
61
+ "@xyo-network/react-module": "^7.0.0",
62
+ "@xyo-network/react-node": "^7.0.0",
63
+ "@xyo-network/sentinel-model": "^5.0.0",
64
+ "@xyo-network/witness-model": "^5.0.0",
65
+ "cytoscape": "^3.33.0",
62
66
  "cytoscape-cola": "^2.5.1",
63
67
  "cytoscape-cose-bilkent": "^4.1.0",
64
68
  "cytoscape-dagre": "^2.5.0",
@@ -71,23 +75,23 @@
71
75
  "@types/cytoscape": "^3.21.9",
72
76
  "@types/cytoscape-dagre": "^2.3.3",
73
77
  "@types/cytoscape-euler": "^1.2.3",
74
- "@types/react": "^19.1.8",
75
- "@types/react-dom": "^19.1.6",
76
- "@xylabs/events": "^4.13.23",
77
- "@xylabs/ts-scripts-yarn3": "next",
78
- "@xylabs/tsconfig-react": "next",
79
- "@xyo-network/archivist": "^4.1.7",
80
- "@xyo-network/archivist-memory": "^4.1.7",
81
- "@xyo-network/bridge-http": "^4.1.7",
82
- "@xyo-network/bridge-model": "^4.1.7",
83
- "@xyo-network/id-plugin": "^4.1.1",
84
- "@xyo-network/node-memory": "^4.1.7",
85
- "@xyo-network/react-storybook": "^6.1.4",
86
- "@xyo-network/react-wallet": "^6.1.4",
87
- "@xyo-network/sentinel": "^4.1.7",
88
- "@xyo-network/sentinel-memory": "^4.1.7",
89
- "react": "^19.1.0",
90
- "react-dom": "^19.1.0",
78
+ "@types/react": "^19.1.9",
79
+ "@types/react-dom": "^19.1.7",
80
+ "@xylabs/events": "^5.0.0",
81
+ "@xylabs/ts-scripts-yarn3": "^7.0.2",
82
+ "@xylabs/tsconfig-react": "^7.0.2",
83
+ "@xyo-network/archivist": "^5.0.0",
84
+ "@xyo-network/archivist-memory": "^5.0.0",
85
+ "@xyo-network/bridge-http": "^5.0.0",
86
+ "@xyo-network/bridge-model": "^5.0.0",
87
+ "@xyo-network/id-plugin": "^5.0.0",
88
+ "@xyo-network/node-memory": "^5.0.0",
89
+ "@xyo-network/react-storybook": "^7.0.0",
90
+ "@xyo-network/react-wallet": "^7.0.0",
91
+ "@xyo-network/sentinel": "^5.0.0",
92
+ "@xyo-network/sentinel-memory": "^5.0.0",
93
+ "react": "^19.1.1",
94
+ "react-dom": "^19.1.1",
91
95
  "storybook": "^9.0.18",
92
96
  "typescript": "^5.8.3"
93
97
  },
@@ -1 +1 @@
1
- import type {} from '@mui/material/themeCssVarsAugmentation'
1
+ import '@mui/material/themeCssVarsAugmentation'
package/typedoc.json DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "$schema": "https://typedoc.org/schema.json",
3
- "entryPoints": ["src/index.ts"],
4
- "tsconfig": "./tsconfig.typedoc.json"
5
- }
package/xy.config.ts DELETED
@@ -1,10 +0,0 @@
1
- import type { XyTsupConfig } from '@xylabs/ts-scripts-yarn3'
2
- const config: XyTsupConfig = {
3
- compile: {
4
- browser: { src: true },
5
- node: {},
6
- neutral: {},
7
- },
8
- }
9
-
10
- export default config