# ControlContent Event Handler Schema v1.0

UnifiedControl Designer stores event handler definitions so a designable `ContentControl` can preserve component behavior together with layout and properties.

## Event binding

Component events use the following shape:

```json
"events": {
  "click": {
    "handlerId": "handler_button_click",
    "enabled": true
  }
}
```

The normalized root content also contains a flat binding list:

```json
"events": {
  "bindings": [
    {
      "componentId": "button-abc",
      "eventName": "click",
      "handlerId": "handler_button_click",
      "enabled": true
    }
  ]
}
```

## Handler definition

```json
{
  "id": "handler_button_click",
  "name": "onButtonClick",
  "componentId": "button-abc",
  "eventName": "click",
  "language": "javascript",
  "parameters": ["event", "context"],
  "code": "function handler(event, context) {\n  // TODO\n}\n",
  "enabled": true,
  "permissions": [],
  "description": "",
  "executionPolicy": "host-approved-only"
}
```

## Safety rule

Handler code is persisted for re-editing. The designer and package reader treat it as definition data only. Do not execute it on Open. Execution must be introduced later through an explicit runtime mode, Host capability approval, sandbox and audit logging.
