Skip to content
Draft
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
7937669
poc
YousefED Jun 22, 2026
56a7916
improve typst exporter
YousefED Jun 30, 2026
776075d
update tests
YousefED Jun 30, 2026
f6dc68a
Merge origin/main into playground/typst-pdf-poc
YousefED Aug 20, 2026
cfb9b6b
feat(typst): math & diagram mappings, SVG diagrams, @cantoo/pdf-lib
YousefED Aug 20, 2026
12b63f4
fix(typst): review-driven hardening of the typst/pdf-ua pipeline
YousefED Aug 20, 2026
87e9e74
fix(typst): review pass-3 fixes, fully offline fonts, pinned poppler …
YousefED Aug 20, 2026
2299aba
refactor(typst): split into xl-typst-exporter + Typst-based PDFExport…
YousefED Aug 20, 2026
90e1426
docs(typst): export docs + review-driven packaging and API hardening
YousefED Aug 20, 2026
6262696
fix(docs): demo page still imported the react-pdf exporter from the p…
YousefED Aug 20, 2026
7cb50ae
fix(ci): e2e failure artifacts were never uploaded
YousefED Aug 20, 2026
d23319f
fix: address CodeRabbit review findings
YousefED Aug 20, 2026
4d69138
ci: add update-e2e-screenshots dispatch workflow
YousefED Aug 20, 2026
6b2cd52
ci: allow triggering the screenshot workflow from the feature branch
YousefED Aug 20, 2026
a0c356b
test: regenerate Linux e2e screenshot baselines
YousefED Aug 20, 2026
4697df2
ci: drop the temporary branch trigger from the screenshot workflow
YousefED Aug 20, 2026
21db062
ci: pass the screenshot filter via env, not template expansion
YousefED Aug 20, 2026
b3dcb74
feat(pdf): bundled default fonts, CDN-free by default; ODT cell merge…
YousefED Aug 20, 2026
f27153c
chore(e2e): docker-only policy for the browser suite
YousefED Aug 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ jobs:
- name: Lint packages
run: vp lint

- name: Install PDF tooling (veraPDF conformance gate + poppler visual snapshots)
run: bash tests/scripts/install-pdf-tooling.sh

- name: Run unit tests
run: vp run test

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/fresh-install-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ jobs:
name: Build packages
run: vp run -r build

- name: Install PDF tooling (veraPDF conformance gate + poppler visual snapshots)
run: bash tests/scripts/install-pdf-tooling.sh

- id: run_unit_tests
name: Run unit tests
run: vp run test
Expand Down
9 changes: 9 additions & 0 deletions docs/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- BEGIN:nextjs-agent-rules -->

# This is NOT the Next.js you know

This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices.

This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.

<!-- END:nextjs-agent-rules -->
1 change: 1 addition & 0 deletions docs/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
4 changes: 3 additions & 1 deletion docs/app/demo/_components/DemoEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ import {
ODTExporter,
odtDefaultSchemaMappings,
} from "@blocknote/xl-odt-exporter";
// The deprecated react-pdf exporter; the demo's PDF action migrates to the
// Typst-based PDFExporter with the examples/docs pass for the new API.
import {
PDFExporter,
pdfDefaultSchemaMappings,
} from "@blocknote/xl-pdf-exporter";
} from "@blocknote/xl-pdf-exporter/react-pdf";
import { pdf } from "@react-pdf/renderer";
import { DefaultChatTransport } from "ai";
import { useTheme } from "next-themes";
Expand Down
11 changes: 11 additions & 0 deletions docs/components/typstCompilerWasmUrl.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// The Typst compiler wasm for the docs build (see next.config.ts): the
// pdf-ua example bundles it via Vite's `?url`; under the docs site the
// import is aliased here. `new URL(..., import.meta.url)` is Turbopack's
// static-asset reference: the ~29MB wasm is emitted as a hashed static
// file and served by the site itself - no CDN involved, and the version
// can't skew from the installed package because it IS the installed file.
const url = new URL(
"../node_modules/@myriaddreamin/typst-ts-web-compiler/pkg/typst_ts_web_compiler_bg.wasm",
import.meta.url,
).href;
export default url;
4 changes: 4 additions & 0 deletions docs/components/typstRendererStub.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Stub for @myriaddreamin/typst-ts-renderer (see next.config.ts): the
// pdf-ua demo only compiles Typst, never canvas-renders, so the optional
// renderer peer is not installed.
export {};
5 changes: 3 additions & 2 deletions docs/content/docs/features/blocks/diagrams.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,16 @@ The example below wires them all up.

