feat(export): Chunk #6 Export Pipeline — 7 exporters, ExportDialog & tests

Add the @pubscript/exporters package exporting a flattened ProseMirror
project to Markdown, HTML, EPUB, DOCX, ODT and PDF, plus a deterministic
generatedAt timestamp threaded through every format (ZIP entry dates,
PDF /ID, DOCX dc:created/modified, EPUB id, HTML/XML footers) so golden
files are byte-stable.

Wire an ExportDialog into the web app (Topbar trigger, App route) with
format selection, theme pick, and download helpers.

Add round-trip and golden-file determinism tests (22) covering
non-empty output, byte-identical re-exports, Markdown round-trip through
the editor, and EPUB/ODT ZIP + mimetype + XML validation.
This commit is contained in:
Schwitzz
2026-10-26 23:30:47 -05:00
parent 35b015bb04
commit 978858362d
24 changed files with 3103 additions and 2 deletions
+4 -1
View File
@@ -1,6 +1,7 @@
import { useState, useEffect } from "react";
import { Routes, Route } from "react-router-dom";
import { Sidebar, Topbar, CommandPalette } from "./components/index.js";
import { ExportDialog } from "./features/export/ExportDialog.js";
import { ToastViewport } from "@pubscript/ui";
import Write from "./routes/Write.js";
import { Characters } from "./routes/Characters.js";
@@ -26,6 +27,7 @@ const NAV = [
export default function App() {
const [paletteOpen, setPaletteOpen] = useState(false);
const [exportOpen, setExportOpen] = useState(false);
useEffect(() => {
const onKey = (e: KeyboardEvent) => {
@@ -41,7 +43,7 @@ export default function App() {
return (
<div className="ps-app">
<Sidebar nav={NAV} />
<Topbar onOpenPalette={() => setPaletteOpen(true)} />
<Topbar onOpenPalette={() => setPaletteOpen(true)} onOpenExport={() => setExportOpen(true)} />
<main className="ps-main">
<Routes>
<Route path="/" element={<Write />} />
@@ -58,6 +60,7 @@ export default function App() {
</main>
<CommandPalette open={paletteOpen} onClose={() => setPaletteOpen(false)} nav={NAV} />
<ExportDialog open={exportOpen} onClose={() => setExportOpen(false)} />
<ToastViewport />
</div>
);