prosemirror-view
Advanced tools
Comparing version 1.0.11 to 1.1.0
{ | ||
"name": "prosemirror-view", | ||
"version": "1.0.11", | ||
"version": "1.1.0", | ||
"description": "ProseMirror's view component", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -401,3 +401,3 @@ import {Selection, NodeSelection, TextSelection} from "prosemirror-state" | ||
} | ||
if (cut) view.dispatch(view.state.tr.deleteSelection().scrollIntoView()) | ||
if (cut) view.dispatch(view.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut")) | ||
} | ||
@@ -432,3 +432,3 @@ | ||
let tr = singleNode ? view.state.tr.replaceSelectionWith(singleNode, view.shiftKey) : view.state.tr.replaceSelection(slice) | ||
view.dispatch(tr.scrollIntoView().setMeta("paste", true)) | ||
view.dispatch(tr.scrollIntoView().setMeta("paste", true).setMeat("uiEvent", "paste")) | ||
return true | ||
@@ -474,3 +474,3 @@ } | ||
let pos = sel.empty ? null : view.posAtCoords(eventCoords(e)) | ||
if (pos && pos.pos >= sel.from && pos.pos <= sel.to) { | ||
if (pos && pos.pos >= sel.from && pos.pos <= (sel instanceof NodeSelection ? sel.to - 1: sel.to)) { | ||
// In selection | ||
@@ -521,2 +521,3 @@ } else if (mouseDown && mouseDown.mightDrag) { | ||
let isNode = slice.openStart == 0 && slice.openEnd == 0 && slice.content.childCount == 1 | ||
let beforeInsert = tr.doc | ||
if (isNode) | ||
@@ -526,2 +527,4 @@ tr.replaceRangeWith(pos, pos, slice.content.firstChild) | ||
tr.replaceRange(pos, pos, slice) | ||
if (tr.doc.eq(beforeInsert)) return | ||
let $pos = tr.doc.resolve(pos) | ||
@@ -534,3 +537,3 @@ if (isNode && NodeSelection.isSelectable(slice.content.firstChild) && | ||
view.focus() | ||
view.dispatch(tr) | ||
view.dispatch(tr.setMeta("uiEvent", "drop")) | ||
} | ||
@@ -537,0 +540,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
683910
8102