prosemirror-view
Advanced tools
Comparing version 1.18.0 to 1.18.1
@@ -0,1 +1,9 @@ | ||
## 1.18.1 (2021-03-15) | ||
### Bug fixes | ||
Fix the scrolling-into-view logic in the case where a scale transformation is applied to the editor. Strip carriage return chars from text pasted as code | ||
Remove carriage return characters when pasting text into code blocks. | ||
## 1.18.0 (2021-03-04) | ||
@@ -2,0 +10,0 @@ |
{ | ||
"name": "prosemirror-view", | ||
"version": "1.18.0", | ||
"version": "1.18.1", | ||
"description": "ProseMirror's view component", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -44,3 +44,3 @@ import {Slice, Fragment, DOMParser, DOMSerializer} from "prosemirror-model" | ||
view.someProp("transformPastedText", f => { text = f(text, inCode || plainText) }) | ||
if (inCode) return new Slice(Fragment.from(view.state.schema.text(text)), 0, 0) | ||
if (inCode) return new Slice(Fragment.from(view.state.schema.text(text.replace(/\r\n?/g, "\n"))), 0, 0) | ||
let parsed = view.someProp("clipboardTextParser", f => f(text, $context, plainText)) | ||
@@ -47,0 +47,0 @@ if (parsed) { |
@@ -15,5 +15,8 @@ import {nodeSize, textRange, parentNode} from "./dom" | ||
let rect = node.getBoundingClientRect() | ||
// Adjust for elements with style "transform: scale()" | ||
let scaleX = (rect.width / node.offsetWidth) || 1 | ||
let scaleY = (rect.height / node.offsetHeight) || 1 | ||
// Make sure scrollbar width isn't included in the rectangle | ||
return {left: rect.left, right: rect.left + node.clientWidth, | ||
top: rect.top, bottom: rect.top + node.clientHeight} | ||
return {left: rect.left, right: rect.left + node.clientWidth * scaleX, | ||
top: rect.top, bottom: rect.top + node.clientHeight * scaleY} | ||
} | ||
@@ -20,0 +23,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
1513233
14110