From 4a7dbf00851db8e1e26d590e40dca727426223c9 Mon Sep 17 00:00:00 2001 From: whitlocktech Date: Sat, 27 Jun 2026 10:57:27 -0500 Subject: [PATCH] Wiki Phase 2: TipTap rich-text editor + inline image uploads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces the raw-HTML textarea in the wiki editor with a TipTap (ProseMirror) WYSIWYG editor. - new RichTextEditor component: bold/italic/strike, H2/H3, bullet+ordered lists, blockquote, code block, divider, link, inline image, undo/redo - generalized POST /admin/uploads (reuses the screenshot multer config) → { url }; the editor uploads inline images through it - editor output still passes through the Phase 1 server-side sanitizer on save and DOMPurify on render - lazy-loaded as its own chunk so the public bundle doesn't ship TipTap (public ~82kB gzip; editor chunk ~106kB gzip loaded only in admin) - RTE styling added to theme.css (toolbar, active states, prose content) Verified: uploads serve as images; H2/H3 + lists + link + inline image round-trip through the WYSIWYG and render sanitized on the public page. Co-Authored-By: Claude Opus 4.8 --- WIKI_UPGRADE.md | 7 +- client/package-lock.json | 809 ++++++++++++++++++ client/package.json | 4 + client/src/api/client.js | 6 + client/src/components/RichTextEditor.jsx | 128 +++ client/src/routes/admin/views/WikiEditor.jsx | 16 +- client/src/styles/theme.css | 69 ++ .../src/router/v1/admin/admin.controller.js | 10 + server/src/router/v1/admin/admin.routes.js | 2 + 9 files changed, 1045 insertions(+), 6 deletions(-) create mode 100644 client/src/components/RichTextEditor.jsx diff --git a/WIKI_UPGRADE.md b/WIKI_UPGRADE.md index 71a1242..3a95ffe 100644 --- a/WIKI_UPGRADE.md +++ b/WIKI_UPGRADE.md @@ -299,10 +299,15 @@ phase if preferred). Do not merge a phase that hasn't been verified. index is data-driven (categories + sections); article shows category breadcrumb; client builds and server boots with no errors. -### Phase 2 — Authoring UX +### Phase 2 — Authoring UX ✅ - TipTap editor replaces the textarea; generalized `/admin/uploads`; inline images. - **Exit check**: create/edit a page with headings, a list, a link, and an inline image; verify it renders sanitized on the public page. +- **Verified** (2026-06-27): `/admin/uploads` returns `{url}` and the file serves as + an image; a page authored with H2/H3, lists, a link, and an uploaded inline image + round-trips through the WYSIWYG and renders sanitized publicly (link `rel` forced, + `