fix: global variable during debug & variable update textarea rerender (#2553)

* fix: global variable during debug & variable update textarea rerender

* update var node use prompt editor

* fix
This commit is contained in:
heheer
2024-08-29 14:09:20 +08:00
committed by GitHub
parent 0632dfed80
commit 034108c218
8 changed files with 128 additions and 65 deletions

View File

@@ -40,14 +40,20 @@ const PromptEditor = ({
const { isOpen, onOpen, onClose } = useDisclosure();
const { t } = useTranslation();
const onChangeInput = useCallback((editorState: EditorState, editor: LexicalEditor) => {
const text = editorStateToText(editor).replaceAll('}}{{', '}} {{');
onChange?.(text);
}, []);
const onBlurInput = useCallback((editor: LexicalEditor) => {
const text = editorStateToText(editor).replaceAll('}}{{', '}} {{');
onBlur?.(text);
}, []);
const onChangeInput = useCallback(
(editorState: EditorState, editor: LexicalEditor) => {
const text = editorStateToText(editor).replaceAll('}}{{', '}} {{');
onChange?.(text);
},
[onChange]
);
const onBlurInput = useCallback(
(editor: LexicalEditor) => {
const text = editorStateToText(editor).replaceAll('}}{{', '}} {{');
onBlur?.(text);
},
[onBlur]
);
return (
<>