Comparing version 0.5.0 to 0.6.0
@@ -7,2 +7,15 @@ # Changelog | ||
## 0.6.0 (April 27, 2016) | ||
### Added | ||
* `ContentState.getFirstBlock()` convenience method | ||
### Changed | ||
* <kbd>return</kbd> key handling now goes through command flow to enable easier | ||
custom `'split-block'` handling. | ||
* `convertFromRaw` now returns a `ContentState` object instead of an | ||
`Array<ContentBlock>` | ||
## 0.5.0 (April 12, 2016) | ||
@@ -9,0 +22,0 @@ |
@@ -109,2 +109,7 @@ /** | ||
}, { | ||
key: 'getFirstBlock', | ||
value: function getFirstBlock() { | ||
return this.getBlockMap().first(); | ||
} | ||
}, { | ||
key: 'getLastBlock', | ||
@@ -111,0 +116,0 @@ value: function getLastBlock() { |
@@ -18,2 +18,3 @@ /** | ||
var ContentBlock = require('./ContentBlock'); | ||
var ContentState = require('./ContentState'); | ||
var DraftEntity = require('./DraftEntity'); | ||
@@ -41,3 +42,3 @@ | ||
return blocks.map(function (block) { | ||
var contentBlocks = blocks.map(function (block) { | ||
var key = block.key; | ||
@@ -69,4 +70,6 @@ var type = block.type; | ||
}); | ||
return ContentState.createFromBlockArray(contentBlocks); | ||
} | ||
module.exports = convertFromRawToDraftState; |
@@ -187,3 +187,2 @@ /** | ||
// $FlowFixMe: Support DOM elements in React.createElement | ||
child = React.createElement(_Element, childProps, React.createElement(Component, componentProps)); | ||
@@ -190,0 +189,0 @@ |
@@ -88,7 +88,7 @@ /** | ||
// The top-level component may manually handle newline insertion. If | ||
// no special handling is performed, insert a newline. | ||
if (!this.props.handleReturn || !this.props.handleReturn(e)) { | ||
this.update(keyCommandInsertNewline(editorState)); | ||
// no special handling is performed, fall through to command handling. | ||
if (this.props.handleReturn && this.props.handleReturn(e)) { | ||
return; | ||
} | ||
return; | ||
break; | ||
case Keys.ESC: | ||
@@ -95,0 +95,0 @@ e.preventDefault(); |
@@ -106,2 +106,4 @@ /** | ||
return getZCommand(e) || null; | ||
case Keys.RETURN: | ||
return 'split-block'; | ||
case Keys.DELETE: | ||
@@ -108,0 +110,0 @@ return getDeleteCommand(e); |
@@ -16,2 +16,5 @@ /** | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
}); | ||
var getRangeClientRects = require('./getRangeClientRects'); | ||
@@ -18,0 +21,0 @@ |
@@ -14,6 +14,2 @@ /** | ||
'use strict'; | ||
var getRangeBoundingClientRect = require('./getRangeBoundingClientRect'); | ||
/** | ||
@@ -24,2 +20,6 @@ * Return the bounding ClientRect for the visible DOM selection, if any. | ||
*/ | ||
'use strict'; | ||
var getRangeBoundingClientRect = require('./getRangeBoundingClientRect'); | ||
function getVisibleSelectionRect(global) { | ||
@@ -26,0 +26,0 @@ var selection = global.getSelection(); |
{ | ||
"name": "draft-js", | ||
"description": "A React framework for building text editors.", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"keywords": [ | ||
@@ -32,3 +32,3 @@ "draftjs", | ||
"dependencies": { | ||
"fbjs": "^0.8.0-alpha.2", | ||
"fbjs": "^0.8.1", | ||
"immutable": "^3.7.4" | ||
@@ -49,3 +49,3 @@ }, | ||
"fbjs-scripts": "^0.6.0-alpha.1", | ||
"flow-bin": "^0.22.1", | ||
"flow-bin": "^0.23.0", | ||
"gulp": "^3.9.0", | ||
@@ -61,3 +61,3 @@ "gulp-babel": "^5.1.0", | ||
"gulp-util": "^3.0.6", | ||
"jest-cli": "^0.9.0-fb1", | ||
"jest-cli": "^11.0.2", | ||
"object-assign": "^4.0.1", | ||
@@ -90,6 +90,6 @@ "react": "^15.0.0-rc.1", | ||
], | ||
"testRunner": "node_modules/jest-cli/src/testRunners/jasmine/jasmine2.js", | ||
"unmockedModulePathPatterns": [ | ||
"<rootDir>/node_modules/fbjs/node_modules/", | ||
"<rootDir>/node_modules/fbjs/lib/(?!(UserAgent.js$|UserAgentData.js$))", | ||
"<rootDir>/node_modules/fbjs/lib/UserAgent.js", | ||
"<rootDir>/node_modules/fbjs/lib/UserAgentData.js", | ||
"<rootDir>/node_modules/fbjs-scripts/", | ||
@@ -96,0 +96,0 @@ "<rootDir>/node_modules/immutable/", |
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 too big to display
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
892954
19305
Updatedfbjs@^0.8.1