"""FlowDeck โ€” Built-in page (block) templates (v5.12.0). Global page templates used by the ยซ + New page ยป picker. Built-ins live here (code, versioned); user templates live in the ``page_global_templates`` table. Block shapes match the editor's storage format (see ``app/routers/board.py::save_page_blocks``) โ€” ids are assigned client-side. """ from __future__ import annotations import json def _b(btype: str, content: str = "", **extra) -> dict: out = {"type": btype, "content": content} out.update(extra) return out BUILTIN_TEMPLATES: dict[str, dict] = { "empty": { "name": "Empty", "icon": "๐Ÿ“„", "description": "A blank page.", "blocks": [_b("paragraph")], }, "meeting_notes": { "name": "Meeting notes", "icon": "๐Ÿ—’๏ธ", "description": "Attendees, agenda, notes, action items.", "blocks": [ _b("heading_1", "Meeting notes"), _b("callout", "Date: ยท Time: ยท Attendees: ", icon="๐Ÿ“…"), _b("heading_2", "Agenda"), _b("bulleted_list", "Topic 1"), _b("bulleted_list", "Topic 2"), _b("heading_2", "Notes"), _b("paragraph"), _b("heading_2", "Decisions"), _b("bulleted_list"), _b("heading_2", "Action items"), _b("to_do", "Owner โ€” due date", checked=False), _b("to_do", "", checked=False), ], }, "weekly_report": { "name": "Weekly report", "icon": "๐Ÿ“Š", "description": "Wins, in progress, blockers, next week.", "blocks": [ _b("heading_1", "Week of [[fddate:2026-01-05]]"), _b("heading_2", "๐ŸŽ‰ Wins"), _b("bulleted_list"), _b("heading_2", "๐Ÿšง In progress"), _b("bulleted_list"), _b("heading_2", "โ›” Blockers"), _b("bulleted_list"), _b("heading_2", "๐Ÿ—“๏ธ Next week"), _b("to_do", "", checked=False), ], }, "todo_list": { "name": "To-do list", "icon": "โœ…", "description": "A simple checklist.", "blocks": [ _b("heading_1", "To-do"), _b("to_do", "", checked=False), _b("to_do", "", checked=False), _b("to_do", "", checked=False), ], }, "project_doc": { "name": "Project doc", "icon": "๐Ÿš€", "description": "Goals, status, team, links.", "blocks": [ _b("heading_1", "Project title"), _b("callout", "One-line description of the project.", icon="๐Ÿ’ก"), _b("heading_2", "Goals"), _b("numbered_list"), _b("heading_2", "Status"), _b("toggle", "This week", expanded=True, children=[_b("paragraph")]), _b("heading_2", "Team"), _b("bulleted_list"), _b("heading_2", "Resources"), _b("bulleted_list"), ], }, } def template_list() -> list[dict]: """Public shape of the built-in templates for the picker UI.""" return [ {"key": key, "name": t["name"], "icon": t["icon"], "description": t["description"], "builtin": True} for key, t in BUILTIN_TEMPLATES.items() ] def blocks_json_for(key: str) -> str | None: t = BUILTIN_TEMPLATES.get(key) return json.dumps(t["blocks"]) if t else None