@astrolabe/editor-tiptap
<astl-editor>, the authoring kit around a TipTap surface, and defineEditor. This entry never imports TipTap: the
surface is a dynamic import, made only when no other editor is plugged in.
Classes
Section titled “Classes”AstlEditor
Section titled “AstlEditor”Extends
Section titled “Extends”LitElement
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AstlEditor(): AstlEditor;Returns
Section titled “Returns”Overrides
Section titled “Overrides”LitElement.constructorProperties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
adapter |
EditorAdapter | null |
The editor the kit drives. Default: TipTap, on a surface this element creates when it first renders without an adapter and without a slot="surface" child. Setting another adapter swaps the editor; null brings the TipTap surface back (with its document), unless a slot="surface" child is there. |
components |
readonly string[] | null |
The component types authors can use (space-separated tags in the attribute); null: every registered type. Others stay in the document, reported as unknown elements. |
locale |
string | null |
UI locale (en, pl); default: the lang attribute, else the browser languages, else en. |
theme |
ThemeSetting | null |
light, dark, hc or auto (the system's light or dark), passed on as data-theme. |
Accessors
Section titled “Accessors”authoring
Section titled “authoring”Get Signature
Section titled “Get Signature”get authoring(): Authoring;The kit's logic, built from the registrations, the UI locale and components.
Returns
Section titled “Returns”Get Signature
Section titled “Get Signature”get value(): string;The source HTML (<astl-doc>): the adapter's, or a value waiting for it, or an empty document.
Returns
Section titled “Returns”string
Set Signature
Section titled “Set Signature”set value(source): void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
source |
string |
Returns
Section titled “Returns”void
Interfaces
Section titled “Interfaces”DefineEditorOptions
Section titled “DefineEditorOptions”The same option names, types and meanings as createEngine and definePlayer; the editor makes its own secret.
Extends
Section titled “Extends”Omit<EngineOptions,"secret">
Properties
Section titled “Properties”| Property | Modifier | Type | Description |
|---|---|---|---|
catalogs? |
readonly |
readonly MessageCatalog[] |
Extra or replacement message catalogs (e.g. more locales) for describe. |
components |
readonly |
readonly ComponentDefinition[] |
- |
editors |
readonly |
readonly EditorDescriptor[] |
Insert menu and inspector entries: one per type authors can add. |
elements |
readonly |
readonly ElementEntry[] |
Player elements for the preview, eager or lazy. |
profile? |
readonly |
Partial<NormalisationProfile> |
Overrides of the default text comparison profile. |
registry? |
readonly |
CustomElementRegistry |
Default: the global customElements. |
slotKinds? |
readonly |
readonly SlotKind<JsonObject>[] |
Added to the built-in slot kinds (text, number, choice, flag). Same kind twice = error. |
styleTemplates? |
readonly |
readonly StyleTemplate[] |
Style templates the hosts' players register, so style-template values can be checked: a name that is not registered, or not allowed at its scope or for its tag, gives the warning STYLE_ |
uploadAsset? |
readonly |
UploadAsset |
Stores a picture file and returns its address (it must pass urlPolicy): the picture dialog, pasted and dropped pictures and picture fields use it. Without it, pictures are added by address only. |
urlPolicy? |
readonly |
UrlPolicy |
Which URLs stay in sources and views (UrlPolicy). Default isSafeUrl. |
Functions
Section titled “Functions”defineEditor()
Section titled “defineEditor()”function defineEditor(options): void;Registers components, editor descriptors, preview elements and looks for every <astl-editor>, and defines
<astl-editor> and the kit elements (nothing is defined on import). A second call adds to the first; a tag or a look
name already registered by another object throws, as two copies would otherwise mix silently.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
DefineEditorOptions |
Returns
Section titled “Returns”void