@serenity-is/corelib / HtmlNoteContentEditor
Class: HtmlNoteContentEditor<P>
Defined in: src/ui/editors/htmlcontenteditor.tsx:496
Html content editor variant for notes with limited toolbar options, e.g. undo redo and bold / italic / underline for now
Extends
Type Parameters
P
P extends HtmlContentEditorOptions = HtmlContentEditorOptions
Constructors
Constructor
new HtmlNoteContentEditor<
P>(props):HtmlNoteContentEditor<P>
Defined in: src/ui/editors/htmlcontenteditor.tsx:499
Parameters
props
EditorProps<P>
Returns
HtmlNoteContentEditor<P>
Overrides
Properties
domNode
readonlydomNode:HTMLTextAreaElement
Defined in: src/ui/editors/htmlcontenteditor.tsx:45
The DOM node this widget is bound to.
Inherited from
idPrefix
readonlyidPrefix:string
Defined in: src/ui/widgets/widget.ts:22
The id prefix used for this widget's child element ids.
Inherited from
options
protectedreadonlyoptions:WidgetProps<EditorProps<P>>
Defined in: src/ui/widgets/widget.ts:18
The widget's options/props.
Inherited from
uniqueName
readonlyuniqueName:string
Defined in: src/ui/widgets/widget.ts:20
A unique name for this widget instance, used for event namespacing.
Inherited from
[typeInfo]
static[typeInfo]:EditorTypeInfo<"Serenity.">
Defined in: src/ui/editors/htmlcontenteditor.tsx:497
Overrides
CKEditorBasePath
staticCKEditorBasePath:string
Defined in: src/ui/editors/htmlcontenteditor.tsx:448
Base path for CKEditor assets.
Inherited from
HtmlContentEditor.CKEditorBasePath
CKEditorVer
staticCKEditorVer:string="4.22.1"
Defined in: src/ui/editors/htmlcontenteditor.tsx:446
CKEditor version to load.
Inherited from
defaultEditorProvider
staticdefaultEditorProvider:HtmlContentEditorProvider
Defined in: src/ui/editors/htmlcontenteditor.tsx:62
Default editor provider.
Inherited from
HtmlContentEditor.defaultEditorProvider
defaultOptions
readonlystaticdefaultOptions:Partial<HtmlContentEditorOptions> ={}
Defined in: src/ui/editors/htmlcontenteditor.tsx:65
Default options for the editor.
Inherited from
HtmlContentEditor.defaultOptions
isComponent
readonlystaticisComponent:true=true
Defined in: src/ui/widgets/widget.ts:334
Inherited from
tiptapModule
statictiptapModule:TiptapModule| () =>TiptapModule|Promise<TiptapModule>
Defined in: src/ui/editors/htmlcontenteditor.tsx:48
The Tiptap module loader.
Inherited from
HtmlContentEditor.tiptapModule
Accessors
editorProvider
Get Signature
get editorProvider():
HtmlContentEditorProvider
Defined in: src/ui/editors/htmlcontenteditor.tsx:490
Returns the active editor provider.
Returns
The editor provider.
Inherited from
HtmlContentEditor.editorProvider
element
Get Signature
get element():
Fluent
Defined in: src/ui/widgets/widget.ts:82
Returns a Fluent(this.domNode) object
Returns
Inherited from
props
Get Signature
get props():
WidgetProps<P>
Defined in: src/ui/widgets/widget.ts:307
Returns the widget's props/options.
Returns
WidgetProps<P>
Inherited from
readOnly
Get Signature
get readOnly():
boolean
Defined in: src/ui/editors/editorwidget.ts:42
Returns whether the editor is read-only.
Returns
boolean
True when read-only.
Set Signature
set readOnly(
value):void
Defined in: src/ui/editors/editorwidget.ts:48
Sets whether the editor is read-only.
Parameters
value
boolean
Returns
void
Inherited from
value
Get Signature
get value():
string
Defined in: src/ui/editors/htmlcontenteditor.tsx:380
Returns the current HTML value.
Returns
string
The HTML value.
Set Signature
set value(
v):void
Defined in: src/ui/editors/htmlcontenteditor.tsx:406
Sets the HTML value.
Parameters
v
string
Returns
void
Inherited from
Methods
addCssClass()
protectedaddCssClass():void
Defined in: src/ui/widgets/widget.ts:89
Adds the widget's CSS class to its DOM node.
Returns
void
Inherited from
addValidationRule()
Call Signature
addValidationRule(
rule,uniqueName?):void
Defined in: src/ui/widgets/widget.ts:142
Adds a validation rule to the widget's DOM node.
Parameters
rule
(input) => string
The validation rule function, or a unique name when the two-argument overload is used.
uniqueName?
string
A unique name for the rule, or the rule function when the two-argument overload is used.
Returns
void
Inherited from
HtmlContentEditor.addValidationRule
Call Signature
addValidationRule(
uniqueName,rule):void
Defined in: src/ui/widgets/widget.ts:143
Adds a validation rule to the widget's DOM node.
Parameters
uniqueName
string
A unique name for the rule, or the rule function when the two-argument overload is used.
rule
(input) => string
The validation rule function, or a unique name when the two-argument overload is used.
Returns
void
Inherited from
HtmlContentEditor.addValidationRule
afterRender()
protectedafterRender(callback):void
Defined in: src/ui/widgets/widget.ts:228
Queues a callback to run after the widget's contents are rendered.
Parameters
callback
() => void
The callback to run after rendering.
Returns
void
Inherited from
byId()
protectedbyId<TElement>(id):Fluent<TElement>
Defined in: src/ui/widgets/widget.ts:154
Finds a child element by its prefix-relative id.
Type Parameters
TElement
TElement extends HTMLElement = HTMLElement
Parameters
id
string
The id relative to the widget's id prefix.
Returns
Fluent<TElement>
A Fluent wrapper for the matching element.
Inherited from
change()
change(
handler):void
Defined in: src/ui/widgets/widget.ts:179
Registers a change handler on the widget's DOM node.
Parameters
handler
(e) => void
The change event handler.
Returns
void
Inherited from
changeSelect2()
changeSelect2(
handler):void
Defined in: src/ui/widgets/widget.ts:188
Registers a change handler that ignores changes originating from
combobox setting values.
Parameters
handler
(e) => void
The change event handler.
Returns
void
Inherited from
HtmlContentEditor.changeSelect2
configureTiptapExtension()
protectedconfigureTiptapExtension(extension):any
Defined in: src/ui/editors/htmlcontenteditor.tsx:519
Configures a Tiptap extension.
Parameters
extension
any
The extension to configure.
Returns
any
The configured extension.
Overrides
HtmlContentEditor.configureTiptapExtension
createTiptapToolbar()
protectedcreateTiptapToolbar(editor,hidden):HTMLElement
Defined in: src/ui/editors/htmlcontenteditor.tsx:330
Creates the Tiptap toolbar.
Parameters
editor
any
The Tiptap editor.
hidden
Hidden toolbar options.
Returns
HTMLElement
The toolbar element.
Inherited from
HtmlContentEditor.createTiptapToolbar
deferRender()
protecteddeferRender():boolean
Defined in: src/ui/widgets/widget.ts:98
Determines whether rendering should be deferred until init is called.
Returns
boolean
True to defer rendering.
Inherited from
destroy()
destroy():
void
Defined in: src/ui/editors/htmlcontenteditor.tsx:347
Cleans up the editor instance.
Returns
void
Inherited from
findById()
protectedfindById<TElement>(id):TElement
Defined in: src/ui/widgets/widget.ts:163
Finds a child element by its prefix-relative id.
Type Parameters
TElement
TElement extends HTMLElement = HTMLElement
Parameters
id
string
The id relative to the widget's id prefix.
Returns
TElement
The matching element, or null if not found.
Inherited from
get_readOnly()
get_readOnly():
boolean
Defined in: src/ui/editors/htmlcontenteditor.tsx:414
Returns whether the editor is read-only.
Returns
boolean
True when read-only.
Inherited from
HtmlContentEditor.get_readOnly
get_value()
get_value():
string
Defined in: src/ui/editors/htmlcontenteditor.tsx:363
Returns the current HTML value.
Returns
string
The HTML value.
Inherited from
getCKEditorConfig()
protectedgetCKEditorConfig():CKEditorConfig
Defined in: src/ui/editors/htmlcontenteditor.tsx:506
Returns the CKEditor configuration.
Returns
The CKEditor config.
Overrides
HtmlContentEditor.getCKEditorConfig
getCKEditorInstance()
protectedgetCKEditorInstance():any
Defined in: src/ui/editors/htmlcontenteditor.tsx:288
Returns the CKEditor instance for this editor.
Returns
any
The CKEditor instance.
Inherited from
HtmlContentEditor.getCKEditorInstance
getCKEditorLanguage()
protectedgetCKEditorLanguage():string
Defined in: src/ui/editors/htmlcontenteditor.tsx:204
Returns the CKEditor language code.
Returns
string
The language code.
Inherited from
HtmlContentEditor.getCKEditorLanguage
getConfig()
protectedgetConfig():CKEditorConfig
Defined in: src/ui/editors/htmlcontenteditor.tsx:226
Returns
Deprecated
Override and use getCKEditorConfig()
Inherited from
getCssClass()
protectedgetCssClass():string
Defined in: src/ui/widgets/widget.ts:106
Returns the CSS class(es) applied to the widget's DOM node.
Returns
string
The space-separated CSS class string.
Inherited from
getCustomAttribute()
protectedgetCustomAttribute<TAttr>(attrType,inherit):TAttr
Defined in: src/ui/widgets/widget.ts:220
Returns a custom attribute applied to the widget's type.
Type Parameters
TAttr
TAttr extends CustomAttribute
Parameters
attrType
(...args) => TAttr
The attribute type to look up.
inherit
boolean = true
Whether to search inherited types; defaults to true.
Returns
TAttr
The matching attribute, or null.
Inherited from
HtmlContentEditor.getCustomAttribute
getGridField()
getGridField():
Fluent
Defined in: src/ui/widgets/widget.ts:171
Returns the closest .field element containing the widget's DOM node.
Returns
A Fluent wrapper for the grid field.
Inherited from
HtmlContentEditor.getGridField
getTiptapExtensions()
protectedgetTiptapExtensions(tiptap):any[]
Defined in: src/ui/editors/htmlcontenteditor.tsx:543
Returns the Tiptap extensions for this editor.
Parameters
tiptap
The Tiptap module.
Returns
any[]
The extensions.
Overrides
HtmlContentEditor.getTiptapExtensions
getTiptapToolbarHidden()
protectedgetTiptapToolbarHidden(editor):TiptapToolbarHiddenOption
Defined in: src/ui/editors/htmlcontenteditor.tsx:339
Returns the hidden Tiptap toolbar options.
Parameters
editor
any
The Tiptap editor.
Returns
The hidden options.
Inherited from
HtmlContentEditor.getTiptapToolbarHidden
handleCKEditorChange()
protectedhandleCKEditorChange(e):void
Defined in: src/ui/editors/htmlcontenteditor.tsx:178
Handles the CKEditor change event.
Parameters
e
any
The CKEditor event.
Returns
void
Inherited from
HtmlContentEditor.handleCKEditorChange
handleCKInstanceReady()
protectedhandleCKInstanceReady(x):void
Defined in: src/ui/editors/htmlcontenteditor.tsx:161
Handles the CKEditor instance-ready event.
Parameters
x
any
The CKEditor event.
Returns
void
Inherited from
HtmlContentEditor.handleCKInstanceReady
handleCKKey()
protectedhandleCKKey(e):void
Defined in: src/ui/editors/htmlcontenteditor.tsx:196
Handles the CKEditor key event.
Parameters
e
any
The CKEditor event.
Returns
void
Inherited from
init()
init():
this
Defined in: src/ui/widgets/widget.ts:243
Initializes the widget, rendering its contents if rendering was deferred.
Returns
this
This widget instance.
Inherited from
internalRenderContents()
internalRenderContents():
void
Defined in: src/ui/widgets/widget.ts:266
Renders the widget's contents and runs any queued after-render callbacks.
Returns
void
Inherited from
HtmlContentEditor.internalRenderContents
legacyTemplateRender()
protectedlegacyTemplateRender():boolean
Defined in: src/ui/widgets/widget.ts:291
Renders the widget from a legacy getTemplate string, if defined.
Returns
boolean
True if a legacy template was rendered.
Inherited from
HtmlContentEditor.legacyTemplateRender
render()
render():
any
Defined in: src/ui/widgets/widget.ts:253
Returns the main element for this widget or the document fragment. As widgets may get their elements from props unlike regular JSX widgets, this method should not be overridden. Override renderContents() instead.
Returns
any
Inherited from
renderContents()
protectedrenderContents():any
Defined in: src/ui/widgets/widget.ts:281
Renders the widget's contents. Override this to provide custom content.
Returns
any
The rendered contents.
Inherited from
HtmlContentEditor.renderContents
set_readOnly()
set_readOnly(
value):void
Defined in: src/ui/editors/htmlcontenteditor.tsx:422
Sets whether the editor is read-only.
Parameters
value
boolean
True to enable read-only mode.
Returns
void
Inherited from
HtmlContentEditor.set_readOnly
set_value()
set_value(
value):void
Defined in: src/ui/editors/htmlcontenteditor.tsx:388
Sets the HTML value.
Parameters
value
string
The HTML value to set.
Returns
void
Inherited from
syncOrAsyncThen()
protectedsyncOrAsyncThen<T>(syncMethod,asyncMethod,then):void
Defined in: src/ui/widgets/widget.ts:318
Runs a method synchronously or asynchronously depending on the widget's
useAsync flag, then invokes a continuation.
Type Parameters
T
T
Parameters
syncMethod
() => T
The synchronous method to run.
asyncMethod
() => PromiseLike<T>
The asynchronous method to run.
then
(v) => void
The continuation invoked with the result.
Returns
void
Inherited from
HtmlContentEditor.syncOrAsyncThen
useIdPrefix()
protecteduseIdPrefix():IdPrefixType
Defined in: src/ui/widgets/widget.ts:329
Returns an id prefix helper for resolving child element ids.
Returns
An IdPrefixType proxy for this widget's id prefix.
Inherited from
create()
staticcreate<TWidget,P>(params):TWidget
Defined in: src/ui/widgets/widget.ts:202
Creates a widget instance from the given params, appending its element to the container and invoking the init/init callbacks.
Type Parameters
TWidget
TWidget extends Widget<P>
P
P
Parameters
params
CreateWidgetParams<TWidget, P>
The widget creation params.
Returns
TWidget
The created widget instance.
Inherited from
createDefaultElement()
staticcreateDefaultElement():HTMLTextAreaElement
Defined in: src/ui/editors/htmlcontenteditor.tsx:59
Creates the default DOM element for a widget.
Returns
HTMLTextAreaElement
A new div element.
Inherited from
HtmlContentEditor.createDefaultElement
getCKEditorBasePath()
staticgetCKEditorBasePath():string
Defined in: src/ui/editors/htmlcontenteditor.tsx:454
Returns the base path for CKEditor assets.
Returns
string
The base path.
Inherited from
HtmlContentEditor.getCKEditorBasePath
getWidgetName()
staticgetWidgetName(type):string
Defined in: src/ui/widgets/widget.ts:131
Returns the widget name for a type, used for association and unique names.
Parameters
type
Function
The widget type.
Returns
string
The widget name.
Inherited from
HtmlContentEditor.getWidgetName
includeCKEditor()
staticincludeCKEditor(then):void
Defined in: src/ui/editors/htmlcontenteditor.tsx:471
Includes the CKEditor script and invokes the callback when loaded.
Parameters
then
() => void
Callback invoked when CKEditor is available.
Returns
void
Inherited from
HtmlContentEditor.includeCKEditor
registerClass()
protectedstaticregisterClass<TypeName>(typeName,intfAndAttr?):ClassTypeInfo<TypeName>
Defined in: src/ui/widgets/widget.ts:342
Registers this type as a class with the given type name.
Type Parameters
TypeName
TypeName
Parameters
typeName
StringLiteral<TypeName>
The type name to register.
intfAndAttr?
(InterfaceType | AttributeSpecifier)[]
Optional interfaces and attributes.
Returns
ClassTypeInfo<TypeName>
The class type info.
Inherited from
HtmlContentEditor.registerClass
registerEditor()
protectedstaticregisterEditor<TypeName>(typeName,intfAndAttr?):EditorTypeInfo<TypeName>
Defined in: src/ui/widgets/widget.ts:357
Registers this type as an editor with the given type name.
Type Parameters
TypeName
TypeName
Parameters
typeName
StringLiteral<TypeName>
The type name to register.
intfAndAttr?
(InterfaceType | AttributeSpecifier)[]
Optional interfaces and attributes.
Returns
EditorTypeInfo<TypeName>
The editor type info.