Skip to content

Commit

Permalink
fix to depend on prop-types for react 15.5
Browse files Browse the repository at this point in the history
  • Loading branch information
ianstormtaylor committed Apr 28, 2017
1 parent bdc6d0f commit 17ea3ed
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 84 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"is-empty": "^1.0.0",
"is-in-browser": "^1.1.3",
"keycode": "^2.1.2",
"prop-types": "^15.5.8",
"react-portal": "^3.0.0",
"selection-is-backward": "^1.0.0",
"type-of": "^2.0.1"
Expand Down
62 changes: 32 additions & 30 deletions src/components/content.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@

import Base64 from '../serializers/base-64'
import Debug from 'debug'
import React from 'react'
import Types from 'prop-types'
import getWindow from 'get-window'
import keycode from 'keycode'

import TYPES from '../constants/types'
import Base64 from '../serializers/base-64'
import Node from './node'
import getPoint from '../utils/get-point'
import Selection from '../models/selection'
import extendSelection from '../utils/extend-selection'
import findClosestNode from '../utils/find-closest-node'
import React from 'react'
import Selection from '../models/selection'
import getTransferData from '../utils/get-transfer-data'
import TYPES from '../constants/types'
import getWindow from 'get-window'
import findDeepestNode from '../utils/find-deepest-node'
import keycode from 'keycode'
import getPoint from '../utils/get-point'
import getTransferData from '../utils/get-transfer-data'
import { IS_FIREFOX, IS_MAC } from '../constants/environment'

/**
Expand All @@ -37,28 +39,28 @@ class Content extends React.Component {
*/

static propTypes = {
autoCorrect: React.PropTypes.bool.isRequired,
autoFocus: React.PropTypes.bool.isRequired,
children: React.PropTypes.array.isRequired,
className: React.PropTypes.string,
editor: React.PropTypes.object.isRequired,
onBeforeInput: React.PropTypes.func.isRequired,
onBlur: React.PropTypes.func.isRequired,
onChange: React.PropTypes.func.isRequired,
onCopy: React.PropTypes.func.isRequired,
onCut: React.PropTypes.func.isRequired,
onDrop: React.PropTypes.func.isRequired,
onFocus: React.PropTypes.func.isRequired,
onKeyDown: React.PropTypes.func.isRequired,
onPaste: React.PropTypes.func.isRequired,
onSelect: React.PropTypes.func.isRequired,
readOnly: React.PropTypes.bool.isRequired,
role: React.PropTypes.string,
schema: React.PropTypes.object,
spellCheck: React.PropTypes.bool.isRequired,
state: React.PropTypes.object.isRequired,
style: React.PropTypes.object,
tabIndex: React.PropTypes.number
autoCorrect: Types.bool.isRequired,
autoFocus: Types.bool.isRequired,
children: Types.array.isRequired,
className: Types.string,
editor: Types.object.isRequired,
onBeforeInput: Types.func.isRequired,
onBlur: Types.func.isRequired,
onChange: Types.func.isRequired,
onCopy: Types.func.isRequired,
onCut: Types.func.isRequired,
onDrop: Types.func.isRequired,
onFocus: Types.func.isRequired,
onKeyDown: Types.func.isRequired,
onPaste: Types.func.isRequired,
onSelect: Types.func.isRequired,
readOnly: Types.bool.isRequired,
role: Types.string,
schema: Types.object,
spellCheck: Types.bool.isRequired,
state: Types.object.isRequired,
style: Types.object,
tabIndex: Types.number
}

/**
Expand Down
40 changes: 21 additions & 19 deletions src/components/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import Debug from 'debug'
import Portal from 'react-portal'
import React from 'react'
import Types from 'prop-types'

import Stack from '../models/stack'
import State from '../models/state'
import noop from '../utils/noop'
Expand Down Expand Up @@ -62,24 +64,24 @@ class Editor extends React.Component {
*/

static propTypes = {
autoCorrect: React.PropTypes.bool,
autoFocus: React.PropTypes.bool,
className: React.PropTypes.string,
onBeforeChange: React.PropTypes.func,
onChange: React.PropTypes.func,
onDocumentChange: React.PropTypes.func,
onSelectionChange: React.PropTypes.func,
placeholder: React.PropTypes.any,
placeholderClassName: React.PropTypes.string,
placeholderStyle: React.PropTypes.object,
plugins: React.PropTypes.array,
readOnly: React.PropTypes.bool,
role: React.PropTypes.string,
schema: React.PropTypes.object,
spellCheck: React.PropTypes.bool,
state: React.PropTypes.instanceOf(State).isRequired,
style: React.PropTypes.object,
tabIndex: React.PropTypes.number,
autoCorrect: Types.bool,
autoFocus: Types.bool,
className: Types.string,
onBeforeChange: Types.func,
onChange: Types.func,
onDocumentChange: Types.func,
onSelectionChange: Types.func,
placeholder: Types.any,
placeholderClassName: Types.string,
placeholderStyle: Types.object,
plugins: Types.array,
readOnly: Types.bool,
role: Types.string,
schema: Types.object,
spellCheck: Types.bool,
state: Types.instanceOf(State).isRequired,
style: Types.object,
tabIndex: Types.number,
}

