lint: change folder names
This commit is contained in:
@@ -22,8 +22,8 @@ import {
|
|||||||
type NodeChange,
|
type NodeChange,
|
||||||
type EdgeChange,
|
type EdgeChange,
|
||||||
} from '@xyflow/react'
|
} from '@xyflow/react'
|
||||||
import { AnimatedEdge } from '@/components/base/AnimatedEdge'
|
import { AnimatedEdge } from '@/components/graph/AnimatedEdge'
|
||||||
import FlowContext from '@/lib/flowContext'
|
import FlowContext from '@/lib/graph/flowContext'
|
||||||
import { useTheme } from '@/lib/themeContext'
|
import { useTheme } from '@/lib/themeContext'
|
||||||
import { usePlatform } from '@/app/kosmos/KosmosContext'
|
import { usePlatform } from '@/app/kosmos/KosmosContext'
|
||||||
import { useGraphStateWithHistory } from '@/hooks/useGraphStateWithHistory'
|
import { useGraphStateWithHistory } from '@/hooks/useGraphStateWithHistory'
|
||||||
@@ -41,7 +41,7 @@ import {
|
|||||||
} from '@/components/ui/context-menu'
|
} from '@/components/ui/context-menu'
|
||||||
import { CanvasMenubar } from '@/app/canvas/CanvasMenubar'
|
import { CanvasMenubar } from '@/app/canvas/CanvasMenubar'
|
||||||
import { createContextualNode } from '@/app/canvas/ContextualZoomNode'
|
import { createContextualNode } from '@/app/canvas/ContextualZoomNode'
|
||||||
import { FlowKeyboardShortcuts } from '@/components/base/FlowKeyboardShortcuts'
|
import { FlowKeyboardShortcuts } from '@/components/graph/FlowKeyboardShortcuts'
|
||||||
import {
|
import {
|
||||||
Empty,
|
Empty,
|
||||||
EmptyContent,
|
EmptyContent,
|
||||||
@@ -57,7 +57,7 @@ import {
|
|||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from '@/components/ui/dialog'
|
} from '@/components/ui/dialog'
|
||||||
import { ClipboardPaste, FolderOpen, FileStack, CircleDotDashed } from 'lucide-react'
|
import { ClipboardPaste, FolderOpen, FileStack, CircleDotDashed } from 'lucide-react'
|
||||||
import { DEFAULT_NODE_STYLE, getDefaultDataForType, getNextNodeId } from '@/lib/flowUtils'
|
import { DEFAULT_NODE_STYLE, getDefaultDataForType, getNextNodeId } from '@/lib/graph/flowUtils'
|
||||||
import {
|
import {
|
||||||
getRegisteredNodeTypes,
|
getRegisteredNodeTypes,
|
||||||
getRegisteredNodeTypesGroupedByClassification,
|
getRegisteredNodeTypesGroupedByClassification,
|
||||||
@@ -65,9 +65,9 @@ import {
|
|||||||
getDefaultStyle,
|
getDefaultStyle,
|
||||||
getNodeType,
|
getNodeType,
|
||||||
isConnectionAllowed,
|
isConnectionAllowed,
|
||||||
} from '@/lib/nodeRegistry'
|
} from '@/lib/graph/nodeRegistry'
|
||||||
import { getPathNodeIds, getPausedSegmentNodeIds } from '@/lib/graphPath'
|
import { getPathNodeIds, getPausedSegmentNodeIds } from '@/lib/graph/graphPath'
|
||||||
import type { AppNode, AppEdge } from '@/lib/nodeTypes'
|
import type { AppNode, AppEdge } from '@/lib/graph/nodeTypes'
|
||||||
import { toast } from 'sonner'
|
import { toast } from 'sonner'
|
||||||
import {
|
import {
|
||||||
loadGraphFromStorage,
|
loadGraphFromStorage,
|
||||||
@@ -526,7 +526,7 @@ export function CanvasPage({ projectId }: CanvasPageProps) {
|
|||||||
'title' in newNode.data &&
|
'title' in newNode.data &&
|
||||||
String(n.type) === 'config'
|
String(n.type) === 'config'
|
||||||
) {
|
) {
|
||||||
;(newNode.data as Record<string, unknown>).title = `${newId}`
|
; (newNode.data as Record<string, unknown>).title = `${newId}`
|
||||||
}
|
}
|
||||||
toAdd.push(newNode)
|
toAdd.push(newNode)
|
||||||
}
|
}
|
||||||
@@ -544,7 +544,7 @@ export function CanvasPage({ projectId }: CanvasPageProps) {
|
|||||||
position: node.position,
|
position: node.position,
|
||||||
style: node.style,
|
style: node.style,
|
||||||
}
|
}
|
||||||
navigator.clipboard?.writeText(JSON.stringify(copy)).catch(() => {})
|
navigator.clipboard?.writeText(JSON.stringify(copy)).catch(() => { })
|
||||||
}, [selectedNodes])
|
}, [selectedNodes])
|
||||||
|
|
||||||
const handlePaste = useCallback(() => {
|
const handlePaste = useCallback(() => {
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { useViewport } from '@xyflow/react'
|
import { useViewport } from '@xyflow/react'
|
||||||
import { getNodeType, getDefaultStyle } from '@/lib/nodeRegistry'
|
import { getNodeType, getDefaultStyle } from '@/lib/graph/nodeRegistry'
|
||||||
import { InputHandle, OutputHandle } from '@/components/base/NodeHandles'
|
import { InputHandle, OutputHandle } from '@/components/graph/NodeHandles'
|
||||||
import { cn } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const MIN_ZOOM = 0.1
|
const MIN_ZOOM = 0.1
|
||||||
@@ -48,7 +48,7 @@ function CompactNodeView({ id, type, selected, width, height }: NodeProps) {
|
|||||||
'flex flex-col rounded-md border bg-card text-card-foreground transition-[border-color,box-shadow] duration-200',
|
'flex flex-col rounded-md border bg-card text-card-foreground transition-[border-color,box-shadow] duration-200',
|
||||||
'border-input hover:ring-1',
|
'border-input hover:ring-1',
|
||||||
selected &&
|
selected &&
|
||||||
'border-primary/50 shadow-[0_0_0_2px_hsl(var(--primary)_/_0.15)] dark:border-primary/35 dark:shadow-[0_0_0_2px_hsl(var(--primary)_/_0.1)]'
|
'border-primary/50 shadow-[0_0_0_2px_hsl(var(--primary)_/_0.15)] dark:border-primary/35 dark:shadow-[0_0_0_2px_hsl(var(--primary)_/_0.1)]'
|
||||||
)}
|
)}
|
||||||
style={{
|
style={{
|
||||||
width: w,
|
width: w,
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import {
|
|||||||
getBezierPath,
|
getBezierPath,
|
||||||
type EdgeProps,
|
type EdgeProps,
|
||||||
} from '@xyflow/react'
|
} from '@xyflow/react'
|
||||||
import FlowContext from '../../lib/flowContext'
|
import FlowContext from '../../lib/graph/flowContext'
|
||||||
import { getConnectionStatus, CONNECTION_STATUS_CLASS } from '../../lib/connectionStatus'
|
import { getConnectionStatus, CONNECTION_STATUS_CLASS } from '../../lib/connectionStatus'
|
||||||
import { getConnectionLabelForTarget } from '../../lib/nodeRegistry'
|
import { getConnectionLabelForTarget } from '../../lib/graph/nodeRegistry'
|
||||||
|
|
||||||
const EDGE_STROKE_WIDTH = 2
|
const EDGE_STROKE_WIDTH = 2
|
||||||
const DOT_MARKER_R = 1.5
|
const DOT_MARKER_R = 1.5
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { ComponentProps, ReactNode } from "react";
|
import type { ComponentProps, ReactNode } from "react";
|
||||||
import { NodeResizer } from "@xyflow/react";
|
import { NodeResizer } from "@xyflow/react";
|
||||||
|
|
||||||
import { useConnectionPathRole } from "@/lib/flowContext";
|
import { useConnectionPathRole } from "@/lib/graph/flowContext";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
|
|
||||||
/** Default min size for resizable nodes (used by NodeResizer). */
|
/** Default min size for resizable nodes (used by NodeResizer). */
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
import React, { useCallback, useContext, useEffect } from 'react'
|
import React, { useCallback, useContext, useEffect } from 'react'
|
||||||
import { useReactFlow } from '@xyflow/react'
|
import { useReactFlow } from '@xyflow/react'
|
||||||
import type { Node } from '@xyflow/react'
|
import type { Node } from '@xyflow/react'
|
||||||
import FlowContext from '@/lib/flowContext'
|
import FlowContext from '@/lib/graph/flowContext'
|
||||||
import { getNextNodeId, getDefaultDataForType } from '@/lib/flowUtils'
|
import { getNextNodeId, getDefaultDataForType } from '@/lib/graph/flowUtils'
|
||||||
import { getDefaultStyle, getRegisteredNodeTypeIds } from '@/lib/nodeRegistry'
|
import { getDefaultStyle, getRegisteredNodeTypeIds } from '@/lib/graph/nodeRegistry'
|
||||||
|
|
||||||
const DUPLICATE_OFFSET = { x: 30, y: 30 }
|
const DUPLICATE_OFFSET = { x: 30, y: 30 }
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ export function FlowKeyboardShortcuts() {
|
|||||||
position: node.position,
|
position: node.position,
|
||||||
style: node.style,
|
style: node.style,
|
||||||
}
|
}
|
||||||
navigator.clipboard?.writeText(JSON.stringify(copy)).catch(() => {})
|
navigator.clipboard?.writeText(JSON.stringify(copy)).catch(() => { })
|
||||||
ev.preventDefault()
|
ev.preventDefault()
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
@@ -132,7 +132,7 @@ export function FlowKeyboardShortcuts() {
|
|||||||
'title' in newNode.data &&
|
'title' in newNode.data &&
|
||||||
String(n.type) === 'config'
|
String(n.type) === 'config'
|
||||||
) {
|
) {
|
||||||
;(newNode.data as Record<string, unknown>).title = `${newId}`
|
; (newNode.data as Record<string, unknown>).title = `${newId}`
|
||||||
}
|
}
|
||||||
toAdd.push(newNode)
|
toAdd.push(newNode)
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import React, { useContext, useMemo } from 'react'
|
import React, { useContext, useMemo } from 'react'
|
||||||
import FlowContext from '../../lib/flowContext'
|
import FlowContext from '../../lib/graph/flowContext'
|
||||||
import { ArrowDownLeft, ArrowUpRight } from 'lucide-react'
|
import { ArrowDownLeft, ArrowUpRight } from 'lucide-react'
|
||||||
import { NodeHelpPopover } from './NodeHelpPopover'
|
import { NodeHelpPopover } from './NodeHelpPopover'
|
||||||
import { getNodeType, getNodeClassificationLabel } from '../../lib/nodeRegistry'
|
import { getNodeType, getNodeClassificationLabel } from '../../lib/graph/nodeRegistry'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
nodeId: string
|
nodeId: string
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useContext } from 'react'
|
import React, { useContext } from 'react'
|
||||||
import { Handle, Position } from '@xyflow/react'
|
import { Handle, Position } from '@xyflow/react'
|
||||||
import { ArrowDownLeft, ArrowUpRight } from 'lucide-react'
|
import { ArrowDownLeft, ArrowUpRight } from 'lucide-react'
|
||||||
import FlowContext from '@/lib/flowContext'
|
import FlowContext from '@/lib/graph/flowContext'
|
||||||
import { cn } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
type NodeHandleProps = {
|
type NodeHandleProps = {
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useCallback, useContext, useEffect, useRef, useState } from 'react'
|
import React, { useCallback, useContext, useEffect, useRef, useState } from 'react'
|
||||||
import FlowContext from '../../lib/flowContext'
|
import FlowContext from '../../lib/graph/flowContext'
|
||||||
import type { AppNode } from '../../lib/nodeTypes'
|
import type { AppNode } from '../../lib/graph/nodeTypes'
|
||||||
import { replaceNodeIdInGraph } from '../../lib/flowUtils'
|
import { replaceNodeIdInGraph } from '../../lib/graph/flowUtils'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
nodeId: string
|
nodeId: string
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { HelpCircle } from 'lucide-react'
|
import { HelpCircle } from 'lucide-react'
|
||||||
import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover'
|
import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover'
|
||||||
import { getNodeHelp } from '../../lib/nodeRegistry'
|
import { getNodeHelp } from '../../lib/graph/nodeRegistry'
|
||||||
import { cn } from '../../lib/utils'
|
import { cn } from '../../lib/utils'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useCallback, useContext } from 'react'
|
import React, { useCallback, useContext } from 'react'
|
||||||
import FlowContext from '../../lib/flowContext'
|
import FlowContext from '../../lib/graph/flowContext'
|
||||||
import {
|
import {
|
||||||
Menubar,
|
Menubar,
|
||||||
MenubarContent,
|
MenubarContent,
|
||||||
@@ -3,21 +3,21 @@ import {
|
|||||||
AbstractNodeProps,
|
AbstractNodeProps,
|
||||||
createAbstractNodeComponent,
|
createAbstractNodeComponent,
|
||||||
useAbstractNode,
|
useAbstractNode,
|
||||||
} from '@/lib/abstractNode'
|
} from '@/lib/graph/abstractNode'
|
||||||
import { getConfigContent } from '@/lib/configTypes'
|
import { getConfigContent } from '@/lib/configTypes'
|
||||||
import {
|
import {
|
||||||
BaseNode,
|
BaseNode,
|
||||||
BaseNodeContent,
|
BaseNodeContent,
|
||||||
BaseNodeFooter,
|
BaseNodeFooter,
|
||||||
BaseNodeHeaderRow,
|
BaseNodeHeaderRow,
|
||||||
} from '@/components/base/BaseNode'
|
} from '@/components/graph/BaseNode'
|
||||||
import { NodeMenubar } from '@/components/base/NodeMenubar'
|
import { NodeMenubar } from '@/components/graph/NodeMenubar'
|
||||||
import { NodeFooterEdgeIndicators } from '@/components/base/NodeFooterEdgeIndicators'
|
import { NodeFooterEdgeIndicators } from '@/components/graph/NodeFooterEdgeIndicators'
|
||||||
import { NodeHeaderTitle } from '@/components/base/NodeHeaderTitle'
|
import { NodeHeaderTitle } from '@/components/graph/NodeHeaderTitle'
|
||||||
import { InputHandle, OutputHandle } from '@/components/base/NodeHandles'
|
import { InputHandle, OutputHandle } from '@/components/graph/NodeHandles'
|
||||||
import FlowContext from '@/lib/flowContext'
|
import FlowContext from '@/lib/graph/flowContext'
|
||||||
import { useSyncConnectionStatus } from '@/lib/nodeLifecycle'
|
import { useSyncConnectionStatus } from '@/lib/graph/nodeLifecycle'
|
||||||
import { getNodeType } from '@/lib/nodeRegistry'
|
import { getNodeType } from '@/lib/graph/nodeRegistry'
|
||||||
import { Button } from '@/components/ui/button'
|
import { Button } from '@/components/ui/button'
|
||||||
import { usePlatform } from '@/app/kosmos/KosmosContext'
|
import { usePlatform } from '@/app/kosmos/KosmosContext'
|
||||||
import { Bot, Play, Loader2 } from 'lucide-react'
|
import { Bot, Play, Loader2 } from 'lucide-react'
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Bot } from 'lucide-react'
|
import { Bot } from 'lucide-react'
|
||||||
import { createNodeTypeBuilder } from '@/lib/nodeTypeBuilder'
|
import { createNodeTypeBuilder } from '@/lib/graph/nodeTypeBuilder'
|
||||||
import { NODE_HELP } from '@/lib/nodeHelp'
|
import { NODE_HELP } from '@/lib/graph/nodeHelp'
|
||||||
import type { NodeTypeDescriptor } from '@/lib/nodeRegistry'
|
import type { NodeTypeDescriptor } from '@/lib/graph/nodeRegistry'
|
||||||
import AgentNode from './AgentNode'
|
import AgentNode from './AgentNode'
|
||||||
import { agentRenderingLogic } from './renderingLogic'
|
import { agentRenderingLogic } from './renderingLogic'
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
createAbstractNodeComponent,
|
createAbstractNodeComponent,
|
||||||
useAbstractNode,
|
useAbstractNode,
|
||||||
type FlowNode,
|
type FlowNode,
|
||||||
} from '@/lib/abstractNode'
|
} from '@/lib/graph/abstractNode'
|
||||||
import { useResizeHeight } from '@/hooks/useResizeHeight'
|
import { useResizeHeight } from '@/hooks/useResizeHeight'
|
||||||
import { nunjucksCompletionSource } from '@/lib/nunjucksAutocomplete'
|
import { nunjucksCompletionSource } from '@/lib/nunjucksAutocomplete'
|
||||||
import { plantumlLanguage } from '@/lib/plantumlLanguage'
|
import { plantumlLanguage } from '@/lib/plantumlLanguage'
|
||||||
@@ -26,7 +26,7 @@ import {
|
|||||||
BaseNodeContent,
|
BaseNodeContent,
|
||||||
BaseNodeFooter,
|
BaseNodeFooter,
|
||||||
BaseNodeHeaderRow,
|
BaseNodeHeaderRow,
|
||||||
} from '@/components/base/BaseNode'
|
} from '@/components/graph/BaseNode'
|
||||||
import { Code2, Database, ScrollText, Variable } from 'lucide-react'
|
import { Code2, Database, ScrollText, Variable } from 'lucide-react'
|
||||||
import {
|
import {
|
||||||
MenubarItem,
|
MenubarItem,
|
||||||
@@ -38,12 +38,12 @@ import {
|
|||||||
} from '@/components/ui/menubar'
|
} from '@/components/ui/menubar'
|
||||||
import { Kbd } from '@/components/ui/kbd'
|
import { Kbd } from '@/components/ui/kbd'
|
||||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'
|
||||||
import { InputHandle, OutputHandle } from '@/components/base/NodeHandles'
|
import { InputHandle, OutputHandle } from '@/components/graph/NodeHandles'
|
||||||
import { NodeFooterEdgeIndicators } from '@/components/base/NodeFooterEdgeIndicators'
|
import { NodeFooterEdgeIndicators } from '@/components/graph/NodeFooterEdgeIndicators'
|
||||||
import { NodeHeaderTitle } from '@/components/base/NodeHeaderTitle'
|
import { NodeHeaderTitle } from '@/components/graph/NodeHeaderTitle'
|
||||||
import { NodeMenubar } from '@/components/base/NodeMenubar'
|
import { NodeMenubar } from '@/components/graph/NodeMenubar'
|
||||||
import FlowContext from '@/lib/flowContext'
|
import FlowContext from '@/lib/graph/flowContext'
|
||||||
import { getNodeType } from '@/lib/nodeRegistry'
|
import { getNodeType } from '@/lib/graph/nodeRegistry'
|
||||||
|
|
||||||
export type ConfigNodeData = { configType?: ConfigTypeId; content?: string; title?: string; /** @deprecated use content */ plantuml?: string }
|
export type ConfigNodeData = { configType?: ConfigTypeId; content?: string; title?: string; /** @deprecated use content */ plantuml?: string }
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { ScrollText } from 'lucide-react'
|
import { ScrollText } from 'lucide-react'
|
||||||
import { createNodeTypeBuilder } from '@/lib/nodeTypeBuilder'
|
import { createNodeTypeBuilder } from '@/lib/graph/nodeTypeBuilder'
|
||||||
import { NODE_HELP } from '@/lib/nodeHelp'
|
import { NODE_HELP } from '@/lib/graph/nodeHelp'
|
||||||
import { getResolvedContentForConfig } from './renderingLogic'
|
import { getResolvedContentForConfig } from './renderingLogic'
|
||||||
import type { NodeTypeDescriptor } from '@/lib/nodeRegistry'
|
import type { NodeTypeDescriptor } from '@/lib/graph/nodeRegistry'
|
||||||
import ConfigNode from './ConfigNode'
|
import ConfigNode from './ConfigNode'
|
||||||
|
|
||||||
const ICON_CLASS = 'mr-2 h-4 w-4'
|
const ICON_CLASS = 'mr-2 h-4 w-4'
|
||||||
|
|||||||
@@ -3,19 +3,19 @@ import {
|
|||||||
AbstractNodeProps,
|
AbstractNodeProps,
|
||||||
createAbstractNodeComponent,
|
createAbstractNodeComponent,
|
||||||
useAbstractNode,
|
useAbstractNode,
|
||||||
} from '@/lib/abstractNode'
|
} from '@/lib/graph/abstractNode'
|
||||||
import {
|
import {
|
||||||
BaseNode,
|
BaseNode,
|
||||||
BaseNodeContent,
|
BaseNodeContent,
|
||||||
BaseNodeFooter,
|
BaseNodeFooter,
|
||||||
BaseNodeHeaderRow,
|
BaseNodeHeaderRow,
|
||||||
} from '@/components/base/BaseNode'
|
} from '@/components/graph/BaseNode'
|
||||||
import { NodeFooterEdgeIndicators } from '@/components/base/NodeFooterEdgeIndicators'
|
import { NodeFooterEdgeIndicators } from '@/components/graph/NodeFooterEdgeIndicators'
|
||||||
import { NodeHeaderTitle } from '@/components/base/NodeHeaderTitle'
|
import { NodeHeaderTitle } from '@/components/graph/NodeHeaderTitle'
|
||||||
import { NodeMenubar } from '@/components/base/NodeMenubar'
|
import { NodeMenubar } from '@/components/graph/NodeMenubar'
|
||||||
import FlowContext from '@/lib/flowContext'
|
import FlowContext from '@/lib/graph/flowContext'
|
||||||
import { getNodeType } from '@/lib/nodeRegistry'
|
import { getNodeType } from '@/lib/graph/nodeRegistry'
|
||||||
import { OutputHandle } from '@/components/base/NodeHandles'
|
import { OutputHandle } from '@/components/graph/NodeHandles'
|
||||||
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table'
|
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table'
|
||||||
import { parseCsvToRows } from '@/lib/csvParse'
|
import { parseCsvToRows } from '@/lib/csvParse'
|
||||||
import { ArrowDown, ArrowUp, ArrowUpDown, Database, FileUp } from 'lucide-react'
|
import { ArrowDown, ArrowUp, ArrowUpDown, Database, FileUp } from 'lucide-react'
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Database } from 'lucide-react'
|
import { Database } from 'lucide-react'
|
||||||
import { createNodeTypeBuilder } from '@/lib/nodeTypeBuilder'
|
import { createNodeTypeBuilder } from '@/lib/graph/nodeTypeBuilder'
|
||||||
import { NODE_HELP } from '@/lib/nodeHelp'
|
import { NODE_HELP } from '@/lib/graph/nodeHelp'
|
||||||
import type { NodeTypeDescriptor } from '@/lib/nodeRegistry'
|
import type { NodeTypeDescriptor } from '@/lib/graph/nodeRegistry'
|
||||||
import DataNode from './DataNode'
|
import DataNode from './DataNode'
|
||||||
|
|
||||||
const ICON_CLASS = 'mr-2 h-4 w-4'
|
const ICON_CLASS = 'mr-2 h-4 w-4'
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
createAbstractNodeComponent,
|
createAbstractNodeComponent,
|
||||||
useAbstractNode,
|
useAbstractNode,
|
||||||
type FlowNode,
|
type FlowNode,
|
||||||
} from '@/lib/abstractNode'
|
} from '@/lib/graph/abstractNode'
|
||||||
import { useResizeHeight } from '@/hooks/useResizeHeight'
|
import { useResizeHeight } from '@/hooks/useResizeHeight'
|
||||||
import { useTheme } from '@/lib/themeContext'
|
import { useTheme } from '@/lib/themeContext'
|
||||||
import {
|
import {
|
||||||
@@ -14,13 +14,13 @@ import {
|
|||||||
BaseNodeContent,
|
BaseNodeContent,
|
||||||
BaseNodeFooter,
|
BaseNodeFooter,
|
||||||
BaseNodeHeaderRow,
|
BaseNodeHeaderRow,
|
||||||
} from '@/components/base/BaseNode'
|
} from '@/components/graph/BaseNode'
|
||||||
import { InputHandle, OutputHandle } from '@/components/base/NodeHandles'
|
import { InputHandle, OutputHandle } from '@/components/graph/NodeHandles'
|
||||||
import { NodeFooterEdgeIndicators } from '@/components/base/NodeFooterEdgeIndicators'
|
import { NodeFooterEdgeIndicators } from '@/components/graph/NodeFooterEdgeIndicators'
|
||||||
import { NodeHeaderTitle } from '@/components/base/NodeHeaderTitle'
|
import { NodeHeaderTitle } from '@/components/graph/NodeHeaderTitle'
|
||||||
import { NodeMenubar } from '@/components/base/NodeMenubar'
|
import { NodeMenubar } from '@/components/graph/NodeMenubar'
|
||||||
import FlowContext from '@/lib/flowContext'
|
import FlowContext from '@/lib/graph/flowContext'
|
||||||
import { getNodeType } from '@/lib/nodeRegistry'
|
import { getNodeType } from '@/lib/graph/nodeRegistry'
|
||||||
import { MenubarItem, MenubarShortcut } from '@/components/ui/menubar'
|
import { MenubarItem, MenubarShortcut } from '@/components/ui/menubar'
|
||||||
import { Kbd } from '@/components/ui/kbd'
|
import { Kbd } from '@/components/ui/kbd'
|
||||||
import { Code2, Variable } from 'lucide-react'
|
import { Code2, Variable } from 'lucide-react'
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Code2 } from 'lucide-react'
|
import { Code2 } from 'lucide-react'
|
||||||
import { createNodeTypeBuilder } from '@/lib/nodeTypeBuilder'
|
import { createNodeTypeBuilder } from '@/lib/graph/nodeTypeBuilder'
|
||||||
import { NODE_HELP } from '@/lib/nodeHelp'
|
import { NODE_HELP } from '@/lib/graph/nodeHelp'
|
||||||
import type { NodeTypeDescriptor } from '@/lib/nodeRegistry'
|
import type { NodeTypeDescriptor } from '@/lib/graph/nodeRegistry'
|
||||||
import FunctionNode from './FunctionNode'
|
import FunctionNode from './FunctionNode'
|
||||||
|
|
||||||
const ICON_CLASS = 'mr-2 h-4 w-4'
|
const ICON_CLASS = 'mr-2 h-4 w-4'
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import {
|
|||||||
AbstractNodeProps,
|
AbstractNodeProps,
|
||||||
createAbstractNodeComponent,
|
createAbstractNodeComponent,
|
||||||
useAbstractNode,
|
useAbstractNode,
|
||||||
} from '@/lib/abstractNode'
|
} from '@/lib/graph/abstractNode'
|
||||||
import { getConfigContent, getConfigType, getConfigTypeId } from '@/lib/configTypes'
|
import { getConfigContent, getConfigType, getConfigTypeId } from '@/lib/configTypes'
|
||||||
import { getSourceRenderingLogic } from '@/lib/sourceRenderingLogic'
|
import { getSourceRenderingLogic } from '@/lib/sourceRenderingLogic'
|
||||||
import { useSyncConnectionStatus } from '@/lib/nodeLifecycle'
|
import { useSyncConnectionStatus } from '@/lib/graph/nodeLifecycle'
|
||||||
import { useResizeHeight } from '@/hooks/useResizeHeight'
|
import { useResizeHeight } from '@/hooks/useResizeHeight'
|
||||||
import { plantumlLanguage } from '@/lib/plantumlLanguage'
|
import { plantumlLanguage } from '@/lib/plantumlLanguage'
|
||||||
import { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia } from '@/components/ui/empty'
|
import { Empty, EmptyHeader, EmptyTitle, EmptyDescription, EmptyContent, EmptyMedia } from '@/components/ui/empty'
|
||||||
@@ -19,17 +19,17 @@ import {
|
|||||||
BaseNodeContent,
|
BaseNodeContent,
|
||||||
BaseNodeFooter,
|
BaseNodeFooter,
|
||||||
BaseNodeHeaderRow,
|
BaseNodeHeaderRow,
|
||||||
} from '@/components/base/BaseNode'
|
} from '@/components/graph/BaseNode'
|
||||||
import { getDefaultDataForType, getNextNodeId } from '@/lib/flowUtils'
|
import { getDefaultDataForType, getNextNodeId } from '@/lib/graph/flowUtils'
|
||||||
import FlowContext from '@/lib/flowContext'
|
import FlowContext from '@/lib/graph/flowContext'
|
||||||
import { getDefaultStyle, getNodeType } from '@/lib/nodeRegistry'
|
import { getDefaultStyle, getNodeType } from '@/lib/graph/nodeRegistry'
|
||||||
import { NodeFooterEdgeIndicators } from '@/components/base/NodeFooterEdgeIndicators'
|
import { NodeFooterEdgeIndicators } from '@/components/graph/NodeFooterEdgeIndicators'
|
||||||
import { NodeHeaderTitle } from '@/components/base/NodeHeaderTitle'
|
import { NodeHeaderTitle } from '@/components/graph/NodeHeaderTitle'
|
||||||
import { NodeMenubar } from '@/components/base/NodeMenubar'
|
import { NodeMenubar } from '@/components/graph/NodeMenubar'
|
||||||
import { NodeStatusIndicator } from '@/components/base/NodeStatusIndicator'
|
import { NodeStatusIndicator } from '@/components/graph/NodeStatusIndicator'
|
||||||
import { MenubarItem, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger } from '@/components/ui/menubar'
|
import { MenubarItem, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger } from '@/components/ui/menubar'
|
||||||
import { Sparkles, ZoomIn, ZoomOut, RotateCcw, RotateCw, Copy, Play, ChevronDown } from 'lucide-react'
|
import { Sparkles, ZoomIn, ZoomOut, RotateCcw, RotateCw, Copy, Play, ChevronDown } from 'lucide-react'
|
||||||
import { InputHandle } from '@/components/base/NodeHandles'
|
import { InputHandle } from '@/components/graph/NodeHandles'
|
||||||
import { TransformWrapper, TransformComponent } from 'react-zoom-pan-pinch'
|
import { TransformWrapper, TransformComponent } from 'react-zoom-pan-pinch'
|
||||||
import { Input } from '@/components/ui/input'
|
import { Input } from '@/components/ui/input'
|
||||||
import { Button } from '@/components/ui/button'
|
import { Button } from '@/components/ui/button'
|
||||||
@@ -715,7 +715,7 @@ function RenderingNodeComponent({ id, data, width, height, selected }: Props) {
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
const text = rawDisplayContent
|
const text = rawDisplayContent
|
||||||
if (text) {
|
if (text) {
|
||||||
navigator.clipboard?.writeText(text).then(() => toast.success('Copied to clipboard')).catch(() => {})
|
navigator.clipboard?.writeText(text).then(() => toast.success('Copied to clipboard')).catch(() => { })
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
disabled={!rawDisplayContent}
|
disabled={!rawDisplayContent}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Sparkles } from 'lucide-react'
|
import { Sparkles } from 'lucide-react'
|
||||||
import { createNodeTypeBuilder } from '@/lib/nodeTypeBuilder'
|
import { createNodeTypeBuilder } from '@/lib/graph/nodeTypeBuilder'
|
||||||
import { NODE_HELP } from '@/lib/nodeHelp'
|
import { NODE_HELP } from '@/lib/graph/nodeHelp'
|
||||||
import type { NodeTypeDescriptor } from '@/lib/nodeRegistry'
|
import type { NodeTypeDescriptor } from '@/lib/graph/nodeRegistry'
|
||||||
import RenderingNode from './RenderingNode'
|
import RenderingNode from './RenderingNode'
|
||||||
|
|
||||||
const ICON_CLASS = 'mr-2 h-4 w-4'
|
const ICON_CLASS = 'mr-2 h-4 w-4'
|
||||||
|
|||||||
@@ -3,20 +3,20 @@ import {
|
|||||||
AbstractNodeProps,
|
AbstractNodeProps,
|
||||||
createAbstractNodeComponent,
|
createAbstractNodeComponent,
|
||||||
useAbstractNode,
|
useAbstractNode,
|
||||||
} from '@/lib/abstractNode'
|
} from '@/lib/graph/abstractNode'
|
||||||
import {
|
import {
|
||||||
BaseNode,
|
BaseNode,
|
||||||
BaseNodeContent,
|
BaseNodeContent,
|
||||||
BaseNodeFooter,
|
BaseNodeFooter,
|
||||||
BaseNodeHeaderRow,
|
BaseNodeHeaderRow,
|
||||||
} from '@/components/base/BaseNode'
|
} from '@/components/graph/BaseNode'
|
||||||
import { NodeMenubar } from '@/components/base/NodeMenubar'
|
import { NodeMenubar } from '@/components/graph/NodeMenubar'
|
||||||
import { Input } from '@/components/ui/input'
|
import { Input } from '@/components/ui/input'
|
||||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'
|
||||||
import { Switch } from '@/components/ui/switch'
|
import { Switch } from '@/components/ui/switch'
|
||||||
import { NodeFooterEdgeIndicators } from '@/components/base/NodeFooterEdgeIndicators'
|
import { NodeFooterEdgeIndicators } from '@/components/graph/NodeFooterEdgeIndicators'
|
||||||
import { NodeHeaderTitle } from '@/components/base/NodeHeaderTitle'
|
import { NodeHeaderTitle } from '@/components/graph/NodeHeaderTitle'
|
||||||
import { OutputHandle } from '@/components/base/NodeHandles'
|
import { OutputHandle } from '@/components/graph/NodeHandles'
|
||||||
import { Variable } from 'lucide-react'
|
import { Variable } from 'lucide-react'
|
||||||
|
|
||||||
export type ValueType = 'string' | 'number' | 'boolean'
|
export type ValueType = 'string' | 'number' | 'boolean'
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Variable } from 'lucide-react'
|
import { Variable } from 'lucide-react'
|
||||||
import { createNodeTypeBuilder } from '@/lib/nodeTypeBuilder'
|
import { createNodeTypeBuilder } from '@/lib/graph/nodeTypeBuilder'
|
||||||
import { NODE_HELP } from '@/lib/nodeHelp'
|
import { NODE_HELP } from '@/lib/graph/nodeHelp'
|
||||||
import type { NodeTypeDescriptor } from '@/lib/nodeRegistry'
|
import type { NodeTypeDescriptor } from '@/lib/graph/nodeRegistry'
|
||||||
import VariableNode from './VariableNode'
|
import VariableNode from './VariableNode'
|
||||||
|
|
||||||
const ICON_CLASS = 'mr-2 h-4 w-4'
|
const ICON_CLASS = 'mr-2 h-4 w-4'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useCallback, useRef, useState } from 'react'
|
import { useCallback, useRef, useState } from 'react'
|
||||||
import type { AppNode, AppEdge } from '@/lib/nodeTypes'
|
import type { AppNode, AppEdge } from '@/lib/graph/nodeTypes'
|
||||||
|
|
||||||
export type GraphState = { nodes: AppNode[]; edges: AppEdge[] }
|
export type GraphState = { nodes: AppNode[]; edges: AppEdge[] }
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
* - **createAbstractNodeComponent(displayName, Component)** — Wraps with memo + nodePropsAreEqual.
|
* - **createAbstractNodeComponent(displayName, Component)** — Wraps with memo + nodePropsAreEqual.
|
||||||
*
|
*
|
||||||
* **Node lifecycle / connection status:** Nodes that can be updating, paused, or in error should
|
* **Node lifecycle / connection status:** Nodes that can be updating, paused, or in error should
|
||||||
* call useSyncConnectionStatus(id, { updating, error, paused }) from @/lib/nodeLifecycle so edge
|
* call useSyncConnectionStatus(id, { updating, error, paused }) from @/lib/graph/nodeLifecycle so edge
|
||||||
* colors and path animation stay correct. See nodeLifecycle.ts for the full contract.
|
* colors and path animation stay correct. See nodeLifecycle.ts for the full contract.
|
||||||
*
|
*
|
||||||
* Example: define NodeData type, Props = AbstractNodeProps<NodeData>, use useAbstractNode in the
|
* Example: define NodeData type, Props = AbstractNodeProps<NodeData>, use useAbstractNode in the
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { useMemo } from 'react'
|
import React, { useMemo } from 'react'
|
||||||
import type { Connection } from '@xyflow/react'
|
import type { Connection } from '@xyflow/react'
|
||||||
import type { AppNode, AppEdge } from '@/lib/nodeTypes'
|
import type { AppNode, AppEdge } from './nodeTypes'
|
||||||
|
|
||||||
export type ConnectionFrom = { nodeId: string; sourceHandle?: string } | null
|
export type ConnectionFrom = { nodeId: string; sourceHandle?: string } | null
|
||||||
|
|
||||||
@@ -83,4 +83,3 @@ export function getDefaultDataForType(type: string, newId?: string): any {
|
|||||||
export function getResetDataForType(type: string, nodeId?: string): any {
|
export function getResetDataForType(type: string, nodeId?: string): any {
|
||||||
return getResetDataFromRegistry(type, nodeId)
|
return getResetDataFromRegistry(type, nodeId)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5,8 +5,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import type React from 'react'
|
import type React from 'react'
|
||||||
import { registerSourceRenderingLogic } from './sourceRenderingLogic'
|
import { registerSourceRenderingLogic } from '../sourceRenderingLogic'
|
||||||
import type { SourceRenderingLogic } from './sourceRenderingLogic'
|
import type { SourceRenderingLogic } from '../sourceRenderingLogic'
|
||||||
|
|
||||||
/** Node classification for UI: Psyche, Pneuma, Physis, Archon (AI Agent). */
|
/** Node classification for UI: Psyche, Pneuma, Physis, Archon (AI Agent). */
|
||||||
export type NodeClassification = 'psyche' | 'pneuma' | 'physis' | 'archon'
|
export type NodeClassification = 'psyche' | 'pneuma' | 'physis' | 'archon'
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
import type React from 'react'
|
import type React from 'react'
|
||||||
import type { NodeTypeDescriptor, NodeClassification, NodeHelpEntry } from './nodeRegistry'
|
import type { NodeTypeDescriptor, NodeClassification, NodeHelpEntry } from './nodeRegistry'
|
||||||
import type { SourceRenderingLogic } from './sourceRenderingLogic'
|
import type { SourceRenderingLogic } from '../sourceRenderingLogic'
|
||||||
|
|
||||||
type OptionalDescriptor = Partial<
|
type OptionalDescriptor = Partial<
|
||||||
Omit<
|
Omit<
|
||||||
@@ -3,7 +3,7 @@ import { createRoot } from 'react-dom/client'
|
|||||||
import { BrowserRouter, Navigate, Route, Routes } from 'react-router-dom'
|
import { BrowserRouter, Navigate, Route, Routes } from 'react-router-dom'
|
||||||
import { Toaster } from 'sonner'
|
import { Toaster } from 'sonner'
|
||||||
import { ThemeProvider } from './lib/themeContext'
|
import { ThemeProvider } from './lib/themeContext'
|
||||||
import { registerBuiltinNodes } from './lib/registerBuiltinNodes'
|
import { registerBuiltinNodes } from './lib/graph/registerBuiltinNodes'
|
||||||
import { KosmosPage } from './app/kosmos/KosmosPage'
|
import { KosmosPage } from './app/kosmos/KosmosPage'
|
||||||
import { ProjectsPage } from './app/pleroma/PleromaPage'
|
import { ProjectsPage } from './app/pleroma/PleromaPage'
|
||||||
import { KeromaPage } from './app/keroma/KeromaPage'
|
import { KeromaPage } from './app/keroma/KeromaPage'
|
||||||
|
|||||||
Reference in New Issue
Block a user