lexical 0.29.1-nightly.20250331.0 → 0.29.1-nightly.20250402.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
@@ -2590,7 +2590,7 @@ function onKeyDown(event, editor) {
2590
2590
  } else if (isDeleteLineBackward(key, metaKey)) {
2591
2591
  event.preventDefault();
2592
2592
  dispatchCommand(editor, DELETE_LINE_COMMAND, true);
2593
- } else if (isDeleteLineForward(key, metaKey)) {
2593
+ } else if (isDeleteLineForward(key, metaKey, ctrlKey)) {
2594
2594
  event.preventDefault();
2595
2595
  dispatchCommand(editor, DELETE_LINE_COMMAND, false);
2596
2596
  } else if (isBold(key, altKey, metaKey, ctrlKey)) {
@@ -10291,7 +10291,7 @@ class LexicalEditor {
10291
10291
  };
10292
10292
  }
10293
10293
  }
10294
- LexicalEditor.version = "0.29.1-nightly.20250331.0+dev.cjs";
10294
+ LexicalEditor.version = "0.29.1-nightly.20250402.0+dev.cjs";
10295
10295
 
10296
10296
  let keyCounter = 1;
10297
10297
  function resetRandomKey() {
@@ -10890,8 +10890,8 @@ function isDeleteWordForward(key, altKey, ctrlKey) {
10890
10890
  function isDeleteLineBackward(key, metaKey) {
10891
10891
  return IS_APPLE && metaKey && isBackspace(key);
10892
10892
  }
10893
- function isDeleteLineForward(key, metaKey) {
10894
- return IS_APPLE && metaKey && isDelete(key);
10893
+ function isDeleteLineForward(key, metaKey, ctrlKey) {
10894
+ return IS_APPLE && (metaKey && isDelete(key) || ctrlKey && key.toLowerCase() === 'k');
10895
10895
  }
10896
10896
  function isDeleteBackward(key, altKey, metaKey, ctrlKey) {
10897
10897
  if (IS_APPLE) {
@@ -11633,7 +11633,7 @@ function $cloneWithProperties(latestNode) {
11633
11633
  }
11634
11634
  function setNodeIndentFromDOM(elementDom, elementNode) {
11635
11635
  const indentSize = parseInt(elementDom.style.paddingInlineStart, 10) || 0;
11636
- const indent = indentSize / 40;
11636
+ const indent = Math.round(indentSize / 40);
11637
11637
  elementNode.setIndent(indent);
11638
11638
  }
11639
11639
 
@@ -12091,7 +12091,7 @@ function $getTextPointCaret(origin, direction, offset) {
12091
12091
 
12092
12092
  /**
12093
12093
  * Get a normalized offset into a TextNode given a numeric offset or a
12094
- * direction for which end of the string to use. Throws if the offset
12094
+ * direction for which end of the string to use. Throws in dev if the offset
12095
12095
  * is not in the bounds of the text content size.
12096
12096
  *
12097
12097
  * @param origin a TextNode
@@ -12100,9 +12100,12 @@ function $getTextPointCaret(origin, direction, offset) {
12100
12100
  */
12101
12101
  function $getTextNodeOffset(origin, offset) {
12102
12102
  const size = origin.getTextContentSize();
12103
- const numericOffset = offset === 'next' ? size : offset === 'previous' ? 0 : offset;
12104
- if (!(numericOffset >= 0 && numericOffset <= size)) {
12105
- formatDevErrorMessage(`$getTextNodeOffset: invalid offset ${String(offset)} for size ${String(size)}`);
12103
+ let numericOffset = offset === 'next' ? size : offset === 'previous' ? 0 : offset;
12104
+ if (numericOffset < 0 || numericOffset > size) {
12105
+ {
12106
+ formatDevErrorMessage(`$getTextNodeOffset: invalid offset ${String(offset)} for size ${String(size)} at key ${origin.getKey()}`);
12107
+ } // Clamp invalid offsets in prod
12108
+ numericOffset = numericOffset < 0 ? 0 : size;
12106
12109
  }
12107
12110
  return numericOffset;
12108
12111
  }
package/Lexical.dev.mjs CHANGED
@@ -2588,7 +2588,7 @@ function onKeyDown(event, editor) {
2588
2588
  } else if (isDeleteLineBackward(key, metaKey)) {
2589
2589
  event.preventDefault();
2590
2590
  dispatchCommand(editor, DELETE_LINE_COMMAND, true);
2591
- } else if (isDeleteLineForward(key, metaKey)) {
2591
+ } else if (isDeleteLineForward(key, metaKey, ctrlKey)) {
2592
2592
  event.preventDefault();
2593
2593
  dispatchCommand(editor, DELETE_LINE_COMMAND, false);
2594
2594
  } else if (isBold(key, altKey, metaKey, ctrlKey)) {
@@ -10289,7 +10289,7 @@ class LexicalEditor {
10289
10289
  };
10290
10290
  }
10291
10291
  }
10292
- LexicalEditor.version = "0.29.1-nightly.20250331.0+dev.esm";
10292
+ LexicalEditor.version = "0.29.1-nightly.20250402.0+dev.esm";
10293
10293
 
10294
10294
  let keyCounter = 1;
10295
10295
  function resetRandomKey() {
@@ -10888,8 +10888,8 @@ function isDeleteWordForward(key, altKey, ctrlKey) {
10888
10888
  function isDeleteLineBackward(key, metaKey) {
10889
10889
  return IS_APPLE && metaKey && isBackspace(key);
10890
10890
  }
10891
- function isDeleteLineForward(key, metaKey) {
10892
- return IS_APPLE && metaKey && isDelete(key);
10891
+ function isDeleteLineForward(key, metaKey, ctrlKey) {
10892
+ return IS_APPLE && (metaKey && isDelete(key) || ctrlKey && key.toLowerCase() === 'k');
10893
10893
  }
10894
10894
  function isDeleteBackward(key, altKey, metaKey, ctrlKey) {
10895
10895
  if (IS_APPLE) {
@@ -11631,7 +11631,7 @@ function $cloneWithProperties(latestNode) {
11631
11631
  }
11632
11632
  function setNodeIndentFromDOM(elementDom, elementNode) {
11633
11633
  const indentSize = parseInt(elementDom.style.paddingInlineStart, 10) || 0;
11634
- const indent = indentSize / 40;
11634
+ const indent = Math.round(indentSize / 40);
11635
11635
  elementNode.setIndent(indent);
11636
11636
  }
11637
11637
 
@@ -12089,7 +12089,7 @@ function $getTextPointCaret(origin, direction, offset) {
12089
12089
 
12090
12090
  /**
12091
12091
  * Get a normalized offset into a TextNode given a numeric offset or a
12092
- * direction for which end of the string to use. Throws if the offset
12092
+ * direction for which end of the string to use. Throws in dev if the offset
12093
12093
  * is not in the bounds of the text content size.
12094
12094
  *
12095
12095
  * @param origin a TextNode
@@ -12098,9 +12098,12 @@ function $getTextPointCaret(origin, direction, offset) {
12098
12098
  */
12099
12099
  function $getTextNodeOffset(origin, offset) {
12100
12100
  const size = origin.getTextContentSize();
12101
- const numericOffset = offset === 'next' ? size : offset === 'previous' ? 0 : offset;
12102
- if (!(numericOffset >= 0 && numericOffset <= size)) {
12103
- formatDevErrorMessage(`$getTextNodeOffset: invalid offset ${String(offset)} for size ${String(size)}`);
12101
+ let numericOffset = offset === 'next' ? size : offset === 'previous' ? 0 : offset;
12102
+ if (numericOffset < 0 || numericOffset > size) {
12103
+ {
12104
+ formatDevErrorMessage(`$getTextNodeOffset: invalid offset ${String(offset)} for size ${String(size)} at key ${origin.getKey()}`);
12105
+ } // Clamp invalid offsets in prod
12106
+ numericOffset = numericOffset < 0 ? 0 : size;
12104
12107
  }
12105
12108
  return numericOffset;
12106
12109
  }