EANCH-WP-0001 T04: extract PDF adapter + scroll/highlight helpers

Move pdf-viewer-adapter-spike.tsx, scroll-job.ts (+test), highlight-styles.css
and debug-textlayer.css into src/pdf/ (the adapter boundary). Rewrite the
spike's @shared import to @citation-evidence/engine/shared and its ./types to
../types. Add src/css.d.ts so tsc accepts side-effect .css imports.

Decisions:
- adapter stays the explicitly-named PdfSpikeViewer spike; promotion to a
  production PDFViewerAdapter is registered as T06 follow-on work
- viewer libs (pdfjs-dist, react, react-pdf-highlighter-plus) confined to
  src/pdf/ and exposed only via the evidence-anchor/pdf subpath; the root
  entrypoint stays pure. Boundary enforced by eslint no-restricted-imports.
- ported unit suites (pdf-selector-math round-trip + scroll-job retry) serve
  as the inspectable harness for capture->selectors->resolve->scroll.

Verified: pnpm test (30 passed), typecheck, lint all green. README layout updated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
tegwick 2026-07-08 20:44:52 +02:00
parent bd7f56c111
commit 5b77dbd314
10 changed files with 720 additions and 23 deletions

View file

@ -31,9 +31,9 @@ export default tseslint.config(
},
},
{
// The pure core (selectors, resolution, highlight helpers) must not pull in
// any concrete viewer library — those live only under src/pdf/.
files: ["src/selectors/**/*.ts", "src/highlight/**/*.ts", "src/types.ts"],
// The pure core (selectors, resolution, adapter-side types) must not pull
// in any concrete viewer library — those live only under src/pdf/.
files: ["src/selectors/**/*.ts", "src/types.ts"],
rules: {
"no-restricted-imports": [
"error",