dify/web/app/components/workflow/utils/gen-node-meta-data.ts
yyh 2ec34b2cfb
feat(workflow): improve block selector navigation and previews (#39212)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-18 09:56:36 +00:00

45 lines
988 B
TypeScript

import type { BlockEnum } from '@/app/components/workflow/types'
import type { UseDifyNodesPath } from '@/types/doc-paths'
import { BlockClassification } from '@/app/components/workflow/block-selector/types'
type GenNodeMetaDataParams = {
classification?: BlockClassification
sort: number
type: BlockEnum
title?: string
author?: string
helpLinkUri?: UseDifyNodesPath
isRequired?: boolean
isUndeletable?: boolean
isStart?: boolean
isSingleton?: boolean
isTypeFixed?: boolean
}
export const genNodeMetaData = ({
classification = BlockClassification.Default,
sort,
type,
title = '',
author = 'Dify',
helpLinkUri,
isRequired = false,
isUndeletable = false,
isStart = false,
isSingleton = false,
isTypeFixed = false,
}: GenNodeMetaDataParams) => {
return {
classification,
sort,
type,
title,
author,
helpLinkUri: helpLinkUri || type,
isRequired,
isUndeletable,
isStart,
isSingleton,
isTypeFixed,
}
}