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/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 1.23.6 (2022-01-13)
2
+
3
+ ### Bug fixes
4
+
5
+ Fix an issue that could cause pieces of DOM to not be synchronized with the document after some kind of changes around marks.
6
+
7
+ Fix a bug where marks rendered with nested elements would in some situations suppress new input.
8
+
9
+ Disable Chrome-specific drag-selection workaround in non-Chrome browsers because it affected table cell selection in Safari.
10
+
1
11
  ## 1.23.5 (2021-12-27)
2
12
 
3
13
  ### Bug fixes
package/dist/index.es.js CHANGED
@@ -1051,7 +1051,8 @@ ViewDesc.prototype.markDirty = function markDirty (from, to) {
1051
1051
  else { child.markDirty(from - startInside, to - startInside); }
1052
1052
  return
1053
1053
  } else {
1054
- child.dirty = child.dom == child.contentDOM && child.dom.parentNode == this.contentDOM ? CONTENT_DIRTY : NODE_DIRTY;
1054
+ child.dirty = child.dom == child.contentDOM && child.dom.parentNode == this.contentDOM && !child.children.length
1055
+ ? CONTENT_DIRTY : NODE_DIRTY;
1055
1056
  }
1056
1057
  }
1057
1058
  offset = end;
@@ -1189,7 +1190,10 @@ var MarkViewDesc = /*@__PURE__*/(function (ViewDesc) {
1189
1190
  return new MarkViewDesc(parent, mark, spec.dom, spec.contentDOM || spec.dom)
1190
1191
  };
1191
1192
 
1192
- MarkViewDesc.prototype.parseRule = function parseRule () { return {mark: this.mark.type.name, attrs: this.mark.attrs, contentElement: this.contentDOM} };
1193
+ MarkViewDesc.prototype.parseRule = function parseRule () {
1194
+ if ((this.dirty & NODE_DIRTY) || this.mark.type.spec.reparseInView) { return null }
1195
+ return {mark: this.mark.type.name, attrs: this.mark.attrs, contentElement: this.contentDOM}
1196
+ };
1193
1197
 
1194
1198
  MarkViewDesc.prototype.matchesMark = function matchesMark (mark) { return this.dirty != NODE_DIRTY && this.mark.eq(mark) };
1195
1199
 
@@ -2148,7 +2152,10 @@ function selectionToDOM(view, force) {
2148
2152
 
2149
2153
  if (!editorOwnsSelection(view)) { return }
2150
2154
 
2151
- if (!force && view.mouseDown && view.mouseDown.allowDefault) {
2155
+ // The delayed drag selection causes issues with Cell Selections
2156
+ // in Safari. And the drag selection delay is to workarond issues
2157
+ // which only present in Chrome.
2158
+ if (!force && view.mouseDown && view.mouseDown.allowDefault && result.chrome) {
2152
2159
  var domSel = view.root.getSelection(), curSel = view.domObserver.currentSelection;
2153
2160
  if (domSel.anchorNode && isEquivalentPosition(domSel.anchorNode, domSel.anchorOffset,
2154
2161
  curSel.anchorNode, curSel.anchorOffset)) {