Files
low-code-react-app-b/src/components/json-definitions/app-header.json
johndoe6345789 4f75409096 feat: Migrate 4 key organisms to JSON architecture
Migrated EmptyCanvasState, SchemaCodeViewer, ToolbarActions, and AppHeader
from TSX to JSON-based components. These are display-focused organisms with
no complex state management requirements.

Changes:
- Create JSON definitions for 4 organisms in src/components/json-definitions/
- Create TypeScript interfaces in src/lib/json-ui/interfaces/
- Add exports to src/lib/json-ui/json-components.ts
- Update interfaces/index.ts to export new interfaces
- Registry entries already marked as jsonCompatible: true

All organisms are pure JSON components (no custom hooks needed):
- EmptyCanvasState: Display component with optional action buttons
- SchemaCodeViewer: Display component showing JSON schema with tabs
- ToolbarActions: Flex container with conditional toolbar buttons
- AppHeader: Complex header layout with multiple sub-components

Build passing with no errors.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-01-21 02:28:50 +00:00

147 lines
4.4 KiB
JSON

{
"id": "app-header",
"type": "header",
"bindings": {
"className": { "value": "border-b border-border bg-card" }
},
"children": [
{
"id": "header-stack",
"type": "Stack",
"props": {
"direction": "vertical",
"spacing": "none"
},
"children": [
{
"id": "header-top",
"type": "Stack",
"props": {
"className": "px-4 sm:px-6 py-3 sm:py-4"
},
"children": [
{
"id": "header-flex",
"type": "Flex",
"props": {
"justify": "between",
"align": "center",
"gap": "sm"
},
"children": [
{
"id": "header-left",
"type": "Flex",
"props": {
"align": "center",
"gap": "sm",
"className": "flex-1 min-w-0"
},
"children": [
{
"id": "sidebar-trigger",
"type": "SidebarTrigger"
},
{
"id": "app-branding",
"type": "AppBranding"
},
{
"id": "save-indicator",
"type": "SaveIndicator",
"bindings": {
"lastSaved": { "source": "lastSaved" }
}
}
]
},
{
"id": "header-right",
"type": "Flex",
"props": {
"gap": "xs",
"shrink": true,
"className": "shrink-0"
},
"children": [
{
"id": "project-manager",
"type": "ProjectManager",
"bindings": {
"currentProject": { "source": "currentProject" }
},
"events": {
"onProjectLoad": {
"type": "callback",
"name": "onProjectLoad"
}
}
},
{
"id": "toolbar-actions",
"type": "ToolbarActions",
"bindings": {
"errorCount": { "source": "errorCount" },
"showErrorButton": {
"source": "featureToggles,errorCount",
"transform": "data && data.featureToggles && data.featureToggles.errorRepair && data.errorCount > 0"
}
},
"events": {
"onSearch": {
"type": "callback",
"name": "onSearch"
},
"onShowShortcuts": {
"type": "callback",
"name": "onShowShortcuts"
},
"onGenerateAI": {
"type": "callback",
"name": "onGenerateAI"
},
"onExport": {
"type": "callback",
"name": "onExport"
},
"onPreview": {
"type": "callback",
"name": "onPreview"
},
"onShowErrors": {
"type": "callback",
"name": "onShowErrors"
}
}
}
]
}
]
}
]
},
{
"id": "separator",
"type": "Separator",
"props": {
"className": "opacity-50"
}
},
{
"id": "header-bottom",
"type": "Stack",
"props": {
"className": "px-4 sm:px-6 py-2"
},
"children": [
{
"id": "breadcrumb",
"type": "Breadcrumb"
}
]
}
]
}
]
}