Skip to content
Document Authoring DA  API Docs v1.22.2
npmGitHub

ContextMenuConfig>= v1.23.0

ContextMenuConfig:

Host items to add to the editor’s context menus, one entry per kind of menu.

Host items come after the built-in items. Built-in items follow DocAuthEditor.setActions: one whose action is left out is hidden.

const editor = await system.createEditor(target, {
ui: {
actions: [
{ id: 'custom.define', label: 'Look up definition', handler: () => showDefinition() },
],
contextMenu: {
text: { items: [{ type: 'action', id: 'define', actionId: 'custom.define' }] },
},
},
});

optional text: ContextMenuItems

Items for the menu that opens when the user right-clicks text, including text in table cells and in shapes. In edit and review mode these items are not shown when an image or shape itself is right-clicked. In view mode images and shapes don’t take pointer input, so right-clicking one opens the text menu.