super-productivity/packages/plugin-dev/document-mode/package.json
Johannes Millan d429900665 feat(document-mode): add TipTap-based document-mode plugin (POC)
A bundled plugin that replaces the work-view task list with a TipTap
editor for projects and the TODAY tag. Task references are read-only
chips with a checkbox; everything else is normal ProseMirror content
(paragraphs, headings, dividers) plus a simple slash menu for inserts.

- Iframe plugin scaffolded under packages/plugin-dev/document-mode with
  esbuild bundling. The editor.js bundle is inlined into index.html
  because the blob-URL iframe can't resolve relative scripts.
- background.ts registers a work-context header button with
  showFor: ['PROJECT', 'TODAY']; click calls showInWorkContext().
- editor.ts: TipTap (core + StarterKit + Placeholder) with a custom
  taskRef atom node-view (checkbox + title from getTasks() cache).
  Subscribes to WORK_CONTEXT_CHANGE for nav and ANY_TASK_UPDATE for
  title/done-state refresh. Persists per-ctx ProseMirror JSON inside
  the existing single plugin blob ({ docs: { [ctxId]: doc } }) with
  5 s debounced save and a pagehide flush.
- Plugin auto-bundled by packages/plugin-dev/scripts/build-all.js and
  registered in BUNDLED_PLUGIN_PATHS.

Out of scope for the POC (documented in the plan): inline-editable
task titles, keyed persistDataSynced API, removal of in-tree
document-mode, data migration, Electron beforeUnload hook.
2026-05-21 17:22:31 +02:00

23 lines
646 B
JSON

{
"name": "document-mode",
"version": "0.1.0",
"description": "Document-style editor for projects and Today using TipTap",
"private": true,
"scripts": {
"build": "node scripts/build.js",
"deploy": "npm run build && node scripts/deploy.js",
"lint": "tsc --noEmit"
},
"devDependencies": {
"@types/node": "^22.15.33",
"esbuild": "^0.25.11",
"typescript": "^5.8.3"
},
"dependencies": {
"@super-productivity/plugin-api": "file:../../plugin-api",
"@tiptap/core": "^2.10.0",
"@tiptap/extension-placeholder": "^2.10.0",
"@tiptap/starter-kit": "^2.10.0",
"@tiptap/suggestion": "^2.10.0"
}
}