[Breaking Change][lexical] Feature: Add updateFromJSON and move more textFormat/textStyle to ElementNode (#6970)

This commit is contained in:
Bob Ippolito
2025-01-01 12:48:12 -08:00
committed by GitHub
parent aaa9009950
commit 7c21d4ff39
66 changed files with 810 additions and 579 deletions

View File

@ -9,7 +9,6 @@
import type {
EditorConfig,
LexicalNode,
NodeKey,
RangeSelection,
SerializedElementNode,
} from 'lexical';
@ -30,18 +29,13 @@ export class OverflowNode extends ElementNode {
}
static importJSON(serializedNode: SerializedOverflowNode): OverflowNode {
return $createOverflowNode();
return $createOverflowNode().updateFromJSON(serializedNode);
}
static importDOM(): null {
return null;
}
constructor(key?: NodeKey) {
super(key);
this.__type = 'overflow';
}
createDOM(config: EditorConfig): HTMLElement {
const div = document.createElement('span');
const className = config.theme.characterLimit;