/**
Expand Down Expand Up @@ -258,7 +260,7 @@ class Editor extends React.Component {
*/

for (const property of EVENT_HANDLERS) {
Editor.propTypes[property] = React.PropTypes.func
Editor.propTypes[property] = Types.func
}

/**
Expand Down
26 changes: 14 additions & 12 deletions src/components/leaf.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@

import Debug from 'debug'
import OffsetKey from '../utils/offset-key'
import React from 'react'
import ReactDOM from 'react-dom'
import Types from 'prop-types'

import OffsetKey from '../utils/offset-key'
import findDeepestNode from '../utils/find-deepest-node'
import { IS_FIREFOX } from '../constants/environment'

Expand All @@ -29,17 +31,17 @@ class Leaf extends React.Component {
*/

static propTypes = {
block: React.PropTypes.object.isRequired,
editor: React.PropTypes.object.isRequired,
index: React.PropTypes.number.isRequired,
marks: React.PropTypes.object.isRequired,
node: React.PropTypes.object.isRequired,
offset: React.PropTypes.number.isRequired,
parent: React.PropTypes.object.isRequired,
ranges: React.PropTypes.object.isRequired,
schema: React.PropTypes.object.isRequired,
state: React.PropTypes.object.isRequired,
text: React.PropTypes.string.isRequired
block: Types.object.isRequired,
editor: Types.object.isRequired,
index: Types.number.isRequired,
marks: Types.object.isRequired,
node: Types.object.isRequired,
offset: Types.number.isRequired,
parent: Types.object.isRequired,
ranges: Types.object.isRequired,
schema: Types.object.isRequired,
state: Types.object.isRequired,
text: Types.string.isRequired
}

/**
Expand Down
18 changes: 10 additions & 8 deletions src/components/node.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@

import Base64 from '../serializers/base-64'
import Debug from 'debug'
import React from 'react'
import ReactDOM from 'react-dom'
import Types from 'prop-types'

import TYPES from '../constants/types'
import Base64 from '../serializers/base-64'
import Leaf from './leaf'
import Void from './void'
import getWindow from 'get-window'
Expand Down Expand Up @@ -32,13 +34,13 @@ class Node extends React.Component {
*/

static propTypes = {
block: React.PropTypes.object,
editor: React.PropTypes.object.isRequired,
node: React.PropTypes.object.isRequired,
parent: React.PropTypes.object.isRequired,
readOnly: React.PropTypes.bool.isRequired,
schema: React.PropTypes.object.isRequired,
state: React.PropTypes.object.isRequired
block: Types.object,
editor: Types.object.isRequired,
node: Types.object.isRequired,
parent: Types.object.isRequired,
readOnly: Types.bool.isRequired,
schema: Types.object.isRequired,
state: Types.object.isRequired
}

/**
Expand Down
13 changes: 7 additions & 6 deletions src/components/placeholder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import React from 'react'
import Types from 'prop-types'

/**
* Placeholder.
Expand All @@ -16,12 +17,12 @@ class Placeholder extends React.Component {
*/

static propTypes = {
children: React.PropTypes.any.isRequired,
className: React.PropTypes.string,
node: React.PropTypes.object.isRequired,
parent: React.PropTypes.object.isRequired,
state: React.PropTypes.object.isRequired,
style: React.PropTypes.object
children: Types.any.isRequired,
className: Types.string,
node: Types.object.isRequired,
parent: Types.object.isRequired,
state: Types.object.isRequired,
style: Types.object
}

/**
Expand Down
18 changes: 10 additions & 8 deletions src/components/void.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@

import Debug from 'debug'
import React from 'react'
import Types from 'prop-types'

import Leaf from './leaf'
import Mark from '../models/mark'
import OffsetKey from '../utils/offset-key'
import React from 'react'
import { IS_FIREFOX } from '../constants/environment'

/**
Expand All @@ -29,13 +31,13 @@ class Void extends React.Component {
*/

static propTypes = {
block: React.PropTypes.object,
children: React.PropTypes.any.isRequired,
editor: React.PropTypes.object.isRequired,
node: React.PropTypes.object.isRequired,
parent: React.PropTypes.object.isRequired,
schema: React.PropTypes.object.isRequired,
state: React.PropTypes.object.isRequired,
block: Types.object,
children: Types.any.isRequired,
editor: Types.object.isRequired,
node: Types.object.isRequired,
parent: Types.object.isRequired,
schema: Types.object.isRequired,
state: Types.object.isRequired,
}

/**
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4841,7 +4841,7 @@ promise@^7.1.1:
dependencies:
asap "~2.0.3"

prop-types@^15.5.7, prop-types@~15.5.7:
prop-types@^15.5.7, prop-types@^15.5.8, prop-types@~15.5.7:
version "15.5.8"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.8.tgz#6b7b2e141083be38c8595aa51fc55775c7199394"
dependencies:
Expand Down

0 comments on commit 17ea3ed

Please sign in to comment.