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/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 1.23.7 (2022-02-25)
2
+
3
+ ### Bug fixes
4
+
5
+ Fix a crash when a view was being destroyed during input reading.
6
+
7
+ Fix a crash on Firefox when replacing text in some specific types of document structure.
8
+
1
9
  ## 1.23.6 (2022-01-13)
2
10
 
3
11
  ### Bug fixes
package/dist/index.es.js CHANGED
@@ -64,7 +64,8 @@ function scanFor(node, off, targetNode, targetOff, dir) {
64
64
  if (node == targetNode && off == targetOff) { return true }
65
65
  if (off == (dir < 0 ? 0 : nodeSize(node))) {
66
66
  var parent = node.parentNode;
67
- if (parent.nodeType != 1 || hasBlockDesc(node) || atomElements.test(node.nodeName) || node.contentEditable == "false")
67
+ if (!parent || parent.nodeType != 1 || hasBlockDesc(node) || atomElements.test(node.nodeName) ||
68
+ node.contentEditable == "false")
68
69
  { return false }
69
70
  off = domIndex(node) + (dir < 0 ? 0 : 1);
70
71
  node = parent;
@@ -3358,7 +3359,7 @@ DOMObserver.prototype.flush = function flush () {
3358
3359
  checkCSS(this.view);
3359
3360
  }
3360
3361
  this.handleDOMChange(from, to, typeOver, added);
3361
- if (this.view.docView.dirty) { this.view.updateState(this.view.state); }
3362
+ if (this.view.docView && this.view.docView.dirty) { this.view.updateState(this.view.state); }
3362
3363
  else if (!this.currentSelection.eq(sel)) { selectionToDOM(this.view); }
3363
3364
  this.currentSelection.set(sel);
3364
3365
  }
@@ -3909,7 +3910,7 @@ function endComposition(view, forceUpdate) {
3909
3910
  if (result.android && view.domObserver.flushingSoon >= 0) { return }
3910
3911
  view.domObserver.forceFlush();
3911
3912
  clearComposition(view);
3912
- if (forceUpdate || view.docView.dirty) {
3913
+ if (forceUpdate || view.docView && view.docView.dirty) {
3913
3914
  var sel = selectionFromDOM(view);
3914
3915
  if (sel && !sel.eq(view.state.selection)) { view.dispatch(view.state.tr.setSelection(sel)); }
3915
3916
  else { view.updateState(view.state); }
@@ -5451,7 +5452,10 @@ function checkStateComponent(plugin) {
5451
5452
  // The DOM serializer to use when putting content onto the
5452
5453
  // clipboard. If not given, the result of
5453
5454
  // [`DOMSerializer.fromSchema`](#model.DOMSerializer^fromSchema)
5454
- // will be used.
5455
+ // will be used. This object will only have its
5456
+ // [`serializeFragment`](#model.DOMSerializer.serializeFragment)
5457
+ // method called, and you may provide an alternative object type
5458
+ // implementing a compatible method.
5455
5459
  //
5456
5460
  // clipboardTextSerializer:: ?(Slice) → string
5457
5461
  // A function that will be called to get the text for the current