# @salmonui/rich-text API reference

> 130 exported symbols of @salmonui/rich-text: 1 component, 26 functions, 1 class, 60 interfaces, 38 types and 4 constants.

Canonical: https://salmonui.dev/docs/reference/rich-text

```ts
import { … } from '@salmonui/rich-text';
```

## Components

### RichTextContent

Kind: component

Page: https://salmonui.dev/docs/reference/rich-text/RichTextContent

```ts
function RichTextContent(props: RichTextContentProps): import("react").JSX.Element;
```

Read-only rendering of rich text content; root class `salmon-rich-text-content`.

Props: [`RichTextContentProps`](https://salmonui.dev/docs/reference/rich-text/RichTextContentProps) (its members are the props)

## Functions

### BlockEditor

Kind: function

Page: https://salmonui.dev/docs/reference/rich-text/BlockEditor

```ts
function BlockEditor(props: BlockEditorProps): ReactElement;
```

The block editor (`@salmonui/rich-text`); value is `Block[]` JSON.

### RichTextEditor

Kind: function

Page: https://salmonui.dev/docs/reference/rich-text/RichTextEditor

```ts
function RichTextEditor<TMention = MentionItem>(props: RichTextEditorProps<TMention>): ReactElement;
```

Rich text editor on ProseMirror (`@salmonui/rich-text`). HTML value,
toolbar, quick toolbars, dialogs, mentions, slash and emoji menus.

### blocksToHtml

Kind: function

Page: https://salmonui.dev/docs/reference/rich-text/blocksToHtml

```ts
function blocksToHtml(blocks: readonly Block[]): string;
```

Serializes blocks to sanitized HTML in the shared vocabulary (`getDataAsHtml`). Block ids are written as `data-block-id`. Pure and
server-safe; unsafe values in the JSON (a `javascript:` link, say) are
removed by the sanitizer like any other HTML.

### cleanPastedHtml

Kind: function

Page: https://salmonui.dev/docs/reference/rich-text/cleanPastedHtml

```ts
function cleanPastedHtml(html: string, options?: PasteCleanupOptions): string;
```

Cleans clipboard HTML for the editors: Word (mso styles,
`o:p`, conditional comments, MsoListParagraph runs into real nested lists
from the mso-list levels, `class="Mso*"`), Google Docs (the
`docs-internal-guid` wrapper, styled spans into marks, flat nested lists,
checklists), then the mode, the tag and attribute filters, and always the
sanitizer. Returns HTML in the shared vocabulary.

### createContentEditableMentionTarget

Kind: function

Page: https://salmonui.dev/docs/reference/rich-text/createContentEditableMentionTarget

```ts
function createContentEditableMentionTarget(element: HTMLElement, options?: ContentEditableMentionOptions): MentionEditorTarget;
```

A `MentionEditorTarget` over a `contenteditable` element.

### detectPasteSource

Kind: function

Page: https://salmonui.dev/docs/reference/rich-text/detectPasteSource

```ts
function detectPasteSource(html: string): PasteSource;
```

Detects Word (desktop and online) and Google Docs clipboard HTML.

### embedAllowed

Kind: function

Page: https://salmonui.dev/docs/reference/rich-text/embedAllowed

```ts
function embedAllowed(src: string, embedHosts: readonly string[]): boolean;
```

Whether an iframe `src` points at an allowed embed host. `embedHosts`
entries are exact hostnames (`www.youtube-nocookie.com`) or `*.example.com`
for any subdomain of `example.com`. Only http(s) URLs with no credentials
and no backslashes qualify.

### escapeAttribute

Kind: function

Page: https://salmonui.dev/docs/reference/rich-text/escapeAttribute

```ts
function escapeAttribute(text: string): string;
```

Escapes text for use inside a double-quoted HTML attribute value.

### escapeHtml

Kind: function

Page: https://salmonui.dev/docs/reference/rich-text/escapeHtml

```ts
function escapeHtml(text: string): string;
```

Escapes text for use as HTML element content.

### findBlock

Kind: function

Page: https://salmonui.dev/docs/reference/rich-text/findBlock

```ts
function findBlock(blocks: readonly Block[], id: string): Block | undefined;
```

Finds a block by id anywhere in the tree (depth-first, document order).

### findParentId

Kind: function

Page: https://salmonui.dev/docs/reference/rich-text/findParentId

```ts
function findParentId(blocks: readonly Block[], id: string, parent?: string | null): string | null | undefined;
```

Id of the block's parent (`null` at the top level, `undefined` when not found).

### forEachBlock

Kind: function

Page: https://salmonui.dev/docs/reference/rich-text/forEachBlock

```ts
function forEachBlock(blocks: readonly Block[], fn: (block: Block, parent: Block | null, index: number) => void, parent?: Block | null): void;
```

Calls `fn` on every block in document order.

### htmlToBlocks

Kind: function

Page: https://salmonui.dev/docs/reference/rich-text/htmlToBlocks

```ts
function htmlToBlocks(html: string): Block[];
```

Parses HTML into blocks (`parseHtmlToBlocks`). The HTML is
sanitized first. Ids come from `data-block-id`; missing or duplicate ids get
deterministic ones from the index path (`b0`, `b2-1`, ...), so server and
client agree. Content the block model has no type for (iframe embeds,
images inside text) is dropped.

### htmlToText

Kind: function

Page: https://salmonui.dev/docs/reference/rich-text/htmlToText

```ts
function htmlToText(html: string, options?: HtmlToTextOptions): string;
```

Text content of HTML as the editors count it: the sanitized content, block
boundaries become `blockSeparator`, `<br>` a newline, table cells are
separated by tabs, whitespace outside `<pre>` collapses as it renders.
Mentions and labels count as their visible text (`@Alice`).

### insertBlocks

Kind: function

Page: https://salmonui.dev/docs/reference/rich-text/insertBlocks

```ts
function insertBlocks(blocks: readonly Block[], inserted: readonly Block[], position?: BlockPosition): Block[];
```

Inserts blocks before or after the block `before` / `after`, or into
`parent`'s children at `index` (default: last). Without a position they go
at the end. Returns the input unchanged when the anchor does not exist.

### loadRichTextEngine

Kind: function

Page: https://salmonui.dev/docs/reference/rich-text/loadRichTextEngine

```ts
function loadRichTextEngine(): Promise<typeof import('./load.js')>;
```

Loads the headless ProseMirror engine on demand: `const { createEngine } = await loadRichTextEngine()`.

### moveBlock

Kind: function

Page: https://salmonui.dev/docs/reference/rich-text/moveBlock

```ts
function moveBlock(blocks: readonly Block[], id: string, position: BlockPosition): Block[];
```

Moves a block (with its children) before or after another block, or into
another block's children. Moving a block into itself or its own subtree,
or relative to a missing block, returns the input unchanged.

### parseHtml

Kind: function

Page: https://salmonui.dev/docs/reference/rich-text/parseHtml

```ts
function parseHtml(input: string): HtmlNode[];
```

Parses an HTML fragment into a tree. Never throws; malformed input yields
the closest well-formed tree. `<!DOCTYPE>` is skipped, CDATA becomes text.

### pasteNeedsPrompt

Kind: function

Page: https://salmonui.dev/docs/reference/rich-text/pasteNeedsPrompt

```ts
function pasteNeedsPrompt(html: string, options?: Pick<PasteCleanupOptions, 'mode'>): boolean;
```

Whether `mode: 'prompt'` needs to ask for this paste (formatted HTML; plain text never asks).

### plainTextToHtml

Kind: function

Page: https://salmonui.dev/docs/reference/rich-text/plainTextToHtml

```ts
function plainTextToHtml(text: string): string;
```

HTML for plain text (plain-text paste): paragraphs on blank lines,
`<br>` on single newlines, runs of spaces kept as no-break spaces, all text
escaped. Empty input gives `''`.

### removeBlocks

Kind: function

Page: https://salmonui.dev/docs/reference/rich-text/removeBlocks

```ts
function removeBlocks(blocks: readonly Block[], ids: readonly string[]): Block[];
```

Removes the blocks with these ids (with their children).

### sanitizeHtml

Kind: function

Page: https://salmonui.dev/docs/reference/rich-text/sanitizeHtml

```ts
function sanitizeHtml(html: string, options?: SanitizeHtmlOptions): string;
```

Sanitizes HTML against the shared vocabulary. Pure and
server-safe: no DOM, no globals, deterministic, linear in the input size.
`sanitizeHtml(sanitizeHtml(x)) === sanitizeHtml(x)`.

### sanitizeNodes

Kind: function

Page: https://salmonui.dev/docs/reference/rich-text/sanitizeNodes

```ts
function sanitizeNodes(nodes: readonly HtmlNode[], options?: SanitizeHtmlOptions): HtmlNode[];
```

Sanitizes a parsed tree (see sanitizeHtml); returns a new tree.

### sanitizeUrl

Kind: function

Page: https://salmonui.dev/docs/reference/rich-text/sanitizeUrl

```ts
function cleanUrl(raw: string, use: UrlUse): string | null;
```

Returns the URL to keep for `use`, or null when it is not allowed.
Leading and trailing whitespace and control characters are trimmed and
tabs and newlines removed, as browsers do, before the scheme is checked, so
`java&#x09;script:` or ` javascript:` are recognized and refused. Allowed:
http, https, mailto, tel and relative URLs (including `#` and `//`) for
links; http, https, blob, relative and `data:image/(png|jpeg|gif|webp|avif)`
for images; http, https, blob and relative for audio and video; embeds are
checked by embedAllowed.

### serializeHtml

Kind: function

Page: https://salmonui.dev/docs/reference/rich-text/serializeHtml

```ts
function serializeHtml(nodes: readonly HtmlNode[], options?: SerializeHtmlOptions): string;
```

Serializes a parsed (or sanitized) tree back to HTML.

### updateBlock

Kind: function

Page: https://salmonui.dev/docs/reference/rich-text/updateBlock

```ts
function updateBlock(blocks: readonly Block[], id: string, patch: BlockPatch | ((block: Block) => Block)): Block[];
```

Updates one block: `props` are merged, `type`, `content` and `children`
replace; or pass a function returning the new block (its id is kept).

## Classes

### RichTextEngine

Kind: class

Page: https://salmonui.dev/docs/reference/rich-text/RichTextEngine

```ts
class RichTextEngine {
    #private;
    readonly schema: Schema;
    readonly commands: RichTextCommands;
    readonly extensionCommands: Record<string, (...args: never[]) => Command>;
    readonly historyCommands: {
        readonly undo: Command;
        readonly redo: Command;
    } | null;
    state: EditorState;
    view: EditorView | null;
    constructor(options: EngineOptions, extensionPlugins: readonly Plugin[], schema?: Schema);
    parseHtml(html: string): PMNode;
    parseSlice(html: string): Slice;
    getHtml(options?: {
        readonly xhtml?: boolean | undefined;
    }): string;
    getText(): string;
    get characterCount(): number;
    get isEmpty(): boolean;
    setHtml(html: string, options?: {
        readonly addToHistory?: boolean;
    }): void;
    dispatch(tr: Transaction): void;
    exec(command: Command): boolean;
    run(id: string, ...args: unknown[]): unknown;
    subscribe(listener: Listener): () => void;
    getSelection(): RichTextSelection;
    setSelection(anchor: number, head?: number): void;
    clearHistory(): void;
    get suggest(): SuggestState | null;
    dismissSuggest(): void;
    completeSuggest(content: string | null): void;
    get findState(): import("./plugins.js").FindState | undefined;
    get painterActive(): boolean;
    insertFiles(files: readonly File[], at?: number): Promise<void>;
    mount(element: HTMLElement): EditorView;
    get mentionTarget(): MentionEditorTarget | null;
    focus(): void;
    refresh(): void;
    destroy(): void;
    selectedNode(): PMNode | null;
    sliceHtml(): string;
}
```

Members (34):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `__#4@#private` | `#private;` |  |  |
| `schema` | `readonly schema: Schema;` |  |  |
| `commands` | `readonly commands: RichTextCommands;` |  |  |
| `extensionCommands` | `readonly extensionCommands: Record<string, (...args: never[]) => Command>;` |  |  |
| `historyCommands` | `readonly historyCommands: {     readonly undo: Command;     readonly redo: Command; } \| null;` |  | Undo and redo of an extension that replaces the history, else null. |
| `state` | `state: EditorState;` |  |  |
| `view` | `view: EditorView \| null;` |  |  |
| `parseHtml` | `parseHtml(html: string): PMNode;` |  |  |
| `parseSlice` | `parseSlice(html: string): Slice;` |  |  |
| `getHtml` | `getHtml(options?: {     readonly xhtml?: boolean \| undefined; }): string;` |  |  |
| `getText` | `getText(): string;` |  |  |
| `characterCount` | `get characterCount(): number;` |  |  |
| `isEmpty` | `get isEmpty(): boolean;` |  |  |
| `setHtml` | `setHtml(html: string, options?: {     readonly addToHistory?: boolean; }): void;` |  | Replaces the document (controlled `value`, form reset, source view). |
| `dispatch` | `dispatch(tr: Transaction): void;` |  |  |
| `exec` | `exec(command: Command): boolean;` |  |  |
| `run` | `run(id: string, ...args: unknown[]): unknown;` |  | Runs a command, an alias, an extension command or a UI action by id; `false` when cancelled or not applied. |
| `subscribe` | `subscribe(listener: Listener): () => void;` |  |  |
| `getSelection` | `getSelection(): RichTextSelection;` |  |  |
| `setSelection` | `setSelection(anchor: number, head?: number): void;` |  |  |
| `clearHistory` | `clearHistory(): void;` |  |  |
| `suggest` | `get suggest(): SuggestState \| null;` |  |  |
| `dismissSuggest` | `dismissSuggest(): void;` |  |  |
| `completeSuggest` | `completeSuggest(content: string \| null): void;` |  | Replaces the active trigger and query (`/head`, `:smi`) with content. |
| `findState` | `get findState(): import("./plugins.js").FindState \| undefined;` |  |  |
| `painterActive` | `get painterActive(): boolean;` |  |  |
| `insertFiles` | `insertFiles(files: readonly File[], at?: number): Promise<void>;` |  |  |
| `mount` | `mount(element: HTMLElement): EditorView;` |  |  |
| `mentionTarget` | `get mentionTarget(): MentionEditorTarget \| null;` |  | The `@salmonui/dropdowns/mention` editor target over this view; one per view. |
| `focus` | `focus(): void;` |  |  |
| `refresh` | `refresh(): void;` |  | Refreshes decorations and editable state after option changes. |
| `destroy` | `destroy(): void;` |  |  |
| `selectedNode` | `selectedNode(): PMNode \| null;` |  | Selection as a NodeSelection of an image, figure, audio, video or embed, if any. |
| `sliceHtml` | `sliceHtml(): string;` |  |  |

## Interfaces

### Block

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/Block

```ts
interface Block {
    id: string;
    type: BlockType;
    props?: Record<string, unknown>;
    content?: InlineContent[];
    children?: Block[];
}
```

One block. `props` by type:
- paragraph: `textAlign?`; heading: `level` (1..6), `textAlign?`;
- numberedListItem: `start?` (starts a new numbered list); checklistItem: `checked`;
- callout: `tone` (`info` | `success` | `warning` | `danger` | `neutral`);
- code: `language?`; toggle: `open?`;
- image: `src`, `alt?`, `caption?`, `width?`, `height?`;
- audio: `src`; video: `src`, `width?`, `height?`;
- table: `headerRow` (first row is header cells), `rows` (`InlineContent[][][]`, rows of cells), `variant?` (`bordered` | `striped`).

`content` holds the block's own text (absent for image, table, divider,
audio, video; one unmarked text item for code); `children` the nested
blocks (list item sub-items, toggle body, quote and callout body).

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `id` | `id: string;` |  |  |
| `type` | `type: BlockType;` |  |  |
| `props` | `props?: Record<string, unknown>;` | optional |  |
| `content` | `content?: InlineContent[];` | optional |  |
| `children` | `children?: Block[];` | optional |  |

