prosemirror-view 1.23.6 → 1.23.7

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/index.js CHANGED
@@ -68,7 +68,8 @@ function scanFor(node, off, targetNode, targetOff, dir) {
68
68
  if (node == targetNode && off == targetOff) { return true }
69
69
  if (off == (dir < 0 ? 0 : nodeSize(node))) {
70
70
  var parent = node.parentNode;
71
- if (parent.nodeType != 1 || hasBlockDesc(node) || atomElements.test(node.nodeName) || node.contentEditable == "false")
71
+ if (!parent || parent.nodeType != 1 || hasBlockDesc(node) || atomElements.test(node.nodeName) ||
72
+ node.contentEditable == "false")
72
73
  { return false }
73
74
  off = domIndex(node) + (dir < 0 ? 0 : 1);
74
75
  node = parent;
@@ -3362,7 +3363,7 @@ DOMObserver.prototype.flush = function flush () {
3362
3363
  checkCSS(this.view);
3363
3364
  }
3364
3365
  this.handleDOMChange(from, to, typeOver, added);
3365
- if (this.view.docView.dirty) { this.view.updateState(this.view.state); }
3366
+ if (this.view.docView && this.view.docView.dirty) { this.view.updateState(this.view.state); }
3366
3367
  else if (!this.currentSelection.eq(sel)) { selectionToDOM(this.view); }
3367
3368
  this.currentSelection.set(sel);
3368
3369
  }
@@ -3913,7 +3914,7 @@ function endComposition(view, forceUpdate) {
3913
3914
  if (result.android && view.domObserver.flushingSoon >= 0) { return }
3914
3915
  view.domObserver.forceFlush();
3915
3916
  clearComposition(view);
3916
- if (forceUpdate || view.docView.dirty) {
3917
+ if (forceUpdate || view.docView && view.docView.dirty) {
3917
3918
  var sel = selectionFromDOM(view);
3918
3919
  if (sel && !sel.eq(view.state.selection)) { view.dispatch(view.state.tr.setSelection(sel)); }
3919
3920
  else { view.updateState(view.state); }
@@ -5455,7 +5456,10 @@ function checkStateComponent(plugin) {
5455
5456
  // The DOM serializer to use when putting content onto the
5456
5457
  // clipboard. If not given, the result of
5457
5458
  // [`DOMSerializer.fromSchema`](#model.DOMSerializer^fromSchema)
5458
- // will be used.
5459
+ // will be used. This object will only have its
5460
+ // [`serializeFragment`](#model.DOMSerializer.serializeFragment)
5461
+ // method called, and you may provide an alternative object type
5462
+ // implementing a compatible method.
5459
5463
  //
5460
5464
  // clipboardTextSerializer:: ?(Slice) → string
5461
5465
  // A function that will be called to get the text for the current