Render structured list and table entries in stat block traits
All checks were successful
CI / check (push) Successful in 2m21s
CI / build-image (push) Successful in 17s

Stat block traits containing 5etools list (e.g. Confusing Burble d4
effects) or table entries were silently dropped. The adapter now
produces structured TraitSegment[] instead of flat text, preserving
lists and tables as first-class data. The stat block component renders
labeled list items inline (bold label + flowing text) matching the
5etools layout. Also fixes support for the singular "entry" field on
list items and bumps the bestiary cache version to force re-normalize.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Lukas
2026-04-04 22:09:11 +02:00
parent 817cfddabc
commit 8f6eebc43b
7 changed files with 335 additions and 37 deletions

View File

@@ -5,9 +5,18 @@ export function creatureId(id: string): CreatureId {
return id as CreatureId;
}
export type TraitSegment =
| { readonly type: "text"; readonly value: string }
| { readonly type: "list"; readonly items: readonly TraitListItem[] };
export interface TraitListItem {
readonly label?: string;
readonly text: string;
}
export interface TraitBlock {
readonly name: string;
readonly text: string;
readonly segments: readonly TraitSegment[];
}
export interface LegendaryBlock {

View File

@@ -34,6 +34,8 @@ export {
proficiencyBonus,
type SpellcastingBlock,
type TraitBlock,
type TraitListItem,
type TraitSegment,
} from "./creature-types.js";
export {
type DeletePlayerCharacterSuccess,