diff --git a/README.md b/README.md index 4f6a111..4a96ba0 100644 --- a/README.md +++ b/README.md @@ -62,13 +62,14 @@ Boundary rules for the layout (enforced by `eslint.config.js`): are confined to `src/pdf/` — the pure zone (`src/selectors/**`, `src/types.ts`) may not import them; - `src/selectors/` is pure and depends only on `citation-engine` shared types; -- the **root** entrypoint (`evidence-anchor`) exposes only the pure surface — - `createSelectors`, `resolveSelectors`, the selector/resolution types, and the - `DocumentViewerAdapter` contract; -- the concrete PDF adapter is reached through the **`evidence-anchor/pdf`** - subpath, so pure consumers never pull PDF.js or React into their bundle. That - adapter is still the explicitly-named `PdfSpikeViewer` spike; promoting it to - a production `PDFViewerAdapter` is registered follow-on work (T06). +- the **root** entrypoint (`evidence-anchor`) is the full barrel — selector + creation/resolution, the adapter types/contract, and the PDF adapter — so + consumers resolve every anchor symbol (and their test `vi.mock(...)` calls) + from a single specifier, matching the umbrella's prior `@anchor/index`; +- a focused, viewer-free entry is also published at **`evidence-anchor/pdf`** + for consumers that want the PDF surface explicitly. The concrete adapter is + still the explicitly-named `PdfSpikeViewer` spike; promoting it to a + production `PDFViewerAdapter` is registered follow-on work (T06). ## Public API (target surface) diff --git a/src/index.ts b/src/index.ts index 450d031..b668299 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,16 +1,38 @@ -// Public entrypoint for `evidence-anchor`. +// Public entrypoint for `evidence-anchor` — the full barrel. // -// The stable surface consumers depend on: -// - adapter-side types + the viewer contract (./types) -// - selector creation / resolution (./selectors) +// Mirrors the surface the umbrella previously consumed as `@anchor/index`, so +// consumers (and their `vi.mock(...)` calls) resolve every anchor symbol from a +// single specifier. Viewer *code* still lives only under `src/pdf/` (enforced +// by eslint); this barrel merely re-exports it. // -// The concrete PDF adapter lives behind the `evidence-anchor/pdf` subpath -// (./pdf) so pure consumers do not pull PDF.js or React into their bundle. +// A focused, viewer-free entry is also available at `evidence-anchor/pdf` for +// consumers that want the PDF surface explicitly — but importing the package +// root pulls in the PDF adapter, matching the pre-extraction behaviour. +// Adapter-side types + the viewer contract. export * from "./types"; + +// Selector creation / resolution (pure core). export { createSelectors, resolveSelectors, DEFAULT_CONTEXT_CHARS, type CreateSelectorsOptions, } from "./selectors"; + +// PDF adapter + helpers (re-exported from the src/pdf/ boundary). +export { + PdfSpikeViewer, + getHighlightClientRects, + selectorsFromPdfCapture, + findPdfRectSelector, + findTextQuoteSelector, + unionRect, + runScrollToHighlightJob, + DEFAULT_SCROLL_ATTEMPTS, + type PdfSpikeViewerProps, + type StoredAnnotation, + type ScrollToHighlightJob, + type ScrollToHighlightDeps, + type ScrollToHighlightState, +} from "./pdf"; diff --git a/workplans/EANCH-WP-0001-intent-placeholder.md b/workplans/EANCH-WP-0001-intent-placeholder.md index 085f20d..61168a3 100644 --- a/workplans/EANCH-WP-0001-intent-placeholder.md +++ b/workplans/EANCH-WP-0001-intent-placeholder.md @@ -276,7 +276,7 @@ implementation remains behind `DocumentViewerAdapter`. ```task id: EANCH-WP-0001-T05 -status: wait +status: progress priority: high depends_on: [T03, T04] state_hub_task_id: "2fd9bd62-5d79-49b5-aee7-45e0a37313ba"