Update JSON UI actions and conditionals

This commit is contained in:
2026-01-18 16:19:42 +00:00
parent f547d38539
commit bbcc91dc80
12 changed files with 84 additions and 72 deletions

View File

@@ -106,7 +106,12 @@ Converted three complex pages (Models, Component Trees, and Workflows) from trad
"type": "Component",
"bindings": { "prop": { "source": "...", "path": "..." } },
"events": [
{ "event": "click", "actions": [...] }
{
"event": "click",
"actions": [
{ "type": "set-value", "target": "selectedId", "expression": "event" }
]
}
]
}
]
@@ -115,6 +120,18 @@ Converted three complex pages (Models, Component Trees, and Workflows) from trad
}
```
### Action & Conditional Syntax
- Use supported JSON UI action types (for example, `set-value`, `toggle-value`, `show-toast`) with `target`, `path`, `value`, or `expression` fields instead of legacy `setState` actions.
- Replace legacy conditional objects (`{ "source": "...", "operator": "eq|gt|truthy|falsy", "value": ... }`) with `conditional.if` expressions:
```json
{
"conditional": {
"if": "modelCount === 0"
}
}
```
### Component Registry Integration
All JSON page wrappers are registered in `component-registry.ts`:
- `JSONModelDesigner`