invoke-node.tsx


Overview

invoke-node.tsx defines a React functional component named InvokeNode that renders a specialized node UI element within a flow-based interface. This component is designed to visually represent an "Invoke" operation node that displays connection handles for linking with other nodes, a header describing the node, and a URL related to the invocation operation.

The node integrates with theming, internationalization, and flow rendering libraries to present a consistent, theme-aware, and localized user interface. It is memoized to optimize rendering performance in complex flow diagrams.


Detailed Description

Component: InnerInvokeNode

This is the core functional React component responsible for rendering the invoke node UI.

Props

InnerInvokeNode receives props conforming to NodeProps<IInvokeNode>, where:

Functionality

Returns

A JSX <section> element representing the node, with conditional CSS classes applied depending on theme and selection state.

Usage Example

import { InvokeNode } from './invoke-node';

// Usage within a flow rendering context
<InvokeNode
  id="node-123"
  data={{
    name: "Invoke API",
    label: "API Call",
    form: { url: "https://api.example.com/endpoint" }
  }}
  isConnectable={true}
  selected={false}
/>

Exported Component: InvokeNode


Important Implementation Details


Interaction with Other Parts of the System


Visual Diagram

componentDiagram
    component InvokeNode {
        +id: string
        +data: IInvokeNode
        +isConnectable?: boolean
        +selected: boolean
        +render(): JSX.Element
    }
    component InnerInvokeNode {
        +id: string
        +data: IInvokeNode
        +isConnectable?: boolean
        +selected: boolean
        +render(): JSX.Element
    }
    component NodeHeader
    component Handle (from @xyflow/react)
    component useTheme (hook)
    component useTranslation (hook)

    InvokeNode --> InnerInvokeNode : memoizes
    InnerInvokeNode --> NodeHeader : renders
    InnerInvokeNode --> Handle : renders left and right handles
    InnerInvokeNode --> useTheme : reads theme
    InnerInvokeNode --> useTranslation : reads translations

Summary

This file is essential for rendering the visual and interactive part of invoke nodes in the flow UI, ensuring consistency and usability in the application’s flow editor.