prosemirror-view 1.23.5 → 1.23.6

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.5",
3
+ "version": "1.23.6",
4
4
  "description": "ProseMirror's view component",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
package/src/selection.js CHANGED
@@ -42,7 +42,10 @@ export function selectionToDOM(view, force) {
42
42
 
43
43
  if (!editorOwnsSelection(view)) return
44
44
 
45
- if (!force && view.mouseDown && view.mouseDown.allowDefault) {
45
+ // The delayed drag selection causes issues with Cell Selections
46
+ // in Safari. And the drag selection delay is to workarond issues
47
+ // which only present in Chrome.
48
+ if (!force && view.mouseDown && view.mouseDown.allowDefault && browser.chrome) {
46
49
  let domSel = view.root.getSelection(), curSel = view.domObserver.currentSelection
47
50
  if (domSel.anchorNode && isEquivalentPosition(domSel.anchorNode, domSel.anchorOffset,
48
51
  curSel.anchorNode, curSel.anchorOffset)) {
package/src/viewdesc.js CHANGED
@@ -462,7 +462,8 @@ class ViewDesc {
462
462
  else child.markDirty(from - startInside, to - startInside)
463
463
  return
464
464
  } else {
465
- child.dirty = child.dom == child.contentDOM && child.dom.parentNode == this.contentDOM ? CONTENT_DIRTY : NODE_DIRTY
465
+ child.dirty = child.dom == child.contentDOM && child.dom.parentNode == this.contentDOM && !child.children.length
466
+ ? CONTENT_DIRTY : NODE_DIRTY
466
467
  }
467
468
  }
468
469
  offset = end
@@ -577,7 +578,10 @@ class MarkViewDesc extends ViewDesc {
577
578
  return new MarkViewDesc(parent, mark, spec.dom, spec.contentDOM || spec.dom)
578
579
  }
579
580
 
580
- parseRule() { return {mark: this.mark.type.name, attrs: this.mark.attrs, contentElement: this.contentDOM} }
581
+ parseRule() {
582
+ if ((this.dirty & NODE_DIRTY) || this.mark.type.spec.reparseInView) return null
583
+ return {mark: this.mark.type.name, attrs: this.mark.attrs, contentElement: this.contentDOM}
584
+ }
581
585
 
582
586
  matchesMark(mark) { return this.dirty != NODE_DIRTY && this.mark.eq(mark) }
583
587