@lexical/list 0.7.9 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -70,28 +70,6 @@ function $getAllListItems(node) {
70
70
  function isNestedListNode(node) {
71
71
  return $isListItemNode(node) && $isListNode(node.getFirstChild());
72
72
  }
73
-
74
- // TODO: rewrite with $findMatchingParent or *nodeOfType
75
- function findNearestListItemNode(node) {
76
- let currentNode = node;
77
- while (currentNode !== null) {
78
- if ($isListItemNode(currentNode)) {
79
- return currentNode;
80
- }
81
- currentNode = currentNode.getParent();
82
- }
83
- return null;
84
- }
85
- function getUniqueListItemNodes(nodeList) {
86
- const keys = new Set();
87
- for (let i = 0; i < nodeList.length; i++) {
88
- const node = nodeList[i];
89
- if ($isListItemNode(node)) {
90
- keys.add(node);
91
- }
92
- }
93
- return Array.from(keys);
94
- }
95
73
  function $removeHighestEmptyListParent(sublist) {
96
74
  // Nodes may be repeatedly indented, to create deeply nested lists that each
97
75
  // contain just one bullet.
@@ -304,156 +282,118 @@ function updateChildrenListItemValue(list, children) {
304
282
  }
305
283
  }
306
284
  }
307
- function $handleIndent(listItemNodes) {
285
+ function $handleIndent(listItemNode) {
308
286
  // go through each node and decide where to move it.
309
287
  const removed = new Set();
310
- listItemNodes.forEach(listItemNode => {
311
- if (isNestedListNode(listItemNode) || removed.has(listItemNode.getKey())) {
312
- return;
313
- }
314
- const parent = listItemNode.getParent();
288
+ if (isNestedListNode(listItemNode) || removed.has(listItemNode.getKey())) {
289
+ return;
290
+ }
291
+ const parent = listItemNode.getParent();
315
292
 
316
- // We can cast both of the below `isNestedListNode` only returns a boolean type instead of a user-defined type guards
317
- const nextSibling = listItemNode.getNextSibling();
318
- const previousSibling = listItemNode.getPreviousSibling();
319
- // if there are nested lists on either side, merge them all together.
293
+ // We can cast both of the below `isNestedListNode` only returns a boolean type instead of a user-defined type guards
294
+ const nextSibling = listItemNode.getNextSibling();
295
+ const previousSibling = listItemNode.getPreviousSibling();
296
+ // if there are nested lists on either side, merge them all together.
320
297
 
321
- if (isNestedListNode(nextSibling) && isNestedListNode(previousSibling)) {
322
- const innerList = previousSibling.getFirstChild();
323
- if ($isListNode(innerList)) {
324
- innerList.append(listItemNode);
325
- const nextInnerList = nextSibling.getFirstChild();
326
- if ($isListNode(nextInnerList)) {
327
- const children = nextInnerList.getChildren();
328
- append(innerList, children);
329
- nextSibling.remove();
330
- removed.add(nextSibling.getKey());
331
- }
332
- updateChildrenListItemValue(innerList);
333
- }
334
- } else if (isNestedListNode(nextSibling)) {
335
- // if the ListItemNode is next to a nested ListNode, merge them
336
- const innerList = nextSibling.getFirstChild();
337
- if ($isListNode(innerList)) {
338
- const firstChild = innerList.getFirstChild();
339
- if (firstChild !== null) {
340
- firstChild.insertBefore(listItemNode);
341
- }
342
- updateChildrenListItemValue(innerList);
298
+ if (isNestedListNode(nextSibling) && isNestedListNode(previousSibling)) {
299
+ const innerList = previousSibling.getFirstChild();
300
+ if ($isListNode(innerList)) {
301
+ innerList.append(listItemNode);
302
+ const nextInnerList = nextSibling.getFirstChild();
303
+ if ($isListNode(nextInnerList)) {
304
+ const children = nextInnerList.getChildren();
305
+ append(innerList, children);
306
+ nextSibling.remove();
307
+ removed.add(nextSibling.getKey());
343
308
  }
344
- } else if (isNestedListNode(previousSibling)) {
345
- const innerList = previousSibling.getFirstChild();
346
- if ($isListNode(innerList)) {
347
- innerList.append(listItemNode);
348
- updateChildrenListItemValue(innerList);
349
- }
350
- } else {
351
- // otherwise, we need to create a new nested ListNode
352
-
353
- if ($isListNode(parent)) {
354
- const newListItem = $createListItemNode();
355
- const newList = $createListNode(parent.getListType());
356
- newListItem.append(newList);
357
- newList.append(listItemNode);
358
- if (previousSibling) {
359
- previousSibling.insertAfter(newListItem);
360
- } else if (nextSibling) {
361
- nextSibling.insertBefore(newListItem);
362
- } else {
363
- parent.append(newListItem);
364
- }
309
+ updateChildrenListItemValue(innerList);
310
+ }
311
+ } else if (isNestedListNode(nextSibling)) {
312
+ // if the ListItemNode is next to a nested ListNode, merge them
313
+ const innerList = nextSibling.getFirstChild();
314
+ if ($isListNode(innerList)) {
315
+ const firstChild = innerList.getFirstChild();
316
+ if (firstChild !== null) {
317
+ firstChild.insertBefore(listItemNode);
365
318
  }
319
+ updateChildrenListItemValue(innerList);
366
320
  }
367
- if ($isListNode(parent)) {
368
- updateChildrenListItemValue(parent);
321
+ } else if (isNestedListNode(previousSibling)) {
322
+ const innerList = previousSibling.getFirstChild();
323
+ if ($isListNode(innerList)) {
324
+ innerList.append(listItemNode);
325
+ updateChildrenListItemValue(innerList);
369
326
  }
370
- });
371
- }
372
- function $handleOutdent(listItemNodes) {
373
- // go through each node and decide where to move it.
374
-
375
- listItemNodes.forEach(listItemNode => {
376
- if (isNestedListNode(listItemNode)) {
377
- return;
378
- }
379
- const parentList = listItemNode.getParent();
380
- const grandparentListItem = parentList ? parentList.getParent() : undefined;
381
- const greatGrandparentList = grandparentListItem ? grandparentListItem.getParent() : undefined;
382
- // If it doesn't have these ancestors, it's not indented.
327
+ } else {
328
+ // otherwise, we need to create a new nested ListNode
383
329
 
384
- if ($isListNode(greatGrandparentList) && $isListItemNode(grandparentListItem) && $isListNode(parentList)) {
385
- // if it's the first child in it's parent list, insert it into the
386
- // great grandparent list before the grandparent
387
- const firstChild = parentList ? parentList.getFirstChild() : undefined;
388
- const lastChild = parentList ? parentList.getLastChild() : undefined;
389
- if (listItemNode.is(firstChild)) {
390
- grandparentListItem.insertBefore(listItemNode);
391
- if (parentList.isEmpty()) {
392
- grandparentListItem.remove();
393
- }
394
- // if it's the last child in it's parent list, insert it into the
395
- // great grandparent list after the grandparent.
396
- } else if (listItemNode.is(lastChild)) {
397
- grandparentListItem.insertAfter(listItemNode);
398
- if (parentList.isEmpty()) {
399
- grandparentListItem.remove();
400
- }
330
+ if ($isListNode(parent)) {
331
+ const newListItem = $createListItemNode();
332
+ const newList = $createListNode(parent.getListType());
333
+ newListItem.append(newList);
334
+ newList.append(listItemNode);
335
+ if (previousSibling) {
336
+ previousSibling.insertAfter(newListItem);
337
+ } else if (nextSibling) {
338
+ nextSibling.insertBefore(newListItem);
401
339
  } else {
402
- // otherwise, we need to split the siblings into two new nested lists
403
- const listType = parentList.getListType();
404
- const previousSiblingsListItem = $createListItemNode();
405
- const previousSiblingsList = $createListNode(listType);
406
- previousSiblingsListItem.append(previousSiblingsList);
407
- listItemNode.getPreviousSiblings().forEach(sibling => previousSiblingsList.append(sibling));
408
- const nextSiblingsListItem = $createListItemNode();
409
- const nextSiblingsList = $createListNode(listType);
410
- nextSiblingsListItem.append(nextSiblingsList);
411
- append(nextSiblingsList, listItemNode.getNextSiblings());
412
- // put the sibling nested lists on either side of the grandparent list item in the great grandparent.
413
- grandparentListItem.insertBefore(previousSiblingsListItem);
414
- grandparentListItem.insertAfter(nextSiblingsListItem);
415
- // replace the grandparent list item (now between the siblings) with the outdented list item.
416
- grandparentListItem.replace(listItemNode);
340
+ parent.append(newListItem);
417
341
  }
418
- updateChildrenListItemValue(parentList);
419
- updateChildrenListItemValue(greatGrandparentList);
420
342
  }
421
- });
343
+ }
344
+ if ($isListNode(parent)) {
345
+ updateChildrenListItemValue(parent);
346
+ }
422
347
  }
423
- function maybeIndentOrOutdent(direction) {
424
- const selection = lexical.$getSelection();
425
- if (!lexical.$isRangeSelection(selection)) {
348
+ function $handleOutdent(listItemNode) {
349
+ // go through each node and decide where to move it.
350
+
351
+ if (isNestedListNode(listItemNode)) {
426
352
  return;
427
353
  }
428
- const selectedNodes = selection.getNodes();
429
- let listItemNodes = [];
430
- if (selectedNodes.length === 0) {
431
- selectedNodes.push(selection.anchor.getNode());
432
- }
433
- if (selectedNodes.length === 1) {
434
- // Only 1 node selected. Selection may not contain the ListNodeItem so we traverse the tree to
435
- // find whether this is part of a ListItemNode
436
- const nearestListItemNode = findNearestListItemNode(selectedNodes[0]);
437
- if (nearestListItemNode !== null) {
438
- listItemNodes = [nearestListItemNode];
439
- }
440
- } else {
441
- listItemNodes = getUniqueListItemNodes(selectedNodes);
442
- }
443
- if (listItemNodes.length > 0) {
444
- if (direction === 'indent') {
445
- $handleIndent(listItemNodes);
354
+ const parentList = listItemNode.getParent();
355
+ const grandparentListItem = parentList ? parentList.getParent() : undefined;
356
+ const greatGrandparentList = grandparentListItem ? grandparentListItem.getParent() : undefined;
357
+ // If it doesn't have these ancestors, it's not indented.
358
+
359
+ if ($isListNode(greatGrandparentList) && $isListItemNode(grandparentListItem) && $isListNode(parentList)) {
360
+ // if it's the first child in it's parent list, insert it into the
361
+ // great grandparent list before the grandparent
362
+ const firstChild = parentList ? parentList.getFirstChild() : undefined;
363
+ const lastChild = parentList ? parentList.getLastChild() : undefined;
364
+ if (listItemNode.is(firstChild)) {
365
+ grandparentListItem.insertBefore(listItemNode);
366
+ if (parentList.isEmpty()) {
367
+ grandparentListItem.remove();
368
+ }
369
+ // if it's the last child in it's parent list, insert it into the
370
+ // great grandparent list after the grandparent.
371
+ } else if (listItemNode.is(lastChild)) {
372
+ grandparentListItem.insertAfter(listItemNode);
373
+ if (parentList.isEmpty()) {
374
+ grandparentListItem.remove();
375
+ }
446
376
  } else {
447
- $handleOutdent(listItemNodes);
377
+ // otherwise, we need to split the siblings into two new nested lists
378
+ const listType = parentList.getListType();
379
+ const previousSiblingsListItem = $createListItemNode();
380
+ const previousSiblingsList = $createListNode(listType);
381
+ previousSiblingsListItem.append(previousSiblingsList);
382
+ listItemNode.getPreviousSiblings().forEach(sibling => previousSiblingsList.append(sibling));
383
+ const nextSiblingsListItem = $createListItemNode();
384
+ const nextSiblingsList = $createListNode(listType);
385
+ nextSiblingsListItem.append(nextSiblingsList);
386
+ append(nextSiblingsList, listItemNode.getNextSiblings());
387
+ // put the sibling nested lists on either side of the grandparent list item in the great grandparent.
388
+ grandparentListItem.insertBefore(previousSiblingsListItem);
389
+ grandparentListItem.insertAfter(nextSiblingsListItem);
390
+ // replace the grandparent list item (now between the siblings) with the outdented list item.
391
+ grandparentListItem.replace(listItemNode);
448
392
  }
393
+ updateChildrenListItemValue(parentList);
394
+ updateChildrenListItemValue(greatGrandparentList);
449
395
  }
450
396
  }
451
- function indentList() {
452
- maybeIndentOrOutdent('indent');
453
- }
454
- function outdentList() {
455
- maybeIndentOrOutdent('outdent');
456
- }
457
397
  function $handleListInsertParagraph() {
458
398
  const selection = lexical.$getSelection();
459
399
  if (!lexical.$isRangeSelection(selection) || !selection.isCollapsed()) {
@@ -747,20 +687,15 @@ class ListItemNode extends lexical.ElementNode {
747
687
  let currentIndent = this.getIndent();
748
688
  while (currentIndent !== indent) {
749
689
  if (currentIndent < indent) {
750
- $handleIndent([this]);
690
+ $handleIndent(this);
751
691
  currentIndent++;
752
692
  } else {
753
- $handleOutdent([this]);
693
+ $handleOutdent(this);
754
694
  currentIndent--;
755
695
  }
756
696
  }
757
697
  return this;
758
698
  }
759
- canIndent() {
760
- // Indent/outdent is handled specifically in the RichText logic.
761
-
762
- return false;
763
- }
764
699
  insertBefore(nodeToInsert) {
765
700
  if ($isListItemNode(nodeToInsert)) {
766
701
  const parent = this.getParentOrThrow();
@@ -1121,7 +1056,5 @@ exports.INSERT_UNORDERED_LIST_COMMAND = INSERT_UNORDERED_LIST_COMMAND;
1121
1056
  exports.ListItemNode = ListItemNode;
1122
1057
  exports.ListNode = ListNode;
1123
1058
  exports.REMOVE_LIST_COMMAND = REMOVE_LIST_COMMAND;
1124
- exports.indentList = indentList;
1125
1059
  exports.insertList = insertList;
1126
- exports.outdentList = outdentList;
1127
1060
  exports.removeList = removeList;
@@ -5,33 +5,31 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  'use strict';var h=require("lexical"),k=require("@lexical/utils");function m(a){throw Error(`Minified Lexical error #${a}; visit https://lexical.dev/docs/error?code=${a} for the full message or `+"use the non-minified dev environment for full errors and additional helpful warnings.");}function n(a){let b=1;for(a=a.getParent();null!=a;){if(p(a)){a=a.getParent();if(q(a)){b++;a=a.getParent();continue}m(40)}break}return b}
8
- function r(a){a=a.getParent();q(a)||m(40);let b=a;for(;null!==b;)b=b.getParent(),q(b)&&(a=b);return a}function t(a){let b=[];a=a.getChildren().filter(p);for(let c=0;c<a.length;c++){let d=a[c],e=d.getFirstChild();q(e)?b=b.concat(t(e)):b.push(d)}return b}function u(a){return p(a)&&q(a.getFirstChild())}function v(a){for(;null==a.getNextSibling()&&null==a.getPreviousSibling();){let b=a.getParent();if(null==b||!p(a)&&!q(a))break;a=b}a.remove()}function w(a){return z().append(a)}
9
- function A(a,b){return p(a)&&(0===b.length||1===b.length&&a.is(b[0])&&0===a.getChildrenSize())}function C(a,b){a.splice(a.getChildrenSize(),0,b)}
10
- function D(a,b){if(q(a))return a;let c=a.getPreviousSibling(),d=a.getNextSibling(),e=z();e.setFormat(a.getFormatType());e.setIndent(a.getIndent());C(e,a.getChildren());if(q(c)&&b===c.getListType())return c.append(e),a.remove(),q(d)&&b===d.getListType()&&(C(c,d.getChildren()),d.remove()),c;if(q(d)&&b===d.getListType())return d.getFirstChildOrThrow().insertBefore(e),a.remove(),d;b=E(b);b.append(e);a.replace(b);F(b);return b}
11
- function F(a,b){a=b||a.getChildren();if(void 0!==a)for(b=0;b<a.length;b++){let f=a[b];if(p(f)){let g=f.getValue();var c=f,d=c.getParent(),e=1;null!=d&&(q(d)?e=d.getStart():m(44));c=c.getPreviousSiblings();for(d=0;d<c.length;d++){let l=c[d];p(l)&&!q(l.getFirstChild())&&e++}g!==e&&f.setValue(e)}}}
12
- function G(a){let b=new Set;a.forEach(c=>{if(!u(c)&&!b.has(c.getKey())){var d=c.getParent(),e=c.getNextSibling(),f=c.getPreviousSibling();if(u(e)&&u(f))f=f.getFirstChild(),q(f)&&(f.append(c),c=e.getFirstChild(),q(c)&&(c=c.getChildren(),C(f,c),e.remove(),b.add(e.getKey())),F(f));else if(u(e))e=e.getFirstChild(),q(e)&&(f=e.getFirstChild(),null!==f&&f.insertBefore(c),F(e));else if(u(f))e=f.getFirstChild(),q(e)&&(e.append(c),F(e));else if(q(d)){let g=z(),l=E(d.getListType());g.append(l);l.append(c);f?
13
- f.insertAfter(g):e?e.insertBefore(g):d.append(g)}q(d)&&F(d)}})}
14
- function H(a){a.forEach(b=>{if(!u(b)){var c=b.getParent(),d=c?c.getParent():void 0,e=d?d.getParent():void 0;if(q(e)&&p(d)&&q(c)){var f=c?c.getFirstChild():void 0,g=c?c.getLastChild():void 0;if(b.is(f))d.insertBefore(b),c.isEmpty()&&d.remove();else if(b.is(g))d.insertAfter(b),c.isEmpty()&&d.remove();else{var l=c.getListType();f=z();let x=E(l);f.append(x);b.getPreviousSiblings().forEach(y=>x.append(y));g=z();l=E(l);g.append(l);C(l,b.getNextSiblings());d.insertBefore(f);d.insertAfter(g);d.replace(b)}F(c);
15
- F(e)}}})}function I(a){var b=h.$getSelection();if(h.$isRangeSelection(b)){var c=b.getNodes(),d=[];0===c.length&&c.push(b.anchor.getNode());if(1===c.length){a:{for(c=c[0];null!==c;){if(p(c))break a;c=c.getParent()}c=null}null!==c&&(d=[c])}else{d=new Set;for(b=0;b<c.length;b++){let e=c[b];p(e)&&d.add(e)}d=Array.from(d)}0<d.length&&("indent"===a?G(d):H(d))}}
16
- class J extends h.ElementNode{static getType(){return"listitem"}static clone(a){return new J(a.__value,a.__checked,a.__key)}constructor(a,b,c){super(c);this.__value=void 0===a?1:a;this.__checked=b}createDOM(a){let b=document.createElement("li"),c=this.getParent();q(c)&&(F(c),K(b,this,null,c));b.value=this.__value;L(b,a.theme,this);return b}updateDOM(a,b,c){let d=this.getParent();q(d)&&(F(d),K(b,this,a,d));b.value=this.__value;L(b,c.theme,this);return!1}static importDOM(){return{li:()=>({conversion:M,
17
- priority:0})}}static importJSON(a){let b=new J(a.value,a.checked);b.setFormat(a.format);b.setIndent(a.indent);b.setDirection(a.direction);return b}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...a){for(let b=0;b<a.length;b++){let c=a[b];if(h.$isElementNode(c)&&this.canMergeWith(c)){let d=c.getChildren();this.append(...d);c.remove()}else super.append(c)}return this}replace(a,b){if(p(a))return super.replace(a);let c=this.getParentOrThrow();
18
- if(q(c)){var d=c.getChildrenKeys();let f=d.length;var e=d.indexOf(this.__key);if(0===e)c.insertBefore(a);else if(e===f-1)c.insertAfter(a);else{d=E(c.getListType());let g=c.getChildren();for(e+=1;e<f;e++)d.append(g[e]);c.insertAfter(a);a.insertAfter(d)}b&&this.getChildren().forEach(g=>{a.append(g)});this.remove();1===f&&c.remove()}return a}insertAfter(a,b=!0){var c=this.getParentOrThrow();q(c)||m(39);var d=this.getNextSiblings();if(p(a))return b=super.insertAfter(a,b),a=a.getParentOrThrow(),q(a)&&
19
- F(a),b;if(q(a)&&a.getListType()===c.getListType()){c=a;a=a.getChildren();for(d=a.length-1;0<=d;d--)c=a[d],this.insertAfter(c,b);return c}c.insertAfter(a,b);if(0!==d.length){let e=E(c.getListType());d.forEach(f=>e.append(f));a.insertAfter(e,b)}return a}remove(a){let b=this.getNextSibling();super.remove(a);null!==b&&(a=b.getParent(),q(a)&&F(a))}insertNewAfter(a,b=!0){a=z(null==this.__checked?void 0:!1);this.insertAfter(a,b);return a}collapseAtStart(a){let b=h.$createParagraphNode();this.getChildren().forEach(f=>
8
+ function r(a){a=a.getParent();q(a)||m(40);let b=a;for(;null!==b;)b=b.getParent(),q(b)&&(a=b);return a}function t(a){let b=[];a=a.getChildren().filter(p);for(let c=0;c<a.length;c++){let d=a[c],e=d.getFirstChild();q(e)?b=b.concat(t(e)):b.push(d)}return b}function u(a){return p(a)&&q(a.getFirstChild())}function v(a){for(;null==a.getNextSibling()&&null==a.getPreviousSibling();){let b=a.getParent();if(null==b||!p(a)&&!q(a))break;a=b}a.remove()}function w(a){return y().append(a)}
9
+ function z(a,b){return p(a)&&(0===b.length||1===b.length&&a.is(b[0])&&0===a.getChildrenSize())}function B(a,b){a.splice(a.getChildrenSize(),0,b)}
10
+ function C(a,b){if(q(a))return a;let c=a.getPreviousSibling(),d=a.getNextSibling(),e=y();e.setFormat(a.getFormatType());e.setIndent(a.getIndent());B(e,a.getChildren());if(q(c)&&b===c.getListType())return c.append(e),a.remove(),q(d)&&b===d.getListType()&&(B(c,d.getChildren()),d.remove()),c;if(q(d)&&b===d.getListType())return d.getFirstChildOrThrow().insertBefore(e),a.remove(),d;b=D(b);b.append(e);a.replace(b);E(b);return b}
11
+ function E(a,b){a=b||a.getChildren();if(void 0!==a)for(b=0;b<a.length;b++){let f=a[b];if(p(f)){let g=f.getValue();var c=f,d=c.getParent(),e=1;null!=d&&(q(d)?e=d.getStart():m(44));c=c.getPreviousSiblings();for(d=0;d<c.length;d++){let l=c[d];p(l)&&!q(l.getFirstChild())&&e++}g!==e&&f.setValue(e)}}}
12
+ function F(a){if(!u(a)){var b=a.getParent(),c=b?b.getParent():void 0,d=c?c.getParent():void 0;if(q(d)&&p(c)&&q(b)){var e=b?b.getFirstChild():void 0,f=b?b.getLastChild():void 0;if(a.is(e))c.insertBefore(a),b.isEmpty()&&c.remove();else if(a.is(f))c.insertAfter(a),b.isEmpty()&&c.remove();else{var g=b.getListType();e=y();let l=D(g);e.append(l);a.getPreviousSiblings().forEach(x=>l.append(x));f=y();g=D(g);f.append(g);B(g,a.getNextSiblings());c.insertBefore(e);c.insertAfter(f);c.replace(a)}E(b);E(d)}}}
13
+ class G extends h.ElementNode{static getType(){return"listitem"}static clone(a){return new G(a.__value,a.__checked,a.__key)}constructor(a,b,c){super(c);this.__value=void 0===a?1:a;this.__checked=b}createDOM(a){let b=document.createElement("li"),c=this.getParent();q(c)&&(E(c),H(b,this,null,c));b.value=this.__value;I(b,a.theme,this);return b}updateDOM(a,b,c){let d=this.getParent();q(d)&&(E(d),H(b,this,a,d));b.value=this.__value;I(b,c.theme,this);return!1}static importDOM(){return{li:()=>({conversion:J,
14
+ priority:0})}}static importJSON(a){let b=new G(a.value,a.checked);b.setFormat(a.format);b.setIndent(a.indent);b.setDirection(a.direction);return b}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...a){for(let b=0;b<a.length;b++){let c=a[b];if(h.$isElementNode(c)&&this.canMergeWith(c)){let d=c.getChildren();this.append(...d);c.remove()}else super.append(c)}return this}replace(a,b){if(p(a))return super.replace(a);let c=this.getParentOrThrow();
15
+ if(q(c)){var d=c.getChildrenKeys();let f=d.length;var e=d.indexOf(this.__key);if(0===e)c.insertBefore(a);else if(e===f-1)c.insertAfter(a);else{d=D(c.getListType());let g=c.getChildren();for(e+=1;e<f;e++)d.append(g[e]);c.insertAfter(a);a.insertAfter(d)}b&&this.getChildren().forEach(g=>{a.append(g)});this.remove();1===f&&c.remove()}return a}insertAfter(a,b=!0){var c=this.getParentOrThrow();q(c)||m(39);var d=this.getNextSiblings();if(p(a))return b=super.insertAfter(a,b),a=a.getParentOrThrow(),q(a)&&
16
+ E(a),b;if(q(a)&&a.getListType()===c.getListType()){c=a;a=a.getChildren();for(d=a.length-1;0<=d;d--)c=a[d],this.insertAfter(c,b);return c}c.insertAfter(a,b);if(0!==d.length){let e=D(c.getListType());d.forEach(f=>e.append(f));a.insertAfter(e,b)}return a}remove(a){let b=this.getNextSibling();super.remove(a);null!==b&&(a=b.getParent(),q(a)&&E(a))}insertNewAfter(a,b=!0){a=y(null==this.__checked?void 0:!1);this.insertAfter(a,b);return a}collapseAtStart(a){let b=h.$createParagraphNode();this.getChildren().forEach(f=>
20
17
  b.append(f));var c=this.getParentOrThrow(),d=c.getParentOrThrow();let e=p(d);1===c.getChildrenSize()?e?(c.remove(),d.select()):(c.insertBefore(b),c.remove(),c=a.anchor,a=a.focus,d=b.getKey(),"element"===c.type&&c.getNode().is(this)&&c.set(d,c.offset,"element"),"element"===a.type&&a.getNode().is(this)&&a.set(d,a.offset,"element")):(c.insertBefore(b),this.remove());return!0}getValue(){return this.getLatest().__value}setValue(a){this.getWritable().__value=a}getChecked(){return this.getLatest().__checked}setChecked(a){this.getWritable().__checked=
21
- a}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){var a=this.getParent();if(null===a)return this.getLatest().__indent;a=a.getParentOrThrow();let b=0;for(;p(a);)a=a.getParentOrThrow().getParentOrThrow(),b++;return b}setIndent(a){let b=this.getIndent();for(;b!==a;)b<a?(G([this]),b++):(H([this]),b--);return this}canIndent(){return!1}insertBefore(a){if(p(a)){let b=this.getParentOrThrow();if(q(b)){let c=this.getNextSiblings();F(b,c)}}return super.insertBefore(a)}canInsertAfter(a){return p(a)}canReplaceWith(a){return p(a)}canMergeWith(a){return h.$isParagraphNode(a)||
22
- p(a)}extractWithChild(a,b){if(!h.$isRangeSelection(b))return!1;a=b.anchor.getNode();let c=b.focus.getNode();return this.isParentOf(a)&&this.isParentOf(c)&&this.getTextContent().length===b.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return E("bullet")}}
23
- function L(a,b,c){let d=[],e=[];var f=(b=b.list)?b.listitem:void 0;if(b&&b.nested)var g=b.nested.listitem;void 0!==f&&(f=f.split(" "),d.push(...f));if(b){f=c.getParent();f=q(f)&&"check"===f.getListType();let l=c.getChecked();f&&!l||e.push(b.listitemUnchecked);f&&l||e.push(b.listitemChecked);f&&d.push(l?b.listitemChecked:b.listitemUnchecked)}void 0!==g&&(g=g.split(" "),c.getChildren().some(l=>q(l))?d.push(...g):e.push(...g));0<e.length&&k.removeClassNamesFromElement(a,...e);0<d.length&&k.addClassNamesToElement(a,
24
- ...d)}function K(a,b,c,d){"check"===d.getListType()?q(b.getFirstChild())?(a.removeAttribute("role"),a.removeAttribute("tabIndex"),a.removeAttribute("aria-checked")):(a.setAttribute("role","checkbox"),a.setAttribute("tabIndex","-1"),c&&b.__checked===c.__checked||a.setAttribute("aria-checked",b.getChecked()?"true":"false")):null!=b.getChecked()&&b.setChecked(void 0)}function M(a){a=a instanceof HTMLElement&&"true"===a.getAttribute("aria-checked");return{node:z(a)}}
25
- function z(a){return h.$applyNodeReplacement(new J(void 0,a))}function p(a){return a instanceof J}
26
- class N extends h.ElementNode{static getType(){return"list"}static clone(a){return new N(a.__listType||O[a.__tag],a.__start,a.__key)}constructor(a,b,c){super(c);this.__listType=a=O[a]||a;this.__tag="number"===a?"ol":"ul";this.__start=b}getTag(){return this.__tag}getListType(){return this.__listType}getStart(){return this.__start}createDOM(a){let b=document.createElement(this.__tag);1!==this.__start&&b.setAttribute("start",String(this.__start));b.__lexicalListType=this.__listType;P(b,a.theme,this);
27
- return b}updateDOM(a,b,c){if(a.__tag!==this.__tag)return!0;P(b,c.theme,this);return!1}static importDOM(){return{ol:()=>({conversion:Q,priority:0}),ul:()=>({conversion:Q,priority:0})}}static importJSON(a){let b=E(a.listType,a.start);b.setFormat(a.format);b.setIndent(a.indent);b.setDirection(a.direction);return b}exportDOM(a){({element:a}=super.exportDOM(a));a&&(1!==this.__start&&a.setAttribute("start",String(this.__start)),"check"===this.__listType&&a.setAttribute("__lexicalListType","check"));return{element:a}}exportJSON(){return{...super.exportJSON(),
28
- listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...a){for(let c=0;c<a.length;c++){var b=a[c];if(p(b))super.append(b);else{let d=z();q(b)?d.append(b):h.$isElementNode(b)?(b=h.$createTextNode(b.getTextContent()),d.append(b)):d.append(b);super.append(d)}}return this}extractWithChild(a){return p(a)}}
29
- function P(a,b,c){let d=[],e=[];var f=b.list;if(void 0!==f){let l=f[`${c.__tag}Depth`]||[];b=n(c)-1;let x=b%l.length;var g=l[x];let y=f[c.__tag],B;f=f.nested;void 0!==f&&f.list&&(B=f.list);void 0!==y&&d.push(y);if(void 0!==g)for(g=g.split(" "),d.push(...g),g=0;g<l.length;g++)g!==x&&e.push(c.__tag+g);void 0!==B&&(c=B.split(" "),1<b?d.push(...c):e.push(...c))}0<e.length&&k.removeClassNamesFromElement(a,...e);0<d.length&&k.addClassNamesToElement(a,...d)}
30
- function R(a){let b=[];for(let d=0;d<a.length;d++){var c=a[d];p(c)?(b.push(c),c=c.getChildren(),1<c.length&&c.forEach(e=>{q(e)&&b.push(w(e))})):b.push(w(c))}return b}function Q(a){let b=a.nodeName.toLowerCase(),c=null;"ol"===b?c=E("number"):"ul"===b&&(c=a instanceof HTMLElement&&"check"===a.getAttribute("__lexicallisttype")?E("check"):E("bullet"));return{after:R,node:c}}let O={ol:"number",ul:"bullet"};function E(a,b=1){return h.$applyNodeReplacement(new N(a,b))}
31
- function q(a){return a instanceof N}let S=h.createCommand("INSERT_UNORDERED_LIST_COMMAND"),T=h.createCommand("INSERT_ORDERED_LIST_COMMAND"),U=h.createCommand("INSERT_CHECK_LIST_COMMAND"),V=h.createCommand("REMOVE_LIST_COMMAND");exports.$createListItemNode=z;exports.$createListNode=E;exports.$getListDepth=n;
32
- exports.$handleListInsertParagraph=function(){var a=h.$getSelection();if(!h.$isRangeSelection(a)||!a.isCollapsed())return!1;a=a.anchor.getNode();if(!p(a)||""!==a.getTextContent())return!1;var b=r(a),c=a.getParent();q(c)||m(40);let d=c.getParent(),e;if(h.$isRootOrShadowRoot(d))e=h.$createParagraphNode(),b.insertAfter(e);else if(p(d))e=z(),d.insertAfter(e);else return!1;e.select();b=a.getNextSiblings();if(0<b.length){let f=E(c.getListType());h.$isParagraphNode(e)?e.insertAfter(f):(c=z(),c.append(f),
33
- e.insertAfter(c));b.forEach(g=>{g.remove();f.append(g)})}v(a);return!0};exports.$isListItemNode=p;exports.$isListNode=q;exports.INSERT_CHECK_LIST_COMMAND=U;exports.INSERT_ORDERED_LIST_COMMAND=T;exports.INSERT_UNORDERED_LIST_COMMAND=S;exports.ListItemNode=J;exports.ListNode=N;exports.REMOVE_LIST_COMMAND=V;exports.indentList=function(){I("indent")};
34
- exports.insertList=function(a,b){a.update(()=>{var c=h.$getSelection();if(h.$isRangeSelection(c)||h.DEPRECATED_$isGridSelection(c)){var d=c.getNodes();c=c.anchor.getNode();var e=c.getParent();if(A(c,d))d=E(b),h.$isRootOrShadowRoot(e)?(c.replace(d),e=z(),h.$isElementNode(c)&&(e.setFormat(c.getFormatType()),e.setIndent(c.getIndent())),d.append(e)):p(c)&&(c=c.getParentOrThrow(),C(d,c.getChildren()),c.replace(d));else for(c=new Set,e=0;e<d.length;e++){var f=d[e];if(h.$isElementNode(f)&&f.isEmpty()&&!c.has(f.getKey()))D(f,
35
- b);else if(h.$isLeafNode(f))for(f=f.getParent();null!=f;){let l=f.getKey();if(q(f)){if(!c.has(l)){var g=E(b);C(g,f.getChildren());f.replace(g);F(g);c.add(l)}break}else{g=f.getParent();if(h.$isRootOrShadowRoot(g)&&!c.has(l)){c.add(l);D(f,b);break}f=g}}}}})};exports.outdentList=function(){I("outdent")};
36
- exports.removeList=function(a){a.update(()=>{let b=h.$getSelection();if(h.$isRangeSelection(b)){var c=new Set,d=b.getNodes(),e=b.anchor.getNode();if(A(e,d))c.add(r(e));else for(e=0;e<d.length;e++){var f=d[e];h.$isLeafNode(f)&&(f=k.$getNearestNodeOfType(f,J),null!=f&&c.add(r(f)))}for(let g of c){c=g;d=t(g);for(let l of d)d=h.$createParagraphNode(),C(d,l.getChildren()),c.insertAfter(d),c=d,l.__key===b.anchor.key&&b.anchor.set(d.getKey(),0,"element"),l.__key===b.focus.key&&b.focus.set(d.getKey(),0,"element"),
18
+ a}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){var a=this.getParent();if(null===a)return this.getLatest().__indent;a=a.getParentOrThrow();let b=0;for(;p(a);)a=a.getParentOrThrow().getParentOrThrow(),b++;return b}setIndent(a){let b=this.getIndent();for(;b!==a;)if(b<a){a:{var c=new Set;if(u(this)||c.has(this.getKey()))break a;let g=this.getParent();var d=this.getNextSibling(),e=this.getPreviousSibling();if(u(d)&&u(e)){if(e=e.getFirstChild(),q(e)){e.append(this);var f=d.getFirstChild();
19
+ q(f)&&(f=f.getChildren(),B(e,f),d.remove(),c.add(d.getKey()));E(e)}}else u(d)?(d=d.getFirstChild(),q(d)&&(c=d.getFirstChild(),null!==c&&c.insertBefore(this),E(d))):u(e)?(d=e.getFirstChild(),q(d)&&(d.append(this),E(d))):q(g)&&(c=y(),f=D(g.getListType()),c.append(f),f.append(this),e?e.insertAfter(c):d?d.insertBefore(c):g.append(c));q(g)&&E(g)}b++}else F(this),b--;return this}insertBefore(a){if(p(a)){let b=this.getParentOrThrow();if(q(b)){let c=this.getNextSiblings();E(b,c)}}return super.insertBefore(a)}canInsertAfter(a){return p(a)}canReplaceWith(a){return p(a)}canMergeWith(a){return h.$isParagraphNode(a)||
20
+ p(a)}extractWithChild(a,b){if(!h.$isRangeSelection(b))return!1;a=b.anchor.getNode();let c=b.focus.getNode();return this.isParentOf(a)&&this.isParentOf(c)&&this.getTextContent().length===b.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return D("bullet")}}
21
+ function I(a,b,c){let d=[],e=[];var f=(b=b.list)?b.listitem:void 0;if(b&&b.nested)var g=b.nested.listitem;void 0!==f&&(f=f.split(" "),d.push(...f));if(b){f=c.getParent();f=q(f)&&"check"===f.getListType();let l=c.getChecked();f&&!l||e.push(b.listitemUnchecked);f&&l||e.push(b.listitemChecked);f&&d.push(l?b.listitemChecked:b.listitemUnchecked)}void 0!==g&&(g=g.split(" "),c.getChildren().some(l=>q(l))?d.push(...g):e.push(...g));0<e.length&&k.removeClassNamesFromElement(a,...e);0<d.length&&k.addClassNamesToElement(a,
22
+ ...d)}function H(a,b,c,d){"check"===d.getListType()?q(b.getFirstChild())?(a.removeAttribute("role"),a.removeAttribute("tabIndex"),a.removeAttribute("aria-checked")):(a.setAttribute("role","checkbox"),a.setAttribute("tabIndex","-1"),c&&b.__checked===c.__checked||a.setAttribute("aria-checked",b.getChecked()?"true":"false")):null!=b.getChecked()&&b.setChecked(void 0)}function J(a){a=a instanceof HTMLElement&&"true"===a.getAttribute("aria-checked");return{node:y(a)}}
23
+ function y(a){return h.$applyNodeReplacement(new G(void 0,a))}function p(a){return a instanceof G}
24
+ class K extends h.ElementNode{static getType(){return"list"}static clone(a){return new K(a.__listType||M[a.__tag],a.__start,a.__key)}constructor(a,b,c){super(c);this.__listType=a=M[a]||a;this.__tag="number"===a?"ol":"ul";this.__start=b}getTag(){return this.__tag}getListType(){return this.__listType}getStart(){return this.__start}createDOM(a){let b=document.createElement(this.__tag);1!==this.__start&&b.setAttribute("start",String(this.__start));b.__lexicalListType=this.__listType;N(b,a.theme,this);
25
+ return b}updateDOM(a,b,c){if(a.__tag!==this.__tag)return!0;N(b,c.theme,this);return!1}static importDOM(){return{ol:()=>({conversion:O,priority:0}),ul:()=>({conversion:O,priority:0})}}static importJSON(a){let b=D(a.listType,a.start);b.setFormat(a.format);b.setIndent(a.indent);b.setDirection(a.direction);return b}exportDOM(a){({element:a}=super.exportDOM(a));a&&(1!==this.__start&&a.setAttribute("start",String(this.__start)),"check"===this.__listType&&a.setAttribute("__lexicalListType","check"));return{element:a}}exportJSON(){return{...super.exportJSON(),
26
+ listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...a){for(let c=0;c<a.length;c++){var b=a[c];if(p(b))super.append(b);else{let d=y();q(b)?d.append(b):h.$isElementNode(b)?(b=h.$createTextNode(b.getTextContent()),d.append(b)):d.append(b);super.append(d)}}return this}extractWithChild(a){return p(a)}}
27
+ function N(a,b,c){let d=[],e=[];var f=b.list;if(void 0!==f){let l=f[`${c.__tag}Depth`]||[];b=n(c)-1;let x=b%l.length;var g=l[x];let L=f[c.__tag],A;f=f.nested;void 0!==f&&f.list&&(A=f.list);void 0!==L&&d.push(L);if(void 0!==g)for(g=g.split(" "),d.push(...g),g=0;g<l.length;g++)g!==x&&e.push(c.__tag+g);void 0!==A&&(c=A.split(" "),1<b?d.push(...c):e.push(...c))}0<e.length&&k.removeClassNamesFromElement(a,...e);0<d.length&&k.addClassNamesToElement(a,...d)}
28
+ function P(a){let b=[];for(let d=0;d<a.length;d++){var c=a[d];p(c)?(b.push(c),c=c.getChildren(),1<c.length&&c.forEach(e=>{q(e)&&b.push(w(e))})):b.push(w(c))}return b}function O(a){let b=a.nodeName.toLowerCase(),c=null;"ol"===b?c=D("number"):"ul"===b&&(c=a instanceof HTMLElement&&"check"===a.getAttribute("__lexicallisttype")?D("check"):D("bullet"));return{after:P,node:c}}let M={ol:"number",ul:"bullet"};function D(a,b=1){return h.$applyNodeReplacement(new K(a,b))}
29
+ function q(a){return a instanceof K}let Q=h.createCommand("INSERT_UNORDERED_LIST_COMMAND"),R=h.createCommand("INSERT_ORDERED_LIST_COMMAND"),S=h.createCommand("INSERT_CHECK_LIST_COMMAND"),T=h.createCommand("REMOVE_LIST_COMMAND");exports.$createListItemNode=y;exports.$createListNode=D;exports.$getListDepth=n;
30
+ exports.$handleListInsertParagraph=function(){var a=h.$getSelection();if(!h.$isRangeSelection(a)||!a.isCollapsed())return!1;a=a.anchor.getNode();if(!p(a)||""!==a.getTextContent())return!1;var b=r(a),c=a.getParent();q(c)||m(40);let d=c.getParent(),e;if(h.$isRootOrShadowRoot(d))e=h.$createParagraphNode(),b.insertAfter(e);else if(p(d))e=y(),d.insertAfter(e);else return!1;e.select();b=a.getNextSiblings();if(0<b.length){let f=D(c.getListType());h.$isParagraphNode(e)?e.insertAfter(f):(c=y(),c.append(f),
31
+ e.insertAfter(c));b.forEach(g=>{g.remove();f.append(g)})}v(a);return!0};exports.$isListItemNode=p;exports.$isListNode=q;exports.INSERT_CHECK_LIST_COMMAND=S;exports.INSERT_ORDERED_LIST_COMMAND=R;exports.INSERT_UNORDERED_LIST_COMMAND=Q;exports.ListItemNode=G;exports.ListNode=K;exports.REMOVE_LIST_COMMAND=T;
32
+ exports.insertList=function(a,b){a.update(()=>{var c=h.$getSelection();if(h.$isRangeSelection(c)||h.DEPRECATED_$isGridSelection(c)){var d=c.getNodes();c=c.anchor.getNode();var e=c.getParent();if(z(c,d))d=D(b),h.$isRootOrShadowRoot(e)?(c.replace(d),e=y(),h.$isElementNode(c)&&(e.setFormat(c.getFormatType()),e.setIndent(c.getIndent())),d.append(e)):p(c)&&(c=c.getParentOrThrow(),B(d,c.getChildren()),c.replace(d));else for(c=new Set,e=0;e<d.length;e++){var f=d[e];if(h.$isElementNode(f)&&f.isEmpty()&&!c.has(f.getKey()))C(f,
33
+ b);else if(h.$isLeafNode(f))for(f=f.getParent();null!=f;){let l=f.getKey();if(q(f)){if(!c.has(l)){var g=D(b);B(g,f.getChildren());f.replace(g);E(g);c.add(l)}break}else{g=f.getParent();if(h.$isRootOrShadowRoot(g)&&!c.has(l)){c.add(l);C(f,b);break}f=g}}}}})};
34
+ exports.removeList=function(a){a.update(()=>{let b=h.$getSelection();if(h.$isRangeSelection(b)){var c=new Set,d=b.getNodes(),e=b.anchor.getNode();if(z(e,d))c.add(r(e));else for(e=0;e<d.length;e++){var f=d[e];h.$isLeafNode(f)&&(f=k.$getNearestNodeOfType(f,G),null!=f&&c.add(r(f)))}for(let g of c){c=g;d=t(g);for(let l of d)d=h.$createParagraphNode(),B(d,l.getChildren()),c.insertAfter(d),c=d,l.__key===b.anchor.key&&b.anchor.set(d.getKey(),0,"element"),l.__key===b.focus.key&&b.focus.set(d.getKey(),0,"element"),
37
35
  l.remove();g.remove()}}})}
@@ -40,7 +40,6 @@ export declare class ListItemNode extends ElementNode {
40
40
  toggleChecked(): void;
41
41
  getIndent(): number;
42
42
  setIndent(indent: number): this;
43
- canIndent(): false;
44
43
  insertBefore(nodeToInsert: LexicalNode): LexicalNode;
45
44
  canInsertAfter(node: LexicalNode): boolean;
46
45
  canReplaceWith(replacement: LexicalNode): boolean;
package/formatList.d.ts CHANGED
@@ -11,8 +11,6 @@ import { ListType } from './LexicalListNode';
11
11
  export declare function insertList(editor: LexicalEditor, listType: ListType): void;
12
12
  export declare function removeList(editor: LexicalEditor): void;
13
13
  export declare function updateChildrenListItemValue(list: ListNode, children?: Array<LexicalNode>): void;
14
- export declare function $handleIndent(listItemNodes: Array<ListItemNode>): void;
15
- export declare function $handleOutdent(listItemNodes: Array<ListItemNode>): void;
16
- export declare function indentList(): void;
17
- export declare function outdentList(): void;
14
+ export declare function $handleIndent(listItemNode: ListItemNode): void;
15
+ export declare function $handleOutdent(listItemNode: ListItemNode): void;
18
16
  export declare function $handleListInsertParagraph(): boolean;
package/index.d.ts CHANGED
@@ -9,11 +9,11 @@
9
9
  import type { SerializedListItemNode } from './LexicalListItemNode';
10
10
  import type { ListType, SerializedListNode } from './LexicalListNode';
11
11
  import type { LexicalCommand } from 'lexical';
12
- import { $handleListInsertParagraph, indentList, insertList, outdentList, removeList } from './formatList';
12
+ import { $handleListInsertParagraph, insertList, removeList } from './formatList';
13
13
  import { $createListItemNode, $isListItemNode, ListItemNode } from './LexicalListItemNode';
14
14
  import { $createListNode, $isListNode, ListNode } from './LexicalListNode';
15
15
  import { $getListDepth } from './utils';
16
- export { $createListItemNode, $createListNode, $getListDepth, $handleListInsertParagraph, $isListItemNode, $isListNode, indentList, insertList, ListItemNode, ListNode, ListType, outdentList, removeList, SerializedListItemNode, SerializedListNode, };
16
+ export { $createListItemNode, $createListNode, $getListDepth, $handleListInsertParagraph, $isListItemNode, $isListNode, insertList, ListItemNode, ListNode, ListType, removeList, SerializedListItemNode, SerializedListNode, };
17
17
  export declare const INSERT_UNORDERED_LIST_COMMAND: LexicalCommand<void>;
18
18
  export declare const INSERT_ORDERED_LIST_COMMAND: LexicalCommand<void>;
19
19
  export declare const INSERT_CHECK_LIST_COMMAND: LexicalCommand<void>;
package/package.json CHANGED
@@ -8,13 +8,13 @@
8
8
  "list"
9
9
  ],
10
10
  "license": "MIT",
11
- "version": "0.7.9",
11
+ "version": "0.8.0",
12
12
  "main": "LexicalList.js",
13
13
  "peerDependencies": {
14
- "lexical": "0.7.9"
14
+ "lexical": "0.8.0"
15
15
  },
16
16
  "dependencies": {
17
- "@lexical/utils": "0.7.9"
17
+ "@lexical/utils": "0.8.0"
18
18
  },
19
19
  "repository": {
20
20
  "type": "git",
package/utils.d.ts CHANGED
@@ -13,6 +13,5 @@ export declare function $isLastItemInList(listItem: ListItemNode): boolean;
13
13
  export declare function $getAllListItems(node: ListNode): Array<ListItemNode>;
14
14
  export declare function isNestedListNode(node: LexicalNode | null | undefined): boolean;
15
15
  export declare function findNearestListItemNode(node: LexicalNode): ListItemNode | null;
16
- export declare function getUniqueListItemNodes(nodeList: Array<LexicalNode>): Array<ListItemNode>;
17
16
  export declare function $removeHighestEmptyListParent(sublist: ListItemNode | ListNode): void;
18
17
  export declare function wrapInListItem(node: LexicalNode): ListItemNode;