### BlockEditorActions

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/BlockEditorActions

```ts
interface BlockEditorActions {
    getBlocks(): Block[];
    getBlock(id: string): Block | undefined;
    insertBlocks(blocks: readonly Block[], position?: BlockPosition): void;
    removeBlocks(ids: readonly string[]): void;
    updateBlock(id: string, patch: BlockPatch): void;
    moveBlock(id: string, position: BlockPosition): boolean;
    turnInto(id: string, type: BlockEditorTransformId): void;
    getSelection(): BlockEditorSelection | null;
    setSelection(selection: BlockEditorSelection): void;
    focus(): void;
    runCommand(id: string, ...args: unknown[]): boolean;
    getHtml(): string;
    print(): void;
}
```

`actionsRef`.

Members (13):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `getBlocks` | `getBlocks(): Block[];` |  | The current document. |
| `getBlock` | `getBlock(id: string): Block \| undefined;` |  |  |
| `insertBlocks` | `insertBlocks(blocks: readonly Block[], position?: BlockPosition): void;` |  |  |
| `removeBlocks` | `removeBlocks(ids: readonly string[]): void;` |  |  |
| `updateBlock` | `updateBlock(id: string, patch: BlockPatch): void;` |  |  |
| `moveBlock` | `moveBlock(id: string, position: BlockPosition): boolean;` |  | Returns false when cancelled by `onBeforeBlockMove` or not possible. |
| `turnInto` | `turnInto(id: string, type: BlockEditorTransformId): void;` |  |  |
| `getSelection` | `getSelection(): BlockEditorSelection \| null;` |  |  |
| `setSelection` | `setSelection(selection: BlockEditorSelection): void;` |  |  |
| `focus` | `focus(): void;` |  |  |
| `runCommand` | `runCommand(id: string, ...args: unknown[]): boolean;` |  | Runs a toolbar action or command by id (`bold`, `heading2`, `insertTable`, `undo`, `print`, ...). |
| `getHtml` | `getHtml(): string;` |  |  |
| `print` | `print(): void;` |  |  |

### BlockEditorBeforeBlockMoveEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/BlockEditorBeforeBlockMoveEvent

```ts
interface BlockEditorBeforeBlockMoveEvent extends BlockEditorBlockMoveEvent {
    preventDefault(): void;
    readonly defaultPrevented: boolean;
}
```

`onBeforeBlockMove`: `preventDefault()` cancels the move.

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `preventDefault` | `preventDefault(): void;` |  |  |
| `defaultPrevented` | `readonly defaultPrevented: boolean;` |  |  |
| `block` | `block: Block;` | inherited |  |
| `from` | `from: BlockEditorBlockLocation;` | inherited |  |
| `position` | `position: BlockPosition;` | inherited |  |
| `source` | `source: "api" \| "keyboard" \| "pointer";` | inherited |  |

### BlockEditorBeforePasteEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/BlockEditorBeforePasteEvent

```ts
interface BlockEditorBeforePasteEvent {
    readonly html: string;
    readonly text: string;
    readonly files: readonly File[];
    preventDefault(): void;
    readonly defaultPrevented: boolean;
}
```

`onBeforePaste`: `preventDefault()` cancels the paste.

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `html` | `readonly html: string;` |  |  |
| `text` | `readonly text: string;` |  |  |
| `files` | `readonly files: readonly File[];` |  |  |
| `preventDefault` | `preventDefault(): void;` |  |  |
| `defaultPrevented` | `readonly defaultPrevented: boolean;` |  |  |

### BlockEditorBlockChangeEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/BlockEditorBlockChangeEvent

```ts
interface BlockEditorBlockChangeEvent {
    readonly type: 'add' | 'update' | 'remove' | 'move';
    readonly block: Block;
}
```

`onBlockChange`.

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `readonly type: 'add' \| 'update' \| 'remove' \| 'move';` |  |  |
| `block` | `readonly block: Block;` |  |  |

### BlockEditorBlockLocation

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/BlockEditorBlockLocation

```ts
interface BlockEditorBlockLocation {
    readonly parentId: string | null;
    readonly index: number;
}
```

Where a block is: parent block id (null at the top level) and index among its siblings.

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `parentId` | `readonly parentId: string \| null;` |  |  |
| `index` | `readonly index: number;` |  |  |

### BlockEditorBlockMoveEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/BlockEditorBlockMoveEvent

```ts
interface BlockEditorBlockMoveEvent {
    readonly block: Block;
    readonly from: BlockEditorBlockLocation;
    readonly position: BlockPosition;
    readonly source: 'pointer' | 'keyboard' | 'api';
}
```

`onBlockMove`.

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `block` | `readonly block: Block;` |  |  |
| `from` | `readonly from: BlockEditorBlockLocation;` |  |  |
| `position` | `readonly position: BlockPosition;` |  |  |
| `source` | `readonly source: 'pointer' \| 'keyboard' \| 'api';` |  |  |

### BlockEditorCustomItem

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/BlockEditorCustomItem

```ts
interface BlockEditorCustomItem {
    readonly id: string;
    readonly label: string;
    readonly keywords?: readonly string[];
    readonly group?: string;
    readonly disabled?: boolean;
    readonly onSelect: (context: BlockEditorItemContext) => void;
}
```

A custom entry of the slash menu, block action menu, context menu or inline toolbar.

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `id` | `readonly id: string;` |  |  |
| `label` | `readonly label: string;` |  |  |
| `keywords` | `readonly keywords?: readonly string[];` | optional | Extra search words (slash menu). |
| `group` | `readonly group?: string;` | optional | Group heading in the slash menu (default: the built-in groups). |
| `disabled` | `readonly disabled?: boolean;` | optional |  |
| `onSelect` | `readonly onSelect: (context: BlockEditorItemContext) => void;` |  |  |

### BlockEditorItemContext

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/BlockEditorItemContext

```ts
interface BlockEditorItemContext {
    readonly block: Block | null;
    readonly actions: BlockEditorActions;
}
```

