wagtail-table 0.1.0a1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- wagtail_table-0.1.0a1/.gitattributes +2 -0
- wagtail_table-0.1.0a1/.github/workflows/publish.yml +71 -0
- wagtail_table-0.1.0a1/.github/workflows/test.yml +37 -0
- wagtail_table-0.1.0a1/.gitignore +16 -0
- wagtail_table-0.1.0a1/.python-version +1 -0
- wagtail_table-0.1.0a1/CHANGELOG.md +26 -0
- wagtail_table-0.1.0a1/LICENSE +28 -0
- wagtail_table-0.1.0a1/Makefile +45 -0
- wagtail_table-0.1.0a1/PKG-INFO +182 -0
- wagtail_table-0.1.0a1/PLAN.md +849 -0
- wagtail_table-0.1.0a1/README.md +156 -0
- wagtail_table-0.1.0a1/docs/clipboard.md +120 -0
- wagtail_table-0.1.0a1/docs/releases.md +84 -0
- wagtail_table-0.1.0a1/frontend/alignment.ts +22 -0
- wagtail_table-0.1.0a1/frontend/clipboard.ts +186 -0
- wagtail_table-0.1.0a1/frontend/controls.ts +160 -0
- wagtail_table-0.1.0a1/frontend/editor.css +22 -0
- wagtail_table-0.1.0a1/frontend/editor.ts +75 -0
- wagtail_table-0.1.0a1/frontend/public/table-public.css +9 -0
- wagtail_table-0.1.0a1/frontend/wagtail.ts +195 -0
- wagtail_table-0.1.0a1/package-lock.json +1887 -0
- wagtail_table-0.1.0a1/package.json +31 -0
- wagtail_table-0.1.0a1/playwright.config.ts +21 -0
- wagtail_table-0.1.0a1/pyproject.toml +73 -0
- wagtail_table-0.1.0a1/scripts/check-assets.mjs +12 -0
- wagtail_table-0.1.0a1/scripts/check_distribution.py +182 -0
- wagtail_table-0.1.0a1/scripts/licenses.mjs +16 -0
- wagtail_table-0.1.0a1/scripts/smoke_installed.py +99 -0
- wagtail_table-0.1.0a1/src/wagtail_table/__init__.py +1 -0
- wagtail_table-0.1.0a1/src/wagtail_table/blocks.py +91 -0
- wagtail_table-0.1.0a1/src/wagtail_table/data.py +157 -0
- wagtail_table-0.1.0a1/src/wagtail_table/rendering.py +133 -0
- wagtail_table-0.1.0a1/src/wagtail_table/static/wagtail_table/THIRD_PARTY_LICENSES.txt +569 -0
- wagtail_table-0.1.0a1/src/wagtail_table/static/wagtail_table/table-public.css +9 -0
- wagtail_table-0.1.0a1/src/wagtail_table/static/wagtail_table/table.css +2 -0
- wagtail_table-0.1.0a1/src/wagtail_table/static/wagtail_table/table.js +108 -0
- wagtail_table-0.1.0a1/src/wagtail_table/templates/wagtail_table/rows.html +19 -0
- wagtail_table-0.1.0a1/src/wagtail_table/templates/wagtail_table/table.html +16 -0
- wagtail_table-0.1.0a1/src/wagtail_table/templates/wagtail_table/widgets/table.html +7 -0
- wagtail_table-0.1.0a1/src/wagtail_table/widgets.py +102 -0
- wagtail_table-0.1.0a1/tests/__init__.py +0 -0
- wagtail_table-0.1.0a1/tests/browser/clipboard-admin.spec.ts +45 -0
- wagtail_table-0.1.0a1/tests/browser/clipboard.spec.ts +132 -0
- wagtail_table-0.1.0a1/tests/browser/editing.spec.ts +75 -0
- wagtail_table-0.1.0a1/tests/browser/server.py +27 -0
- wagtail_table-0.1.0a1/tests/browser/table.spec.ts +43 -0
- wagtail_table-0.1.0a1/tests/browser/widget.spec.ts +49 -0
- wagtail_table-0.1.0a1/tests/conftest.py +14 -0
- wagtail_table-0.1.0a1/tests/fixtures/basic.json +24 -0
- wagtail_table-0.1.0a1/tests/fixtures/clipboard/large.tsv +31 -0
- wagtail_table-0.1.0a1/tests/fixtures/clipboard/native-html.json +111 -0
- wagtail_table-0.1.0a1/tests/fixtures/clipboard/native-large.json +1 -0
- wagtail_table-0.1.0a1/tests/fixtures/clipboard/office-like.html +9 -0
- wagtail_table-0.1.0a1/tests/fixtures/clipboard/sheets-like.html +6 -0
- wagtail_table-0.1.0a1/tests/fixtures/native.json +157 -0
- wagtail_table-0.1.0a1/tests/fixtures/phase2.json +166 -0
- wagtail_table-0.1.0a1/tests/js/clipboard.test.ts +36 -0
- wagtail_table-0.1.0a1/tests/js/editor.test.ts +75 -0
- wagtail_table-0.1.0a1/tests/test_admin.py +64 -0
- wagtail_table-0.1.0a1/tests/test_blocks.py +85 -0
- wagtail_table-0.1.0a1/tests/test_data.py +85 -0
- wagtail_table-0.1.0a1/tests/test_demo.py +25 -0
- wagtail_table-0.1.0a1/tests/test_project/__init__.py +0 -0
- wagtail_table-0.1.0a1/tests/test_project/demo_app/__init__.py +0 -0
- wagtail_table-0.1.0a1/tests/test_project/demo_app/examples.py +66 -0
- wagtail_table-0.1.0a1/tests/test_project/demo_app/management/__init__.py +0 -0
- wagtail_table-0.1.0a1/tests/test_project/demo_app/management/commands/__init__.py +0 -0
- wagtail_table-0.1.0a1/tests/test_project/demo_app/management/commands/create_content.py +51 -0
- wagtail_table-0.1.0a1/tests/test_project/demo_app/management/commands/create_examples.py +24 -0
- wagtail_table-0.1.0a1/tests/test_project/demo_app/migrations/0001_initial.py +47 -0
- wagtail_table-0.1.0a1/tests/test_project/demo_app/migrations/__init__.py +0 -0
- wagtail_table-0.1.0a1/tests/test_project/demo_app/models.py +18 -0
- wagtail_table-0.1.0a1/tests/test_project/demo_app/static/demo_app/demo.css +5 -0
- wagtail_table-0.1.0a1/tests/test_project/demo_app/templates/demo_app/demo_page.html +22 -0
- wagtail_table-0.1.0a1/tests/test_project/manage.py +10 -0
- wagtail_table-0.1.0a1/tests/test_project/settings.py +70 -0
- wagtail_table-0.1.0a1/tests/test_project/urls.py +8 -0
- wagtail_table-0.1.0a1/tests/test_rendering.py +193 -0
- wagtail_table-0.1.0a1/tests/test_widgets.py +30 -0
- wagtail_table-0.1.0a1/tsconfig.json +13 -0
- wagtail_table-0.1.0a1/vite.config.ts +17 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ['v*']
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
concurrency:
|
|
11
|
+
group: publish-${{ github.ref }}
|
|
12
|
+
cancel-in-progress: false
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
build:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v6
|
|
19
|
+
- uses: astral-sh/setup-uv@v6
|
|
20
|
+
- uses: actions/setup-python@v6
|
|
21
|
+
with:
|
|
22
|
+
python-version: '3.13'
|
|
23
|
+
- uses: actions/setup-node@v6
|
|
24
|
+
with:
|
|
25
|
+
node-version: '22.15.0'
|
|
26
|
+
cache: npm
|
|
27
|
+
- name: Verify release tag
|
|
28
|
+
run: |
|
|
29
|
+
python - <<'PY'
|
|
30
|
+
import os
|
|
31
|
+
import tomllib
|
|
32
|
+
from pathlib import Path
|
|
33
|
+
|
|
34
|
+
version = tomllib.loads(Path('pyproject.toml').read_text())['project']['version']
|
|
35
|
+
if os.environ['GITHUB_REF_NAME'] != f'v{version}':
|
|
36
|
+
raise SystemExit('Release tag must match the version in pyproject.toml')
|
|
37
|
+
PY
|
|
38
|
+
- run: make install
|
|
39
|
+
- run: make test
|
|
40
|
+
- run: npx playwright install --with-deps chromium
|
|
41
|
+
- run: make test-browser
|
|
42
|
+
- run: make check-distribution
|
|
43
|
+
- uses: actions/upload-artifact@v4
|
|
44
|
+
with:
|
|
45
|
+
name: distributions
|
|
46
|
+
path: |
|
|
47
|
+
dist/*.whl
|
|
48
|
+
dist/*.tar.gz
|
|
49
|
+
if-no-files-found: error
|
|
50
|
+
- uses: actions/upload-artifact@v4
|
|
51
|
+
if: failure()
|
|
52
|
+
with:
|
|
53
|
+
name: browser-results
|
|
54
|
+
path: test-results/
|
|
55
|
+
|
|
56
|
+
publish:
|
|
57
|
+
needs: build
|
|
58
|
+
runs-on: ubuntu-latest
|
|
59
|
+
environment:
|
|
60
|
+
name: pypi
|
|
61
|
+
url: https://pypi.org/project/wagtail-table/
|
|
62
|
+
permissions:
|
|
63
|
+
contents: read
|
|
64
|
+
id-token: write
|
|
65
|
+
steps:
|
|
66
|
+
- uses: astral-sh/setup-uv@v6
|
|
67
|
+
- uses: actions/download-artifact@v4
|
|
68
|
+
with:
|
|
69
|
+
name: distributions
|
|
70
|
+
path: dist
|
|
71
|
+
- run: uv publish --trusted-publishing always
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
13
|
+
cancel-in-progress: true
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
test:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v6
|
|
20
|
+
- uses: astral-sh/setup-uv@v6
|
|
21
|
+
- uses: actions/setup-python@v6
|
|
22
|
+
with:
|
|
23
|
+
python-version: '3.13'
|
|
24
|
+
- uses: actions/setup-node@v6
|
|
25
|
+
with:
|
|
26
|
+
node-version: '22.15.0'
|
|
27
|
+
cache: npm
|
|
28
|
+
- run: make install
|
|
29
|
+
- run: make test
|
|
30
|
+
- run: npx playwright install --with-deps chromium
|
|
31
|
+
- run: make test-browser
|
|
32
|
+
- run: make check-distribution
|
|
33
|
+
- uses: actions/upload-artifact@v4
|
|
34
|
+
if: failure()
|
|
35
|
+
with:
|
|
36
|
+
name: browser-results
|
|
37
|
+
path: test-results/
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.venv/
|
|
2
|
+
node_modules/
|
|
3
|
+
__pycache__/
|
|
4
|
+
*.py[cod]
|
|
5
|
+
.pytest_cache/
|
|
6
|
+
.ruff_cache/
|
|
7
|
+
dist/
|
|
8
|
+
build/
|
|
9
|
+
*.egg-info/
|
|
10
|
+
.idea/
|
|
11
|
+
.DS_Store
|
|
12
|
+
tests/test_project/*.sqlite3
|
|
13
|
+
tests/test_project/staticfiles/
|
|
14
|
+
tests/test_project/media/
|
|
15
|
+
test-results/
|
|
16
|
+
playwright-report/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.13
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0a1 — 2026-11-20
|
|
4
|
+
|
|
5
|
+
First public alpha of the native Tiptap table editor for Wagtail StreamField.
|
|
6
|
+
|
|
7
|
+
- Direct text editing, row and column operations, cell selection, merge/split,
|
|
8
|
+
undo/redo, header controls, and horizontal/vertical alignment.
|
|
9
|
+
- Captions, accessible descriptions, versioned JSON storage, and escaped
|
|
10
|
+
server-side HTML rendering with no public JavaScript dependency.
|
|
11
|
+
- HTML table and TSV paste through native ProseMirror table handling, with
|
|
12
|
+
package-specific limits and feedback for unsupported content.
|
|
13
|
+
- Independent StreamField editors, including dynamic insertion, duplication,
|
|
14
|
+
draft save/reload, and publishing.
|
|
15
|
+
- Prebuilt frontend assets and bundled dependency notices in Python packages;
|
|
16
|
+
installing the package does not require Node.js.
|
|
17
|
+
|
|
18
|
+
This is an experimental release for evaluation. Public APIs and stored data may
|
|
19
|
+
change before a stable release; automatic migrations between alpha versions are
|
|
20
|
+
not promised. Back up content before upgrading. Hybrid Wagtail block cells are
|
|
21
|
+
planned and are not implemented.
|
|
22
|
+
|
|
23
|
+
The verified development stack is Python 3.13, Wagtail 8.1, and Django 6.1.
|
|
24
|
+
Broader compatibility testing, real Excel/Google Sheets/Word clipboard checks,
|
|
25
|
+
and a full accessibility review remain outstanding. Complex header relationships
|
|
26
|
+
have documented limits; UX refinement is planned before hybrid-cell work.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, Coen van der Kamp
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
16
|
+
contributors may be used to endorse or promote products derived from
|
|
17
|
+
this software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
PYTHON_VERSION ?= 3.13
|
|
2
|
+
PYTHON ?= .venv/bin/python
|
|
3
|
+
RUFF ?= .venv/bin/ruff
|
|
4
|
+
DJLINT ?= .venv/bin/djlint
|
|
5
|
+
NPM ?= npm
|
|
6
|
+
|
|
7
|
+
.PHONY: install test test-browser check-distribution build fix-codestyle demo
|
|
8
|
+
|
|
9
|
+
install:
|
|
10
|
+
uv venv --python $(PYTHON_VERSION)
|
|
11
|
+
uv pip install --python $(PYTHON) -e ".[test]"
|
|
12
|
+
$(NPM) ci
|
|
13
|
+
|
|
14
|
+
build:
|
|
15
|
+
$(NPM) run build
|
|
16
|
+
|
|
17
|
+
test:
|
|
18
|
+
$(PYTHON) tests/test_project/manage.py check
|
|
19
|
+
$(PYTHON) tests/test_project/manage.py makemigrations --check --dry-run
|
|
20
|
+
$(RUFF) check src tests
|
|
21
|
+
$(RUFF) format src tests --check
|
|
22
|
+
$(RUFF) check scripts/*.py
|
|
23
|
+
$(RUFF) format scripts/*.py --check
|
|
24
|
+
$(DJLINT) src/wagtail_table/templates tests/test_project --lint --check
|
|
25
|
+
$(PYTHON) -X dev -m pytest $(ARGS)
|
|
26
|
+
$(NPM) run typecheck
|
|
27
|
+
$(NPM) test
|
|
28
|
+
$(NPM) run check:assets
|
|
29
|
+
|
|
30
|
+
test-browser:
|
|
31
|
+
$(NPM) run test:browser
|
|
32
|
+
|
|
33
|
+
check-distribution:
|
|
34
|
+
$(PYTHON) scripts/check_distribution.py
|
|
35
|
+
|
|
36
|
+
fix-codestyle:
|
|
37
|
+
$(RUFF) check --fix src tests
|
|
38
|
+
$(RUFF) format src tests
|
|
39
|
+
$(DJLINT) src/wagtail_table/templates tests/test_project --reformat
|
|
40
|
+
|
|
41
|
+
demo:
|
|
42
|
+
$(PYTHON) tests/test_project/manage.py migrate
|
|
43
|
+
$(PYTHON) tests/test_project/manage.py create_content
|
|
44
|
+
$(PYTHON) tests/test_project/manage.py create_examples
|
|
45
|
+
$(PYTHON) tests/test_project/manage.py runserver
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: wagtail-table
|
|
3
|
+
Version: 0.1.0a1
|
|
4
|
+
Summary: A native Tiptap table editor for Wagtail StreamField.
|
|
5
|
+
Project-URL: Repository, https://github.com/allcaps/wagtail-table
|
|
6
|
+
Project-URL: Issues, https://github.com/allcaps/wagtail-table/issues
|
|
7
|
+
Project-URL: Changelog, https://github.com/allcaps/wagtail-table/blob/main/CHANGELOG.md
|
|
8
|
+
Author-email: Coen van der Kamp <coen@fourdigits.nl>
|
|
9
|
+
License-Expression: BSD-3-Clause
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: streamfield,table,tiptap,wagtail
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Environment :: Web Environment
|
|
14
|
+
Classifier: Framework :: Django
|
|
15
|
+
Classifier: Framework :: Wagtail
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Requires-Python: >=3.11
|
|
19
|
+
Requires-Dist: wagtail<8.2,>=7.4
|
|
20
|
+
Provides-Extra: test
|
|
21
|
+
Requires-Dist: djlint; extra == 'test'
|
|
22
|
+
Requires-Dist: pytest; extra == 'test'
|
|
23
|
+
Requires-Dist: pytest-django; extra == 'test'
|
|
24
|
+
Requires-Dist: ruff; extra == 'test'
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
# wagtail-table
|
|
28
|
+
|
|
29
|
+
A native Tiptap table editor for Wagtail StreamField. This early alpha provides
|
|
30
|
+
native text-table editing, JSON persistence, and safe server-side rendering.
|
|
31
|
+
|
|
32
|
+
Version `0.1.0a1` is experimental and intended for evaluation. Public APIs and
|
|
33
|
+
stored data may change before a stable release; automatic migrations between
|
|
34
|
+
alpha versions are not promised. Back up content before upgrading. Hybrid
|
|
35
|
+
Wagtail block cells are planned, not implemented. A full accessibility review
|
|
36
|
+
and real external-application clipboard checks remain outstanding.
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
from wagtail import blocks
|
|
40
|
+
from wagtail_table.blocks import TableBlock
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class ContentBlock(blocks.StreamBlock):
|
|
44
|
+
paragraph = blocks.RichTextBlock()
|
|
45
|
+
table = TableBlock()
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Install the alpha once published:
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
pip install wagtail-table==0.1.0a1
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Add `"wagtail_table"` to
|
|
55
|
+
`INSTALLED_APPS`. Use `ContentBlock()` in a normal StreamField and FieldPanel.
|
|
56
|
+
Render with Wagtail's `{% include_block page.body %}`. No frontend JavaScript
|
|
57
|
+
or Node.js is required by the installed Python package.
|
|
58
|
+
|
|
59
|
+
## Development
|
|
60
|
+
|
|
61
|
+
Local checks currently pass on Python 3.13, Wagtail 8.1, and Django 6.1.
|
|
62
|
+
Use Node 22.15+ for frontend development. CI will target the current verified
|
|
63
|
+
stack, with newer versions evaluated as development moves forward. A broader
|
|
64
|
+
compatibility matrix is deferred; other versions allowed by the package's
|
|
65
|
+
dependency bounds have not yet been verified.
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
make install
|
|
69
|
+
make build
|
|
70
|
+
make test
|
|
71
|
+
npx playwright install chromium
|
|
72
|
+
make test-browser
|
|
73
|
+
make check-distribution
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
All eight Playwright tests passed in a local run outside the development sandbox,
|
|
77
|
+
including real browser Clipboard API paste, native editing, and save/publish
|
|
78
|
+
journeys. Backend draft/publish round trips are covered by pytest. The sandbox
|
|
79
|
+
itself blocks the local server and browser process.
|
|
80
|
+
|
|
81
|
+
Start the SQLite demo with `make demo`. Create a local admin account separately:
|
|
82
|
+
|
|
83
|
+
```sh
|
|
84
|
+
.venv/bin/python tests/test_project/manage.py createsuperuser
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Visit `/admin/` to edit the example page and `/` to inspect published HTML.
|
|
88
|
+
`make demo` also creates `/table-examples/`, showing the four header configurations,
|
|
89
|
+
merged cells, alignment, captions, descriptions, and a larger TSV-pasted table.
|
|
90
|
+
Existing content is preserved; existing example pages are not rewritten.
|
|
91
|
+
For an already running demo, add the examples with:
|
|
92
|
+
|
|
93
|
+
```sh
|
|
94
|
+
.venv/bin/python tests/test_project/manage.py create_examples
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
The browser tests use their own temporary database and local test credentials.
|
|
98
|
+
|
|
99
|
+
Authored TypeScript/CSS lives in `frontend/`; generated assets are committed
|
|
100
|
+
under `src/wagtail_table/static/wagtail_table/`. Run `make build` after frontend
|
|
101
|
+
changes. `npm run check:assets` rebuilds and compares their contents.
|
|
102
|
+
`uv build` creates a wheel and sdist containing prebuilt assets, with no npm build
|
|
103
|
+
step during Python installation.
|
|
104
|
+
|
|
105
|
+
## Current scope
|
|
106
|
+
|
|
107
|
+
The editor uses native table nodes and stores one table per block in versioned
|
|
108
|
+
JSON. Current features include:
|
|
109
|
+
|
|
110
|
+
- Native row/column insertion and deletion, rectangular cell selection, merge,
|
|
111
|
+
split, undo, and redo, exposed through compact controls.
|
|
112
|
+
- Independent First row headers and First column headers toggles: turn both off
|
|
113
|
+
for no edge headers, or both on for row and column headers. Header cell toggles
|
|
114
|
+
the selected cells individually. The actual native cells determine the control
|
|
115
|
+
states; there is no separately stored header mode.
|
|
116
|
+
- Horizontal left/center/right and vertical top/middle/bottom alignment.
|
|
117
|
+
- An optional caption and a separate, visible description linked to the published
|
|
118
|
+
table with `aria-describedby`.
|
|
119
|
+
|
|
120
|
+
Use Tab and Shift+Tab for native cell navigation, Shift+click to select a range,
|
|
121
|
+
and Escape to move from the editor to Table actions. Native Tab at the last cell
|
|
122
|
+
adds a row. Metadata text inputs use ordinary browser undo; the toolbar Undo and
|
|
123
|
+
Redo operate on the native table document.
|
|
124
|
+
|
|
125
|
+
Merging retains the top-left cell's type and alignment and combines native cell
|
|
126
|
+
content. Splitting retains the content in the first cell. Header types inherited
|
|
127
|
+
after structural edits are native Tiptap/ProseMirror behavior. The UI reports a
|
|
128
|
+
custom layout when individual or merged cells no longer match the edge settings;
|
|
129
|
+
changing an edge toggle does not reset unrelated individual headers.
|
|
130
|
+
|
|
131
|
+
Phase 3 clipboard implementation and automated verification are complete;
|
|
132
|
+
see [paste behavior, coverage, and manual checks](https://github.com/allcaps/wagtail-table/blob/main/docs/clipboard.md).
|
|
133
|
+
HTML tables and tab-separated ranges use native ProseMirror insertion and table
|
|
134
|
+
manipulation. At a text cursor, a range can grow the table; a selected rectangle
|
|
135
|
+
clips or repeats the source. Visible help and notices explain this distinction
|
|
136
|
+
and merged-cell changes. Unsupported table structures are rejected without
|
|
137
|
+
clearing existing cells. The schema prevents nested or unrelated root content.
|
|
138
|
+
Unsupported document content must be corrected before saving; it is never
|
|
139
|
+
silently discarded. External application clipboard compatibility has not yet
|
|
140
|
+
been verified.
|
|
141
|
+
Malformed or unsupported saved values are retained read only; a repair UI is
|
|
142
|
+
not implemented.
|
|
143
|
+
|
|
144
|
+
## Published tables
|
|
145
|
+
|
|
146
|
+
Published tables use semantic HTML with escaped text. Leading header rows use
|
|
147
|
+
`thead` when no cell span crosses into the body. Simple edge headers receive
|
|
148
|
+
`scope`; merged edge headers use explicit `id`/`headers` associations without
|
|
149
|
+
inventing row or column groups. Accessibility IDs are unique per render and are
|
|
150
|
+
not stored cell IDs.
|
|
151
|
+
|
|
152
|
+
Automatic relationships cover identifiable leading header rows and first-column
|
|
153
|
+
headers. Interior headers, corner headers with two possible directions, and
|
|
154
|
+
headers spanning from the header band into data do not receive guessed scopes
|
|
155
|
+
or outgoing associations. Individual `th` cells are preserved in place. Such
|
|
156
|
+
layouts require review and may need simplification; this package does not yet
|
|
157
|
+
provide a manual header-association editor or guarantee arbitrary complex tables
|
|
158
|
+
are accessible.
|
|
159
|
+
|
|
160
|
+
Include the supplied alignment classes in your public base template:
|
|
161
|
+
|
|
162
|
+
```django
|
|
163
|
+
{% load static %}
|
|
164
|
+
<link rel="stylesheet" href="{% static 'wagtail_table/table-public.css' %}">
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Site layout, borders, and typography remain under the integrator's control.
|
|
168
|
+
No public JavaScript is needed.
|
|
169
|
+
|
|
170
|
+
## Releases
|
|
171
|
+
|
|
172
|
+
See the [release checklist](https://github.com/allcaps/wagtail-table/blob/main/docs/releases.md)
|
|
173
|
+
and [changelog](https://github.com/allcaps/wagtail-table/blob/main/CHANGELOG.md).
|
|
174
|
+
Version numbers live in `pyproject.toml`; matching `v*` tags trigger verification
|
|
175
|
+
and PyPI Trusted Publishing through the GitHub `pypi` environment.
|
|
176
|
+
`make check-distribution` checks wheel/sdist contents, rebuilds from the sdist,
|
|
177
|
+
and installs and renders the package in an isolated environment with Node/npm
|
|
178
|
+
unavailable. It requires uv and the installed test dependencies and replaces
|
|
179
|
+
old wheel/sdist files in `dist/` only after all checks pass.
|
|
180
|
+
|
|
181
|
+
The project uses BSD-3-Clause; bundled dependency license texts ship alongside
|
|
182
|
+
the generated admin assets.
|