lexical 0.30.1-nightly.20250410.0 → 0.30.1-nightly.20250415.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.
package/Lexical.dev.js CHANGED
@@ -7249,7 +7249,7 @@ function updateDOMSelection(prevSelection, nextSelection, editor, domSelection,
7249
7249
 
7250
7250
  // TODO: make this not hard-coded, and add another config option
7251
7251
  // that makes this configurable.
7252
- if (tags.has('collaboration') && activeElement !== rootElement || activeElement !== null && isSelectionCapturedInDecoratorInput(activeElement)) {
7252
+ if (tags.has(COLLABORATION_TAG) && activeElement !== rootElement || activeElement !== null && isSelectionCapturedInDecoratorInput(activeElement)) {
7253
7253
  return;
7254
7254
  }
7255
7255
  if (!$isRangeSelection(nextSelection)) {
@@ -7317,7 +7317,7 @@ function updateDOMSelection(prevSelection, nextSelection, editor, domSelection,
7317
7317
  // Apply the updated selection to the DOM. Note: this will trigger
7318
7318
  // a "selectionchange" event, although it will be asynchronous.
7319
7319
  setDOMSelectionBaseAndExtent(domSelection, nextAnchorNode, nextAnchorOffset, nextFocusNode, nextFocusOffset);
7320
- if (!tags.has('skip-scroll-into-view') && nextSelection.isCollapsed() && rootElement !== null && rootElement === document.activeElement) {
7320
+ if (!tags.has(SKIP_SCROLL_INTO_VIEW_TAG) && nextSelection.isCollapsed() && rootElement !== null && rootElement === document.activeElement) {
7321
7321
  const selectionTarget = $isRangeSelection(nextSelection) && nextSelection.anchor.type === 'element' ? nextAnchorNode.childNodes[nextAnchorOffset] || null : domSelection.rangeCount > 0 ? domSelection.getRangeAt(0) : null;
7322
7322
  if (selectionTarget !== null) {
7323
7323
  let selectionRect;
@@ -7975,7 +7975,7 @@ function $commitPendingUpdates(editor, recoveryEditorState) {
7975
7975
  // and scroll into view if needed.
7976
7976
  if (editor._editable &&
7977
7977
  // domSelection will be null in headless
7978
- domSelection !== null && (needsUpdate || pendingSelection === null || pendingSelection.dirty) && rootElement !== null && !tags.has('skip-dom-selection')) {
7978
+ domSelection !== null && (needsUpdate || pendingSelection === null || pendingSelection.dirty) && rootElement !== null && !tags.has(SKIP_DOM_SELECTION_TAG)) {
7979
7979
  activeEditor = editor;
7980
7980
  activeEditorState = pendingEditorState;
7981
7981
  try {
@@ -9284,6 +9284,60 @@ class EditorState {
9284
9284
  }
9285
9285
  }
9286
9286
 
9287
+ /**
9288
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
9289
+ *
9290
+ * This source code is licensed under the MIT license found in the
9291
+ * LICENSE file in the root directory of this source tree.
9292
+ *
9293
+ */
9294
+
9295
+ /**
9296
+ * Common update tags used in Lexical. These tags can be used with editor.update() or $addUpdateTag()
9297
+ * to indicate the type/purpose of an update. Multiple tags can be used in a single update.
9298
+ */
9299
+
9300
+ /**
9301
+ * Indicates that the update is related to history operations (undo/redo)
9302
+ */
9303
+ const HISTORIC_TAG = 'historic';
9304
+
9305
+ /**
9306
+ * Indicates that a new history entry should be pushed to the history stack
9307
+ */
9308
+ const HISTORY_PUSH_TAG = 'history-push';
9309
+
9310
+ /**
9311
+ * Indicates that the current update should be merged with the previous history entry
9312
+ */
9313
+ const HISTORY_MERGE_TAG = 'history-merge';
9314
+
9315
+ /**
9316
+ * Indicates that the update is related to a paste operation
9317
+ */
9318
+ const PASTE_TAG = 'paste';
9319
+
9320
+ /**
9321
+ * Indicates that the update is related to collaborative editing
9322
+ */
9323
+ const COLLABORATION_TAG = 'collaboration';
9324
+
9325
+ /**
9326
+ * Indicates that the update should skip collaborative sync
9327
+ */
9328
+ const SKIP_COLLAB_TAG = 'skip-collab';
9329
+
9330
+ /**
9331
+ * Indicates that the update should skip scrolling the selection into view
9332
+ */
9333
+ const SKIP_SCROLL_INTO_VIEW_TAG = 'skip-scroll-into-view';
9334
+
9335
+ /**
9336
+ * Indicates that the update should skip updating the DOM selection
9337
+ * This is useful when you want to make updates without changing the selection or focus
9338
+ */
9339
+ const SKIP_DOM_SELECTION_TAG = 'skip-dom-selection';
9340
+
9287
9341
  /**
9288
9342
  * Copyright (c) Meta Platforms, Inc. and affiliates.
9289
9343
  *
@@ -10069,7 +10123,7 @@ class LexicalEditor {
10069
10123
  this._window = windowObj;
10070
10124
  this._dirtyType = FULL_RECONCILE;
10071
10125
  initMutationObserver(this);
10072
- this._updateTags.add('history-merge');
10126
+ this._updateTags.add(HISTORY_MERGE_TAG);
10073
10127
  $commitPendingUpdates(this);
10074
10128
 
10075
10129
  // TODO: remove this flag once we no longer use UEv2 internally
@@ -10093,7 +10147,7 @@ class LexicalEditor {
10093
10147
  // using a commit we preserve the readOnly invariant
10094
10148
  // for editor.getEditorState().
10095
10149
  this._window = null;
10096
- this._updateTags.add('history-merge');
10150
+ this._updateTags.add(HISTORY_MERGE_TAG);
10097
10151
  $commitPendingUpdates(this);
10098
10152
  }
10099
10153
  triggerListeners('root', this, false, nextRootElement, prevRootElement);
@@ -10301,7 +10355,7 @@ class LexicalEditor {
10301
10355
  };
10302
10356
  }
10303
10357
  }
10304
- LexicalEditor.version = "0.30.1-nightly.20250410.0+dev.cjs";
10358
+ LexicalEditor.version = "0.30.1-nightly.20250415.0+dev.cjs";
10305
10359
 
10306
10360
  let keyCounter = 1;
10307
10361
  function resetRandomKey() {
@@ -10492,6 +10546,13 @@ function internalMarkParentElementsAsDirty(parentKey, nodeMap, dirtyElements) {
10492
10546
  }
10493
10547
 
10494
10548
  // TODO #6031 this function or their callers have to adjust selection (i.e. insertBefore)
10549
+ /**
10550
+ * Removes a node from its parent, updating all necessary pointers and links.
10551
+ * @internal
10552
+ *
10553
+ * This function is for internal use of the library.
10554
+ * Please do not use it as it may change in the future.
10555
+ */
10495
10556
  function removeFromParent(node) {
10496
10557
  const oldParent = node.getParent();
10497
10558
  if (oldParent !== null) {
@@ -10499,47 +10560,38 @@ function removeFromParent(node) {
10499
10560
  const writableParent = oldParent.getWritable();
10500
10561
  const prevSibling = node.getPreviousSibling();
10501
10562
  const nextSibling = node.getNextSibling();
10502
- // TODO: this function duplicates a bunch of operations, can be simplified.
10563
+
10564
+ // Store sibling keys
10565
+ const nextSiblingKey = nextSibling !== null ? nextSibling.__key : null;
10566
+ const prevSiblingKey = prevSibling !== null ? prevSibling.__key : null;
10567
+
10568
+ // Get writable siblings once
10569
+ const writablePrevSibling = prevSibling !== null ? prevSibling.getWritable() : null;
10570
+ const writableNextSibling = nextSibling !== null ? nextSibling.getWritable() : null;
10571
+
10572
+ // Update parent's first/last pointers
10503
10573
  if (prevSibling === null) {
10504
- if (nextSibling !== null) {
10505
- const writableNextSibling = nextSibling.getWritable();
10506
- writableParent.__first = nextSibling.__key;
10507
- writableNextSibling.__prev = null;
10508
- } else {
10509
- writableParent.__first = null;
10510
- }
10511
- } else {
10512
- const writablePrevSibling = prevSibling.getWritable();
10513
- if (nextSibling !== null) {
10514
- const writableNextSibling = nextSibling.getWritable();
10515
- writableNextSibling.__prev = writablePrevSibling.__key;
10516
- writablePrevSibling.__next = writableNextSibling.__key;
10517
- } else {
10518
- writablePrevSibling.__next = null;
10519
- }
10520
- writableNode.__prev = null;
10574
+ writableParent.__first = nextSiblingKey;
10521
10575
  }
10522
10576
  if (nextSibling === null) {
10523
- if (prevSibling !== null) {
10524
- const writablePrevSibling = prevSibling.getWritable();
10525
- writableParent.__last = prevSibling.__key;
10526
- writablePrevSibling.__next = null;
10527
- } else {
10528
- writableParent.__last = null;
10529
- }
10530
- } else {
10531
- const writableNextSibling = nextSibling.getWritable();
10532
- if (prevSibling !== null) {
10533
- const writablePrevSibling = prevSibling.getWritable();
10534
- writablePrevSibling.__next = writableNextSibling.__key;
10535
- writableNextSibling.__prev = writablePrevSibling.__key;
10536
- } else {
10537
- writableNextSibling.__prev = null;
10538
- }
10539
- writableNode.__next = null;
10577
+ writableParent.__last = prevSiblingKey;
10540
10578
  }
10541
- writableParent.__size--;
10579
+
10580
+ // Update sibling links
10581
+ if (writablePrevSibling !== null) {
10582
+ writablePrevSibling.__next = nextSiblingKey;
10583
+ }
10584
+ if (writableNextSibling !== null) {
10585
+ writableNextSibling.__prev = prevSiblingKey;
10586
+ }
10587
+
10588
+ // Clear node's links
10589
+ writableNode.__prev = null;
10590
+ writableNode.__next = null;
10542
10591
  writableNode.__parent = null;
10592
+
10593
+ // Update parent size
10594
+ writableParent.__size--;
10543
10595
  }
10544
10596
  }
10545
10597
 
@@ -10561,7 +10613,6 @@ function internalMarkNodeAsDirty(node) {
10561
10613
  if ($isElementNode(node)) {
10562
10614
  dirtyElements.set(key, true);
10563
10615
  } else {
10564
- // TODO split internally MarkNodeAsDirty into two dedicated Element/leave functions
10565
10616
  editor._dirtyLeaves.add(key);
10566
10617
  }
10567
10618
  }
@@ -10674,7 +10725,7 @@ function markNodesWithTypesAsDirty(editor, types) {
10674
10725
  }
10675
10726
  }
10676
10727
  }, editor._pendingEditorState === null ? {
10677
- tag: 'history-merge'
10728
+ tag: HISTORY_MERGE_TAG
10678
10729
  } : undefined);
10679
10730
  }
10680
10731
  function $getRoot() {
@@ -13010,60 +13061,6 @@ function $splitAtPointCaretNext(pointCaret, {
13010
13061
  return parentCaret;
13011
13062
  }
13012
13063
 
13013
- /**
13014
- * Copyright (c) Meta Platforms, Inc. and affiliates.
13015
- *
13016
- * This source code is licensed under the MIT license found in the
13017
- * LICENSE file in the root directory of this source tree.
13018
- *
13019
- */
13020
-
13021
- /**
13022
- * Common update tags used in Lexical. These tags can be used with editor.update() or $addUpdateTag()
13023
- * to indicate the type/purpose of an update. Multiple tags can be used in a single update.
13024
- */
13025
-
13026
- /**
13027
- * Indicates that the update is related to history operations (undo/redo)
13028
- */
13029
- const HISTORIC_TAG = 'historic';
13030
-
13031
- /**
13032
- * Indicates that a new history entry should be pushed to the history stack
13033
- */
13034
- const HISTORY_PUSH_TAG = 'history-push';
13035
-
13036
- /**
13037
- * Indicates that the current update should be merged with the previous history entry
13038
- */
13039
- const HISTORY_MERGE_TAG = 'history-merge';
13040
-
13041
- /**
13042
- * Indicates that the update is related to a paste operation
13043
- */
13044
- const PASTE_TAG = 'paste';
13045
-
13046
- /**
13047
- * Indicates that the update is related to collaborative editing
13048
- */
13049
- const COLLABORATION_TAG = 'collaboration';
13050
-
13051
- /**
13052
- * Indicates that the update should skip collaborative sync
13053
- */
13054
- const SKIP_COLLAB_TAG = 'skip-collab';
13055
-
13056
- /**
13057
- * Indicates that the update should skip scrolling the selection into view
13058
- */
13059
- const SKIP_SCROLL_INTO_VIEW_TAG = 'skip-scroll-into-view';
13060
-
13061
- /**
13062
- * Indicates that the update should skip updating the DOM selection
13063
- * This is useful when you want to make updates without changing the selection or focus
13064
- */
13065
- const SKIP_DOM_SELECTION_TAG = 'skip-dom-selection';
13066
-
13067
13064
  exports.$addUpdateTag = $addUpdateTag;
13068
13065
  exports.$applyNodeReplacement = $applyNodeReplacement;
13069
13066
  exports.$caretFromPoint = $caretFromPoint;
@@ -13250,6 +13247,7 @@ exports.isLexicalEditor = isLexicalEditor;
13250
13247
  exports.isSelectionCapturedInDecoratorInput = isSelectionCapturedInDecoratorInput;
13251
13248
  exports.isSelectionWithinEditor = isSelectionWithinEditor;
13252
13249
  exports.makeStepwiseIterator = makeStepwiseIterator;
13250
+ exports.removeFromParent = removeFromParent;
13253
13251
  exports.resetRandomKey = resetRandomKey;
13254
13252
  exports.setDOMUnmanaged = setDOMUnmanaged;
13255
13253
  exports.setNodeIndentFromDOM = setNodeIndentFromDOM;
package/Lexical.dev.mjs CHANGED
@@ -7247,7 +7247,7 @@ function updateDOMSelection(prevSelection, nextSelection, editor, domSelection,
7247
7247
 
7248
7248
  // TODO: make this not hard-coded, and add another config option
7249
7249
  // that makes this configurable.
7250
- if (tags.has('collaboration') && activeElement !== rootElement || activeElement !== null && isSelectionCapturedInDecoratorInput(activeElement)) {
7250
+ if (tags.has(COLLABORATION_TAG) && activeElement !== rootElement || activeElement !== null && isSelectionCapturedInDecoratorInput(activeElement)) {
7251
7251
  return;
7252
7252
  }
7253
7253
  if (!$isRangeSelection(nextSelection)) {
@@ -7315,7 +7315,7 @@ function updateDOMSelection(prevSelection, nextSelection, editor, domSelection,
7315
7315
  // Apply the updated selection to the DOM. Note: this will trigger
7316
7316
  // a "selectionchange" event, although it will be asynchronous.
7317
7317
  setDOMSelectionBaseAndExtent(domSelection, nextAnchorNode, nextAnchorOffset, nextFocusNode, nextFocusOffset);
7318
- if (!tags.has('skip-scroll-into-view') && nextSelection.isCollapsed() && rootElement !== null && rootElement === document.activeElement) {
7318
+ if (!tags.has(SKIP_SCROLL_INTO_VIEW_TAG) && nextSelection.isCollapsed() && rootElement !== null && rootElement === document.activeElement) {
7319
7319
  const selectionTarget = $isRangeSelection(nextSelection) && nextSelection.anchor.type === 'element' ? nextAnchorNode.childNodes[nextAnchorOffset] || null : domSelection.rangeCount > 0 ? domSelection.getRangeAt(0) : null;
7320
7320
  if (selectionTarget !== null) {
7321
7321
  let selectionRect;
@@ -7973,7 +7973,7 @@ function $commitPendingUpdates(editor, recoveryEditorState) {
7973
7973
  // and scroll into view if needed.
7974
7974
  if (editor._editable &&
7975
7975
  // domSelection will be null in headless
7976
- domSelection !== null && (needsUpdate || pendingSelection === null || pendingSelection.dirty) && rootElement !== null && !tags.has('skip-dom-selection')) {
7976
+ domSelection !== null && (needsUpdate || pendingSelection === null || pendingSelection.dirty) && rootElement !== null && !tags.has(SKIP_DOM_SELECTION_TAG)) {
7977
7977
  activeEditor = editor;
7978
7978
  activeEditorState = pendingEditorState;
7979
7979
  try {
@@ -9282,6 +9282,60 @@ class EditorState {
9282
9282
  }
9283
9283
  }
9284
9284
 
9285
+ /**
9286
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
9287
+ *
9288
+ * This source code is licensed under the MIT license found in the
9289
+ * LICENSE file in the root directory of this source tree.
9290
+ *
9291
+ */
9292
+
9293
+ /**
9294
+ * Common update tags used in Lexical. These tags can be used with editor.update() or $addUpdateTag()
9295
+ * to indicate the type/purpose of an update. Multiple tags can be used in a single update.
9296
+ */
9297
+
9298
+ /**
9299
+ * Indicates that the update is related to history operations (undo/redo)
9300
+ */
9301
+ const HISTORIC_TAG = 'historic';
9302
+
9303
+ /**
9304
+ * Indicates that a new history entry should be pushed to the history stack
9305
+ */
9306
+ const HISTORY_PUSH_TAG = 'history-push';
9307
+
9308
+ /**
9309
+ * Indicates that the current update should be merged with the previous history entry
9310
+ */
9311
+ const HISTORY_MERGE_TAG = 'history-merge';
9312
+
9313
+ /**
9314
+ * Indicates that the update is related to a paste operation
9315
+ */
9316
+ const PASTE_TAG = 'paste';
9317
+
9318
+ /**
9319
+ * Indicates that the update is related to collaborative editing
9320
+ */
9321
+ const COLLABORATION_TAG = 'collaboration';
9322
+
9323
+ /**
9324
+ * Indicates that the update should skip collaborative sync
9325
+ */
9326
+ const SKIP_COLLAB_TAG = 'skip-collab';
9327
+
9328
+ /**
9329
+ * Indicates that the update should skip scrolling the selection into view
9330
+ */
9331
+ const SKIP_SCROLL_INTO_VIEW_TAG = 'skip-scroll-into-view';
9332
+
9333
+ /**
9334
+ * Indicates that the update should skip updating the DOM selection
9335
+ * This is useful when you want to make updates without changing the selection or focus
9336
+ */
9337
+ const SKIP_DOM_SELECTION_TAG = 'skip-dom-selection';
9338
+
9285
9339
  /**
9286
9340
  * Copyright (c) Meta Platforms, Inc. and affiliates.
9287
9341
  *
@@ -10067,7 +10121,7 @@ class LexicalEditor {
10067
10121
  this._window = windowObj;
10068
10122
  this._dirtyType = FULL_RECONCILE;
10069
10123
  initMutationObserver(this);
10070
- this._updateTags.add('history-merge');
10124
+ this._updateTags.add(HISTORY_MERGE_TAG);
10071
10125
  $commitPendingUpdates(this);
10072
10126
 
10073
10127
  // TODO: remove this flag once we no longer use UEv2 internally
@@ -10091,7 +10145,7 @@ class LexicalEditor {
10091
10145
  // using a commit we preserve the readOnly invariant
10092
10146
  // for editor.getEditorState().
10093
10147
  this._window = null;
10094
- this._updateTags.add('history-merge');
10148
+ this._updateTags.add(HISTORY_MERGE_TAG);
10095
10149
  $commitPendingUpdates(this);
10096
10150
  }
10097
10151
  triggerListeners('root', this, false, nextRootElement, prevRootElement);
@@ -10299,7 +10353,7 @@ class LexicalEditor {
10299
10353
  };
10300
10354
  }
10301
10355
  }
10302
- LexicalEditor.version = "0.30.1-nightly.20250410.0+dev.esm";
10356
+ LexicalEditor.version = "0.30.1-nightly.20250415.0+dev.esm";
10303
10357
 
10304
10358
  let keyCounter = 1;
10305
10359
  function resetRandomKey() {
@@ -10490,6 +10544,13 @@ function internalMarkParentElementsAsDirty(parentKey, nodeMap, dirtyElements) {
10490
10544
  }
10491
10545
 
10492
10546
  // TODO #6031 this function or their callers have to adjust selection (i.e. insertBefore)
10547
+ /**
10548
+ * Removes a node from its parent, updating all necessary pointers and links.
10549
+ * @internal
10550
+ *
10551
+ * This function is for internal use of the library.
10552
+ * Please do not use it as it may change in the future.
10553
+ */
10493
10554
  function removeFromParent(node) {
10494
10555
  const oldParent = node.getParent();
10495
10556
  if (oldParent !== null) {
@@ -10497,47 +10558,38 @@ function removeFromParent(node) {
10497
10558
  const writableParent = oldParent.getWritable();
10498
10559
  const prevSibling = node.getPreviousSibling();
10499
10560
  const nextSibling = node.getNextSibling();
10500
- // TODO: this function duplicates a bunch of operations, can be simplified.
10561
+
10562
+ // Store sibling keys
10563
+ const nextSiblingKey = nextSibling !== null ? nextSibling.__key : null;
10564
+ const prevSiblingKey = prevSibling !== null ? prevSibling.__key : null;
10565
+
10566
+ // Get writable siblings once
10567
+ const writablePrevSibling = prevSibling !== null ? prevSibling.getWritable() : null;
10568
+ const writableNextSibling = nextSibling !== null ? nextSibling.getWritable() : null;
10569
+
10570
+ // Update parent's first/last pointers
10501
10571
  if (prevSibling === null) {
10502
- if (nextSibling !== null) {
10503
- const writableNextSibling = nextSibling.getWritable();
10504
- writableParent.__first = nextSibling.__key;
10505
- writableNextSibling.__prev = null;
10506
- } else {
10507
- writableParent.__first = null;
10508
- }
10509
- } else {
10510
- const writablePrevSibling = prevSibling.getWritable();
10511
- if (nextSibling !== null) {
10512
- const writableNextSibling = nextSibling.getWritable();
10513
- writableNextSibling.__prev = writablePrevSibling.__key;
10514
- writablePrevSibling.__next = writableNextSibling.__key;
10515
- } else {
10516
- writablePrevSibling.__next = null;
10517
- }
10518
- writableNode.__prev = null;
10572
+ writableParent.__first = nextSiblingKey;
10519
10573
  }
10520
10574
  if (nextSibling === null) {
10521
- if (prevSibling !== null) {
10522
- const writablePrevSibling = prevSibling.getWritable();
10523
- writableParent.__last = prevSibling.__key;
10524
- writablePrevSibling.__next = null;
10525
- } else {
10526
- writableParent.__last = null;
10527
- }
10528
- } else {
10529
- const writableNextSibling = nextSibling.getWritable();
10530
- if (prevSibling !== null) {
10531
- const writablePrevSibling = prevSibling.getWritable();
10532
- writablePrevSibling.__next = writableNextSibling.__key;
10533
- writableNextSibling.__prev = writablePrevSibling.__key;
10534
- } else {
10535
- writableNextSibling.__prev = null;
10536
- }
10537
- writableNode.__next = null;
10575
+ writableParent.__last = prevSiblingKey;
10538
10576
  }
10539
- writableParent.__size--;
10577
+
10578
+ // Update sibling links
10579
+ if (writablePrevSibling !== null) {
10580
+ writablePrevSibling.__next = nextSiblingKey;
10581
+ }
10582
+ if (writableNextSibling !== null) {
10583
+ writableNextSibling.__prev = prevSiblingKey;
10584
+ }
10585
+
10586
+ // Clear node's links
10587
+ writableNode.__prev = null;
10588
+ writableNode.__next = null;
10540
10589
  writableNode.__parent = null;
10590
+
10591
+ // Update parent size
10592
+ writableParent.__size--;
10541
10593
  }
10542
10594
  }
10543
10595
 
@@ -10559,7 +10611,6 @@ function internalMarkNodeAsDirty(node) {
10559
10611
  if ($isElementNode(node)) {
10560
10612
  dirtyElements.set(key, true);
10561
10613
  } else {
10562
- // TODO split internally MarkNodeAsDirty into two dedicated Element/leave functions
10563
10614
  editor._dirtyLeaves.add(key);
10564
10615
  }
10565
10616
  }
@@ -10672,7 +10723,7 @@ function markNodesWithTypesAsDirty(editor, types) {
10672
10723
  }
10673
10724
  }
10674
10725
  }, editor._pendingEditorState === null ? {
10675
- tag: 'history-merge'
10726
+ tag: HISTORY_MERGE_TAG
10676
10727
  } : undefined);
10677
10728
  }
10678
10729
  function $getRoot() {
@@ -13008,58 +13059,4 @@ function $splitAtPointCaretNext(pointCaret, {
13008
13059
  return parentCaret;
13009
13060
  }
13010
13061
 
13011
- /**
13012
- * Copyright (c) Meta Platforms, Inc. and affiliates.
13013
- *
13014
- * This source code is licensed under the MIT license found in the
13015
- * LICENSE file in the root directory of this source tree.
13016
- *
13017
- */
13018
-
13019
- /**
13020
- * Common update tags used in Lexical. These tags can be used with editor.update() or $addUpdateTag()
13021
- * to indicate the type/purpose of an update. Multiple tags can be used in a single update.
13022
- */
13023
-
13024
- /**
13025
- * Indicates that the update is related to history operations (undo/redo)
13026
- */
13027
- const HISTORIC_TAG = 'historic';
13028
-
13029
- /**
13030
- * Indicates that a new history entry should be pushed to the history stack
13031
- */
13032
- const HISTORY_PUSH_TAG = 'history-push';
13033
-
13034
- /**
13035
- * Indicates that the current update should be merged with the previous history entry
13036
- */
13037
- const HISTORY_MERGE_TAG = 'history-merge';
13038
-
13039
- /**
13040
- * Indicates that the update is related to a paste operation
13041
- */
13042
- const PASTE_TAG = 'paste';
13043
-
13044
- /**
13045
- * Indicates that the update is related to collaborative editing
13046
- */
13047
- const COLLABORATION_TAG = 'collaboration';
13048
-
13049
- /**
13050
- * Indicates that the update should skip collaborative sync
13051
- */
13052
- const SKIP_COLLAB_TAG = 'skip-collab';
13053
-
13054
- /**
13055
- * Indicates that the update should skip scrolling the selection into view
13056
- */
13057
- const SKIP_SCROLL_INTO_VIEW_TAG = 'skip-scroll-into-view';
13058
-
13059
- /**
13060
- * Indicates that the update should skip updating the DOM selection
13061
- * This is useful when you want to make updates without changing the selection or focus
13062
- */
13063
- const SKIP_DOM_SELECTION_TAG = 'skip-dom-selection';
13064
-
13065
- export { $addUpdateTag, $applyNodeReplacement, $caretFromPoint, $caretRangeFromSelection, $cloneWithProperties, $comparePointCaretNext, $copyNode, $createLineBreakNode, $createNodeSelection, $createParagraphNode, $createPoint, $createRangeSelection, $createRangeSelectionFromDom, $createTabNode, $createTextNode, $extendCaretToRange, $getAdjacentChildCaret, $getAdjacentNode, $getAdjacentSiblingOrParentSiblingCaret, $getCaretInDirection, $getCaretRange, $getCaretRangeInDirection, $getCharacterOffsets, $getChildCaret, $getChildCaretAtIndex, $getChildCaretOrSelf, $getCollapsedCaretRange, $getCommonAncestor, $getCommonAncestorResultBranchOrder, $getEditor, $getNearestNodeFromDOMNode, $getNearestRootOrShadowRoot, $getNodeByKey, $getNodeByKeyOrThrow, $getPreviousSelection, $getRoot, $getSelection, $getSiblingCaret, $getState, $getStateChange, $getTextContent, $getTextNodeOffset, $getTextPointCaret, $getTextPointCaretSlice, $getWritableNodeState, $hasAncestor, $hasUpdateTag, $insertNodes, $isBlockElementNode, $isChildCaret, $isDecoratorNode, $isElementNode, $isExtendableTextPointCaret, $isInlineElementOrDecoratorNode, $isLeafNode, $isLineBreakNode, $isNodeCaret, $isNodeSelection, $isParagraphNode, $isRangeSelection, $isRootNode, $isRootOrShadowRoot, $isSiblingCaret, $isTabNode, $isTextNode, $isTextPointCaret, $isTextPointCaretSlice, $isTokenOrSegmented, $nodesOfType, $normalizeCaret, $normalizeSelection as $normalizeSelection__EXPERIMENTAL, $onUpdate, $parseSerializedNode, $removeTextFromCaretRange, $rewindSiblingCaret, $selectAll, $setCompositionKey, $setPointFromCaret, $setSelection, $setSelectionFromCaretRange, $setState, $splitAtPointCaretNext, $splitNode, $updateRangeSelectionFromCaretRange, ArtificialNode__DO_NOT_USE, BLUR_COMMAND, CAN_REDO_COMMAND, CAN_UNDO_COMMAND, CLEAR_EDITOR_COMMAND, CLEAR_HISTORY_COMMAND, CLICK_COMMAND, COLLABORATION_TAG, COMMAND_PRIORITY_CRITICAL, COMMAND_PRIORITY_EDITOR, COMMAND_PRIORITY_HIGH, COMMAND_PRIORITY_LOW, COMMAND_PRIORITY_NORMAL, CONTROLLED_TEXT_INSERTION_COMMAND, COPY_COMMAND, CUT_COMMAND, DELETE_CHARACTER_COMMAND, DELETE_LINE_COMMAND, DELETE_WORD_COMMAND, DRAGEND_COMMAND, DRAGOVER_COMMAND, DRAGSTART_COMMAND, DROP_COMMAND, DecoratorNode, ElementNode, FOCUS_COMMAND, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, HISTORIC_TAG, HISTORY_MERGE_TAG, HISTORY_PUSH_TAG, INDENT_CONTENT_COMMAND, INSERT_LINE_BREAK_COMMAND, INSERT_PARAGRAPH_COMMAND, INSERT_TAB_COMMAND, INTERNAL_$isBlock, IS_ALL_FORMATTING, IS_BOLD, IS_CODE, IS_HIGHLIGHT, IS_ITALIC, IS_STRIKETHROUGH, IS_SUBSCRIPT, IS_SUPERSCRIPT, IS_UNDERLINE, KEY_ARROW_DOWN_COMMAND, KEY_ARROW_LEFT_COMMAND, KEY_ARROW_RIGHT_COMMAND, KEY_ARROW_UP_COMMAND, KEY_BACKSPACE_COMMAND, KEY_DELETE_COMMAND, KEY_DOWN_COMMAND, KEY_ENTER_COMMAND, KEY_ESCAPE_COMMAND, KEY_MODIFIER_COMMAND, KEY_SPACE_COMMAND, KEY_TAB_COMMAND, LineBreakNode, MOVE_TO_END, MOVE_TO_START, NODE_STATE_KEY, OUTDENT_CONTENT_COMMAND, PASTE_COMMAND, PASTE_TAG, ParagraphNode, REDO_COMMAND, REMOVE_TEXT_COMMAND, RootNode, SELECTION_CHANGE_COMMAND, SELECTION_INSERT_CLIPBOARD_NODES_COMMAND, SELECT_ALL_COMMAND, SKIP_COLLAB_TAG, SKIP_DOM_SELECTION_TAG, SKIP_SCROLL_INTO_VIEW_TAG, TEXT_TYPE_TO_FORMAT, TabNode, TextNode, UNDO_COMMAND, createCommand, createEditor, createState, flipDirection, getDOMOwnerDocument, getDOMSelection, getDOMSelectionFromTarget, getDOMTextNode, getEditorPropertyFromDOMNode, getNearestEditorFromDOMNode, isBlockDomNode, isCurrentlyReadOnlyMode, isDOMDocumentNode, isDOMNode, isDOMTextNode, isDOMUnmanaged, isDocumentFragment, isHTMLAnchorElement, isHTMLElement, isInlineDomNode, isLexicalEditor, isSelectionCapturedInDecoratorInput, isSelectionWithinEditor, makeStepwiseIterator, resetRandomKey, setDOMUnmanaged, setNodeIndentFromDOM };
13062
+ export { $addUpdateTag, $applyNodeReplacement, $caretFromPoint, $caretRangeFromSelection, $cloneWithProperties, $comparePointCaretNext, $copyNode, $createLineBreakNode, $createNodeSelection, $createParagraphNode, $createPoint, $createRangeSelection, $createRangeSelectionFromDom, $createTabNode, $createTextNode, $extendCaretToRange, $getAdjacentChildCaret, $getAdjacentNode, $getAdjacentSiblingOrParentSiblingCaret, $getCaretInDirection, $getCaretRange, $getCaretRangeInDirection, $getCharacterOffsets, $getChildCaret, $getChildCaretAtIndex, $getChildCaretOrSelf, $getCollapsedCaretRange, $getCommonAncestor, $getCommonAncestorResultBranchOrder, $getEditor, $getNearestNodeFromDOMNode, $getNearestRootOrShadowRoot, $getNodeByKey, $getNodeByKeyOrThrow, $getPreviousSelection, $getRoot, $getSelection, $getSiblingCaret, $getState, $getStateChange, $getTextContent, $getTextNodeOffset, $getTextPointCaret, $getTextPointCaretSlice, $getWritableNodeState, $hasAncestor, $hasUpdateTag, $insertNodes, $isBlockElementNode, $isChildCaret, $isDecoratorNode, $isElementNode, $isExtendableTextPointCaret, $isInlineElementOrDecoratorNode, $isLeafNode, $isLineBreakNode, $isNodeCaret, $isNodeSelection, $isParagraphNode, $isRangeSelection, $isRootNode, $isRootOrShadowRoot, $isSiblingCaret, $isTabNode, $isTextNode, $isTextPointCaret, $isTextPointCaretSlice, $isTokenOrSegmented, $nodesOfType, $normalizeCaret, $normalizeSelection as $normalizeSelection__EXPERIMENTAL, $onUpdate, $parseSerializedNode, $removeTextFromCaretRange, $rewindSiblingCaret, $selectAll, $setCompositionKey, $setPointFromCaret, $setSelection, $setSelectionFromCaretRange, $setState, $splitAtPointCaretNext, $splitNode, $updateRangeSelectionFromCaretRange, ArtificialNode__DO_NOT_USE, BLUR_COMMAND, CAN_REDO_COMMAND, CAN_UNDO_COMMAND, CLEAR_EDITOR_COMMAND, CLEAR_HISTORY_COMMAND, CLICK_COMMAND, COLLABORATION_TAG, COMMAND_PRIORITY_CRITICAL, COMMAND_PRIORITY_EDITOR, COMMAND_PRIORITY_HIGH, COMMAND_PRIORITY_LOW, COMMAND_PRIORITY_NORMAL, CONTROLLED_TEXT_INSERTION_COMMAND, COPY_COMMAND, CUT_COMMAND, DELETE_CHARACTER_COMMAND, DELETE_LINE_COMMAND, DELETE_WORD_COMMAND, DRAGEND_COMMAND, DRAGOVER_COMMAND, DRAGSTART_COMMAND, DROP_COMMAND, DecoratorNode, ElementNode, FOCUS_COMMAND, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, HISTORIC_TAG, HISTORY_MERGE_TAG, HISTORY_PUSH_TAG, INDENT_CONTENT_COMMAND, INSERT_LINE_BREAK_COMMAND, INSERT_PARAGRAPH_COMMAND, INSERT_TAB_COMMAND, INTERNAL_$isBlock, IS_ALL_FORMATTING, IS_BOLD, IS_CODE, IS_HIGHLIGHT, IS_ITALIC, IS_STRIKETHROUGH, IS_SUBSCRIPT, IS_SUPERSCRIPT, IS_UNDERLINE, KEY_ARROW_DOWN_COMMAND, KEY_ARROW_LEFT_COMMAND, KEY_ARROW_RIGHT_COMMAND, KEY_ARROW_UP_COMMAND, KEY_BACKSPACE_COMMAND, KEY_DELETE_COMMAND, KEY_DOWN_COMMAND, KEY_ENTER_COMMAND, KEY_ESCAPE_COMMAND, KEY_MODIFIER_COMMAND, KEY_SPACE_COMMAND, KEY_TAB_COMMAND, LineBreakNode, MOVE_TO_END, MOVE_TO_START, NODE_STATE_KEY, OUTDENT_CONTENT_COMMAND, PASTE_COMMAND, PASTE_TAG, ParagraphNode, REDO_COMMAND, REMOVE_TEXT_COMMAND, RootNode, SELECTION_CHANGE_COMMAND, SELECTION_INSERT_CLIPBOARD_NODES_COMMAND, SELECT_ALL_COMMAND, SKIP_COLLAB_TAG, SKIP_DOM_SELECTION_TAG, SKIP_SCROLL_INTO_VIEW_TAG, TEXT_TYPE_TO_FORMAT, TabNode, TextNode, UNDO_COMMAND, createCommand, createEditor, createState, flipDirection, getDOMOwnerDocument, getDOMSelection, getDOMSelectionFromTarget, getDOMTextNode, getEditorPropertyFromDOMNode, getNearestEditorFromDOMNode, isBlockDomNode, isCurrentlyReadOnlyMode, isDOMDocumentNode, isDOMNode, isDOMTextNode, isDOMUnmanaged, isDocumentFragment, isHTMLAnchorElement, isHTMLElement, isInlineDomNode, isLexicalEditor, isSelectionCapturedInDecoratorInput, isSelectionWithinEditor, makeStepwiseIterator, removeFromParent, resetRandomKey, setDOMUnmanaged, setNodeIndentFromDOM };
package/Lexical.mjs CHANGED
@@ -195,6 +195,7 @@ export const isLexicalEditor = mod.isLexicalEditor;
195
195
  export const isSelectionCapturedInDecoratorInput = mod.isSelectionCapturedInDecoratorInput;
196
196
  export const isSelectionWithinEditor = mod.isSelectionWithinEditor;
197
197
  export const makeStepwiseIterator = mod.makeStepwiseIterator;
198
+ export const removeFromParent = mod.removeFromParent;
198
199
  export const resetRandomKey = mod.resetRandomKey;
199
200
  export const setDOMUnmanaged = mod.setDOMUnmanaged;
200
201
  export const setNodeIndentFromDOM = mod.setNodeIndentFromDOM;
package/Lexical.node.mjs CHANGED
@@ -193,6 +193,7 @@ export const isLexicalEditor = mod.isLexicalEditor;
193
193
  export const isSelectionCapturedInDecoratorInput = mod.isSelectionCapturedInDecoratorInput;
194
194
  export const isSelectionWithinEditor = mod.isSelectionWithinEditor;
195
195
  export const makeStepwiseIterator = mod.makeStepwiseIterator;
196
+ export const removeFromParent = mod.removeFromParent;
196
197
  export const resetRandomKey = mod.resetRandomKey;
197
198
  export const setDOMUnmanaged = mod.setDOMUnmanaged;
198
199
  export const setNodeIndentFromDOM = mod.setNodeIndentFromDOM;