LibWeb: Lay out CommandDefinitions for Editing API a bit nicer

No functional changes.
This commit is contained in:
Jelle Raaijmakers 2024-12-16 15:48:24 +01:00 committed by Jelle Raaijmakers
commit 433c19c1ed
Notes: github-actions[bot] 2024-12-21 18:17:48 +00:00
2 changed files with 26 additions and 9 deletions

View file

@ -781,11 +781,28 @@ bool command_style_with_css_state(DOM::Document const& document)
}
static Array const commands {
CommandDefinition { CommandNames::delete_, command_delete_action, {}, {}, {} },
CommandDefinition { CommandNames::defaultParagraphSeparator, command_default_paragraph_separator_action, {}, {}, command_default_paragraph_separator_value },
CommandDefinition { CommandNames::insertLineBreak, command_insert_linebreak_action, {}, {}, {} },
CommandDefinition { CommandNames::insertParagraph, command_insert_paragraph_action, {}, {}, {} },
CommandDefinition { CommandNames::styleWithCSS, command_style_with_css_action, {}, command_style_with_css_state, {} },
CommandDefinition {
.command = CommandNames::delete_,
.action = command_delete_action,
},
CommandDefinition {
.command = CommandNames::defaultParagraphSeparator,
.action = command_default_paragraph_separator_action,
.value = command_default_paragraph_separator_value,
},
CommandDefinition {
.command = CommandNames::insertLineBreak,
.action = command_insert_linebreak_action,
},
CommandDefinition {
.command = CommandNames::insertParagraph,
.action = command_insert_paragraph_action,
},
CommandDefinition {
.command = CommandNames::styleWithCSS,
.action = command_style_with_css_action,
.state = command_style_with_css_state,
},
};
Optional<CommandDefinition const&> find_command_definition(FlyString const& command)