feat:新增dify1.11.1版本

This commit is contained in:
2025-12-15 15:38:42 +08:00
parent 2fb63ebf62
commit 9a846bbe13
7572 changed files with 1052887 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
import { createContext, useContext, useContextSelector } from 'use-context-selector'
import { useMitt } from '@/hooks/use-mitt'
import { noop } from 'lodash-es'
type ContextValueType = ReturnType<typeof useMitt>
export const MittContext = createContext<ContextValueType>({
emit: noop,
useSubscribe: noop,
})
export const MittProvider = ({ children }: { children: React.ReactNode }) => {
const mitt = useMitt()
return (
<MittContext.Provider value={mitt}>
{children}
</MittContext.Provider>
)
}
export const useMittContext = () => {
return useContext(MittContext)
}
export function useMittContextSelector<T>(selector: (value: ContextValueType) => T): T {
return useContextSelector(MittContext, selector)
}