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.
package/dist/rooster.d.ts CHANGED
@@ -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
 
package/dist/rooster.js CHANGED
@@ -10617,6 +10617,9 @@ function getBlockElementAtNode(rootNode, node) {
10617
10617
  // Both are actually completely and exclusively wrapped in a parent div, and can be represented with a Node block
10618
10618
  // So we shall try to collapse as much as we can to the nearest common ancestor
10619
10619
  var nodes = (0, collapseNodes_1.default)(rootNode, headNode, tailNode, false /*canSplitParent*/);
10620
+ if (nodes.length === 0) {
10621
+ return null;
10622
+ }
10620
10623
  headNode = nodes[0];
10621
10624
  tailNode = nodes[nodes.length - 1];
10622
10625
  if (headNode.parentNode != tailNode.parentNode) {
@@ -21879,7 +21882,10 @@ function getBlockTraverser(editor, element) {
21879
21882
  return undefined;
21880
21883
  }
21881
21884
  var blockElement = (_a = editor.getBlockElementAtNode(element)) === null || _a === void 0 ? void 0 : _a.getStartNode();
21882
- return blockElement ? roosterjs_editor_dom_1.ContentTraverser.createBodyTraverser(blockElement, element) : undefined;
21885
+ if (!blockElement || !(0, roosterjs_editor_dom_2.isBlockElement)(blockElement)) {
21886
+ return undefined;
21887
+ }
21888
+ return roosterjs_editor_dom_1.ContentTraverser.createBodyTraverser(blockElement, element);
21883
21889
  }
21884
21890
  function cacheDelimiter(event, checkBefore, delimiter) {
21885
21891
  return (0, roosterjs_editor_dom_2.cacheGetEventData)(event, 'delimiter_cache_key_' + checkBefore, function () { return delimiter; });