chore(tests) added README and added plugins to generic tests
This commit is contained in:
Vendored
+5
-1
@@ -1,7 +1,11 @@
|
||||
import { Edge, Node, ReactFlowProps } from '@xyflow/react';
|
||||
import { BackgroundProps, ControlProps, Edge, MiniMapProps, Node, PanelProps, ReactFlowProps } from '@xyflow/react';
|
||||
|
||||
declare global {
|
||||
interface FlowConfig {
|
||||
flowProps: Omit<ReactFlowProps, 'nodes' | 'edges'> & { nodes: Node[]; edges: Edge[] };
|
||||
panelProps: PanelProps;
|
||||
backgroundProps: BackgroundProps;
|
||||
controlsProps: ControlProps;
|
||||
minimapProps: MiniMapProps;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,10 @@ import {
|
||||
OnNodesChange,
|
||||
OnEdgesChange,
|
||||
OnConnect,
|
||||
Controls,
|
||||
Panel,
|
||||
MiniMap,
|
||||
Background,
|
||||
} from '@xyflow/react';
|
||||
|
||||
type FlowProps = {
|
||||
@@ -24,7 +28,12 @@ export default ({ flowConfig }: FlowProps) => {
|
||||
|
||||
return (
|
||||
<div style={{ height: '100%' }}>
|
||||
<ReactFlow {...props} onNodesChange={onNodesChange} onEdgesChange={onEdgesChange} onConnect={onConnect} />
|
||||
<ReactFlow {...props} onNodesChange={onNodesChange} onEdgesChange={onEdgesChange} onConnect={onConnect}>
|
||||
{flowConfig.controlsProps && <Controls {...flowConfig.controlsProps} />}
|
||||
{flowConfig.panelProps && <Panel {...flowConfig.panelProps} />}
|
||||
{flowConfig.minimapProps && <MiniMap {...flowConfig.minimapProps} />}
|
||||
{flowConfig.backgroundProps && <Background {...flowConfig.backgroundProps} />}
|
||||
</ReactFlow>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user