100 Commits
Author SHA1 Message Date
adminandClaude Opus 5.5 b418ad60ed deps: take CHMate, dejaview, Riposte and foliate-js from Gitea
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>
2026-11-29 16:28:11 +01:00
adminandClaude Opus 5.5 89d1981e9d Publish the dist-embed build so it can be served from jsDelivr
Deploy to GitHub Pages / build (push) Canceled after 0s
Deploy to GitHub Pages / deploy (push) Canceled after 0s
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>
2026-10-21 16:22:23 +02:00
admin 7df65692f6 Merge pull request #17 from Alpaq92/fix/sidebar-and-text-fallback
Read unknown files as text; fix the light-mode sidebar
2026-09-05 15:34:30 +02:00
adminandClaude Opus 5 a760004b09 feat: read unknown file types as text instead of refusing them
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>
2026-09-05 15:32:42 +02:00
adminandClaude Opus 5 7ce2f4ff73 fix: recess the sidebar in light mode, document the theme switcher
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>
2026-09-04 16:12:43 +02:00
admin 1542458383 Merge pull request #16 from Alpaq92/feat/theme-switcher
feat: add light/dark/system theme switcher
2026-09-04 14:58:10 +02:00
adminandClaude Opus 5 9791b6c697 feat: add light/dark/system theme switcher
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>
2026-09-04 14:54:54 +02:00
admin 10d09bd294 Update README.md 2026-06-30 20:48:16 +02:00
admin f1c497c0bf Merge pull request #15 from Alpaq92/feat/postscript
feat: add PostScript/EPS support via Riposte + bump deps
2026-06-30 20:44:59 +02:00
adminandClaude Opus 4.8 3df5627b9f feat: add PostScript/EPS support via Riposte + bump deps
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>
2026-06-30 20:44:27 +02:00
admin f6897f803e Merge pull request #14 from Alpaq92/feat/chm
feat: add CHM (.chm) support via CHMate
2026-06-29 18:07:33 +02:00
adminandClaude Opus 4.8 4643132582 feat: add CHM (.chm) support via CHMate
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>
2026-06-29 18:06:58 +02:00
admin 52233830d1 Merge pull request #13 from Alpaq92/feat/mhtml
Feat/mhtml
2026-06-29 17:08:25 +02:00
adminandClaude Opus 4.8 fe76a8db17 fix: add MHTML toolbar badge colour, fix poor-contrast amber
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>
2026-06-29 16:02:08 +02:00
adminandClaude Opus 4.8 e5a2d970ed fix: show MHTML chip in the dropzone format list
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>
2026-06-29 15:40:44 +02:00
adminandClaude Opus 4.8 e16a032dd9 feat: add MHTML (.mht/.mhtml) web-archive renderer
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>
2026-06-29 15:37:06 +02:00
admin 34e8323e27 Merge pull request #12 from Alpaq92/chore/refresh-deps
chore: bump dejaview + /simplify the compare feature
2026-06-26 02:30:14 +02:00
adminandClaude Opus 4.8 0bf5053458 refactor: tidy the compare feature (/simplify)
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>
2026-06-26 02:26:29 +02:00
adminandClaude Opus 4.8 530f88e880 chore(deps): bump dejaview to the latest commit
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>
2026-06-26 02:26:29 +02:00
admin c4e8b08a4a Merge pull request #11 from Alpaq92/feat/compare
chore(deps): update to latest — pdf.js 6, rtf.js 3, vite 8, dejaview
2026-06-26 00:11:05 +02:00
adminandClaude Opus 4.8 3c97ffd1f5 docs: README — page-by-page compare + credit jsdiff and Open-Color
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>
2026-06-25 23:58:40 +02:00
adminandClaude Opus 4.8 fddc552d49 chore(deps): update to latest — pdf.js 6, rtf.js 3, vite 8, dejaview
- 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>
2026-06-25 23:54:13 +02:00
admin 8b45c7fa16 Merge pull request #10 from Alpaq92/feat/compare
Feat/compare
2026-06-25 23:42:42 +02:00
adminandClaude Opus 4.8 e1ea9e4385 chore: add .gitattributes marking binary assets
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>
2026-06-25 23:38:17 +02:00
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 9c179cc730 fix: nudge the page-number input 1px down onto the '/ N' baseline
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>
2026-06-25 23:11:03 +02:00
adminandClaude Opus 4.8 13a4c3306b style: redesign the compare mode-toggle as a crisp segmented control
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>
2026-06-25 23:00:30 +02:00
adminandClaude Opus 4.8 700f0f18be fix: page-number digit alignment + match diff toolbar to the main toolbar
- #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>
2026-06-25 22:56:10 +02:00
adminandClaude Opus 4.8 ac7446e6e7 style: flatten the toolbar drop shadow in compare mode
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>
2026-06-25 22:49:12 +02:00
adminandClaude Opus 4.8 9aa4cbf407 style: re-skin the compare/diff view on the Open-Color palette
Aligns the diff to the app's dark-gray + blue-accent chrome using Open-Color
(MIT) tokens, declared as --oc-* CSS variables:
- surface gray-9, raised (toggle/pins) gray-8, muted text gray-5/6, body gray-3
- deletions red-6, additions green-6 (word marks red-1 / green-1)
- accent blue-3, compare badge indigo-6
Replaces the off-palette Discord-darks + GitHub red/green. Credits Open-Color.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 22:46:57 +02:00
admin 950b1fad6d Merge pull request #9 from Alpaq92/feat/compare
feat: compare follow-ups — PDF/DjVu/e-book diff, full-bleed dark UI, MDI icons
2026-06-25 22:41:42 +02:00
adminandClaude Opus 4.8 9aa3009f6d style: full-bleed compare view (no floating card)
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>
2026-06-25 22:37:24 +02:00
adminandClaude Opus 4.8 a46b454fd2 style: use mdi card-multiple for the compare button icon
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 22:37:24 +02:00
adminandClaude Opus 4.8 6a8d5e4841 style: compare view fills the viewer + reflect-horizontal icon
- 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>
2026-06-25 22:37:24 +02:00
adminandClaude Opus 4.8 b0a6e7c607 style: MDI icons for compare (table-merge-cells) + pin / pin-off
- 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>
2026-06-25 22:37:24 +02:00
adminandClaude Opus 4.8 c80ed0e59a test: add a sample compare pair + widen the Compare picker accept list
- 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>
2026-06-25 22:37:24 +02:00
adminandClaude Opus 4.8 e407565e94 feat: compare DjVu and e-books too (extractText via dejaview / foliate)
- 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>
2026-06-25 22:37:24 +02:00
adminandClaude Opus 4.8 9bbfa66ad9 feat: compare PDFs (text layer) + restyle the diff view to the dark theme
- 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>
2026-06-25 22:37:24 +02:00
adminandClaude Opus 4.8 39ecfee868 fix: compare demo picks both files in one dialog (chained dialog was blocked)
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>
2026-06-25 22:37:24 +02:00
admin 60af9ff9c6 Merge pull request #7 from Alpaq92/feat/compare
feat: compare two versions (jsdiff) — pinnable, blame-aware tooltips
2026-06-25 20:51:42 +02:00
admin 89bb800d5a Merge pull request #8 from Alpaq92/fix/sidebar-dblclick-close
feat: double-click the sidebar header to close the thumbnail sidebar
2026-06-25 20:44:42 +02:00
adminandClaude Opus 4.8 9f7e3ff45f feat: double-click the sidebar header to close the thumbnail sidebar
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>
2026-06-25 20:41:12 +02:00
adminandClaude Opus 4.8 defc9e9373 feat: compare two versions with jsdiff — pinnable, blame-aware tooltips
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>
2026-06-25 20:37:49 +02:00
admin 9ceeabda90 Merge pull request #6 from Alpaq92/refactor/unify-deps
refactor: unify on npm dependencies, drop all git submodules
2026-06-25 16:41:58 +02:00
adminandClaude Opus 4.8 1b4fbe9356 refactor: bare specifier for the dejaview worker (/simplify)
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>
2026-06-25 16:36:50 +02:00
adminandClaude Opus 4.8 982a85151f refactor: unify on npm dependencies, drop all git submodules
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>
2026-06-25 16:36:50 +02:00
admin d11396691d Merge pull request #5 from Alpaq92/feat/embeddable
feat: embeddable, byte-based ReaderJS (iframe widget + lazy engines)
2026-06-25 16:02:58 +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
admin f6455ae3ee Merge pull request #4 from Alpaq92/cleanup/djvu-renderer
refactor: dedup canvas + subsample helpers in DjVuRenderer
2026-06-25 15:24:15 +02:00
adminandClaude Opus 4.8 1eea327214 refactor: dedup canvas + subsample helpers in DjVuRenderer
/simplify cleanup of the DjVu renderer (no behavior change):
- Extract _canvasFromRender(res) — the render-result -> canvas block was
  copy-pasted in _renderPage and _buildThumbnails.
