Metadata-Version: 2.5
Name: spaday-regular-layout
Version: 0.2.0
Summary: regular-layout for spaday
Project-URL: Repository, https://github.com/1kbgz/spaday-regular-layout
Project-URL: Homepage, https://github.com/1kbgz/spaday-regular-layout
Author-email: 1kbgz <dev@1kbgz.com>
License: Apache-2.0
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.11
Requires-Dist: spaday>=0.6.0
Provides-Extra: develop
Requires-Dist: build; extra == 'develop'
Requires-Dist: bump-my-version; extra == 'develop'
Requires-Dist: check-dist; extra == 'develop'
Requires-Dist: codespell; extra == 'develop'
Requires-Dist: hatch-js; extra == 'develop'
Requires-Dist: hatchling; extra == 'develop'
Requires-Dist: httpx; extra == 'develop'
Requires-Dist: mdformat; extra == 'develop'
Requires-Dist: mdformat-tables>=1; extra == 'develop'
Requires-Dist: pydantic>=2; extra == 'develop'
Requires-Dist: pytest; extra == 'develop'
Requires-Dist: pytest-cov; extra == 'develop'
Requires-Dist: ruff; extra == 'develop'
Requires-Dist: starlette; extra == 'develop'
Requires-Dist: transports; extra == 'develop'
Requires-Dist: twine; extra == 'develop'
Requires-Dist: ty; extra == 'develop'
Requires-Dist: uv; extra == 'develop'
Requires-Dist: uvicorn; extra == 'develop'
Requires-Dist: websockets; extra == 'develop'
Requires-Dist: wheel; extra == 'develop'
Provides-Extra: examples
Requires-Dist: pydantic>=2; extra == 'examples'
Requires-Dist: starlette; extra == 'examples'
Requires-Dist: transports; extra == 'examples'
Requires-Dist: uvicorn; extra == 'examples'
Requires-Dist: websockets; extra == 'examples'
Description-Content-Type: text/markdown

# spaday-regular-layout

Serializable, resizable panel layouts for spaday, powered by `regular-layout`.

[![Build Status](https://github.com/1kbgz/spaday-regular-layout/actions/workflows/build.yaml/badge.svg?branch=main&event=push)](https://github.com/1kbgz/spaday-regular-layout/actions/workflows/build.yaml)
[![codecov](https://codecov.io/gh/1kbgz/spaday-regular-layout/branch/main/graph/badge.svg)](https://codecov.io/gh/1kbgz/spaday-regular-layout)
[![License](https://img.shields.io/github/license/1kbgz/spaday-regular-layout)](https://github.com/1kbgz/spaday-regular-layout)
[![PyPI](https://img.shields.io/pypi/v/spaday-regular-layout.svg)](https://pypi.python.org/pypi/spaday-regular-layout)

## Documentation

- [Build a resizable workspace](docs/src/tutorial.md) — guided first layout.
- [Persist user layout changes](docs/src/how-to.md) — task-focused state synchronization.
- [API reference](docs/src/reference.md) — layout nodes, components, and events.
- [Why layouts are serialized](docs/src/explanation.md) — wrapper design and state model.

## Quick example

```python
from spaday import serve
from spaday_regular_layout import RegularLayout, RegularLayoutFrame

layout = {
    "type": "split-layout",
    "orientation": "horizontal",
    "sizes": [0.3, 0.7],
    "children": [
        {"type": "tab-layout", "tabs": ["nav"]},
        {"type": "tab-layout", "tabs": ["main"]},
    ],
}

page = RegularLayout(
    RegularLayoutFrame("Navigation", name="nav"),
    RegularLayoutFrame("Main", name="main"),
    layout=layout,
    style="height: 32rem",
).prop("class", "lorax")
serve(page, packages=["regular-layout"])
```

`layout` is the serializable split/tab tree returned by upstream `save()`. Bind it to application state to restore layouts reactively. Browser changes emit `regular-layout-update`; use a spaday event action to persist `event.detail`.

## Run the local example

```bash
python -m pip install -e ".[examples]"
python -m spaday_regular_layout.example
```

Open `http://127.0.0.1:8013` to resize and rearrange the [complete three-panel example](spaday_regular_layout/example.py). It
receives a new server layout every five seconds and persists browser rearrangements back to Python. It passes
the local package descriptor directly, so it does not install or resolve the integration from GitHub.
