Class: EmojiNode
EmojiNode doesn't really need to override any of TextNode's functionality, other than these serialization and type related static methods.
The behavior is augmented in $createEmojiNode where we set mode to token so it is treated as an "atomic" unit and not considered for further text transforms.
The display behavior is all implemented in the mutation listener set up by EmojiPlan, which makes it a little easier to ensure that clean-up is done properly.
Extends
TextNode
Constructors
new EmojiNode()
new EmojiNode(
text
,shortcode
?,key
?):EmojiNode
Parameters
• text: string
• shortcode?: string
• key?: string
Returns
Overrides
TextNode.constructor
Defined in
Properties
__shortcode?
optional
__shortcode:string
Defined in
Methods
createDOM()
createDOM(
config
,editor
?):HTMLElement
Parameters
• config: EditorConfig
• editor?: LexicalEditor
Returns
HTMLElement
Overrides
TextNode.createDOM
Defined in
exportJSON()
exportJSON():
SerializedEmojiNode
Returns
SerializedEmojiNode
Overrides
TextNode.exportJSON
Defined in
getShortcode()
getShortcode():
undefined
|string
Returns
undefined
| string
Defined in
setShortcode()
setShortcode(
shortcode
?):this
Parameters
• shortcode?: string
Returns
this
Defined in
updateDOM()
updateDOM(
prevNode
,dom
,config
):boolean
Parameters
• prevNode: this
• dom: HTMLElement
• config: EditorConfig
Returns
boolean
Overrides
TextNode.updateDOM
Defined in
clone()
static
clone(node
):EmojiNode
Parameters
• node: EmojiNode
Returns
Overrides
TextNode.clone
Defined in
getType()
static
getType():"emoji"
Returns
"emoji"
Overrides
TextNode.getType
Defined in
importDOM()
static
importDOM():null
|DOMConversionMap
Returns
null
| DOMConversionMap
Overrides
TextNode.importDOM
Defined in
importJSON()
static
importJSON(serializedNode
):EmojiNode
Parameters
• serializedNode: SerializedEmojiNode
Returns
Overrides
TextNode.importJSON