pub struct Capabilities {Show 20 fields
pub bold: bool,
pub italic: bool,
pub code: bool,
pub mark: bool,
pub underline: bool,
pub strike: bool,
pub superscript: bool,
pub subscript: bool,
pub heading: bool,
pub blockquote: bool,
pub bullet_list: bool,
pub ordered_list: bool,
pub task: bool,
pub link: bool,
pub image: bool,
pub thematic_break: bool,
pub footnote: bool,
pub code_language: bool,
pub table: bool,
pub cell_line_break: bool,
}Expand description
Which formatting controls this document’s format can spell — the toolbar’s
enabled state, one flag per button, from LeafDoc::capabilities. Mirrors
leaf_core::Capabilities, where the reasoning lives.
Its shape is a flat record of Bools rather than a query taking a gesture
because the Swift side wants exactly one crossing and a value it can hold in
an @Observable: let caps = doc.capabilities(), then
.disabled(!caps.bold) on each control.
Fields§
§bold: bool§italic: bool§code: bool§mark: bool§underline: bool§strike: bool§superscript: bool§subscript: bool§heading: boolBoth LeafDoc::set_heading and LeafDoc::set_paragraph — they are
the same gesture in core and stand or fall together.
blockquote: bool§bullet_list: bool§ordered_list: bool§task: boolLeafDoc::toggle_task_item, LeafDoc::toggle_task_checked and
LeafDoc::toggle_task_at — including a tap on a rendered checkbox,
which should not be live where the box cannot be spelled.
link: bool§image: bool[LeafDoc::insert_image] and LeafDoc::insert_media both.
thematic_break: bool§footnote: boolLeafDoc::insert_footnote. Markdown and djot spell the pair; HTML does
not, so the button goes rather than dims into a refusal.
code_language: bool§table: boolThe grid controls. Gate them on this and LeafDoc::caret_in_table:
this asks whether the format’s tables are editable, that whether the
caret is in one.
cell_line_break: boolShift+Return inside a cell — LeafDoc::cell_line_break.