roosterjs 8.45.0 → 8.45.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.
@@ -1,4 +1,4 @@
1
- // Type definitions for roosterjs (Version 8.45.0)
1
+ // Type definitions for roosterjs (Version 8.45.1)
2
2
  // Generated by dts tool from roosterjs
3
3
  // Project: https://github.com/Microsoft/roosterjs
4
4
 
@@ -10616,6 +10616,9 @@ function getBlockElementAtNode(rootNode, node) {
10616
10616
  // Both are actually completely and exclusively wrapped in a parent div, and can be represented with a Node block
10617
10617
  // So we shall try to collapse as much as we can to the nearest common ancestor
10618
10618
  var nodes = (0, collapseNodes_1.default)(rootNode, headNode, tailNode, false /*canSplitParent*/);
10619
+ if (nodes.length === 0) {
10620
+ return null;
10621
+ }
10619
10622
  headNode = nodes[0];
10620
10623
  tailNode = nodes[nodes.length - 1];
10621
10624
  if (headNode.parentNode != tailNode.parentNode) {
@@ -21878,7 +21881,10 @@ function getBlockTraverser(editor, element) {
21878
21881
  return undefined;
21879
21882
  }
21880
21883
  var blockElement = (_a = editor.getBlockElementAtNode(element)) === null || _a === void 0 ? void 0 : _a.getStartNode();
21881
- return blockElement ? roosterjs_editor_dom_1.ContentTraverser.createBodyTraverser(blockElement, element) : undefined;
21884
+ if (!blockElement || !(0, roosterjs_editor_dom_2.isBlockElement)(blockElement)) {
21885
+ return undefined;
21886
+ }
21887
+ return roosterjs_editor_dom_1.ContentTraverser.createBodyTraverser(blockElement, element);
21882
21888
  }
21883
21889
  function cacheDelimiter(event, checkBefore, delimiter) {
21884
21890
  return (0, roosterjs_editor_dom_2.cacheGetEventData)(event, 'delimiter_cache_key_' + checkBefore, function () { return delimiter; });