mirror of
https://github.com/johndoe6345789/low-code-react-app-b.git
synced 2026-04-24 13:44:54 +00:00
Converts two additional components to JSON architecture with custom hooks: - ConflictDetailsDialog: Dialog component with conflict diff analysis - DataBindingDesigner: Designer for data binding configuration Includes: - JSON definitions in src/components/json-definitions/ - Custom hooks (useConflictDetailsDialog, useDataBindingDesigner) - TypeScript interfaces for type safety - Registry updates and exports All tests passing, build clean (0 audit issues). Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
80 lines
2.6 KiB
TypeScript
80 lines
2.6 KiB
TypeScript
/**
|
|
* Hook Registry for JSON Components
|
|
* Allows JSON components to use custom React hooks
|
|
*/
|
|
import { useSaveIndicator } from '@/hooks/use-save-indicator'
|
|
import { useComponentTree } from '@/hooks/use-component-tree'
|
|
import { useStorageBackendInfo } from '@/hooks/use-storage-backend-info'
|
|
import { useD3BarChart } from '@/hooks/use-d3-bar-chart'
|
|
import { useFocusState } from '@/hooks/use-focus-state'
|
|
import { useCopyState } from '@/hooks/use-copy-state'
|
|
import { usePasswordVisibility } from '@/hooks/use-password-visibility'
|
|
import { useImageState } from '@/hooks/use-image-state'
|
|
import { usePopoverState } from '@/hooks/use-popover-state'
|
|
import { useMenuState } from '@/hooks/use-menu-state'
|
|
import { useFileUpload } from '@/hooks/use-file-upload'
|
|
import { useAccordion } from '@/hooks/use-accordion'
|
|
import { useBindingEditor } from '@/hooks/use-binding-editor'
|
|
import { useRepeatWrapper } from '@/hooks/use-repeat-wrapper'
|
|
import { useAppLayout } from '@/hooks/use-app-layout'
|
|
import { useAppRouterLayout } from '@/hooks/use-app-router-layout'
|
|
import { useNavigationMenu } from '@/hooks/use-navigation-menu'
|
|
import { useDataSourceManagerState } from '@/hooks/use-data-source-manager-state'
|
|
import { useFormatValue } from '@/hooks/use-format-value'
|
|
import { useConflictResolution } from '@/hooks/use-conflict-resolution'
|
|
import { useConflictCard } from '@/hooks/use-conflict-card'
|
|
import { useConflictDetailsDialog } from '@/hooks/use-conflict-details-dialog'
|
|
import { useDocumentationView } from '@/hooks/use-documentation-view'
|
|
import { useDockerBuildDebugger } from '@/hooks/use-docker-build-debugger'
|
|
import { useDataBindingDesigner } from '@/hooks/use-data-binding-designer'
|
|
|
|
export interface HookRegistry {
|
|
[key: string]: (...args: any[]) => any
|
|
}
|
|
|
|
/**
|
|
* Registry of all custom hooks available to JSON components
|
|
*/
|
|
export const hooksRegistry: HookRegistry = {
|
|
useSaveIndicator,
|
|
useComponentTree,
|
|
useStorageBackendInfo,
|
|
useD3BarChart,
|
|
useFocusState,
|
|
useCopyState,
|
|
usePasswordVisibility,
|
|
useImageState,
|
|
usePopoverState,
|
|
useMenuState,
|
|
useFileUpload,
|
|
useAccordion,
|
|
useBindingEditor,
|
|
useRepeatWrapper,
|
|
useAppLayout,
|
|
useAppRouterLayout,
|
|
useNavigationMenu,
|
|
useDataSourceManagerState,
|
|
useFormatValue,
|
|
useConflictResolution,
|
|
useConflictCard,
|
|
useConflictDetailsDialog,
|
|
useDocumentationView,
|
|
useDockerBuildDebugger,
|
|
useDataBindingDesigner,
|
|
// Add more hooks here as needed
|
|
}
|
|
|
|
/**
|
|
* Get a hook from the registry by name
|
|
*/
|
|
export function getHook(hookName: string) {
|
|
return hooksRegistry[hookName]
|
|
}
|
|
|
|
/**
|
|
* Register a new hook
|
|
*/
|
|
export function registerHook(name: string, hook: (...args: any[]) => any) {
|
|
hooksRegistry[name] = hook
|
|
}
|