@seed-ship/mcp-ui-solid 2.11.0 → 2.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -440,11 +440,21 @@ const EmbeddedFormSection: Component<{
440
440
 
441
441
  const handleSubmit = (e: Event) => {
442
442
  e.preventDefault()
443
- // Use dedicated onSubmit if provided, fallback to onAction
443
+
444
+ // Filter out unsupported fields, keep only values with content
445
+ const values = Object.fromEntries(
446
+ Object.entries(formData())
447
+ .filter(([key]) => {
448
+ const field = config().fields.find((f: any) => f.name === key)
449
+ return field?.fieldStatus !== 'unsupported'
450
+ })
451
+ .filter(([, v]) => v !== undefined && v !== '' && !(Array.isArray(v) && v.length === 0))
452
+ )
453
+
444
454
  if (props.onSubmit) {
445
- props.onSubmit(props.sectionId, formData())
455
+ props.onSubmit(props.sectionId, values)
446
456
  } else {
447
- props.onAction?.('submit_form', { sectionId: props.sectionId, values: formData() })
457
+ props.onAction?.('submit_form', { sectionId: props.sectionId, values })
448
458
  }
449
459
  }
450
460
 
@@ -359,6 +359,12 @@ export interface FormFieldParams {
359
359
  extraParams?: Record<string, string>
360
360
  }
361
361
 
362
+ // Field status — API capability indicator
363
+ /** Whether this field is supported by the target API/dataset */
364
+ fieldStatus?: 'required' | 'optional' | 'unsupported' | 'unknown'
365
+ /** Human-readable explanation of the status */
366
+ statusReason?: string
367
+
362
368
  // Checkbox specific
363
369
  checkboxLabel?: string
364
370