mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +08:00
chore(web): new lint setup (#30020)
Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
This commit is contained in:
@ -1,10 +1,11 @@
|
||||
import { type FC, useEffect } from 'react'
|
||||
import { GeneratorType } from '@/app/components/app/configuration/config/automatic/types'
|
||||
import type { FC } from 'react'
|
||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
|
||||
import { useSelectOrDelete } from '../../hooks'
|
||||
import { CurrentBlockNode, DELETE_CURRENT_BLOCK_COMMAND } from '.'
|
||||
import { useEffect } from 'react'
|
||||
import { GeneratorType } from '@/app/components/app/configuration/config/automatic/types'
|
||||
import { cn } from '@/utils/classnames'
|
||||
import { CurrentBlockNode, DELETE_CURRENT_BLOCK_COMMAND } from '.'
|
||||
import { CodeAssistant, MagicEdit } from '../../../icons/src/vender/line/general'
|
||||
import { useSelectOrDelete } from '../../hooks'
|
||||
|
||||
type CurrentBlockComponentProps = {
|
||||
nodeKey: string
|
||||
@ -35,8 +36,8 @@ const CurrentBlockComponent: FC<CurrentBlockComponentProps> = ({
|
||||
}}
|
||||
ref={ref}
|
||||
>
|
||||
<Icon className='mr-0.5 h-[14px] w-[14px]' />
|
||||
<div className='text-xs font-medium'>{generatorType === GeneratorType.prompt ? 'current_prompt' : 'current_code'}</div>
|
||||
<Icon className="mr-0.5 h-[14px] w-[14px]" />
|
||||
<div className="text-xs font-medium">{generatorType === GeneratorType.prompt ? 'current_prompt' : 'current_code'}</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
import type { CurrentBlockType } from '../../types'
|
||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
|
||||
import { mergeRegister } from '@lexical/utils'
|
||||
import { $applyNodeReplacement } from 'lexical'
|
||||
import {
|
||||
memo,
|
||||
useCallback,
|
||||
useEffect,
|
||||
} from 'react'
|
||||
import { $applyNodeReplacement } from 'lexical'
|
||||
import { mergeRegister } from '@lexical/utils'
|
||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
|
||||
import { decoratorTransform } from '../../utils'
|
||||
import { CURRENT_PLACEHOLDER_TEXT } from '../../constants'
|
||||
import type { CurrentBlockType } from '../../types'
|
||||
import { decoratorTransform } from '../../utils'
|
||||
import { CustomTextNode } from '../custom-text/node'
|
||||
import {
|
||||
$createCurrentBlockNode,
|
||||
CurrentBlockNode,
|
||||
} from './node'
|
||||
import { CustomTextNode } from '../custom-text/node'
|
||||
|
||||
const REGEX = new RegExp(CURRENT_PLACEHOLDER_TEXT)
|
||||
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
import {
|
||||
memo,
|
||||
useEffect,
|
||||
} from 'react'
|
||||
import type { CurrentBlockType } from '../../types'
|
||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
|
||||
import { mergeRegister } from '@lexical/utils'
|
||||
import {
|
||||
$insertNodes,
|
||||
COMMAND_PRIORITY_EDITOR,
|
||||
createCommand,
|
||||
} from 'lexical'
|
||||
import { mergeRegister } from '@lexical/utils'
|
||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
|
||||
import type { CurrentBlockType } from '../../types'
|
||||
import {
|
||||
memo,
|
||||
useEffect,
|
||||
} from 'react'
|
||||
import {
|
||||
$createCurrentBlockNode,
|
||||
CurrentBlockNode,
|
||||
@ -62,5 +62,5 @@ const CurrentBlock = memo(({
|
||||
CurrentBlock.displayName = 'CurrentBlock'
|
||||
|
||||
export { CurrentBlock }
|
||||
export { CurrentBlockNode } from './node'
|
||||
export { default as CurrentBlockReplacementBlock } from './current-block-replacement-block'
|
||||
export { CurrentBlockNode } from './node'
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import type { LexicalNode, NodeKey, SerializedLexicalNode } from 'lexical'
|
||||
import type { GeneratorType } from '@/app/components/app/configuration/config/automatic/types'
|
||||
import { DecoratorNode } from 'lexical'
|
||||
import CurrentBlockComponent from './component'
|
||||
import type { GeneratorType } from '@/app/components/app/configuration/config/automatic/types'
|
||||
|
||||
export type SerializedNode = SerializedLexicalNode & { generatorType: GeneratorType; }
|
||||
export type SerializedNode = SerializedLexicalNode & { generatorType: GeneratorType }
|
||||
|
||||
export class CurrentBlockNode extends DecoratorNode<React.JSX.Element> {
|
||||
__generatorType: GeneratorType
|
||||
|
||||
Reference in New Issue
Block a user