Commit History
-
fix(publisher): render math server-side via KaTeX
TipTap's math extension emits empty inline/block-math placeholders during generateHTML (rendering is a view-only step). Add a math transformer that fills those placeholders with static KaTeX HTML so formulas appear in the published article. Pin the KaTeX CSS CDN version to the server-side katex. Co-authored-by: Cursor <[email protected]>d062662
-
chore(deps): align @hocuspocus /provider with server (v3)
The backend declared @hocuspocus/provider ^4.0.0 while the server and frontend run ^3.4.4. A v4 provider (used by the demo clients) against a v3 server risks protocol drift; pin it to the same major. Co-authored-by: Cursor <[email protected]>24e2428
-
feat(agent): switch AI backend from OpenRouter to HF Inference Providers
The chat panel and embed studio now call Hugging Face Inference Providers (OpenAI-compatible router at https://huggingface.co/proxy/router.huggingface.co/v1) via @ai-sdk/openai-compatible, using the logged-in editor's OAuth token when available and falling back to HF_TOKEN. Forking the Space no longer requires wiring an OpenRouter API key - the user's own HF token funds their own inference. - Replace @openrouter/ai-sdk-provider with @ai-sdk/openai-compatible - Forward the OAuth cookie token per request, fallback to HF_TOKEN - Refresh AVAILABLE_MODELS to HF-served, tool-calling-capable models (gpt-oss 120B/20B, Llama 3.3 70B, Qwen3 Coder 480B, DeepSeek V3.1) - Add inference-api to hf_oauth_scopes and document the new env vars (HF_INFERENCE_MODEL, expanded HF_TOKEN role) in README + SPECIFICATION - Update agent-chat tests to expect the new "Hugging Face token" error Co-authored-by: Cursor <[email protected]>6b6afea
-
feat(demo): full showcase polish - mouse cursor, robust selection, HF affiliations
Demo orchestration: - Visible mouse cursor overlay (popover top-layer, MutationObserver to stay above native dialogs) + humanMove/humanClick/humanHover helpers - Yjs Node.js clients for Bob and Carol with awareness cursors and a set of high-level helpers (writeBlockMathAtSlot, setAffiliationUrl, waitForAffiliationCount, etc.) so peer interactions never collide - Pre-bold sync barrier: Alice waits for Bob's block math and Carol's code block to land before doing the bubble-toolbar bold so layout is frozen during the drag selection (no more cross-paragraph selections) - Progressive cursor-driven text selection (visible glide + step-wise setTextSelection) for bold and rephrase actions - Custom rAF-eased scroll-to-top on the actual .editor-scroll container before the hue drag so the banner retint reads on camera Embed Studio: - New architecture.json companion data file (transformer-block layers) seeded alongside model-accuracy.csv, so the agent has something concrete to r…f469961
-
test(backend): add Playwright E2E suite + deps for editor basics, chat persistence and publish
- Covers 9 flows: title persistence through Hocuspocus reload, settings drawer, chat panel open/close, new-conversation clear, stable user identity across reloads, publish round-trip - Bundled as `npm run test:e2e` (opt-in, not part of the fast hermetic suite) with spec-driven fixtures that spin up a real Express + Hocuspocus server on an ephemeral port - Brings playwright + @playwright/test into backend/package.json Made-with: Cursor6a34a48
-
refactor: remove MUI, unify publisher pipeline, add shared component registry
Phase 1 - Publisher pipeline: - Extract ~370 lines of inline CSS from html-renderer.ts into _publisher.css - Create shared/component-defs.ts as single source of truth for component definitions - Replace 6 regex blocks in postProcess() with linkedom DOM manipulation - Add GET /api/preview/:docName for testing renders without publishing - Add 12 snapshot tests for each postProcess transformation (46 tests total) Phase 2 - Remove MUI: - Replace all MUI components with native HTML elements + custom CSS - Create _ui.css with editor chrome styles using --ed-* CSS tokens - Create Tooltip.tsx using Floating UI (lightweight replacement) - Replace @mui/icons-material with lucide-react - Delete theme.ts, remove @mui/* and @emotion/* dependencies Phase 3 - Documentation: - Add docs/ARCHITECTURE.md covering CSS layers, HF Spaces constraints, shared registry, publisher pipeline, and test coverage Made-with: Cursord15d7f7 -
fix: enable PDF generation by adding playwright dependency
- Add playwright as a production dependency in backend - Set PLAYWRIGHT_BROWSERS_PATH in Dockerfile for reliable browser discovery - Remove silent fallback on playwright install to surface errors - Remove non-functional PDF button from editor hero (only relevant in published output) - Respect showPdf frontmatter flag in publisher pipeline Made-with: Cursor8d245e0 -
test: add vitest test suite for publisher, auth, security, utils
- Setup vitest with test helpers for Y.Doc fixtures - 34 tests across 6 files covering: - Publisher pipeline (extraction, HTML gen, post-processing, idempotency) - XSS prevention (licence, title, description, authors, DOI) - Auth (token extraction, OAuth config) - Utils (sanitizeName, docPath, path traversal) - CSS @custom-media resolution - HF Storage configuration Made-with: Cursor755a930 -
fix: rename to Research Article Template Editor
Made-with: Cursor1e2f7dc -
refactor: rename to Science Article Template Editor, remove MDX export, fix settings drawer
- Rename project from "Collab Editor" to "Science Article Template Editor" across README, package.json, HTML titles, and docs - Remove MDX export: delete to-mdx.ts, serializers, UI button, and registerComponentSerializers; use editor.getText() for agent context - Settings drawer: flatten Advanced accordion, fix toggle clipping (ml: 0), widen to 380px, use slotProps.paper (MUI v9) Made-with: Cursor20354ec
-
fix: replace express-ws with native ws to fix WebSocket binary handling
express-ws bundles [email protected] while @hocuspocus/server requires [email protected]. This version mismatch causes ERR_ENCODING_INVALID_ENCODED_DATA errors as the binary Yjs protocol messages get corrupted passing through express-ws's incompatible ws instance. Replace express-ws with native http.createServer + ws.WebSocketServer handling the upgrade event directly. This ensures a single [email protected] is used throughout, matching what Hocuspocus expects. Made-with: Cursor82092f2 -
fix: use TiptapTransformer to extract Y.Doc content for publish
The old extractFromYDoc relied on a Y.Map("tiptap-json") that the editor never populated. Now uses @hocuspocus/transformer to properly convert the Y.XmlFragment to ProseMirror JSON using the same extensions as the server-side HTML renderer. Made-with: Cursordb4f7ee -
feat: add publish pipeline with HTML/PDF/thumbnail generation
Publisher pipeline (POST /api/publish): - Server-side TipTap extensions mirroring frontend (no React) - generateHTML() produces article HTML with SEO meta tags - Playwright-based PDF and OG thumbnail generation (optional) - Upload published artifacts to HF dataset (or local fallback) - HTML template with light/dark theme toggle, image lightbox Routing updates: - Authenticated editors get SPA, visitors get published HTML - Image proxy for private HF datasets (/api/images/*) - Serve local published articles from /published/ Also: add type declarations for citation-js and playwright Made-with: Cursor3171ebe -
chore: initial commit
Collaborative article editor with TipTap, Yjs, and HF integration. Features: - Real-time collaborative editing (Hocuspocus + Yjs) - Notion-like block handles, slash commands, bubble toolbar - Academic citations (Citation.js + DOI/BibTeX) - KaTeX math, code highlighting, tables - Custom component system (accordion, note, quote, stack, etc.) - LLM agent sidebar (OpenRouter) - Image upload with HF dataset storage - MDX export - Frontmatter management (title, authors, affiliations) - Comments system Made-with: Cursor561e6f0