@lexical/list 0.3.5 → 0.3.8
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.
- package/LexicalList.dev.js +35 -2
- package/LexicalList.prod.js +27 -25
- package/LexicalListItemNode.d.ts +4 -4
- package/formatList.d.ts +2 -2
- package/package.json +3 -3
- package/utils.d.ts +1 -0
package/LexicalList.dev.js
CHANGED
|
@@ -130,6 +130,10 @@ function $removeHighestEmptyListParent(sublist) {
|
|
|
130
130
|
|
|
131
131
|
emptyListPtr.remove();
|
|
132
132
|
}
|
|
133
|
+
function wrapInListItem(node) {
|
|
134
|
+
const listItemWrapper = $createListItemNode();
|
|
135
|
+
return listItemWrapper.append(node);
|
|
136
|
+
}
|
|
133
137
|
|
|
134
138
|
/**
|
|
135
139
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
@@ -337,7 +341,8 @@ function $handleIndent(listItemNodes) {
|
|
|
337
341
|
return;
|
|
338
342
|
}
|
|
339
343
|
|
|
340
|
-
const parent = listItemNode.getParent();
|
|
344
|
+
const parent = listItemNode.getParent(); // We can cast both of the below `isNestedListNode` only returns a boolean type instead of a user-defined type guards
|
|
345
|
+
|
|
341
346
|
const nextSibling = listItemNode.getNextSibling();
|
|
342
347
|
const previousSibling = listItemNode.getPreviousSibling(); // if there are nested lists on either side, merge them all together.
|
|
343
348
|
|
|
@@ -1122,7 +1127,7 @@ function setListThemeClassNames(dom, editorThemeClasses, node) {
|
|
|
1122
1127
|
const listTheme = editorThemeClasses.list;
|
|
1123
1128
|
|
|
1124
1129
|
if (listTheme !== undefined) {
|
|
1125
|
-
const listLevelsClassNames = listTheme[node.__tag
|
|
1130
|
+
const listLevelsClassNames = listTheme[`${node.__tag}Depth`] || [];
|
|
1126
1131
|
const listDepth = $getListDepth(node) - 1;
|
|
1127
1132
|
const normalizedListDepth = listDepth % listLevelsClassNames.length;
|
|
1128
1133
|
const listLevelClassName = listLevelsClassNames[normalizedListDepth];
|
|
@@ -1168,6 +1173,33 @@ function setListThemeClassNames(dom, editorThemeClasses, node) {
|
|
|
1168
1173
|
utils.addClassNamesToElement(dom, ...classesToAdd);
|
|
1169
1174
|
}
|
|
1170
1175
|
}
|
|
1176
|
+
/*
|
|
1177
|
+
* This function normalizes the children of a ListNode after the conversion from HTML,
|
|
1178
|
+
* ensuring that they are all ListItemNodes and contain either a single nested ListNode
|
|
1179
|
+
* or some other inline content.
|
|
1180
|
+
*/
|
|
1181
|
+
|
|
1182
|
+
|
|
1183
|
+
function normalizeChildren(nodes) {
|
|
1184
|
+
const normalizedListItems = [];
|
|
1185
|
+
|
|
1186
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
1187
|
+
const node = nodes[i];
|
|
1188
|
+
|
|
1189
|
+
if ($isListItemNode(node)) {
|
|
1190
|
+
normalizedListItems.push(node);
|
|
1191
|
+
node.getChildren().forEach(child => {
|
|
1192
|
+
if ($isListNode(child)) {
|
|
1193
|
+
normalizedListItems.push(wrapInListItem(child));
|
|
1194
|
+
}
|
|
1195
|
+
});
|
|
1196
|
+
} else {
|
|
1197
|
+
normalizedListItems.push(wrapInListItem(node));
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
return normalizedListItems;
|
|
1202
|
+
}
|
|
1171
1203
|
|
|
1172
1204
|
function convertListNode(domNode) {
|
|
1173
1205
|
const nodeName = domNode.nodeName.toLowerCase();
|
|
@@ -1180,6 +1212,7 @@ function convertListNode(domNode) {
|
|
|
1180
1212
|
}
|
|
1181
1213
|
|
|
1182
1214
|
return {
|
|
1215
|
+
after: normalizeChildren,
|
|
1183
1216
|
node
|
|
1184
1217
|
};
|
|
1185
1218
|
}
|
package/LexicalList.prod.js
CHANGED
|
@@ -4,30 +4,32 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
'use strict';var h=require("lexical"),l=require("@lexical/utils");function m(a){throw Error(`Minified Lexical error #${a};
|
|
8
|
-
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){for(;null==a.getNextSibling()&&null==a.getPreviousSibling();){let b=a.getParent();if(null==b||!p(a)&&!q(a))break;a=b}a.remove()}function x(a
|
|
9
|
-
function A(a,b){
|
|
10
|
-
function
|
|
11
|
-
function F(a){
|
|
12
|
-
f.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
'use strict';var h=require("lexical"),l=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 t(a){a=a.getParent();q(a)||m(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){for(;null==a.getNextSibling()&&null==a.getPreviousSibling();){let b=a.getParent();if(null==b||!p(a)&&!q(a))break;a=b}a.remove()}function x(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();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){(b||a.getChildren()).forEach(c=>{let d=c.getValue();var e=c.getParent();var f=1;null!=e&&(q(e)?f=e.getStart():m(44));e=c.getPreviousSiblings();for(let g=0;g<e.length;g++){let k=e[g];p(k)&&!q(k.getFirstChild())&&f++}d!==f&&c.setValue(f)})}
|
|
12
|
+
function G(a){let b=new Set;a.forEach(c=>{if(!v(c)&&!b.has(c.getKey())){var d=c.getParent(),e=c.getNextSibling(),f=c.getPreviousSibling();if(v(e)&&v(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(v(e))e=e.getFirstChild(),q(e)&&(f=e.getFirstChild(),null!==f&&f.insertBefore(c),F(e));else if(v(f))e=f.getFirstChild(),q(e)&&(e.append(c),F(e));else if(q(d)){let g=z(),k=E(d.getListType());g.append(k);k.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(!v(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 k=c.getListType();f=z();let r=E(k);f.append(r);b.getPreviousSiblings().forEach(y=>r.append(y));g=z();k=E(k);g.append(k);C(k,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){if(p(a))return super.replace(a);let b=this.getParentOrThrow();
|
|
18
|
+
if(q(b)){var c=b.__children;let e=c.length;var d=c.indexOf(this.__key);if(0===d)b.insertBefore(a);else if(d===e-1)b.insertAfter(a);else{c=E(b.getListType());let f=b.getChildren();for(d+=1;d<e;d++)c.append(f[d]);b.insertAfter(a);a.insertAfter(c)}this.remove();1===e&&b.remove()}return a}insertAfter(a){var b=this.getParentOrThrow();q(b)||m(39);var c=this.getNextSiblings();if(p(a))return b=super.insertAfter(a),a=a.getParentOrThrow(),q(a)&&F(a),b;if(q(a)&&a.getListType()===b.getListType()){b=a;a=a.getChildren();
|
|
19
|
+
for(c=a.length-1;0<=c;c--)b=a[c],this.insertAfter(b);return b}b.insertAfter(a);if(0!==c.length){let d=E(b.getListType());c.forEach(e=>d.append(e));a.insertAfter(d)}return a}remove(a){let b=this.getNextSibling();super.remove(a);null!==b&&(a=b.getParent(),q(a)&&F(a))}insertNewAfter(){let a=z(null==this.__checked?void 0:!1);this.insertAfter(a);return a}collapseAtStart(a){let b=h.$createParagraphNode();this.getChildren().forEach(f=>b.append(f));var c=this.getParentOrThrow(),d=c.getParentOrThrow();let e=
|
|
19
20
|
p(d);1===c.getChildrenSize()?e?(c.remove(),d.select()):(c.replace(b),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=a}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){var a=
|
|
20
|
-
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?(
|
|
21
|
+
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)||
|
|
21
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}}
|
|
22
|
-
function
|
|
23
|
-
...d)}function
|
|
24
|
-
class
|
|
25
|
-
return b}updateDOM(a,b,c){if(a.__tag!==this.__tag)return!0;
|
|
26
|
-
0;c<a.length;c++){var b=a[c];if(p(b))super.append(b);else{let d=
|
|
27
|
-
function
|
|
28
|
-
function
|
|
29
|
-
exports.$
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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 k=c.getChecked();f&&!k||e.push(b.listitemUnchecked);f&&k||e.push(b.listitemChecked);f&&d.push(k?b.listitemChecked:b.listitemUnchecked)}void 0!==g&&(g=g.split(" "),c.getChildren().some(k=>q(k))?d.push(...g):e.push(...g));0<e.length&&l.removeClassNamesFromElement(a,...e);0<d.length&&l.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(){return{node:z()}}function z(a){return new J(void 0,a)}function p(a){return a instanceof J}
|
|
25
|
+
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);
|
|
26
|
+
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}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...a){for(let c=
|
|
27
|
+
0;c<a.length;c++){var b=a[c];if(p(b))super.append(b);else{let d=z();q(b)?d.append(b):(b=h.$createTextNode(b.getTextContent()),d.append(b));super.append(d)}}return this}extractWithChild(a){return p(a)}}
|
|
28
|
+
function P(a,b,c){let d=[],e=[];var f=b.list;if(void 0!==f){let k=f[`${c.__tag}Depth`]||[];b=n(c)-1;let r=b%k.length;var g=k[r];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<k.length;g++)g!==r&&e.push(c.__tag+g);void 0!==B&&(c=B.split(" "),1<b?d.push(...c):e.push(...c))}0<e.length&&l.removeClassNamesFromElement(a,...e);0<d.length&&l.addClassNamesToElement(a,...d)}
|
|
29
|
+
function R(a){let b=[];for(let c=0;c<a.length;c++){let d=a[c];p(d)?(b.push(d),d.getChildren().forEach(e=>{q(e)&&b.push(x(e))})):b.push(x(d))}return b}function Q(a){a=a.nodeName.toLowerCase();let b=null;"ol"===a?b=E("number"):"ul"===a&&(b=E("bullet"));return{after:R,node:b}}let O={ol:"number",ul:"bullet"};function E(a,b=1){return new N(a,b)}function q(a){return a instanceof N}let S=h.createCommand(),T=h.createCommand(),U=h.createCommand(),V=h.createCommand();exports.$createListItemNode=z;
|
|
30
|
+
exports.$createListNode=E;exports.$getListDepth=n;
|
|
31
|
+
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=t(a),c=a.getParent();q(c)||m(40);let d=c.getParent(),e;if(h.$isRootNode(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),e.insertAfter(c));
|
|
32
|
+
b.forEach(g=>{g.remove();f.append(g)})}w(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")};
|
|
33
|
+
exports.insertList=function(a,b){a.update(()=>{var c=h.$getSelection();if(h.$isRangeSelection(c)){var d=c.getNodes();c=c.anchor.getNode();var e=c.getParent();if(A(c,d))d=E(b),h.$isRootNode(e)?(c.replace(d),c=z(),d.append(c)):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,b);else if(h.$isLeafNode(f))for(f=f.getParent();null!=f;){let k=f.getKey();if(q(f)){if(!c.has(k)){var g=
|
|
34
|
+
E(b);C(g,f.getChildren());f.replace(g);F(g);c.add(k)}break}else{g=f.getParent();if(h.$isRootNode(g)&&!c.has(k)){c.add(k);D(f,b);break}f=g}}}}})};exports.outdentList=function(){I("outdent")};
|
|
35
|
+
exports.removeList=function(a){a.update(()=>{var b=h.$getSelection();if(h.$isRangeSelection(b)){let d=new Set,e=b.getNodes();b=b.anchor.getNode();if(A(b,e))d.add(t(b));else for(b=0;b<e.length;b++){var c=e[b];h.$isLeafNode(c)&&(c=l.$getNearestNodeOfType(c,J),null!=c&&d.add(t(c)))}d.forEach(f=>{let g=f;u(f).forEach(k=>{if(null!=k){let r=h.$createParagraphNode();C(r,k.getChildren());g.insertAfter(r);g=r;k.remove()}});f.remove()})}})}
|
package/LexicalListItemNode.d.ts
CHANGED
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
import type { DOMConversionMap, EditorConfig, GridSelection, LexicalNode, NodeKey, NodeSelection, ParagraphNode, RangeSelection, SerializedElementNode, Spread } from 'lexical';
|
|
9
9
|
import { ElementNode } from 'lexical';
|
|
10
10
|
export declare type SerializedListItemNode = Spread<{
|
|
11
|
-
checked: boolean;
|
|
11
|
+
checked: boolean | undefined;
|
|
12
12
|
type: 'listitem';
|
|
13
13
|
value: number;
|
|
14
14
|
version: 1;
|
|
15
15
|
}, SerializedElementNode>;
|
|
16
16
|
export declare class ListItemNode extends ElementNode {
|
|
17
17
|
__value: number;
|
|
18
|
-
__checked
|
|
18
|
+
__checked?: boolean;
|
|
19
19
|
static getType(): string;
|
|
20
20
|
static clone(node: ListItemNode): ListItemNode;
|
|
21
21
|
constructor(value?: number, checked?: boolean, key?: NodeKey);
|
|
@@ -32,8 +32,8 @@ export declare class ListItemNode extends ElementNode {
|
|
|
32
32
|
collapseAtStart(selection: RangeSelection): true;
|
|
33
33
|
getValue(): number;
|
|
34
34
|
setValue(value: number): void;
|
|
35
|
-
getChecked(): boolean;
|
|
36
|
-
setChecked(checked
|
|
35
|
+
getChecked(): boolean | undefined;
|
|
36
|
+
setChecked(checked?: boolean): void;
|
|
37
37
|
toggleChecked(): void;
|
|
38
38
|
getIndent(): number;
|
|
39
39
|
setIndent(indent: number): this;
|
package/formatList.d.ts
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
import type { LexicalEditor
|
|
8
|
+
import type { LexicalEditor } from 'lexical';
|
|
9
9
|
import { ListItemNode, ListNode } from './';
|
|
10
10
|
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
|
-
export declare function updateChildrenListItemValue(list: ListNode, children?: Array<
|
|
13
|
+
export declare function updateChildrenListItemValue(list: ListNode, children?: Array<ListItemNode>): void;
|
|
14
14
|
export declare function $handleIndent(listItemNodes: Array<ListItemNode>): void;
|
|
15
15
|
export declare function $handleOutdent(listItemNodes: Array<ListItemNode>): void;
|
|
16
16
|
export declare function indentList(): void;
|
package/package.json
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
"list"
|
|
9
9
|
],
|
|
10
10
|
"license": "MIT",
|
|
11
|
-
"version": "0.3.
|
|
11
|
+
"version": "0.3.8",
|
|
12
12
|
"main": "LexicalList.js",
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"lexical": "0.3.
|
|
14
|
+
"lexical": "0.3.8"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@lexical/utils": "0.3.
|
|
17
|
+
"@lexical/utils": "0.3.8"
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
package/utils.d.ts
CHANGED
|
@@ -15,3 +15,4 @@ export declare function isNestedListNode(node: LexicalNode | null | undefined):
|
|
|
15
15
|
export declare function findNearestListItemNode(node: LexicalNode): ListItemNode | null;
|
|
16
16
|
export declare function getUniqueListItemNodes(nodeList: Array<LexicalNode>): Array<ListItemNode>;
|
|
17
17
|
export declare function $removeHighestEmptyListParent(sublist: ListItemNode | ListNode): void;
|
|
18
|
+
export declare function wrapInListItem(node: LexicalNode): ListItemNode;
|