The mirrors moved from Alpaq to the Iris org; point at them directly instead
of relying on Gitea's redirect from the old names.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Pages workflow can never run again (the GitHub account is suspended).
CI now checks that the app and the embeddable bundle build from a clean
install on Node 22; once main is green, the kaskada repo bumps Galena's
ReaderJS pin.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Alpaq92 GitHub account is suspended, so the github: dependencies no
longer resolve. CHMate, dejaview and Riposte are restored in the Alpaq
organisation on Gitea from the files installed here; foliate-js comes from
a Gitea mirror of johnfactotum/foliate-js, pinned to the same commit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Galena loads the viewer from cdn.jsdelivr.net/gh/Alpaq92/ReaderJS@<sha>/dist-embed/
instead of vendoring it, so the built bundle is committed and pinned by commit SHA.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An extension with no dedicated renderer showed "Unsupported format" and nothing
else. Most such files — config, logs, dotfiles, lockfiles, source in a language not
in CODE_EXTS — are perfectly readable as text, and refusing them is a worse default
than simply showing them.
Binaries stay the exception. Decoding an executable as UTF-8 yields a screenful of
replacement characters, which is less useful than saying the format is unsupported,
so the first 4 KB is sniffed and the error kept for that case alone. The heuristic
is deliberately conservative — a NUL byte, or a high density of other C0 controls —
because a false "binary" only costs the user a rename, while a false "text" costs
them a screen of mojibake. Reading just the head keeps this an early return, before
any loading state has been set up.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
In light mode the sidebar was #fff while the toolbar is gray-0, which made it the
brightest surface on screen — it read as a glaring slab beside the chrome rather
than as part of it. A sidebar should sit level with the chrome or slightly below
it, never above. Moving it to gray-1 with a gray-2 header gives a consistent
ladder from the toolbar down to the document surround (L 0.946 / 0.894 / 0.835 /
0.756) and keeps text contrast high (7.35 and 9.70).
Also adds the theme switcher to the README's feature list — it shipped in #16
without being documented there.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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 toolbar #formatBadge had no .badge-mhtml rule, so an opened .mht fell
through to the unstyled base badge (no background). Add it, and switch both the
dropzone pill and the badge from amber (#ff8f00, ~2.2 white-text contrast) to
#8e24aa (7.04 contrast, WCAG AAA).
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>
Quality pass over the merged compare code — no behavior change:
- Extract the duplicated HTML->text block walker into a shared
src/dom-text.js#flattenBlocks; main.js (rich docs) and epub-renderer (book
sections) now call it with their own block/skip tag sets instead of each
keeping a copy that had already drifted.
- Replace the stringly-typed \f page separator with an explicit string[]:
extractText returns one entry per page and compare() lines the arrays up
directly (no split('\f')).
- Drop dead code in diff-view.js: the unstyled diff-blank class + its empty
branch, the unstyled .diff-view class toggle, and the unread pageCount on
the controller.
Verified: PDF page-by-page, markdown compare, and blank cells render the same;
app + embed build clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The DjVu decoder (the user's own repo) advanced; pin to ae7aed2. Worker
open/render/text protocol unchanged, build green. Every other dependency was
already at its latest version.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Reflect the compare feature accurately (DjVu, page-by-page for multi-page
PDF/DjVu, word-level highlights) and add the two compare-related libraries to
the credits table.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- pdfjs-dist 4.10 -> 6.0.227. v6 removed PDFDocumentProxy.destroy(); destroy the
loading task instead (load / extractText / destroy). render() API is unchanged.
- rtf.js 2.3 -> 3.0.9 (npm) and refreshed public/rtfjs/*.bundle.min.js — the
bundles the renderer loads at runtime (window.RTFJS), not the npm import.
- vite 6.4 -> 8.1 (now Rolldown-based); build config unchanged.
- dejaview pinned to the latest commit (worker open/render/text protocol intact).
- foliate-js, xlsx (SheetJS 0.20.3) and every other dep were already at latest.
Verified: app + embed build; PDF compare (pdf.js 6 text layer), RTF render
(rtf.js 3 bundles), and markdown compare all work. PDF/DjVu *canvas* rendering
can't be exercised in the headless preview — confirm document viewing in a real
browser.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
core.autocrlf=true would otherwise rewrite LF->CRLF in checked-out binaries
(the uncompressed sample PDFs especially), corrupting their byte offsets. Mark
PDFs, images, fonts, e-books and Office files as binary so git leaves them alone.
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 number input's digit still sat a hair high vs the adjacent text; offset it
with position:relative; top:1px.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Rebuild the diff view-mode switcher to match the main toolbar's quality:
- 42px bar with the same #1a1a1a hairline, so it reads as a second toolbar tier
- wrap the three buttons in a recessed .diff-mode-group well (inset shadow)
- active segment is a raised tactile gray (#5d5d5d) with a drop shadow + top
highlight + bold white text, like a pressed toolbar button
Replaces the thin blue-outlined dark pill that read as off-design.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- #pageNumber fell back to the UA default (Arial) since form controls don't
inherit font-family, so its digit sat off the baseline of the adjacent '/ N'
text (Segoe UI). Inherit the app font stack.
- The diff mode-toggle bar now shares --toolbar-bg (#474747) with the main
toolbar, so the two tiers read as one continuous toolbar.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The toolbar's box-shadow fell onto the full-bleed diff. Move the is-compare
class up to #mainContainer so the toolbar (a sibling of the viewer) can be
targeted, and zero its shadow while comparing; normal loads restore it.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The diff filled the viewer but still read as a floating panel: a 1px border,
6px radius, drop shadow, and the viewer's 20px padding left it inset on a
lighter background. Make it edge-to-edge instead — drop the border/radius/shadow
and zero the viewer padding while comparing (is-compare now lives on
#viewerContainer; normal loads restore the 20px padding).
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>
- DjVuRenderer.extractText(): the dejaview worker's 'text' message returns word
zones per page; group them into lines by baseline. Worker setup factored into
_spawnWorker() (shared with load()).
- EPUBRenderer.extractText(): foliate's makeBook() parses any e-book
(epub/mobi/azw3/fb2) into sections; walk each section document block-aware.
- _extractText already prefers a renderer's extractText(), so both become
comparable with no other changes. Now only image/comic/pptx (no text) show
the 'unavailable' message.
- Docs: EMBEDDING/README compare format lists updated (PDF + DjVu + e-books).
Verified: EPUB diff shows changes across chapters (GPL->MIT, required->optional);
DjVu extracts its text layer (757 chars) and renders the diff.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- PDF comparison: PDFRenderer.extractText() pulls text from pdf.js's text
layer (no canvas render, so the headless render-hang doesn't apply); lines
split on hasEOL + baseline-y change. _extractText now prefers a renderer's
own extractText() (extensible to any engine with a text API) before the DOM
path — so PDF is comparable even though it's not DOM-text.
- Restyle the diff to match the app chrome: dark card (#2b2d31) + light text,
dark mode toggle, dark gutters, subtle red/green change washes with brighter
word-diff spans, dark tooltip/pin popovers. (Was a white card clashing with
the dark UI.)
Verified: two PDFs diff correctly (License + Attribution changes with word-level
highlighting, no 'unsupported'); diff card is dark and 1100px wide.
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>
Double-clicking #sidebarToolbar (the 'Pages' title bar) removes the
sidebar-open class, collapsing the thumbnail sidebar. A single click is
unaffected, so there are no accidental closes.
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>
Align the dejaview worker reference with the bare-specifier style already used
by pdf-renderer ('pdfjs-dist/build/pdf.worker.min.mjs') and the foliate import
('foliate-js/view.js'), instead of a hardcoded '../../node_modules/...' path
(brittle under pnpm/hoisting/non-flat node_modules). Verified byte-identical
worker chunk output.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
One library-fetching method: everything is an npm dependency, no git
submodules. 'npm install' alone yields a working build.
- foliate-js (e-books) and dejaview (DjVu) aren't published to npm, so they
are pinned to a commit as git dependencies in package.json (were submodules).
Imports updated: epub-renderer -> 'foliate-js/view.js'; djvu-renderer worker
-> node_modules/dejaview.
- vite: optimizeDeps.exclude foliate-js — its stubbed/unused pdf.js uses
top-level await, which fails esbuild's es2020 prebundle; served as source it
goes through the existing stubFoliatePdf plugin.
- Removed the 5 reference-only submodules (pdf.js, docx, WebODF, rtf.js,
marked) — never imported; the runtime uses the npm packages.
- Dropped .gitmodules, submodules/, the monthly update-submodules workflow, the
deploy checkout's 'submodules: recursive', and the submodules:init script.
JSDoc's docToText.js stays (already committed under public/jsdoc).
- README: removed the Submodules table; clone no longer needs --recurse-submodules.
Verified: npm ci (fresh-clone sim) + build green; DjVu renders via the
node_modules dejaview worker (dev + build); app boots with foliate loaded.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>