[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;
getStyle(): string;
isComposing(): boolean;
isInline(): true;
isToken(): boolean;
isSegmented(): boolean;
isDirectionless(): boolean;
@ -698,6 +699,7 @@ declare export class LineBreakNode extends LexicalNode {
getTextContent(): '\n';
createDOM(): HTMLElement;
updateDOM(): false;
isInline(): true;
static importJSON(
serializedLineBreakNode: SerializedLineBreakNode,
): LineBreakNode;

View File

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

View File

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