lexical 0.27.1-nightly.20250304.0 → 0.27.1

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
@@ -3216,7 +3216,9 @@ class LexicalNode {
3216
3216
  * @param node - the other node to find the common ancestor of.
3217
3217
  */
3218
3218
  getCommonAncestor(node) {
3219
- const result = $getCommonAncestor(this, node);
3219
+ const a = $isElementNode(this) ? this : this.getParent();
3220
+ const b = $isElementNode(node) ? node : node.getParent();
3221
+ const result = a && b ? $getCommonAncestor(a, b) : null;
3220
3222
  return result ? result.commonAncestor /* TODO this type cast is a lie, but fixing it would break backwards compatibility */ : null;
3221
3223
  }
3222
3224
 
@@ -10221,7 +10223,7 @@ class LexicalEditor {
10221
10223
  };
10222
10224
  }
10223
10225
  }
10224
- LexicalEditor.version = "0.27.1-nightly.20250304.0+dev.cjs";
10226
+ LexicalEditor.version = "0.27.1+dev.cjs";
10225
10227
 
10226
10228
  let keyCounter = 1;
10227
10229
  function resetRandomKey() {
package/Lexical.dev.mjs CHANGED
@@ -3214,7 +3214,9 @@ class LexicalNode {
3214
3214
  * @param node - the other node to find the common ancestor of.
3215
3215
  */
3216
3216
  getCommonAncestor(node) {
3217
- const result = $getCommonAncestor(this, node);
3217
+ const a = $isElementNode(this) ? this : this.getParent();
3218
+ const b = $isElementNode(node) ? node : node.getParent();
3219
+ const result = a && b ? $getCommonAncestor(a, b) : null;
3218
3220
  return result ? result.commonAncestor /* TODO this type cast is a lie, but fixing it would break backwards compatibility */ : null;
3219
3221
  }
3220
3222
 
@@ -10219,7 +10221,7 @@ class LexicalEditor {
10219
10221
  };
10220
10222
  }
10221
10223
  }
10222
- LexicalEditor.version = "0.27.1-nightly.20250304.0+dev.esm";
10224
+ LexicalEditor.version = "0.27.1+dev.esm";
10223
10225
 
10224
10226
  let keyCounter = 1;
10225
10227
  function resetRandomKey() {