{"_id":"@arena.ai/faster-latex-react","_rev":"3-f5e3bb48556669d3f61ec84bf5c17ae5","name":"@arena.ai/faster-latex-react","dist-tags":{"placeholder":"0.0.0","latest":"0.2.1"},"versions":{"0.0.0":{"name":"@arena.ai/faster-latex-react","version":"0.0.0","license":"Apache-2.0","_id":"@arena.ai/faster-latex-react@0.0.0","maintainers":[{"name":"matthova","email":"matthova87@gmail.com"}],"homepage":"https://github.com/Arena-OSS/faster-latex#readme","bugs":{"url":"https://github.com/Arena-OSS/faster-latex/issues"},"dist":{"shasum":"90f87b27d8f5ea14ace44f164c16dd0f5aee87a0","tarball":"https://registry.npmjs.org/@arena.ai/faster-latex-react/-/faster-latex-react-0.0.0.tgz","fileCount":4,"integrity":"sha512-/lqFk7FmmLd6yKZCqoydWkK8Pebq8ZaxGnQSqgzOToRIp00tLA1P4jXDLJiHuQv+3o+92MSW/zYLn/5h9FJZbA==","signatures":[{"sig":"MEUCIAM8dpDxVVnt0r6yMVPAXorVWOQKvaohBx/5c6A0fTXtAiEAhMjIzsPciNiVaLvBgCHtyrbP0MavKtJnxt7a4QmVoRU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1096},"main":"index.js","type":"module","types":"index.d.ts","_npmUser":{"name":"matthova","email":"matthova87@gmail.com"},"repository":{"url":"git+https://github.com/Arena-OSS/faster-latex.git","type":"git","directory":"sdk/react"},"_npmVersion":"10.9.8","description":"Reserved placeholder for the faster-latex React adapter. Not yet released.","directories":{},"_nodeVersion":"22.22.3","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/faster-latex-react_0.0.0_1787637199391_0.03259601804684653","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@arena.ai/faster-latex-react","version":"0.2.0","keywords":["latex","html","mathml","wasm","react","renderer","incremental"],"author":{"name":"Matt Hova"},"license":"Apache-2.0","_id":"@arena.ai/faster-latex-react@0.2.0","maintainers":[{"name":"matthova","email":"matthova87@gmail.com"}],"homepage":"https://github.com/matthova/faster-latex#readme","bugs":{"url":"https://github.com/matthova/faster-latex/issues"},"dist":{"shasum":"93acb0e7a2e2012bbfe2f32a85dc2b68e6c59391","tarball":"https://registry.npmjs.org/@arena.ai/faster-latex-react/-/faster-latex-react-0.2.0.tgz","fileCount":22,"integrity":"sha512-2ib/amRKV/7QG9qDycrYOiOBBSeXcO6u7l9CDo7XSWkhFduFu73GWLmK9M5IGub2r/jesj/B8/XcRY3lBiLy9A==","signatures":[{"sig":"MEUCIHSNTecTKjYSQ/RA3BigRwzzLZoAntzi0n8FFD/mkoGEAiEArPOoPfKNIo2zauS01igYZ4fpQz39YlQxB0S9pEo0GQs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23305},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./server":{"types":"./dist/server.d.ts","default":"./dist/server.js"},"./styles":{"types":"./dist/styles.d.ts","default":"./dist/styles.js"},"./package.json":"./package.json"},"gitHead":"5f69162199849558db370ec20277e062c44eb06e","scripts":{"test":"tsc -p tsconfig.build.json && node --test --experimental-strip-types test/*.test.ts","build":"tsc -p tsconfig.build.json"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:2e41bb60-d8a7-4da1-a359-dd89656f1d39"}},"repository":{"url":"git+https://github.com/matthova/faster-latex.git","type":"git","directory":"sdk/react"},"_npmVersion":"12.0.2","description":"Thin React integration for faster-latex: <FasterLatex> and useFasterLatex, incremental and worker-backed, with no duplicate WASM.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.2","dependencies":{"@arena.ai/faster-latex-dom":"workspace:^"},"publishConfig":{"access":"public","provenance":false},"_hasShrinkwrap":false,"devDependencies":{"jsdom":"25.0.1","react":"19.0.0","react-dom":"19.0.0","typescript":"5.7.3","@types/react":"19.0.7","@types/react-dom":"19.0.3","@testing-library/dom":"10.4.0","@testing-library/react":"16.1.0"},"peerDependencies":{"react":"^18.2.0 || ^19.0.0"},"_npmOperationalInternal":{"tmp":"tmp/faster-latex-react_0.2.0_1787669639667_0.4115986636900255","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@arena.ai/faster-latex-react","version":"0.2.1","description":"Thin React integration for faster-latex: <FasterLatex> and useFasterLatex, incremental and worker-backed, with no duplicate WASM.","type":"module","license":"Apache-2.0","author":{"name":"Matt Hova"},"repository":{"type":"git","url":"git+https://github.com/matthova/faster-latex.git","directory":"sdk/react"},"homepage":"https://github.com/matthova/faster-latex#readme","bugs":{"url":"https://github.com/matthova/faster-latex/issues"},"keywords":["latex","html","mathml","wasm","react","renderer","incremental"],"sideEffects":false,"main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./styles":{"types":"./dist/styles.d.ts","default":"./dist/styles.js"},"./server":{"types":"./dist/server.d.ts","default":"./dist/server.js"},"./package.json":"./package.json"},"dependencies":{"@arena.ai/faster-latex-dom":"^0.2.1"},"peerDependencies":{"react":"^18.2.0 || ^19.0.0"},"devDependencies":{"@testing-library/dom":"10.4.0","@testing-library/react":"16.1.0","@types/react":"19.0.7","@types/react-dom":"19.0.3","jsdom":"25.0.1","react":"19.0.0","react-dom":"19.0.0","typescript":"5.7.3"},"publishConfig":{"access":"public","provenance":false},"scripts":{"build":"tsc -p tsconfig.build.json","test":"tsc -p tsconfig.build.json && node --test --experimental-strip-types test/*.test.ts"},"_id":"@arena.ai/faster-latex-react@0.2.1","_integrity":"sha512-pP9T81LHezEkyAZFK2CtK8WGL73T4wXgHZ2wbmwWzovsYuD1wkO5favwB1ncnTDuEzu4SKseDi1FA/WXSYK0vA==","_resolved":"/tmp/fl-release-XQxopk/arena.ai-faster-latex-react-0.2.1.tgz","_from":"file:/tmp/fl-release-XQxopk/arena.ai-faster-latex-react-0.2.1.tgz","_nodeVersion":"22.23.2","_npmVersion":"12.0.2","dist":{"integrity":"sha512-pP9T81LHezEkyAZFK2CtK8WGL73T4wXgHZ2wbmwWzovsYuD1wkO5favwB1ncnTDuEzu4SKseDi1FA/WXSYK0vA==","shasum":"e60e52998313383da4157d2c284ad242a1274789","tarball":"https://registry.npmjs.org/@arena.ai/faster-latex-react/-/faster-latex-react-0.2.1.tgz","fileCount":23,"unpackedSize":34657,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICIF9ghnqmT1W4B/Yd+VgycEeesqOuKtp0695F7QzY1aAiEA7Wbz1GuUQ4eeF7L/q635cvD/dxOKZ8XFy0NpqSNoSKo="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:2e41bb60-d8a7-4da1-a359-dd89656f1d39"}},"directories":{},"maintainers":[{"name":"matthova","email":"matthova87@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/faster-latex-react_0.2.1_1787693313843_0.6781707220208375"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-25T05:53:19.229Z","modified":"2026-08-25T21:28:34.165Z","0.0.0":"2026-08-25T05:53:19.514Z","0.2.0":"2026-08-25T14:53:59.792Z","0.2.1":"2026-08-25T21:28:33.999Z"},"bugs":{"url":"https://github.com/matthova/faster-latex/issues"},"author":{"name":"Matt Hova"},"license":"Apache-2.0","homepage":"https://github.com/matthova/faster-latex#readme","keywords":["latex","html","mathml","wasm","react","renderer","incremental"],"repository":{"type":"git","url":"git+https://github.com/matthova/faster-latex.git","directory":"sdk/react"},"description":"Thin React integration for faster-latex: <FasterLatex> and useFasterLatex, incremental and worker-backed, with no duplicate WASM.","maintainers":[{"name":"matthova","email":"matthova87@gmail.com"}],"readme":"# @arena.ai/faster-latex-react\n\nThin React integration for [@arena.ai/faster-latex](https://www.npmjs.com/package/@arena.ai/faster-latex),\nbuilt on [`@arena.ai/faster-latex-dom`](https://www.npmjs.com/package/@arena.ai/faster-latex-dom). No\nduplicate WASM — the engine is loaded once by the controller.\n\n```tsx\nimport { FasterLatex } from \"@arena.ai/faster-latex-react\";\n\nexport function Preview({ src }: { src: string }) {\n  return <FasterLatex source={src} placeholder={<p>Rendering…</p>} />;\n}\n```\n\n- **Worker execution by default**, with an automatic main-thread fallback\n  (`execution=\"auto\" | \"worker\" | \"main\"`).\n- **Incremental block patches** into a React-owned but React-untouched host —\n  React never reconciles the generated descendants.\n- **True SSR**: `<FasterLatexServer>` renders real LaTeX HTML on the server —\n  no client JS, no wasm shipped to the browser (see below). The interactive\n  `<FasterLatex>` is **SSR-safe** too: it renders a placeholder on the server and\n  starts real rendering after hydration. **StrictMode-safe**: create/dispose are\n  symmetric and late results are dropped.\n- **Deduplicated styles** automatically; a **static stylesheet** is exported for\n  CSP-controlled apps.\n- **React 18.2 and 19** (peer dependency).\n\nA runnable Vite + React demo lives in\n[`examples/react-demo`](../../examples/react-demo) (`pnpm demo:react`).\n\n## `<FasterLatex>`\n\n| prop | type | notes |\n|---|---|---|\n| `source` | `string` | LaTeX; feed on every keystroke |\n| `options` | `RenderOptions` | set once (a change recreates the controller) |\n| `execution` | `\"auto\" \\| \"worker\" \\| \"main\"` | default `\"auto\"` |\n| `styles` | `\"auto\" \\| \"none\"` | default `\"auto\"` |\n| `placeholder` | `ReactNode` | shown until first render (and on the server) |\n| `className` / `style` | wrapper | |\n| `as` / `hostClassName` | host element tag / class | default `\"div\"` |\n| `onRender(state)` / `onError(msg)` | callbacks | |\n| `onPatch(nodes, {full})` | post-paint hook | e.g. dark-mode colour pass |\n\n## `useFasterLatex(config)`\n\nFor custom preview/editor UIs. Returns `{ ref, state, renderer }`; attach `ref`\nto an element you own but never render into:\n\n```tsx\nconst { ref, state } = useFasterLatex({ source, options });\nreturn <div ref={ref} className={state.status === \"error\" ? \"err\" : \"\"} />;\n```\n\n## Server-side rendering: `<FasterLatexServer>`\n\nFor real server rendering — a React Server Component (or any async render path)\nthat emits finished LaTeX HTML with **no client JS and no wasm in the browser\nbundle** — use the `server` entry. It runs the Node build of the engine\n(`@arena.ai/faster-latex/node`), which reads its wasm off disk synchronously; the engine is\npure (string in, string out), so no DOM or jsdom is involved.\n\n```tsx\nimport { FasterLatexServer } from \"@arena.ai/faster-latex-react/server\";\n\n// an async Server Component\nexport default async function Page() {\n  return (\n    <FasterLatexServer\n      source={\"\\\\section{Hi} $e^{i\\\\pi}+1=0$\"}\n      options={{ packages }}\n      inlineStyles // emit a <style> with the article stylesheet; omit if it's in <head>\n    />\n  );\n}\n```\n\nProps: `source`, `options` (`RenderOptions`), `as` / `className` / `style` for\nthe host element, `inlineStyles` (default `false`), and `loadEngine` to override\nhow the engine is loaded. The output is set via `dangerouslySetInnerHTML` by\ndesign — the engine emits its own HTML from a parsed AST, and React never\nreconciles it.\n\nFramework-neutral equivalent (no React): `renderToString` from\n`@arena.ai/faster-latex-dom/server`, which returns `{ html, css, warnings, packages, version }`.\n\n## CSP / SSR: static stylesheet\n\n```ts\nimport { articleStylesheet } from \"@arena.ai/faster-latex-react/styles\";\n```\n\n## License\n\nApache-2.0\n","readmeFilename":"README.md"}