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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prosemirror-view",
3
- "version": "1.23.6",
3
+ "version": "1.23.7",
4
4
  "description": "ProseMirror's view component",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
package/src/dom.js CHANGED
@@ -39,7 +39,8 @@ function scanFor(node, off, targetNode, targetOff, dir) {
39
39
  if (node == targetNode && off == targetOff) return true
40
40
  if (off == (dir < 0 ? 0 : nodeSize(node))) {
41
41
  let parent = node.parentNode
42
- if (parent.nodeType != 1 || hasBlockDesc(node) || atomElements.test(node.nodeName) || node.contentEditable == "false")
42
+ if (!parent || parent.nodeType != 1 || hasBlockDesc(node) || atomElements.test(node.nodeName) ||
43
+ node.contentEditable == "false")
43
44
  return false
44
45
  off = domIndex(node) + (dir < 0 ? 0 : 1)
45
46
  node = parent
@@ -174,7 +174,7 @@ export class DOMObserver {
174
174
  checkCSS(this.view)
175
175
  }
176
176
  this.handleDOMChange(from, to, typeOver, added)
177
- if (this.view.docView.dirty) this.view.updateState(this.view.state)
177
+ if (this.view.docView && this.view.docView.dirty) this.view.updateState(this.view.state)
178
178
  else if (!this.currentSelection.eq(sel)) selectionToDOM(this.view)
179
179
  this.currentSelection.set(sel)
180
180
  }
package/src/index.js CHANGED
@@ -602,7 +602,10 @@ function checkStateComponent(plugin) {
602
602
  // The DOM serializer to use when putting content onto the
603
603
  // clipboard. If not given, the result of
604
604
  // [`DOMSerializer.fromSchema`](#model.DOMSerializer^fromSchema)
605
- // will be used.
605
+ // will be used. This object will only have its
606
+ // [`serializeFragment`](#model.DOMSerializer.serializeFragment)
607
+ // method called, and you may provide an alternative object type
608
+ // implementing a compatible method.
606
609
  //
607
610
  // clipboardTextSerializer:: ?(Slice) → string
608
611
  // A function that will be called to get the text for the current
package/src/input.js CHANGED
@@ -485,7 +485,7 @@ export function endComposition(view, forceUpdate) {
485
485
  if (browser.android && view.domObserver.flushingSoon >= 0) return
486
486
  view.domObserver.forceFlush()
487
487
  clearComposition(view)
488
- if (forceUpdate || view.docView.dirty) {
488
+ if (forceUpdate || view.docView && view.docView.dirty) {
489
489
  let sel = selectionFromDOM(view)
490
490
  if (sel && !sel.eq(view.state.selection)) view.dispatch(view.state.tr.setSelection(sel))
491
491
  else view.updateState(view.state)