prosemirror-view
Advanced tools
Comparing version 1.32.0 to 1.32.1
{ | ||
"name": "prosemirror-view", | ||
"version": "1.32.0", | ||
"version": "1.32.1", | ||
"description": "ProseMirror's view component", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -22,3 +22,8 @@ import {Selection, NodeSelection, TextSelection, AllSelection, EditorState} from "prosemirror-state" | ||
if (sel instanceof TextSelection) { | ||
if (!sel.empty || mods.indexOf("s") > -1) { | ||
if (mods.indexOf("s") > -1) { | ||
let {$head} = sel, node = $head.textOffset ? null : dir < 0 ? $head.nodeBefore : $head.nodeAfter | ||
if (!node || node.isText || !node.isLeaf) return false | ||
let $newHead = view.state.doc.resolve($head.pos + node.nodeSize * (dir < 0 ? -1 : 1)) | ||
return apply(view, new TextSelection(sel.$anchor, $newHead)) | ||
} else if (!sel.empty) { | ||
return false | ||
@@ -59,3 +64,2 @@ } else if (view.endOfTextblock(dir > 0 ? "forward" : "backward")) { | ||
function isIgnorable(dom: Node, dir: number) { | ||
if ((dom as HTMLElement).contentEditable == "false") return true | ||
let desc = dom.pmViewDesc | ||
@@ -62,0 +66,0 @@ return desc && desc.size == 0 && (dir < 0 || dom.nextSibling || dom.nodeName != "BR") |
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
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
840633
17083