Skip to content

@astl/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>

optional help(part): void;

Opens the help for students of the component at the cursor at a part, from a tag on its frame (<astl-editor>: astl-help-open, else its inspector).

Parameter Type
part HelpPart

void

refuse(): void;

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

void

optional style(kind): void;

Opens the style form of the selected picture, figure or component (<astl-editor>: as its toolbar's style menu does).

Parameter Type
kind "picture" | "figure" | "component"

void

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

The TipTap extensions of the content format, labelled in authoring's locale: the nodes of manifests (default: the authoring's types), pages with their heads, pictures, layouts and help for students. pictures is how the surface asks about pictures; pageActions are the buttons of each page's head, in order (default: PAGE_ACTIONS, all four), read when the extensions are made.

Parameter Type Default value
authoring Authoring undefined
manifests? readonly ComponentManifest[] authoring.engine.manifests
options? { pageActions?: readonly PageAction[]; pictures?: PictureHooks; } {}
options.pageActions? readonly PageAction[] undefined
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

Re-exports PAGE_ACTIONS


Re-exports PageAction