[lexical] Chore: Added missing isInline function to TextNode (#7226)

Co-authored-by: Bob Ippolito <bob@redivi.com>
This commit is contained in:
Divyansh Kumar
2025-03-01 02:13:21 +05:30
committed by GitHub
parent cb893441a8
commit 2a08be22aa
3 changed files with 13 additions and 0 deletions

View File

@ -623,6 +623,7 @@ declare export class TextNode extends LexicalNode {
getFormat(): number; getFormat(): number;
getStyle(): string; getStyle(): string;
isComposing(): boolean; isComposing(): boolean;
isInline(): true;
isToken(): boolean; isToken(): boolean;
isSegmented(): boolean; isSegmented(): boolean;
isDirectionless(): boolean; isDirectionless(): boolean;
@ -698,6 +699,7 @@ declare export class LineBreakNode extends LexicalNode {
getTextContent(): '\n'; getTextContent(): '\n';
createDOM(): HTMLElement; createDOM(): HTMLElement;
updateDOM(): false; updateDOM(): false;
isInline(): true;
static importJSON( static importJSON(
serializedLineBreakNode: SerializedLineBreakNode, serializedLineBreakNode: SerializedLineBreakNode,
): LineBreakNode; ): LineBreakNode;

View File

@ -50,6 +50,10 @@ export class LineBreakNode extends LexicalNode {
return false; return false;
} }
isInline(): true {
return true;
}
static importDOM(): DOMConversionMap | null { static importDOM(): DOMConversionMap | null {
return { return {
br: (node: Node) => { br: (node: Node) => {

View File

@ -473,6 +473,13 @@ export class TextNode extends LexicalNode {
return true; return true;
} }
/**
* @returns true if the text node is inline, false otherwise.
*/
isInline(): true {
return true;
}
// View // View
createDOM(config: EditorConfig, editor?: LexicalEditor): HTMLElement { createDOM(config: EditorConfig, editor?: LexicalEditor): HTMLElement {