- Parameterize _subsample(info, capW) so the thumbnail path reuses it
  instead of re-implementing the downscale formula inline.

Verified: sample renders (initial window + navigation), thumbnails build,
no console errors; build green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 15:18:00 +02:00
admin 1c24ffb4de Merge pull request #3 from Alpaq92/docs/readme-preview
docs: optimized PPTX screenshot as README preview
2026-06-25 15:13:57 +02:00
adminandClaude Opus 4.8 5339effffd docs: use an optimized PPTX screenshot as the README preview
Replace the placeholder hero.svg with a real app screenshot (PPTX viewer
with the thumbnail rail and toolbar). Downscaled 1920->1456px and
re-encoded to 92 KB.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 15:08:50 +02:00
admin 12810f3915 Merge pull request #2 from Alpaq92/fix/scale-dropdown-slack
fix: restore scale-dropdown min-width slack (lost in PR #1 merge race)
2026-06-25 15:06:27 +02:00
adminandClaude Opus 4.8 45397b0e67 fix: give the scale dropdown min-width slack so labels aren't flush
The previous max-width-only fix let the <select> auto-size to an exact
hug of the longest label (text width == content width), which can still
clip the final glyph across fonts. Add min-width:140px so localized
labels like PL 'Dopasuj wysokosc' render with visible slack; max-width
raised to 170px so the longest (RU) labels still fit.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 14:57:53 +02:00
admin dd2fd55ae7 Merge pull request #1 from Alpaq92/feat/djvu-support
feat: DjVu (.djvu/.djv) support via DejaView + scale-dropdown fit fix
2026-06-25 14:50:02 +02:00
adminandClaude Opus 4.8 c89a9d5fcc fix: widen scale dropdown so long localized labels fit
The zoom <select> was capped at max-width:110px, clipping the selected
value for languages with longer scale labels - Polish 'Dopasuj wysokosc',
French 'Ajuster la hauteur', Russian 'По размеру страницы', etc.

Give #scaleSelect its own max-width:160px (langSelect stays 110px). A
native <select> sizes to its widest option, so short-label languages
(English) stay compact - this only raises the ceiling.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 14:43:57 +02:00
adminandClaude Opus 4.8 d05d1fe17d feat: add DjVu (.djvu/.djv) support via DejaView
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>
2026-06-25 14:34:54 +02:00
adminandClaude Sonnet 4.6 d2941d6c2f style: slim, dark scrollbars to match the theme
Replace the default chunky OS scrollbars with thin dark ones (transparent
track, rounded grey thumb) via scrollbar-width/-color and ::-webkit-scrollbar.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 14:05:09 +02:00
adminandClaude Sonnet 4.6 d229b061be fix: intermittent failure on first PPTX load
PptxViewJS schedules a chart auto-rerender ~200ms after the first render; on a
cold/slow first load that overlapped the thumbnail render loop, and concurrent
renderSlide calls on the shared viewer intermittently corrupted the load.

- Serialise all renders through a queue so none overlap.
- Start thumbnail building after the chart-rerender window (400ms).
- Retry the load once if it throws (cold-start resilience).

Verified: cold load of a chart deck renders the slide + charts, builds all
thumbnails (correct aspect), and navigation/active-highlight work.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 14:03:08 +02:00
adminandClaude Sonnet 4.6 831d4fa0be fix: keep slide aspect ratio in PPTX thumbnails
PPTX thumbnails were squished: a <canvas> with max-width:100% gets its width
capped to the sidebar but keeps its intrinsic height, distorting the slide.
Render each slide into a reused canvas, then convert it to an <img> via
toDataURL — <img> scales correctly with max-width/height:auto.

Verified: 16:9 thumbs display 183×103, 4:3 thumbs 183×137 (both fit the sidebar
and keep the slide ratio); click-to-navigate and active highlight still work.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 13:48:55 +02:00
adminandClaude Sonnet 4.6 8f475e8868 feat: PPTX slide thumbnails
PptxViewJS fits a slide into the canvas's current size, so render each slide
straight into a small 320px thumbnail canvas (cheap) instead of full-size.

- PPTXRenderer builds thumbnails asynchronously after the first slide shows, so
  the deck appears immediately and thumbs stream in. A generation token cancels
  the loop if another document loads mid-build.
- Clicking a thumbnail navigates; the current slide's thumbnail is highlighted.
- main.js skips the "no thumbnails" placeholder for renderers that build async.

Verified: 3-slide deck builds 3 distinct thumbnails (correct 4:3, real slide
content), click + toolbar navigation work, main view stays correct.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 13:36:49 +02:00
adminandClaude Sonnet 4.6 48e47bd4c1 docs: refresh README hero image
Replace the outdated docx-viewer.png with a crisp SVG of the current dropzone —
shows the MDI toolbar, the cloud-upload drop area, and all supported format
pills (PDF…XLSX, CSV, JSON/XML/YAML, images+EXIF, comics, e-books).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 13:30:35 +02:00
adminandClaude Sonnet 4.6 5b1c34ec5a fix: drop Document Outline tab; make thumbnails behave
- 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>
2026-06-25 13:22:16 +02:00
adminandClaude Sonnet 4.6 4a28ce13c5 feat: add CSV/TSV, source-code, and spreadsheet (XLSX) support
- 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>
2026-06-25 13:10:50 +02:00
adminandClaude Sonnet 4.6 7e72ab60e9 feat: add PowerPoint (PPTX) support via PptxViewJS
- 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>
2026-06-25 12:36:40 +02:00
adminandClaude Sonnet 4.6 e6ae8c5877 feat: add image support (+ EXIF), TIFF, and FB2/FBZ
- 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>
2026-06-25 12:05:03 +02:00
adminandClaude Sonnet 4.6 dae04aa4d6 feat: use plus / minus for zoom in / out
Zoom in: plus-thick → plus. Zoom out: minus-thick → minus.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 11:34:47 +02:00
adminandClaude Sonnet 4.6 163fb10b6f feat: translatable UI with 9 languages and a switcher
- 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>
2026-06-25 11:33:33 +02:00
adminandClaude Sonnet 4.6 66933c57e1 feat: cloud-upload for dropzone, card-multiple for outline tab
- Dropzone: arrow-up-bold-circle → cloud-upload
- Document Outline tab: book → card-multiple

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 11:11:49 +02:00
adminandClaude Sonnet 4.6 a45d7c974a style: revert sidebar tab icons to 16px
Keep the 42px header height; restore the previous icon size.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 11:10:31 +02:00
adminandClaude Sonnet 4.6 d015368f70 docs: refresh "Powered by" credits
- Dropzone footer now lists marked, JSZip and libarchive.js alongside the
  existing PDF.js / JSDoc / RTF.js / mammoth.js / foliate-js
- README: credit Material Design Icons (Pictogrammers, Apache-2.0)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 10:56:03 +02:00
adminandClaude Sonnet 4.6 e21d48c1a3 feat: use book icon for the Document Outline tab
Outline tab: view-list → book.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 10:54:35 +02:00
adminandClaude Sonnet 4.6 5ea15b9846 style: match sidebar header height to toolbar; enlarge tab icons
- #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>
2026-06-25 10:52:55 +02:00
adminandClaude Sonnet 4.6 091fe2f1e4 feat: use dots-vertical for the sidebar toggle
Sidebar toggle: menu (hamburger) → dots-vertical.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 10:51:02 +02:00
adminandClaude Sonnet 4.6 01eda68c05 style: slimmer chevron on the zoom dropdown
Suppress the chunky native <select> arrow (appearance: none) and draw a slim
stroked chevron-down via an inline SVG background.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 10:47:51 +02:00
adminandClaude Sonnet 4.6 2e55d4c4b2 feat: use plus-thick / minus-thick for zoom in / out
Zoom in: plus-box → plus-thick. Zoom out: minus-box → minus-thick.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 10:46:24 +02:00
adminandClaude Sonnet 4.6 049d709c6c feat: use arrow-up-bold-circle for the dropzone upload icon
Dropzone: file-upload → arrow-up-bold-circle (keeps the accent color).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 10:45:34 +02:00
adminandClaude Sonnet 4.6 20a51ff0f5 feat: use view-list for the outline sidebar tab
Outline tab: format-list-bulleted → view-list (thumbnails tab already view-grid).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 10:44:38 +02:00
adminandClaude Sonnet 4.6 8b8ff40c26 feat: use requested MDI icons for open/zoom/upload
- Open file: folder-open → folder
- Zoom out / in: magnify-minus/plus-outline → minus-box / plus-box
- Dropzone: file-upload-outline → file-upload (filled)

Menu and chevron-left/right already matched the requested icons.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 10:42:09 +02:00
adminandClaude Sonnet 4.6 e576fea4c8 feat: switch UI icons to Material Design Icons (MDI)
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>
2026-06-25 10:36:34 +02:00
adminandClaude Sonnet 4.6 fe3c84f2a3 feat: add plain-text (TXT) support; fix page-number vertical alignment
- 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>
2026-06-25 10:32:22 +02:00
adminandClaude Sonnet 4.6 4bb4f93cee feat: switch UI icons to Tabler icons
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>
2026-06-25 10:24:37 +02:00
adminandClaude Sonnet 4.6 92aa9f360a feat: consistent fit-on-open — height for paged, width for text
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>
2026-06-25 10:18:43 +02:00
adminandClaude Sonnet 4.6 c076c481f8 fix: comics default to honest fit-width with working zoom
Comics were capped to viewer width by `.comic-page { max-width: 100% }`, which
made them *look* fit-to-width while the zoom dropdown dishonestly read "100%"
and zoom-in did nothing (the cap clamped it).

- Drop the max-width cap so explicit zoom works (overflow + horizontal scroll)
- ComicRenderer declares defaultScaleOption='page-width'; main.js honors a
  renderer's preferred default zoom instead of hardcoding 100% (other formats
  unchanged — they fall through to scale 1.0 with no extra re-render)

