Skip to content

@astrolabe/editor-tiptap/tiptap

For hosts that build their own TipTap editor around the authoring kit: the extensions of the content format and the EditorAdapter over a TipTap editor. A separate entry, because it imports TipTap.

How the surface asks the author about pictures (<astl-editor> answers with its picture dialog). Without it, picture files that are pasted or dropped are left to the browser's default and Enter on a picture does nothing new.

ask(request): Promise<
| PictureFields
| null>;

Asks for a picture: a new one from file (uploaded first), or current to edit. Null: the author cancelled.

Parameter Type
request PictureRequest

Promise< | PictureFields | null>

refuse(): void;

A picture file was pasted or dropped, but there is no upload: say why nothing was inserted.

void

function astrolabeExtensions(
authoring,
manifests?,
options?
): Extensions;

The TipTap extensions of the content format, for new Editor({ extensions }): StarterKit restricted to the rich text the format allows (no code blocks, rules or trailing paragraph; headings 2 to 4; links with href only), the formatting it adds (sub, sup, mark, span, lang and dir), pictures and figures (shown only when the authoring's URL policy allows their address), the document, pages and a node for every type of manifests (default: the authoring's), labelled in the authoring locale, with the astlWrap command of rich blocks.

Parameter Type Default value
authoring Authoring undefined
manifests? readonly ComponentManifest[] authoring.engine.manifests
options? { pictures?: PictureHooks; } {}
options.pictures? PictureHooks undefined

Extensions


function createTiptapAdapter(editor, manifests): EditorAdapter;

The EditorAdapter over a TipTap editor made with astrolabeExtensions: the source in and out, one element by id, the selection and change events, for the kit elements or <astl-editor>'s adapter. manifests are the types of its schema, as given to astrolabeExtensions.

Parameter Type
editor Editor
manifests readonly ComponentManifest[]

EditorAdapter