DiffViewer
Read-only unified diff pane with add/remove tinting and line numbers.
Props
DiffLine fields: type ("add" | "del" | "ctx" | "hunk"), content, oldNo?, newNo?.
| Prop | Type | Default | Description |
|---|---|---|---|
diff | string | — | Unified diff text, parsed internally. Takes precedence over lines. |
lines | DiffLine[] | — | Pre-parsed diff lines array. |
noGutter | boolean | — | Hide the old/new line-number gutters. |
Examples
import { DiffViewer, parseUnifiedDiff } from "@solarius/onset";
import type { DiffLine } from "@solarius/onset";