panelmark-web 0.1.0__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.
- panelmark_web-0.1.0/.claude/settings.local.json +49 -0
- panelmark_web-0.1.0/.gitignore +8 -0
- panelmark_web-0.1.0/CLAUDE.md +109 -0
- panelmark_web-0.1.0/DOCUMENTATION_TODO.md +217 -0
- panelmark_web-0.1.0/LICENSE +21 -0
- panelmark_web-0.1.0/PKG-INFO +160 -0
- panelmark_web-0.1.0/README.md +130 -0
- panelmark_web-0.1.0/TODO.md +468 -0
- panelmark_web-0.1.0/docs/getting-started.md +290 -0
- panelmark_web-0.1.0/docs/hook-usage.md +107 -0
- panelmark_web-0.1.0/docs/interaction-coverage.md +108 -0
- panelmark_web-0.1.0/docs/protocol.md +182 -0
- panelmark_web-0.1.0/examples/fastapi_app.py +126 -0
- panelmark_web-0.1.0/examples/flask_app.py +127 -0
- panelmark_web-0.1.0/examples/out/initial.html +135 -0
- panelmark_web-0.1.0/panelmark_web/__init__.py +1 -0
- panelmark_web-0.1.0/panelmark_web/adapters.py +41 -0
- panelmark_web-0.1.0/panelmark_web/interactions/__init__.py +62 -0
- panelmark_web-0.1.0/panelmark_web/interactions/_helpers.py +12 -0
- panelmark_web-0.1.0/panelmark_web/interactions/checkbox.py +73 -0
- panelmark_web-0.1.0/panelmark_web/interactions/dataclass_form.py +198 -0
- panelmark_web-0.1.0/panelmark_web/interactions/form_input.py +244 -0
- panelmark_web-0.1.0/panelmark_web/interactions/list_view.py +44 -0
- panelmark_web-0.1.0/panelmark_web/interactions/menu_function.py +84 -0
- panelmark_web-0.1.0/panelmark_web/interactions/menu_return.py +68 -0
- panelmark_web-0.1.0/panelmark_web/interactions/nested_menu.py +164 -0
- panelmark_web-0.1.0/panelmark_web/interactions/radio_list.py +70 -0
- panelmark_web-0.1.0/panelmark_web/interactions/status_message.py +69 -0
- panelmark_web-0.1.0/panelmark_web/interactions/table_view.py +110 -0
- panelmark_web-0.1.0/panelmark_web/interactions/textbox.py +117 -0
- panelmark_web-0.1.0/panelmark_web/keymap.py +33 -0
- panelmark_web-0.1.0/panelmark_web/page.py +65 -0
- panelmark_web-0.1.0/panelmark_web/protocol.py +3 -0
- panelmark_web-0.1.0/panelmark_web/renderer.py +130 -0
- panelmark_web-0.1.0/panelmark_web/server.py +122 -0
- panelmark_web-0.1.0/panelmark_web/session.py +74 -0
- panelmark_web-0.1.0/panelmark_web/static/client.js +184 -0
- panelmark_web-0.1.0/panelmark_web/widgets/__init__.py +52 -0
- panelmark_web-0.1.0/panelmark_web/widgets/alert.py +84 -0
- panelmark_web-0.1.0/panelmark_web/widgets/confirm.py +109 -0
- panelmark_web-0.1.0/panelmark_web/widgets/dataclass_form.py +57 -0
- panelmark_web-0.1.0/panelmark_web/widgets/file_picker.py +203 -0
- panelmark_web-0.1.0/panelmark_web/widgets/input_prompt.py +95 -0
- panelmark_web-0.1.0/panelmark_web/widgets/list_select.py +225 -0
- panelmark_web-0.1.0/pyproject.toml +40 -0
- panelmark_web-0.1.0/tests/__init__.py +0 -0
- panelmark_web-0.1.0/tests/test_adapters.py +110 -0
- panelmark_web-0.1.0/tests/test_integration.py +350 -0
- panelmark_web-0.1.0/tests/test_interactions.py +739 -0
- panelmark_web-0.1.0/tests/test_page.py +71 -0
- panelmark_web-0.1.0/tests/test_portable_integration.py +736 -0
- panelmark_web-0.1.0/tests/test_renderer.py +184 -0
- panelmark_web-0.1.0/tests/test_server.py +399 -0
- panelmark_web-0.1.0/tests/test_session.py +199 -0
- panelmark_web-0.1.0/tests/test_widgets.py +392 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(git init:*)",
|
|
5
|
+
"Bash(git remote:*)",
|
|
6
|
+
"Bash(git branch:*)",
|
|
7
|
+
"Bash(PYTHONPATH=/home/sirrommit/claude_play/panelmark-web:/home/sirrommit/claude_play/panelmark:/home/sirrommit/claude_play/panelmark-html python -c \"import panelmark_web; from panelmark_web.keymap import BROWSER_TO_PM; from panelmark_web import renderer, session, protocol; print\\('Phase 1 OK'\\)\")",
|
|
8
|
+
"Bash(PYTHONPATH=/home/sirrommit/claude_play/panelmark-web:/home/sirrommit/claude_play/panelmark:/home/sirrommit/claude_play/panelmark-html python3 -c \"import panelmark_web; from panelmark_web.keymap import BROWSER_TO_PM; from panelmark_web import renderer, session, protocol; print\\('Phase 1 OK'\\)\")",
|
|
9
|
+
"Bash(PYTHONPATH=/home/sirrommit/claude_play/panelmark:/home/sirrommit/claude_play/panelmark-html python3 -c \"from panelmark.draw import WriteCmd, FillCmd, CursorCmd, RenderContext; import dataclasses; print\\('WriteCmd:', [f.name for f in dataclasses.fields\\(WriteCmd\\)]\\); print\\('FillCmd:', [f.name for f in dataclasses.fields\\(FillCmd\\)]\\); print\\('CursorCmd:', [f.name for f in dataclasses.fields\\(CursorCmd\\)]\\); print\\('RenderContext:', [f.name for f in dataclasses.fields\\(RenderContext\\)]\\)\")",
|
|
10
|
+
"Bash(PYTHONPATH=/home/sirrommit/claude_play/panelmark-web:/home/sirrommit/claude_play/panelmark:/home/sirrommit/claude_play/panelmark-html python3 -m pytest tests/test_renderer.py -q 2>&1)",
|
|
11
|
+
"Bash(pip3 install:*)",
|
|
12
|
+
"Bash(PYTHONPATH=/home/sirrommit/claude_play/panelmark-web:/home/sirrommit/claude_play/panelmark:/home/sirrommit/claude_play/panelmark-html /home/sirrommit/claude_play/panelmark/.venv/bin/pytest tests/test_renderer.py -q 2>&1)",
|
|
13
|
+
"Bash(PYTHONPATH=/home/sirrommit/claude_play/panelmark:/home/sirrommit/claude_play/panelmark-html python3 -c \"from panelmark.shell import Shell; import inspect; print\\(inspect.signature\\(Shell.__init__\\)\\)\")",
|
|
14
|
+
"Bash(PYTHONPATH=/home/sirrommit/claude_play/panelmark:/home/sirrommit/claude_play/panelmark-html python3 -c \"\nfrom panelmark.interactions.base import Interaction\nimport inspect\nprint\\(inspect.getsource\\(Interaction.render\\)\\)\n\")",
|
|
15
|
+
"Bash(PYTHONPATH=/home/sirrommit/claude_play/panelmark-web:/home/sirrommit/claude_play/panelmark:/home/sirrommit/claude_play/panelmark-html /home/sirrommit/claude_play/panelmark/.venv/bin/pytest tests/test_session.py -q 2>&1)",
|
|
16
|
+
"Bash(PYTHONPATH=/home/sirrommit/claude_play/panelmark:/home/sirrommit/claude_play/panelmark-html python3 -c \"\nfrom panelmark.shell import Shell\nimport inspect\nprint\\(inspect.getsource\\(Shell.handle_key\\)\\)\n\")",
|
|
17
|
+
"Bash(PYTHONPATH=/home/sirrommit/claude_play/panelmark-web:/home/sirrommit/claude_play/panelmark:/home/sirrommit/claude_play/panelmark-html /home/sirrommit/claude_play/panelmark/.venv/bin/pytest tests/test_server.py -q 2>&1)",
|
|
18
|
+
"Bash(PYTHONPATH=/home/sirrommit/claude_play/panelmark-web:/home/sirrommit/claude_play/panelmark:/home/sirrommit/claude_play/panelmark-html /home/sirrommit/claude_play/panelmark/.venv/bin/pytest -q 2>&1)",
|
|
19
|
+
"Bash(git add:*)",
|
|
20
|
+
"Bash(git rm:*)",
|
|
21
|
+
"Bash(git commit:*)",
|
|
22
|
+
"Bash(git push:*)",
|
|
23
|
+
"Bash(git:*)",
|
|
24
|
+
"Bash(PYTHONPATH=/home/sirrommit/claude_play/panelmark-html:/home/sirrommit/claude_play/panelmark /home/sirrommit/claude_play/panelmark/.venv/bin/pytest /home/sirrommit/claude_play/panelmark-html -q 2>&1)",
|
|
25
|
+
"Bash(gh pr:*)",
|
|
26
|
+
"Bash(PYTHONPATH=/home/sirrommit/claude_play/panelmark-web:/home/sirrommit/claude_play/panelmark:/home/sirrommit/claude_play/panelmark-html /home/sirrommit/claude_play/panelmark/.venv/bin/pytest tests/test_integration.py -q 2>&1)",
|
|
27
|
+
"Bash(gh repo:*)",
|
|
28
|
+
"Bash(pip3 show:*)",
|
|
29
|
+
"Bash(/home/sirrommit/claude_play/panelmark/.venv/bin/pip show:*)",
|
|
30
|
+
"Bash(/home/sirrommit/claude_play/panelmark/.venv/bin/pip install:*)",
|
|
31
|
+
"Bash(/home/sirrommit/claude_play/panelmark/.venv/bin/python3 -c \"\nimport simple_websocket, inspect\nsrc = inspect.getsource\\(simple_websocket.Server.receive\\)\nprint\\(src\\)\n\")",
|
|
32
|
+
"Bash(ls:*)",
|
|
33
|
+
"Bash(/home/sirrommit/claude_play/panelmark/.venv/bin/python3 -c \"\nfrom starlette.websockets import WebSocketDisconnect\nprint\\('WebSocketDisconnect:', WebSocketDisconnect\\)\nimport inspect\nprint\\(inspect.getsource\\(WebSocketDisconnect\\)\\)\n\")",
|
|
34
|
+
"Bash(PYTHONPATH=/home/sirrommit/claude_play/panelmark-web:/home/sirrommit/claude_play/panelmark:/home/sirrommit/claude_play/panelmark-html /home/sirrommit/claude_play/panelmark/.venv/bin/pytest tests/test_page.py -q 2>&1)",
|
|
35
|
+
"Bash(PYTHONPATH=/home/sirrommit/claude_play/panelmark-web:/home/sirrommit/claude_play/panelmark:/home/sirrommit/claude_play/panelmark-html pytest -q)",
|
|
36
|
+
"Bash(PYTHONPATH=/home/sirrommit/claude_play/panelmark-web:/home/sirrommit/claude_play/panelmark:/home/sirrommit/claude_play/panelmark-html /home/sirrommit/claude_play/panelmark/.venv/bin/pytest tests/test_interactions.py -v)",
|
|
37
|
+
"Bash(PYTHONPATH=/home/sirrommit/claude_play/panelmark-web:/home/sirrommit/claude_play/panelmark:/home/sirrommit/claude_play/panelmark-html /home/sirrommit/claude_play/panelmark/.venv/bin/pytest tests/test_widgets.py -v)",
|
|
38
|
+
"Bash(PYTHONPATH=/home/sirrommit/claude_play/panelmark-web:/home/sirrommit/claude_play/panelmark:/home/sirrommit/claude_play/panelmark-html /home/sirrommit/claude_play/panelmark/.venv/bin/pytest tests/test_portable_integration.py -v)",
|
|
39
|
+
"Bash(PYTHONPATH=/home/sirrommit/claude_play/panelmark-web:/home/sirrommit/claude_play/panelmark:/home/sirrommit/claude_play/panelmark-html /home/sirrommit/claude_play/panelmark/.venv/bin/pytest tests/test_interactions.py -v --tb=short)",
|
|
40
|
+
"Bash(PYTHONPATH=/home/sirrommit/claude_play/panelmark-web:/home/sirrommit/claude_play/panelmark:/home/sirrommit/claude_play/panelmark-html /home/sirrommit/claude_play/panelmark/.venv/bin/pytest tests/test_portable_integration.py -v --tb=short)",
|
|
41
|
+
"Bash(PYTHONPATH=/home/sirrommit/claude_play/panelmark-web:/home/sirrommit/claude_play/panelmark:/home/sirrommit/claude_play/panelmark-html python -c \"import panelmark_web.interactions; import panelmark_web.widgets; print\\('ok'\\)\")",
|
|
42
|
+
"Bash(PYTHONPATH=/home/sirrommit/claude_play/panelmark-web:/home/sirrommit/claude_play/panelmark:/home/sirrommit/claude_play/panelmark-html .venv/bin/python -c \"import panelmark_web.interactions; import panelmark_web.widgets; print\\('ok'\\)\")",
|
|
43
|
+
"Bash(PYTHONPATH=/home/sirrommit/claude_play/panelmark-web:/home/sirrommit/claude_play/panelmark:/home/sirrommit/claude_play/panelmark-html python3 -c \"import panelmark_web.interactions; import panelmark_web.widgets; print\\('ok'\\)\")",
|
|
44
|
+
"WebFetch(domain:raw.githubusercontent.com)",
|
|
45
|
+
"Bash(python -m pytest -q)",
|
|
46
|
+
"Bash(PYTHONPATH=/home/sirrommit/claude_play/panelmark-web:/home/sirrommit/claude_play/panelmark:/home/sirrommit/claude_play/panelmark-html python3 -m pytest -q)"
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Claude Instructions for panelmark-web
|
|
2
|
+
|
|
3
|
+
This repository is `panelmark-web`, the live web renderer for the panelmark ecosystem.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Scope
|
|
8
|
+
|
|
9
|
+
The only repositories in scope for this work are:
|
|
10
|
+
|
|
11
|
+
- `/home/sirrommit/claude_play/panelmark` — read for API docs and contracts
|
|
12
|
+
- `/home/sirrommit/claude_play/panelmark-html` — read for DOM hook contract and CSS
|
|
13
|
+
- `/home/sirrommit/claude_play/panelmark-web` — the implementation target
|
|
14
|
+
|
|
15
|
+
`panelmark-tui` is **out of scope**. Do not read, search, or reference it.
|
|
16
|
+
|
|
17
|
+
Do not read `panelmark` or `panelmark-html` source code unless a doc gap is found.
|
|
18
|
+
All information needed is available from the documentation listed below.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Repo initialisation
|
|
23
|
+
|
|
24
|
+
If this directory does not yet have a `.git` folder, initialise the repo first:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
cd /home/sirrommit/claude_play/panelmark-web
|
|
28
|
+
git init
|
|
29
|
+
git remote add origin git@github.com:sirrommit/panelmark-web.git
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Do this once. Skip if `.git` already exists.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Implementation plan
|
|
37
|
+
|
|
38
|
+
Read this before starting any work:
|
|
39
|
+
|
|
40
|
+
- `/home/sirrommit/claude_play/PANELMARK_WEB_IMPLEMENTATION_PLAN.md`
|
|
41
|
+
|
|
42
|
+
All open questions in the plan are answered. Do not read `panelmark` or `panelmark-html`
|
|
43
|
+
source to re-answer them.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Required documentation
|
|
48
|
+
|
|
49
|
+
All information needed to implement `panelmark-web` is in these doc files.
|
|
50
|
+
Read them instead of source code.
|
|
51
|
+
|
|
52
|
+
| What you need to know | Document | Section |
|
|
53
|
+
|-----------------------|----------|---------|
|
|
54
|
+
| Renderer contract overview | `panelmark/docs/renderer-spec/contract.md` | — |
|
|
55
|
+
| Key string format (`KEY_*` names, control chars, printable chars) | `panelmark/docs/renderer-spec/contract.md` | §"Key string format" |
|
|
56
|
+
| `Shell.handle_key` return values | `panelmark/docs/renderer-spec/contract.md` | §"Return value" |
|
|
57
|
+
| Dirty-region tracking (`dirty_regions`, `mark_all_clean()`, render loop) | `panelmark/docs/renderer-spec/contract.md` | §"Dirty-region tracking" |
|
|
58
|
+
| `Interaction` ABC (`render`, `handle_key`, `get_value`, `set_value`, `is_focusable`) | `panelmark/docs/custom-interactions.md` | — |
|
|
59
|
+
| `DrawCommand` types (`WriteCmd`, `FillCmd`, `CursorCmd`) and `RenderContext` | `panelmark/docs/draw-commands.md` | — |
|
|
60
|
+
| Stable DOM hooks (`data-pm-region`, `.pm-panel-body`, `data-pm-focused`, etc.) | `panelmark-html/docs/hook-contract.md` | — |
|
|
61
|
+
| CSS classes and custom properties provided by `panelmark-html` | `panelmark-html/docs/hook-contract.md` | §"CSS classes", §"CSS custom properties" |
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Dependency direction
|
|
66
|
+
|
|
67
|
+
- `panelmark-web` depends on `panelmark` and `panelmark-html`.
|
|
68
|
+
- Do not make changes to `panelmark` or `panelmark-html` unless a genuine contract gap
|
|
69
|
+
is found. If a gap is found, stop and get explicit user approval before editing either
|
|
70
|
+
upstream package.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Validation
|
|
75
|
+
|
|
76
|
+
Every change must be tested before completion.
|
|
77
|
+
|
|
78
|
+
- Run the narrowest relevant test first.
|
|
79
|
+
- If the change is broader, run:
|
|
80
|
+
```
|
|
81
|
+
cd /home/sirrommit/claude_play/panelmark-web
|
|
82
|
+
PYTHONPATH=/home/sirrommit/claude_play/panelmark-web:/home/sirrommit/claude_play/panelmark:/home/sirrommit/claude_play/panelmark-html pytest -q
|
|
83
|
+
```
|
|
84
|
+
- For doc-only changes, state explicitly that no automated check exists.
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Git
|
|
89
|
+
|
|
90
|
+
Each completed update should be committed and pushed unless the user says not to.
|
|
91
|
+
|
|
92
|
+
- Remote: `origin git@github.com:sirrommit/panelmark-web.git`
|
|
93
|
+
- Default branch: `main`
|
|
94
|
+
|
|
95
|
+
Before pushing:
|
|
96
|
+
|
|
97
|
+
- Check `git status --short`
|
|
98
|
+
- Confirm only intended files changed
|
|
99
|
+
- Use a clear scoped commit message
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Working style
|
|
104
|
+
|
|
105
|
+
- Follow the phase order in the implementation plan. Complete one phase before starting
|
|
106
|
+
the next unless the user directs otherwise.
|
|
107
|
+
- Make the smallest change that fully solves the task.
|
|
108
|
+
- Do not add features, abstractions, or error handling beyond what the plan specifies.
|
|
109
|
+
- Keep `panelmark-web` independent of `panelmark-tui` — no imports, no references.
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# Documentation TODO: panelmark-web
|
|
2
|
+
|
|
3
|
+
All panelmark-docs links in this file use the base:
|
|
4
|
+
`https://github.com/sirrommit/panelmark-docs/blob/main/docs`
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## README.md
|
|
9
|
+
|
|
10
|
+
### 1 — Add "Not Implemented" section
|
|
11
|
+
|
|
12
|
+
The current README lists what is implemented but does not state what is absent.
|
|
13
|
+
After the "## What it includes" section (ends around line 37), add:
|
|
14
|
+
|
|
15
|
+
```markdown
|
|
16
|
+
## What is not implemented
|
|
17
|
+
|
|
18
|
+
The following optional interactions and widgets from the portable library are
|
|
19
|
+
**not** implemented in this version:
|
|
20
|
+
|
|
21
|
+
| Item | Type | Notes |
|
|
22
|
+
|------|------|-------|
|
|
23
|
+
| `TreeView` | Interaction | Not implemented |
|
|
24
|
+
| `DatePicker` | Widget | Not implemented |
|
|
25
|
+
| `Progress` | Widget | Not implemented |
|
|
26
|
+
| `Spinner` | Widget | Not implemented |
|
|
27
|
+
| `Toast` | Widget | Not implemented |
|
|
28
|
+
|
|
29
|
+
See the [interaction coverage matrix](docs/interaction-coverage.md) for the full
|
|
30
|
+
status of every portable interaction, widget, and draw command.
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 2 — Add also-implemented interactions note
|
|
34
|
+
|
|
35
|
+
After "## What it includes", before the "Not Implemented" section added above,
|
|
36
|
+
add a note that panelmark-web also implements three frequently-used optional
|
|
37
|
+
interactions beyond the 8 required portable ones:
|
|
38
|
+
|
|
39
|
+
```markdown
|
|
40
|
+
Beyond the 8 required portable interactions, `panelmark-web` also implements:
|
|
41
|
+
`MenuFunction`, `ListView`, `TableView`.
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Add this as a sentence/paragraph below the Interactions and Widgets bullet
|
|
45
|
+
points in "## What it includes".
|
|
46
|
+
|
|
47
|
+
### 3 — Add CursorCmd note to Compatibility status section
|
|
48
|
+
|
|
49
|
+
The compatibility section (lines 52–70) already mentions `CursorCmd` is ignored
|
|
50
|
+
on line 58. Confirm line 58 reads:
|
|
51
|
+
`- draw-command execution (\`WriteCmd\`, \`FillCmd\`; \`CursorCmd\` ignored)`
|
|
52
|
+
|
|
53
|
+
If it reads differently, update it to match exactly. No other change needed in
|
|
54
|
+
that section.
|
|
55
|
+
|
|
56
|
+
### 4 — Replace relative docs/ links with panelmark-docs links
|
|
57
|
+
|
|
58
|
+
The following relative links exist in the README and must be updated:
|
|
59
|
+
|
|
60
|
+
- Line 37: `[docs/interaction-coverage.md](docs/interaction-coverage.md)`
|
|
61
|
+
→ replace with local repo link (this file lives in this repo):
|
|
62
|
+
`[interaction coverage matrix](docs/interaction-coverage.md)` — **keep as-is**;
|
|
63
|
+
`docs/interaction-coverage.md` is a repo-local file (see Local docs section below).
|
|
64
|
+
|
|
65
|
+
- Line 67: second `[docs/interaction-coverage.md](docs/interaction-coverage.md)`
|
|
66
|
+
→ same as above; keep as-is.
|
|
67
|
+
|
|
68
|
+
- Line 87: `[docs/getting-started.md](docs/getting-started.md)`
|
|
69
|
+
→ replace with panelmark-docs link:
|
|
70
|
+
`[docs/getting-started.md](https://github.com/sirrommit/panelmark-docs/blob/main/docs/panelmark-web/getting-started.md)`
|
|
71
|
+
|
|
72
|
+
The `examples/` links on lines 91–92 are repo-local and correct; leave them
|
|
73
|
+
unchanged.
|
|
74
|
+
|
|
75
|
+
### 5 — Add Documentation Links section
|
|
76
|
+
|
|
77
|
+
After the "## Quick start" section (currently the last section), add:
|
|
78
|
+
|
|
79
|
+
```markdown
|
|
80
|
+
## Documentation
|
|
81
|
+
|
|
82
|
+
| Document | Description |
|
|
83
|
+
|----------|-------------|
|
|
84
|
+
| [Getting Started](https://github.com/sirrommit/panelmark-docs/blob/main/docs/panelmark-web/getting-started.md) | Step-by-step guide: interaction definition, FastAPI/Flask wiring, browser setup |
|
|
85
|
+
| [Interaction Coverage](docs/interaction-coverage.md) | Status matrix: every portable interaction, widget, and draw command |
|
|
86
|
+
| [WebSocket Protocol](docs/protocol.md) | Client→server and server→client message format; key mapping reference |
|
|
87
|
+
| [Hook Usage](docs/hook-usage.md) | How panelmark-web reads and writes the panelmark-html DOM hook contract |
|
|
88
|
+
| [DOM Hook Contract](https://github.com/sirrommit/panelmark-html/blob/main/docs/hook-contract.md) | Stable DOM interface defined by panelmark-html that this package depends on |
|
|
89
|
+
| [Portable Library Spec](https://github.com/sirrommit/panelmark-docs/blob/main/docs/renderer-spec/portable-library.md) | Normative spec for all 8 portable interactions and 6 portable widgets |
|
|
90
|
+
| [Renderer Spec](https://github.com/sirrommit/panelmark-docs/blob/main/docs/renderer-spec/overview.md) | Core renderer contract; compatibility levels; extension policy |
|
|
91
|
+
| [Shell Language](https://github.com/sirrommit/panelmark-docs/blob/main/docs/shell-language/overview.md) | ASCII-art layout syntax reference |
|
|
92
|
+
| [Ecosystem Overview](https://github.com/sirrommit/panelmark-docs/blob/main/docs/ecosystem.md) | How panelmark-web fits into the panelmark package ecosystem |
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### 6 — Shorten portable list in "What it includes"
|
|
96
|
+
|
|
97
|
+
The current "What it includes" section lists all 8 portable interactions and all
|
|
98
|
+
6 portable widgets by name. Shorten to a reference rather than a full
|
|
99
|
+
enumeration. Replace the two bullet points with:
|
|
100
|
+
|
|
101
|
+
```markdown
|
|
102
|
+
- **Interactions** (`panelmark_web.interactions`): all 8 required portable
|
|
103
|
+
interactions — `StatusMessage`, `MenuReturn`, `RadioList`, `CheckBox`,
|
|
104
|
+
`TextBox`, `NestedMenu`, `FormInput`, `DataclassFormInteraction` — plus
|
|
105
|
+
`MenuFunction`, `ListView`, `TableView`.
|
|
106
|
+
See [portable library spec](https://github.com/sirrommit/panelmark-docs/blob/main/docs/renderer-spec/portable-library.md)
|
|
107
|
+
for the full normative specification.
|
|
108
|
+
|
|
109
|
+
- **Widgets** (`panelmark_web.widgets`): all 6 required portable widgets —
|
|
110
|
+
`Alert`, `Confirm`, `InputPrompt`, `ListSelect`, `DataclassForm`, `FilePicker`.
|
|
111
|
+
Web-specific note: widgets are async/non-blocking; see
|
|
112
|
+
[overview](https://github.com/sirrommit/panelmark-docs/blob/main/docs/panelmark-web/overview.md)
|
|
113
|
+
for the async widget model.
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Local docs/ folder
|
|
119
|
+
|
|
120
|
+
Three files exist in `docs/`. Each must be audited:
|
|
121
|
+
|
|
122
|
+
### docs/interaction-coverage.md
|
|
123
|
+
|
|
124
|
+
- [ ] This file is repo-local and repo-specific (tracks implementation status
|
|
125
|
+
for this renderer). **Keep it.** Verify the matrix is current:
|
|
126
|
+
- All 8 portable interactions: `StatusMessage`, `MenuReturn`, `NestedMenu`,
|
|
127
|
+
`RadioList`, `CheckBox`, `TextBox`, `FormInput`, `DataclassFormInteraction`
|
|
128
|
+
should be marked implemented.
|
|
129
|
+
- All 6 portable widgets: `Alert`, `Confirm`, `InputPrompt`, `ListSelect`,
|
|
130
|
+
`DataclassForm`, `FilePicker` should be marked implemented.
|
|
131
|
+
- Optional implemented: `MenuFunction`, `ListView`, `TableView` — mark implemented.
|
|
132
|
+
- Not implemented: `TreeView`, `DatePicker`, `Progress`, `Spinner`, `Toast` —
|
|
133
|
+
mark not implemented.
|
|
134
|
+
- Draw commands: `WriteCmd` ✅, `FillCmd` ✅, `CursorCmd` — mark as "accepted,
|
|
135
|
+
ignored" (not an error, just a no-op).
|
|
136
|
+
- Update any stale entries and add any missing rows.
|
|
137
|
+
|
|
138
|
+
### docs/getting-started.md
|
|
139
|
+
|
|
140
|
+
- [ ] This file is mirrored at
|
|
141
|
+
`https://github.com/sirrommit/panelmark-docs/blob/main/docs/panelmark-web/getting-started.md`.
|
|
142
|
+
Compare both versions:
|
|
143
|
+
- If panelmark-docs is more complete, update this local file to match and add
|
|
144
|
+
a header:
|
|
145
|
+
```markdown
|
|
146
|
+
> **Note:** This document is also available on
|
|
147
|
+
> [panelmark-docs](https://github.com/sirrommit/panelmark-docs/blob/main/docs/panelmark-web/getting-started.md).
|
|
148
|
+
```
|
|
149
|
+
- If the local file is more complete, note the gap for panelmark-docs maintainers;
|
|
150
|
+
do not delete the local copy.
|
|
151
|
+
- README link to `docs/getting-started.md` was replaced with the panelmark-docs
|
|
152
|
+
URL in step 4 above. Confirm the local file is not orphaned by checking for
|
|
153
|
+
any remaining links to it:
|
|
154
|
+
`grep -rn "docs/getting-started" . --include="*.md"`
|
|
155
|
+
|
|
156
|
+
### docs/hook-contract-web.md
|
|
157
|
+
|
|
158
|
+
- [ ] Read this file. It likely documents how panelmark-web reads/writes the
|
|
159
|
+
panelmark-html hook contract (equivalent to
|
|
160
|
+
`https://github.com/sirrommit/panelmark-docs/blob/main/docs/panelmark-web/hook-usage.md`).
|
|
161
|
+
- Compare against the panelmark-docs version.
|
|
162
|
+
- Rename this file to `docs/hook-usage.md` to match the canonical name used in
|
|
163
|
+
the Documentation table added in step 5 above.
|
|
164
|
+
- Add a header to the renamed file:
|
|
165
|
+
```markdown
|
|
166
|
+
> **Note:** This document is also mirrored at
|
|
167
|
+
> [panelmark-docs](https://github.com/sirrommit/panelmark-docs/blob/main/docs/panelmark-web/hook-usage.md).
|
|
168
|
+
```
|
|
169
|
+
- Confirm no other file links to the old name `docs/hook-contract-web.md` after
|
|
170
|
+
the rename:
|
|
171
|
+
`grep -rn "hook-contract-web" . --include="*.md"`
|
|
172
|
+
|
|
173
|
+
### docs/protocol.md (check existence)
|
|
174
|
+
|
|
175
|
+
- [ ] Run: `ls /home/sirrommit/claude_play/panelmark-web/docs/`
|
|
176
|
+
If `docs/protocol.md` does not exist, create it by fetching the content from:
|
|
177
|
+
`https://github.com/sirrommit/panelmark-docs/blob/main/docs/panelmark-web/protocol.md`
|
|
178
|
+
and adding this header at the top:
|
|
179
|
+
```markdown
|
|
180
|
+
> **Note:** This document is also mirrored at
|
|
181
|
+
> [panelmark-docs](https://github.com/sirrommit/panelmark-docs/blob/main/docs/panelmark-web/protocol.md).
|
|
182
|
+
```
|
|
183
|
+
If it already exists, compare against panelmark-docs and sync, adding the same header.
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Validation
|
|
188
|
+
|
|
189
|
+
- [ ] Grep for any remaining relative `docs/getting-started` links in README:
|
|
190
|
+
`grep -n "docs/getting-started" README.md`
|
|
191
|
+
Result must be empty (replaced with panelmark-docs URL in step 4).
|
|
192
|
+
|
|
193
|
+
- [ ] Confirm "Not implemented" section is present:
|
|
194
|
+
`grep -n "not implemented\|Not Implemented\|What is not" README.md`
|
|
195
|
+
|
|
196
|
+
- [ ] Confirm `CursorCmd` is mentioned in the Compatibility section:
|
|
197
|
+
`grep -n "CursorCmd" README.md`
|
|
198
|
+
|
|
199
|
+
- [ ] Confirm `docs/hook-contract-web.md` has been renamed to `docs/hook-usage.md`:
|
|
200
|
+
`ls /home/sirrommit/claude_play/panelmark-web/docs/`
|
|
201
|
+
Should show `hook-usage.md`, not `hook-contract-web.md`.
|
|
202
|
+
|
|
203
|
+
- [ ] Confirm `docs/protocol.md` exists.
|
|
204
|
+
|
|
205
|
+
- [ ] Run tests (doc-only change — if no automated check exists, state that
|
|
206
|
+
explicitly in the commit message):
|
|
207
|
+
`cd /home/sirrommit/claude_play/panelmark-web && PYTHONPATH=/home/sirrommit/claude_play/panelmark-web:/home/sirrommit/claude_play/panelmark:/home/sirrommit/claude_play/panelmark-html pytest -q`
|
|
208
|
+
|
|
209
|
+
- [ ] Review `git diff --stat` and confirm only `README.md`, `docs/` files are
|
|
210
|
+
changed. No Python source changes.
|
|
211
|
+
|
|
212
|
+
- [ ] Commit:
|
|
213
|
+
```
|
|
214
|
+
docs: add not-implemented list, documentation links section, fix relative links; rename hook-contract-web.md to hook-usage.md
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
- [ ] Push to `origin main`.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Timothy Morris PhD
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: panelmark-web
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Live web renderer for the panelmark ecosystem
|
|
5
|
+
Project-URL: Repository, https://github.com/sirrommit/panelmark-web
|
|
6
|
+
Author-email: Timothy Morris PhD <sirrommit@gmail.com>
|
|
7
|
+
License: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Keywords: layout,panelmark,renderer,ui,web,websocket
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Topic :: Software Development :: User Interfaces
|
|
17
|
+
Requires-Python: >=3.11
|
|
18
|
+
Requires-Dist: panelmark-html>=0.1.0
|
|
19
|
+
Requires-Dist: panelmark>=0.1.0
|
|
20
|
+
Provides-Extra: dev
|
|
21
|
+
Requires-Dist: pytest; extra == 'dev'
|
|
22
|
+
Requires-Dist: pytest-asyncio; extra == 'dev'
|
|
23
|
+
Provides-Extra: fastapi
|
|
24
|
+
Requires-Dist: fastapi; extra == 'fastapi'
|
|
25
|
+
Requires-Dist: uvicorn[standard]; extra == 'fastapi'
|
|
26
|
+
Provides-Extra: flask
|
|
27
|
+
Requires-Dist: flask; extra == 'flask'
|
|
28
|
+
Requires-Dist: flask-sock; extra == 'flask'
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
|
|
31
|
+
# panelmark-web
|
|
32
|
+
|
|
33
|
+
Live web session runtime for the [panelmark](https://github.com/sirrommit/panelmark) ecosystem.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## What it is
|
|
38
|
+
|
|
39
|
+
`panelmark-web` sits on top of `panelmark-html`'s static structure and adds a
|
|
40
|
+
real-time browser interface:
|
|
41
|
+
|
|
42
|
+
- A WebSocket server handler that drives a `panelmark.Shell` instance
|
|
43
|
+
- A draw-command-to-HTML renderer that populates `.pm-panel-body` elements
|
|
44
|
+
- A vanilla-JS browser client that relays keyboard input and applies DOM updates
|
|
45
|
+
- Framework adapters for FastAPI/Starlette (async) and Flask/flask-sock (sync)
|
|
46
|
+
|
|
47
|
+
Each browser tab corresponds to one `Shell` instance on the server. The
|
|
48
|
+
WebSocket connection is the session lifetime.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## What it includes
|
|
53
|
+
|
|
54
|
+
Beyond the transport and rendering infrastructure, `panelmark-web` ships
|
|
55
|
+
built-in implementations of the full portable standard library:
|
|
56
|
+
|
|
57
|
+
- **Interactions** (`panelmark_web.interactions`): all 8 required portable
|
|
58
|
+
interactions — `StatusMessage`, `MenuReturn`, `RadioList`, `CheckBox`,
|
|
59
|
+
`TextBox`, `NestedMenu`, `FormInput`, `DataclassFormInteraction` — plus
|
|
60
|
+
`MenuFunction`, `ListView`, `TableView`.
|
|
61
|
+
See [portable library spec](https://github.com/sirrommit/panelmark-docs/blob/main/docs/renderer-spec/portable-library.md)
|
|
62
|
+
for the full normative specification.
|
|
63
|
+
|
|
64
|
+
- **Widgets** (`panelmark_web.widgets`): all 6 required portable widgets —
|
|
65
|
+
`Alert`, `Confirm`, `InputPrompt`, `ListSelect`, `DataclassForm`, `FilePicker`.
|
|
66
|
+
Web-specific note: widgets are async/non-blocking; see
|
|
67
|
+
[overview](https://github.com/sirrommit/panelmark-docs/blob/main/docs/panelmark-web/overview.md)
|
|
68
|
+
for the async widget model.
|
|
69
|
+
|
|
70
|
+
Application code can also supply arbitrary custom `Interaction` objects — any
|
|
71
|
+
`render()` method that returns `WriteCmd` and `FillCmd` commands works out of
|
|
72
|
+
the box.
|
|
73
|
+
|
|
74
|
+
See [docs/interaction-coverage.md](docs/interaction-coverage.md) for the full
|
|
75
|
+
status matrix.
|
|
76
|
+
|
|
77
|
+
## What is not implemented
|
|
78
|
+
|
|
79
|
+
The following optional interactions and widgets from the portable library are
|
|
80
|
+
**not** implemented in this version:
|
|
81
|
+
|
|
82
|
+
| Item | Type | Notes |
|
|
83
|
+
|------|------|-------|
|
|
84
|
+
| `TreeView` | Interaction | Not implemented |
|
|
85
|
+
| `DatePicker` | Widget | Not implemented |
|
|
86
|
+
| `Progress` | Widget | Not implemented |
|
|
87
|
+
| `Spinner` | Widget | Not implemented |
|
|
88
|
+
| `Toast` | Widget | Not implemented |
|
|
89
|
+
|
|
90
|
+
See the [interaction coverage matrix](docs/interaction-coverage.md) for the full
|
|
91
|
+
status of every portable interaction, widget, and draw command.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Dependencies
|
|
96
|
+
|
|
97
|
+
| Package | Role |
|
|
98
|
+
|---------|------|
|
|
99
|
+
| `panelmark` | Shell, Interaction ABC, draw commands |
|
|
100
|
+
| `panelmark-html` | Static page structure and base CSS |
|
|
101
|
+
| `fastapi` / `starlette` *(optional)* | Async ASGI server adapter |
|
|
102
|
+
| `flask` + `flask-sock` *(optional)* | Sync WSGI server adapter |
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Compatibility status
|
|
107
|
+
|
|
108
|
+
`panelmark-web` implements the **core renderer contract** and claims
|
|
109
|
+
**`portable-library-compatible`** status:
|
|
110
|
+
|
|
111
|
+
- shell hosting via WebSocket session
|
|
112
|
+
- draw-command execution (`WriteCmd`, `FillCmd`; `CursorCmd` ignored)
|
|
113
|
+
- focus routing and dirty-region tracking
|
|
114
|
+
- exit signal handling
|
|
115
|
+
- all 8 required portable interactions (`panelmark_web.interactions`)
|
|
116
|
+
- all 6 required portable widgets (`panelmark_web.widgets`)
|
|
117
|
+
|
|
118
|
+
**Web note:** The portable-library spec describes widgets as blocking
|
|
119
|
+
(`widget.show(sh)` returns after the user acts). In `panelmark-web` the
|
|
120
|
+
session is async — assign the widget to a panel region and `signal_return()`
|
|
121
|
+
delivers the result when the user acts. Constructor signatures and value
|
|
122
|
+
semantics match the spec exactly.
|
|
123
|
+
|
|
124
|
+
See [docs/interaction-coverage.md](docs/interaction-coverage.md) for the
|
|
125
|
+
full status matrix.
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Install
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
pip install panelmark-web[fastapi] # FastAPI / Starlette
|
|
133
|
+
pip install panelmark-web[flask] # Flask + flask-sock
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Quick start
|
|
139
|
+
|
|
140
|
+
See [docs/getting-started.md](https://github.com/sirrommit/panelmark-docs/blob/main/docs/panelmark-web/getting-started.md) for a step-by-step
|
|
141
|
+
guide including interaction definition, server wiring, and browser setup.
|
|
142
|
+
|
|
143
|
+
See [examples/fastapi_app.py](examples/fastapi_app.py) and
|
|
144
|
+
[examples/flask_app.py](examples/flask_app.py) for working server examples.
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Documentation
|
|
149
|
+
|
|
150
|
+
| Document | Description |
|
|
151
|
+
|----------|-------------|
|
|
152
|
+
| [Getting Started](https://github.com/sirrommit/panelmark-docs/blob/main/docs/panelmark-web/getting-started.md) | Step-by-step guide: interaction definition, FastAPI/Flask wiring, browser setup |
|
|
153
|
+
| [Interaction Coverage](docs/interaction-coverage.md) | Status matrix: every portable interaction, widget, and draw command |
|
|
154
|
+
| [WebSocket Protocol](docs/protocol.md) | Client→server and server→client message format; key mapping reference |
|
|
155
|
+
| [Hook Usage](docs/hook-usage.md) | How panelmark-web reads and writes the panelmark-html DOM hook contract |
|
|
156
|
+
| [DOM Hook Contract](https://github.com/sirrommit/panelmark-html/blob/main/docs/hook-contract.md) | Stable DOM interface defined by panelmark-html that this package depends on |
|
|
157
|
+
| [Portable Library Spec](https://github.com/sirrommit/panelmark-docs/blob/main/docs/renderer-spec/portable-library.md) | Normative spec for all 8 portable interactions and 6 portable widgets |
|
|
158
|
+
| [Renderer Spec](https://github.com/sirrommit/panelmark-docs/blob/main/docs/renderer-spec/overview.md) | Core renderer contract; compatibility levels; extension policy |
|
|
159
|
+
| [Shell Language](https://github.com/sirrommit/panelmark-docs/blob/main/docs/shell-language/overview.md) | ASCII-art layout syntax reference |
|
|
160
|
+
| [Ecosystem Overview](https://github.com/sirrommit/panelmark-docs/blob/main/docs/ecosystem.md) | How panelmark-web fits into the panelmark package ecosystem |
|