Now: opens at true fit-width (dropdown shows "Page Width"); 50%–300% all work.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 09:51:16 +02:00
adminandClaude Sonnet 4.6 337e9ee369 fix: CBR/CBT worker path broke on GitHub Pages sub-path deploy
ComicRenderer hardcoded the libarchive worker as '/libarchive/worker-bundle.js'
(absolute from root). The site deploys with `vite build --base /ReaderJS/`, so
on Pages that resolved to alpaq92.github.io/libarchive/... (404) and every CBR
and CBT silently failed extraction. Worked on localhost only (base '/').

Use import.meta.env.BASE_URL so it resolves under any base. The worker loads
its sibling libarchive.wasm relative to itself, so only this URL needed fixing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 09:26:28 +02:00
adminandClaude Sonnet 4.6 cb48e2d93d fix: make MD format tag visible — dark slate blended into dropzone background
The #455a64 slate was nearly the same luminance as the viewer background,
so the MD pill disappeared. Use saturated pink (#d81b60) like the other tags.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 09:18:36 +02:00
adminandClaude Sonnet 4.6 fe2548190d feat: add EPUB / MOBI / AZW3 support via foliate-js
- 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>
2026-06-25 09:01:41 +02:00
adminandClaude Sonnet 4.6 99c09f1a7f feat: add comic-book support (CBZ / CBR / CBT)
- 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>
2026-06-25 08:46:41 +02:00
adminandClaude Sonnet 4.6 8f8cd1c4e9 docs: add Markdown support to README
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 08:24:59 +02:00
adminandClaude Sonnet 4.6 45aa3b4426 feat: add Markdown (.md) support via marked
- Add markedjs/marked as a submodule
- Install marked npm package for runtime rendering
- Add MDRenderer that parses .md/.markdown files with marked and renders into doc-page
- Register md/markdown extensions in EXT_MAP

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 08:24:11 +02:00
adminandClaude Sonnet 4.6 3becdd8db3 fix: align page number input vertically with adjacent text, update submodules
- Set input height to 21px and offset top by 2px to align '1' visually with '/1'
- Update JSDoc submodule (build scripts, doc/text conversion improvements)
- Update pdf.js submodule (annotation layer, presentation mode fixes)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 08:17:08 +02:00
admin 7c79c2f167 fix: set page number input height to 17px to match text line height, eliminating alignment gap 2026-06-24 23:52:13 +02:00
admin d2cf489401 fix: remove box from page number input, use underline to fix alignment perception 2026-06-24 23:47:43 +02:00
admin be85e57b35 fix: replace page number group with unified pill widget to fix alignment 2026-06-24 23:40:55 +02:00
admin 326b1ca866 fix: reduce page number input height to 16px to align with adjacent text 2026-06-24 23:22:30 +02:00
admin bd1b3346e4 fix: align page number input with adjacent text 2026-06-24 23:13:30 +02:00
admin b3b95959c9 fix: align page number input with adjacent text via line-height:1 2026-06-24 22:59:57 +02:00
admin 85faec976b fix: align page number input vertically with adjacent text 2026-06-24 22:54:05 +02:00
admin 948c6c0c79 refactor: rename PreviewJS to ReaderJS across all files and repo 2026-06-24 18:44:20 +02:00