Metadata-Version: 2.4
Name: fastpluggy-website-builder
Version: 0.3.2
Author: FastPluggy Team
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: FastPluggy>=0.4.33
Provides-Extra: tests
Requires-Dist: pytest>=7.0; extra == "tests"
Requires-Dist: pytest-cov>=4.0; extra == "tests"
Provides-Extra: e2e
Requires-Dist: playwright>=1.44; extra == "e2e"

# fastpluggy-website-builder

![Website Builder](https://img.shields.io/badge/FastPluggy-Website%20Builder-blue)
[![Release](https://gitlab.ggcorp.fr/open/fastpluggy/plugins/website_builder/-/badges/release.svg)](https://gitlab.ggcorp.fr/open/fastpluggy/plugins/website_builder/-/releases)
[![Pipeline Status](https://gitlab.ggcorp.fr/open/fastpluggy/plugins/website_builder/badges/main/pipeline.svg?key_text=CI)](https://gitlab.ggcorp.fr/open/fastpluggy/plugins/website_builder/-/pipelines?ignore_skipped=true)
[![Coverage](https://gitlab.ggcorp.fr/open/fastpluggy/plugins/website_builder/badges/main/coverage.svg)](https://gitlab.ggcorp.fr/open/fastpluggy/plugins/website_builder/-/pipelines)

Drag-and-drop page builder for FastPluggy. Editor is built on [gridstack.js](https://gridstackjs.com/) (vendored — touch support, collision detection, keyboard nav). Pages are stored as JSON and rendered server-side by `widget_builder.py`.

## Installation

```bash
pip install fastpluggy-website-builder
```

## Dependencies

- FastPluggy >= 0.4.0
- `crud_tools >= 0.1.0` (plugin dependency, resolved automatically)

## Features

- Grid editor with HTML5 drag-and-drop, touch, and collision detection (gridstack v12)
- Built-in widgets: text, image (extend by registering classes in `src/widgets/`)
- Per-widget JSON-schema-driven config modal
- Debounced autosave + explicit Save button that flushes pending writes
- Iframe preview using the real production renderer, with a draft-mode banner
- Keyboard shortcuts (arrows, Shift+arrows, Delete, Ctrl/⌘+D, `?` help) — see [docs/builder-ui.md](docs/builder-ui.md)
- Per-request asset cache busting via an `<script type="importmap">` block
- Cookie consent banner (off by default) — single accept/reject, `localStorage` persistence, blocks `<script type="text/plain" data-cookie-consent>` until accept, ships a default `/privacy` template — see [docs/cookie-consent.md](docs/cookie-consent.md)

## Settings

| Name | Default | Description |
|---|---|---|
| `default_cols` | 6 | Default columns shown in the create-page form |
| `default_rows` | 4 | Default rows shown in the create-page form |
| `cookie_consent_enabled` | `False` | Master toggle for the consent banner |
| `cookie_consent_text` / `_accept_label` / `_reject_label` | English defaults | Banner copy |
| `cookie_consent_privacy_url` | `None` | If set, banner links to your URL and the shipped `/privacy` returns 404 |
| `WEBSITE_BUILDER_ASSET_VERSION` (env) | per-request ms stamp | Pin the builder JS/CSS cache buster in production |

## Documentation

- [docs/README.md](docs/README.md) — overview, routes, configuration, development
- [docs/builder-ui.md](docs/builder-ui.md) — editor architecture, storage shape, autosave, preview, keyboard shortcuts, gridstack version pin
- [docs/cookie-consent.md](docs/cookie-consent.md) — banner settings, script-blocking pattern, JS API, privacy-page override behavior

