BuiltInActionNEW
BuiltInAction:
{}Built-in actions have pre-defined IDs from BuiltInActionId and automatically use default handlers if not provided. This allows you
to customize things without having to reimplement internal functionality.
Example
Section titled “Example”
// Remove all built-in actions except bold built-in (handler auto-populated)editor.setActions([{ id: 'formatting.bold', label: 'Bold', shortcuts: ['Mod+B'] }]);
// Override the default handler for boldeditor.setActions([ { id: 'formatting.bold', label: 'Bold', shortcuts: ['Mod+B'], handler: () => { console.log('Custom bold implementation'); }, },]);
// Customize shortcuts and labels while keeping default behavioreditor.setActions([ { id: 'document.export-pdf', label: 'Download PDF', shortcuts: ['Mod+P'] },]);BuiltInActionIdfor available built-in action IDs.CustomActionfor defining custom actions.
Properties
Section titled “Properties”id:
BuiltInActionId
label:
string
description?
Section titled “description?”
optionaldescription:string
shortcuts?
Section titled “shortcuts?”
optionalshortcuts:string[]
Keyboard shortcuts for the action. Use “Mod” as the primary modifier key - it will be automatically resolved to:
- “Ctrl” on Windows/Linux
- ”⌘” (Command) on Mac
Examples:
- “Mod+B” becomes “Ctrl+B” on Windows, “⌘B” on Mac
- “Mod+Shift+P” becomes “Ctrl+Shift+P” on Windows, ”⌘⇧P” on Mac
optionalicon:string
Icon as data URI (e.g., data:image/svg+xml;base64,… or data:image/png;base64,…). Only data:image/ URIs are allowed for security.
isEnabled()?
Section titled “isEnabled()?”
optionalisEnabled: () =>boolean
Returns
Section titled “Returns”handler()?
Section titled “handler()?”Handler function - optional for built-in actions (defaults will be used if omitted)
Parameters
Section titled “Parameters”…unknown[]