Open potatowagon opened 3 weeks ago
Hi @potatowagon, when upgrading to Lexical to 0.15.0
I now get warnings in the console since ArtificialNode__DO_NOT_USE
is not implementing methods required by ElementNode
. I guess this is not be expected? Or am I maybe doing something wrong in the way I use Lexical?
ArtificialNode__DO_NOT_USE should implement "importJSON" method to ensure JSON and default HTML serialization works as expected
ArtificialNode__DO_NOT_USE should implement "exportJSON" method to ensure JSON and default HTML serialization works as expected
ArtificialNode__DO_NOT_USE must implement static "clone" method
@jaapvanblaaderen https://github.com/facebook/lexical/pull/6107 should fix the warnings
https://github.com/facebook/lexical/pull/6048 another fix
A followup task to #5857
During html pasting, ArtificialNode is a temp wrapper node to group nodes within block elements that should be separated by a linebreak (
). It is currently represented by a class extending ElementNode to be compatible with the typings in packages/lexical-html/src/index.ts.
A cleaner soln would be to not have ArtificialNode extend ElementNode so that it would not be confused as a LexicalNode. ArtificialNode is only used in the pasting logic and ideally should not need to be initialised in the Editor.