diff --git a/CHANGELOG.md b/CHANGELOG.md index c8d0cf28..5ad746b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,12 @@ ## Change Log -### 3.3.1 (2017/04/14 03:32 +00:00) -- Missed building for 3.3.0 -### 3.3.0 (2017/04/14 03:32 +00:00) +### 3.4.0 (2017/10/16 13:36 +00:00) +- [#321](https://github.com/wwayne/react-tooltip/pull/321) React 16 support (@mikecousins) + +### 3.3.1 (2017/10/05 05:08 +00:00) +- [#292](https://github.com/wwayne/react-tooltip/pull/292) Fix typo (@piperchester) + +### 3.3.0 (2017/04/14 03:34 +00:00) - [#287](https://github.com/wwayne/react-tooltip/pull/287) Use prop-types package instead of React.PropTypes (@ssilve1989) ### 3.2.10 (2017/03/28 20:41 +00:00) @@ -79,7 +83,7 @@ - [#145](https://github.com/wwayne/react-tooltip/pull/145) fix typo (@meandavejustice) ### 3.0.13 (2016/07/14 09:53 +00:00) -- [#136](https://github.com/wwayne/react-tooltip/pull/136) Check if current element is under transform (@CremAlex) +- [#136](https://github.com/wwayne/react-tooltip/pull/136) Check if current element is under transform (@CremaFR) - [#135](https://github.com/wwayne/react-tooltip/pull/135) Transform 3d (@wwayne) ### 3.0.10 (2016/07/12 00:28 +00:00) diff --git a/Makefile b/Makefile index 38ee507d..55ea22fd 100644 --- a/Makefile +++ b/Makefile @@ -11,10 +11,6 @@ lint: @echo Linting... @$(NODE_BIN)/standard --verbose | $(NODE_BIN)/snazzy src/index.js -test: lint - @echo Start testing... - @$(NODE_BIN)/mocha $(MOCHA_OPTS) $(TEST) - convertCSS: @echo Converting css... @node bin/transferSass.js diff --git a/bower.json b/bower.json index 28bdb8c2..58920df7 100644 --- a/bower.json +++ b/bower.json @@ -27,6 +27,7 @@ "url": "https://github.com/wwayne/react-tooltip" }, "dependencies": { - "react": "^0.14.0 || ^15.0.0" + "react": ">=0.14", + "react-dom": ">=0.14" } } diff --git a/example/src/index.js b/example/src/index.js index 95d67974..60c86b78 100755 --- a/example/src/index.js +++ b/example/src/index.js @@ -1,43 +1,43 @@ 'use strict' -import React from 'react' +import React, { Component } from 'react' import {render, findDOMNode} from 'react-dom' import ReactTooltip from '../../src' -const Test = React.createClass({ - - getInitialState () { - return { +class Test extends Component { + constructor(props) { + super(props); + this.state = { place: 'top', type: 'dark', effect: 'float', condition: false } - }, + } changePlace (place) { this.setState({ place: place }) - }, + } changeType (type) { this.setState({ type: type }) - }, + } changeEffect (effect) { this.setState({ effect: effect }) - }, + } _onClick () { this.setState({ condition: true }) - }, + } render () { let { place, type, effect } = this.state @@ -250,6 +250,6 @@ const Test = React.createClass({ ) } -}) +} render(, document.getElementById('main')) diff --git a/package.json b/package.json index 9f65e5b0..68b36ebd 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { "name": "react-tooltip", - "version": "3.3.1", + "version": "3.4.0", "description": "react tooltip component", "main": "dist/index.js", "scripts": { - "test": "make test", + "test": "make lint", "start": "make dev", "deploy": "make deploy" }, @@ -43,8 +43,8 @@ "react-dom": ">=0.14" }, "dependencies": { - "classnames": "^2.2.0", - "prop-types": "^15.5.8" + "classnames": "^2.2.5", + "prop-types": "^15.6.0" }, "engines": { "node": ">=4.2.1" @@ -65,6 +65,7 @@ "chai-enzyme": "^0.5.0", "concurrently": "^2.1.0", "enzyme": "^2.3.0", + "enzyme-adapter-react-16": "^1.0.1", "http-server": "^0.8.0", "jsdom": "^9.2.1", "mocha": "^2.5.3", diff --git a/test/globalMethods.test.js b/test/globalMethods.test.js deleted file mode 100644 index 135bd65c..00000000 --- a/test/globalMethods.test.js +++ /dev/null @@ -1,38 +0,0 @@ -/* For Standard.js lint checking */ -/* eslint-env mocha */ -import React from 'react' -import { mount } from 'enzyme' -import { expect } from 'chai' -// import chaiEnzyme from 'chai-enzyme' -import sinon from 'sinon' -import ReactTooltip from '../src' - -// Initial test tools -// @note chai enzyme has bug -// chai.use(chaiEnzyme()) - -describe.skip('Global methods', () => { - before(() => { - sinon.spy(ReactTooltip.prototype, 'hideTooltip') - sinon.spy(ReactTooltip.prototype, 'globalRebuild') - }) - - it('should be hided by invoking ReactTooltip.hide', done => { - const wrapper = mount() - wrapper.setState({ show: true }) - ReactTooltip.hide() - setImmediate(() => { - expect(ReactTooltip.prototype.hideTooltip.calledOnce).to.equal(true) - expect(wrapper).to.have.state('show', false) - done() - }) - }) - - it('should invoke globalRebuild when using ReactTooltip.rebuild', done => { - ReactTooltip.rebuild() - setImmediate(() => { - expect(ReactTooltip.prototype.globalRebuild.calledOnce).to.equal(true) - done() - }) - }) -}) diff --git a/test/setup.js b/test/setup.js deleted file mode 100644 index ccdca868..00000000 --- a/test/setup.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Setup jsdom for enzyme mount - * @see https://github.com/airbnb/enzyme/blob/master/docs/guides/jsdom.md#using-enzyme-with-jsdom - */ -import {jsdom} from 'jsdom' - -const exposedProperties = ['window', 'navigator', 'document'] - -global.document = jsdom('') -global.window = document.defaultView -Object.keys(document.defaultView).forEach((property) => { - if (typeof global[property] === 'undefined') { - exposedProperties.push(property) - global[property] = document.defaultView[property] - } -}) - -global.navigator = { - userAgent: 'node.js' -} diff --git a/yarn.lock b/yarn.lock index bc4e275b..36f03d16 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1220,8 +1220,8 @@ browser-resolve@^1.11.0, browser-resolve@^1.7.0: resolve "1.1.7" browserify-aes@^1.0.0, browserify-aes@^1.0.4: - version "1.0.8" - resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.0.8.tgz#c8fa3b1b7585bb7ba77c5560b60996ddec6d5309" + version "1.1.0" + resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.1.0.tgz#1d2ad62a8b479f23f0ab631c1be86a82dbccbe48" dependencies: buffer-xor "^1.0.3" cipher-base "^1.0.0" @@ -1528,7 +1528,7 @@ circular-json@^0.3.1: version "0.3.3" resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" -classnames@^2.2.0: +classnames@^2.2.5: version "2.2.5" resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.5.tgz#fb3801d453467649ef3603c7d61a02bd129bde6d" @@ -2095,6 +2095,24 @@ entities@^1.1.1, entities@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0" +enzyme-adapter-react-16@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.0.1.tgz#066cb1735e65d8d95841a023f94dab3ce6109e17" + dependencies: + enzyme-adapter-utils "^1.0.0" + lodash "^4.17.4" + object.assign "^4.0.4" + object.values "^1.0.4" + prop-types "^15.5.10" + +enzyme-adapter-utils@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/enzyme-adapter-utils/-/enzyme-adapter-utils-1.0.1.tgz#fcd81223339a55a312f7552641e045c404084009" + dependencies: + lodash "^4.17.4" + object.assign "^4.0.4" + prop-types "^15.5.10" + enzyme@^2.3.0: version "2.9.1" resolved "https://registry.yarnpkg.com/enzyme/-/enzyme-2.9.1.tgz#07d5ce691241240fb817bf2c4b18d6e530240df6" @@ -2135,13 +2153,13 @@ es-to-primitive@^1.1.1: is-symbol "^1.0.1" es5-ext@^0.10.14, es5-ext@^0.10.9, es5-ext@~0.10.14: - version "0.10.30" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.30.tgz#7141a16836697dbabfaaaeee41495ce29f52c939" + version "0.10.35" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.35.tgz#18ee858ce6a3c45c7d79e91c15fcca9ec568494f" dependencies: - es6-iterator "2" - es6-symbol "~3.1" + es6-iterator "~2.0.1" + es6-symbol "~3.1.1" -es6-iterator@2, es6-iterator@^2.0.1, es6-iterator@~2.0.1: +es6-iterator@^2.0.1, es6-iterator@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.1.tgz#8e319c9f0453bf575d374940a655920e59ca5512" dependencies: @@ -2170,7 +2188,7 @@ es6-set@~0.1.5: es6-symbol "3.1.1" event-emitter "~0.3.5" -es6-symbol@3.1.1, es6-symbol@^3.1, es6-symbol@^3.1.1, es6-symbol@~3.1, es6-symbol@~3.1.1: +es6-symbol@3.1.1, es6-symbol@^3.1, es6-symbol@^3.1.1, es6-symbol@~3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" dependencies: @@ -3306,8 +3324,8 @@ js-base64@^2.1.8: resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.3.2.tgz#a79a923666372b580f8e27f51845c6f7e8fbfbaf" js-beautify@^1.5.10: - version "1.7.3" - resolved "https://registry.yarnpkg.com/js-beautify/-/js-beautify-1.7.3.tgz#3f563067162cd0635c8611686d1fa0bb1448773a" + version "1.7.4" + resolved "https://registry.yarnpkg.com/js-beautify/-/js-beautify-1.7.4.tgz#fa0dfa8fef594d6a6253755fe26af5d0a22cbd90" dependencies: config-chain "~1.1.5" editorconfig "^0.13.2" @@ -3756,7 +3774,7 @@ longest@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" -loose-envify@^1.0.0, loose-envify@^1.3.1: +loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" dependencies: @@ -3936,8 +3954,8 @@ module-deps@^4.0.8: xtend "^4.0.0" moment@^2.11.2: - version "2.18.1" - resolved "https://registry.yarnpkg.com/moment/-/moment-2.18.1.tgz#c36193dd3ce1c2eed2adb7c802dbbc77a81b1c0f" + version "2.19.1" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.19.1.tgz#56da1a2d1cbf01d38b7e1afc31c10bcfa1929167" mothership@~0.2.0: version "0.2.0" @@ -4109,8 +4127,8 @@ number-is-nan@^1.0.0: resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" "nwmatcher@>= 1.3.9 < 2.0.0": - version "1.4.2" - resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.4.2.tgz#c5e545ab40d22a56b0326531c4beaed7a888b3ea" + version "1.4.3" + resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.4.3.tgz#64348e3b3d80f035b40ac11563d278f8b72db89c" oauth-sign@~0.8.1, oauth-sign@~0.8.2: version "0.8.2" @@ -4388,8 +4406,8 @@ preserve@^0.2.0: resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" private@^0.1.6, private@^0.1.7, private@~0.1.5: - version "0.1.7" - resolved "https://registry.yarnpkg.com/private/-/private-0.1.7.tgz#68ce5e8a1ef0a23bb570cc28537b5332aba63ef1" + version "0.1.8" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" process-nextick-args@~1.0.6: version "1.0.7" @@ -4405,7 +4423,7 @@ promise@^7.1.1: dependencies: asap "~2.0.3" -prop-types@^15.5.10, prop-types@^15.5.8: +prop-types@^15.5.10, prop-types@^15.6.0: version "15.6.0" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.0.tgz#ceaf083022fc46b4a35f69e13ef75aed0d639856" dependencies: @@ -4481,8 +4499,8 @@ randombytes@^2.0.0, randombytes@^2.0.1: safe-buffer "^5.1.0" rc@^1.1.7: - version "1.2.1" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.1.tgz#2e03e8e42ee450b8cb3dce65be1bf8974e1dfd95" + version "1.2.2" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.2.tgz#d8ce9cb57e8d64d9c7badd9876c7c34cbe3c7077" dependencies: deep-extend "~0.4.0" ini "~1.3.0" @@ -4505,6 +4523,15 @@ react-element-to-jsx-string@^3.0.0: stringify-object "^2.3.1" traverse "^0.6.6" +react@^16.0.0: + version "16.0.0" + resolved "https://registry.yarnpkg.com/react/-/react-16.0.0.tgz#ce7df8f1941b036f02b2cca9dbd0cb1f0e855e2d" + dependencies: + fbjs "^0.8.16" + loose-envify "^1.1.0" + object-assign "^4.1.1" + prop-types "^15.6.0" + read-only-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/read-only-stream/-/read-only-stream-2.0.0.tgz#2724fd6a8113d73764ac288d4386270c1dbf17f0" @@ -5459,8 +5486,8 @@ typedarray@^0.0.6, typedarray@~0.0.5: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" ua-parser-js@^0.7.9: - version "0.7.14" - resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.14.tgz#110d53fa4c3f326c121292bbeac904d2e03387ca" + version "0.7.17" + resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.17.tgz#e9ec5f9498b9ec910e7ae3ac626a805c4d09ecac" uglify-js@^2.6: version "2.8.29"