Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@lexical/list

Package Overview
Dependencies
Maintainers
5
Versions
260
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lexical/list - npm Package Compare versions

Comparing version 0.23.2-nightly.20250110.0 to 0.23.2-nightly.20250113.0

7

formatList.d.ts

@@ -8,3 +8,2 @@ /**

*/
import { LexicalEditor } from 'lexical';
import { ListItemNode, ListNode } from './';

@@ -19,6 +18,5 @@ import { ListType } from './LexicalListNode';

* a new ListNode, or create a new ListNode at the nearest root/shadow root.
* @param editor - The lexical editor.
* @param listType - The type of list, "number" | "bullet" | "check".
*/
export declare function insertList(editor: LexicalEditor, listType: ListType): void;
export declare function $insertList(listType: ListType): void;
/**

@@ -36,5 +34,4 @@ * A recursive function that goes through each list and their children, including nested lists,

* inside a ListItemNode will be appended to the new ParagraphNodes.
* @param editor - The lexical editor.
*/
export declare function removeList(editor: LexicalEditor): void;
export declare function $removeList(): void;
/**

@@ -41,0 +38,0 @@ * Takes the value of a child ListItemNode and makes it the value the ListItemNode

@@ -11,7 +11,7 @@ /**

import type { LexicalCommand, LexicalEditor } from 'lexical';
import { $handleListInsertParagraph, insertList, removeList } from './formatList';
import { $handleListInsertParagraph, $insertList, $removeList } from './formatList';
import { $createListItemNode, $isListItemNode, ListItemNode } from './LexicalListItemNode';
import { $createListNode, $isListNode, ListNode } from './LexicalListNode';
import { $getListDepth } from './utils';
export { $createListItemNode, $createListNode, $getListDepth, $handleListInsertParagraph, $isListItemNode, $isListNode, insertList, ListItemNode, ListNode, ListType, removeList, SerializedListItemNode, SerializedListNode, };
export { $createListItemNode, $createListNode, $getListDepth, $handleListInsertParagraph, $insertList, $isListItemNode, $isListNode, $removeList, ListItemNode, ListNode, ListType, SerializedListItemNode, SerializedListNode, };
export declare const INSERT_UNORDERED_LIST_COMMAND: LexicalCommand<void>;

@@ -22,1 +22,24 @@ export declare const INSERT_ORDERED_LIST_COMMAND: LexicalCommand<void>;

export declare function registerList(editor: LexicalEditor): () => void;
/**
* @deprecated use {@link $insertList} from an update or command listener.
*
* Inserts a new ListNode. If the selection's anchor node is an empty ListItemNode and is a child of
* the root/shadow root, it will replace the ListItemNode with a ListNode and the old ListItemNode.
* Otherwise it will replace its parent with a new ListNode and re-insert the ListItemNode and any previous children.
* If the selection's anchor node is not an empty ListItemNode, it will add a new ListNode or merge an existing ListNode,
* unless the the node is a leaf node, in which case it will attempt to find a ListNode up the branch and replace it with
* a new ListNode, or create a new ListNode at the nearest root/shadow root.
* @param editor - The lexical editor.
* @param listType - The type of list, "number" | "bullet" | "check".
*/
export declare function insertList(editor: LexicalEditor, listType: ListType): void;
/**
* @deprecated use {@link $removeList} from an update or command listener.
*
* Searches for the nearest ancestral ListNode and removes it. If selection is an empty ListItemNode
* it will remove the whole list, including the ListItemNode. For each ListItemNode in the ListNode,
* removeList will also generate new ParagraphNodes in the removed ListNode's place. Any child node
* inside a ListItemNode will be appended to the new ParagraphNodes.
* @param editor - The lexical editor.
*/
export declare function removeList(editor: LexicalEditor): void;

