feat: synchronize input/output variables in the panel with generated code by the code generator (#10150)

This commit is contained in:
Kota-Yamaguchi
2024-11-01 12:39:32 +09:00
committed by GitHub
parent fafa5938da
commit f674de4f5d
5 changed files with 442 additions and 8 deletions

View File

@@ -31,6 +31,7 @@ export type Props = {
noWrapper?: boolean
isExpand?: boolean
showFileList?: boolean
onGenerated?: (value: string) => void
showCodeGenerator?: boolean
}
@@ -64,6 +65,7 @@ const CodeEditor: FC<Props> = ({
noWrapper,
isExpand,
showFileList,
onGenerated,
showCodeGenerator = false,
}) => {
const [isFocus, setIsFocus] = React.useState(false)
@@ -151,9 +153,6 @@ const CodeEditor: FC<Props> = ({
return isFocus ? 'focus-theme' : 'blur-theme'
})()
const handleGenerated = (code: string) => {
handleEditorChange(code)
}
const main = (
<>
@@ -205,7 +204,7 @@ const CodeEditor: FC<Props> = ({
isFocus={isFocus && !readOnly}
minHeight={minHeight}
isInNode={isInNode}
onGenerated={handleGenerated}
onGenerated={onGenerated}
codeLanguages={language}
fileList={fileList}
showFileList={showFileList}