mirror of
https://github.com/labring/FastGPT.git
synced 2026-05-06 01:02:54 +08:00
fix: document deploy (#5868)
* mcp memory * Editor space parse error * fix: ts * fix: debug interactive * fix: templateId * fix: editor in debug * doc
This commit is contained in:
@@ -30,6 +30,7 @@ import FocusPlugin from '../../Textarea/PromptEditor/plugins/FocusPlugin';
|
||||
import VariableLabelPlugin from '../../Textarea/PromptEditor/plugins/VariableLabelPlugin';
|
||||
import { VariableLabelNode } from '../../Textarea/PromptEditor/plugins/VariableLabelPlugin/node';
|
||||
import VariableLabelPickerPlugin from '../../Textarea/PromptEditor/plugins/VariableLabelPickerPlugin';
|
||||
import { useDeepCompareEffect } from 'ahooks';
|
||||
|
||||
export default function Editor({
|
||||
h = 40,
|
||||
@@ -45,7 +46,7 @@ export default function Editor({
|
||||
h?: number;
|
||||
variables: EditorVariablePickerType[];
|
||||
variableLabels: EditorVariableLabelPickerType[];
|
||||
onChange?: (editorState: EditorState, editor: LexicalEditor) => void;
|
||||
onChange?: (editor: LexicalEditor) => void;
|
||||
onBlur?: (editor: LexicalEditor) => void;
|
||||
value?: string;
|
||||
currentValue?: string;
|
||||
@@ -61,11 +62,11 @@ export default function Editor({
|
||||
nodes: [VariableNode, VariableLabelNode],
|
||||
editorState: textToEditorState(value),
|
||||
onError: (error: Error) => {
|
||||
throw error;
|
||||
console.error('Lexical errror', error);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
useDeepCompareEffect(() => {
|
||||
if (focus) return;
|
||||
setKey(getNanoid(6));
|
||||
}, [value, variables.length]);
|
||||
@@ -119,7 +120,7 @@ export default function Editor({
|
||||
<OnChangePlugin
|
||||
onChange={(editorState: EditorState, editor: LexicalEditor) => {
|
||||
startSts(() => {
|
||||
onChange?.(editorState, editor);
|
||||
onChange?.(editor);
|
||||
});
|
||||
}}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user