dist/bundle.js
// null if no position was found.
null if no position was found.
null if no position was found .
function insertPoint(doc, pos, nodeType) {
  var $pos = doc.resolve(pos);
  if ($pos.parent.canReplaceWith($pos.index(), $pos.index(), nodeType)) { return pos }
  if ($pos.parentOffset == 0)
    { for (var d = $pos.depth - 1; d >= 0; d--) {
      var index = $pos.index(d);
      if ($pos.node(d).canReplaceWith(index, index, nodeType)) { return $pos.before(d + 1) }
      if (index > 0) { return null }
    } }
  if ($pos.parentOffset == $pos.parent.content.size)
    { for (var d$1 = $pos.depth - 1; d$1 >= 0; d$1--) {
      var index$1 = $pos.indexAfter(d$1);
      if ($pos.node(d$1).canReplaceWith(index$1, index$1, nodeType)) { return $pos.after(d$1 + 1) }
      if (index$1 < $pos.node(d$1).childCount) { return null }
    } }
}
function insertPoint ( doc , pos , nodeType ) { var $pos = doc . resolve ( pos ) ; if ( $pos . parent . canReplaceWith ( $pos . index ( ) , $pos . index ( ) , nodeType ) ) { return pos } if ( $pos . parentOffset == 0 ) { for ( var d = $pos . depth - 1 ; d >= 0 ; d -- ) { var index = $pos . index ( d ) ; if ( $pos . node ( d ) . canReplaceWith ( index , index , nodeType ) ) { return $pos . before ( d + 1 ) } if ( index > 0 ) { return null } } } if ( $pos . parentOffset == $pos . parent . content . size ) { for ( var d$1 = $pos . depth - 1 ; d$1 >= 0 ; d$1 -- ) { var index$1 = $pos . indexAfter ( d$1 ) ; if ( $pos . node ( d$1 ) . canReplaceWith ( index$1 , index$1 , nodeType ) ) { return $pos . after ( d$1 + 1 ) } if ( index$1 < $pos . node ( d$1 ) . childCount ) { return null } } } }
null if no position was found.
null if no position was found .