lexical_list 1.3.0 copy "lexical_list: ^1.3.0" to clipboard
lexical_list: ^1.3.0 copied to clipboard

List and list-item nodes for lexical_core, including check lists, wire-compatible with Lexical's @lexical/list. Pure Dart.

lexical_list

lexical_list #

Bullet, ordered and check-list nodes for lexical_core. Pure Dart.

dependencies:
  lexical_list: ^1.0.0
final editor = LexicalEditor(nodes: listNodes);
registerListNumbering(editor);      // keeps `value` in step with position

editor.update(() {
  $getRoot().append(
    $createListNode(ListType.check)
      ..append($createListItemNode(true)..append($createTextNode('erledigt')))
      ..append($createListItemNode(false)..append($createTextNode('offen'))),
  );
}, discrete: true);

Two details the wire format insists on #

listitem.checked is absent outside a check list, not present with value null — those are different values on the wire, and a blanket "skip nulls" rule gets one of them wrong.

listitem.value is derived: list.start + index. It is maintained by the transform registerListNumbering installs, not recomputed on export, because import must stay verbatim — a document whose numbering disagrees with its positions is preserved rather than silently rewritten.

Nesting is a list inside an item, not a list inside a list; ListItemNode.isNestedListHolder identifies those wrapper items.

Wire-compatible with @lexical/list 0.48.x.

Licence #

MIT. Derived from Lexical, © Meta Platforms, Inc., also MIT. See NOTICE.

0
likes
0
points
605
downloads

Publisher

verified publisherahmadre.com

Weekly Downloads

List and list-item nodes for lexical_core, including check lists, wire-compatible with Lexical's @lexical/list. Pure Dart.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

lexical_core, meta

More

Packages that depend on lexical_list