@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.
Interfaces
Section titled “Interfaces”PictureHooks
Section titled “PictureHooks”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.
Methods
Section titled “Methods”ask(request): Promise< | PictureFields| null>;Asks for a picture: a new one from file (uploaded first), or current to edit. Null: the author cancelled.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
request |
PictureRequest |
Returns
Section titled “Returns”Promise<
| PictureFields
| null>
refuse()
Section titled “refuse()”refuse(): void;A picture file was pasted or dropped, but there is no upload: say why nothing was inserted.
Returns
Section titled “Returns”void
Functions
Section titled “Functions”astrolabeExtensions()
Section titled “astrolabeExtensions()”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.
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
authoring |
Authoring |
undefined |
manifests? |
readonly ComponentManifest[] |
authoring.engine.manifests |
options? |
{ pictures?: PictureHooks; } |
{} |
options.pictures? |
PictureHooks |
undefined |
Returns
Section titled “Returns”Extensions
createTiptapAdapter()
Section titled “createTiptapAdapter()”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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
editor |
Editor |
manifests |
readonly ComponentManifest[] |