npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@flowajs/react-viewer

v0.0.10

Published

React components for rendering flowa pipeline outputs: citation-grounded Markdown, PDF viewer with bbox highlights, triage workspace.

Downloads

848

Readme

@flowajs/react-viewer

React components for rendering flowa pipeline outputs.

Install

pnpm add @flowajs/react-viewer
# Plus the peer dependencies, if not already installed:
pnpm add react react-dom @mantine/core @mantine/hooks @tabler/icons-react

Exports

  • sanitizeLlmMarkdown(md, mapping) — single sanitization pipeline for LLM-generated Markdown: marked → DOMPurify → citation-link validation.
  • parseCitationsFromMarkdown(md) — extract (paperId, quote) pairs from citation links of the form [display](#cite:AuthorYear "verbatim quote").
  • parseCiteHref(href) / isCitationHref(href) — parse / validate citation fragment URLs.
  • LlmContent — renders LLM Markdown with click-to-resolve citation links.
  • PdfHighlightViewer — react-pdf-based viewer with 0–1000 normalized bbox highlight overlays.

Citation contract

Citation links use the form:

[display text](#cite:AuthorYear "verbatim quote")

AuthorYear matches [A-Za-z]+\d+ and must resolve in the supplied PaperIdMapping.byAuthorYear. The title attribute carries the verbatim quote used to resolve a bbox. sanitizeLlmMarkdown strips every <a> tag that fails this format or whose AuthorYear is absent from the mapping.

Bbox coordinate scale

All highlight bboxes use a 0–1000 normalized scale (left/top/right/bottom), 1-indexed pages. The viewer rescales to rendered pixels.

Styles

The package ships a pre-built stylesheet at @flowajs/react-viewer/styles.css. Import it once (e.g. in your top-level page or _app.tsx):

import "@flowajs/react-viewer/styles.css";

The bundle contains only the Tailwind utilities used by the package itself — no Preflight reset, so it won't fight your existing base styles (Mantine's own reset stays in effect).

Consumers do not need a Tailwind toolchain. The CSS is statically built at package release time; nothing in your tailwind.config needs to point at node_modules/@flowajs/react-viewer.

SSR

PdfHighlightViewer lazy-imports react-pdf on mount, so it is safe to render on a server (it returns a <Loader> placeholder until react-pdf loads in the browser). No dynamic(() => …, { ssr: false }) wrapper needed.

LlmContent is server-render-safe.

Worker assets

PdfHighlightViewer requires the consumer to serve pdf.worker.min.mjs and cmaps/ somewhere reachable, then pass URLs via workerSrc and cMapUrl props:

<PdfHighlightViewer
  pdfUrl={url}
  highlights={highlights}
  workerSrc="/pdfjs/pdf.worker.min.mjs"
  cMapUrl="/pdfjs/cmaps/"
/>

Both files ship with react-pdf under node_modules/react-pdf/dist/. Copy them into your public assets at install time (e.g. via a postinstall script).

Provenance

Every published version carries a sigstore provenance attestation. To verify:

npm audit signatures
# Or, for one package:
npm view @flowajs/react-viewer

License

MIT.