@lexical/list 0.3.2 → 0.3.5
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 +4 -4
- package/LexicalList.prod.js +2 -2
- package/LexicalListItemNode.d.ts +48 -0
- package/LexicalListNode.d.ts +40 -0
- package/formatList.d.ts +18 -0
- package/index.d.ts +18 -0
- package/package.json +3 -3
- package/utils.d.ts +17 -0
- package/LexicalList.d.ts +0 -83
package/LexicalList.dev.js
CHANGED
|
@@ -15,7 +15,6 @@ var utils = require('@lexical/utils');
|
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
18
|
*/
|
|
20
19
|
function $getListDepth(listNode) {
|
|
21
20
|
let depth = 1;
|
|
@@ -627,7 +626,8 @@ class ListItemNode extends lexical.ElementNode {
|
|
|
627
626
|
return { ...super.exportJSON(),
|
|
628
627
|
checked: this.getChecked(),
|
|
629
628
|
type: 'listitem',
|
|
630
|
-
value: this.getValue()
|
|
629
|
+
value: this.getValue(),
|
|
630
|
+
version: 1
|
|
631
631
|
};
|
|
632
632
|
}
|
|
633
633
|
|
|
@@ -991,7 +991,6 @@ function $isListItemNode(node) {
|
|
|
991
991
|
* This source code is licensed under the MIT license found in the
|
|
992
992
|
* LICENSE file in the root directory of this source tree.
|
|
993
993
|
*
|
|
994
|
-
*
|
|
995
994
|
*/
|
|
996
995
|
class ListNode extends lexical.ElementNode {
|
|
997
996
|
static getType() {
|
|
@@ -1075,7 +1074,8 @@ class ListNode extends lexical.ElementNode {
|
|
|
1075
1074
|
listType: this.getListType(),
|
|
1076
1075
|
start: this.getStart(),
|
|
1077
1076
|
tag: this.getTag(),
|
|
1078
|
-
type: 'list'
|
|
1077
|
+
type: 'list',
|
|
1078
|
+
version: 1
|
|
1079
1079
|
};
|
|
1080
1080
|
}
|
|
1081
1081
|
|
package/LexicalList.prod.js
CHANGED
|
@@ -13,7 +13,7 @@ f.insertAfter(g):e?e.insertBefore(g):d.append(g)}q(d)&&E(d)}})}
|
|
|
13
13
|
function G(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=C();let r=D(k);f.append(r);b.getPreviousSiblings().forEach(y=>r.append(y));g=C();k=D(k);g.append(k);z(k,b.getNextSiblings());d.insertBefore(f);d.insertAfter(g);d.replace(b)}E(c);
|
|
14
14
|
E(e)}}})}function H(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?F(d):G(d))}}
|
|
15
15
|
class I extends h.ElementNode{static getType(){return"listitem"}static clone(a){return new I(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),J(b,this,null,c));b.value=this.__value;K(b,a.theme,this);return b}updateDOM(a,b,c){let d=this.getParent();q(d)&&(E(d),J(b,this,a,d));b.value=this.__value;K(b,c.theme,this);return!1}static importDOM(){return{li:()=>({conversion:L,
|
|
16
|
-
priority:0})}}static importJSON(a){let b=new I(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()}}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();
|
|
16
|
+
priority:0})}}static importJSON(a){let b=new I(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();
|
|
17
17
|
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=D(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)&&E(a),b;if(q(a)&&a.getListType()===b.getListType()){b=a;a=a.getChildren();
|
|
18
18
|
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=D(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)&&E(a))}insertNewAfter(){let a=C(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
19
|
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=
|
|
@@ -22,7 +22,7 @@ p(a)}extractWithChild(a,b){if(!h.$isRangeSelection(b))return!1;a=b.anchor.getNod
|
|
|
22
22
|
function K(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,
|
|
23
23
|
...d)}function J(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 L(){return{node:C()}}function C(a){return new I(void 0,a)}function p(a){return a instanceof I}
|
|
24
24
|
class M extends h.ElementNode{static getType(){return"list"}static clone(a){return new M(a.__listType||N[a.__tag],a.__start,a.__key)}constructor(a,b,c){super(c);this.__listType=a=N[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;O(b,a.theme,this);
|
|
25
|
-
return b}updateDOM(a,b,c){if(a.__tag!==this.__tag)return!0;O(b,c.theme,this);return!1}static importDOM(){return{ol:()=>({conversion:P,priority:0}),ul:()=>({conversion:P,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}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list"}}canBeEmpty(){return!1}canIndent(){return!1}append(...a){for(let c=
|
|
25
|
+
return b}updateDOM(a,b,c){if(a.__tag!==this.__tag)return!0;O(b,c.theme,this);return!1}static importDOM(){return{ol:()=>({conversion:P,priority:0}),ul:()=>({conversion:P,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}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=
|
|
26
26
|
0;c<a.length;c++){var b=a[c];if(p(b))super.append(b);else{let d=C();q(b)?d.append(b):(b=h.$createTextNode(b.getTextContent()),d.append(b));super.append(d)}}return this}extractWithChild(a){return p(a)}}
|
|
27
27
|
function O(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)}
|
|
28
28
|
function P(a){a=a.nodeName.toLowerCase();let b=null;"ol"===a?b=D("number"):"ul"===a&&(b=D("bullet"));return{node:b}}let N={ol:"number",ul:"bullet"};function D(a,b=1){return new M(a,b)}function q(a){return a instanceof M}let Q=h.createCommand(),R=h.createCommand(),S=h.createCommand(),T=h.createCommand();exports.$createListItemNode=C;exports.$createListNode=D;exports.$getListDepth=n;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { DOMConversionMap, EditorConfig, GridSelection, LexicalNode, NodeKey, NodeSelection, ParagraphNode, RangeSelection, SerializedElementNode, Spread } from 'lexical';
|
|
9
|
+
import { ElementNode } from 'lexical';
|
|
10
|
+
export declare type SerializedListItemNode = Spread<{
|
|
11
|
+
checked: boolean;
|
|
12
|
+
type: 'listitem';
|
|
13
|
+
value: number;
|
|
14
|
+
version: 1;
|
|
15
|
+
}, SerializedElementNode>;
|
|
16
|
+
export declare class ListItemNode extends ElementNode {
|
|
17
|
+
__value: number;
|
|
18
|
+
__checked: boolean;
|
|
19
|
+
static getType(): string;
|
|
20
|
+
static clone(node: ListItemNode): ListItemNode;
|
|
21
|
+
constructor(value?: number, checked?: boolean, key?: NodeKey);
|
|
22
|
+
createDOM(config: EditorConfig): HTMLElement;
|
|
23
|
+
updateDOM(prevNode: ListItemNode, dom: HTMLElement, config: EditorConfig): boolean;
|
|
24
|
+
static importDOM(): DOMConversionMap | null;
|
|
25
|
+
static importJSON(serializedNode: SerializedListItemNode): ListItemNode;
|
|
26
|
+
exportJSON(): SerializedListItemNode;
|
|
27
|
+
append(...nodes: LexicalNode[]): this;
|
|
28
|
+
replace<N extends LexicalNode>(replaceWithNode: N): N;
|
|
29
|
+
insertAfter(node: LexicalNode): LexicalNode;
|
|
30
|
+
remove(preserveEmptyParent?: boolean): void;
|
|
31
|
+
insertNewAfter(): ListItemNode | ParagraphNode;
|
|
32
|
+
collapseAtStart(selection: RangeSelection): true;
|
|
33
|
+
getValue(): number;
|
|
34
|
+
setValue(value: number): void;
|
|
35
|
+
getChecked(): boolean;
|
|
36
|
+
setChecked(checked: boolean): void;
|
|
37
|
+
toggleChecked(): void;
|
|
38
|
+
getIndent(): number;
|
|
39
|
+
setIndent(indent: number): this;
|
|
40
|
+
canIndent(): false;
|
|
41
|
+
insertBefore(nodeToInsert: LexicalNode): LexicalNode;
|
|
42
|
+
canInsertAfter(node: LexicalNode): boolean;
|
|
43
|
+
canReplaceWith(replacement: LexicalNode): boolean;
|
|
44
|
+
canMergeWith(node: LexicalNode): boolean;
|
|
45
|
+
extractWithChild(child: LexicalNode, selection: RangeSelection | NodeSelection | GridSelection): boolean;
|
|
46
|
+
}
|
|
47
|
+
export declare function $createListItemNode(checked?: boolean): ListItemNode;
|
|
48
|
+
export declare function $isListItemNode(node: LexicalNode | null | undefined): node is ListItemNode;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { Spread } from 'lexical';
|
|
9
|
+
import { DOMConversionMap, EditorConfig, ElementNode, LexicalEditor, LexicalNode, NodeKey, SerializedElementNode } from 'lexical';
|
|
10
|
+
export declare type SerializedListNode = Spread<{
|
|
11
|
+
listType: ListType;
|
|
12
|
+
start: number;
|
|
13
|
+
tag: ListNodeTagType;
|
|
14
|
+
type: 'list';
|
|
15
|
+
version: 1;
|
|
16
|
+
}, SerializedElementNode>;
|
|
17
|
+
export declare type ListType = 'number' | 'bullet' | 'check';
|
|
18
|
+
export declare type ListNodeTagType = 'ul' | 'ol';
|
|
19
|
+
export declare class ListNode extends ElementNode {
|
|
20
|
+
__tag: ListNodeTagType;
|
|
21
|
+
__start: number;
|
|
22
|
+
__listType: ListType;
|
|
23
|
+
static getType(): string;
|
|
24
|
+
static clone(node: ListNode): ListNode;
|
|
25
|
+
constructor(listType: ListType, start: number, key?: NodeKey);
|
|
26
|
+
getTag(): ListNodeTagType;
|
|
27
|
+
getListType(): ListType;
|
|
28
|
+
getStart(): number;
|
|
29
|
+
createDOM(config: EditorConfig, _editor?: LexicalEditor): HTMLElement;
|
|
30
|
+
updateDOM(prevNode: ListNode, dom: HTMLElement, config: EditorConfig): boolean;
|
|
31
|
+
static importDOM(): DOMConversionMap | null;
|
|
32
|
+
static importJSON(serializedNode: SerializedListNode): ListNode;
|
|
33
|
+
exportJSON(): SerializedListNode;
|
|
34
|
+
canBeEmpty(): false;
|
|
35
|
+
canIndent(): false;
|
|
36
|
+
append(...nodesToAppend: LexicalNode[]): this;
|
|
37
|
+
extractWithChild(child: LexicalNode): boolean;
|
|
38
|
+
}
|
|
39
|
+
export declare function $createListNode(listType: ListType, start?: number): ListNode;
|
|
40
|
+
export declare function $isListNode(node: LexicalNode | null | undefined): node is ListNode;
|
package/formatList.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { LexicalEditor, LexicalNode } from 'lexical';
|
|
9
|
+
import { ListItemNode, ListNode } from './';
|
|
10
|
+
import { ListType } from './LexicalListNode';
|
|
11
|
+
export declare function insertList(editor: LexicalEditor, listType: ListType): void;
|
|
12
|
+
export declare function removeList(editor: LexicalEditor): void;
|
|
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;
|
|
18
|
+
export declare function $handleListInsertParagraph(): boolean;
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { ListType } from './LexicalListNode';
|
|
9
|
+
import type { LexicalCommand } from 'lexical';
|
|
10
|
+
import { $handleListInsertParagraph, indentList, insertList, outdentList, removeList } from './formatList';
|
|
11
|
+
import { $createListItemNode, $isListItemNode, ListItemNode } from './LexicalListItemNode';
|
|
12
|
+
import { $createListNode, $isListNode, ListNode } from './LexicalListNode';
|
|
13
|
+
import { $getListDepth } from './utils';
|
|
14
|
+
export { $createListItemNode, $createListNode, $getListDepth, $handleListInsertParagraph, $isListItemNode, $isListNode, indentList, insertList, ListItemNode, ListNode, ListType, outdentList, removeList, };
|
|
15
|
+
export declare const INSERT_UNORDERED_LIST_COMMAND: LexicalCommand<void>;
|
|
16
|
+
export declare const INSERT_ORDERED_LIST_COMMAND: LexicalCommand<void>;
|
|
17
|
+
export declare const INSERT_CHECK_LIST_COMMAND: LexicalCommand<void>;
|
|
18
|
+
export declare const REMOVE_LIST_COMMAND: LexicalCommand<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.5",
|
|
12
12
|
"main": "LexicalList.js",
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"lexical": "0.3.
|
|
14
|
+
"lexical": "0.3.5"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@lexical/utils": "0.3.
|
|
17
|
+
"@lexical/utils": "0.3.5"
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
package/utils.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import type { LexicalNode } from 'lexical';
|
|
9
|
+
import { ListItemNode, ListNode } from './';
|
|
10
|
+
export declare function $getListDepth(listNode: ListNode): number;
|
|
11
|
+
export declare function $getTopListNode(listItem: LexicalNode): ListNode;
|
|
12
|
+
export declare function $isLastItemInList(listItem: ListItemNode): boolean;
|
|
13
|
+
export declare function $getAllListItems(node: ListNode): Array<ListItemNode>;
|
|
14
|
+
export declare function isNestedListNode(node: LexicalNode | null | undefined): boolean;
|
|
15
|
+
export declare function findNearestListItemNode(node: LexicalNode): ListItemNode | null;
|
|
16
|
+
export declare function getUniqueListItemNodes(nodeList: Array<LexicalNode>): Array<ListItemNode>;
|
|
17
|
+
export declare function $removeHighestEmptyListParent(sublist: ListItemNode | ListNode): void;
|
package/LexicalList.d.ts
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
ElementNode,
|
|
11
|
-
LexicalNode,
|
|
12
|
-
LexicalEditor,
|
|
13
|
-
ParagraphNode,
|
|
14
|
-
RangeSelection,
|
|
15
|
-
LexicalCommand,
|
|
16
|
-
SerializedElementNode,
|
|
17
|
-
} from 'lexical';
|
|
18
|
-
import {Spread} from 'libdefs/globals';
|
|
19
|
-
|
|
20
|
-
export type ListNodeTagType = 'ul' | 'ol';
|
|
21
|
-
export type ListType = 'number' | 'bullet' | 'check';
|
|
22
|
-
export function $createListItemNode(checked?: boolean | void): ListItemNode;
|
|
23
|
-
export function $createListNode(listType: ListType, start?: number): ListNode;
|
|
24
|
-
export function $getListDepth(listNode: ListNode): number;
|
|
25
|
-
export function $handleListInsertParagraph(): boolean;
|
|
26
|
-
export function $isListItemNode(node?: LexicalNode): node is ListItemNode;
|
|
27
|
-
export function $isListNode(node?: LexicalNode): node is ListNode;
|
|
28
|
-
export function indentList(): void;
|
|
29
|
-
export function insertList(editor: LexicalEditor, listType: ListType): void;
|
|
30
|
-
export declare class ListItemNode extends ElementNode {
|
|
31
|
-
append(...nodes: LexicalNode[]): this;
|
|
32
|
-
replace<N extends LexicalNode>(replaceWithNode: N): N;
|
|
33
|
-
insertAfter(node: LexicalNode): LexicalNode;
|
|
34
|
-
insertNewAfter(): ListItemNode | ParagraphNode;
|
|
35
|
-
collapseAtStart(selection: RangeSelection): true;
|
|
36
|
-
getIndent(): number;
|
|
37
|
-
setIndent(indent: number): this;
|
|
38
|
-
insertBefore(nodeToInsert: LexicalNode): LexicalNode;
|
|
39
|
-
canInsertAfter(node: LexicalNode): boolean;
|
|
40
|
-
canReplaceWith(replacement: LexicalNode): boolean;
|
|
41
|
-
canMergeWith(node: LexicalNode): boolean;
|
|
42
|
-
getChecked(): boolean | void;
|
|
43
|
-
setChecked(boolean: boolean): this;
|
|
44
|
-
toggleChecked(): void;
|
|
45
|
-
static importJSON(serializedNode: SerializedListItemNode): ListItemNode;
|
|
46
|
-
exportJSON(): SerializedListItemNode;
|
|
47
|
-
}
|
|
48
|
-
export declare class ListNode extends ElementNode {
|
|
49
|
-
canBeEmpty(): false;
|
|
50
|
-
append(...nodesToAppend: LexicalNode[]): this;
|
|
51
|
-
getTag(): ListNodeTagType;
|
|
52
|
-
getStart(): number;
|
|
53
|
-
getListType(): ListType;
|
|
54
|
-
static importJSON(serializedNode: SerializedListNode): ListNode;
|
|
55
|
-
exportJSON(): SerializedListNode;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export function outdentList(): void;
|
|
59
|
-
export function removeList(editor: LexicalEditor): boolean;
|
|
60
|
-
|
|
61
|
-
export var INSERT_UNORDERED_LIST_COMMAND: LexicalCommand<void>;
|
|
62
|
-
export var INSERT_ORDERED_LIST_COMMAND: LexicalCommand<void>;
|
|
63
|
-
export var INSERT_CHECK_LIST_COMMAND: LexicalCommand<void>;
|
|
64
|
-
export var REMOVE_LIST_COMMAND: LexicalCommand<void>;
|
|
65
|
-
|
|
66
|
-
export type SerializedListItemNode = Spread<
|
|
67
|
-
{
|
|
68
|
-
checked: boolean | void;
|
|
69
|
-
value: number;
|
|
70
|
-
type: 'listitem';
|
|
71
|
-
},
|
|
72
|
-
SerializedElementNode
|
|
73
|
-
>;
|
|
74
|
-
|
|
75
|
-
export type SerializedListNode = Spread<
|
|
76
|
-
{
|
|
77
|
-
listType: ListType;
|
|
78
|
-
start: number;
|
|
79
|
-
tag: ListNodeTagType;
|
|
80
|
-
type: 'list';
|
|
81
|
-
},
|
|
82
|
-
SerializedElementNode
|
|
83
|
-
>;
|