feat: Delete ComponentBindingDialog and DataSourceEditorDialog wrappers, update exports

- Deleted ComponentBindingDialogWrapper.tsx and DataSourceEditorDialogWrapper.tsx
- These already have JSON definitions and were exported from json-components
- Updated molecules/index.ts to export from json-components instead of wrappers
- Reduced remaining wrappers from 6 to 4
- All deleted wrappers now pure JSON components

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-18 23:29:36 +00:00
parent 4c17cc49c1
commit db8759f9e0
3 changed files with 9 additions and 93 deletions

View File

@@ -1,47 +0,0 @@
import type { ChangeEvent } from 'react'
import { ComponentRenderer } from '@/lib/json-ui/component-renderer'
import { cn } from '@/lib/utils'
import componentBindingDialogDefinition from './definitions/component-binding-dialog.json'
import type { ComponentBindingDialogWrapperProps } from './interfaces'
export function ComponentBindingDialogWrapper({
open = false,
title = 'Component Bindings',
description = 'Connect component props to data sources.',
componentType,
componentId,
bindings = [],
onBindingChange,
onSave,
onCancel,
onOpenChange,
className,
}: ComponentBindingDialogWrapperProps) {
const handleBindingFieldChange = (event: ChangeEvent<HTMLInputElement>) => {
const fieldId = event.currentTarget?.dataset?.fieldId || event.target?.dataset?.fieldId
if (!fieldId) return
onBindingChange?.(fieldId, event.target.value)
}
return (
<ComponentRenderer
component={componentBindingDialogDefinition}
data={{
open,
title,
description,
componentType,
componentId,
bindingFields: bindings,
emptyMessage: 'No bindings configured.',
contentClassName: cn('max-w-2xl', className),
onBindingFieldChange: handleBindingFieldChange,
onSave,
onCancel,
onOpenChange,
cancelLabel: 'Cancel',
saveLabel: 'Save',
}}
/>
)
}

View File

@@ -1,43 +0,0 @@
import type { ChangeEvent } from 'react'
import { ComponentRenderer } from '@/lib/json-ui/component-renderer'
import { cn } from '@/lib/utils'
import dataSourceEditorDialogDefinition from './definitions/data-source-editor-dialog.json'
import type { DataSourceEditorDialogWrapperProps } from './interfaces'
export function DataSourceEditorDialogWrapper({
open = false,
title = 'Data Source',
description = 'Update data source details and fields.',
fields = [],
onFieldChange,
onSave,
onCancel,
onOpenChange,
className,
}: DataSourceEditorDialogWrapperProps) {
const handleFieldChange = (event: ChangeEvent<HTMLInputElement>) => {
const fieldId = event.currentTarget?.dataset?.fieldId || event.target?.dataset?.fieldId
if (!fieldId) return
onFieldChange?.(fieldId, event.target.value)
}
return (
<ComponentRenderer
component={dataSourceEditorDialogDefinition}
data={{
open,
title,
description,
fields,
emptyMessage: 'No fields configured.',
contentClassName: cn('max-w-2xl', className),
onFieldChange: handleFieldChange,
onSave,
onCancel,
onOpenChange,
cancelLabel: 'Cancel',
saveLabel: 'Save',
}}
/>
)
}

View File

@@ -16,9 +16,15 @@ export { ToolbarButton } from './ToolbarButton'
export { TreeFormDialog } from './TreeFormDialog'
export { SearchInput } from './SearchInput'
export { BindingEditor } from './BindingEditor'
export { DataSourceEditorDialog } from './DataSourceEditorDialog'
export { ComponentBindingDialog } from './ComponentBindingDialog'
export { TreeCard } from './TreeCard'
export { TreeListHeader } from './TreeListHeader'
export { LoadingFallback, NavigationItem, PageHeaderContent } from '@/lib/json-ui/json-components'
export {
LoadingFallback,
NavigationItem,
PageHeaderContent,
ComponentBindingDialog,
DataSourceEditorDialog,
GitHubBuildStatus as GitHubBuildStatusJSON,
SaveIndicator as SaveIndicatorJSON
} from '@/lib/json-ui/json-components'
export { preloadMonacoEditor } from './LazyMonacoEditor'