Render structured list and table entries in stat block traits
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:
@@ -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 {
|
||||
|
||||
@@ -34,6 +34,8 @@ export {
|
||||
proficiencyBonus,
|
||||
type SpellcastingBlock,
|
||||
type TraitBlock,
|
||||
type TraitListItem,
|
||||
type TraitSegment,
|
||||
} from "./creature-types.js";
|
||||
export {
|
||||
type DeletePlayerCharacterSuccess,
|
||||
|
||||
Reference in New Issue
Block a user