prosemirror-transform
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -0,1 +1,9 @@ | ||
## 1.3.1 (2021-04-01) | ||
### Bug fixes | ||
Fix a crash in `Transform.replaceRange` when called with under specific circumstances. | ||
Fix an issue where `dropPoint` could return an invalid drop point. | ||
## 1.3.0 (2021-03-31) | ||
@@ -2,0 +10,0 @@ |
{ | ||
"name": "prosemirror-transform", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "ProseMirror document transformations", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -420,3 +420,3 @@ import {Fragment, Slice} from "prosemirror-model" | ||
let depth = targetDepths[i] | ||
if (i < 0) continue | ||
if (depth < 0) continue | ||
from = $from.before(depth); to = $to.after(depth) | ||
@@ -423,0 +423,0 @@ } |
@@ -279,5 +279,10 @@ import {Slice, Fragment} from "prosemirror-model" | ||
let insertPos = $pos.index(d) + (bias > 0 ? 1 : 0) | ||
if (pass == 1 | ||
? $pos.node(d).canReplace(insertPos, insertPos, content) | ||
: $pos.node(d).contentMatchAt(insertPos).findWrapping(content.firstChild.type)) | ||
let parent = $pos.node(d), fits = false | ||
if (pass == 1) { | ||
fits = parent.canReplace(insertPos, insertPos, content) | ||
} else { | ||
let wrapping = parent.contentMatchAt(insertPos).findWrapping(content.firstChild.type) | ||
fits = wrapping && parent.canReplaceWith(insertPos, insertPos, wrapping[0].type) | ||
} | ||
if (fits) | ||
return bias == 0 ? $pos.pos : bias < 0 ? $pos.before(d + 1) : $pos.after(d + 1) | ||
@@ -284,0 +289,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
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
493958
4484