1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-31 10:51:44 +02:00

cleanup editor and content props

This commit is contained in:
Ian Storm Taylor
2016-07-25 17:04:10 -07:00
parent ca837e2426
commit e088366364
2 changed files with 11 additions and 10 deletions

View File

@@ -36,15 +36,15 @@ class Content extends React.Component {
static propTypes = { static propTypes = {
className: React.PropTypes.string, className: React.PropTypes.string,
editor: React.PropTypes.object.isRequired, editor: React.PropTypes.object.isRequired,
onBeforeInput: React.PropTypes.func, onBeforeInput: React.PropTypes.func.isRequired,
onChange: React.PropTypes.func, onChange: React.PropTypes.func.isRequired,
onKeyDown: React.PropTypes.func, onKeyDown: React.PropTypes.func.isRequired,
onPaste: React.PropTypes.func, onPaste: React.PropTypes.func.isRequired,
onSelect: React.PropTypes.func, onSelect: React.PropTypes.func.isRequired,
readOnly: React.PropTypes.bool, readOnly: React.PropTypes.bool.isRequired,
renderMark: React.PropTypes.func.isRequired, renderMark: React.PropTypes.func.isRequired,
renderNode: React.PropTypes.func.isRequired, renderNode: React.PropTypes.func.isRequired,
spellCheck: React.PropTypes.bool, spellCheck: React.PropTypes.bool.isRequired,
state: React.PropTypes.object.isRequired, state: React.PropTypes.object.isRequired,
style: React.PropTypes.object style: React.PropTypes.object
}; };
@@ -56,8 +56,6 @@ class Content extends React.Component {
*/ */
static defaultProps = { static defaultProps = {
readOnly: false,
spellCheck: true,
style: {} style: {}
}; };

View File

@@ -38,6 +38,7 @@ class Editor extends React.Component {
renderDecorations: React.PropTypes.func, renderDecorations: React.PropTypes.func,
renderMark: React.PropTypes.func, renderMark: React.PropTypes.func,
renderNode: React.PropTypes.func, renderNode: React.PropTypes.func,
spellCheck: React.PropTypes.bool,
state: React.PropTypes.object.isRequired, state: React.PropTypes.object.isRequired,
style: React.PropTypes.object style: React.PropTypes.object
}; };
@@ -46,7 +47,8 @@ class Editor extends React.Component {
onDocumentChange: noop, onDocumentChange: noop,
onSelectionChange: noop, onSelectionChange: noop,
plugins: [], plugins: [],
readOnly: false readOnly: false,
spellCheck: true
}; };
/** /**
@@ -232,6 +234,7 @@ class Editor extends React.Component {
readOnly={this.props.readOnly} readOnly={this.props.readOnly}
renderMark={this.renderMark} renderMark={this.renderMark}
renderNode={this.renderNode} renderNode={this.renderNode}
spellCheck={this.props.spellCheck}
state={this.state.state} state={this.state.state}
style={this.props.style} style={this.props.style}
/> />