@@ -155,64 +155,61 @@ /**

* a new ListNode, or create a new ListNode at the nearest root/shadow root.
* @param editor - The lexical editor.
* @param listType - The type of list, "number" | "bullet" | "check".
*/
function insertList(editor, listType) {
editor.update(() => {
const selection = lexical.$getSelection();
if (selection !== null) {
const nodes = selection.getNodes();
if (lexical.$isRangeSelection(selection)) {
const anchorAndFocus = selection.getStartEndPoints();
if (!(anchorAndFocus !== null)) {
throw Error(`insertList: anchor should be defined`);
}
const [anchor] = anchorAndFocus;
const anchorNode = anchor.getNode();
const anchorNodeParent = anchorNode.getParent();
if ($isSelectingEmptyListItem(anchorNode, nodes)) {
const list = $createListNode(listType);
if (lexical.$isRootOrShadowRoot(anchorNodeParent)) {
anchorNode.replace(list);
const listItem = $createListItemNode();
if (lexical.$isElementNode(anchorNode)) {
listItem.setFormat(anchorNode.getFormatType());
listItem.setIndent(anchorNode.getIndent());
}
list.append(listItem);
} else if ($isListItemNode(anchorNode)) {
const parent = anchorNode.getParentOrThrow();
append(list, parent.getChildren());
parent.replace(list);
function $insertList(listType) {
const selection = lexical.$getSelection();
if (selection !== null) {
const nodes = selection.getNodes();
if (lexical.$isRangeSelection(selection)) {
const anchorAndFocus = selection.getStartEndPoints();
if (!(anchorAndFocus !== null)) {
throw Error(`insertList: anchor should be defined`);
}
const [anchor] = anchorAndFocus;
const anchorNode = anchor.getNode();
const anchorNodeParent = anchorNode.getParent();
if ($isSelectingEmptyListItem(anchorNode, nodes)) {
const list = $createListNode(listType);
if (lexical.$isRootOrShadowRoot(anchorNodeParent)) {
anchorNode.replace(list);
const listItem = $createListItemNode();
if (lexical.$isElementNode(anchorNode)) {
listItem.setFormat(anchorNode.getFormatType());
listItem.setIndent(anchorNode.getIndent());
}
return;
list.append(listItem);
} else if ($isListItemNode(anchorNode)) {
const parent = anchorNode.getParentOrThrow();
append(list, parent.getChildren());
parent.replace(list);
}
return;
}
const handled = new Set();
for (let i = 0; i < nodes.length; i++) {
const node = nodes[i];
if (lexical.$isElementNode(node) && node.isEmpty() && !$isListItemNode(node) && !handled.has(node.getKey())) {
$createListOrMerge(node, listType);
continue;
}
if (lexical.$isLeafNode(node)) {
let parent = node.getParent();
while (parent != null) {
const parentKey = parent.getKey();
if ($isListNode(parent)) {
if (!handled.has(parentKey)) {
const newListNode = $createListNode(listType);
append(newListNode, parent.getChildren());
parent.replace(newListNode);
handled.add(parentKey);
}
}
const handled = new Set();
for (let i = 0; i < nodes.length; i++) {
const node = nodes[i];
if (lexical.$isElementNode(node) && node.isEmpty() && !$isListItemNode(node) && !handled.has(node.getKey())) {
$createListOrMerge(node, listType);
continue;
}
if (lexical.$isLeafNode(node)) {
let parent = node.getParent();
while (parent != null) {
const parentKey = parent.getKey();
if ($isListNode(parent)) {
if (!handled.has(parentKey)) {
const newListNode = $createListNode(listType);
append(newListNode, parent.getChildren());
parent.replace(newListNode);
handled.add(parentKey);
}
break;
} else {
const nextParent = parent.getParent();
if (lexical.$isRootOrShadowRoot(nextParent) && !handled.has(parentKey)) {
handled.add(parentKey);
$createListOrMerge(parent, listType);
break;
} else {
const nextParent = parent.getParent();
if (lexical.$isRootOrShadowRoot(nextParent) && !handled.has(parentKey)) {
handled.add(parentKey);
$createListOrMerge(parent, listType);
break;
}
parent = nextParent;
}
parent = nextParent;
}

@@ -222,3 +219,3 @@ }

}
});
}
}

@@ -286,51 +283,48 @@ function append(node, nodesToAppend) {

* inside a ListItemNode will be appended to the new ParagraphNodes.
* @param editor - The lexical editor.
*/
function removeList(editor) {
editor.update(() => {
const selection = lexical.$getSelection();
if (lexical.$isRangeSelection(selection)) {
const listNodes = new Set();
const nodes = selection.getNodes();
const anchorNode = selection.anchor.getNode();
if ($isSelectingEmptyListItem(anchorNode, nodes)) {
listNodes.add($getTopListNode(anchorNode));
} else {
for (let i = 0; i < nodes.length; i++) {
const node = nodes[i];
if (lexical.$isLeafNode(node)) {
const listItemNode = utils.$getNearestNodeOfType(node, ListItemNode);
if (listItemNode != null) {
listNodes.add($getTopListNode(listItemNode));
}
function $removeList() {
const selection = lexical.$getSelection();
if (lexical.$isRangeSelection(selection)) {
const listNodes = new Set();
const nodes = selection.getNodes();
const anchorNode = selection.anchor.getNode();
if ($isSelectingEmptyListItem(anchorNode, nodes)) {
listNodes.add($getTopListNode(anchorNode));
} else {
for (let i = 0; i < nodes.length; i++) {
const node = nodes[i];
if (lexical.$isLeafNode(node)) {
const listItemNode = utils.$getNearestNodeOfType(node, ListItemNode);
if (listItemNode != null) {
listNodes.add($getTopListNode(listItemNode));
}
}
}
for (const listNode of listNodes) {
let insertionPoint = listNode;
const listItems = $getAllListItems(listNode);
for (const listItemNode of listItems) {
const paragraph = lexical.$createParagraphNode();
append(paragraph, listItemNode.getChildren());
insertionPoint.insertAfter(paragraph);
insertionPoint = paragraph;
}
for (const listNode of listNodes) {
let insertionPoint = listNode;
const listItems = $getAllListItems(listNode);
for (const listItemNode of listItems) {
const paragraph = lexical.$createParagraphNode();
append(paragraph, listItemNode.getChildren());
insertionPoint.insertAfter(paragraph);
insertionPoint = paragraph;
// When the anchor and focus fall on the textNode
// we don't have to change the selection because the textNode will be appended to
// the newly generated paragraph.
// When selection is in empty nested list item, selection is actually on the listItemNode.
// When the corresponding listItemNode is deleted and replaced by the newly generated paragraph
// we should manually set the selection's focus and anchor to the newly generated paragraph.
if (listItemNode.__key === selection.anchor.key) {
selection.anchor.set(paragraph.getKey(), 0, 'element');
}
if (listItemNode.__key === selection.focus.key) {
selection.focus.set(paragraph.getKey(), 0, 'element');
}
listItemNode.remove();
// When the anchor and focus fall on the textNode
// we don't have to change the selection because the textNode will be appended to
// the newly generated paragraph.
// When selection is in empty nested list item, selection is actually on the listItemNode.
// When the corresponding listItemNode is deleted and replaced by the newly generated paragraph
// we should manually set the selection's focus and anchor to the newly generated paragraph.
if (listItemNode.__key === selection.anchor.key) {
selection.anchor.set(paragraph.getKey(), 0, 'element');
}
listNode.remove();
if (listItemNode.__key === selection.focus.key) {
selection.focus.set(paragraph.getKey(), 0, 'element');
}
listItemNode.remove();
}
listNode.remove();
}
});
}
}

@@ -1269,9 +1263,9 @@

const removeListener = utils.mergeRegister(editor.registerCommand(INSERT_ORDERED_LIST_COMMAND, () => {
insertList(editor, 'number');
$insertList('number');
return true;
}, lexical.COMMAND_PRIORITY_LOW), editor.registerCommand(INSERT_UNORDERED_LIST_COMMAND, () => {
insertList(editor, 'bullet');
$insertList('bullet');
return true;
}, lexical.COMMAND_PRIORITY_LOW), editor.registerCommand(REMOVE_LIST_COMMAND, () => {
removeList(editor);
$removeList();
return true;

@@ -1288,2 +1282,31 @@ }, lexical.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical.INSERT_PARAGRAPH_COMMAND, () => {

/**
* @deprecated use {@link $insertList} from an update or command listener.
*
* Inserts a new ListNode. If the selection's anchor node is an empty ListItemNode and is a child of
* the root/shadow root, it will replace the ListItemNode with a ListNode and the old ListItemNode.
* Otherwise it will replace its parent with a new ListNode and re-insert the ListItemNode and any previous children.
* If the selection's anchor node is not an empty ListItemNode, it will add a new ListNode or merge an existing ListNode,
* unless the the node is a leaf node, in which case it will attempt to find a ListNode up the branch and replace it with
* a new ListNode, or create a new ListNode at the nearest root/shadow root.
* @param editor - The lexical editor.
* @param listType - The type of list, "number" | "bullet" | "check".
*/
function insertList(editor, listType) {
editor.update(() => $insertList(listType));
}
/**
* @deprecated use {@link $removeList} from an update or command listener.
*
* Searches for the nearest ancestral ListNode and removes it. If selection is an empty ListItemNode
* it will remove the whole list, including the ListItemNode. For each ListItemNode in the ListNode,
* removeList will also generate new ParagraphNodes in the removed ListNode's place. Any child node
* inside a ListItemNode will be appended to the new ParagraphNodes.
* @param editor - The lexical editor.
*/
function removeList(editor) {
editor.update(() => $removeList());
}
exports.$createListItemNode = $createListItemNode;

@@ -1293,4 +1316,6 @@ exports.$createListNode = $createListNode;

exports.$handleListInsertParagraph = $handleListInsertParagraph;
exports.$insertList = $insertList;
exports.$isListItemNode = $isListItemNode;
exports.$isListNode = $isListNode;
exports.$removeList = $removeList;
exports.INSERT_CHECK_LIST_COMMAND = INSERT_CHECK_LIST_COMMAND;

@@ -1297,0 +1322,0 @@ exports.INSERT_ORDERED_LIST_COMMAND = INSERT_ORDERED_LIST_COMMAND;

@@ -9,34 +9,34 @@ /**

'use strict';var g=require("@lexical/utils"),h=require("lexical"),l;function n(a){let b=new URLSearchParams;b.append("code",a);for(let c=1;c<arguments.length;c++)b.append("v",arguments[c]);throw Error(`Minified Lexical error #${a}; visit https://lexical.dev/docs/error?${b} for the full message or `+"use the non-minified dev environment for full errors and additional helpful warnings.");}l=n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n["default"]:n;
function p(a){let b=1;for(a=a.getParent();null!=a;){if(q(a)){a=a.getParent();if(r(a)){b++;a=a.getParent();continue}l(40)}break}return b}function t(a){a=a.getParent();r(a)||l(40);let b=a;for(;null!==b;)b=b.getParent(),r(b)&&(a=b);return a}function u(a){let b=[];a=a.getChildren().filter(q);for(let c=0;c<a.length;c++){let d=a[c],e=d.getFirstChild();r(e)?b=b.concat(u(e)):b.push(d)}return b}function v(a){return q(a)&&r(a.getFirstChild())}function w(a){return x().append(a)}
function y(a,b){return q(a)&&(0===b.length||1===b.length&&a.is(b[0])&&0===a.getChildrenSize())}
function z(a,b){a.update(()=>{var c=h.$getSelection();if(null!==c){var d=c.getNodes();if(h.$isRangeSelection(c)){c=c.getStartEndPoints();null===c&&l(143);[c]=c;c=c.getNode();var e=c.getParent();if(y(c,d)){d=A(b);h.$isRootOrShadowRoot(e)?(c.replace(d),e=x(),h.$isElementNode(c)&&(e.setFormat(c.getFormatType()),e.setIndent(c.getIndent())),d.append(e)):q(c)&&(c=c.getParentOrThrow(),B(d,c.getChildren()),c.replace(d));return}}c=new Set;for(e=0;e<d.length;e++){var f=d[e];if(h.$isElementNode(f)&&f.isEmpty()&&
!q(f)&&!c.has(f.getKey()))E(f,b);else if(h.$isLeafNode(f))for(f=f.getParent();null!=f;){let m=f.getKey();if(r(f)){if(!c.has(m)){var k=A(b);B(k,f.getChildren());f.replace(k);c.add(m)}break}else{k=f.getParent();if(h.$isRootOrShadowRoot(k)&&!c.has(m)){c.add(m);E(f,b);break}f=k}}}}})}function B(a,b){a.splice(a.getChildrenSize(),0,b)}
function E(a,b){if(r(a))return a;let c=a.getPreviousSibling(),d=a.getNextSibling(),e=x();B(e,a.getChildren());r(c)&&b===c.getListType()?(c.append(e),r(d)&&b===d.getListType()&&(B(c,d.getChildren()),d.remove()),b=c):r(d)&&b===d.getListType()?(d.getFirstChildOrThrow().insertBefore(e),b=d):(b=A(b),b.append(e),a.replace(b));e.setFormat(a.getFormatType());e.setIndent(a.getIndent());a.remove();return b}
'use strict';var g=require("@lexical/utils"),h=require("lexical"),l;function m(a){let b=new URLSearchParams;b.append("code",a);for(let c=1;c<arguments.length;c++)b.append("v",arguments[c]);throw Error(`Minified Lexical error #${a}; visit https://lexical.dev/docs/error?${b} for the full message or `+"use the non-minified dev environment for full errors and additional helpful warnings.");}l=m&&m.__esModule&&Object.prototype.hasOwnProperty.call(m,"default")?m["default"]:m;
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}l(40)}break}return b}function t(a){a=a.getParent();q(a)||l(40);let b=a;for(;null!==b;)b=b.getParent(),q(b)&&(a=b);return a}function u(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(u(e)):b.push(d)}return b}function v(a){return p(a)&&q(a.getFirstChild())}function w(a){return x().append(a)}
function y(a,b){return p(a)&&(0===b.length||1===b.length&&a.is(b[0])&&0===a.getChildrenSize())}
function z(a){var b=h.$getSelection();if(null!==b){var c=b.getNodes();if(h.$isRangeSelection(b)){b=b.getStartEndPoints();null===b&&l(143);[b]=b;b=b.getNode();var d=b.getParent();if(y(b,c)){a=A(a);h.$isRootOrShadowRoot(d)?(b.replace(a),c=x(),h.$isElementNode(b)&&(c.setFormat(b.getFormatType()),c.setIndent(b.getIndent())),a.append(c)):p(b)&&(c=b.getParentOrThrow(),B(a,c.getChildren()),c.replace(a));return}}b=new Set;for(d=0;d<c.length;d++){var e=c[d];if(h.$isElementNode(e)&&e.isEmpty()&&!p(e)&&!b.has(e.getKey()))C(e,
a);else if(h.$isLeafNode(e))for(e=e.getParent();null!=e;){let k=e.getKey();if(q(e)){if(!b.has(k)){var f=A(a);B(f,e.getChildren());e.replace(f);b.add(k)}break}else{f=e.getParent();if(h.$isRootOrShadowRoot(f)&&!b.has(k)){b.add(k);C(e,a);break}e=f}}}}}function B(a,b){a.splice(a.getChildrenSize(),0,b)}
function C(a,b){if(q(a))return a;let c=a.getPreviousSibling(),d=a.getNextSibling(),e=x();B(e,a.getChildren());q(c)&&b===c.getListType()?(c.append(e),q(d)&&b===d.getListType()&&(B(c,d.getChildren()),d.remove()),b=c):q(d)&&b===d.getListType()?(d.getFirstChildOrThrow().insertBefore(e),b=d):(b=A(b),b.append(e),a.replace(b));e.setFormat(a.getFormatType());e.setIndent(a.getIndent());a.remove();return b}
function F(a,b){var c=a.getLastChild();let d=b.getFirstChild();c&&d&&v(c)&&v(d)&&(F(c.getFirstChild(),d.getFirstChild()),d.remove());c=b.getChildren();0<c.length&&a.append(...c);b.remove()}
function G(a){a.update(()=>{let b=h.$getSelection();if(h.$isRangeSelection(b)){var c=new Set,d=b.getNodes(),e=b.anchor.getNode();if(y(e,d))c.add(t(e));else for(e=0;e<d.length;e++){var f=d[e];h.$isLeafNode(f)&&(f=g.$getNearestNodeOfType(f,H),null!=f&&c.add(t(f)))}for(let k of c){c=k;d=u(k);for(let m of d)d=h.$createParagraphNode(),B(d,m.getChildren()),c.insertAfter(d),c=d,m.__key===b.anchor.key&&b.anchor.set(d.getKey(),0,"element"),m.__key===b.focus.key&&b.focus.set(d.getKey(),0,"element"),m.remove();
k.remove()}}})}
function I(a){if(!v(a)){var b=a.getParent(),c=b?b.getParent():void 0,d=c?c.getParent():void 0;if(r(d)&&q(c)&&r(b)){d=b?b.getFirstChild():void 0;var e=b?b.getLastChild():void 0;if(a.is(d))c.insertBefore(a),b.isEmpty()&&c.remove();else if(a.is(e))c.insertAfter(a),b.isEmpty()&&c.remove();else{e=b.getListType();b=x();let f=A(e);b.append(f);a.getPreviousSiblings().forEach(k=>f.append(k));d=x();e=A(e);d.append(e);B(e,a.getNextSiblings());c.insertBefore(b);c.insertAfter(d);c.replace(a)}}}}
function J(){var a=h.$getSelection();if(!h.$isRangeSelection(a)||!a.isCollapsed())return!1;var b=a.anchor.getNode();if(!q(b)||0!==b.getChildrenSize())return!1;var c=t(b),d=b.getParent();r(d)||l(40);let e=d.getParent();if(h.$isRootOrShadowRoot(e)){var f=h.$createParagraphNode();f.setTextStyle(a.style);f.setTextFormat(a.format);c.insertAfter(f)}else if(q(e))f=x(),e.insertAfter(f);else return!1;f.select();a=b.getNextSiblings();0<a.length&&(d=A(d.getListType()),q(f)?(c=x(),c.append(d),f.insertAfter(c)):
f.insertAfter(d),d.append(...a));for(;null==b.getNextSibling()&&null==b.getPreviousSibling();){f=b.getParent();if(null==f||!q(b)&&!r(b))break;b=f}b.remove();return!0}function K(...a){let b=[];for(let c of a)if(c&&"string"===typeof c)for(let [d]of c.matchAll(/\S+/g))b.push(d);return b}
class H extends h.ElementNode{static getType(){return"listitem"}static clone(a){return new H(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();r(c)&&"check"===c.getListType()&&L(b,this,null);b.value=this.__value;M(b,a.theme,this);return b}updateDOM(a,b,c){let d=this.getParent();r(d)&&"check"===d.getListType()&&L(b,this,a);b.value=this.__value;M(b,c.theme,this);return!1}static transform(){return a=>
{q(a)||l(144);if(null!=a.__checked){var b=a.getParent();r(b)&&"check"!==b.getListType()&&null!=a.getChecked()&&a.setChecked(void 0)}}}static importDOM(){return{li:()=>({conversion:N,priority:0})}}static importJSON(a){return x().updateFromJSON(a)}updateFromJSON(a){return super.updateFromJSON(a).setValue(a.value).setChecked(a.checked)}exportDOM(a){a=this.createDOM(a._config);a.style.textAlign=this.getFormatType();return{element:a}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),
value:this.getValue()}}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(q(a))return super.replace(a);this.setIndent(0);let c=this.getParentOrThrow();if(!r(c))return a;if(c.__first===this.getKey())c.insertBefore(a);else if(c.__last===this.getKey())c.insertAfter(a);else{let d=A(c.getListType()),e=this.getNextSibling();for(;e;){let f=e;e=e.getNextSibling();
d.append(f)}c.insertAfter(a);a.insertAfter(d)}b&&(h.$isElementNode(a)||l(139),this.getChildren().forEach(d=>{a.append(d)}));this.remove();0===c.getChildrenSize()&&c.remove();return a}insertAfter(a,b=!0){let c=this.getParentOrThrow();r(c)||l(39);if(q(a))return super.insertAfter(a,b);let d=this.getNextSiblings();c.insertAfter(a,b);if(0!==d.length){let e=A(c.getListType());d.forEach(f=>e.append(f));a.insertAfter(e,b)}return a}remove(a){let b=this.getPreviousSibling(),c=this.getNextSibling();super.remove(a);
b&&c&&v(b)&&v(c)&&(F(b.getFirstChild(),c.getFirstChild()),c.remove())}insertNewAfter(a,b=!0){a=x().updateFromJSON(this.exportJSON()).setChecked(this.getChecked()?!1:void 0);this.insertAfter(a,b);return a}collapseAtStart(a){let b=h.$createParagraphNode();this.getChildren().forEach(f=>b.append(f));var c=this.getParentOrThrow(),d=c.getParentOrThrow();let e=q(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){let b=this.getWritable();b.__value=a;return b}getChecked(){let a=this.getLatest(),b,c=this.getParent();r(c)&&(b=c.getListType());return"check"===b?!!a.__checked:void 0}setChecked(a){let b=this.getWritable();b.__checked=a;return b}toggleChecked(){let a=this.getWritable();return a.setChecked(!a.__checked)}getIndent(){var a=
this.getParent();if(null===a)return this.getLatest().__indent;a=a.getParentOrThrow();let b=0;for(;q(a);)a=a.getParentOrThrow().getParentOrThrow(),b++;return b}setIndent(a){"number"!==typeof a&&l(117);a=Math.floor(a);0<=a||l(199);let b=this.getIndent();for(;b!==a;)if(b<a){var c=new Set;if(!v(this)&&!c.has(this.getKey())){var d=this.getParent(),e=this.getNextSibling(),f=this.getPreviousSibling();if(v(e)&&v(f))d=f.getFirstChild(),r(d)&&(d.append(this),f=e.getFirstChild(),r(f)&&(f=f.getChildren(),B(d,
f),e.remove(),c.add(e.getKey())));else if(v(e))e=e.getFirstChild(),r(e)&&(e=e.getFirstChild(),null!==e&&e.insertBefore(this));else if(v(f))e=f.getFirstChild(),r(e)&&e.append(this);else if(r(d)){c=x();let k=A(d.getListType());c.append(k);k.append(this);f?f.insertAfter(c):e?e.insertBefore(c):d.append(c)}}b++}else I(this),b--;return this}canInsertAfter(a){return q(a)}canReplaceWith(a){return q(a)}canMergeWith(a){return q(a)||h.$isParagraphNode(a)}extractWithChild(a,b){if(!h.$isRangeSelection(b))return!1;
function G(){let a=h.$getSelection();if(h.$isRangeSelection(a)){var b=new Set,c=a.getNodes(),d=a.anchor.getNode();if(y(d,c))b.add(t(d));else for(d=0;d<c.length;d++){var e=c[d];h.$isLeafNode(e)&&(e=g.$getNearestNodeOfType(e,H),null!=e&&b.add(t(e)))}for(let f of b){b=f;c=u(f);for(let k of c)c=h.$createParagraphNode(),B(c,k.getChildren()),b.insertAfter(c),b=c,k.__key===a.anchor.key&&a.anchor.set(c.getKey(),0,"element"),k.__key===a.focus.key&&a.focus.set(c.getKey(),0,"element"),k.remove();f.remove()}}}
function I(a){if(!v(a)){var b=a.getParent(),c=b?b.getParent():void 0,d=c?c.getParent():void 0;if(q(d)&&p(c)&&q(b)){d=b?b.getFirstChild():void 0;var e=b?b.getLastChild():void 0;if(a.is(d))c.insertBefore(a),b.isEmpty()&&c.remove();else if(a.is(e))c.insertAfter(a),b.isEmpty()&&c.remove();else{e=b.getListType();b=x();let f=A(e);b.append(f);a.getPreviousSiblings().forEach(k=>f.append(k));d=x();e=A(e);d.append(e);B(e,a.getNextSiblings());c.insertBefore(b);c.insertAfter(d);c.replace(a)}}}}
function J(){var a=h.$getSelection();if(!h.$isRangeSelection(a)||!a.isCollapsed())return!1;var b=a.anchor.getNode();if(!p(b)||0!==b.getChildrenSize())return!1;var c=t(b),d=b.getParent();q(d)||l(40);let e=d.getParent();if(h.$isRootOrShadowRoot(e)){var f=h.$createParagraphNode();f.setTextStyle(a.style);f.setTextFormat(a.format);c.insertAfter(f)}else if(p(e))f=x(),e.insertAfter(f);else return!1;f.select();a=b.getNextSiblings();0<a.length&&(d=A(d.getListType()),p(f)?(c=x(),c.append(d),f.insertAfter(c)):
f.insertAfter(d),d.append(...a));for(;null==b.getNextSibling()&&null==b.getPreviousSibling();){f=b.getParent();if(null==f||!p(b)&&!q(b))break;b=f}b.remove();return!0}function K(...a){let b=[];for(let c of a)if(c&&"string"===typeof c)for(let [d]of c.matchAll(/\S+/g))b.push(d);return b}
class H extends h.ElementNode{static getType(){return"listitem"}static clone(a){return new H(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)&&"check"===c.getListType()&&L(b,this,null);b.value=this.__value;M(b,a.theme,this);return b}updateDOM(a,b,c){let d=this.getParent();q(d)&&"check"===d.getListType()&&L(b,this,a);b.value=this.__value;M(b,c.theme,this);return!1}static transform(){return a=>
{p(a)||l(144);if(null!=a.__checked){var b=a.getParent();q(b)&&"check"!==b.getListType()&&null!=a.getChecked()&&a.setChecked(void 0)}}}static importDOM(){return{li:()=>({conversion:N,priority:0})}}static importJSON(a){return x().updateFromJSON(a)}updateFromJSON(a){return super.updateFromJSON(a).setValue(a.value).setChecked(a.checked)}exportDOM(a){a=this.createDOM(a._config);a.style.textAlign=this.getFormatType();return{element:a}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),
value:this.getValue()}}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);this.setIndent(0);let c=this.getParentOrThrow();if(!q(c))return a;if(c.__first===this.getKey())c.insertBefore(a);else if(c.__last===this.getKey())c.insertAfter(a);else{let d=A(c.getListType()),e=this.getNextSibling();for(;e;){let f=e;e=e.getNextSibling();
d.append(f)}c.insertAfter(a);a.insertAfter(d)}b&&(h.$isElementNode(a)||l(139),this.getChildren().forEach(d=>{a.append(d)}));this.remove();0===c.getChildrenSize()&&c.remove();return a}insertAfter(a,b=!0){let c=this.getParentOrThrow();q(c)||l(39);if(p(a))return super.insertAfter(a,b);let d=this.getNextSiblings();c.insertAfter(a,b);if(0!==d.length){let e=A(c.getListType());d.forEach(f=>e.append(f));a.insertAfter(e,b)}return a}remove(a){let b=this.getPreviousSibling(),c=this.getNextSibling();super.remove(a);
b&&c&&v(b)&&v(c)&&(F(b.getFirstChild(),c.getFirstChild()),c.remove())}insertNewAfter(a,b=!0){a=x().updateFromJSON(this.exportJSON()).setChecked(this.getChecked()?!1:void 0);this.insertAfter(a,b);return a}collapseAtStart(a){let b=h.$createParagraphNode();this.getChildren().forEach(f=>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){let b=this.getWritable();b.__value=a;return b}getChecked(){let a=this.getLatest(),b,c=this.getParent();q(c)&&(b=c.getListType());return"check"===b?!!a.__checked:void 0}setChecked(a){let b=this.getWritable();b.__checked=a;return b}toggleChecked(){let a=this.getWritable();return a.setChecked(!a.__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){"number"!==typeof a&&l(117);a=Math.floor(a);0<=a||l(199);let b=this.getIndent();for(;b!==a;)if(b<a){var c=new Set;if(!v(this)&&!c.has(this.getKey())){var d=this.getParent(),e=this.getNextSibling(),f=this.getPreviousSibling();if(v(e)&&v(f))d=f.getFirstChild(),q(d)&&(d.append(this),f=e.getFirstChild(),q(f)&&(f=f.getChildren(),B(d,
f),e.remove(),c.add(e.getKey())));else if(v(e))e=e.getFirstChild(),q(e)&&(e=e.getFirstChild(),null!==e&&e.insertBefore(this));else if(v(f))e=f.getFirstChild(),q(e)&&e.append(this);else if(q(d)){c=x();let k=A(d.getListType());c.append(k);k.append(this);f?f.insertAfter(c):e?e.insertBefore(c):d.append(c)}}b++}else I(this),b--;return this}canInsertAfter(a){return p(a)}canReplaceWith(a){return p(a)}canMergeWith(a){return p(a)||h.$isParagraphNode(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 A("bullet")}canMergeWhenEmpty(){return!0}}
function M(a,b,c){let d=[],e=[];var f=(b=b.list)?b.listitem:void 0;if(b&&b.nested)var k=b.nested.listitem;void 0!==f&&d.push(...K(f));if(b){f=c.getParent();f=r(f)&&"check"===f.getListType();let m=c.getChecked();f&&!m||e.push(b.listitemUnchecked);f&&m||e.push(b.listitemChecked);f&&d.push(m?b.listitemChecked:b.listitemUnchecked)}void 0!==k&&(k=K(k),c.getChildren().some(m=>r(m))?d.push(...k):e.push(...k));0<e.length&&g.removeClassNamesFromElement(a,...e);0<d.length&&g.addClassNamesToElement(a,...d)}
function L(a,b,c){r(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"))}
function N(a){if(a.classList.contains("task-list-item"))for(let b of a.children)if("INPUT"===b.tagName)return a=b,"checkbox"!==a.getAttribute("type")?a={node:null}:(a=a.hasAttribute("checked"),a={node:x(a)}),a;a=a.getAttribute("aria-checked");return{node:x("true"===a?!0:"false"===a?!1:void 0)}}function x(a){return h.$applyNodeReplacement(new H(void 0,a))}function q(a){return a instanceof H}
function M(a,b,c){let d=[],e=[];var f=(b=b.list)?b.listitem:void 0;if(b&&b.nested)var k=b.nested.listitem;void 0!==f&&d.push(...K(f));if(b){f=c.getParent();f=q(f)&&"check"===f.getListType();let r=c.getChecked();f&&!r||e.push(b.listitemUnchecked);f&&r||e.push(b.listitemChecked);f&&d.push(r?b.listitemChecked:b.listitemUnchecked)}void 0!==k&&(k=K(k),c.getChildren().some(r=>q(r))?d.push(...k):e.push(...k));0<e.length&&g.removeClassNamesFromElement(a,...e);0<d.length&&g.addClassNamesToElement(a,...d)}
function L(a,b,c){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"))}
function N(a){if(a.classList.contains("task-list-item"))for(let b of a.children)if("INPUT"===b.tagName)return a=b,"checkbox"!==a.getAttribute("type")?a={node:null}:(a=a.hasAttribute("checked"),a={node:x(a)}),a;a=a.getAttribute("aria-checked");return{node:x("true"===a?!0:"false"===a?!1:void 0)}}function x(a){return h.$applyNodeReplacement(new H(void 0,a))}function p(a){return a instanceof H}
class O extends h.ElementNode{static getType(){return"list"}static clone(a){return new O(a.__listType||P[a.__tag],a.__start,a.__key)}constructor(a="number",b=1,c){super(c);this.__listType=a=P[a]||a;this.__tag="number"===a?"ol":"ul";this.__start=b}getTag(){return this.__tag}setListType(a){let b=this.getWritable();b.__listType=a;b.__tag="number"===a?"ol":"ul";return b}getListType(){return this.__listType}getStart(){return this.__start}setStart(a){let b=this.getWritable();b.__start=a;return b}createDOM(a){let b=
document.createElement(this.__tag);1!==this.__start&&b.setAttribute("start",String(this.__start));b.__lexicalListType=this.__listType;S(b,a.theme,this);return b}updateDOM(a,b,c){if(a.__tag!==this.__tag)return!0;S(b,c.theme,this);return!1}static transform(){return a=>{r(a)||l(163);var b=a.getNextSibling();r(b)&&a.getListType()===b.getListType()&&F(a,b);b="check"!==a.getListType();let c=a.getStart();for(let d of a.getChildren())q(d)&&(d.getValue()!==c&&d.setValue(c),b&&null!=d.getLatest().__checked&&
d.setChecked(void 0),r(d.getFirstChild())||c++)}}static importDOM(){return{ol:()=>({conversion:T,priority:0}),ul:()=>({conversion:T,priority:0})}}static importJSON(a){return A().updateFromJSON(a)}updateFromJSON(a){return super.updateFromJSON(a).setListType(a.listType).setStart(a.start)}exportDOM(a){a=this.createDOM(a._config,a);g.isHTMLElement(a)&&(1!==this.__start&&a.setAttribute("start",String(this.__start)),"check"===this.__listType&&a.setAttribute("__lexicalListType","check"));return{element:a}}exportJSON(){return{...super.exportJSON(),
listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}append(...a){for(let c=0;c<a.length;c++){var b=a[c];if(q(b))super.append(b);else{let d=x();r(b)?d.append(b):h.$isElementNode(b)?b.isInline()?d.append(b):(b=h.$createTextNode(b.getTextContent()),d.append(b)):d.append(b);super.append(d)}}return this}extractWithChild(a){return q(a)}}
function S(a,b,c){let d=[],e=[];var f=b.list;if(void 0!==f){let m=f[`${c.__tag}Depth`]||[];b=p(c)-1;let Q=b%m.length;var k=m[Q];let R=f[c.__tag],C,D=f.nested;f=f.checklist;void 0!==D&&D.list&&(C=D.list);void 0!==R&&d.push(R);void 0!==f&&"check"===c.__listType&&d.push(f);if(void 0!==k)for(d.push(...K(k)),k=0;k<m.length;k++)k!==Q&&e.push(c.__tag+k);void 0!==C&&(c=K(C),1<b?d.push(...c):e.push(...c))}0<e.length&&g.removeClassNamesFromElement(a,...e);0<d.length&&g.addClassNamesToElement(a,...d)}
function U(a){let b=[];for(let d=0;d<a.length;d++){var c=a[d];q(c)?(b.push(c),c=c.getChildren(),1<c.length&&c.forEach(e=>{r(e)&&b.push(w(e))})):b.push(w(c))}return b}
function T(a){let b=a.nodeName.toLowerCase(),c=null;if("ol"===b)c=A("number",a.start);else if("ul"===b){a:if("check"===a.getAttribute("__lexicallisttype")||a.classList.contains("contains-task-list"))a=!0;else{for(let d of a.childNodes)if(g.isHTMLElement(d)&&d.hasAttribute("aria-checked")){a=!0;break a}a=!1}c=a?A("check"):A("bullet")}return{after:U,node:c}}let P={ol:"number",ul:"bullet"};function A(a="number",b=1){return h.$applyNodeReplacement(new O(a,b))}function r(a){return a instanceof O}
let V=h.createCommand("INSERT_UNORDERED_LIST_COMMAND"),W=h.createCommand("INSERT_ORDERED_LIST_COMMAND"),X=h.createCommand("INSERT_CHECK_LIST_COMMAND"),Y=h.createCommand("REMOVE_LIST_COMMAND");exports.$createListItemNode=x;exports.$createListNode=A;exports.$getListDepth=p;exports.$handleListInsertParagraph=J;exports.$isListItemNode=q;exports.$isListNode=r;exports.INSERT_CHECK_LIST_COMMAND=X;exports.INSERT_ORDERED_LIST_COMMAND=W;exports.INSERT_UNORDERED_LIST_COMMAND=V;exports.ListItemNode=H;
exports.ListNode=O;exports.REMOVE_LIST_COMMAND=Y;exports.insertList=z;exports.registerList=function(a){return g.mergeRegister(a.registerCommand(W,()=>{z(a,"number");return!0},h.COMMAND_PRIORITY_LOW),a.registerCommand(V,()=>{z(a,"bullet");return!0},h.COMMAND_PRIORITY_LOW),a.registerCommand(Y,()=>{G(a);return!0},h.COMMAND_PRIORITY_LOW),a.registerCommand(h.INSERT_PARAGRAPH_COMMAND,()=>J()?!0:!1,h.COMMAND_PRIORITY_LOW))};exports.removeList=G
document.createElement(this.__tag);1!==this.__start&&b.setAttribute("start",String(this.__start));b.__lexicalListType=this.__listType;S(b,a.theme,this);return b}updateDOM(a,b,c){if(a.__tag!==this.__tag)return!0;S(b,c.theme,this);return!1}static transform(){return a=>{q(a)||l(163);var b=a.getNextSibling();q(b)&&a.getListType()===b.getListType()&&F(a,b);b="check"!==a.getListType();let c=a.getStart();for(let d of a.getChildren())p(d)&&(d.getValue()!==c&&d.setValue(c),b&&null!=d.getLatest().__checked&&
d.setChecked(void 0),q(d.getFirstChild())||c++)}}static importDOM(){return{ol:()=>({conversion:T,priority:0}),ul:()=>({conversion:T,priority:0})}}static importJSON(a){return A().updateFromJSON(a)}updateFromJSON(a){return super.updateFromJSON(a).setListType(a.listType).setStart(a.start)}exportDOM(a){a=this.createDOM(a._config,a);g.isHTMLElement(a)&&(1!==this.__start&&a.setAttribute("start",String(this.__start)),"check"===this.__listType&&a.setAttribute("__lexicalListType","check"));return{element:a}}exportJSON(){return{...super.exportJSON(),
listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}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=x();q(b)?d.append(b):h.$isElementNode(b)?b.isInline()?d.append(b):(b=h.$createTextNode(b.getTextContent()),d.append(b)):d.append(b);super.append(d)}}return this}extractWithChild(a){return p(a)}}
function S(a,b,c){let d=[],e=[];var f=b.list;if(void 0!==f){let r=f[`${c.__tag}Depth`]||[];b=n(c)-1;let Q=b%r.length;var k=r[Q];let R=f[c.__tag],D,E=f.nested;f=f.checklist;void 0!==E&&E.list&&(D=E.list);void 0!==R&&d.push(R);void 0!==f&&"check"===c.__listType&&d.push(f);if(void 0!==k)for(d.push(...K(k)),k=0;k<r.length;k++)k!==Q&&e.push(c.__tag+k);void 0!==D&&(c=K(D),1<b?d.push(...c):e.push(...c))}0<e.length&&g.removeClassNamesFromElement(a,...e);0<d.length&&g.addClassNamesToElement(a,...d)}
function U(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 T(a){let b=a.nodeName.toLowerCase(),c=null;if("ol"===b)c=A("number",a.start);else if("ul"===b){a:if("check"===a.getAttribute("__lexicallisttype")||a.classList.contains("contains-task-list"))a=!0;else{for(let d of a.childNodes)if(g.isHTMLElement(d)&&d.hasAttribute("aria-checked")){a=!0;break a}a=!1}c=a?A("check"):A("bullet")}return{after:U,node:c}}let P={ol:"number",ul:"bullet"};function A(a="number",b=1){return h.$applyNodeReplacement(new O(a,b))}function q(a){return a instanceof O}
let V=h.createCommand("INSERT_UNORDERED_LIST_COMMAND"),W=h.createCommand("INSERT_ORDERED_LIST_COMMAND"),X=h.createCommand("INSERT_CHECK_LIST_COMMAND"),Y=h.createCommand("REMOVE_LIST_COMMAND");exports.$createListItemNode=x;exports.$createListNode=A;exports.$getListDepth=n;exports.$handleListInsertParagraph=J;exports.$insertList=z;exports.$isListItemNode=p;exports.$isListNode=q;exports.$removeList=G;exports.INSERT_CHECK_LIST_COMMAND=X;exports.INSERT_ORDERED_LIST_COMMAND=W;
exports.INSERT_UNORDERED_LIST_COMMAND=V;exports.ListItemNode=H;exports.ListNode=O;exports.REMOVE_LIST_COMMAND=Y;exports.insertList=function(a,b){a.update(()=>z(b))};exports.registerList=function(a){return g.mergeRegister(a.registerCommand(W,()=>{z("number");return!0},h.COMMAND_PRIORITY_LOW),a.registerCommand(V,()=>{z("bullet");return!0},h.COMMAND_PRIORITY_LOW),a.registerCommand(Y,()=>{G();return!0},h.COMMAND_PRIORITY_LOW),a.registerCommand(h.INSERT_PARAGRAPH_COMMAND,()=>J()?!0:!1,h.COMMAND_PRIORITY_LOW))};
exports.removeList=function(a){a.update(()=>G())}

@@ -11,8 +11,8 @@ {

"license": "MIT",
"version": "0.23.2-nightly.20250110.0",
"version": "0.23.2-nightly.20250113.0",
"main": "LexicalList.js",
"types": "index.d.ts",
"dependencies": {
"@lexical/utils": "0.23.2-nightly.20250110.0",
"lexical": "0.23.2-nightly.20250110.0"
"@lexical/utils": "0.23.2-nightly.20250113.0",
"lexical": "0.23.2-nightly.20250113.0"
},

@@ -19,0 +19,0 @@ "repository": {

@@ -12,8 +12,8 @@ # `@lexical/list`

### insertList
### $insertList
As the name suggests, this inserts a list of the provided type according to an algorithm that tries to determine the best way to do that based on
the current Selection. For instance, if some text is selected, insertList may try to move it into the first item in the list. See the API documentation for more detail.
the current Selection. For instance, if some text is selected, $insertList may try to move it into the first item in the list. See the API documentation for more detail.
### removeList
### $removeList

@@ -47,3 +47,3 @@ Attempts to remove lists inside the current selection based on a set of opinionated heuristics that implement conventional editor behaviors. For instance, it converts empty ListItemNodes into empty ParagraphNodes.

editor.registerCommand(INSERT_UNORDERED_LIST_COMMAND, () => {
insertList(editor, 'bullet');
$insertList(editor, 'bullet');
return true;

@@ -50,0 +50,0 @@ }, COMMAND_PRIORITY_LOW);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc