Skip to content

Commit f3e126a

Browse files
committed
Fixes conflicts
2 parents bebdcf0 + c28d02b commit f3e126a

25 files changed

+23896
-663
lines changed

.travis.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,26 @@ cache:
33
directories:
44
- node_modules
55
node_js:
6-
- "4"
6+
- "8"
77
notifications:
8-
email: false
8+
email:
9+
recipients:
10+
11+
on_success: change
12+
on_failure: always
913
install:
10-
- npm install
14+
- npm install
15+
16+
script:
17+
- npm run build
18+
- git config --global user.name "Travis CI"
19+
- git config --global user.email "[email protected]"
20+
- export GIT_PUBLISH_URL=https://${GH_TOKEN}@github.com/wwayne/react-tooltip.git
21+
- if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then npm run gh-pages -- --repo ${GIT_PUBLISH_URL}; fi
22+
23+
after_success:
24+
- npm run semantic-release
25+
26+
branches:
27+
except:
28+
- "/^v\\d+\\.\\d+\\.\\d+$/"

CHANGELOG.md

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,79 @@
11
## Change Log
22

3+
### v3.9.0 (2018/11/07 00:43 +00:00)
4+
- [#452](https://github.com/wwayne/react-tooltip/pull/452) docs(README.md): Updates demo url (@tjFogarty)
5+
- [#439](https://github.com/wwayne/react-tooltip/pull/439) added support for passing options to sanitizeHtml (@icheishvili)
6+
- [#433](https://github.com/wwayne/react-tooltip/pull/433) Use capture mode with globalEventOff (@apandichi)
7+
8+
### v3.8.4 (2018/09/12 18:00 +00:00)
9+
- [#428](https://github.com/wwayne/react-tooltip/pull/428) fix(example): <p> warning from react, make text match code. (@aronhelser)
10+
11+
### v3.8.3 (2018/09/12 13:47 +00:00)
12+
- [#426](https://github.com/wwayne/react-tooltip/pull/426) perf(Use sanitize-html-react instead of sanitize-html) (@jgerlier)
13+
- [#425](https://github.com/wwayne/react-tooltip/pull/425) fix(index.js): fix state initialization (@MtBlue81)
14+
15+
### v3.8.2 (2018/09/11 17:55 +00:00)
16+
- [#413](https://github.com/wwayne/react-tooltip/pull/413) fix(index.js): Use correct orientation when mouse enters (@an4ger)
17+
18+
### v3.8.1 (2018/09/06 14:07 +00:00)
19+
- [#422](https://github.com/wwayne/react-tooltip/pull/422) fix(tooltip): sanitize HTML to prevent XSS (@wichniowski)
20+
21+
### v3.7.0 (2018/09/03 15:13 +00:00)
22+
- [#416](https://github.com/wwayne/react-tooltip/pull/416) feat(mouseover): Add ability to hover on tooltip. (@RobertGary1)
23+
- [#414](https://github.com/wwayne/react-tooltip/pull/414) Fixed jsdoc return typos (@AlexanderEllis)
24+
- [#399](https://github.com/wwayne/react-tooltip/pull/399) Fixes Typos (@jstettner)
25+
- [#391](https://github.com/wwayne/react-tooltip/pull/391) fix(positioning): make sure tooltip is oriented correctly when close to edge (@hassanbot)
26+
27+
### v3.6.1 (2018/06/05 13:46 +00:00)
28+
- [#389](https://github.com/wwayne/react-tooltip/pull/389) fix(isCapture): guard use of currentTarget (@aronhelser)
29+
- [#384](https://github.com/wwayne/react-tooltip/pull/384) Detach custom event listener (@P0lip)
30+
31+
### v3.6.0 (2018/05/15 18:03 +00:00)
32+
- [#360](https://github.com/wwayne/react-tooltip/pull/360) Compute or enrich tip content (@austil)
33+
34+
### v3.5.1 (2018/05/03 18:11 +00:00)
35+
- [#380](https://github.com/wwayne/react-tooltip/pull/380) fix(examples): add SVG example (@P0lip)
36+
- [#379](https://github.com/wwayne/react-tooltip/pull/379) ci(gh-pages): Allow travis to publish new examples to github (@aronhelser)
37+
- [#366](https://github.com/wwayne/react-tooltip/pull/366) Make getPosition() calculate offsets correctly for svg elements (@P0lip)
38+
- [#310](https://github.com/wwayne/react-tooltip/pull/310) Update position with content (@stefanhayden)
39+
- [#368](https://github.com/wwayne/react-tooltip/pull/368) Fix issue where tooltip won't show for adjacent elements. (@tishihar94)
40+
- [#376](https://github.com/wwayne/react-tooltip/pull/376) Add displayName (@clehnert-psl)
41+
- [#375](https://github.com/wwayne/react-tooltip/pull/375) test(scrolling): Add example showing tooltip inside scrolling div (@aronhelser)
42+
43+
### v3.5.0 (2018/04/11 18:04 +00:00)
44+
- [#281](https://github.com/wwayne/react-tooltip/pull/281) Get tooltip content dynamically in the render method (@alfonsomunozpomer)
45+
46+
### v3.4.3 (2018/04/11 15:14 +00:00)
47+
- [#207](https://github.com/wwayne/react-tooltip/pull/207) Return tooltip to original position when possible (@hassanbot)
48+
- [#301](https://github.com/wwayne/react-tooltip/pull/301) insert css as first to allow easy css styling without important (@roblan)
49+
50+
### 3.4.2 (2018/04/09 18:58 +00:00)
51+
- [#373](https://github.com/wwayne/react-tooltip/pull/373) fix(example): 'made dev' works again, small fixes. (@aronhelser)
52+
- [#337](https://github.com/wwayne/react-tooltip/pull/337) Fix README show tip usage error (@sivagao)
53+
- [#359](https://github.com/wwayne/react-tooltip/pull/359) License should use H2 as the previous sections do (@konekoya)
54+
55+
### 3.4.1 (2018/04/05 17:24 +00:00)
56+
- [#369](https://github.com/wwayne/react-tooltip/pull/369) fix(index.js): add missing argument so tooltip hides. (@aronhelser)
57+
- [#372](https://github.com/wwayne/react-tooltip/pull/372) Travis: update node version to fix travis build. (@aronhelser)
58+
59+
### 3.4.0 (2017/10/16 13:39 +00:00)
60+
- [#321](https://github.com/wwayne/react-tooltip/pull/321) React 16 support (@mikecousins)
61+
62+
### 3.3.1 (2017/10/05 05:08 +00:00)
63+
- [#292](https://github.com/wwayne/react-tooltip/pull/292) Fix typo (@piperchester)
64+
65+
### 3.3.0 (2017/04/14 03:34 +00:00)
66+
- [#287](https://github.com/wwayne/react-tooltip/pull/287) Use prop-types package instead of React.PropTypes (@ssilve1989)
67+
68+
### 3.2.10 (2017/03/28 20:41 +00:00)
69+
- [#278](https://github.com/wwayne/react-tooltip/pull/278) Make MutationObserver-based removal tracking (@huumanoid)
70+
- [#272](https://github.com/wwayne/react-tooltip/pull/272) Fix wrapper tag (@huumanoid)
71+
- [#259](https://github.com/wwayne/react-tooltip/pull/259) Track removal of DOM elements (@antoniogiordano)
72+
- [#270](https://github.com/wwayne/react-tooltip/pull/270) Fix typos and improve for clarity (@theholla)
73+
74+
### 3.2.9 (2017/03/20 15:41 +00:00)
75+
- [#236](https://github.com/wwayne/react-tooltip/pull/236) escape backslash in getTargetArray method (@rnons)
76+
377
### 3.2.7 (2017/02/17 07:24 +00:00)
478
- [#262](https://github.com/wwayne/react-tooltip/pull/262) Fix nodelist converte in safari (@wwayne)
579
- [#260](https://github.com/wwayne/react-tooltip/pull/260) Fix NodeList to Array convertion (@huumanoid)
@@ -65,7 +139,7 @@
65139
- [#145](https://github.com/wwayne/react-tooltip/pull/145) fix typo (@meandavejustice)
66140

67141
### 3.0.13 (2016/07/14 09:53 +00:00)
68-
- [#136](https://github.com/wwayne/react-tooltip/pull/136) Check if current element is under transform (@CremAlex)
142+
- [#136](https://github.com/wwayne/react-tooltip/pull/136) Check if current element is under transform (@CremaFR)
69143
- [#135](https://github.com/wwayne/react-tooltip/pull/135) Transform 3d (@wwayne)
70144

71145
### 3.0.10 (2016/07/12 00:28 +00:00)

Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ lint:
1111
@echo Linting...
1212
@$(NODE_BIN)/standard --verbose | $(NODE_BIN)/snazzy src/index.js
1313

14-
test: lint
15-
@echo Start testing...
16-
@$(NODE_BIN)/mocha $(MOCHA_OPTS) $(TEST)
17-
1814
convertCSS:
1915
@echo Converting css...
2016
@node bin/transferSass.js
@@ -33,6 +29,11 @@ devCSS:
3329
@$(NODE_BIN)/node-sass $(SRC)/index.scss $(EXAMPLE_DIST)/style.css
3430
@$(NODE_BIN)/node-sass -w $(EXAMPLE_SRC)/index.scss $(EXAMPLE_DIST)/index.css
3531

32+
deployExample:
33+
@$(NODE_BIN)/browserify -t babelify $(EXAMPLE_SRC)/index.js -o $(EXAMPLE_DIST)/index.js -dv
34+
@$(NODE_BIN)/node-sass $(EXAMPLE_SRC)/index.scss $(EXAMPLE_DIST)/index.css
35+
@$(NODE_BIN)/node-sass $(SRC)/index.scss $(EXAMPLE_DIST)/style.css
36+
3637
devServer:
3738
@echo Listening 8888...
3839
@$(NODE_BIN)/http-server example -p 8888 -s
@@ -51,9 +52,11 @@ deployJS:
5152
deploy: lint
5253
@echo Deploy...
5354
@rm -rf dist && mkdir dist
55+
@rm -rf $(EXAMPLE_DIST) && mkdir -p $(EXAMPLE_DIST)
56+
@make deployExample
5457
@make convertCSS
5558
@make deployJS
5659
@make genStand
5760
@echo success!
5861

59-
.PHONY: lint convertCSS genStand devJS devCSS devServer dev deployJS deployCSS deploy
62+
.PHONY: lint convertCSS genStand devJS devCSS devServer dev deployExample deployJS deployCSS deploy

README.md

Lines changed: 47 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
[download-image]: https://img.shields.io/npm/dm/react-tooltip.svg?style=flat-square
88
[download-url]: https://npmjs.org/package/react-tooltip
99

10+
## Maintainers
11+
12+
[aronhelser](https://github.com/aronhelser) Passive maintainer - accepting PRs and doing minor testing, but not fixing issues or doing active development.
13+
14+
[huumanoid](https://github.com/huumanoid) (inactive)
15+
16+
We would gladly accept a new maintainer to help out!
17+
1018
## Installation
1119

1220
```sh
@@ -27,7 +35,7 @@ import ReactTooltip from 'react-tooltip'
2735
<p data-tip="hello world">Tooltip</p>
2836
```
2937

30-
3 . Including react-tooltip component
38+
3 . Include react-tooltip component
3139

3240

3341
```js
@@ -36,15 +44,15 @@ import ReactTooltip from 'react-tooltip'
3644

3745
**Standalone**
3846

39-
You can import `node_modules/react-tooltip/standalone/react-tooltip.min.js` into your page, please make sure that you have already imported `react` and `react-dom` into your page.
47+
You can import `node_modules/react-tooltip/standalone/react-tooltip.min.js` into your page. Please make sure that you have already imported `react` and `react-dom` into your page.
4048

4149
## Options
4250
Notes:
43-
* The tooltip is using `type: dark` `place: top` `effect: float` as **default** attribute, you don't have to add these options if you don't want to change default
51+
* The tooltip sets `type: dark` `place: top` `effect: float` as **default** attributes. You don't have to add these options if you don't want to change the defaults
4452
* The option you set on `<ReactTooltip />` component will be implemented on every tooltip in a same page: `<ReactTooltip effect="solid" />`
45-
* The option you set on specific element, for example: `<a data-type="warning"></a>` will only make effect on this specific tooltip
53+
* The option you set on a specific element, for example: `<a data-type="warning"></a>` will only affect this specific tooltip
4654

47-
Check example: [React-tooltip Test](http://wwayne.com/react-tooltip)
55+
Check example: [React-tooltip Test](https://react-tooltip.netlify.com/)
4856

4957
Global|Specific |Type |Values | Description
5058
|:---|:---|:---|:---|:----
@@ -58,71 +66,76 @@ Global|Specific |Type |Values | Description
5866
offset | data-offset | Object | top, right, bottom, left | `data-offset="{'top': 10, 'left': 10}"` for specific and `offset={{top: 10, left: 10}}` for global
5967
multiline | data-multiline | Bool | true, false | support `<br>`, `<br />` to make multiline
6068
className | data-class | String | | extra custom class, can use !important to overwrite react-tooltip's default class
61-
html | data-html | Bool | true, false | `<p data-tip="<p>HTML tooltip</p>" data-html={true}></p>` or `<ReactTooltip html={true} />`
69+
html | data-html | Bool | true, false | `<p data-tip="<p>HTML tooltip</p>" data-html={true}></p>` or `<ReactTooltip html={true} />`, but see [Security Note](#security-note) below.
6270
delayHide | data-delay-hide | Number | | `<p data-tip="tooltip" data-delay-hide='1000'></p>` or `<ReactTooltip delayHide={1000} />`
6371
delayShow | data-delay-show | Number | | `<p data-tip="tooltip" data-delay-show='1000'></p>` or `<ReactTooltip delayShow={1000} />`
72+
delayUpdate | data-delay-update | Number | | `<p data-tip="tooltip" data-delay-update='1000'></p>` or `<ReactTooltip delayUpdate={1000} />` Sets a delay in calling getContent if the tooltip is already shown and you mouse over another target
6473
insecure | null | Bool | true, false | Whether to inject the style header into the page dynamically (violates CSP style-src but is a convenient default)
6574
border | data-border | Bool | true, false | Add one pixel white border
66-
getContent | null | Func or Array | () => {}, [() => {}, Interval] | Generate the tip content dynamically
67-
afterShow | null | Func | () => {} | Function that will be called after tooltip show
68-
afterHide | null | Func | () => {} | Function that will be called after tooltip hide
75+
getContent | null | Func or Array | (dataTip) => {}, [(dataTip) => {}, Interval] | Generate the tip content dynamically
76+
afterShow | null | Func | (evt) => {} | Function that will be called after tooltip show, with event that triggered show
77+
afterHide | null | Func | (evt) => {} | Function that will be called after tooltip hide, with event that triggered hide
78+
overridePosition | null | Func | ({left:number, top: number}, currentEvent, currentTarget, node, place, desiredPlace, effect, offset) => ({left: number, top: number}) | Function that will replace tooltip position with custom one
6979
disable | data-tip-disable | Bool | true, false | Disable the tooltip behaviour, default is false
7080
scrollHide | data-scroll-hide | Bool | true, false | Hide the tooltip when scrolling, default is true
7181
resizeHide | null | Bool | true, false | Hide the tooltip when resizing the window, default is true
7282
wrapper | null | String | div, span | Selecting the wrapper element of the react tooltip, default is div
83+
clickable | null | Bool | true, false | Enables tooltip to respond to mouse (or touch) events, default is false
84+
85+
### Security Note
86+
87+
The `html` option allows a tooltip to directly display raw HTML. This is a security risk if any of that content is supplied by the user. Any user-supplied content must be sanitized, using a package like [sanitize-html-react](https://www.npmjs.com/package/sanitize-html-react). We chose not to include sanitization after discovering it [increased our package size](https://github.com/wwayne/react-tooltip/issues/429) too much - we don't want to penalize people who don't use the `html` option.
7388

7489
## Using react component as tooltip
75-
Check the example [React-tooltip Test](http://wwayne.com/react-tooltip)
90+
Check the example [React-tooltip Test](https://react-tooltip.netlify.com/)
7691

7792
##### Note:
78-
1. **data-tip** is necessary, because `<ReactTooltip />` find tooltip via this attribute
79-
2. **data-for** correspond to the **id** of `<ReactTooltip />`
80-
3. When using react component as tooltip, you can have many `<ReactTooltip />` in a page but they should have different **id**
93+
1. **data-tip** is necessary, because `<ReactTooltip />` finds the tooltip via this attribute
94+
2. **data-for** corresponds to the **id** of `<ReactTooltip />`
95+
3. When using react component as tooltip, you can have many `<ReactTooltip />` in a page but they should have different **id**s
8196

8297
## Static Methods
83-
###ReactTooltip.hide(target)
98+
### ReactTooltip.hide(target)
8499

85-
> Hide the tooltip manually, the target is optional, if no target passed in, all exitent tooltip will be hiden
100+
> Hide the tooltip manually, the target is optional, if no target passed in, all existing tooltips will be hidden
86101
87102
```js
88-
import {findDOMNode} from 'react-dom'
89103
import ReactTooltip from 'react-tooltip'
90104

91-
<p ref='foo' data-tip='tooltip'></p>
92-
<button onClick={() => { ReactTooltip.hide(findDOMNode(this.refs.foo)) }}></button>
105+
<p ref={ref => this.fooRef = ref} data-tip='tooltip'></p>
106+
<button onClick={() => { ReactTooltip.hide(this.fooRef) }}></button>
93107
<ReactTooltip />
94108
```
95109

96-
###ReactTooltip.rebuild()
110+
### ReactTooltip.rebuild()
97111

98112
> Rebinding all tooltips
99113
100-
###ReactTooltip.show(target)
114+
### ReactTooltip.show(target)
101115

102116
> Show specific tooltip manually, for example:
103117
104118
```js
105-
import {findDOMNode} from 'react-dom'
106119
import ReactTooltip from 'react-tooltip'
107120

108-
<p ref='foo' data-tip='tooltip'></p>
109-
<button onClick={() => { ReactTooltip.show(findDOMNode(this.refs.foo)) }}></button>
121+
<p ref={ref => this.fooRef = ref} data-tip='tooltip'></p>
122+
<button onClick={() => { ReactTooltip.show(this.fooRef) }}></button>
110123
<ReactTooltip />
111124
```
112125

113-
## Trouble Shooting
126+
## Troubleshooting
114127
### 1. Using tooltip within the modal (e.g. [react-modal](https://github.com/reactjs/react-modal))
115-
The component was designed to set a `<Reactooltip />` one place then use tooltip everywhere, but a lot of people stuck in using this component with modal, you can check the discussion [here](https://github.com/wwayne/react-tooltip/issues/130), the summarization of solving the problem is as following:
128+
The component was designed to set `<ReactTooltip />` once and then use tooltip everywhere, but a lot of people get stuck when using this component in a modal. You can read the discussion [here](https://github.com/wwayne/react-tooltip/issues/130). To solve this problem:
116129

117-
1. Put `<ReactTooltip />` out of the `<Modal>`
130+
1. Place `<ReactTooltip />` outside of the `<Modal>`
118131
2. Use `ReactTooltip.rebuild()` when opening the modal
119-
3. If your modal's z-index happens to higher than the tooltip, use the attribute `className` to custom your tooltip's z-index
132+
3. If your modal's z-index happens to be higher than the tooltip's, use the attribute `className` to custom your tooltip's z-index
120133

121-
>I suggest always put `<ReactTooltip />` in the Highest level or smart component of Redux, so you might need these static
134+
>I suggest always putting `<ReactTooltip />` in the Highest level or smart component of Redux, so you might need these static
122135
method to control tooltip's behaviour in some situations
123136

124137
### 2. Hide tooltip when getContent returns undefined
125-
When you set `getContent={() => { return }}` you will find the tooltip will dispaly `true`, that's because React will set the value of data-* to be 'true' automatically if there is no value to be set. So you have to set `data-tip=''` in this situaction.
138+
When you set `getContent={() => { return }}` you will find the tooltip will display `true`. That's because React will set the value of data-* to be 'true' automatically if there is no value to be set. So you have to set `data-tip=''` in this situation.
126139

127140
```jsx
128141
<p data-tip='' data-for='test'></p>
@@ -139,6 +152,10 @@ Same for empty children, if you don't want show the tooltip when the children is
139152
## Article
140153
[How I insert sass into react component](https://medium.com/@wwayne_me/how-i-insert-sass-into-my-npm-react-component-b46b9811c226#.gi4hxu44a)
141154

142-
### License
155+
## Contributing
156+
157+
We welcome your contribution! Fork the repo, make some changes, submit a pull-request! Our [contributing](contributing.md) doc has some details.
158+
159+
## License
143160

144161
MIT

bower.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"url": "https://github.com/wwayne/react-tooltip"
2828
},
2929
"dependencies": {
30-
"react": "^0.14.0 || ^15.0.0"
30+
"react": ">=0.14",
31+
"react-dom": ">=0.14"
3132
}
3233
}

contributing.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Contributing
2+
3+
This doc needs help! Please submit your PR...
4+
5+
## Commit messages
6+
7+
We are using semantic-release to automate the release process, and this depends on a specific format for commit messages. Please run `npm run commit` to use `commitizen` to properly format your commit messages so they can be automatically processed and included in release notes.
8+
9+
## Pull request testing
10+
11+
Some notes on testing and releasing.
12+
* For a PR, follow Github's command-line instructions for retrieving the branch with the changes.
13+
* `make dev` starts a development server, open `http://localhost:8888` to see the example website.
14+
* Provide feedback on the PR about your results.
15+
16+
## Doing a release
17+
18+
We are using semantic-release instead of this:
19+
20+
* `make deploy` updates the files in the `standalone` directory
21+
* update the version number in `package.json`
22+
- Fixes update the patch number, features update the minor number.
23+
- Major version update is reserved for API breaking changes, not just additions.
24+
* `npm run github-changes -- -n 3.X.Y` to update the changelog
25+
* `git add`, `git commit` and `git push` to get the version to master.
26+
* `git tag -a 3.X.Y -m 3.X.Y` `git push --tags`
27+
* `npm publish`
28+
* add a version on the github release page, based on the tag

0 commit comments

Comments
 (0)