slate-react
Advanced tools
Comparing version 0.10.4 to 0.10.5
@@ -511,3 +511,6 @@ 'use strict'; | ||
var node = document.getDescendant(point.key); | ||
var block = document.getClosestBlock(node.key); | ||
var leaves = node.getLeaves(); | ||
var lastText = block.getLastText(); | ||
var lastLeaf = leaves.last(); | ||
var start = 0; | ||
@@ -517,6 +520,6 @@ var end = 0; | ||
var leaf = leaves.find(function (r) { | ||
start = end; | ||
end += r.text.length; | ||
if (end >= point.offset) return true; | ||
start = end; | ||
}); | ||
}) || lastLeaf; | ||
@@ -527,8 +530,5 @@ // Get the text information. | ||
var block = document.getClosestBlock(node.key); | ||
var lastText = block.getLastText(); | ||
var lastLeaf = leaves.last(); | ||
var lastChar = textContent.charAt(textContent.length - 1); | ||
var isLastText = node == lastText; | ||
var isLastLeaf = leaf == lastLeaf; | ||
var lastChar = textContent.charAt(textContent.length - 1); | ||
@@ -535,0 +535,0 @@ // COMPAT: If this is the last leaf, and the DOM text ends in a new line, |
{ | ||
"name": "slate-react", | ||
"description": "A set of React components for building completely customizable rich-text editors.", | ||
"version": "0.10.4", | ||
"version": "0.10.5", | ||
"license": "MIT", | ||
@@ -19,6 +19,6 @@ "repository": "git://github.com/ianstormtaylor/slate.git", | ||
"selection-is-backward": "^1.0.0", | ||
"slate-base64-serializer": "^0.2.4", | ||
"slate-dev-logger": "^0.1.28", | ||
"slate-plain-serializer": "^0.4.2", | ||
"slate-prop-types": "^0.4.2" | ||
"slate-base64-serializer": "^0.2.5", | ||
"slate-dev-logger": "^0.1.29", | ||
"slate-plain-serializer": "^0.4.3", | ||
"slate-prop-types": "^0.4.3" | ||
}, | ||
@@ -28,3 +28,3 @@ "peerDependencies": { | ||
"react-dom": "^0.14.0 || ^15.0.0 || ^16.0.0", | ||
"slate": "^0.30.2" | ||
"slate": "^0.30.3" | ||
}, | ||
@@ -35,5 +35,5 @@ "devDependencies": { | ||
"mocha": "^2.5.3", | ||
"slate": "^0.30.2", | ||
"slate-hyperscript": "^0.4.2", | ||
"slate-simulator": "^0.4.2", | ||
"slate": "^0.30.3", | ||
"slate-hyperscript": "^0.4.3", | ||
"slate-simulator": "^0.4.3", | ||
"uglify-js": "^2.7.0" | ||
@@ -40,0 +40,0 @@ }, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
744322
Updatedslate-dev-logger@^0.1.29
Updatedslate-prop-types@^0.4.3