Type Editor / @type-editor/menu / menu-items/image-item / imageItem
Function: imageItem()
ts
function imageItem(title?, imgType?, figureType?, codeBlockNodeType?): MenuItem;Defined in: packages/menu/src/menu-items/image-item.ts:92
Creates a menu item for inserting and editing images in the editor.
This menu item provides functionality to:
- Insert new images via file picker or drag-and-drop
- Edit existing image properties (caption, size, text flow)
- Handle conversion between paragraph and figure nodes based on caption presence
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
title | string | 'Image' | Display title for the menu item (default: 'Image') |
imgType | NodeType | schema.nodes.image | Node type for images (default: schema.nodes.image) |
figureType | NodeType | schema.nodes.figure | Node type for figures with captions (default: schema.nodes.figure) |
codeBlockNodeType | NodeType | schema.nodes.code_block | used to identify code blocks where image insertion is disabled (default: schema.nodes.code_block) |
Returns
A configured MenuItem instance