mirror of
https://github.com/facebook/lexical.git
synced 2025-08-06 16:39:33 +08:00
[Breaking Change][lexical] Feature: Add updateFromJSON and move more textFormat/textStyle to ElementNode (#6970)
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user