lexical 0.28.1-nightly.20250319.0 → 0.28.1-nightly.20250321.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
@@ -2836,7 +2836,7 @@ function $removeNode(nodeToRemove, restoreSelection, preserveEmptyParent) {
2836
2836
  if (!preserveEmptyParent && !$isRootOrShadowRoot(parent) && !parent.canBeEmpty() && parent.isEmpty()) {
2837
2837
  $removeNode(parent, restoreSelection);
2838
2838
  }
2839
- if (restoreSelection && $isRootNode(parent) && parent.isEmpty()) {
2839
+ if (restoreSelection && selection && $isRootNode(parent) && parent.isEmpty()) {
2840
2840
  parent.selectEnd();
2841
2841
  }
2842
2842
  }
@@ -10169,7 +10169,11 @@ class LexicalEditor {
10169
10169
  }
10170
10170
 
10171
10171
  /**
10172
- * Focuses the editor
10172
+ * Focuses the editor by marking the existing selection as dirty, or by
10173
+ * creating a new selection at `defaultSelection` if one does not already
10174
+ * exist. If you want to force a specific selection, you should call
10175
+ * `root.selectStart()` or `root.selectEnd()` in an update.
10176
+ *
10173
10177
  * @param callbackFn - A function to run after the editor is focused.
10174
10178
  * @param options - A bag of options
10175
10179
  * @param options.defaultSelection - Where to move selection when the editor is
@@ -10255,7 +10259,7 @@ class LexicalEditor {
10255
10259
  };
10256
10260
  }
10257
10261
  }
10258
- LexicalEditor.version = "0.28.1-nightly.20250319.0+dev.cjs";
10262
+ LexicalEditor.version = "0.28.1-nightly.20250321.0+dev.cjs";
10259
10263
 
10260
10264
  let keyCounter = 1;
10261
10265
  function resetRandomKey() {
package/Lexical.dev.mjs CHANGED
@@ -2834,7 +2834,7 @@ function $removeNode(nodeToRemove, restoreSelection, preserveEmptyParent) {
2834
2834
  if (!preserveEmptyParent && !$isRootOrShadowRoot(parent) && !parent.canBeEmpty() && parent.isEmpty()) {
2835
2835
  $removeNode(parent, restoreSelection);
2836
2836
  }
2837
- if (restoreSelection && $isRootNode(parent) && parent.isEmpty()) {
2837
+ if (restoreSelection && selection && $isRootNode(parent) && parent.isEmpty()) {
2838
2838
  parent.selectEnd();
2839
2839
  }
2840
2840
  }
@@ -10167,7 +10167,11 @@ class LexicalEditor {
10167
10167
  }
10168
10168
 
10169
10169
  /**
10170
- * Focuses the editor
10170
+ * Focuses the editor by marking the existing selection as dirty, or by
10171
+ * creating a new selection at `defaultSelection` if one does not already
10172
+ * exist. If you want to force a specific selection, you should call
10173
+ * `root.selectStart()` or `root.selectEnd()` in an update.
10174
+ *
10171
10175
  * @param callbackFn - A function to run after the editor is focused.
10172
10176
  * @param options - A bag of options
10173
10177
  * @param options.defaultSelection - Where to move selection when the editor is
@@ -10253,7 +10257,7 @@ class LexicalEditor {
10253
10257
  };
10254
10258
  }
10255
10259
  }
10256
- LexicalEditor.version = "0.28.1-nightly.20250319.0+dev.esm";
10260
+ LexicalEditor.version = "0.28.1-nightly.20250321.0+dev.esm";
10257
10261
 
10258
10262
  let keyCounter = 1;
10259
10263
  function resetRandomKey() {