@lexical/list 0.44.1-nightly.20260519.0 → 0.45.1-dev.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.
@@ -0,0 +1,231 @@
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 type {LexicalCommand, LexicalEditor, NodeKey} from 'lexical';
10
+
11
+ import {$findMatchingParent, mergeRegister} from '@lexical/utils';
12
+ import {
13
+ $getNodeByKey,
14
+ $getSelection,
15
+ $isRangeSelection,
16
+ $isTextNode,
17
+ COMMAND_PRIORITY_LOW,
18
+ createCommand,
19
+ INSERT_PARAGRAPH_COMMAND,
20
+ TextNode,
21
+ } from 'lexical';
22
+
23
+ import {
24
+ $handleListInsertParagraph,
25
+ $insertList,
26
+ $removeList,
27
+ updateChildrenListItemValue,
28
+ } from './formatList';
29
+ import {$isListItemNode, ListItemNode} from './LexicalListItemNode';
30
+ import {$isListNode, ListNode} from './LexicalListNode';
31
+ import {$getListDepth} from './utils';
32
+
33
+ export const UPDATE_LIST_START_COMMAND: LexicalCommand<{
34
+ listNodeKey: NodeKey;
35
+ newStart: number;
36
+ }> = createCommand('UPDATE_LIST_START_COMMAND');
37
+ export const INSERT_UNORDERED_LIST_COMMAND: LexicalCommand<void> =
38
+ createCommand('INSERT_UNORDERED_LIST_COMMAND');
39
+ export const INSERT_ORDERED_LIST_COMMAND: LexicalCommand<void> = createCommand(
40
+ 'INSERT_ORDERED_LIST_COMMAND',
41
+ );
42
+ export const REMOVE_LIST_COMMAND: LexicalCommand<void> = createCommand(
43
+ 'REMOVE_LIST_COMMAND',
44
+ );
45
+
46
+ export interface RegisterListOptions {
47
+ restoreNumbering?: boolean;
48
+ }
49
+
50
+ export function registerList(
51
+ editor: LexicalEditor,
52
+ options?: RegisterListOptions,
53
+ ): () => void {
54
+ const removeListener = mergeRegister(
55
+ editor.registerCommand(
56
+ INSERT_ORDERED_LIST_COMMAND,
57
+ () => {
58
+ $insertList('number');
59
+ return true;
60
+ },
61
+ COMMAND_PRIORITY_LOW,
62
+ ),
63
+ editor.registerCommand(
64
+ UPDATE_LIST_START_COMMAND,
65
+ payload => {
66
+ const {listNodeKey, newStart} = payload;
67
+ const listNode = $getNodeByKey(listNodeKey);
68
+ if (!$isListNode(listNode)) {
69
+ return false;
70
+ }
71
+ if (listNode.getListType() === 'number') {
72
+ listNode.setStart(newStart);
73
+ updateChildrenListItemValue(listNode);
74
+ }
75
+ return true;
76
+ },
77
+ COMMAND_PRIORITY_LOW,
78
+ ),
79
+ editor.registerCommand(
80
+ INSERT_UNORDERED_LIST_COMMAND,
81
+ () => {
82
+ $insertList('bullet');
83
+ return true;
84
+ },
85
+ COMMAND_PRIORITY_LOW,
86
+ ),
87
+ editor.registerCommand(
88
+ REMOVE_LIST_COMMAND,
89
+ () => {
90
+ $removeList();
91
+ return true;
92
+ },
93
+ COMMAND_PRIORITY_LOW,
94
+ ),
95
+ editor.registerCommand(
96
+ INSERT_PARAGRAPH_COMMAND,
97
+ () => {
98
+ const shouldRestore = options && options.restoreNumbering;
99
+ return $handleListInsertParagraph(!!shouldRestore);
100
+ },
101
+ COMMAND_PRIORITY_LOW,
102
+ ),
103
+ editor.registerNodeTransform(ListItemNode, node => {
104
+ const firstChild = node.getFirstChild();
105
+ if (firstChild) {
106
+ if ($isTextNode(firstChild)) {
107
+ const style = firstChild.getStyle();
108
+ const format = firstChild.getFormat();
109
+ if (node.getTextStyle() !== style) {
110
+ node.setTextStyle(style);
111
+ }
112
+ if (node.getTextFormat() !== format) {
113
+ node.setTextFormat(format);
114
+ }
115
+ }
116
+ } else {
117
+ // If it's empty, check the selection
118
+ const selection = $getSelection();
119
+ if (
120
+ $isRangeSelection(selection) &&
121
+ (selection.style !== node.getTextStyle() ||
122
+ selection.format !== node.getTextFormat()) &&
123
+ selection.isCollapsed() &&
124
+ node.is(selection.anchor.getNode())
125
+ ) {
126
+ node.setTextStyle(selection.style).setTextFormat(selection.format);
127
+ }
128
+ }
129
+ }),
130
+ editor.registerNodeTransform(TextNode, node => {
131
+ const listItemParentNode = node.getParent();
132
+ if (
133
+ $isListItemNode(listItemParentNode) &&
134
+ node.is(listItemParentNode.getFirstChild())
135
+ ) {
136
+ const style = node.getStyle();
137
+ const format = node.getFormat();
138
+ if (
139
+ style !== listItemParentNode.getTextStyle() ||
140
+ format !== listItemParentNode.getTextFormat()
141
+ ) {
142
+ listItemParentNode.setTextStyle(style).setTextFormat(format);
143
+ }
144
+ }
145
+ }),
146
+ );
147
+ return removeListener;
148
+ }
149
+
150
+ export function registerListStrictIndentTransform(
151
+ editor: LexicalEditor,
152
+ ): () => void {
153
+ const $formatListIndentStrict = (listItemNode: ListItemNode): void => {
154
+ const listNode = listItemNode.getParent();
155
+ if ($isListNode(listItemNode.getFirstChild()) || !$isListNode(listNode)) {
156
+ return;
157
+ }
158
+
159
+ const startingListItemNode = $findMatchingParent(
160
+ listItemNode,
161
+ node =>
162
+ $isListItemNode(node) &&
163
+ $isListNode(node.getParent()) &&
164
+ $isListItemNode(node.getPreviousSibling()),
165
+ );
166
+
167
+ if (startingListItemNode === null && listItemNode.getIndent() > 0) {
168
+ listItemNode.setIndent(0);
169
+ } else if ($isListItemNode(startingListItemNode)) {
170
+ const prevListItemNode = startingListItemNode.getPreviousSibling();
171
+
172
+ if ($isListItemNode(prevListItemNode)) {
173
+ const endListItemNode = $findChildrenEndListItemNode(prevListItemNode);
174
+ const endListNode = endListItemNode.getParent();
175
+
176
+ if ($isListNode(endListNode)) {
177
+ const prevDepth = $getListDepth(endListNode);
178
+ const depth = $getListDepth(listNode);
179
+
180
+ if (prevDepth + 1 < depth) {
181
+ listItemNode.setIndent(prevDepth);
182
+ }
183
+ }
184
+ }
185
+ }
186
+ };
187
+
188
+ const $processListWithStrictIndent = (listNode: ListNode): void => {
189
+ const queue: ListNode[] = [listNode];
190
+
191
+ while (queue.length > 0) {
192
+ const node = queue.shift();
193
+ if (!$isListNode(node)) {
194
+ continue;
195
+ }
196
+
197
+ for (const child of node.getChildren()) {
198
+ if ($isListItemNode(child)) {
199
+ $formatListIndentStrict(child);
200
+
201
+ const firstChild = child.getFirstChild();
202
+ if ($isListNode(firstChild)) {
203
+ queue.push(firstChild);
204
+ }
205
+ }
206
+ }
207
+ }
208
+ };
209
+
210
+ return editor.registerNodeTransform(ListNode, $processListWithStrictIndent);
211
+ }
212
+
213
+ function $findChildrenEndListItemNode(
214
+ listItemNode: ListItemNode,
215
+ ): ListItemNode {
216
+ let current = listItemNode;
217
+ let firstChild = current.getFirstChild();
218
+
219
+ while ($isListNode(firstChild)) {
220
+ const lastChild = firstChild.getLastChild();
221
+
222
+ if ($isListItemNode(lastChild)) {
223
+ current = lastChild;
224
+ firstChild = current.getFirstChild();
225
+ } else {
226
+ break;
227
+ }
228
+ }
229
+
230
+ return current;
231
+ }
package/src/utils.ts ADDED
@@ -0,0 +1,196 @@
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 type {LexicalNode, Spread} from 'lexical';
10
+
11
+ import invariant from '@lexical/internal/invariant';
12
+ import {$findMatchingParent} from '@lexical/utils';
13
+
14
+ import {$isListItemNode, $isListNode, ListItemNode, ListNode} from './';
15
+
16
+ /**
17
+ * Checks the depth of listNode from the root node.
18
+ * @param listNode - The ListNode to be checked.
19
+ * @returns The depth of the ListNode.
20
+ */
21
+ export function $getListDepth(listNode: ListNode): number {
22
+ let depth = 1;
23
+ let parent = listNode.getParent();
24
+
25
+ while (parent != null) {
26
+ if ($isListItemNode(parent)) {
27
+ const parentList = parent.getParent();
28
+
29
+ if ($isListNode(parentList)) {
30
+ depth++;
31
+ parent = parentList.getParent();
32
+ continue;
33
+ }
34
+ invariant(false, 'A ListItemNode must have a ListNode for a parent.');
35
+ }
36
+
37
+ return depth;
38
+ }
39
+
40
+ return depth;
41
+ }
42
+
43
+ /**
44
+ * Finds the nearest ancestral ListNode and returns it, throws an invariant if listItem is not a ListItemNode.
45
+ * @param listItem - The node to be checked.
46
+ * @returns The ListNode found.
47
+ */
48
+ export function $getTopListNode(listItem: LexicalNode): ListNode {
49
+ let list = listItem.getParent<ListNode>();
50
+
51
+ if (!$isListNode(list)) {
52
+ invariant(false, 'A ListItemNode must have a ListNode for a parent.');
53
+ }
54
+
55
+ let parent: ListNode | null = list;
56
+
57
+ while (parent !== null) {
58
+ parent = parent.getParent();
59
+
60
+ if ($isListNode(parent)) {
61
+ list = parent;
62
+ }
63
+ }
64
+
65
+ return list;
66
+ }
67
+
68
+ /**
69
+ * Checks if listItem has no child ListNodes and has no ListItemNode ancestors with siblings.
70
+ * @param listItem - the ListItemNode to be checked.
71
+ * @returns true if listItem has no child ListNode and no ListItemNode ancestors with siblings, false otherwise.
72
+ */
73
+ export function $isLastItemInList(listItem: ListItemNode): boolean {
74
+ let isLast = true;
75
+ const firstChild = listItem.getFirstChild();
76
+
77
+ if ($isListNode(firstChild)) {
78
+ return false;
79
+ }
80
+ let parent: ListItemNode | null = listItem;
81
+
82
+ while (parent !== null) {
83
+ if ($isListItemNode(parent)) {
84
+ if (parent.getNextSiblings().length > 0) {
85
+ isLast = false;
86
+ }
87
+ }
88
+
89
+ parent = parent.getParent();
90
+ }
91
+
92
+ return isLast;
93
+ }
94
+
95
+ /**
96
+ * A recursive Depth-First Search (Postorder Traversal) that finds all of a node's children
97
+ * that are of type ListItemNode and returns them in an array.
98
+ * @param node - The ListNode to start the search.
99
+ * @returns An array containing all nodes of type ListItemNode found.
100
+ */
101
+ // This should probably be $getAllChildrenOfType
102
+ export function $getAllListItems(node: ListNode): Array<ListItemNode> {
103
+ let listItemNodes: Array<ListItemNode> = [];
104
+ const listChildren: Array<ListItemNode> = node
105
+ .getChildren()
106
+ .filter($isListItemNode);
107
+
108
+ for (let i = 0; i < listChildren.length; i++) {
109
+ const listItemNode = listChildren[i];
110
+ const firstChild = listItemNode.getFirstChild();
111
+
112
+ if ($isListNode(firstChild)) {
113
+ listItemNodes = listItemNodes.concat($getAllListItems(firstChild));
114
+ } else {
115
+ listItemNodes.push(listItemNode);
116
+ }
117
+ }
118
+
119
+ return listItemNodes;
120
+ }
121
+
122
+ const NestedListNodeBrand: unique symbol = Symbol.for(
123
+ '@lexical/NestedListNodeBrand',
124
+ );
125
+
126
+ /**
127
+ * Checks to see if the passed node is a ListItemNode and has a ListNode as a child.
128
+ * @param node - The node to be checked.
129
+ * @returns true if the node is a ListItemNode and has a ListNode child, false otherwise.
130
+ */
131
+ export function isNestedListNode(
132
+ node: LexicalNode | null | undefined,
133
+ ): node is Spread<
134
+ {getFirstChild(): ListNode; [NestedListNodeBrand]: never},
135
+ ListItemNode
136
+ > {
137
+ return $isListItemNode(node) && $isListNode(node.getFirstChild());
138
+ }
139
+
140
+ /**
141
+ * Traverses up the tree and returns the first ListItemNode found.
142
+ * @param node - Node to start the search.
143
+ * @returns The first ListItemNode found, or null if none exist.
144
+ */
145
+ export function $findNearestListItemNode(
146
+ node: LexicalNode,
147
+ ): ListItemNode | null {
148
+ const matchingParent = $findMatchingParent(node, parent =>
149
+ $isListItemNode(parent),
150
+ );
151
+ return matchingParent as ListItemNode | null;
152
+ }
153
+
154
+ /**
155
+ * Takes a deeply nested ListNode or ListItemNode and traverses up the branch to delete the first
156
+ * ancestral ListNode (which could be the root ListNode) or ListItemNode with siblings, essentially
157
+ * bringing the deeply nested node up the branch once. Would remove sublist if it has siblings.
158
+ * Should not break ListItem -> List -> ListItem chain as empty List/ItemNodes should be removed on .remove().
159
+ * @param sublist - The nested ListNode or ListItemNode to be brought up the branch.
160
+ */
161
+ export function $removeHighestEmptyListParent(
162
+ sublist: ListItemNode | ListNode,
163
+ ) {
164
+ // Nodes may be repeatedly indented, to create deeply nested lists that each
165
+ // contain just one bullet.
166
+ // Our goal is to remove these (empty) deeply nested lists. The easiest
167
+ // way to do that is crawl back up the tree until we find a node that has siblings
168
+ // (e.g. is actually part of the list contents) and delete that, or delete
169
+ // the root of the list (if no list nodes have siblings.)
170
+ let emptyListPtr = sublist;
171
+
172
+ while (
173
+ emptyListPtr.getNextSibling() == null &&
174
+ emptyListPtr.getPreviousSibling() == null
175
+ ) {
176
+ const parent = emptyListPtr.getParent();
177
+
178
+ if (parent == null || !($isListItemNode(parent) || $isListNode(parent))) {
179
+ break;
180
+ }
181
+
182
+ emptyListPtr = parent;
183
+ }
184
+
185
+ emptyListPtr.remove();
186
+ }
187
+
188
+ /**
189
+ * Calculates the start value for a new list created by splitting an existing list.
190
+ */
191
+ export function $getNewListStart(
192
+ list: ListNode,
193
+ listItem: ListItemNode,
194
+ ): number {
195
+ return list.getStart() + listItem.getIndexWithinParent();
196
+ }
@@ -1,9 +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
- "use strict";var e=require("@lexical/extension"),t=require("@lexical/utils"),n=require("lexical");function r(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function i(e){let t=1,n=e.getParent();for(;null!=n;){if(L(n)){const e=n.getParent();if($(e)){t++,n=e.getParent();continue}r(40)}return t}return t}function s(e){let t=e.getParent();$(t)||r(40);let n=t;for(;null!==n;)n=n.getParent(),$(n)&&(t=n);return t}function o(e){let t=[];const n=e.getChildren().filter(L);for(let e=0;e<n.length;e++){const r=n[e],i=r.getFirstChild();$(i)?t=t.concat(o(i)):t.push(r)}return t}function l(e){return L(e)&&$(e.getFirstChild())}function a(e,t){return L(e)&&(0===t.length||1===t.length&&e.is(t[0])&&0===e.getChildrenSize())}function c(e){const t=n.$getSelection();if(null!==t){let r=t.getNodes();if(n.$isRangeSelection(t)){const[i]=t.getStartEndPoints(),s=i.getNode(),o=s.getParent();if(n.$isRootOrShadowRoot(s)){const e=s.getFirstChild();if(e)r=e.selectStart().getNodes();else{const e=n.$createParagraphNode();s.append(e),r=e.select().getNodes()}}else if(a(s,r)){const t=M(e);if(n.$isRootOrShadowRoot(o)){s.replace(t);const e=y();n.$isElementNode(s)&&(e.setFormat(s.getFormatType()),e.setIndent(s.getIndent())),t.append(e)}else if(L(s)){const e=s.getParentOrThrow();d(t,e.getChildren()),e.replace(t)}return}}const i=new Set;for(let t=0;t<r.length;t++){const s=r[t];if(n.$isElementNode(s)&&s.isEmpty()&&!L(s)&&!i.has(s.getKey())){g(s,e);continue}let o=n.$isLeafNode(s)?s.getParent():L(s)&&s.isEmpty()?s:null;for(;null!=o;){const t=o.getKey();if($(o)){if(!i.has(t)){const n=M(e);d(n,o.getChildren()),o.replace(n),i.add(t)}break}{const r=o.getParent();if(n.$isRootOrShadowRoot(r)&&!i.has(t)){i.add(t),g(o,e);break}o=r}}}}}function d(e,t){e.splice(e.getChildrenSize(),0,t)}function g(e,t){if($(e))return e;const r=e.getPreviousSibling(),i=e.getNextSibling(),s=y();let o;if(d(s,e.getChildren()),$(r)&&t===r.getListType())r.append(s),$(i)&&t===i.getListType()&&(d(r,i.getChildren()),i.remove()),o=r;else if($(i)&&t===i.getListType())i.getFirstChildOrThrow().insertBefore(s),o=i;else{const n=M(t);n.append(s),e.replace(n),o=n}s.setFormat(e.getFormatType()),s.setIndent(e.getIndent());const l=n.$getSelection();return n.$isRangeSelection(l)&&(o.getKey()===l.anchor.key&&l.anchor.set(s.getKey(),l.anchor.offset,"element"),o.getKey()===l.focus.key&&l.focus.set(s.getKey(),l.focus.offset,"element")),e.remove(),o}function u(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&l(n)&&l(r)&&(u(n.getFirstChild(),r.getFirstChild()),r.remove());const i=t.getChildren();i.length>0&&e.append(...i),t.remove()}function h(){const e=n.$getSelection();if(n.$isRangeSelection(e)){const r=new Set,i=e.getNodes(),l=e.anchor.getNode();if(a(l,i))r.add(s(l));else for(let e=0;e<i.length;e++){const o=i[e];if(n.$isLeafNode(o)){const e=t.$getNearestNodeOfType(o,C);null!=e&&r.add(s(e))}}for(const t of r){let r=t;const i=o(t);for(const t of i){const i=n.$createParagraphNode().setTextStyle(e.style).setTextFormat(e.format);d(i,t.getChildren()),r.insertAfter(i),r=i,t.__key===e.anchor.key&&n.$setPointFromCaret(e.anchor,n.$normalizeCaret(n.$getChildCaret(i,"next"))),t.__key===e.focus.key&&n.$setPointFromCaret(e.focus,n.$normalizeCaret(n.$getChildCaret(i,"next"))),t.remove()}t.remove()}}}function f(e){const t="check"!==e.getListType();let n=e.getStart();for(const r of e.getChildren())L(r)&&(r.getValue()!==n&&r.setValue(n),t&&null!=r.getLatest().__checked&&r.setChecked(void 0),$(r.getFirstChild())||n++)}function p(e){const t=new Set;if(l(e)||t.has(e.getKey()))return;const r=e.getParent(),i=e.getNextSibling(),s=e.getPreviousSibling();if(l(i)&&l(s)){const n=s.getFirstChild();if($(n)){n.append(e);const r=i.getFirstChild();if($(r)){d(n,r.getChildren()),i.remove(),t.add(i.getKey())}}}else if(l(i)){const t=i.getFirstChild();if($(t)){const n=t.getFirstChild();null!==n&&n.insertBefore(e)}}else if(l(s)){const t=s.getFirstChild();$(t)&&t.append(e)}else if($(r)){const t=n.$copyNode(e),o=n.$copyNode(r);t.append(o),o.append(e),s?s.insertAfter(t):i?i.insertBefore(t):r.append(t)}}function m(e){if(l(e))return;const t=e.getParent(),r=t?t.getParent():void 0;if($(r?r.getParent():void 0)&&L(r)&&$(t)){const i=t?t.getFirstChild():void 0,s=t?t.getLastChild():void 0;if(e.is(i))r.insertBefore(e),t.isEmpty()&&r.remove();else if(e.is(s))r.insertAfter(e),t.isEmpty()&&r.remove();else{const i=n.$copyNode(e),s=n.$copyNode(t);i.append(s),e.getPreviousSiblings().forEach(e=>s.append(e));const o=n.$copyNode(e),l=n.$copyNode(t);o.append(l),d(l,e.getNextSiblings()),r.insertBefore(i),r.insertAfter(o),r.replace(e)}}}function _(e=!1){const t=n.$getSelection();if(!n.$isRangeSelection(t)||!t.isCollapsed())return!1;const i=t.anchor.getNode();let o=null;if(L(i)&&0===i.getChildrenSize())o=i;else if(n.$isTextNode(i)){const e=i.getParent();L(e)&&e.getChildren().every(e=>n.$isTextNode(e)&&""===e.getTextContent().trim())&&(o=e)}if(null===o)return!1;const l=s(o),a=o.getParent();$(a)||r(40);const c=a.getParent();let d;if(n.$isRootOrShadowRoot(c))d=n.$createParagraphNode(),l.insertAfter(d);else{if(!L(c))return!1;d=n.$copyNode(c),c.insertAfter(d)}d.setTextStyle(t.style).setTextFormat(t.format).select();const g=o.getNextSiblings();if(g.length>0){const t=e?function(e,t){return e.getStart()+t.getIndexWithinParent()}(a,o):1,r=n.$copyNode(a).setStart(t);if(L(d)){const e=n.$copyNode(d);e.append(r),d.insertAfter(e)}else d.insertAfter(r);r.append(...g)}return function(e){let t=e;for(;null==t.getNextSibling()&&null==t.getPreviousSibling();){const e=t.getParent();if(null==e||!L(e)&&!$(e))break;t=e}t.remove()}(o),!0}class C extends n.ElementNode{__value;__checked;$config(){return this.config("listitem",{$transform:e=>{const i=e.getParent();if($(i))"check"!==i.getListType()&&null!=e.getChecked()&&e.setChecked(void 0);else if(i){const s=e.createParentElementNode();$(s)||r(340);const o=[e];for(const t of["previous","next"]){o.reverse();for(const{origin:r}of n.$getSiblingCaret(e,t)){if(!L(r))break;o.push(r)}}e.insertBefore(s),s.splice(0,0,o),n.$isRootOrShadowRoot(i)||(t.$insertNodeToNearestRootAtCaret(s,n.$rewindSiblingCaret(n.$getSiblingCaret(s,"next")),{$shouldSplit:()=>!1,removeEmptyDestination:!0}),i.isEmpty()&&i.isAttached()&&i.remove())}},extends:n.ElementNode,importDOM:n.buildImportMap({li:()=>({conversion:N,priority:0})})})}constructor(e=1,t=void 0,n){super(n),this.__value=void 0===e?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){const t=document.createElement("li");return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,r,i){!function(e,t){const n=t.getParent();!$(n)||"check"!==n.getListType()||$(t.getFirstChild())?(e.removeAttribute("role"),e.removeAttribute("tabIndex"),e.removeAttribute("aria-checked")):(e.setAttribute("role","checkbox"),e.setAttribute("tabIndex","-1"),e.setAttribute("aria-checked",t.getChecked()?"true":"false"))}(r,this),r.value=this.__value,function(e,r,i){const s=r.list;if(!s)return;const o=s.listitem,l=s.nested&&s.nested.listitem,a=i.getParent(),c=$(a)&&"check"===a.getListType(),d=i.getChecked(),g=i.getChildren().some(e=>$(e)),u=[];void 0!==s.listitemChecked&&u.push(s.listitemChecked);void 0!==s.listitemUnchecked&&u.push(s.listitemUnchecked);void 0!==l&&u.push(...n.normalizeClassNames(l));u.length>0&&t.removeClassNamesFromElement(e,...u);const h=[];void 0!==o&&h.push(...n.normalizeClassNames(o));if(c){const e=d?s.listitemChecked:s.listitemUnchecked;void 0!==e&&h.push(e)}void 0!==l&&g&&h.push(...n.normalizeClassNames(l));h.length>0&&t.addClassNamesToElement(e,...h)}(r,i.theme,this);const s=e?e.__style:"",o=this.__style;s!==o&&n.setDOMStyleFromCSS(r.style,o,s),function(e,t,r){const i=t.__textStyle,s=r?r.__textStyle:"";if(null!==r&&s===i)return;const o=n.getStyleObjectFromCSS(i);for(const t in o)e.style.setProperty(`--listitem-marker-${t}`,o[t]);if(""!==s)for(const t in n.getStyleObjectFromCSS(s))t in o||e.style.removeProperty(`--listitem-marker-${t}`)}(r,this,e)}updateDOM(e,t,n){const r=t;return this.updateListItemDOM(e,r,n),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){const t=this.createDOM(e._config),r=this.getFormatType();r&&(t.style.textAlign=r);const i=this.getDirection();return i&&(t.dir=i),l(this)?{after(e){if(n.isHTMLElement(e)){const t=e.previousElementSibling;if(n.isHTMLElement(t)&&"LI"===t.nodeName){for(;e.firstChild;)t.append(e.firstChild);e.remove()}}return e},element:t}:{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){const r=e[t];if(n.$isElementNode(r)&&this.canMergeWith(r)){const e=r.getChildren();this.append(...e),r.remove()}else super.append(r)}return this}replace(e,t){if(L(e))return super.replace(e);this.setIndent(0);const i=this.getParentOrThrow();if(!$(i))return e;if(i.__first===this.getKey())i.insertBefore(e);else if(i.__last===this.getKey())i.insertAfter(e);else{const t=n.$copyNode(i);let r=this.getNextSibling();for(;r;){const e=r;r=r.getNextSibling(),t.append(e)}i.insertAfter(e),e.insertAfter(t)}const s=this.__key;let o=0;if(t&&(n.$isElementNode(e)||r(139),o=e.getChildrenSize(),e.splice(o,0,this.getChildren())),t&&n.$isElementNode(e)){const t=n.$getSelection();if(n.$isRangeSelection(t))for(const n of t.getStartEndPoints())n.key===s&&"element"===n.type&&n.set(e.getKey(),o+n.offset,"element")}return this.remove(),0===i.getChildrenSize()&&i.remove(),e}insertAfter(e,t=!0){const i=this.getParentOrThrow();if($(i)||r(39),L(e))return super.insertAfter(e,t);const s=this.getNextSiblings();if(i.insertAfter(e,t),0!==s.length){const r=n.$copyNode(i);s.forEach(e=>r.append(e)),e.insertAfter(r,t)}return e}remove(e){const t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&l(t)&&l(n)&&(u(t.getFirstChild(),n.getFirstChild()),n.remove())}resetOnCopyNodeFrom(e){super.resetOnCopyNodeFrom(e),e.getChecked()&&this.setChecked(!1)}insertNewAfter(e,t=!0){const r=n.$copyNode(this);return this.insertAfter(r,t),r}collapseAtStart(e){const t=n.$createParagraphNode();this.getChildren().forEach(e=>t.append(e));const r=this.getParentOrThrow(),i=r.getParentOrThrow(),s=L(i);if(1===r.getChildrenSize())if(s)r.remove(),i.select();else{r.insertBefore(t),r.remove();const n=e.anchor,i=e.focus,s=t.getKey();"element"===n.type&&n.getNode().is(this)&&n.set(s,n.offset,"element"),"element"===i.type&&i.getNode().is(this)&&i.set(s,i.offset,"element")}else r.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){const t=this.getWritable();return t.__value=e,t}getChecked(){const e=this.getLatest();let t;const n=this.getParent();return $(n)&&(t=n.getListType()),"check"===t?Boolean(e.__checked):void 0}setChecked(e){const t=this.getWritable();return t.__checked=e,t}toggleChecked(){const e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){const e=this.getParent();if(null===e||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;L(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){"number"!=typeof e&&r(117),(e=Math.floor(e))>=0||r(199);let t=this.getIndent();for(;t!==e;)t<e?(p(this),t++):(m(this),t--);return this}canInsertAfter(e){return L(e)}canReplaceWith(e){return L(e)}canMergeWith(e){return L(e)||n.$isParagraphNode(e)}extractWithChild(e,t){if(!n.$isRangeSelection(t))return!1;const r=t.anchor.getNode(),i=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return M("bullet")}canMergeWhenEmpty(){return!0}}function N(e){if(e.classList.contains("task-list-item"))for(const t of e.children)if("INPUT"===t.tagName)return T(t);if(e.classList.contains("joplin-checkbox"))for(const t of e.children)if(t.classList.contains("checkbox-wrapper")&&t.children.length>0&&"INPUT"===t.children[0].tagName)return T(t.children[0]);const t=e.getAttribute("aria-checked"),r=y("true"===t||"false"!==t&&void 0);return n.$setFormatFromDOM(r,e),{after:S.bind(null,r),node:n.$setDirectionFromDOM(r,e)}}function T(e){if(!("checkbox"===e.getAttribute("type")))return{node:null};const t=y(e.hasAttribute("checked"));return{after:S.bind(null,t),node:t}}function S(e,t){const r=t[0];return 1===t.length&&n.$isParagraphNode(r)&&!e.getFormatType()&&r.getFormatType()?(e.setFormat(r.getFormatType()),r.getChildren()):t}function y(e){return n.$applyNodeReplacement(new C(void 0,e))}function L(e){return e instanceof C}class O extends n.ElementNode{__tag;__start;__listType;$config(){return this.config("list",{$transform:e=>{!function(e){const t=e.getNextSibling();$(t)&&e.getListType()===t.getListType()&&u(e,t)}(e),f(e)},extends:n.ElementNode,importDOM:n.buildImportMap({ol:()=>({conversion:x,priority:0}),ul:()=>({conversion:x,priority:0})})})}constructor(e="number",t=1,n){super(n);const r=E[e]||e;this.__listType=r,this.__tag="number"===r?"ol":"ul",this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){const t=this.getWritable();return t.__listType=e,t.__tag="number"===e?"ol":"ul",t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){const t=this.getWritable();return t.__start=e,t}createDOM(e,t){const n=this.__tag,r=document.createElement(n);return 1!==this.__start&&r.setAttribute("start",String(this.__start)),r.__lexicalListType=this.__listType,v(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||(v(t,n.theme,this),e.__start!==this.__start&&t.setAttribute("start",String(this.__start)),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){const n=this.createDOM(e._config,e);return t.isHTMLElement(n)&&(1!==this.__start&&n.setAttribute("start",String(this.__start)),"check"===this.__listType&&n.setAttribute("__lexicalListType","check")),{element:n}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,r){let i=r;for(let e=0;e<r.length;e++){const t=r[e];L(t)||(i===r&&(i=[...r]),i[e]=this.createListItemNode().append(!n.$isElementNode(t)||$(t)||t.isInline()?t:n.$createTextNode(t.getTextContent())))}return super.splice(e,t,i)}extractWithChild(e){return L(e)}createListItemNode(){return y()}}function v(e,r,s){const o=[],l=[],a=r.list;if(void 0!==a){const e=a[`${s.__tag}Depth`]||[],t=i(s)-1,r=t%e.length,c=e[r],d=a[s.__tag];let g;const u=a.nested,h=a.checklist;if(void 0!==u&&u.list&&(g=u.list),void 0!==d&&o.push(d),void 0!==h&&"check"===s.__listType&&o.push(h),void 0!==c){o.push(...n.normalizeClassNames(c));for(let t=0;t<e.length;t++)t!==r&&l.push(s.__tag+t)}if(void 0!==g){const e=n.normalizeClassNames(g);t>1?o.push(...e):l.push(...e)}}l.length>0&&t.removeClassNamesFromElement(e,...l),o.length>0&&t.addClassNamesToElement(e,...o)}function x(e){let r;if(function(e){return t.isHTMLElement(e)&&"ol"===e.nodeName.toLowerCase()}(e)){const t=e.start;r=M("number",t)}else r=function(e){if("check"===e.getAttribute("__lexicallisttype")||e.classList.contains("contains-task-list")||"1"===e.getAttribute("data-is-checklist"))return!0;for(const n of e.childNodes)if(t.isHTMLElement(n)&&n.hasAttribute("aria-checked"))return!0;return!1}(e)?M("check"):M("bullet");return n.$setDirectionFromDOM(r,e),{after:e=>function(e,t){const n=t.createListItemNode.bind(t),r=[];for(let t=0;t<e.length;t++){const i=e[t];if(L(i)){r.push(i);const e=i.getChildren();e.length>1&&e.forEach(e=>{$(e)&&r.push(n().append(e))})}else r.push(n().append(i))}return r}(e,r),node:r}}const E={ol:"number",ul:"bullet"};function M(e="number",t=1){return n.$applyNodeReplacement(new O(e,t))}function $(e){return e instanceof O}const P=n.createCommand("INSERT_CHECK_LIST_COMMAND");function b(e,r){const i=r&&r.disableTakeFocusOnClick||!1,s="boolean"==typeof i?()=>i:i.peek.bind(i),o=e=>{const n=e.target;if(!t.isHTMLElement(n))return!1;const r=n.__lexicalCheckListLastHandled;return void 0!==r&&e.timeStamp-r<500},l=e=>{const n=e.target;t.isHTMLElement(n)&&(n.__lexicalCheckListLastHandled=e.timeStamp)},a=e=>{o(e)||(l(e),A(e,s()))},d=e=>{"touch"===e.pointerType&&(o(e)||(l(e),A(e,s())))},g=e=>{!function(e,t){k(e,()=>{e.preventDefault(),t&&e.stopPropagation()})}(e,s())};return t.mergeRegister(e.registerCommand(P,()=>(c("check"),!0),n.COMMAND_PRIORITY_LOW),e.registerCommand(n.KEY_ARROW_DOWN_COMMAND,t=>R(t,e,!1),n.COMMAND_PRIORITY_LOW),e.registerCommand(n.KEY_ARROW_UP_COMMAND,t=>R(t,e,!0),n.COMMAND_PRIORITY_LOW),e.registerCommand(n.KEY_ESCAPE_COMMAND,()=>{if(null!=I()){const t=e.getRootElement();return null!=t&&t.focus(),!0}return!1},n.COMMAND_PRIORITY_LOW),e.registerCommand(n.KEY_SPACE_COMMAND,t=>{const r=I();return!(null==r||!e.isEditable())&&(e.update(()=>{const e=n.$getNearestNodeFromDOMNode(r);L(e)&&(t.preventDefault(),e.toggleChecked())}),!0)},n.COMMAND_PRIORITY_LOW),e.registerCommand(n.KEY_ARROW_LEFT_COMMAND,r=>e.getEditorState().read(()=>{const i=n.$getSelection();if(n.$isRangeSelection(i)&&i.isCollapsed()){const{anchor:s}=i,o="element"===s.type;if(o||0===s.offset){const i=s.getNode(),l=t.$findMatchingParent(i,e=>n.$isElementNode(e)&&!e.isInline());if(L(l)){const t=l.getParent();if($(t)&&"check"===t.getListType()&&(o||l.getFirstDescendant()===i)){const t=e.getElementByKey(l.__key);if(null!=t&&document.activeElement!==t)return t.focus(),r.preventDefault(),!0}}}}return!1}),n.COMMAND_PRIORITY_LOW),e.registerRootListener(e=>{if(null!==e)return e.addEventListener("click",a),e.addEventListener("pointerup",d),e.addEventListener("pointerdown",g,{capture:!0}),e.addEventListener("mousedown",g,{capture:!0}),e.addEventListener("touchstart",g,{capture:!0,passive:!1}),()=>{e.removeEventListener("click",a),e.removeEventListener("pointerup",d),e.removeEventListener("pointerdown",g,{capture:!0}),e.removeEventListener("mousedown",g,{capture:!0}),e.removeEventListener("touchstart",g,{capture:!0})}}))}function k(e,n){const r=e.target;if(!t.isHTMLElement(r))return;const i=r.firstChild;if(t.isHTMLElement(i)&&("UL"===i.tagName||"OL"===i.tagName))return;const s=r.parentNode;if(!s||"check"!==s.__lexicalListType)return;let o=null,l=null;if("clientX"in e)o=e.clientX;else if("touches"in e){const t=e.touches;t.length>0&&(o=t[0].clientX,l="touch")}if(null==o)return;const a=r.getBoundingClientRect(),c=o/t.calculateZoomLevel(r),d=window.getComputedStyle?window.getComputedStyle(r,"::before"):{width:"0px"},g=parseFloat(d.width),u="touch"===l||"pointerType"in e&&"touch"===e.pointerType?32:0;("rtl"===r.dir?c<a.right+u&&c>a.right-g-u:c>a.left-u&&c<a.left+g+u)&&n()}function A(e,r){k(e,()=>{if(t.isHTMLElement(e.target)){const t=e.target,i=n.getNearestEditorFromDOMNode(t);null!=i&&i.isEditable()&&i.update(()=>{const e=n.$getNearestNodeFromDOMNode(t);L(e)&&(r?(n.$addUpdateTag(n.SKIP_SELECTION_FOCUS_TAG),n.$addUpdateTag(n.SKIP_DOM_SELECTION_TAG)):t.focus(),e.toggleChecked())})}})}function I(){const e=document.activeElement;return t.isHTMLElement(e)&&"LI"===e.tagName&&null!=e.parentNode&&"check"===e.parentNode.__lexicalListType?e:null}function R(e,t,r){const i=I();return null!=i&&t.update(()=>{const s=n.$getNearestNodeFromDOMNode(i);if(!L(s))return;const o=function(e,t){let n=t?e.getPreviousSibling():e.getNextSibling(),r=e;for(;null==n&&L(r);)r=r.getParentOrThrow().getParent(),null!=r&&(n=t?r.getPreviousSibling():r.getNextSibling());for(;L(n);){const e=t?n.getLastChild():n.getFirstChild();if(!$(e))return n;n=t?e.getLastChild():e.getFirstChild()}return null}(s,r);if(null!=o){o.selectStart();const n=t.getElementByKey(o.__key);null!=n&&(e.preventDefault(),setTimeout(()=>{n.focus()},0))}}),!1}const F=n.createCommand("UPDATE_LIST_START_COMMAND"),D=n.createCommand("INSERT_UNORDERED_LIST_COMMAND"),w=n.createCommand("INSERT_ORDERED_LIST_COMMAND"),W=n.createCommand("REMOVE_LIST_COMMAND");function K(e,r){return t.mergeRegister(e.registerCommand(w,()=>(c("number"),!0),n.COMMAND_PRIORITY_LOW),e.registerCommand(F,e=>{const{listNodeKey:t,newStart:r}=e,i=n.$getNodeByKey(t);return!!$(i)&&("number"===i.getListType()&&(i.setStart(r),f(i)),!0)},n.COMMAND_PRIORITY_LOW),e.registerCommand(D,()=>(c("bullet"),!0),n.COMMAND_PRIORITY_LOW),e.registerCommand(W,()=>(h(),!0),n.COMMAND_PRIORITY_LOW),e.registerCommand(n.INSERT_PARAGRAPH_COMMAND,()=>_(!!(r&&r.restoreNumbering)),n.COMMAND_PRIORITY_LOW),e.registerNodeTransform(C,e=>{const t=e.getFirstChild();if(t){if(n.$isTextNode(t)){const n=t.getStyle(),r=t.getFormat();e.getTextStyle()!==n&&e.setTextStyle(n),e.getTextFormat()!==r&&e.setTextFormat(r)}}else{const t=n.$getSelection();n.$isRangeSelection(t)&&(t.style!==e.getTextStyle()||t.format!==e.getTextFormat())&&t.isCollapsed()&&e.is(t.anchor.getNode())&&e.setTextStyle(t.style).setTextFormat(t.format)}}),e.registerNodeTransform(n.TextNode,e=>{const t=e.getParent();if(L(t)&&e.is(t.getFirstChild())){const n=e.getStyle(),r=e.getFormat();n===t.getTextStyle()&&r===t.getTextFormat()||t.setTextStyle(n).setTextFormat(r)}}))}function H(e){const n=e=>{const n=e.getParent();if($(e.getFirstChild())||!$(n))return;const r=t.$findMatchingParent(e,e=>L(e)&&$(e.getParent())&&L(e.getPreviousSibling()));if(null===r&&e.getIndent()>0)e.setIndent(0);else if(L(r)){const t=r.getPreviousSibling();if(L(t)){const r=function(e){let t=e,n=t.getFirstChild();for(;$(n);){const e=n.getLastChild();if(!L(e))break;t=e,n=t.getFirstChild()}return t}(t),s=r.getParent();if($(s)){const t=i(s);t+1<i(n)&&e.setIndent(t)}}}};return e.registerNodeTransform(O,e=>{const t=[e];for(;t.length>0;){const e=t.shift();if($(e))for(const r of e.getChildren())if(L(r)){n(r);const e=r.getFirstChild();$(e)&&t.push(e)}}})}const U=n.defineExtension({build:(t,n,r)=>e.namedSignals(n),config:n.safeCast({hasStrictIndent:!1,shouldPreserveNumbering:!1}),name:"@lexical/list/List",nodes:()=>[O,C],register(n,r,i){const s=i.getOutput();return t.mergeRegister(e.effect(()=>K(n,{restoreNumbering:s.shouldPreserveNumbering.value})),e.effect(()=>s.hasStrictIndent.value?H(n):void 0))}}),Y=n.defineExtension({build:(t,n)=>e.namedSignals(n),config:n.safeCast({disableTakeFocusOnClick:!1}),dependencies:[U],name:"@lexical/list/CheckList",register:(e,t,n)=>b(e,n.getOutput())});exports.$createListItemNode=y,exports.$createListNode=M,exports.$getListDepth=i,exports.$handleListInsertParagraph=_,exports.$insertList=c,exports.$isListItemNode=L,exports.$isListNode=$,exports.$removeList=h,exports.CheckListExtension=Y,exports.INSERT_CHECK_LIST_COMMAND=P,exports.INSERT_ORDERED_LIST_COMMAND=w,exports.INSERT_UNORDERED_LIST_COMMAND=D,exports.ListExtension=U,exports.ListItemNode=C,exports.ListNode=O,exports.REMOVE_LIST_COMMAND=W,exports.UPDATE_LIST_START_COMMAND=F,exports.insertList=function(e,t){e.update(()=>c(t))},exports.registerCheckList=b,exports.registerList=K,exports.registerListStrictIndentTransform=H,exports.removeList=function(e){e.update(()=>h())};
@@ -1,9 +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{effect as e,namedSignals as t}from"@lexical/extension";import{$getNearestNodeOfType as n,$insertNodeToNearestRootAtCaret as r,removeClassNamesFromElement as i,addClassNamesToElement as s,isHTMLElement as o,mergeRegister as l,$findMatchingParent as c,calculateZoomLevel as a}from"@lexical/utils";import{$copyNode as u,$getSelection as g,$isRangeSelection as h,$isRootOrShadowRoot as d,$createParagraphNode as f,$isElementNode as p,$isLeafNode as m,$setPointFromCaret as _,$normalizeCaret as y,$getChildCaret as C,$isTextNode as v,ElementNode as T,buildImportMap as S,$getSiblingCaret as k,$rewindSiblingCaret as b,setDOMStyleFromCSS as x,isHTMLElement as L,$isParagraphNode as N,$applyNodeReplacement as P,$setFormatFromDOM as F,$setDirectionFromDOM as E,normalizeClassNames as O,getStyleObjectFromCSS as A,$createTextNode as I,COMMAND_PRIORITY_LOW as w,KEY_ARROW_DOWN_COMMAND as D,KEY_ARROW_UP_COMMAND as M,KEY_ESCAPE_COMMAND as K,KEY_SPACE_COMMAND as R,$getNearestNodeFromDOMNode as B,KEY_ARROW_LEFT_COMMAND as W,createCommand as U,getNearestEditorFromDOMNode as $,$addUpdateTag as J,SKIP_SELECTION_FOCUS_TAG as V,SKIP_DOM_SELECTION_TAG as z,defineExtension as H,safeCast as X,$getNodeByKey as j,INSERT_PARAGRAPH_COMMAND as q,TextNode as G}from"lexical";function Q(e,...t){const n=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",e);for(const e of t)r.append("v",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Y(e){let t=1,n=e.getParent();for(;null!=n;){if(_e(n)){const e=n.getParent();if(ke(e)){t++,n=e.getParent();continue}Q(40)}return t}return t}function Z(e){let t=e.getParent();ke(t)||Q(40);let n=t;for(;null!==n;)n=n.getParent(),ke(n)&&(t=n);return t}function ee(e){let t=[];const n=e.getChildren().filter(_e);for(let e=0;e<n.length;e++){const r=n[e],i=r.getFirstChild();ke(i)?t=t.concat(ee(i)):t.push(r)}return t}function te(e){return _e(e)&&ke(e.getFirstChild())}function ne(e,t){return _e(e)&&(0===t.length||1===t.length&&e.is(t[0])&&0===e.getChildrenSize())}function re(e){const t=g();if(null!==t){let n=t.getNodes();if(h(t)){const[r]=t.getStartEndPoints(),i=r.getNode(),s=i.getParent();if(d(i)){const e=i.getFirstChild();if(e)n=e.selectStart().getNodes();else{const e=f();i.append(e),n=e.select().getNodes()}}else if(ne(i,n)){const t=Se(e);if(d(s)){i.replace(t);const e=me();p(i)&&(e.setFormat(i.getFormatType()),e.setIndent(i.getIndent())),t.append(e)}else if(_e(i)){const e=i.getParentOrThrow();ie(t,e.getChildren()),e.replace(t)}return}}const r=new Set;for(let t=0;t<n.length;t++){const i=n[t];if(p(i)&&i.isEmpty()&&!_e(i)&&!r.has(i.getKey())){se(i,e);continue}let s=m(i)?i.getParent():_e(i)&&i.isEmpty()?i:null;for(;null!=s;){const t=s.getKey();if(ke(s)){if(!r.has(t)){const n=Se(e);ie(n,s.getChildren()),s.replace(n),r.add(t)}break}{const n=s.getParent();if(d(n)&&!r.has(t)){r.add(t),se(s,e);break}s=n}}}}}function ie(e,t){e.splice(e.getChildrenSize(),0,t)}function se(e,t){if(ke(e))return e;const n=e.getPreviousSibling(),r=e.getNextSibling(),i=me();let s;if(ie(i,e.getChildren()),ke(n)&&t===n.getListType())n.append(i),ke(r)&&t===r.getListType()&&(ie(n,r.getChildren()),r.remove()),s=n;else if(ke(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(i),s=r;else{const n=Se(t);n.append(i),e.replace(n),s=n}i.setFormat(e.getFormatType()),i.setIndent(e.getIndent());const o=g();return h(o)&&(s.getKey()===o.anchor.key&&o.anchor.set(i.getKey(),o.anchor.offset,"element"),s.getKey()===o.focus.key&&o.focus.set(i.getKey(),o.focus.offset,"element")),e.remove(),s}function oe(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&te(n)&&te(r)&&(oe(n.getFirstChild(),r.getFirstChild()),r.remove());const i=t.getChildren();i.length>0&&e.append(...i),t.remove()}function le(){const e=g();if(h(e)){const t=new Set,r=e.getNodes(),i=e.anchor.getNode();if(ne(i,r))t.add(Z(i));else for(let e=0;e<r.length;e++){const i=r[e];if(m(i)){const e=n(i,he);null!=e&&t.add(Z(e))}}for(const n of t){let t=n;const r=ee(n);for(const n of r){const r=f().setTextStyle(e.style).setTextFormat(e.format);ie(r,n.getChildren()),t.insertAfter(r),t=r,n.__key===e.anchor.key&&_(e.anchor,y(C(r,"next"))),n.__key===e.focus.key&&_(e.focus,y(C(r,"next"))),n.remove()}n.remove()}}}function ce(e){const t="check"!==e.getListType();let n=e.getStart();for(const r of e.getChildren())_e(r)&&(r.getValue()!==n&&r.setValue(n),t&&null!=r.getLatest().__checked&&r.setChecked(void 0),ke(r.getFirstChild())||n++)}function ae(e){const t=new Set;if(te(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(te(r)&&te(i)){const n=i.getFirstChild();if(ke(n)){n.append(e);const i=r.getFirstChild();if(ke(i)){ie(n,i.getChildren()),r.remove(),t.add(r.getKey())}}}else if(te(r)){const t=r.getFirstChild();if(ke(t)){const n=t.getFirstChild();null!==n&&n.insertBefore(e)}}else if(te(i)){const t=i.getFirstChild();ke(t)&&t.append(e)}else if(ke(n)){const t=u(e),s=u(n);t.append(s),s.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function ue(e){if(te(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(ke(n?n.getParent():void 0)&&_e(n)&&ke(t)){const r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{const r=u(e),i=u(t);r.append(i),e.getPreviousSiblings().forEach(e=>i.append(e));const s=u(e),o=u(t);s.append(o),ie(o,e.getNextSiblings()),n.insertBefore(r),n.insertAfter(s),n.replace(e)}}}function ge(e=!1){const t=g();if(!h(t)||!t.isCollapsed())return!1;const n=t.anchor.getNode();let r=null;if(_e(n)&&0===n.getChildrenSize())r=n;else if(v(n)){const e=n.getParent();_e(e)&&e.getChildren().every(e=>v(e)&&""===e.getTextContent().trim())&&(r=e)}if(null===r)return!1;const i=Z(r),s=r.getParent();ke(s)||Q(40);const o=s.getParent();let l;if(d(o))l=f(),i.insertAfter(l);else{if(!_e(o))return!1;l=u(o),o.insertAfter(l)}l.setTextStyle(t.style).setTextFormat(t.format).select();const c=r.getNextSiblings();if(c.length>0){const t=e?function(e,t){return e.getStart()+t.getIndexWithinParent()}(s,r):1,n=u(s).setStart(t);if(_e(l)){const e=u(l);e.append(n),l.insertAfter(e)}else l.insertAfter(n);n.append(...c)}return function(e){let t=e;for(;null==t.getNextSibling()&&null==t.getPreviousSibling();){const e=t.getParent();if(null==e||!_e(e)&&!ke(e))break;t=e}t.remove()}(r),!0}class he extends T{__value;__checked;$config(){return this.config("listitem",{$transform:e=>{const t=e.getParent();if(ke(t))"check"!==t.getListType()&&null!=e.getChecked()&&e.setChecked(void 0);else if(t){const n=e.createParentElementNode();ke(n)||Q(340);const i=[e];for(const t of["previous","next"]){i.reverse();for(const{origin:n}of k(e,t)){if(!_e(n))break;i.push(n)}}e.insertBefore(n),n.splice(0,0,i),d(t)||(r(n,b(k(n,"next")),{$shouldSplit:()=>!1,removeEmptyDestination:!0}),t.isEmpty()&&t.isAttached()&&t.remove())}},extends:T,importDOM:S({li:()=>({conversion:de,priority:0})})})}constructor(e=1,t=void 0,n){super(n),this.__value=void 0===e?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){const t=document.createElement("li");return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){!function(e,t){const n=t.getParent();!ke(n)||"check"!==n.getListType()||ke(t.getFirstChild())?(e.removeAttribute("role"),e.removeAttribute("tabIndex"),e.removeAttribute("aria-checked")):(e.setAttribute("role","checkbox"),e.setAttribute("tabIndex","-1"),e.setAttribute("aria-checked",t.getChecked()?"true":"false"))}(t,this),t.value=this.__value,function(e,t,n){const r=t.list;if(!r)return;const o=r.listitem,l=r.nested&&r.nested.listitem,c=n.getParent(),a=ke(c)&&"check"===c.getListType(),u=n.getChecked(),g=n.getChildren().some(e=>ke(e)),h=[];void 0!==r.listitemChecked&&h.push(r.listitemChecked);void 0!==r.listitemUnchecked&&h.push(r.listitemUnchecked);void 0!==l&&h.push(...O(l));h.length>0&&i(e,...h);const d=[];void 0!==o&&d.push(...O(o));if(a){const e=u?r.listitemChecked:r.listitemUnchecked;void 0!==e&&d.push(e)}void 0!==l&&g&&d.push(...O(l));d.length>0&&s(e,...d)}(t,n.theme,this);const r=e?e.__style:"",o=this.__style;r!==o&&x(t.style,o,r),function(e,t,n){const r=t.__textStyle,i=n?n.__textStyle:"";if(null!==n&&i===r)return;const s=A(r);for(const t in s)e.style.setProperty(`--listitem-marker-${t}`,s[t]);if(""!==i)for(const t in A(i))t in s||e.style.removeProperty(`--listitem-marker-${t}`)}(t,this,e)}updateDOM(e,t,n){const r=t;return this.updateListItemDOM(e,r,n),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){const t=this.createDOM(e._config),n=this.getFormatType();n&&(t.style.textAlign=n);const r=this.getDirection();return r&&(t.dir=r),te(this)?{after(e){if(L(e)){const t=e.previousElementSibling;if(L(t)&&"LI"===t.nodeName){for(;e.firstChild;)t.append(e.firstChild);e.remove()}}return e},element:t}:{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if(p(n)&&this.canMergeWith(n)){const e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(_e(e))return super.replace(e);this.setIndent(0);const n=this.getParentOrThrow();if(!ke(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{const t=u(n);let r=this.getNextSibling();for(;r;){const e=r;r=r.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}const r=this.__key;let i=0;if(t&&(p(e)||Q(139),i=e.getChildrenSize(),e.splice(i,0,this.getChildren())),t&&p(e)){const t=g();if(h(t))for(const n of t.getStartEndPoints())n.key===r&&"element"===n.type&&n.set(e.getKey(),i+n.offset,"element")}return this.remove(),0===n.getChildrenSize()&&n.remove(),e}insertAfter(e,t=!0){const n=this.getParentOrThrow();if(ke(n)||Q(39),_e(e))return super.insertAfter(e,t);const r=this.getNextSiblings();if(n.insertAfter(e,t),0!==r.length){const i=u(n);r.forEach(e=>i.append(e)),e.insertAfter(i,t)}return e}remove(e){const t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&te(t)&&te(n)&&(oe(t.getFirstChild(),n.getFirstChild()),n.remove())}resetOnCopyNodeFrom(e){super.resetOnCopyNodeFrom(e),e.getChecked()&&this.setChecked(!1)}insertNewAfter(e,t=!0){const n=u(this);return this.insertAfter(n,t),n}collapseAtStart(e){const t=f();this.getChildren().forEach(e=>t.append(e));const n=this.getParentOrThrow(),r=n.getParentOrThrow(),i=_e(r);if(1===n.getChildrenSize())if(i)n.remove(),r.select();else{n.insertBefore(t),n.remove();const r=e.anchor,i=e.focus,s=t.getKey();"element"===r.type&&r.getNode().is(this)&&r.set(s,r.offset,"element"),"element"===i.type&&i.getNode().is(this)&&i.set(s,i.offset,"element")}else n.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){const t=this.getWritable();return t.__value=e,t}getChecked(){const e=this.getLatest();let t;const n=this.getParent();return ke(n)&&(t=n.getListType()),"check"===t?Boolean(e.__checked):void 0}setChecked(e){const t=this.getWritable();return t.__checked=e,t}toggleChecked(){const e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){const e=this.getParent();if(null===e||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;_e(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){"number"!=typeof e&&Q(117),(e=Math.floor(e))>=0||Q(199);let t=this.getIndent();for(;t!==e;)t<e?(ae(this),t++):(ue(this),t--);return this}canInsertAfter(e){return _e(e)}canReplaceWith(e){return _e(e)}canMergeWith(e){return _e(e)||N(e)}extractWithChild(e,t){if(!h(t))return!1;const n=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Se("bullet")}canMergeWhenEmpty(){return!0}}function de(e){if(e.classList.contains("task-list-item"))for(const t of e.children)if("INPUT"===t.tagName)return fe(t);if(e.classList.contains("joplin-checkbox"))for(const t of e.children)if(t.classList.contains("checkbox-wrapper")&&t.children.length>0&&"INPUT"===t.children[0].tagName)return fe(t.children[0]);const t=e.getAttribute("aria-checked"),n=me("true"===t||"false"!==t&&void 0);return F(n,e),{after:pe.bind(null,n),node:E(n,e)}}function fe(e){if(!("checkbox"===e.getAttribute("type")))return{node:null};const t=me(e.hasAttribute("checked"));return{after:pe.bind(null,t),node:t}}function pe(e,t){const n=t[0];return 1===t.length&&N(n)&&!e.getFormatType()&&n.getFormatType()?(e.setFormat(n.getFormatType()),n.getChildren()):t}function me(e){return P(new he(void 0,e))}function _e(e){return e instanceof he}class ye extends T{__tag;__start;__listType;$config(){return this.config("list",{$transform:e=>{!function(e){const t=e.getNextSibling();ke(t)&&e.getListType()===t.getListType()&&oe(e,t)}(e),ce(e)},extends:T,importDOM:S({ol:()=>({conversion:ve,priority:0}),ul:()=>({conversion:ve,priority:0})})})}constructor(e="number",t=1,n){super(n);const r=Te[e]||e;this.__listType=r,this.__tag="number"===r?"ol":"ul",this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){const t=this.getWritable();return t.__listType=e,t.__tag="number"===e?"ol":"ul",t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){const t=this.getWritable();return t.__start=e,t}createDOM(e,t){const n=this.__tag,r=document.createElement(n);return 1!==this.__start&&r.setAttribute("start",String(this.__start)),r.__lexicalListType=this.__listType,Ce(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||(Ce(t,n.theme,this),e.__start!==this.__start&&t.setAttribute("start",String(this.__start)),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){const t=this.createDOM(e._config,e);return o(t)&&(1!==this.__start&&t.setAttribute("start",String(this.__start)),"check"===this.__listType&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,n){let r=n;for(let e=0;e<n.length;e++){const t=n[e];_e(t)||(r===n&&(r=[...n]),r[e]=this.createListItemNode().append(!p(t)||ke(t)||t.isInline()?t:I(t.getTextContent())))}return super.splice(e,t,r)}extractWithChild(e){return _e(e)}createListItemNode(){return me()}}function Ce(e,t,n){const r=[],o=[],l=t.list;if(void 0!==l){const e=l[`${n.__tag}Depth`]||[],t=Y(n)-1,i=t%e.length,s=e[i],c=l[n.__tag];let a;const u=l.nested,g=l.checklist;if(void 0!==u&&u.list&&(a=u.list),void 0!==c&&r.push(c),void 0!==g&&"check"===n.__listType&&r.push(g),void 0!==s){r.push(...O(s));for(let t=0;t<e.length;t++)t!==i&&o.push(n.__tag+t)}if(void 0!==a){const e=O(a);t>1?r.push(...e):o.push(...e)}}o.length>0&&i(e,...o),r.length>0&&s(e,...r)}function ve(e){let t;if(function(e){return o(e)&&"ol"===e.nodeName.toLowerCase()}(e)){const n=e.start;t=Se("number",n)}else t=function(e){if("check"===e.getAttribute("__lexicallisttype")||e.classList.contains("contains-task-list")||"1"===e.getAttribute("data-is-checklist"))return!0;for(const t of e.childNodes)if(o(t)&&t.hasAttribute("aria-checked"))return!0;return!1}(e)?Se("check"):Se("bullet");return E(t,e),{after:e=>function(e,t){const n=t.createListItemNode.bind(t),r=[];for(let t=0;t<e.length;t++){const i=e[t];if(_e(i)){r.push(i);const e=i.getChildren();e.length>1&&e.forEach(e=>{ke(e)&&r.push(n().append(e))})}else r.push(n().append(i))}return r}(e,t),node:t}}const Te={ol:"number",ul:"bullet"};function Se(e="number",t=1){return P(new ye(e,t))}function ke(e){return e instanceof ye}const be=U("INSERT_CHECK_LIST_COMMAND");function xe(e,t){const n=t&&t.disableTakeFocusOnClick||!1,r="boolean"==typeof n?()=>n:n.peek.bind(n),i=e=>{const t=e.target;if(!o(t))return!1;const n=t.__lexicalCheckListLastHandled;return void 0!==n&&e.timeStamp-n<500},s=e=>{const t=e.target;o(t)&&(t.__lexicalCheckListLastHandled=e.timeStamp)},a=e=>{i(e)||(s(e),Ne(e,r()))},u=e=>{"touch"===e.pointerType&&(i(e)||(s(e),Ne(e,r())))},d=e=>{!function(e,t){Le(e,()=>{e.preventDefault(),t&&e.stopPropagation()})}(e,r())};return l(e.registerCommand(be,()=>(re("check"),!0),w),e.registerCommand(D,t=>Fe(t,e,!1),w),e.registerCommand(M,t=>Fe(t,e,!0),w),e.registerCommand(K,()=>{if(null!=Pe()){const t=e.getRootElement();return null!=t&&t.focus(),!0}return!1},w),e.registerCommand(R,t=>{const n=Pe();return!(null==n||!e.isEditable())&&(e.update(()=>{const e=B(n);_e(e)&&(t.preventDefault(),e.toggleChecked())}),!0)},w),e.registerCommand(W,t=>e.getEditorState().read(()=>{const n=g();if(h(n)&&n.isCollapsed()){const{anchor:r}=n,i="element"===r.type;if(i||0===r.offset){const n=r.getNode(),s=c(n,e=>p(e)&&!e.isInline());if(_e(s)){const r=s.getParent();if(ke(r)&&"check"===r.getListType()&&(i||s.getFirstDescendant()===n)){const n=e.getElementByKey(s.__key);if(null!=n&&document.activeElement!==n)return n.focus(),t.preventDefault(),!0}}}}return!1}),w),e.registerRootListener(e=>{if(null!==e)return e.addEventListener("click",a),e.addEventListener("pointerup",u),e.addEventListener("pointerdown",d,{capture:!0}),e.addEventListener("mousedown",d,{capture:!0}),e.addEventListener("touchstart",d,{capture:!0,passive:!1}),()=>{e.removeEventListener("click",a),e.removeEventListener("pointerup",u),e.removeEventListener("pointerdown",d,{capture:!0}),e.removeEventListener("mousedown",d,{capture:!0}),e.removeEventListener("touchstart",d,{capture:!0})}}))}function Le(e,t){const n=e.target;if(!o(n))return;const r=n.firstChild;if(o(r)&&("UL"===r.tagName||"OL"===r.tagName))return;const i=n.parentNode;if(!i||"check"!==i.__lexicalListType)return;let s=null,l=null;if("clientX"in e)s=e.clientX;else if("touches"in e){const t=e.touches;t.length>0&&(s=t[0].clientX,l="touch")}if(null==s)return;const c=n.getBoundingClientRect(),u=s/a(n),g=window.getComputedStyle?window.getComputedStyle(n,"::before"):{width:"0px"},h=parseFloat(g.width),d="touch"===l||"pointerType"in e&&"touch"===e.pointerType?32:0;("rtl"===n.dir?u<c.right+d&&u>c.right-h-d:u>c.left-d&&u<c.left+h+d)&&t()}function Ne(e,t){Le(e,()=>{if(o(e.target)){const n=e.target,r=$(n);null!=r&&r.isEditable()&&r.update(()=>{const e=B(n);_e(e)&&(t?(J(V),J(z)):n.focus(),e.toggleChecked())})}})}function Pe(){const e=document.activeElement;return o(e)&&"LI"===e.tagName&&null!=e.parentNode&&"check"===e.parentNode.__lexicalListType?e:null}function Fe(e,t,n){const r=Pe();return null!=r&&t.update(()=>{const i=B(r);if(!_e(i))return;const s=function(e,t){let n=t?e.getPreviousSibling():e.getNextSibling(),r=e;for(;null==n&&_e(r);)r=r.getParentOrThrow().getParent(),null!=r&&(n=t?r.getPreviousSibling():r.getNextSibling());for(;_e(n);){const e=t?n.getLastChild():n.getFirstChild();if(!ke(e))return n;n=t?e.getLastChild():e.getFirstChild()}return null}(i,n);if(null!=s){s.selectStart();const n=t.getElementByKey(s.__key);null!=n&&(e.preventDefault(),setTimeout(()=>{n.focus()},0))}}),!1}const Ee=U("UPDATE_LIST_START_COMMAND"),Oe=U("INSERT_UNORDERED_LIST_COMMAND"),Ae=U("INSERT_ORDERED_LIST_COMMAND"),Ie=U("REMOVE_LIST_COMMAND");function we(e,t){return l(e.registerCommand(Ae,()=>(re("number"),!0),w),e.registerCommand(Ee,e=>{const{listNodeKey:t,newStart:n}=e,r=j(t);return!!ke(r)&&("number"===r.getListType()&&(r.setStart(n),ce(r)),!0)},w),e.registerCommand(Oe,()=>(re("bullet"),!0),w),e.registerCommand(Ie,()=>(le(),!0),w),e.registerCommand(q,()=>ge(!!(t&&t.restoreNumbering)),w),e.registerNodeTransform(he,e=>{const t=e.getFirstChild();if(t){if(v(t)){const n=t.getStyle(),r=t.getFormat();e.getTextStyle()!==n&&e.setTextStyle(n),e.getTextFormat()!==r&&e.setTextFormat(r)}}else{const t=g();h(t)&&(t.style!==e.getTextStyle()||t.format!==e.getTextFormat())&&t.isCollapsed()&&e.is(t.anchor.getNode())&&e.setTextStyle(t.style).setTextFormat(t.format)}}),e.registerNodeTransform(G,e=>{const t=e.getParent();if(_e(t)&&e.is(t.getFirstChild())){const n=e.getStyle(),r=e.getFormat();n===t.getTextStyle()&&r===t.getTextFormat()||t.setTextStyle(n).setTextFormat(r)}}))}function De(e){const t=e=>{const t=e.getParent();if(ke(e.getFirstChild())||!ke(t))return;const n=c(e,e=>_e(e)&&ke(e.getParent())&&_e(e.getPreviousSibling()));if(null===n&&e.getIndent()>0)e.setIndent(0);else if(_e(n)){const r=n.getPreviousSibling();if(_e(r)){const n=function(e){let t=e,n=t.getFirstChild();for(;ke(n);){const e=n.getLastChild();if(!_e(e))break;t=e,n=t.getFirstChild()}return t}(r),i=n.getParent();if(ke(i)){const n=Y(i);n+1<Y(t)&&e.setIndent(n)}}}};return e.registerNodeTransform(ye,e=>{const n=[e];for(;n.length>0;){const e=n.shift();if(ke(e))for(const r of e.getChildren())if(_e(r)){t(r);const e=r.getFirstChild();ke(e)&&n.push(e)}}})}function Me(e,t){e.update(()=>re(t))}function Ke(e){e.update(()=>le())}const Re=H({build:(e,n,r)=>t(n),config:X({hasStrictIndent:!1,shouldPreserveNumbering:!1}),name:"@lexical/list/List",nodes:()=>[ye,he],register(t,n,r){const i=r.getOutput();return l(e(()=>we(t,{restoreNumbering:i.shouldPreserveNumbering.value})),e(()=>i.hasStrictIndent.value?De(t):void 0))}}),Be=H({build:(e,n)=>t(n),config:X({disableTakeFocusOnClick:!1}),dependencies:[Re],name:"@lexical/list/CheckList",register:(e,t,n)=>xe(e,n.getOutput())});export{me as $createListItemNode,Se as $createListNode,Y as $getListDepth,ge as $handleListInsertParagraph,re as $insertList,_e as $isListItemNode,ke as $isListNode,le as $removeList,Be as CheckListExtension,be as INSERT_CHECK_LIST_COMMAND,Ae as INSERT_ORDERED_LIST_COMMAND,Oe as INSERT_UNORDERED_LIST_COMMAND,Re as ListExtension,he as ListItemNode,ye as ListNode,Ie as REMOVE_LIST_COMMAND,Ee as UPDATE_LIST_START_COMMAND,Me as insertList,xe as registerCheckList,we as registerList,De as registerListStrictIndentTransform,Ke as removeList};
File without changes
File without changes
File without changes
File without changes