Diagrams export to every format BlockNote supports. [Markdown](/docs/features/export/markdown) works out of the box — diagrams export as ` ```mermaid ` fenced code blocks, their common Markdown notation.

The [PDF](/docs/features/export/pdf), [DOCX](/docs/features/export/docx), [ODT](/docs/features/export/odt), and [email](/docs/features/export/email) exporters embed the diagram as an image via their mappings — they live as subpaths of this package, and each exports a `createDiagramBlockMapping` factory to spread into the exporter's default mappings. The [DOCX exporter](/docs/features/export/docx) shown here; the [PDF](/docs/features/export/pdf), [ODT](/docs/features/export/odt), and [email](/docs/features/export/email) exporters work the same way with their respective subpaths:
The [PDF](/docs/features/export/pdf) (and [Typst](/docs/features/export/typst)), [DOCX](/docs/features/export/docx), [ODT](/docs/features/export/odt), and [email](/docs/features/export/email) exporters embed the diagram as an image via their mappings — they live as subpaths of this package, and each exports a `createDiagramBlockMapping` factory to spread into the exporter's default mappings. The [DOCX exporter](/docs/features/export/docx) shown here; the others work the same way with their respective subpaths:

```typescript
import {
DOCXExporter,
docxDefaultSchemaMappings,
} from "@blocknote/xl-docx-exporter";
import { createDiagramBlockMapping } from "@blocknote/diagram-block/docx-exporter";
// ...or "@blocknote/diagram-block/pdf-exporter",
// ...or "@blocknote/diagram-block/typst-exporter" (PDF + Typst - embeds
// vector SVG with labels as real text),
// "@blocknote/diagram-block/odt-exporter",
// "@blocknote/diagram-block/email-exporter"

Expand Down
35 changes: 15 additions & 20 deletions docs/content/docs/features/blocks/math.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -121,34 +121,29 @@ import {

### PDF

With the [PDF exporter](/docs/features/export/pdf), math blocks export as vector formulas — no rasterization, so they also work server-side out of the box. Inline math is rasterized to images that flow with the text:
With the [PDF exporter](/docs/features/export/pdf) (or the standalone
[Typst exporter](/docs/features/export/typst) — they share mappings), math
blocks and inline math export as **native Typst equations**: real, selectable
text, no rasterization, so they also work server-side out of the box:

```typescript
import {
createInlineMathMapping,
inlineMathMapping,
mathBlockMapping,
} from "@blocknote/math-block/pdf-exporter";
} from "@blocknote/math-block/typst-exporter";

// Spread into the PDFExporter's mappings as for DOCX above - note that
// inline math is a factory here: `math: createInlineMathMapping()`.
// Spread into the PDFExporter's mappings as for DOCX above:
// `mathBlock: mathBlockMapping` and `math: inlineMathMapping`.
```

The inline math factory takes one option:

```typescript
createInlineMathMapping(options?: {
/**
* Rasterizes the formula SVG to an image. Defaults to the built-in
* canvas rasterizer, which only works in the browser - when exporting
* server-side, pass one backed by e.g. `@resvg/resvg-js` or `sharp`;
* without it, a server-side export throws. The `RasterizeSVG` type is
* exported from the same subpath.
*/
rasterize?: RasterizeSVG;
});
```
The LaTeX is converted to Typst's math notation. Most KaTeX commands are
covered; a valid formula using an uncovered command fails the export loudly
(rather than silently exporting something else), while invalid LaTeX renders
the error placeholder as in other formats.

Math blocks require the `@react-pdf/math` package (a peer dependency of the PDF mapping).
The deprecated [react-pdf exporter](/docs/features/export/pdf#deprecated-the-react-pdf-exporter)'s
mappings remain available from `@blocknote/math-block/pdf-exporter` during its
deprecation window.

### Email

Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/features/export/meta.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"title": "Export",
"pages": ["markdown", "html", "pdf", "docx", "email", "odt", "..."]
"pages": ["markdown", "html", "pdf", "docx", "email", "odt", "typst", "..."]
}
Loading
Loading