Schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Context",
"description": "Reads and updates drawer context values.",
"type": "object",
"examples": [
{
"title": "Put a value, then interpolate it",
"description": "Context is session-scoped in-memory state. Any widget can read Context.<key> via {{ interpolation }}. State is lost on reload (use LocalStorage for persistence).",
"document": {
"PresentationType": "Column",
"CrossAxis": "Start",
"Children": [
{
"PresentationType": "TextInput",
"Name": "Model.YourName",
"HintText": "Type your name",
"BorderColor": "#CCCCCC",
"BorderRadius": 6
},
{
"PresentationType": "SizedBox",
"Height": 10
},
{
"PresentationType": "Button",
"Text": "Greet me",
"BorderRadius": 6,
"Color": "#FFFFFF",
"BackgroundColor": "#2F6FED",
"OnClick": {
"Handler": "Alert",
"Theme": "Success",
"Title": "Hello",
"Message": "Hi, {{ Context.Model.YourName }}."
}
}
]
}
}
],
"x-version": "1.0",
"required": [
"Handler",
"Action",
"Key"
],
"properties": {
"Handler": {
"const": "Context"
},
"Action": {
"type": "string",
"enum": [
"Get",
"Put"
]
},
"Key": {
"type": "string"
},
"Value": {},
"OnSuccess": {
"$ref": "/schema/Actions/Action/1.0/index.json"
},
"OnFailure": {
"$ref": "/schema/Actions/Action/1.0/index.json"
}
},
"additionalProperties": false,
"x-icon": "<svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.7\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M8 4H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h2M16 4h2a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-2\"/></svg>",
"$id": "/schema/Actions/Context/1.0/index.json",
"x-family": "Actions",
"x-name": "Context",
"x-source-package": "zero-schema"
}
Context is session-scoped in-memory state. Any widget can read Context.<key> via {{ interpolation }}. State is lost on reload (use LocalStorage for persistence).
{
"PresentationType": "Column",
"CrossAxis": "Start",
"Children": [
{
"PresentationType": "TextInput",
"Name": "Model.YourName",
"HintText": "Type your name",
"BorderColor": "#CCCCCC",
"BorderRadius": 6
},
{
"PresentationType": "SizedBox",
"Height": 10
},
{
"PresentationType": "Button",
"Text": "Greet me",
"BorderRadius": 6,
"Color": "#FFFFFF",
"BackgroundColor": "#2F6FED",
"OnClick": {
"Handler": "Alert",
"Theme": "Success",
"Title": "Hello",
"Message": "Hi, {{ Context.Model.YourName }}."
}
}
]
}