# UnifiedControl ControlContent Schema v1.0

`ControlContent` is the native design data edited by UnifiedControl Designer. It is not `FormSchema`; application packages such as UnifiedForm convert it through adapters.

```json
{
  "kind": "UnifiedControl.ControlContent",
  "version": "1.0",
  "metadata": {
    "name": "Untitled",
    "description": "",
    "createdBy": "UnifiedControl Designer"
  },
  "root": {
    "id": "root",
    "type": "root",
    "props": {},
    "layout": {},
    "children": []
  },
  "styles": {
    "tokens": {},
    "classes": {}
  },
  "resources": [],
  "events": {
    "bindings": []
  },
  "scripts": {
    "language": "javascript",
    "handlers": {}
  },
  "permissions": {
    "requested": []
  }
}
```

## Component shape

```json
{
  "id": "textbox-xxx",
  "type": "textbox",
  "props": {
    "name": "textBox",
    "label": "TextBox"
  },
  "layout": {
    "x": 40,
    "y": 40,
    "width": 220,
    "height": 32
  },
  "events": {
    "change": {
      "handlerId": "handler_textbox_change",
      "enabled": true
    }
  },
  "eventHandlers": {
    "handler_textbox_change": {
      "id": "handler_textbox_change",
      "name": "onTextBoxChange",
      "componentId": "textbox-xxx",
      "eventName": "change",
      "language": "javascript",
      "parameters": ["event", "context"],
      "code": "function handler(event, context) {\n}\n",
      "enabled": true,
      "permissions": [],
      "executionPolicy": "host-approved-only"
    }
  },
  "children": []
}
```

The component-local `eventHandlers` copy keeps the canvas editor simple. On save, the serializer also aggregates handlers into `content.scripts.handlers` and rebuilds `content.events.bindings`.

## Runtime execution policy

The schema can store JavaScript handler code as authoring data, but loading a `.uctlx` file must not execute code. Runtime binding requires Host permission and a future sandboxed runtime path.