What a custom menu entry receives.

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `block` | `readonly block: Block \| null;` |  | The block the menu belongs to (the caret's block for the slash menu and toolbar). |
| `actions` | `readonly actions: BlockEditorActions;` |  |  |

### BlockEditorLabels

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/BlockEditorLabels

```ts
interface BlockEditorLabels<T = MentionItem & {
    readonly tone?: string;
}> {
    readonly trigger?: string;
    readonly items: MentionData<T>;
}
```

Labels: inserted as label atoms. An item's `tone` colors the label.

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `trigger` | `readonly trigger?: string;` | optional | Trigger (default `'#'`). |
| `items` | `readonly items: MentionData<T>;` |  |  |

### BlockEditorMentions

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/BlockEditorMentions

```ts
interface BlockEditorMentions<T = MentionItem> {
    readonly trigger?: string;
    readonly items: MentionData<T>;
}
```

Mentions through the contenteditable `Mention` target.

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `trigger` | `readonly trigger?: string;` | optional | Trigger (default `'@'`). |
| `items` | `readonly items: MentionData<T>;` |  |  |

### BlockEditorPasteEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/BlockEditorPasteEvent

```ts
interface BlockEditorPasteEvent {
    readonly html: string;
    readonly text: string;
    readonly blocks: Block[];
}
```

`onPaste`: after pasted content was applied.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `html` | `readonly html: string;` |  |  |
| `text` | `readonly text: string;` |  |  |
| `blocks` | `readonly blocks: Block[];` |  | The document after the paste. |

### BlockEditorProps

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/BlockEditorProps

```ts
interface BlockEditorProps {
    readonly value?: readonly Block[];
    readonly defaultValue?: readonly Block[];
    readonly onChange?: (blocks: Block[]) => void;
    readonly onBlockChange?: (event: BlockEditorBlockChangeEvent) => void;
    readonly onSelectionChange?: (selection: BlockEditorSelection | null) => void;
    readonly onFocus?: () => void;
    readonly onBlur?: () => void;
    readonly readOnly?: boolean;
    readonly placeholder?: string;
    readonly slashMenu?: false | readonly BlockEditorSlashItem[];
    readonly inlineToolbar?: false | readonly BlockEditorInlineToolbarItem[];
    readonly transforms?: readonly BlockEditorTransformId[];
    readonly blockActions?: readonly BlockEditorBlockAction[];
    readonly contextMenu?: false | readonly BlockEditorContextMenuItem[];
    readonly draggable?: boolean;
    readonly onBeforeBlockMove?: (event: BlockEditorBeforeBlockMoveEvent) => void;
    readonly onBlockMove?: (event: BlockEditorBlockMoveEvent) => void;
    readonly onUpload?: (file: File) => Promise<{
        readonly src: string;
        readonly alt?: string;
    }>;
    readonly codeLanguages?: readonly {
        readonly value: string;
        readonly label: string;
    }[];
    readonly highlight?: HighlightFn;
    readonly pasteCleanup?: Omit<PasteCleanupOptions, 'embedHosts' | 'sanitize'>;
    readonly onBeforePaste?: (event: BlockEditorBeforePasteEvent) => void;
    readonly onPaste?: (event: BlockEditorPasteEvent) => void;
    readonly undoLimit?: number;
    readonly keyBindings?: Readonly<Partial<Record<BlockEditorCommandId, string | false>>>;
    readonly mentions?: BlockEditorMentions;
    readonly labels?: BlockEditorLabels;
    readonly extensions?: readonly RichTextExtension[];
    readonly embedHosts?: readonly string[];
    readonly sanitize?: SanitizeHook;
    readonly localeText?: Partial<BlockEditorLocaleText>;
    readonly 'aria-label'?: string;
    readonly 'aria-labelledby'?: string;
    readonly id?: string;
    readonly className?: string;
    readonly style?: CSSProperties;
    readonly actionsRef?: Ref<BlockEditorActions | null>;
}
```

Members (37):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `value` | `readonly value?: readonly Block[];` | optional | Controlled document. Pass back what `onChange` gave to keep the editor in sync. |
| `defaultValue` | `readonly defaultValue?: readonly Block[];` | optional |  |
| `onChange` | `readonly onChange?: (blocks: Block[]) => void;` | optional |  |
| `onBlockChange` | `readonly onBlockChange?: (event: BlockEditorBlockChangeEvent) => void;` | optional |  |
| `onSelectionChange` | `readonly onSelectionChange?: (selection: BlockEditorSelection \| null) => void;` | optional |  |
| `onFocus` | `readonly onFocus?: () => void;` | optional |  |
| `onBlur` | `readonly onBlur?: () => void;` | optional |  |
| `readOnly` | `readonly readOnly?: boolean;` | optional |  |
| `placeholder` | `readonly placeholder?: string;` | optional | Shown in an empty document. |
| `slashMenu` | `readonly slashMenu?: false \| readonly BlockEditorSlashItem[];` | optional | Slash menu entries (default: every built-in); `false` turns the menu off. |
| `inlineToolbar` | `readonly inlineToolbar?: false \| readonly BlockEditorInlineToolbarItem[];` | optional | Selection toolbar entries (default bold, italic, underline, strike, code, link, turnInto); `false` hides it. |
| `transforms` | `readonly transforms?: readonly BlockEditorTransformId[];` | optional | Types offered by `'turnInto'` (default: all). |
| `blockActions` | `readonly blockActions?: readonly BlockEditorBlockAction[];` | optional | Block action menu entries (default duplicate, delete, moveUp, moveDown, turnInto). |
| `contextMenu` | `readonly contextMenu?: false \| readonly BlockEditorContextMenuItem[];` | optional | Context menu entries (default: all built-in); `false` keeps the browser menu. |
| `draggable` | `readonly draggable?: boolean;` | optional | Drag handles reorder and nest blocks (default true). |
| `onBeforeBlockMove` | `readonly onBeforeBlockMove?: (event: BlockEditorBeforeBlockMoveEvent) => void;` | optional |  |
| `onBlockMove` | `readonly onBlockMove?: (event: BlockEditorBlockMoveEvent) => void;` | optional |  |
| `onUpload` | `readonly onUpload?: (file: File) => Promise<{     readonly src: string;     readonly alt?: string; }>;` | optional | Uploads an image, audio or video file; the block is pending until it settles. Default: a blob URL. |
| `codeLanguages` | `readonly codeLanguages?: readonly {     readonly value: string;     readonly label: string; }[];` | optional | Code block languages. |
| `highlight` | `readonly highlight?: HighlightFn;` | optional | Code highlighting hook. |
| `pasteCleanup` | `readonly pasteCleanup?: Omit<PasteCleanupOptions, 'embedHosts' \| 'sanitize'>;` | optional | Paste cleanup. Default mode `'clean'`. |
| `onBeforePaste` | `readonly onBeforePaste?: (event: BlockEditorBeforePasteEvent) => void;` | optional |  |
| `onPaste` | `readonly onPaste?: (event: BlockEditorPasteEvent) => void;` | optional |  |
| `undoLimit` | `readonly undoLimit?: number;` | optional | Undo steps kept (default 30). |
| `keyBindings` | `readonly keyBindings?: Readonly<Partial<Record<BlockEditorCommandId, string \| false>>>;` | optional | Command id -> key chord (ProseMirror key names, `Mod-` = Ctrl/Cmd); `false` removes the default. |
| `mentions` | `readonly mentions?: BlockEditorMentions;` | optional |  |
| `labels` | `readonly labels?: BlockEditorLabels;` | optional |  |
| `extensions` | `readonly extensions?: readonly RichTextExtension[];` | optional | Engine extensions, for example `createCollaboration()` from `/collab`. Keep the array stable. |
| `embedHosts` | `readonly embedHosts?: readonly string[];` | optional | Hosts whose iframe embeds are kept by the sanitizer. |
| `sanitize` | `readonly sanitize?: SanitizeHook;` | optional | Further sanitizer restriction. Keep it stable. |
| `localeText` | `readonly localeText?: Partial<BlockEditorLocaleText>;` | optional |  |
| `aria-label` | `readonly 'aria-label'?: string;` | optional |  |
| `aria-labelledby` | `readonly 'aria-labelledby'?: string;` | optional |  |
| `id` | `readonly id?: string;` | optional |  |
| `className` | `readonly className?: string;` | optional |  |
| `style` | `readonly style?: CSSProperties;` | optional |  |
| `actionsRef` | `readonly actionsRef?: Ref<BlockEditorActions \| null>;` | optional |  |

### BlockEditorSelection

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/BlockEditorSelection

```ts
interface BlockEditorSelection {
    readonly blockId: string;
    readonly offset: number;
}
```

Caret position: the block and the character offset in its text.

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `blockId` | `readonly blockId: string;` |  |  |
| `offset` | `readonly offset: number;` |  |  |

### BlockPatch

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/BlockPatch

```ts
interface BlockPatch {
    type?: BlockType;
    props?: Record<string, unknown>;
    content?: InlineContent[];
    children?: Block[];
}
```

A partial update for updateBlock: `props` merge, the rest replaces.

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type?: BlockType;` | optional |  |
| `props` | `props?: Record<string, unknown>;` | optional |  |
| `content` | `content?: InlineContent[];` | optional |  |
| `children` | `children?: Block[];` | optional |  |

### ContentEditableMentionOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/ContentEditableMentionOptions

```ts
interface ContentEditableMentionOptions {
    readonly chipClassName?: string;
    readonly spacer?: string;
    readonly createChip?: (insertion: MentionEditorInsertion, doc: Document) => HTMLElement;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `chipClassName` | `readonly chipClassName?: string;` | optional | Class of the inserted chip (default `'salmon-mention-chip'`). |
| `spacer` | `readonly spacer?: string;` | optional | Text placed after a chip when the trigger has no `suffix`, so the caret has a place to sit (default a no-break space). |
| `createChip` | `readonly createChip?: (insertion: MentionEditorInsertion, doc: Document) => HTMLElement;` | optional | Builds the chip; the default is a `<span contenteditable="false">` with `data-mention-*` attributes. |

### EngineOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/EngineOptions

```ts
interface EngineOptions {
    readonly html?: string | undefined;
    readonly embedHosts?: readonly string[] | undefined;
    readonly extensions?: readonly RichTextExtension[] | undefined;
    readonly sanitize?: SanitizeHook | undefined;
    readonly undoLimit?: number | undefined;
    readonly undoGroupDelay?: number | undefined;
    readonly enterKey?: 'p' | 'div' | 'br' | undefined;
    readonly paragraphTag?: 'p' | 'div' | undefined;
    readonly shiftEnterKey?: 'p' | 'div' | 'br' | undefined;
    readonly tabKey?: 'indent' | 'focus' | undefined;
    readonly keyBindings?: RichTextKeyBindings | undefined;
    readonly placeholder?: (() => string | undefined) | undefined;
    readonly maxLength?: (() => number | undefined) | undefined;
    readonly highlight?: (() => HighlightFn | undefined) | undefined;
    readonly codeLanguages?: (() => readonly {
        readonly value: string;
        readonly label: string;
    }[] | undefined) | undefined;
    readonly suggestTriggers?: (() => readonly SuggestTrigger[]) | undefined;
    readonly onSuggestKey?: ((event: KeyboardEvent) => boolean) | undefined;
    readonly onAction?: ((id: string, args: readonly unknown[]) => boolean) | undefined;
    readonly onBeforeCommand?: ((command: string, args: readonly unknown[]) => boolean) | undefined;
    readonly onCommand?: ((command: string, args: readonly unknown[], applied: boolean) => void) | undefined;
    readonly upload?: (() => UploadHandler | undefined) | undefined;
    readonly imageInsert?: (() => 'base64' | 'blob') | undefined;
    readonly uploadLabel?: (() => string) | undefined;
    readonly onUploadError?: ((error: unknown, file: File) => void) | undefined;
    readonly pasteMode?: (() => PasteMode) | undefined;
    readonly cleanPaste?: ((html: string, mode: 'keep' | 'clean') => string) | undefined;
    readonly pastePrompt?: (() => Promise<'keep' | 'clean' | 'plainText' | null>) | undefined;
    readonly editable?: (() => boolean) | undefined;
    readonly attributes?: (() => Record<string, string>) | undefined;
}
```

Members (29):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `html` | `readonly html?: string \| undefined;` | optional |  |
| `embedHosts` | `readonly embedHosts?: readonly string[] \| undefined;` | optional |  |
| `extensions` | `readonly extensions?: readonly RichTextExtension[] \| undefined;` | optional |  |
| `sanitize` | `readonly sanitize?: SanitizeHook \| undefined;` | optional | Extends the always-on sanitizer applied before parsing and to getHtml output. |
| `undoLimit` | `readonly undoLimit?: number \| undefined;` | optional |  |
| `undoGroupDelay` | `readonly undoGroupDelay?: number \| undefined;` | optional |  |
| `enterKey` | `readonly enterKey?: 'p' \| 'div' \| 'br' \| undefined;` | optional |  |
| `paragraphTag` | `readonly paragraphTag?: 'p' \| 'div' \| undefined;` | optional | Paragraphs are written as `<div>` in getHtml (`enterKey: 'div'`); `<div>` parses back to a paragraph. |
| `shiftEnterKey` | `readonly shiftEnterKey?: 'p' \| 'div' \| 'br' \| undefined;` | optional |  |
| `tabKey` | `readonly tabKey?: 'indent' \| 'focus' \| undefined;` | optional |  |
| `keyBindings` | `readonly keyBindings?: RichTextKeyBindings \| undefined;` | optional |  |
| `placeholder` | `readonly placeholder?: (() => string \| undefined) \| undefined;` | optional |  |
| `maxLength` | `readonly maxLength?: (() => number \| undefined) \| undefined;` | optional |  |
| `highlight` | `readonly highlight?: (() => HighlightFn \| undefined) \| undefined;` | optional |  |
| `codeLanguages` | `readonly codeLanguages?: (() => readonly {     readonly value: string;     readonly label: string; }[] \| undefined) \| undefined;` | optional |  |
| `suggestTriggers` | `readonly suggestTriggers?: (() => readonly SuggestTrigger[]) \| undefined;` | optional |  |
| `onSuggestKey` | `readonly onSuggestKey?: ((event: KeyboardEvent) => boolean) \| undefined;` | optional |  |
| `onAction` | `readonly onAction?: ((id: string, args: readonly unknown[]) => boolean) \| undefined;` | optional | UI actions (dialogs, fullscreen, source view) reached from key bindings and `run`. |
| `onBeforeCommand` | `readonly onBeforeCommand?: ((command: string, args: readonly unknown[]) => boolean) \| undefined;` | optional | Return false to cancel a command (`onBeforeCommand`). |
| `onCommand` | `readonly onCommand?: ((command: string, args: readonly unknown[], applied: boolean) => void) \| undefined;` | optional |  |
| `upload` | `readonly upload?: (() => UploadHandler \| undefined) \| undefined;` | optional |  |
| `imageInsert` | `readonly imageInsert?: (() => 'base64' \| 'blob') \| undefined;` | optional |  |
| `uploadLabel` | `readonly uploadLabel?: (() => string) \| undefined;` | optional |  |
| `onUploadError` | `readonly onUploadError?: ((error: unknown, file: File) => void) \| undefined;` | optional |  |
| `pasteMode` | `readonly pasteMode?: (() => PasteMode) \| undefined;` | optional |  |
| `cleanPaste` | `readonly cleanPaste?: ((html: string, mode: 'keep' \| 'clean') => string) \| undefined;` | optional | Paste cleanup: returns the HTML to parse for `keep` or `clean`. |
| `pastePrompt` | `readonly pastePrompt?: (() => Promise<'keep' \| 'clean' \| 'plainText' \| null>) \| undefined;` | optional |  |
| `editable` | `readonly editable?: (() => boolean) \| undefined;` | optional |  |
| `attributes` | `readonly attributes?: (() => Record<string, string>) \| undefined;` | optional |  |

### HighlightRange

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/HighlightRange

```ts
interface HighlightRange {
    readonly from: number;
    readonly to: number;
    readonly className: string;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `from` | `readonly from: number;` |  |  |
| `to` | `readonly to: number;` |  |  |
| `className` | `readonly className: string;` |  |  |

### HtmlComment

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/HtmlComment

```ts
interface HtmlComment {
    type: 'comment';
    value: string;
}
```

A comment (`<!-- -->` or a bogus comment such as `<![if ...]>`).

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'comment';` |  |  |
| `value` | `value: string;` |  |  |

### HtmlElement

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/HtmlElement

```ts
interface HtmlElement {
    type: 'element';
    tag: string;
    attrs: Record<string, string>;
    children: HtmlNode[];
}
```

An element of a parsed HTML fragment. Tag and attribute names are lowercase.

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'element';` |  |  |
| `tag` | `tag: string;` |  |  |
| `attrs` | `attrs: Record<string, string>;` |  |  |
| `children` | `children: HtmlNode[];` |  |  |

### HtmlText

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/HtmlText

```ts
interface HtmlText {
    type: 'text';
    value: string;
}
```

A text node; `value` is decoded text (never markup).

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'text';` |  |  |
| `value` | `value: string;` |  |  |

### HtmlToTextOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/HtmlToTextOptions

```ts
interface HtmlToTextOptions {
    blockSeparator?: string;
}
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `blockSeparator` | `blockSeparator?: string;` | optional | Inserted between blocks (paragraphs, headings, list items, rows). Default `'\n'`. |

### InlineHardBreak

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/InlineHardBreak

```ts
interface InlineHardBreak {
    type: 'hardBreak';
}
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'hardBreak';` |  |  |

### InlineLabel

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/InlineLabel

```ts
interface InlineLabel {
    type: 'label';
    id: string;
    label: string;
    trigger: string;
    tone?: string;
}
```

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'label';` |  |  |
| `id` | `id: string;` |  |  |
| `label` | `label: string;` |  |  |
| `trigger` | `trigger: string;` |  |  |
| `tone` | `tone?: string;` | optional |  |

### InlineLink

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/InlineLink

```ts
interface InlineLink {
    type: 'link';
    href: string;
    target?: '_blank';
    content: InlineText[];
}
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'link';` |  |  |
| `href` | `href: string;` |  |  |
| `target` | `target?: '_blank';` | optional |  |
| `content` | `content: InlineText[];` |  |  |

### InlineMention

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/InlineMention

```ts
interface InlineMention {
    type: 'mention';
    id: string;
    label: string;
    trigger: string;
}
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'mention';` |  |  |
| `id` | `id: string;` |  |  |
| `label` | `label: string;` |  |  |
| `trigger` | `trigger: string;` |  |  |

### InlineText

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/InlineText

```ts
interface InlineText {
    type: 'text';
    text: string;
    marks?: InlineMark[];
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type: 'text';` |  |  |
| `text` | `text: string;` |  |  |
| `marks` | `marks?: InlineMark[];` | optional |  |

### PasteCleanupOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/PasteCleanupOptions

```ts
interface PasteCleanupOptions {
    mode?: PasteCleanupMode;
    allowedTags?: readonly string[];
    deniedTags?: readonly string[];
    allowedAttributes?: readonly string[];
    deniedAttributes?: readonly string[];
    keepWordFormatting?: boolean;
    embedHosts?: readonly string[];
    sanitize?: SanitizeHook;
    allow?: SanitizeAllow | readonly SanitizeAllow[];
}
```

Members (9):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `mode` | `mode?: PasteCleanupMode;` | optional | `'keep'`: keep all formatting the vocabulary allows (fonts, sizes, colors, alignment); `'clean'` (default): keep structure, marks and links, drop presentational styles; `'plainText'`: text only, paragraphs and line breaks kept; `'prompt'`: the editor asks; here it behaves as `'clean'`. |
| `allowedTags` | `allowedTags?: readonly string[];` | optional | Only these elements survive (others are unwrapped, text kept). Vocabulary names (`strong`, not `b`). |
| `deniedTags` | `deniedTags?: readonly string[];` | optional | These elements are unwrapped (text kept). |
| `allowedAttributes` | `allowedAttributes?: readonly string[];` | optional | Only these attributes survive (`style` counts as one). |
| `deniedAttributes` | `deniedAttributes?: readonly string[];` | optional | These attributes are removed. |
| `keepWordFormatting` | `keepWordFormatting?: boolean;` | optional | In `'clean'` mode, keep the inline formatting of Word and Google Docs content. Default false. |
| `embedHosts` | `embedHosts?: readonly string[];` | optional | Passed to the sanitizer (see `SanitizeHtmlOptions`). |
| `sanitize` | `sanitize?: SanitizeHook;` | optional | Passed to the sanitizer, after the paste filters. |
| `allow` | `allow?: SanitizeAllow \| readonly SanitizeAllow[];` | optional | Passed to the sanitizer: extension elements and attributes. |

### RichTextAiAssistant

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/RichTextAiAssistant

```ts
interface RichTextAiAssistant {
    readonly onRequest: (request: RichTextAiRequest) => Promise<string> | AsyncIterable<string>;
}
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `onRequest` | `readonly onRequest: (request: RichTextAiRequest) => Promise<string> \| AsyncIterable<string>;` |  | Text (plain, inserted as paragraphs) as a whole or streamed in chunks. |

### RichTextAiRequest

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/RichTextAiRequest

```ts
interface RichTextAiRequest {
    readonly prompt: string;
    readonly selectionHtml: string;
    readonly signal: AbortSignal;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `prompt` | `readonly prompt: string;` |  |  |
| `selectionHtml` | `readonly selectionHtml: string;` |  | The selected content as HTML ('' when the selection is empty). |
| `signal` | `readonly signal: AbortSignal;` |  |  |

### RichTextBeforeCommandEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/RichTextBeforeCommandEvent

```ts
interface RichTextBeforeCommandEvent {
    readonly command: string;
    readonly args: readonly unknown[];
    preventDefault(): void;
    readonly defaultPrevented: boolean;
}
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `command` | `readonly command: string;` |  |  |
| `args` | `readonly args: readonly unknown[];` |  |  |
| `preventDefault` | `preventDefault(): void;` |  |  |
| `defaultPrevented` | `readonly defaultPrevented: boolean;` |  |  |

### RichTextBeforeDialogOpenEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/RichTextBeforeDialogOpenEvent

```ts
interface RichTextBeforeDialogOpenEvent {
    readonly dialog: RichTextDialogId;
    preventDefault(): void;
    readonly defaultPrevented: boolean;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `dialog` | `readonly dialog: RichTextDialogId;` |  |  |
| `preventDefault` | `preventDefault(): void;` |  |  |
| `defaultPrevented` | `readonly defaultPrevented: boolean;` |  |  |

### RichTextBeforePopupOpenEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/RichTextBeforePopupOpenEvent

```ts
interface RichTextBeforePopupOpenEvent {
    readonly popup: RichTextPopupId;
    preventDefault(): void;
    readonly defaultPrevented: boolean;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `popup` | `readonly popup: RichTextPopupId;` |  |  |
| `preventDefault` | `preventDefault(): void;` |  |  |
| `defaultPrevented` | `readonly defaultPrevented: boolean;` |  |  |

### RichTextCommandEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/RichTextCommandEvent

```ts
interface RichTextCommandEvent {
    readonly command: string;
    readonly args: readonly unknown[];
    readonly applied: boolean;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `command` | `readonly command: string;` |  |  |
| `args` | `readonly args: readonly unknown[];` |  |  |
| `applied` | `readonly applied: boolean;` |  |  |

### RichTextCommands

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/RichTextCommands

```ts
interface RichTextCommands {
    bold(): boolean;
    italic(): boolean;
    underline(): boolean;
    strike(): boolean;
    subscript(): boolean;
    superscript(): boolean;
    code(): boolean;
    uppercase(): boolean;
    lowercase(): boolean;
    fontFamily(value: string | null): boolean;
    fontSize(value: string | null): boolean;
    color(value: string | null): boolean;
    backgroundColor(value: string | null): boolean;
    paragraph(): boolean;
    heading(level: 1 | 2 | 3 | 4 | 5 | 6): boolean;
    blockquote(): boolean;
    codeBlock(language?: string | null): boolean;
    setCodeLanguage(language: string | null): boolean;
    textAlign(align: RichTextTextAlign | null): boolean;
    lineHeight(value: string | null): boolean;
    indent(): boolean;
    outdent(): boolean;
    bulletList(style?: RichTextBulletStyle | null): boolean;
    orderedList(style?: RichTextOrderedStyle | null): boolean;
    taskList(): boolean;
    toggleTask(): boolean;
    horizontalRule(): boolean;
    clearFormat(): boolean;
    setLink(link: RichTextLinkInput): boolean;
    unsetLink(): boolean;
    insertImage(image: RichTextImageInput): boolean;
    updateImage(image: Partial<RichTextImageInput>): boolean;
    insertAudio(media: RichTextMediaInput): boolean;
    insertVideo(media: RichTextMediaInput): boolean;
    insertEmbed(media: RichTextMediaInput): boolean;
    deleteNode(): boolean;
    insertTable(size: {
        readonly rows: number;
        readonly cols: number;
        readonly headerRow?: boolean | undefined;
    }): boolean;
    addRowBefore(): boolean;
    addRowAfter(): boolean;
    deleteRow(): boolean;
    addColumnBefore(): boolean;
    addColumnAfter(): boolean;
    deleteColumn(): boolean;
    mergeCells(): boolean;
    splitCell(): boolean;
    toggleHeaderRow(): boolean;
    setTableStyle(style: RichTextTableStyle | null): boolean;
    deleteTable(): boolean;
    insertText(text: string): boolean;
    insertHtml(html: string, options?: {
        readonly blocks?: boolean;
    }): boolean;
    selectAll(): boolean;
    undo(): boolean;
    redo(): boolean;
    find(query: string, options?: RichTextFindOptions): number;
    findNext(): boolean;
    findPrevious(): boolean;
    replace(text: string): boolean;
    replaceAll(text: string): number;
    clearFind(): boolean;
    copyFormat(sticky?: boolean): boolean;
    applyFormat(): boolean;
    cancelFormatPainter(): boolean;
}
```

Typed commands (`actionsRef.current.commands`); each returns whether it applied.

Members (62):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `bold` | `bold(): boolean;` |  |  |
| `italic` | `italic(): boolean;` |  |  |
| `underline` | `underline(): boolean;` |  |  |
| `strike` | `strike(): boolean;` |  |  |
| `subscript` | `subscript(): boolean;` |  |  |
| `superscript` | `superscript(): boolean;` |  |  |
| `code` | `code(): boolean;` |  |  |
| `uppercase` | `uppercase(): boolean;` |  |  |
| `lowercase` | `lowercase(): boolean;` |  |  |
| `fontFamily` | `fontFamily(value: string \| null): boolean;` |  |  |
| `fontSize` | `fontSize(value: string \| null): boolean;` |  |  |
| `color` | `color(value: string \| null): boolean;` |  |  |
| `backgroundColor` | `backgroundColor(value: string \| null): boolean;` |  |  |
| `paragraph` | `paragraph(): boolean;` |  |  |
| `heading` | `heading(level: 1 \| 2 \| 3 \| 4 \| 5 \| 6): boolean;` |  |  |
| `blockquote` | `blockquote(): boolean;` |  |  |
| `codeBlock` | `codeBlock(language?: string \| null): boolean;` |  |  |
| `setCodeLanguage` | `setCodeLanguage(language: string \| null): boolean;` |  |  |
| `textAlign` | `textAlign(align: RichTextTextAlign \| null): boolean;` |  |  |
| `lineHeight` | `lineHeight(value: string \| null): boolean;` |  |  |
| `indent` | `indent(): boolean;` |  |  |
| `outdent` | `outdent(): boolean;` |  |  |
| `bulletList` | `bulletList(style?: RichTextBulletStyle \| null): boolean;` |  |  |
| `orderedList` | `orderedList(style?: RichTextOrderedStyle \| null): boolean;` |  |  |
| `taskList` | `taskList(): boolean;` |  |  |
| `toggleTask` | `toggleTask(): boolean;` |  |  |
| `horizontalRule` | `horizontalRule(): boolean;` |  |  |
| `clearFormat` | `clearFormat(): boolean;` |  |  |
| `setLink` | `setLink(link: RichTextLinkInput): boolean;` |  |  |
| `unsetLink` | `unsetLink(): boolean;` |  |  |
| `insertImage` | `insertImage(image: RichTextImageInput): boolean;` |  |  |
| `updateImage` | `updateImage(image: Partial<RichTextImageInput>): boolean;` |  |  |
| `insertAudio` | `insertAudio(media: RichTextMediaInput): boolean;` |  |  |
| `insertVideo` | `insertVideo(media: RichTextMediaInput): boolean;` |  |  |
| `insertEmbed` | `insertEmbed(media: RichTextMediaInput): boolean;` |  |  |
| `deleteNode` | `deleteNode(): boolean;` |  |  |
| `insertTable` | `insertTable(size: {     readonly rows: number;     readonly cols: number;     readonly headerRow?: boolean \| undefined; }): boolean;` |  |  |
| `addRowBefore` | `addRowBefore(): boolean;` |  |  |
| `addRowAfter` | `addRowAfter(): boolean;` |  |  |
| `deleteRow` | `deleteRow(): boolean;` |  |  |
| `addColumnBefore` | `addColumnBefore(): boolean;` |  |  |
| `addColumnAfter` | `addColumnAfter(): boolean;` |  |  |
| `deleteColumn` | `deleteColumn(): boolean;` |  |  |
| `mergeCells` | `mergeCells(): boolean;` |  |  |
| `splitCell` | `splitCell(): boolean;` |  |  |
| `toggleHeaderRow` | `toggleHeaderRow(): boolean;` |  |  |
| `setTableStyle` | `setTableStyle(style: RichTextTableStyle \| null): boolean;` |  |  |
| `deleteTable` | `deleteTable(): boolean;` |  |  |
| `insertText` | `insertText(text: string): boolean;` |  |  |
| `insertHtml` | `insertHtml(html: string, options?: {     readonly blocks?: boolean; }): boolean;` |  | Sanitized and parsed through the schema, replacing the selection like a paste; `{ blocks: true }` inserts whole blocks after splitting the current one (imports). |
| `selectAll` | `selectAll(): boolean;` |  |  |
| `undo` | `undo(): boolean;` |  |  |
| `redo` | `redo(): boolean;` |  |  |
| `find` | `find(query: string, options?: RichTextFindOptions): number;` |  | Highlights matches and selects the first; returns the match count. |
| `findNext` | `findNext(): boolean;` |  |  |
| `findPrevious` | `findPrevious(): boolean;` |  |  |
| `replace` | `replace(text: string): boolean;` |  | Replaces the current match and moves to the next. |
| `replaceAll` | `replaceAll(text: string): number;` |  | Returns the number of replaced matches. |
| `clearFind` | `clearFind(): boolean;` |  |  |
| `copyFormat` | `copyFormat(sticky?: boolean): boolean;` |  | Format painter: copy the format at the selection (`sticky` keeps applying until `cancelFormatPainter`). |
| `applyFormat` | `applyFormat(): boolean;` |  |  |
| `cancelFormatPainter` | `cancelFormatPainter(): boolean;` |  |  |

### RichTextContentProps

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/RichTextContentProps

```ts
interface RichTextContentProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'dangerouslySetInnerHTML'> {
    value?: string;
    blocks?: readonly Block[];
    embedHosts?: readonly string[];
    sanitize?: SanitizeHook;
    className?: string;
    style?: CSSProperties;
    ref?: Ref<HTMLDivElement>;
}
```

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `value` | `value?: string;` | optional | Stored HTML (for example a RichTextEditor value). Sanitized before rendering. |
| `blocks` | `blocks?: readonly Block[];` | optional | BlockEditor blocks; rendered through `blocksToHtml` when `value` is not given. |
| `embedHosts` | `embedHosts?: readonly string[];` | optional | Hostnames whose iframe embeds are kept (see `SanitizeHtmlOptions.embedHosts`). |
| `sanitize` | `sanitize?: SanitizeHook;` | optional | Further sanitizer restriction (see `SanitizeHook`); keep it stable (module scope or memoized). |
| `className` | `className?: string;` | optional |  |
| `style` | `style?: CSSProperties;` | optional |  |
| `ref` | `ref?: Ref<HTMLDivElement>;` | optional |  |

### RichTextEditorActions

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/RichTextEditorActions

```ts
interface RichTextEditorActions {
    readonly commands: RichTextCommands;
    run(id: string, ...args: unknown[]): unknown;
    getHtml(options?: {
        readonly xhtml?: boolean;
    }): string;
    getText(): string;
    getSelection(): RichTextSelection;
    setSelection(anchor: number, head?: number): void;
    focus(): void;
    clearHistory(): void;
    openDialog(id: RichTextDialogId): void;
    closeDialog(): void;
    insertFiles(files: readonly File[]): Promise<void>;
    readonly engine: RichTextEngine;
}
```

`actionsRef.current` once the engine is mounted.

Members (12):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `commands` | `readonly commands: RichTextCommands;` |  |  |
| `run` | `run(id: string, ...args: unknown[]): unknown;` |  | Runs a command, alias, extension command or UI action by id. |
| `getHtml` | `getHtml(options?: {     readonly xhtml?: boolean; }): string;` |  |  |
| `getText` | `getText(): string;` |  |  |
| `getSelection` | `getSelection(): RichTextSelection;` |  |  |
| `setSelection` | `setSelection(anchor: number, head?: number): void;` |  |  |
| `focus` | `focus(): void;` |  |  |
| `clearHistory` | `clearHistory(): void;` |  |  |
| `openDialog` | `openDialog(id: RichTextDialogId): void;` |  |  |
| `closeDialog` | `closeDialog(): void;` |  |  |
| `insertFiles` | `insertFiles(files: readonly File[]): Promise<void>;` |  | Inserts files through `onUpload` (or `imageInsert`) as on paste and drop. |
| `engine` | `readonly engine: RichTextEngine;` |  | The headless engine. |

### RichTextEditorProps

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/RichTextEditorProps

```ts
interface RichTextEditorProps<TMention = MentionItem> {
    readonly value?: string;
    readonly defaultValue?: string;
    readonly onChange?: (html: string) => void;
    readonly changeDelay?: number;
    readonly onBlur?: (html: string) => void;
    readonly onFocus?: () => void;
    readonly toolbar?: readonly RichTextToolbarItem[] | 'floating' | false;
    readonly toolbarOverflow?: 'menu' | 'scroll' | 'wrap';
    readonly toolbarPosition?: 'top' | 'bottom';
    readonly stickyToolbar?: boolean;
    readonly quickToolbars?: RichTextQuickToolbars | false;
    readonly fontFamilies?: readonly {
        readonly label: string;
        readonly value: string;
    }[];
    readonly fontSizes?: readonly string[];
    readonly colors?: readonly {
        readonly label: string;
        readonly value: string;
    }[];
    readonly onUpload?: UploadHandler;
    readonly imageInsert?: 'base64' | 'blob';
    readonly onUploadError?: (error: unknown, file: File) => void;
    readonly embedHosts?: readonly string[];
    readonly codeLanguages?: readonly (string | {
        readonly value: string;
        readonly label: string;
    })[];
    readonly highlight?: HighlightFn;
    readonly pasteCleanup?: RichTextPasteCleanup;
    readonly sanitize?: SanitizeHook;
    readonly onImport?: (file: File) => Promise<string>;
    readonly importAccept?: string;
    readonly onBrowseFiles?: (kind: 'image' | 'audio' | 'video') => Promise<{
        readonly src: string;
        readonly alt?: string;
    } | null>;
    readonly aiAssistant?: RichTextAiAssistant;
    readonly emojiList?: readonly RichTextEmoji[];
    readonly slashMenu?: boolean | readonly RichTextSlashItem[];
    readonly mentions?: RichTextMentions<TMention>;
    readonly undoLimit?: number;
    readonly undoGroupDelay?: number;
    readonly showCount?: boolean;
    readonly maxLength?: number;
    readonly resizable?: boolean;
    readonly fullscreen?: boolean;
    readonly defaultFullscreen?: boolean;
    readonly onFullscreenChange?: (fullscreen: boolean) => void;
    readonly enterKey?: 'p' | 'div' | 'br';
    readonly shiftEnterKey?: 'p' | 'div' | 'br';
    readonly tabKey?: 'indent' | 'focus';
    readonly keyBindings?: RichTextKeyBindings;
    readonly extensions?: readonly RichTextExtension[];
    readonly placeholder?: string;
    readonly readOnly?: boolean;
    readonly disabled?: boolean;
    readonly name?: string;
    readonly required?: boolean;
    readonly invalid?: boolean;
    readonly localeText?: Partial<RichTextEditorLocaleText>;
    readonly actionsRef?: RefObject<RichTextEditorActions | null> | Ref<RichTextEditorActions>;
    readonly onReady?: (actions: RichTextEditorActions) => void;
    readonly onBeforeCommand?: (event: RichTextBeforeCommandEvent) => void;
    readonly onCommand?: (event: RichTextCommandEvent) => void;
    readonly onToolbarItemClick?: (event: RichTextToolbarItemClickEvent) => void;
    readonly onBeforeDialogOpen?: (event: RichTextBeforeDialogOpenEvent) => void;
    readonly onDialogClose?: (event: {
        readonly dialog: RichTextDialogId;
    }) => void;
    readonly onBeforePopupOpen?: (event: RichTextBeforePopupOpenEvent) => void;
    readonly onToolbarStateChange?: (state: RichTextToolbarState) => void;
    readonly id?: string;
    readonly 'aria-label'?: string;
    readonly 'aria-labelledby'?: string;
    readonly 'aria-describedby'?: string;
    readonly className?: string;
    readonly style?: CSSProperties;
}
```

`TMention` is the item type of `mentions` (its `renderItem` receives it).

Members (64):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `value` | `readonly value?: string;` | optional |  |
| `defaultValue` | `readonly defaultValue?: string;` | optional |  |
| `onChange` | `readonly onChange?: (html: string) => void;` | optional | The HTML value after a transaction batch (`changeDelay` ms, default 0: once per batch). |
| `changeDelay` | `readonly changeDelay?: number;` | optional |  |
| `onBlur` | `readonly onBlur?: (html: string) => void;` | optional |  |
| `onFocus` | `readonly onFocus?: () => void;` | optional |  |
| `toolbar` | `readonly toolbar?: readonly RichTextToolbarItem[] \| 'floating' \| false;` | optional |  |
| `toolbarOverflow` | `readonly toolbarOverflow?: 'menu' \| 'scroll' \| 'wrap';` | optional |  |
| `toolbarPosition` | `readonly toolbarPosition?: 'top' \| 'bottom';` | optional |  |
| `stickyToolbar` | `readonly stickyToolbar?: boolean;` | optional |  |
| `quickToolbars` | `readonly quickToolbars?: RichTextQuickToolbars \| false;` | optional |  |
| `fontFamilies` | `readonly fontFamilies?: readonly {     readonly label: string;     readonly value: string; }[];` | optional |  |
| `fontSizes` | `readonly fontSizes?: readonly string[];` | optional |  |
| `colors` | `readonly colors?: readonly {     readonly label: string;     readonly value: string; }[];` | optional |  |
| `onUpload` | `readonly onUpload?: UploadHandler;` | optional | Image, audio and video upload (pending until the promise settles). |
| `imageInsert` | `readonly imageInsert?: 'base64' \| 'blob';` | optional | Without `onUpload`: inline images as data URLs or object URLs (default `'blob'`). |
| `onUploadError` | `readonly onUploadError?: (error: unknown, file: File) => void;` | optional |  |
| `embedHosts` | `readonly embedHosts?: readonly string[];` | optional |  |
| `codeLanguages` | `readonly codeLanguages?: readonly (string \| {     readonly value: string;     readonly label: string; })[];` | optional |  |
| `highlight` | `readonly highlight?: HighlightFn;` | optional |  |
| `pasteCleanup` | `readonly pasteCleanup?: RichTextPasteCleanup;` | optional |  |
| `sanitize` | `readonly sanitize?: SanitizeHook;` | optional |  |
| `onImport` | `readonly onImport?: (file: File) => Promise<string>;` | optional |  |
| `importAccept` | `readonly importAccept?: string;` | optional |  |
| `onBrowseFiles` | `readonly onBrowseFiles?: (kind: 'image' \| 'audio' \| 'video') => Promise<{     readonly src: string;     readonly alt?: string; } \| null>;` | optional |  |
| `aiAssistant` | `readonly aiAssistant?: RichTextAiAssistant;` | optional |  |
| `emojiList` | `readonly emojiList?: readonly RichTextEmoji[];` | optional |  |
| `slashMenu` | `readonly slashMenu?: boolean \| readonly RichTextSlashItem[];` | optional |  |
| `mentions` | `readonly mentions?: RichTextMentions<TMention>;` | optional |  |
| `undoLimit` | `readonly undoLimit?: number;` | optional |  |
| `undoGroupDelay` | `readonly undoGroupDelay?: number;` | optional |  |
| `showCount` | `readonly showCount?: boolean;` | optional |  |
| `maxLength` | `readonly maxLength?: number;` | optional |  |
| `resizable` | `readonly resizable?: boolean;` | optional |  |
| `fullscreen` | `readonly fullscreen?: boolean;` | optional |  |
| `defaultFullscreen` | `readonly defaultFullscreen?: boolean;` | optional |  |
| `onFullscreenChange` | `readonly onFullscreenChange?: (fullscreen: boolean) => void;` | optional |  |
| `enterKey` | `readonly enterKey?: 'p' \| 'div' \| 'br';` | optional |  |
| `shiftEnterKey` | `readonly shiftEnterKey?: 'p' \| 'div' \| 'br';` | optional |  |
| `tabKey` | `readonly tabKey?: 'indent' \| 'focus';` | optional |  |
| `keyBindings` | `readonly keyBindings?: RichTextKeyBindings;` | optional |  |
| `extensions` | `readonly extensions?: readonly RichTextExtension[];` | optional |  |
| `placeholder` | `readonly placeholder?: string;` | optional |  |
| `readOnly` | `readonly readOnly?: boolean;` | optional |  |
| `disabled` | `readonly disabled?: boolean;` | optional |  |
| `name` | `readonly name?: string;` | optional |  |
| `required` | `readonly required?: boolean;` | optional |  |
| `invalid` | `readonly invalid?: boolean;` | optional |  |
| `localeText` | `readonly localeText?: Partial<RichTextEditorLocaleText>;` | optional |  |
| `actionsRef` | `readonly actionsRef?: RefObject<RichTextEditorActions \| null> \| Ref<RichTextEditorActions>;` | optional |  |
| `onReady` | `readonly onReady?: (actions: RichTextEditorActions) => void;` | optional |  |
| `onBeforeCommand` | `readonly onBeforeCommand?: (event: RichTextBeforeCommandEvent) => void;` | optional |  |
| `onCommand` | `readonly onCommand?: (event: RichTextCommandEvent) => void;` | optional |  |
| `onToolbarItemClick` | `readonly onToolbarItemClick?: (event: RichTextToolbarItemClickEvent) => void;` | optional |  |
| `onBeforeDialogOpen` | `readonly onBeforeDialogOpen?: (event: RichTextBeforeDialogOpenEvent) => void;` | optional |  |
| `onDialogClose` | `readonly onDialogClose?: (event: {     readonly dialog: RichTextDialogId; }) => void;` | optional |  |
| `onBeforePopupOpen` | `readonly onBeforePopupOpen?: (event: RichTextBeforePopupOpenEvent) => void;` | optional |  |
| `onToolbarStateChange` | `readonly onToolbarStateChange?: (state: RichTextToolbarState) => void;` | optional |  |
| `id` | `readonly id?: string;` | optional |  |
| `aria-label` | `readonly 'aria-label'?: string;` | optional |  |
| `aria-labelledby` | `readonly 'aria-labelledby'?: string;` | optional |  |
| `aria-describedby` | `readonly 'aria-describedby'?: string;` | optional |  |
| `className` | `readonly className?: string;` | optional |  |
| `style` | `readonly style?: CSSProperties;` | optional |  |

### RichTextEmoji

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/RichTextEmoji

```ts
interface RichTextEmoji {
    readonly emoji: string;
    readonly name: string;
    readonly keywords?: readonly string[];
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `emoji` | `readonly emoji: string;` |  |  |
| `name` | `readonly name: string;` |  |  |
| `keywords` | `readonly keywords?: readonly string[];` | optional |  |

### RichTextExtension

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/RichTextExtension

```ts
interface RichTextExtension {
    readonly name: string;
    readonly nodes?: Readonly<Record<string, NodeSpec>>;
    readonly marks?: Readonly<Record<string, MarkSpec>>;
    readonly plugins?: (context: RichTextExtensionContext) => readonly Plugin[] | Promise<readonly Plugin[]>;
    readonly keyBindings?: Readonly<Record<string, string | Command>>;
    readonly inputRules?: (schema: Schema) => readonly InputRule[];
    readonly commands?: Readonly<Record<string, (...args: never[]) => Command>>;
    readonly toolbarItems?: readonly RichTextExtensionToolbarItem[];
    readonly html?: {
        readonly tags?: readonly string[];
        readonly attributes?: Readonly<Record<string, readonly string[]>>;
    };
    readonly replacesHistory?: boolean;
    readonly history?: {
        readonly undo: Command;
        readonly redo: Command;
    };
}
```

An editor extension: schema nodes and marks, ProseMirror plugins
(a factory may be async, for example the `/collab` Yjs binding), key
bindings, input rules, commands and toolbar items. Keep the array stable.

Members (11):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `name` | `readonly name: string;` |  |  |
| `nodes` | `readonly nodes?: Readonly<Record<string, NodeSpec>>;` | optional |  |
| `marks` | `readonly marks?: Readonly<Record<string, MarkSpec>>;` | optional |  |
| `plugins` | `readonly plugins?: (context: RichTextExtensionContext) => readonly Plugin[] \| Promise<readonly Plugin[]>;` | optional |  |
| `keyBindings` | `readonly keyBindings?: Readonly<Record<string, string \| Command>>;` | optional | Key -> command id or ProseMirror command, before the built-in table (ProseMirror key names, `Mod-` for Ctrl/Cmd). |
| `inputRules` | `readonly inputRules?: (schema: Schema) => readonly InputRule[];` | optional |  |
| `commands` | `readonly commands?: Readonly<Record<string, (...args: never[]) => Command>>;` | optional | Command id -> factory of a ProseMirror command; run with `actionsRef.current.run(id, ...args)`. |
| `toolbarItems` | `readonly toolbarItems?: readonly RichTextExtensionToolbarItem[];` | optional |  |
| `html` | `readonly html?: {     readonly tags?: readonly string[];     readonly attributes?: Readonly<Record<string, readonly string[]>>; };` | optional | Elements and attributes the extension's nodes and marks write, added to the always-on sanitizer for value in, paste and HTML out. Active content (script, style, iframe, object, embed, forms), `on*` handlers, `style` and URL attributes other than href / cite / src / poster are never allowed; those four are checked by the URL rules. |
| `replacesHistory` | `readonly replacesHistory?: boolean;` | optional | Turns off history in the engine (the Yjs undo manager replaces it). |
| `history` | `readonly history?: {     readonly undo: Command;     readonly redo: Command; };` | optional | The undo and redo that replace the engine's (with `replacesHistory`): `commands.undo` / `redo`, the toolbar and its enabled state use them. Called without `dispatch` they answer whether a step is available. |

### RichTextExtensionContext

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/RichTextExtensionContext

```ts
interface RichTextExtensionContext {
    readonly schema: Schema;
    getState(): EditorState;
    getView(): EditorView | null;
}
```

What an extension's plugin factory receives.

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `schema` | `readonly schema: Schema;` |  |  |
| `getState` | `getState(): EditorState;` |  | The engine's current state (after mount the view's state). |
| `getView` | `getView(): EditorView \| null;` |  | The view once mounted. |

### RichTextExtensionToolbarItem

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/RichTextExtensionToolbarItem

```ts
interface RichTextExtensionToolbarItem {
    readonly id: string;
    readonly label: string;
    readonly command: string;
    readonly icon?: unknown;
}
```

A toolbar item an extension contributes (`toolbar` refers to it by `id`).

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `id` | `readonly id: string;` |  |  |
| `label` | `readonly label: string;` |  |  |
| `command` | `readonly command: string;` |  | Command id (an extension or built-in command) run on click. |
| `icon` | `readonly icon?: unknown;` | optional |  |

### RichTextFindOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/RichTextFindOptions

```ts
interface RichTextFindOptions {
    readonly matchCase?: boolean | undefined;
    readonly wholeWord?: boolean | undefined;
}
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `matchCase` | `readonly matchCase?: boolean \| undefined;` | optional |  |
| `wholeWord` | `readonly wholeWord?: boolean \| undefined;` | optional |  |

### RichTextImageInput

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/RichTextImageInput

```ts
interface RichTextImageInput {
    readonly src: string;
    readonly alt?: string | undefined;
    readonly title?: string | undefined;
    readonly width?: number | null | undefined;
    readonly height?: number | null | undefined;
    readonly caption?: string | undefined;
}
```

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `src` | `readonly src: string;` |  |  |
| `alt` | `readonly alt?: string \| undefined;` | optional |  |
| `title` | `readonly title?: string \| undefined;` | optional |  |
| `width` | `readonly width?: number \| null \| undefined;` | optional |  |
| `height` | `readonly height?: number \| null \| undefined;` | optional |  |
| `caption` | `readonly caption?: string \| undefined;` | optional | A caption wraps the image in `<figure>` with `<figcaption>`. |

### RichTextLinkInput

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/RichTextLinkInput

```ts
interface RichTextLinkInput {
    readonly href: string;
    readonly text?: string | undefined;
    readonly title?: string | undefined;
    readonly target?: '_blank' | null | undefined;
}
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `href` | `readonly href: string;` |  |  |
| `text` | `readonly text?: string \| undefined;` | optional | Link text inserted when the selection is empty (default the URL). |
| `title` | `readonly title?: string \| undefined;` | optional |  |
| `target` | `readonly target?: '_blank' \| null \| undefined;` | optional | `'_blank'` opens in a new window (`rel="noopener noreferrer"` is added). |

### RichTextMediaInput

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/RichTextMediaInput

```ts
interface RichTextMediaInput {
    readonly src: string;
    readonly width?: number | null | undefined;
    readonly height?: number | null | undefined;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `src` | `readonly src: string;` |  |  |
| `width` | `readonly width?: number \| null \| undefined;` | optional |  |
| `height` | `readonly height?: number \| null \| undefined;` | optional |  |

### RichTextMentions

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/RichTextMentions

```ts
interface RichTextMentions<T = MentionItem> {
    readonly trigger?: string;
    readonly items?: readonly T[];
    readonly onSearch?: (text: string) => Promise<readonly T[]>;
    readonly renderItem?: (context: MentionRenderItemContext<T>) => ReactNode;
    readonly mentionProps?: Omit<MentionProps<T>, 'editor' | 'children' | 'target' | 'data' | 'triggers' | 'renderItem'>;
}
```

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `trigger` | `readonly trigger?: string;` | optional | Trigger character (default `'@'`). |
| `items` | `readonly items?: readonly T[];` | optional |  |
| `onSearch` | `readonly onSearch?: (text: string) => Promise<readonly T[]>;` | optional | Remote suggestions for the typed text. |
| `renderItem` | `readonly renderItem?: (context: MentionRenderItemContext<T>) => ReactNode;` | optional |  |
| `mentionProps` | `readonly mentionProps?: Omit<MentionProps<T>, 'editor' \| 'children' \| 'target' \| 'data' \| 'triggers' \| 'renderItem'>;` | optional | Further Mention props (labels, search options, events). |

### RichTextPasteCleanup

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/RichTextPasteCleanup

```ts
interface RichTextPasteCleanup extends Omit<PasteCleanupOptions, 'embedHosts' | 'sanitize'> {
}
```

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `mode` | `mode?: PasteCleanupMode;` | optional, inherited | `'keep'`: keep all formatting the vocabulary allows (fonts, sizes, colors, alignment); `'clean'` (default): keep structure, marks and links, drop presentational styles; `'plainText'`: text only, paragraphs and line breaks kept; `'prompt'`: the editor asks; here it behaves as `'clean'`. |
| `allowedTags` | `allowedTags?: readonly string[];` | optional, inherited | Only these elements survive (others are unwrapped, text kept). Vocabulary names (`strong`, not `b`). |
| `deniedTags` | `deniedTags?: readonly string[];` | optional, inherited | These elements are unwrapped (text kept). |
| `allowedAttributes` | `allowedAttributes?: readonly string[];` | optional, inherited | Only these attributes survive (`style` counts as one). |
| `deniedAttributes` | `deniedAttributes?: readonly string[];` | optional, inherited | These attributes are removed. |
| `keepWordFormatting` | `keepWordFormatting?: boolean;` | optional, inherited | In `'clean'` mode, keep the inline formatting of Word and Google Docs content. Default false. |
| `allow` | `allow?: readonly SanitizeAllow[] \| SanitizeAllow;` | optional, inherited | Passed to the sanitizer: extension elements and attributes. |

### RichTextQuickToolbars

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/RichTextQuickToolbars

```ts
interface RichTextQuickToolbars {
    readonly link?: readonly RichTextToolbarItem[] | false;
    readonly image?: readonly RichTextToolbarItem[] | false;
    readonly table?: readonly RichTextToolbarItem[] | false;
    readonly audio?: readonly RichTextToolbarItem[] | false;
    readonly video?: readonly RichTextToolbarItem[] | false;
    readonly text?: readonly RichTextToolbarItem[] | false;
}
```

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `link` | `readonly link?: readonly RichTextToolbarItem[] \| false;` | optional |  |
| `image` | `readonly image?: readonly RichTextToolbarItem[] \| false;` | optional |  |
| `table` | `readonly table?: readonly RichTextToolbarItem[] \| false;` | optional |  |
| `audio` | `readonly audio?: readonly RichTextToolbarItem[] \| false;` | optional |  |
| `video` | `readonly video?: readonly RichTextToolbarItem[] \| false;` | optional |  |
| `text` | `readonly text?: readonly RichTextToolbarItem[] \| false;` | optional | Shown on a non-empty text selection; off unless `toolbar="floating"` or set. |

### RichTextSelection

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/RichTextSelection

```ts
interface RichTextSelection {
    readonly anchor: number;
    readonly head: number;
    readonly from: number;
    readonly to: number;
    readonly empty: boolean;
    readonly text: string;
}
```

Members (6):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `anchor` | `readonly anchor: number;` |  |  |
| `head` | `readonly head: number;` |  |  |
| `from` | `readonly from: number;` |  |  |
| `to` | `readonly to: number;` |  |  |
| `empty` | `readonly empty: boolean;` |  |  |
| `text` | `readonly text: string;` |  | Selected plain text. |

### RichTextSlashCustomItem

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/RichTextSlashCustomItem

```ts
interface RichTextSlashCustomItem {
    readonly id: string;
    readonly label: string;
    readonly keywords?: readonly string[];
    readonly onSelect: (actions: RichTextEditorActions) => void;
}
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `id` | `readonly id: string;` |  |  |
| `label` | `readonly label: string;` |  |  |
| `keywords` | `readonly keywords?: readonly string[];` | optional |  |
| `onSelect` | `readonly onSelect: (actions: RichTextEditorActions) => void;` |  |  |

### RichTextToolbarCustomItem

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/RichTextToolbarCustomItem

```ts
interface RichTextToolbarCustomItem {
    readonly id: string;
    readonly label: string;
    readonly icon?: ReactNode;
    readonly command?: string;
    readonly onClick?: (actions: RichTextEditorActions) => void;
    readonly pressed?: boolean;
    readonly disabled?: boolean;
}
```

A custom toolbar item.

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `id` | `readonly id: string;` |  |  |
| `label` | `readonly label: string;` |  |  |
| `icon` | `readonly icon?: ReactNode;` | optional |  |
| `command` | `readonly command?: string;` | optional | A command or action id run on click (built-in, alias or extension command). |
| `onClick` | `readonly onClick?: (actions: RichTextEditorActions) => void;` | optional |  |
| `pressed` | `readonly pressed?: boolean;` | optional |  |
| `disabled` | `readonly disabled?: boolean;` | optional |  |

### RichTextToolbarItemClickEvent

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/RichTextToolbarItemClickEvent

```ts
interface RichTextToolbarItemClickEvent {
    readonly id: string;
    preventDefault(): void;
    readonly defaultPrevented: boolean;
}
```

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `id` | `readonly id: string;` |  |  |
| `preventDefault` | `preventDefault(): void;` |  |  |
| `defaultPrevented` | `readonly defaultPrevented: boolean;` |  |  |

### RichTextToolbarItemOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/RichTextToolbarItemOptions

```ts
interface RichTextToolbarItemOptions {
    readonly id: Exclude<RichTextToolbarItemId, '|'>;
    readonly disabled?: boolean;
    readonly label?: string;
}
```

A built-in item with per-item options (per-item `disabled`).

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `id` | `readonly id: Exclude<RichTextToolbarItemId, '\|'>;` |  |  |
| `disabled` | `readonly disabled?: boolean;` | optional |  |
| `label` | `readonly label?: string;` | optional |  |

### RichTextToolbarState

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/RichTextToolbarState

```ts
interface RichTextToolbarState {
    readonly marks: Readonly<Record<'bold' | 'italic' | 'underline' | 'strike' | 'subscript' | 'superscript' | 'code', boolean>>;
    readonly fontFamily: string | null;
    readonly fontSize: string | null;
    readonly color: string | null;
    readonly backgroundColor: string | null;
    readonly block: string;
    readonly textAlign: RichTextTextAlign | null;
    readonly lineHeight: string | null;
    readonly list: 'bullet' | 'ordered' | 'task' | null;
    readonly link: string | null;
    readonly inTable: boolean;
    readonly node: 'image' | 'figure' | 'audio' | 'video' | 'embed' | 'horizontal_rule' | null;
    readonly canUndo: boolean;
    readonly canRedo: boolean;
    readonly count: number;
    readonly empty: boolean;
    readonly selectionEmpty: boolean;
    readonly painter: boolean;
    readonly findCount: number;
    readonly findIndex: number;
    readonly suggest: {
        readonly id: string;
        readonly query: string;
        readonly from: number;
    } | null;
}
```

Derived toolbar state (`onToolbarStateChange`).

Members (21):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `marks` | `readonly marks: Readonly<Record<'bold' \| 'italic' \| 'underline' \| 'strike' \| 'subscript' \| 'superscript' \| 'code', boolean>>;` |  |  |
| `fontFamily` | `readonly fontFamily: string \| null;` |  |  |
| `fontSize` | `readonly fontSize: string \| null;` |  |  |
| `color` | `readonly color: string \| null;` |  |  |
| `backgroundColor` | `readonly backgroundColor: string \| null;` |  |  |
| `block` | `readonly block: string;` |  | `'p'`, `'h1'`..`'h6'`, `'code'` or `'blockquote'`. |
| `textAlign` | `readonly textAlign: RichTextTextAlign \| null;` |  |  |
| `lineHeight` | `readonly lineHeight: string \| null;` |  |  |
| `list` | `readonly list: 'bullet' \| 'ordered' \| 'task' \| null;` |  |  |
| `link` | `readonly link: string \| null;` |  | The href of the link at the selection. |
| `inTable` | `readonly inTable: boolean;` |  |  |
| `node` | `readonly node: 'image' \| 'figure' \| 'audio' \| 'video' \| 'embed' \| 'horizontal_rule' \| null;` |  | The selected node (or the figure around the caret). |
| `canUndo` | `readonly canUndo: boolean;` |  |  |
| `canRedo` | `readonly canRedo: boolean;` |  |  |
| `count` | `readonly count: number;` |  | Character count (text and inline atoms, no block separators). |
| `empty` | `readonly empty: boolean;` |  |  |
| `selectionEmpty` | `readonly selectionEmpty: boolean;` |  |  |
| `painter` | `readonly painter: boolean;` |  |  |
| `findCount` | `readonly findCount: number;` |  |  |
| `findIndex` | `readonly findIndex: number;` |  |  |
| `suggest` | `readonly suggest: {     readonly id: string;     readonly query: string;     readonly from: number; } \| null;` |  | The active slash or emoji trigger. |

### SanitizeAllow

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/SanitizeAllow

```ts
interface SanitizeAllow {
    readonly tags?: readonly string[];
    readonly attributes?: Readonly<Record<string, readonly string[]>>;
}
```

Elements and attributes an editor extension adds to the vocabulary
(`RichTextExtension.html`). `attributes` maps a tag (an extension tag or a
vocabulary tag) to extra attribute names.

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `tags` | `readonly tags?: readonly string[];` | optional |  |
| `attributes` | `readonly attributes?: Readonly<Record<string, readonly string[]>>;` | optional |  |

### SanitizeElement

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/SanitizeElement

```ts
interface SanitizeElement {
    readonly tag: string;
    readonly attrs: Readonly<Record<string, string>>;
    readonly parent: string | null;
}
```

A sanitized element as the `sanitize` hook sees it (read-only copy).

Members (3):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `tag` | `readonly tag: string;` |  | Lowercase tag name from the vocabulary (`p`, `a`, `img`, `span`, ...). |
| `attrs` | `readonly attrs: Readonly<Record<string, string>>;` |  | The attributes that survived the built-in rules. |
| `parent` | `readonly parent: string \| null;` |  | Tag of the sanitized parent element, or null at the top level. |

### SanitizeHtmlOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/SanitizeHtmlOptions

```ts
interface SanitizeHtmlOptions {
    embedHosts?: readonly string[];
    sanitize?: SanitizeHook;
    blockIds?: boolean;
    allow?: SanitizeAllow | readonly SanitizeAllow[];
}
```

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `embedHosts` | `embedHosts?: readonly string[];` | optional | Hostnames whose `<iframe src>` embeds are kept (`www.youtube-nocookie.com`, or `*.example.com` for subdomains). Default: none, so iframes are dropped. |
| `sanitize` | `sanitize?: SanitizeHook;` | optional | Further restriction, see SanitizeHook. |
| `blockIds` | `blockIds?: boolean;` | optional | Keep `data-block-id` attributes (BlockEditor ids). Default: true. |
| `allow` | `allow?: SanitizeAllow \| readonly SanitizeAllow[];` | optional | Elements and attributes editor extensions add. It can widen the vocabulary only with inert markup: script, style, iframe, object, embed, forms and foreign content, `on*` handlers, `style` and URL carriers other than href / cite / src / poster (checked by the URL rules) are refused. |

### SerializeHtmlOptions

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/SerializeHtmlOptions

```ts
interface SerializeHtmlOptions {
    xhtml?: boolean;
}
```

Members (1):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `xhtml` | `xhtml?: boolean;` | optional | XHTML-compatible output (used by the editor's `getHtml({ xhtml: true })`): void elements self-close (`<br />`), boolean attributes are written as `name="name"` and `&nbsp;` as `&#160;`, so the result also parses as XML. |

### UploadResult

Kind: interface

Page: https://salmonui.dev/docs/reference/rich-text/UploadResult

```ts
interface UploadResult {
    readonly src: string;
    readonly alt?: string | undefined;
}
```

Members (2):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `src` | `readonly src: string;` |  |  |
| `alt` | `readonly alt?: string \| undefined;` | optional |  |

## Types

### BlockEditorBlockAction

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/BlockEditorBlockAction

```ts
type BlockEditorBlockAction = BlockEditorBlockActionId | BlockEditorCustomItem;
```

### BlockEditorBlockActionId

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/BlockEditorBlockActionId

```ts
type BlockEditorBlockActionId = 'duplicate' | 'delete' | 'moveUp' | 'moveDown' | 'turnInto';
```

Block action menu entries; image and table blocks add their own.

### BlockEditorCommandId

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/BlockEditorCommandId

```ts
type BlockEditorCommandId = 'moveBlockUp' | 'moveBlockDown' | 'duplicateBlock' | 'deleteBlock' | 'blockMenu' | 'contextMenu' | 'print' | (string & {});
```

Commands `keyBindings` can rebind: the block commands plus every RichTextEditor command id.

### BlockEditorContextMenuItem

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/BlockEditorContextMenuItem

```ts
type BlockEditorContextMenuItem = BlockEditorContextMenuItemId | BlockEditorCustomItem;
```

### BlockEditorContextMenuItemId

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/BlockEditorContextMenuItemId

```ts
type BlockEditorContextMenuItemId = 'cut' | 'copy' | 'duplicate' | 'delete' | 'moveUp' | 'moveDown' | 'turnInto';
```

Context menu entries.

### BlockEditorInlineToolbarItem

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/BlockEditorInlineToolbarItem

```ts
type BlockEditorInlineToolbarItem = BlockEditorInlineToolbarItemId | BlockEditorCustomItem;
```

### BlockEditorInlineToolbarItemId

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/BlockEditorInlineToolbarItemId

```ts
type BlockEditorInlineToolbarItemId = 'bold' | 'italic' | 'underline' | 'strike' | 'code' | 'link' | 'turnInto';
```

Inline (selection) toolbar entries.

### BlockEditorLocaleText

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/BlockEditorLocaleText

```ts
type BlockEditorLocaleText = {
    readonly [K in keyof typeof BLOCK_EDITOR_DEFAULT_LOCALE_TEXT]: string;
};
```

Members (59):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `editor` | `editor: string;` | inherited |  |
| `dragHandle` | `dragHandle: string;` | inherited |  |
| `blockActions` | `blockActions: string;` | inherited |  |
| `contextMenu` | `contextMenu: string;` | inherited |  |
| `slashMenu` | `slashMenu: string;` | inherited |  |
| `noResults` | `noResults: string;` | inherited |  |
| `inlineToolbar` | `inlineToolbar: string;` | inherited |  |
| `groupBasic` | `groupBasic: string;` | inherited |  |
| `groupMedia` | `groupMedia: string;` | inherited |  |
| `groupCustom` | `groupCustom: string;` | inherited |  |
| `paragraph` | `paragraph: string;` | inherited |  |
| `heading1` | `heading1: string;` | inherited |  |
| `heading2` | `heading2: string;` | inherited |  |
| `heading3` | `heading3: string;` | inherited |  |
| `bulletList` | `bulletList: string;` | inherited |  |
| `numberedList` | `numberedList: string;` | inherited |  |
| `checklist` | `checklist: string;` | inherited |  |
| `quote` | `quote: string;` | inherited |  |
| `callout` | `callout: string;` | inherited |  |
| `code` | `code: string;` | inherited |  |
| `toggle` | `toggle: string;` | inherited |  |
| `image` | `image: string;` | inherited |  |
| `table` | `table: string;` | inherited |  |
| `divider` | `divider: string;` | inherited |  |
| `bold` | `bold: string;` | inherited |  |
| `italic` | `italic: string;` | inherited |  |
| `underline` | `underline: string;` | inherited |  |
| `strike` | `strike: string;` | inherited |  |
| `inlineCode` | `inlineCode: string;` | inherited |  |
| `link` | `link: string;` | inherited |  |
| `linkUrl` | `linkUrl: string;` | inherited |  |
| `apply` | `apply: string;` | inherited |  |
| `removeLink` | `removeLink: string;` | inherited |  |
| `turnInto` | `turnInto: string;` | inherited |  |
| `duplicate` | `duplicate: string;` | inherited |  |
| `delete` | `delete: string;` | inherited |  |
| `moveUp` | `moveUp: string;` | inherited |  |
| `moveDown` | `moveDown: string;` | inherited |  |
| `cut` | `cut: string;` | inherited |  |
| `copy` | `copy: string;` | inherited |  |
| `editImage` | `editImage: string;` | inherited |  |
| `altText` | `altText: string;` | inherited |  |
| `width` | `width: string;` | inherited |  |
| `save` | `save: string;` | inherited |  |
| `cancel` | `cancel: string;` | inherited |  |
| `addRowBefore` | `addRowBefore: string;` | inherited |  |
| `addRowAfter` | `addRowAfter: string;` | inherited |  |
| `deleteRow` | `deleteRow: string;` | inherited |  |
| `addColumnBefore` | `addColumnBefore: string;` | inherited |  |
| `addColumnAfter` | `addColumnAfter: string;` | inherited |  |
| `deleteColumn` | `deleteColumn: string;` | inherited |  |
| `mergeCells` | `mergeCells: string;` | inherited |  |
| `splitCell` | `splitCell: string;` | inherited |  |
| `toggleHeaderRow` | `toggleHeaderRow: string;` | inherited |  |
| `uploading` | `uploading: string;` | inherited |  |
| `pastePrompt` | `pastePrompt: string;` | inherited |  |
| `pasteKeep` | `pasteKeep: string;` | inherited |  |
| `pasteClean` | `pasteClean: string;` | inherited |  |
| `pastePlain` | `pastePlain: string;` | inherited |  |

### BlockEditorSlashItem

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/BlockEditorSlashItem

```ts
type BlockEditorSlashItem = BlockEditorSlashItemId | BlockEditorCustomItem;
```

### BlockEditorSlashItemId

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/BlockEditorSlashItemId

```ts
type BlockEditorSlashItemId = BlockEditorTransformId | 'image' | 'table' | 'divider';
```

Built-in slash menu entries: the transforms plus inserted blocks.

### BlockEditorTransformId

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/BlockEditorTransformId

```ts
type BlockEditorTransformId = 'paragraph' | 'heading1' | 'heading2' | 'heading3' | 'bulletList' | 'numberedList' | 'checklist' | 'quote' | 'callout' | 'code' | 'toggle';
```

Block types a block can be turned into (`'turnInto'`, `transforms`).

### BlockPosition

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/BlockPosition

```ts
type BlockPosition = {
    before: string;
} | {
    after: string;
} | {
    parent: string;
    index?: number;
};
```

Where blocks go in the insert and move helpers.

### BlockType

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/BlockType

```ts
type BlockType = 'paragraph' | 'heading' | 'bulletListItem' | 'numberedListItem' | 'checklistItem' | 'quote' | 'callout' | 'code' | 'image' | 'table' | 'divider' | 'toggle' | 'audio' | 'video';
```

Block types.

### HighlightFn

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/HighlightFn

```ts
type HighlightFn = (code: string, language: string | null) => readonly HighlightRange[];
```

### HtmlNode

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/HtmlNode

```ts
type HtmlNode = HtmlElement | HtmlText | HtmlComment;
```

### InlineContent

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/InlineContent

```ts
type InlineContent = InlineText | InlineLink | InlineMention | InlineLabel | InlineHardBreak;
```

Inline content of a block: text with marks, link, mention, label, hard break.

### InlineMark

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/InlineMark

```ts
type InlineMark = {
    type: 'bold' | 'italic' | 'underline' | 'strike' | 'subscript' | 'superscript' | 'code';
} | {
    type: 'color' | 'backgroundColor' | 'fontFamily' | 'fontSize';
    value: string;
};
```

Inline formatting of text (shared with RichTextEditor marks).

### PasteCleanupMode

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/PasteCleanupMode

```ts
type PasteCleanupMode = 'keep' | 'clean' | 'plainText' | 'prompt';
```

How pasted HTML is treated. `'prompt'` asks the user each time (see pasteNeedsPrompt).

### PasteMode

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/PasteMode

```ts
type PasteMode = 'keep' | 'clean' | 'plainText' | 'prompt';
```

### PasteSource

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/PasteSource

```ts
type PasteSource = 'word' | 'googleDocs' | 'html';
```

Where pasted HTML comes from, as detectPasteSource sees it.

### ResolvedPasteCleanupMode

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/ResolvedPasteCleanupMode

```ts
type ResolvedPasteCleanupMode = Exclude<PasteCleanupMode, 'prompt'>;
```

A mode the user (or configuration) has decided on.

### RichTextBulletStyle

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/RichTextBulletStyle

```ts
type RichTextBulletStyle = 'disc' | 'circle' | 'square';
```

### RichTextCommandName

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/RichTextCommandName

```ts
type RichTextCommandName = keyof RichTextCommands;
```

### RichTextDialogId

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/RichTextDialogId

```ts
type RichTextDialogId = 'link' | 'image' | 'audio' | 'video' | 'embed' | 'table' | 'findReplace' | 'aiAssistant' | 'pastePrompt';
```

### RichTextEditorLocaleText

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/RichTextEditorLocaleText

```ts
type RichTextEditorLocaleText = {
    readonly [K in keyof typeof RICH_TEXT_EDITOR_DEFAULT_LOCALE_TEXT]: string;
};
```

Members (123):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `toolbar` | `toolbar: string;` | inherited |  |
| `content` | `content: string;` | inherited |  |
| `more` | `more: string;` | inherited |  |
| `bold` | `bold: string;` | inherited |  |
| `italic` | `italic: string;` | inherited |  |
| `underline` | `underline: string;` | inherited |  |
| `strikethrough` | `strikethrough: string;` | inherited |  |
| `subscript` | `subscript: string;` | inherited |  |
| `superscript` | `superscript: string;` | inherited |  |
| `inlineCode` | `inlineCode: string;` | inherited |  |
| `uppercase` | `uppercase: string;` | inherited |  |
| `lowercase` | `lowercase: string;` | inherited |  |
| `fontName` | `fontName: string;` | inherited |  |
| `fontSize` | `fontSize: string;` | inherited |  |
| `fontColor` | `fontColor: string;` | inherited |  |
| `backgroundColor` | `backgroundColor: string;` | inherited |  |
| `defaultFont` | `defaultFont: string;` | inherited |  |
| `removeColor` | `removeColor: string;` | inherited |  |
| `formats` | `formats: string;` | inherited |  |
| `paragraph` | `paragraph: string;` | inherited |  |
| `heading1` | `heading1: string;` | inherited |  |
| `heading2` | `heading2: string;` | inherited |  |
| `heading3` | `heading3: string;` | inherited |  |
| `heading4` | `heading4: string;` | inherited |  |
| `heading5` | `heading5: string;` | inherited |  |
| `heading6` | `heading6: string;` | inherited |  |
| `codeBlock` | `codeBlock: string;` | inherited |  |
| `blockquote` | `blockquote: string;` | inherited |  |
| `alignments` | `alignments: string;` | inherited |  |
| `alignLeft` | `alignLeft: string;` | inherited |  |
| `alignCenter` | `alignCenter: string;` | inherited |  |
| `alignRight` | `alignRight: string;` | inherited |  |
| `alignJustify` | `alignJustify: string;` | inherited |  |
| `orderedList` | `orderedList: string;` | inherited |  |
| `unorderedList` | `unorderedList: string;` | inherited |  |
| `checklist` | `checklist: string;` | inherited |  |
| `indent` | `indent: string;` | inherited |  |
| `outdent` | `outdent: string;` | inherited |  |
| `lineHeight` | `lineHeight: string;` | inherited |  |
| `horizontalRule` | `horizontalRule: string;` | inherited |  |
| `clearFormat` | `clearFormat: string;` | inherited |  |
| `link` | `link: string;` | inherited |  |
| `openLink` | `openLink: string;` | inherited |  |
| `editLink` | `editLink: string;` | inherited |  |
| `removeLink` | `removeLink: string;` | inherited |  |
| `image` | `image: string;` | inherited |  |
| `editImage` | `editImage: string;` | inherited |  |
| `audio` | `audio: string;` | inherited |  |
| `video` | `video: string;` | inherited |  |
| `embed` | `embed: string;` | inherited |  |
| `removeNode` | `removeNode: string;` | inherited |  |
| `table` | `table: string;` | inherited |  |
| `addRowBefore` | `addRowBefore: string;` | inherited |  |
| `addRowAfter` | `addRowAfter: string;` | inherited |  |
| `deleteRow` | `deleteRow: string;` | inherited |  |
| `addColumnBefore` | `addColumnBefore: string;` | inherited |  |
| `addColumnAfter` | `addColumnAfter: string;` | inherited |  |
| `deleteColumn` | `deleteColumn: string;` | inherited |  |
| `mergeCells` | `mergeCells: string;` | inherited |  |
| `splitCell` | `splitCell: string;` | inherited |  |
| `toggleHeaderRow` | `toggleHeaderRow: string;` | inherited |  |
| `tableStyle` | `tableStyle: string;` | inherited |  |
| `tableStyleNone` | `tableStyleNone: string;` | inherited |  |
| `tableStyleBordered` | `tableStyleBordered: string;` | inherited |  |
| `tableStyleStriped` | `tableStyleStriped: string;` | inherited |  |
| `deleteTable` | `deleteTable: string;` | inherited |  |
| `undo` | `undo: string;` | inherited |  |
| `redo` | `redo: string;` | inherited |  |
| `sourceCode` | `sourceCode: string;` | inherited |  |
| `sourceCodeLabel` | `sourceCodeLabel: string;` | inherited |  |
| `fullscreen` | `fullscreen: string;` | inherited |  |
| `print` | `print: string;` | inherited |  |
| `findReplace` | `findReplace: string;` | inherited |  |
| `formatPainter` | `formatPainter: string;` | inherited |  |
| `emoji` | `emoji: string;` | inherited |  |
| `emojiSearch` | `emojiSearch: string;` | inherited |  |
| `noEmoji` | `noEmoji: string;` | inherited |  |
| `import` | `import: string;` | inherited |  |
| `aiAssistant` | `aiAssistant: string;` | inherited |  |
| `slashMenu` | `slashMenu: string;` | inherited |  |
| `linkUrl` | `linkUrl: string;` | inherited |  |
| `linkText` | `linkText: string;` | inherited |  |
| `linkTitle` | `linkTitle: string;` | inherited |  |
| `linkNewWindow` | `linkNewWindow: string;` | inherited |  |
| `imageUrl` | `imageUrl: string;` | inherited |  |
| `imageAlt` | `imageAlt: string;` | inherited |  |
| `imageCaption` | `imageCaption: string;` | inherited |  |
| `width` | `width: string;` | inherited |  |
| `height` | `height: string;` | inherited |  |
| `uploadFile` | `uploadFile: string;` | inherited |  |
| `browseFiles` | `browseFiles: string;` | inherited |  |
| `mediaUrl` | `mediaUrl: string;` | inherited |  |
| `rows` | `rows: string;` | inherited |  |
| `columns` | `columns: string;` | inherited |  |
| `headerRow` | `headerRow: string;` | inherited |  |
| `find` | `find: string;` | inherited |  |
| `replaceWith` | `replaceWith: string;` | inherited |  |
| `matchCase` | `matchCase: string;` | inherited |  |
| `wholeWord` | `wholeWord: string;` | inherited |  |
| `findNext` | `findNext: string;` | inherited |  |
| `findPrevious` | `findPrevious: string;` | inherited |  |
| `replace` | `replace: string;` | inherited |  |
| `replaceAll` | `replaceAll: string;` | inherited |  |
| `matches` | `matches: string;` | inherited |  |
| `noMatches` | `noMatches: string;` | inherited |  |
| `insert` | `insert: string;` | inherited |  |
| `update` | `update: string;` | inherited |  |
| `cancel` | `cancel: string;` | inherited |  |
| `close` | `close: string;` | inherited |  |
| `pastePrompt` | `pastePrompt: string;` | inherited |  |
| `pasteKeep` | `pasteKeep: string;` | inherited |  |
| `pasteClean` | `pasteClean: string;` | inherited |  |
| `pastePlain` | `pastePlain: string;` | inherited |  |
| `aiPrompt` | `aiPrompt: string;` | inherited |  |
| `aiGenerate` | `aiGenerate: string;` | inherited |  |
| `aiAccept` | `aiAccept: string;` | inherited |  |
| `aiDiscard` | `aiDiscard: string;` | inherited |  |
| `aiWorking` | `aiWorking: string;` | inherited |  |
| `aiError` | `aiError: string;` | inherited |  |
| `uploading` | `uploading: string;` | inherited |  |
| `characters` | `characters: string;` | inherited |  |
| `charactersOf` | `charactersOf: string;` | inherited |  |
| `limitReached` | `limitReached: string;` | inherited |  |

### RichTextKeyBindings

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/RichTextKeyBindings

```ts
type RichTextKeyBindings = Readonly<Record<string, string | false | (() => boolean)>>;
```

`keyBindings` prop: key -> command or action id, a function, or `false` to remove a default.

### RichTextOrderedStyle

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/RichTextOrderedStyle

```ts
type RichTextOrderedStyle = 'decimal' | 'lower-alpha' | 'upper-alpha' | 'lower-roman' | 'upper-roman';
```

### RichTextPopupId

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/RichTextPopupId

```ts
type RichTextPopupId = 'emoji' | 'slash' | 'floating' | 'link' | 'image' | 'table' | 'audio' | 'video' | 'text';
```

### RichTextSlashItem

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/RichTextSlashItem

```ts
type RichTextSlashItem = RichTextSlashItemId | RichTextSlashCustomItem;
```

### RichTextSlashItemId

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/RichTextSlashItemId

```ts
type RichTextSlashItemId = 'paragraph' | 'heading1' | 'heading2' | 'heading3' | 'unorderedList' | 'orderedList' | 'checklist' | 'blockquote' | 'codeBlock' | 'table' | 'image' | 'horizontalRule' | 'emoji';
```

### RichTextTableStyle

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/RichTextTableStyle

```ts
type RichTextTableStyle = 'bordered' | 'striped';
```

### RichTextTextAlign

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/RichTextTextAlign

```ts
type RichTextTextAlign = 'left' | 'center' | 'right' | 'justify';
```

### RichTextToolbarItem

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/RichTextToolbarItem

```ts
type RichTextToolbarItem = RichTextToolbarItemId | (string & Record<never, never>) | RichTextToolbarItemOptions | RichTextToolbarCustomItem;
```

A built-in id, the id of an extension's `toolbarItems` entry, item options or a custom item.

### RichTextToolbarItemId

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/RichTextToolbarItemId

```ts
type RichTextToolbarItemId = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'subscript' | 'superscript' | 'inlineCode' | 'uppercase' | 'lowercase' | 'fontName' | 'fontSize' | 'fontColor' | 'backgroundColor' | 'formats' | 'paragraph' | 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6' | 'blockquote' | 'codeBlock' | 'alignments' | 'alignLeft' | 'alignCenter' | 'alignRight' | 'alignJustify' | 'orderedList' | 'unorderedList' | 'checklist' | 'indent' | 'outdent' | 'lineHeight' | 'horizontalRule' | 'clearFormat' | 'link' | 'openLink' | 'editLink' | 'removeLink' | 'image' | 'editImage' | 'audio' | 'video' | 'embed' | 'removeNode' | 'table' | 'addRowBefore' | 'addRowAfter' | 'deleteRow' | 'addColumnBefore' | 'addColumnAfter' | 'deleteColumn' | 'mergeCells' | 'splitCell' | 'toggleHeaderRow' | 'tableStyle' | 'deleteTable' | 'undo' | 'redo' | 'sourceCode' | 'fullscreen' | 'print' | 'findReplace' | 'formatPainter' | 'emoji' | 'import' | 'aiAssistant' | '|';
```

Built-in toolbar item ids (shared names with MarkdownEditor where they overlap); `'|'` is a separator.

### SanitizeHook

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/SanitizeHook

```ts
type SanitizeHook = (element: SanitizeElement) => SanitizeHookResult;
```

Extension hook (`sanitize`). It
runs after the built-in allow-list, on every element of the sanitized tree,
parents before children. It can only remove or further restrict content;
the built-in sanitizing cannot be turned off or widened through it.

### SanitizeHookResult

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/SanitizeHookResult

```ts
type SanitizeHookResult = undefined | null | 'keep' | 'remove' | 'unwrap' | {
    attrs: Record<string, string>;
};
```

What the `sanitize` hook returns for an element:
- `undefined` / `'keep'`: keep it as is;
- `null` / `'remove'`: remove it with its content;
- `'unwrap'`: remove the element and keep its content;
- `{ attrs }`: keep it with these attributes. Only names the element
  already has are accepted and every value is validated again by the
  built-in rules, so the hook can drop or narrow attributes but never add
  one or re-enable a value the sanitizer refused.

### UploadHandler

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/UploadHandler

```ts
type UploadHandler = (file: File, context: {
    readonly signal: AbortSignal;
}) => Promise<UploadResult>;
```

### UrlUse

Kind: type

Page: https://salmonui.dev/docs/reference/rich-text/UrlUse

```ts
type UrlUse = 'link' | 'image' | 'media' | 'embed';
```

Where a URL is used; each use has its own scheme allow-list.

## Constants

### BLOCK_EDITOR_DEFAULT_LOCALE_TEXT

Kind: const

Page: https://salmonui.dev/docs/reference/rich-text/BLOCK_EDITOR_DEFAULT_LOCALE_TEXT

```ts
const BLOCK_EDITOR_DEFAULT_LOCALE_TEXT: Readonly<{
    editor: "Editor";
    dragHandle: "Drag to move, or open block actions";
    blockActions: "Block actions";
    contextMenu: "Editor actions";
    slashMenu: "Insert block";
    noResults: "No matching blocks";
    inlineToolbar: "Formatting";
    groupBasic: "Basic blocks";
    groupMedia: "Media";
    groupCustom: "Other";
    paragraph: "Text";
    heading1: "Heading 1";
    heading2: "Heading 2";
    heading3: "Heading 3";
    bulletList: "Bulleted list";
    numberedList: "Numbered list";
    checklist: "Checklist";
    quote: "Quote";
    callout: "Callout";
    code: "Code";
    toggle: "Toggle";
    image: "Image";
    table: "Table";
    divider: "Divider";
    bold: "Bold";
    italic: "Italic";
    underline: "Underline";
    strike: "Strikethrough";
    inlineCode: "Inline code";
    link: "Link";
    linkUrl: "Link address";
    apply: "Apply";
    removeLink: "Remove link";
    turnInto: "Turn into";
    duplicate: "Duplicate";
    delete: "Delete";
    moveUp: "Move up";
    moveDown: "Move down";
    cut: "Cut";
    copy: "Copy";
    editImage: "Image settings";
    altText: "Alternative text";
    width: "Width (px)";
    save: "Save";
    cancel: "Cancel";
    addRowBefore: "Insert row above";
    addRowAfter: "Insert row below";
    deleteRow: "Delete row";
    addColumnBefore: "Insert column before";
    addColumnAfter: "Insert column after";
    deleteColumn: "Delete column";
    mergeCells: "Merge cells";
    splitCell: "Split cell";
    toggleHeaderRow: "Header row";
    uploading: "Uploading";
    pastePrompt: "Paste formatted content";
    pasteKeep: "Keep formatting";
    pasteClean: "Clean formatting";
    pastePlain: "Plain text";
}>;
```

### RICH_TEXT_DEFAULT_QUICK_TOOLBARS

Kind: const

Page: https://salmonui.dev/docs/reference/rich-text/RICH_TEXT_DEFAULT_QUICK_TOOLBARS

```ts
const RICH_TEXT_DEFAULT_QUICK_TOOLBARS: Required<{
    [K in keyof RichTextQuickToolbars]: readonly RichTextToolbarItem[];
}>;
```

Default quick toolbars; `text` is off unless `toolbar="floating"`.

### RICH_TEXT_DEFAULT_TOOLBAR

Kind: const

Page: https://salmonui.dev/docs/reference/rich-text/RICH_TEXT_DEFAULT_TOOLBAR

```ts
const RICH_TEXT_DEFAULT_TOOLBAR: readonly RichTextToolbarItem[];
```

Default toolbar.

### RICH_TEXT_EDITOR_DEFAULT_LOCALE_TEXT

Kind: const

Page: https://salmonui.dev/docs/reference/rich-text/RICH_TEXT_EDITOR_DEFAULT_LOCALE_TEXT

```ts
const RICH_TEXT_EDITOR_DEFAULT_LOCALE_TEXT: Readonly<{
    toolbar: "Formatting";
    content: "Rich text editor";
    more: "More";
    bold: "Bold";
    italic: "Italic";
    underline: "Underline";
    strikethrough: "Strikethrough";
    subscript: "Subscript";
    superscript: "Superscript";
    inlineCode: "Inline code";
    uppercase: "Uppercase";
    lowercase: "Lowercase";
    fontName: "Font";
    fontSize: "Font size";
    fontColor: "Font color";
    backgroundColor: "Background color";
    defaultFont: "Default";
    removeColor: "No color";
    formats: "Formats";
    paragraph: "Paragraph";
    heading1: "Heading 1";
    heading2: "Heading 2";
    heading3: "Heading 3";
    heading4: "Heading 4";
    heading5: "Heading 5";
    heading6: "Heading 6";
    codeBlock: "Code block";
    blockquote: "Quote";
    alignments: "Alignment";
    alignLeft: "Align left";
    alignCenter: "Align center";
    alignRight: "Align right";
    alignJustify: "Justify";
    orderedList: "Numbered list";
    unorderedList: "Bulleted list";
    checklist: "Checklist";
    indent: "Increase indent";
    outdent: "Decrease indent";
    lineHeight: "Line height";
    horizontalRule: "Horizontal line";
    clearFormat: "Clear format";
    link: "Insert link";
    openLink: "Open link";
    editLink: "Edit link";
    removeLink: "Remove link";
    image: "Insert image";
    editImage: "Edit image";
    audio: "Insert audio";
    video: "Insert video";
    embed: "Insert embed";
    removeNode: "Remove";
    table: "Insert table";
    addRowBefore: "Insert row above";
    addRowAfter: "Insert row below";
    deleteRow: "Delete row";
    addColumnBefore: "Insert column before";
    addColumnAfter: "Insert column after";
    deleteColumn: "Delete column";
    mergeCells: "Merge cells";
    splitCell: "Split cell";
    toggleHeaderRow: "Header row";
    tableStyle: "Table style";
    tableStyleNone: "Plain";
    tableStyleBordered: "Bordered";
    tableStyleStriped: "Striped";
    deleteTable: "Delete table";
    undo: "Undo";
    redo: "Redo";
    sourceCode: "Source code";
    sourceCodeLabel: "HTML source";
    fullscreen: "Fullscreen";
    print: "Print";
    findReplace: "Find and replace";
    formatPainter: "Format painter";
    emoji: "Emoji";
    emojiSearch: "Search emoji";
    noEmoji: "No emoji found";
    import: "Import";
    aiAssistant: "AI assistant";
    slashMenu: "Insert block";
    linkUrl: "URL";
    linkText: "Text";
    linkTitle: "Title";
    linkNewWindow: "Open in new window";
    imageUrl: "Image URL";
    imageAlt: "Alternative text";
    imageCaption: "Caption";
    width: "Width";
    height: "Height";
    uploadFile: "Upload file";
    browseFiles: "Browse files";
    mediaUrl: "URL";
    rows: "Rows";
    columns: "Columns";
    headerRow: "Header row";
    find: "Find";
    replaceWith: "Replace with";
    matchCase: "Match case";
    wholeWord: "Whole word";
    findNext: "Next";
    findPrevious: "Previous";
    replace: "Replace";
    replaceAll: "Replace all";
    matches: "{index} of {count}";
    noMatches: "No matches";
    insert: "Insert";
    update: "Update";
    cancel: "Cancel";
    close: "Close";
    pastePrompt: "Paste options";
    pasteKeep: "Keep formatting";
    pasteClean: "Clean formatting";
    pastePlain: "Plain text";
    aiPrompt: "Prompt";
    aiGenerate: "Generate";
    aiAccept: "Insert";
    aiDiscard: "Discard";
    aiWorking: "Generating";
    aiError: "The request failed.";
    uploading: "Uploading";
    characters: "{count} characters";
    charactersOf: "{count} / {max}";
    limitReached: "Character limit reached";
}>;
```
