prosemirror-view
Advanced tools
Comparing version 1.18.4 to 1.18.5
@@ -0,1 +1,11 @@ | ||
## 1.18.5 (2021-05-17) | ||
### Bug fixes | ||
Work around a Firefox bug where backspace sometimes deletes the node after the cursor. | ||
Fix a bug that prevented `transformPasted` hooks from being called on content dragged within the editor. | ||
Fixes an issue where clicking near a node or other special selection on Chrome would in some cases do nothing. | ||
## 1.18.4 (2021-04-27) | ||
@@ -2,0 +12,0 @@ |
{ | ||
"name": "prosemirror-view", | ||
"version": "1.18.4", | ||
"version": "1.18.5", | ||
"description": "ProseMirror's view component", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -363,3 +363,3 @@ import {Selection, NodeSelection, TextSelection} from "prosemirror-state" | ||
(browser.chrome && !(this.view.state.selection instanceof TextSelection) && | ||
(pos.pos == this.view.state.selection.from || pos.pos == this.view.state.selection.to))) { | ||
Math.min(Math.abs(pos.pos - this.view.state.selection.from), Math.abs(pos.pos - view.state.selection.to)) <= 2)) { | ||
updateSelection(this.view, Selection.near(this.view.state.doc.resolve(pos.pos)), "pointer") | ||
@@ -610,5 +610,9 @@ event.preventDefault() | ||
if (!$mouse) return | ||
let slice = dragging && dragging.slice || | ||
parseFromClipboard(view, e.dataTransfer.getData(brokenClipboardAPI ? "Text" : "text/plain"), | ||
brokenClipboardAPI ? null : e.dataTransfer.getData("text/html"), false, $mouse) | ||
let slice = dragging && dragging.slice | ||
if (slice) { | ||
view.someProp("transformPasted", f => { slice = f(slice) }) | ||
} else { | ||
slice = parseFromClipboard(view, e.dataTransfer.getData(brokenClipboardAPI ? "Text" : "text/plain"), | ||
brokenClipboardAPI ? null : e.dataTransfer.getData("text/html"), false, $mouse) | ||
} | ||
let move = dragging && !e[dragCopyModifier] | ||
@@ -615,0 +619,0 @@ if (view.someProp("handleDrop", f => f(view, e, slice || Slice.empty, move))) { |
@@ -385,2 +385,8 @@ import {DOMSerializer, Fragment, Mark} from "prosemirror-model" | ||
} | ||
// Firefox can act strangely when the selection is in front of an | ||
// uneditable node. See #1163 and https://bugzilla.mozilla.org/show_bug.cgi?id=1709536 | ||
if (browser.gecko && domSel.focusNode && domSel.focusNode != headDOM.node && domSel.focusNode.nodeType == 1) { | ||
let after = domSel.focusNode.childNodes[domSel.focusOffset] | ||
if (after && after.contentEditable == "false") force = true | ||
} | ||
@@ -845,5 +851,5 @@ if (!(force || brKludge && browser.safari) && | ||
// A dummy desc used to tag trailing BR or span nodes created to work | ||
// A dummy desc used to tag trailing BR or IMG nodes created to work | ||
// around contentEditable terribleness. | ||
class BRHackViewDesc extends ViewDesc { | ||
class TrailingHackViewDesc extends ViewDesc { | ||
parseRule() { return {ignore: true} } | ||
@@ -1191,3 +1197,3 @@ matchesHack() { return this.dirty == NOT_DIRTY } | ||
let dom = document.createElement("br") | ||
this.top.children.splice(this.index++, 0, new BRHackViewDesc(this.top, nothing, dom, null)) | ||
this.top.children.splice(this.index++, 0, new TrailingHackViewDesc(this.top, nothing, dom, null)) | ||
this.changed = true | ||
@@ -1194,0 +1200,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
1522165
14170