3 Commits
Author SHA1 Message Date
adminandClaude Opus 4.8 951059d75d feat: page-by-page compare for multi-page docs + move mode dropdown right
- 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>
2026-06-25 23:36:39 +02:00
adminandClaude Opus 4.8 d11e845da6 feat: compare view-mode dropdown in the top toolbar (drop the second bar)
- 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>
2026-06-25 23:23:52 +02:00
adminandClaude Opus 4.8 1e785cd69f feat: embeddable, byte-based ReaderJS (iframe widget + lazy engines)
Expose ReaderJS as a read-only, self-contained, same-origin embed:

  ReaderJS.mount(container, { blob|arrayBuffer, name, mime }) -> { load, destroy }

The host hands in document bytes (not a File); the filename's extension picks
the renderer. Isolated in a same-origin iframe so the viewer's full-page CSS,
JS globals and CSP surface stay out of the host page. Also supports a zero-JS
iframe variant: reader.html?src=<url>&name=<file> (self-fetches same-origin).

- main.js: lazy per-format renderer registry (pdf.js/jszip/foliate split into
  on-demand chunks) + loadBytes(bytes, name, mime); openFile delegates; export
  DocumentViewer; null-tolerant UI wiring; auto-init gated on #dropzone.
- reader.html (trimmed index.html, no upload UI) + src/reader.js bootstrap
  (?src self-fetch or origin-checked postMessage handshake).
- src/readerjs.js: IIFE loader exposing window.ReaderJS.mount (sandboxed iframe,
  structured-clone copy so the host buffer is not neutered).
- vite.config.app.js + vite.config.embed.js -> dist-embed/ (base:'./', workers/
  wasm/public assets bundle-relative); npm run build:embed.
- i18n.js: localStorage guarded for sandboxed contexts.
- CREDITS.md (all engines permissive; pptxviewjs MIT; WebODF reference-only, not
  bundled) + EMBEDDING.md (API, iframe variant, CSP asset list).

Verified against the built artifact: bytes-mode renders DjVu (dejaview module
worker under base:'./'), ?src mode renders CSV, per-format lazy chunks, zero
external-origin requests, destroy() cleanup. Demo app build unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 15:53:35 +02:00