fix: prompt-editor

This commit is contained in:
StyleZhang
2024-04-02 19:55:39 +08:00
parent 01c6a35966
commit d260e6b064
3 changed files with 5 additions and 23 deletions

View File

@ -1,13 +0,0 @@
import { useEffect } from 'react'
import { registerCodeHighlighting } from '@lexical/code'
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
export default function CodeHighlightPlugin() {
const [editor] = useLexicalComposerContext()
useEffect(() => {
return registerCodeHighlighting(editor)
}, [editor])
return null
}

View File

@ -125,7 +125,7 @@ const ComponentPicker = ({
anchorElementRef,
{ selectedIndex, selectOptionAndCleanUp, setHighlightedIndex },
) => {
if (anchorElementRef.current && (allOptions.length || workflowVariableOptions.length)) {
if (anchorElementRef.current && (allOptions.length || workflowVariableBlock?.show)) {
return (
<>
{
@ -224,7 +224,7 @@ const ComponentPicker = ({
)
}
{
!!workflowVariableOptions.length && (
workflowVariableBlock?.show && (
<>
{
(!!promptOptions.length || !!variableOptions.length || !!externalToolOptions.length) && (
@ -257,8 +257,9 @@ const ComponentPicker = ({
promptOptions,
variableOptions,
externalToolOptions,
workflowVariableOptions,
queryString,
workflowVariableBlock?.show,
workflowVariableOptions,
handleSelectWorkflowVariable,
elements,
floatingStyles,