@@ -19,7 +19,6 @@ import {
1919 Modal ,
2020 Tabs ,
2121} from '@cloudscape-design/components' ;
22- import Editor from '@monaco-editor/react' ;
2322import SchemaBuilder from '../json-schema-builder/SchemaBuilder' ;
2423
2524// Add custom styles for compact form layout
@@ -571,9 +570,7 @@ const ConfigBuilder = ({
571570 // Check dependencies FIRST, before any rendering - applies to all field types
572571 if ( property . dependsOn ) {
573572 const dependencyField = property . dependsOn . field ;
574- const dependencyValues = Array . isArray ( property . dependsOn . values )
575- ? property . dependsOn . values
576- : [ property . dependsOn . value ] ;
573+ const dependencyValues = Array . isArray ( property . dependsOn . values ) ? property . dependsOn . values : [ property . dependsOn . value ] ;
577574
578575 let dependencyPath ;
579576
@@ -619,8 +616,7 @@ const ConfigBuilder = ({
619616 dependencyValueType : typeof dependencyValue ,
620617 dependencyValues,
621618 dependencyValuesTypes : dependencyValues . map ( ( v ) => typeof v ) ,
622- isNestedAttribute :
623- currentPath . includes ( 'groupAttributes[' ) || currentPath . includes ( 'listItemTemplate.itemAttributes[' ) ,
619+ isNestedAttribute : currentPath . includes ( 'groupAttributes[' ) || currentPath . includes ( 'listItemTemplate.itemAttributes[' ) ,
624620 shouldHide : dependencyValue === undefined || ! dependencyValues . includes ( dependencyValue ) ,
625621 } ) ;
626622
@@ -793,9 +789,7 @@ const ConfigBuilder = ({
793789 < SpaceBetween size = "xs" >
794790 { getSortedObjectProperties ( property . properties ) . map ( ( { propKey, propSchema } ) => {
795791 const nestedPropSchema =
796- propSchema . type === 'list' || propSchema . type === 'array'
797- ? { ...propSchema , nestLevel : nestLevel + 1 }
798- : propSchema ;
792+ propSchema . type === 'list' || propSchema . type === 'array' ? { ...propSchema , nestLevel : nestLevel + 1 } : propSchema ;
799793 return < Box key = { propKey } > { renderField ( propKey , nestedPropSchema , fullPath ) } </ Box > ;
800794 } ) }
801795 </ SpaceBetween >
@@ -979,22 +973,18 @@ const ConfigBuilder = ({
979973 // Special handling for nested attributes looking for attributeType
980974 if (
981975 dependencyField === 'attributeType' &&
982- ( fieldPath . includes ( 'groupAttributes[' ) ||
983- fieldPath . includes ( 'listItemTemplate.itemAttributes[' ) )
976+ ( fieldPath . includes ( 'groupAttributes[' ) || fieldPath . includes ( 'listItemTemplate.itemAttributes[' ) )
984977 ) {
985978 if ( fieldPath . includes ( 'groupAttributes[' ) ) {
986979 const attributeMatch = fieldPath . match ( / ^ ( .+ \. a t t r i b u t e s \[ \d + \] ) \. g r o u p A t t r i b u t e s / ) ;
987980 dependencyPath = attributeMatch ? `${ attributeMatch [ 1 ] } .attributeType` : null ;
988981 } else if ( fieldPath . includes ( 'listItemTemplate.itemAttributes[' ) ) {
989- const attributeMatch = fieldPath . match (
990- / ^ ( .+ \. a t t r i b u t e s \[ \d + \] ) \. l i s t I t e m T e m p l a t e \. i t e m A t t r i b u t e s / ,
991- ) ;
982+ const attributeMatch = fieldPath . match ( / ^ ( .+ \. a t t r i b u t e s \[ \d + \] ) \. l i s t I t e m T e m p l a t e \. i t e m A t t r i b u t e s / ) ;
992983 dependencyPath = attributeMatch ? `${ attributeMatch [ 1 ] } .attributeType` : null ;
993984 }
994985 } else {
995986 const parentPath = fieldPath . substring ( 0 , fieldPath . lastIndexOf ( '.' ) ) ;
996- dependencyPath =
997- parentPath . length > 0 ? `${ parentPath } .${ dependencyField } ` : dependencyField ;
987+ dependencyPath = parentPath . length > 0 ? `${ parentPath } .${ dependencyField } ` : dependencyField ;
998988 }
999989
1000990 if ( ! dependencyPath ) return false ;
@@ -1081,17 +1071,13 @@ const ConfigBuilder = ({
10811071 // Render the regular fields using HTML table for guaranteed columns
10821072 const renderedRegularFields = (
10831073 < Box padding = "0" style = { { margin : 0 } } >
1084- < table
1085- style = { { width : '100%' , borderCollapse : 'separate' , borderSpacing : '4px 0' , margin : 0 } }
1086- >
1074+ < table style = { { width : '100%' , borderCollapse : 'separate' , borderSpacing : '4px 0' , margin : 0 } } >
10871075 < tbody style = { { margin : 0 , padding : 0 } } >
10881076 { /* Render description field first if it exists, spanning full width */ }
10891077 { descriptionField && (
10901078 < tr key = "description-row" >
10911079 < td colSpan = { actualColumnCount } style = { { verticalAlign : 'top' } } >
1092- < Box padding = "0" >
1093- { renderField ( descriptionField . propKey , descriptionField . propSchema , itemPath ) }
1094- </ Box >
1080+ < Box padding = "0" > { renderField ( descriptionField . propKey , descriptionField . propSchema , itemPath ) } </ Box >
10951081 </ td >
10961082 </ tr >
10971083 ) }
@@ -1164,12 +1150,7 @@ const ConfigBuilder = ({
11641150 } ;
11651151
11661152 return (
1167- < Box
1168- key = { propKey }
1169- padding = { { top : '0' , bottom : '8px' } }
1170- width = "100%"
1171- margin = { { bottom : '4px' } }
1172- >
1153+ < Box key = { propKey } padding = { { top : '0' , bottom : '8px' } } width = "100%" margin = { { bottom : '4px' } } >
11731154 { renderField ( propKey , nestedProps , itemPath ) }
11741155 </ Box >
11751156 ) ;
@@ -1190,9 +1171,7 @@ const ConfigBuilder = ({
11901171 } ) ( )
11911172 ) : (
11921173 // Simple list item (non-object)
1193- < Box padding = "xs" >
1194- { renderInputField ( `${ key } [${ index } ]` , property . items , values [ index ] , itemPath ) }
1195- </ Box >
1174+ < Box padding = "xs" > { renderInputField ( `${ key } [${ index } ]` , property . items , values [ index ] , itemPath ) } </ Box >
11961175 ) }
11971176 </ Box >
11981177 </ Box >
@@ -1347,11 +1326,7 @@ const ConfigBuilder = ({
13471326 options = { property . enum . map ( ( opt ) => ( { value : opt , label : opt } ) ) }
13481327 />
13491328 ) ;
1350- } else if (
1351- property . format === 'text-area' ||
1352- path . toLowerCase ( ) . includes ( 'prompt' ) ||
1353- path . toLowerCase ( ) . includes ( 'description' )
1354- ) {
1329+ } else if ( property . format === 'text-area' || path . toLowerCase ( ) . includes ( 'prompt' ) || path . toLowerCase ( ) . includes ( 'description' ) ) {
13551330 input = (
13561331 < Textarea
13571332 value = { displayValue !== undefined && displayValue !== null ? String ( displayValue ) : '' }
@@ -1434,9 +1409,7 @@ const ConfigBuilder = ({
14341409
14351410 // Check if a property needs a container with section header
14361411 const shouldUseContainer = ( key , property ) => {
1437- return (
1438- property . sectionLabel && ( property . type === 'object' || property . type === 'list' || property . type === 'array' )
1439- ) ;
1412+ return property . sectionLabel && ( property . type === 'object' || property . type === 'list' || property . type === 'array' ) ;
14401413 } ;
14411414
14421415 // Render each top-level property
@@ -1489,11 +1462,7 @@ const ConfigBuilder = ({
14891462 label : 'Document Schema' ,
14901463 content : (
14911464 < Box style = { { height : 'calc(70vh - 60px)' } } >
1492- < SchemaBuilder
1493- initialSchema = { extractionSchema }
1494- onChange = { onSchemaChange }
1495- onValidate = { onSchemaValidate }
1496- />
1465+ < SchemaBuilder initialSchema = { extractionSchema } onChange = { onSchemaChange } onValidate = { onSchemaValidate } />
14971466 </ Box >
14981467 ) ,
14991468 } ,
@@ -1521,10 +1490,7 @@ const ConfigBuilder = ({
15211490 { activeAddModal && (
15221491 < FormField
15231492 label = "Name"
1524- description = {
1525- getPropertyFromPath ( activeAddModal ) ?. items ?. properties ?. name ?. description ||
1526- 'Enter a unique name for this item'
1527- }
1493+ description = { getPropertyFromPath ( activeAddModal ) ?. items ?. properties ?. name ?. description || 'Enter a unique name for this item' }
15281494 errorText = { nameError }
15291495 >
15301496 { showNameAsDropdown ? (
@@ -1544,7 +1510,6 @@ const ConfigBuilder = ({
15441510 label : opt ,
15451511 } ) ) || [ ]
15461512 }
1547- autoFocus
15481513 />
15491514 ) : (
15501515 // Text input for regular string values
@@ -1557,7 +1522,6 @@ const ConfigBuilder = ({
15571522 }
15581523 } }
15591524 placeholder = "Enter name"
1560- autoFocus
15611525 />
15621526 ) }
15631527 </ FormField >
0 commit comments