fix: json schem ui problem

pull/22091/head
Joel 11 months ago
parent 68e9081d05
commit a0621c61d3

@ -44,6 +44,7 @@ const SchemaModal: FC<Props> = ({
<MittProvider> <MittProvider>
<VisualEditorContextProvider> <VisualEditorContextProvider>
<VisualEditor <VisualEditor
className='w-full'
schema={schema} schema={schema}
rootName={rootName} rootName={rootName}
readOnly readOnly

@ -231,7 +231,6 @@ const FormInputItem: FC<Props> = ({
value={varInput?.value as any} value={varInput?.value as any}
isExpand isExpand
isInNode isInNode
height={100}
language={CodeLanguage.json} language={CodeLanguage.json}
onChange={handleValueChange} onChange={handleValueChange}
className='w-full' className='w-full'

@ -2,8 +2,10 @@ import type { FC } from 'react'
import type { SchemaRoot } from '../../../types' import type { SchemaRoot } from '../../../types'
import SchemaNode from './schema-node' import SchemaNode from './schema-node'
import { useSchemaNodeOperations } from './hooks' import { useSchemaNodeOperations } from './hooks'
import cn from '@/utils/classnames'
export type VisualEditorProps = { export type VisualEditorProps = {
className?: string
schema: SchemaRoot schema: SchemaRoot
rootName?: string rootName?: string
readOnly?: boolean readOnly?: boolean
@ -11,11 +13,11 @@ export type VisualEditorProps = {
} }
const VisualEditor: FC<VisualEditorProps> = (props) => { const VisualEditor: FC<VisualEditorProps> = (props) => {
const { schema, readOnly } = props const { className, schema, readOnly } = props
useSchemaNodeOperations(props) useSchemaNodeOperations(props)
return ( return (
<div className='h-full overflow-auto rounded-xl bg-background-section-burn p-1 pl-2'> <div className={cn('h-full overflow-auto rounded-xl bg-background-section-burn p-1 pl-2', className)}>
<SchemaNode <SchemaNode
name={props.rootName || 'structured_output'} name={props.rootName || 'structured_output'}
schema={schema} schema={schema}

Loading…
Cancel
Save