mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-08 22:48:14 -05:00
Reorganized state files
This commit is contained in:
@@ -9,13 +9,13 @@ import ReactFlow, {
|
||||
ConnectionLineType,
|
||||
} from 'reactflow'
|
||||
import { getBlock } from '../../../../../blocks'
|
||||
import { useWorkflowStore } from '@/stores/workflow/workflow-store'
|
||||
import { useNotificationStore } from '@/stores/notifications/notifications-store'
|
||||
import { useWorkflowStore } from '@/stores/workflow/store'
|
||||
import { useNotificationStore } from '@/stores/notifications/store'
|
||||
import { useWorkflowExecution } from '../../../hooks/use-workflow-execution'
|
||||
import { NotificationList } from '@/app/w/components/notifications/notifications'
|
||||
import { WorkflowNode } from '../workflow-node/workflow-node'
|
||||
import { CustomEdge } from '../custom-edge/custom-edge'
|
||||
import { initializeStateLogger } from '@/stores/workflow/state-logger'
|
||||
import { initializeStateLogger } from '@/stores/workflow/logger'
|
||||
|
||||
// Define custom node and edge types for ReactFlow
|
||||
const nodeTypes: NodeTypes = { workflowBlock: WorkflowNode }
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
import { ReactFlowProvider } from 'reactflow'
|
||||
import 'reactflow/dist/style.css'
|
||||
import { useWorkflowRegistry } from '@/stores/workflow/workflow-registry'
|
||||
import { useWorkflowRegistry } from '@/stores/workflow/registry'
|
||||
import { useParams, useRouter } from 'next/navigation'
|
||||
import { WorkflowCanvas } from './components/workflow-canvas/workflow-canvas'
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
NotificationType,
|
||||
NotificationStore,
|
||||
} from '@/stores/notifications/types'
|
||||
import { useNotificationStore } from '@/stores/notifications/notifications-store'
|
||||
import { useNotificationStore } from '@/stores/notifications/store'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { ErrorIcon } from '@/components/icons'
|
||||
import { useState, useEffect } from 'react'
|
||||
|
||||
@@ -8,14 +8,14 @@ import {
|
||||
DropdownMenuTrigger,
|
||||
} from '@/components/ui/dropdown-menu'
|
||||
import { History, Bell, Play, Trash2 } from 'lucide-react'
|
||||
import { useNotificationStore } from '@/stores/notifications/notifications-store'
|
||||
import { useNotificationStore } from '@/stores/notifications/store'
|
||||
import { NotificationDropdownItem } from './components/notification-dropdown-item'
|
||||
import { useWorkflowStore } from '@/stores/workflow/workflow-store'
|
||||
import { useWorkflowStore } from '@/stores/workflow/store'
|
||||
import { HistoryDropdownItem } from './components/history-dropdown-item'
|
||||
import { formatDistanceToNow } from 'date-fns'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useWorkflowExecution } from '../../hooks/use-workflow-execution'
|
||||
import { useWorkflowRegistry } from '@/stores/workflow/workflow-registry'
|
||||
import { useWorkflowRegistry } from '@/stores/workflow/registry'
|
||||
import { useRouter } from 'next/navigation'
|
||||
import {
|
||||
Tooltip,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
import { AlertCircle, Terminal } from 'lucide-react'
|
||||
import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert'
|
||||
import { useNotificationStore } from '@/stores/notifications/notifications-store'
|
||||
import { useNotificationStore } from '@/stores/notifications/store'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { ErrorIcon } from '@/components/icons'
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
TooltipTrigger,
|
||||
} from '@/components/ui/tooltip'
|
||||
import { AgentIcon } from '@/components/icons'
|
||||
import { useWorkflowRegistry } from '@/stores/workflow/workflow-registry'
|
||||
import { useWorkflowRegistry } from '@/stores/workflow/registry'
|
||||
import { useRouter } from 'next/navigation'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { useState } from 'react'
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
ArrowLeftRight,
|
||||
ArrowUpDown,
|
||||
} from 'lucide-react'
|
||||
import { useWorkflowStore } from '@/stores/workflow/workflow-store'
|
||||
import { useWorkflowStore } from '@/stores/workflow/store'
|
||||
import {
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useWorkflowStore } from '@/stores/workflow/workflow-store'
|
||||
import { useWorkflowStore } from '@/stores/workflow/store'
|
||||
import { useCallback } from 'react'
|
||||
|
||||
export function useSubBlockValue(blockId: string, subBlockId: string) {
|
||||
|
||||
@@ -6,7 +6,7 @@ import { cn } from '@/lib/utils'
|
||||
import { ActionBar } from './components/action-bar/action-bar'
|
||||
import { ConnectionBlocks } from './components/connection-blocks/connection-blocks'
|
||||
import { useState } from 'react'
|
||||
import { useWorkflowStore } from '@/stores/workflow/workflow-store'
|
||||
import { useWorkflowStore } from '@/stores/workflow/store'
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
|
||||
interface WorkflowBlockProps {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useWorkflowStore } from '@/stores/workflow/workflow-store'
|
||||
import { useWorkflowStore } from '@/stores/workflow/store'
|
||||
import { shallow } from 'zustand/shallow'
|
||||
|
||||
export interface ConnectedBlock {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { useCallback, useState } from 'react'
|
||||
import { useWorkflowStore } from '@/stores/workflow/workflow-store'
|
||||
import { useWorkflowStore } from '@/stores/workflow/store'
|
||||
import { Serializer } from '@/serializer'
|
||||
import { Executor } from '@/executor'
|
||||
import { ExecutionResult } from '@/executor/types'
|
||||
import { useNotificationStore } from '@/stores/notifications/notifications-store'
|
||||
import { useWorkflowRegistry } from '@/stores/workflow/workflow-registry'
|
||||
import { useNotificationStore } from '@/stores/notifications/store'
|
||||
import { useWorkflowRegistry } from '@/stores/workflow/registry'
|
||||
|
||||
export function useWorkflowExecution() {
|
||||
const [isExecuting, setIsExecuting] = useState(false)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useWorkflowStore } from './workflow-store'
|
||||
import { useWorkflowStore } from './store'
|
||||
|
||||
export function initializeStateLogger() {
|
||||
useWorkflowStore.subscribe((state) => {
|
||||
@@ -1,7 +1,7 @@
|
||||
import { create } from 'zustand'
|
||||
import { devtools } from 'zustand/middleware'
|
||||
import { WorkflowRegistry, WorkflowMetadata } from './registry-types'
|
||||
import { useWorkflowStore } from './workflow-store'
|
||||
import { useWorkflowStore } from './store'
|
||||
|
||||
export const useWorkflowRegistry = create<WorkflowRegistry>()(
|
||||
devtools(
|
||||
@@ -3,7 +3,7 @@ import { devtools } from 'zustand/middleware'
|
||||
import { Edge } from 'reactflow'
|
||||
import { Position, SubBlockState, WorkflowStore } from './types'
|
||||
import { getBlock } from '@/blocks'
|
||||
import { withHistory, WorkflowStoreWithHistory, pushHistory } from './history-middleware'
|
||||
import { withHistory, WorkflowStoreWithHistory, pushHistory } from './middleware'
|
||||
import { resolveOutputType } from '@/blocks/utils'
|
||||
|
||||
const initialState = {
|
||||
Reference in New Issue
Block a user