mirror of
https://github.com/langgenius/dify.git
synced 2026-03-28 09:30:55 +08:00
refactor: move skill store to workflow/store/
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
'use client'
|
||||
|
||||
import type { NodeApi, TreeApi } from 'react-arborist'
|
||||
import type { OpensObject } from '../store'
|
||||
import type { TreeNodeData } from '../type'
|
||||
import type { OpensObject } from '@/app/components/workflow/store/workflow/skill-editor-slice'
|
||||
import { RiDragDropLine } from '@remixicon/react'
|
||||
import { useIsMutating } from '@tanstack/react-query'
|
||||
import { useSize } from 'ahooks'
|
||||
|
||||
@ -10,20 +10,19 @@ import type { HistorySliceShape } from './history-slice'
|
||||
import type { LayoutSliceShape } from './layout-slice'
|
||||
import type { NodeSliceShape } from './node-slice'
|
||||
import type { PanelSliceShape } from './panel-slice'
|
||||
import type { SkillEditorSliceShape } from './skill-editor-slice'
|
||||
import type { ToolSliceShape } from './tool-slice'
|
||||
import type { VersionSliceShape } from './version-slice'
|
||||
import type { WorkflowDraftSliceShape } from './workflow-draft-slice'
|
||||
import type { WorkflowSliceShape } from './workflow-slice'
|
||||
import type { RagPipelineSliceShape } from '@/app/components/rag-pipeline/store'
|
||||
import type { WorkflowSliceShape as WorkflowAppSliceShape } from '@/app/components/workflow-app/store/workflow/workflow-slice'
|
||||
import type { SkillEditorSliceShape } from '@/app/components/workflow/skill/store'
|
||||
import { useContext } from 'react'
|
||||
import {
|
||||
useStore as useZustandStore,
|
||||
} from 'zustand'
|
||||
import { createStore } from 'zustand/vanilla'
|
||||
import { WorkflowContext } from '@/app/components/workflow/context'
|
||||
import { createSkillEditorSlice } from '@/app/components/workflow/skill/store'
|
||||
import { createChatVariableSlice } from './chat-variable-slice'
|
||||
import { createInspectVarsSlice } from './debug/inspect-vars-slice'
|
||||
import { createEnvVariableSlice } from './env-variable-slice'
|
||||
@ -32,8 +31,8 @@ import { createHelpLineSlice } from './help-line-slice'
|
||||
import { createHistorySlice } from './history-slice'
|
||||
import { createLayoutSlice } from './layout-slice'
|
||||
import { createNodeSlice } from './node-slice'
|
||||
|
||||
import { createPanelSlice } from './panel-slice'
|
||||
import { createSkillEditorSlice } from './skill-editor-slice'
|
||||
import { createToolSlice } from './tool-slice'
|
||||
import { createVersionSlice } from './version-slice'
|
||||
import { createWorkflowDraftSlice } from './workflow-draft-slice'
|
||||
|
||||
@ -24,7 +24,7 @@ export type TabSliceShape = {
|
||||
isPreviewTab: (fileId: string) => boolean
|
||||
}
|
||||
|
||||
export const createTabSlice: StateCreator<TabSliceShape> = (set, get) => ({
|
||||
const createTabSlice: StateCreator<TabSliceShape> = (set, get) => ({
|
||||
openTabIds: [],
|
||||
activeTabId: null,
|
||||
previewTabId: null,
|
||||
@ -114,7 +114,7 @@ export type FileTreeSliceShape = {
|
||||
getOpensObject: () => OpensObject
|
||||
}
|
||||
|
||||
export const createFileTreeSlice: StateCreator<FileTreeSliceShape> = (set, get) => ({
|
||||
const createFileTreeSlice: StateCreator<FileTreeSliceShape> = (set, get) => ({
|
||||
expandedFolderIds: new Set<string>(),
|
||||
|
||||
setExpandedFolderIds: (ids: Set<string>) => {
|
||||
@ -164,7 +164,7 @@ export type DirtySliceShape = {
|
||||
getDraftContent: (fileId: string) => string | undefined
|
||||
}
|
||||
|
||||
export const createDirtySlice: StateCreator<DirtySliceShape> = (set, get) => ({
|
||||
const createDirtySlice: StateCreator<DirtySliceShape> = (set, get) => ({
|
||||
dirtyContents: new Map<string, string>(),
|
||||
|
||||
setDraftContent: (fileId: string, content: string) => {
|
||||
@ -199,7 +199,7 @@ export type FileOperationsMenuSliceShape = {
|
||||
setContextMenu: (menu: FileOperationsMenuSliceShape['contextMenu']) => void
|
||||
}
|
||||
|
||||
export const createFileOperationsMenuSlice: StateCreator<FileOperationsMenuSliceShape> = set => ({
|
||||
const createFileOperationsMenuSlice: StateCreator<FileOperationsMenuSliceShape> = set => ({
|
||||
contextMenu: null,
|
||||
|
||||
setContextMenu: (contextMenu) => {
|
||||
Reference in New Issue
Block a user