Metadata-Version: 2.3
Name: mcms-editor
Version: 0.1.0
Summary: It is the authoring and editing application for MCMS content, component trees and Theme Styles
Author: MikemathuKE
Author-email: MikemathuKE <michaelmathu6@gmail.com>
Requires-Dist: mcms-core
Requires-Dist: mcms-content
Requires-Dist: mcms-design
Requires-Dist: mcms-components
Requires-Dist: mcms-render
Requires-Dist: mcms-templates
Requires-Dist: mcms-plugins
Requires-Dist: mcms-data
Requires-Python: >=3.13
Description-Content-Type: text/markdown

# MCMS Editor

`mcms_editor` is the authoring and editing application for MCMS content, theme styles and component trees. The ADRs establish the editor as a consumer of the component, field, data-binding, render-tree, design, and plugin architectures.

## Responsibilities established by the ADRs

- Provide a visual authoring experience for component trees.
- Support runtime editing of components and their composition.
- Work with the canonical `RenderTree` representation rather than introducing a parallel tree model.
- Expose content-field semantics from `mcms_content` to suitable editing controls.
- Provide a visual way to configure data connections and bindings.
- Integrate with design-system editing capabilities.
- Support plugin-provided editor JavaScript and CSS assets through `mcms_plugins`.

## Architectural model

The editor works with the same component and render-tree concepts used by the rest of MCMS:

```text
Component definitions
        |
        v
RenderTree / RenderNode
        |
        v
Editor interaction
        |
        v
Updated tree
```

The `RenderTree` remains the structural authority. Node identity, parent/child relationships, ordering, and tree invariants must be maintained when the editor changes a composition.

The data-binding ADR describes an editor experience in which users can select a data context and field path rather than authoring template-language expressions directly.

## Architectural integrations

| Package | Relationship |
|---|---|
| `mcms_core` | Shared registry and exception infrastructure |
| `mcms_components` | Component definitions and composition model |
| `mcms_content` | Field definitions and editor-specific field metadata |
| `mcms_data` | Data contexts and declarative bindings |
| `mcms_design` | Theme and style editing integration |
| `mcms_render` | Canonical RenderTree model and tree operations |
| `mcms_templates` | Reusable component compositions that can be instantiated into a page tree |
| `mcms_plugins` | Editor JavaScript and CSS extensions |
| `mcms_files` | File/media selection and management integration, where implemented |

## Plugin assets

The plugin architecture defines editor-specific resource categories:

- `editor_js`
- `editor_css`

These resources are resolved by the plugin asset resolver and made available to the `mcms_editor` application. The plugin ADR specifies that missing assets are copied to the editor application's static destination.

## Application configuration

The ADRs do not specify the editor's Django app label, static directory path, URL configuration, or global settings variable.

## Dependencies

### Architectural integrations

The integration table describes architectural relationships, not a confirmed list of direct Python imports. The editor should consume the shared domain models and APIs rather than reimplementing component, field, data, or render-tree abstractions.

### Python distribution dependencies

All MCMS Packages rely on django

## Development

```bash
uv run pytest packages/mcms-editor/tests
```

Run the repository-configured frontend, Ruff, and mypy checks that apply to this package.
