Editor
A rich text editor built on Tiptap, using Prose for typographic styles.
Installation
import { Editor } from "@o/pipeline/experimental/components/editor";
Hooks, extensions, and utilities have their own entry points:
import { useCurrentEditor } from "@o/pipeline/experimental/components/editor/hooks";
import { createMentionExtension } from "@o/pipeline/experimental/components/editor/extensions";
import { plainTextToTipTapJson } from "@o/pipeline/experimental/components/editor/utils";
Usage
Checklists
The message preset includes interactive checklists. Other presets can opt in by importing taskListExtensions from the extensions entry point and passing it through Editor.Root’s extensions prop. This also enables the checklist action in the floating toolbar and preserves checked state in task-list JSON.
Toolbar
Editor.Bubble is the editor’s floating toolbar. Select text for buttons to format it, and a text style menu to make it regular text or a heading; it shows only the formats the editor’s preset supports. Click a link and a toolbar opens with buttons to edit, open, copy or remove it; when the link is inside the selected text, or you paste a URL over it, the same toolbar reshapes instead. Link shows as pressed when the selected text is a link. Edit opens a dialog for the link’s text and URL. ⌘K opens the same dialog for the link under the caret or to link the selected text; with neither, the shortcut is left to the page. Pass disabled to leave selections, link clicks and ⌘K to the editor and the page.
Prose
Under-the-hood, Editor uses Prose for typographic styles.
Editor supports all Prose props, with the following constraints:
renderis not supportedmaxWidthdefaults tofalse(rather thantrueas it does inProse)