The app was dark-only, with the chrome's colours hardcoded across style.css.
Introduce a semantic token layer with three states: bare :root carries the dark
palette (the original look, unchanged), a prefers-color-scheme block drives
system mode, and [data-theme="light"] lets an explicit choice win against the OS.
System is the default. Nothing is stored and no attribute is set until the user
picks something, so the media query stays in charge — including an OS change made
while the app is open, with no listener needed.
The light palette is Open Color throughout, extending the --oc-* subset the
compare view already used rather than adding a second scale. Document surfaces
(.pdf-page, .image-info, …) are deliberately not themed — a page is white paper
in both themes — and the format badges keep their meaning colours.
Foreground tokens are set from measured contrast rather than by mirroring the
dark ramp, because muted greys have to get darker in a light theme, not lighter:
--fg-dim at gray-5 on gray-4 measured 1.39:1, effectively invisible. It is now
dividers-only and never carries text. --fg-muted and --fg-faint both land on
gray-7, since a light theme has far less headroom below the surface than a dark
one has above it.
Also:
- localized theme selector (all 9 languages) beside the language one, with a
pre-paint script in <head> so an explicit light choice cannot flash dark
- the select chevron is tokenised as a whole image, since a custom property
cannot be interpolated inside url()
- the dropzone icon uses currentColor so it follows the accent
- drop the duplicate toolbar separator shown when the format badge is hidden
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Render PostScript and EPS (.ps / .eps / .epsf). Riposte (pure-JS, zero-dep, MIT)
interprets each page and rasterizes it to a <canvas>; the new PostScriptRenderer
drives Riposte's engine and lays pages out as `.postscript-page`, matching the
PDF/DjVu/comic paged-canvas model. A per-page try/catch keeps an unsupported
operator from sinking the whole document.
- New src/renderers/postscript-renderer.js; wired into EXT_MAP (.ps/.eps/.epsf)
+ RENDERER_LOADERS, dropzone pill + toolbar badge (#880e4f), accept list, CSS
- riposte pinned as a git dep (no Vite alias needed — it declares no package exports)
- README / CREDITS / EMBEDDING updated (riposte is the 4th git-dep engine)
- Bump deps: mammoth 1.8->1.12, pdfjs-dist 6.0.227->6.1.200, vite 8.1.0->8.1.2
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Render Microsoft Compiled HTML Help files. CHMate (pure-JS, MIT) parses the ITSF
container and LZX-decompresses topics; its hardened renderTopic sanitizes each
topic, inlines resources as blob: URLs and adds a strict CSP. The new
CHMRenderer shows topics in a sandboxed iframe (no allow-scripts), wires
internal (data-chm-href) and external (confirm + new tab) link navigation, and
builds the .hhc table of contents into the sidebar.
- New src/renderers/chm-renderer.js; wired into EXT_MAP + RENDERER_LOADERS,
dropzone pill + toolbar badge (#006064), file-picker accept list
- chmate pinned as a git dep; `chmate/render` exposed via a Vite resolve alias
(CHMate's package exports only "."), inherited by the embed-app build
- README / CREDITS / EMBEDDING updated (chmate is the 3rd git-dep engine)
- Also: re-fit the page when the viewer area resizes — a ResizeObserver on
#viewerContainer re-applies the fit-to-width/height/page scale, so opening the
sidebar (or resizing the window) no longer leaves the page clipped at its old
scale. Benefits every renderer, not just CHM.
- /simplify applied: merged duplicate MHTML/CHM iframe CSS, dropped a dead
field + an inert TOC wrapper div, replaced a parallel Map with data-target.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The renderer was wired up but the landing-page format pills weren't — add an
MHTML .format-tag (with a tag-mhtml colour) alongside DOCX/PPTX.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Render saved Web Archive (MHTML) pages — the "single file" saves from
Chrome/IE — via mhtml-to-html (MIT, gildas-lormeau). The library unpacks the
MIME container and inlines every resource as a data: URI; the result renders in
a sandboxed iframe (allow-scripts intentionally omitted) so the page's own CSS
can't leak into the app and nothing executes or touches the network.
- New src/renderers/mhtml-renderer.js, lazy-loaded; wired into EXT_MAP and
RENDERER_LOADERS for .mht/.mhtml, plus the file-picker accept list
- README / CREDITS / EMBEDDING updated; mhtml-to-html stays permissive (MIT)
- Removed dead .odf-frame CSS (an abandoned, unreferenced iframe rule)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- PDF and DjVu extractors separate pages with \f; compare() splits each document
into pages and renders a per-page diff. The existing toolbar page nav (< 1 / N >)
drives it through the diff controller's new setPage, so multi-page PDFs and DjVu
compare page-by-page. Single-page formats (docx/doc/rtf/odf/txt/...) are
unchanged — they render as a continuous flow with no page breaks to split on.
- Move the compare view-mode dropdown from the middle to the right, just left of
the language selector.
- Add a 2-page sample PDF pair (samples/manual-v{1,2}.pdf) for testing.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Move the side-by-side / unified / inline switcher out of the diff into a
dropdown in the main toolbar, shown only in compare mode where it swaps in for
the inert zoom controls. Works in the demo and the embed (both share the
toolbar) — wired to the diff controller's setMode; the in-diff toggle is gone.
- Center the page-number digit in its box with line-height (dropping the 1px
nudge); the box is flex-centered, so it lines up with '/ N' too.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- The diff now spans the full viewer width and height (scoped via an is-compare
class on #docContainer) instead of a centered min(96%,1100px) card that left
empty space; .diff-body flexes so short diffs still fill the pane.
- Compare toolbar icon -> mdi reflect-horizontal (was table-merge-cells).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Compare toolbar button → mdi table-merge-cells.
- Tooltip pin button → mdi pin (was the 📌 emoji).
- Pinned-popover close → mdi pin-off (was ✕).
SVG icons built via a small icon() helper in diff-view.js; the buttons are
centered with inline-flex. Paths are Apache-2.0 MDI, matching the rest of the UI.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- samples/report-v1.md and report-v2.md: a slightly-modified pair that exercises
add / remove / modify rows (incl. word-level changes) for testing the compare
view locally.
- index.html: the demo Compare picker now also accepts PDF / DjVu / e-book
formats (they became comparable), not just the text/Office formats.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The demo Compare control opened a second file dialog programmatically after the
first file was chosen — browsers block that (no user gesture), so picking one
file did nothing. Use a single multiple-file input: choose two files in one
dialog (sorted by name), then compare. Selecting one file shows a hint
('compare.pickTwo', added to all 9 languages).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Compare two versions of a text document (txt, md, code, csv, xlsx, docx, rtf,
odf, doc) using jsdiff. Three switchable view modes — side-by-side (default),
unified, inline — all rendered from one diff. Each changed line has a hover
tooltip that can be pinned open; tooltips show blame (author/date/commit/
message) the host supplies, keyed by the new-side line number.
- src/diff-view.js (new, lazy): Diff.diffLines -> aligned row model (del+add
paired as 'mod'), intra-line word diff, three renderers from one rows[],
shared hover tooltip + pinnable popovers. DOM-built (no innerHTML).
- main.js: compare(srcA,nameA,srcB,nameB,{blame,mode}); _extractText renders
each version with a FRESH renderer into a detached node (never the live
viewer) and extracts text per format (block-aware walk for rich HTML,
tab/newline for tables); DIFFABLE gate; teardown on normal load.
- Embed: readerjs.js inst.compare(a,b,opts) + a 'compare' mount opt; reader.js
readerjs:compare message. Blame is plain data (postMessage-safe).
- Demo: a Compare control (pick two files) in index.html, gated to the full app.
- i18n: compare.*/blame.* in all 9 languages; CSS for the diff grid, ins/del,
tooltip/pin (reusing the .image-info look) + badge-compare.
- diff (jsdiff, BSD-3) added; lazy-split into its own chunk.
- Docs: CREDITS (jsdiff), EMBEDDING (compare + blame API), README feature.
Verified (demo + built embed): side-by-side aligns; unified/inline toggle
instantly; word-level ins/del; hover tooltip shows blame; pin -> persistent
popover; setLang re-translates; pdf/etc -> unsupported without breaking the
view; normal load after compare tears down cleanly. Blame round-trips through
the embed's postMessage.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Pure-JS, MIT-licensed DjVu decoder (DejaView) running in a Web Worker.
Pages render lazily to canvas (window around the current page plus an
IntersectionObserver for scroll), fit-to-height by default, with sidebar
thumbnails.
- New DjVuRenderer (src/renderers/djvu-renderer.js)
- Register djvu/djv in EXT_MAP + renderers (src/main.js)
- DJVU dropzone pill, accept list, Powered-by footer link (index.html)
- .djvu-page / badge / tag styles (src/style.css)
- dejaview submodule (pinned 5a4ef8a), README format table + credits
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Remove the non-functional "Document Outline" sidebar tab/panel; the sidebar
is now a single "Pages" thumbnail list with a titled header.
- Fix giant thumbnails: .thumb img had no size rule, so comic/image thumbnails
rendered at natural size — now constrained (max-width:100%) like canvases.
- Clear stale thumbnails when switching documents; show a "No thumbnails"
placeholder for single-page / reflowable formats (MD, DOCX, EPUB, …).
- i18n: replace dead tip.thumbnails/tip.outline with sidebar.pages /
sidebar.noThumbnails across all 9 languages.
Verified: outline gone, image thumb 183px (was 500px natural), comic thumbs
constrained, MD shows the placeholder.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- CSVRenderer: CSV/TSV → HTML table via Papa Parse (MIT); robust quoting,
header row, horizontal scroll.
- CodeRenderer: source/config files (JS/TS/JSON/XML/YAML/CSS/Python/…) with
highlight.js (BSD-3); JSON is pretty-printed. ~35 extensions.
- XLSXRenderer: .xlsx/.xls/.xlsm/.xlsb → one titled HTML table per sheet via
SheetJS (Apache-2.0, from the official CDN build — current & secure).
- Register all in EXT_MAP; dropzone tags + badges; shared .data-table styling.
- Add the EXIF pill to the dropzone; list SheetJS / Papa Parse / highlight.js
in the footer + README credits.
All three deps are permissive (Apache-2.0 / MIT / BSD-3), so the license policy
holds. Verified in preview: CSV (quoted commas parsed), JSON/Python highlighted
+ pretty-printed, 2-sheet XLSX renders both sheets. vite build ok.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- PPTXRenderer renders .pptx slides to a canvas with PptxViewJS (MIT). The
toolbar's page nav drives slide changes; opens fit-to-view (page-fit).
- PptxViewJS always paints at the slide's native pixel size and fits the slide
into the canvas's current backing, so we pin the canvas to native dims
(from presentation.slideSize, EMU→px) and scale the wrapper via CSS zoom —
touching canvas.style distorts the slide via its post-load re-render.
- Deps: pptxviewjs (MIT) + chart.js (MIT, peer dep it imports for charts).
- Register pptx in EXT_MAP; dropzone tag + badge; README + credits.
- Also list exifr + UTIF.js in the dropzone "Powered by" footer (were missing
after the image feature).
Verified in preview: 3-slide deck renders at correct 4:3 aspect, fits the
viewport, zoom (wrapper) and slide navigation work. vite build ok.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- ImageRenderer for PNG/JPEG/GIF/WebP/AVIF/BMP/SVG/ICO (native <img>) and TIFF
(decoded with UTIF.js, multi-page TIFFs become multiple pages). Fits the whole
image to the viewport on open (page-fit); thumbnails + scroll tracking.
- EXIF/info panel via exifr: format, dimensions, size, plus camera, lens, date,
focal length, exposure (ƒ/shutter/ISO) and GPS when present. Labels carry
data-i18n so they translate and react to language switches (added info.* keys
to all 9 locales).
- FB2 / FBZ routed to the existing foliate-js EPUBRenderer (foliate already
parses FictionBook) — just register the extensions.
- Register image + fb2/fbz in EXT_MAP; dropzone tags, badge/tag colors; README.
- New deps: utif (MIT), exifr (MIT).
Verified in preview: JPEG renders with full EXIF (incl. GPS), PNG shows basic
info, multi-page TIFF decodes to 2 pages, FB2 renders via foliate; panel labels
switch language live. vite build ok.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add a lightweight i18n module (src/i18n.js): per-locale dictionaries, t() for
dynamic strings, applyTranslations() for data-i18n / -title / -aria markup,
setLang() with localStorage persistence. No dependency.
- Languages: EN, PL, ES, FR, DE, PT, ZH, JA, RU. Auto-detected from
navigator.language, falling back to English.
- Mark up all UI strings in index.html (tooltips, zoom options, dropzone text,
aria-labels, <title>); localize main.js error messages.
- Add a language switcher <select> in the toolbar (shares the zoom select's
slim-chevron styling); sets <html lang> for accessibility.
Verified: browser-locale auto-detect works (preview detected Polish); switching
to RU/PL/EN updates tooltips, dropzone, zoom labels and title live. vite build ok.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- #sidebarToolbar min-height 42px (was 35) to line up with the main toolbar
- Sidebar tab icons 16px → 22px
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the Tabler outline icons with Pictogrammers' Material Design Icons
(filled, single-path) across the toolbar, sidebar, error bar and dropzone:
view-grid, format-list-bulleted, menu, chevron-left/right, magnify-plus/minus,
printer, folder-open, alert-circle, close, and file-upload for the dropzone.
MDI is Apache-2.0 licensed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- TXTRenderer renders .txt/.text/.log into a monospace <pre> (pre-wrap) inside
a .doc-page; uses textContent so content is never parsed as markup. Inherits
the HTML-doc fit-to-width behavior. Adds TXT badge/dropzone tag (brown).
- Fix: drop the `position:relative; top:2px` on #pageNumber. It was nudging the
input 2px below the hamburger, chevrons and the "/—" text (all centered at
20.5px); removing it re-centers the input to match.
Verified: TXT renders with preserved line breaks, soft-wraps long lines, ASCII
escaped safely, fits width; toolbar elements all align at the same center.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the mixed Material-style filled glyphs with consistent Tabler outline
icons (stroke-based) across the toolbar, sidebar, error bar and dropzone:
chevrons, menu, layout-grid, list, zoom-in/out, printer, folder, alert-circle,
x, and a file-upload illustration for the dropzone.
Tabler Icons are MIT-licensed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Unifies the default zoom across formats:
- PDF & comics fit one whole page to the window HEIGHT (new 'page-height'
zoom option + defaultScaleOption)
- Continuous HTML docs (DOCX/RTF/MD/ODF/DOC) fit to WIDTH; BaseRenderer now
scales the .doc-page via CSS `zoom` (reflows layout, unlike transform, so
vertical scroll stays correct)
- EPUB unchanged (reflowable, fills its frame; zoom = font size)
PDF renderer awaits thumbnail building (guarded) so the on-open height-fit
re-render can't race pdf.js page rendering.
Verified in preview: MD fits width (zoom 1.49 → 1216px in 1264px viewport),
comic fits height (707px in 758px). PDF rendering can't be exercised in the
headless preview (pre-existing pdf.js canvas hang, confirmed on clean main),
but its fit path is the same 'page-height' math as comics.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add foliate-js (MIT) as a git submodule, pinned at 78914ae
- Add EPUBRenderer wrapping foliate's <foliate-view> paginator: drives the
existing toolbar (prev/next/jump via relocate's location.current/total) and
maps zoom to font-size reflow; reflowable books use content-based locations
- Register epub/mobi/azw3/azw/kf8 in EXT_MAP; thread file name through for
foliate's format hinting; add format badge + dropzone tags
- Stub foliate's pdf.js (we use our own PDFRenderer) via a Vite resolveId
plugin — it bundles pdf.mjs through a `new URL` glob that breaks vite build
- README + index.html: document EPUB/MOBI and credit foliate-js
Verified: vite build succeeds (modules code-split); EPUB renders, paginates,
navigates and zooms in the dev preview.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add ComicRenderer: renders archive page images as a vertical stack with
scroll-synced page tracking and thumbnails, matching the PDF renderer model
- CBZ unpacked via JSZip (existing dep); CBR/CBT via libarchive.js, whose
RAR decoder is libarchive's own BSD implementation — no UnRAR-licensed code
- Vendor libarchive.js worker + wasm under public/libarchive/ (served statically)
- Register cbz/cbr/cbt in EXT_MAP; add format badge + dropzone tags
- Also backfill the Markdown (.md) dropzone tag and file-input accept entry
- README: document comic formats and credit libarchive.js
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace mammoth.js .doc handler with JSDoc (Alpaq92/JSDoc submodule)
- Fix RTF.js rendering via jQuery append instead of appendChild
- Use import.meta.env.BASE_URL for asset paths to support /PreviewJS/ base
- Add GitHub Actions: deploy.yml (push-triggered Pages deploy) and
update-submodules.yml (monthly cron with release creation)
- Add .gitignore, README.md with Credits, MIT LICENSE
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Drop zone now uses min(90%, 620px) instead of 100% width
- viewerContainer uses align-items:center so dropzone is vertically centred
- docContainer overrides with align-self:flex-start so pages stack from top
- EXT_MAP maps .doc -> docx renderer (mammoth handles legacy Word best-effort)
- Accept attribute and format tags updated to include .doc
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>