feat: add WorkflowLineAddButton and WorkflowLineNodePanel components for enhanced workflow editing
This commit is contained in:
@@ -8,6 +8,8 @@ import {
|
||||
type WorkflowNodeEntity,
|
||||
type WorkflowJSON,
|
||||
} from "@flowgram.ai/free-layout-editor"
|
||||
import { createFreeLinesPlugin } from "@flowgram.ai/free-lines-plugin"
|
||||
import { createFreeNodePanelPlugin } from "@flowgram.ai/free-node-panel-plugin"
|
||||
import { createFreeSnapPlugin } from "@flowgram.ai/free-snap-plugin"
|
||||
import { createMinimapPlugin } from "@flowgram.ai/minimap-plugin"
|
||||
|
||||
@@ -15,6 +17,8 @@ import type { AIWorkflowDefinition, AIWorkflowNodeSpec } from "@/lib/api/admin"
|
||||
|
||||
import { FlowgramNodeRenderer } from "./flowgram-node-renderer"
|
||||
import { buildFlowgramNodeRegistries } from "./flowgram-node-registries"
|
||||
import { WorkflowLineAddButton } from "./workflow-line-add-button"
|
||||
import { WorkflowLineNodePanel } from "./workflow-line-node-panel"
|
||||
import {
|
||||
normalizeConditionPortsForFlowgram,
|
||||
syncConditionBranchTargetsFromEdges,
|
||||
@@ -84,6 +88,17 @@ export function useFlowgramEditorProps({
|
||||
}
|
||||
},
|
||||
plugins: () => [
|
||||
createFreeLinesPlugin({
|
||||
renderInsideLine: WorkflowLineAddButton,
|
||||
}),
|
||||
createFreeNodePanelPlugin({
|
||||
renderer: (props) => (
|
||||
<WorkflowLineNodePanel
|
||||
{...props}
|
||||
nodeSpecs={nodeSpecs}
|
||||
/>
|
||||
),
|
||||
}),
|
||||
createMinimapPlugin({
|
||||
disableLayer: true,
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user