Skip to content

Commit 99e2f25

Browse files
authored
Merge branch 'master' into master
2 parents 873c2a8 + ea16185 commit 99e2f25

38 files changed

+12459
-17854
lines changed

.babelrc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
{
2-
"presets": ["es2015", "react", "stage-0"],
3-
"plugins": ["transform-decorators-legacy"],
2+
"plugins": [["@babel/plugin-proposal-decorators", { "legacy": true }],
3+
"@babel/plugin-proposal-class-properties"
4+
],
5+
"presets": [
6+
["@babel/preset-env", {
7+
"modules": false
8+
}],
9+
"@babel/preset-react"
10+
]
411
}

.eslintignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Dependency directories
2+
node_modules/
3+
4+
build/
5+
dist/
6+
standalone/

.eslintrc

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"parser": "babel-eslint",
3+
"extends": [
4+
"standard",
5+
"standard-react",
6+
"prettier",
7+
"eslint:recommended"
8+
],
9+
"env": {
10+
"es6": true,
11+
"jest": true
12+
},
13+
"plugins": [
14+
"react",
15+
"prettier"
16+
],
17+
"parserOptions": {
18+
"sourceType": "module",
19+
"ecmaVersion": 2018,
20+
"ecmaFeatures": {
21+
"impliedStrict": true,
22+
"jsx": true,
23+
"arrowFunctions": true,
24+
"blockBindings": true,
25+
"defaultParams": true,
26+
"destructuring": true,
27+
"forOf": true,
28+
"generators": true,
29+
"objectLiteralComputedProperties": true,
30+
"objectLiteralShorthandMethods": true,
31+
"objectLiteralShorthandProperties": true,
32+
"experimentalObjectRestSpread": true,
33+
"restParams": true,
34+
"spread": true,
35+
"templateStrings": true,
36+
"modules": true,
37+
"classes": true
38+
}
39+
},
40+
"rules": {
41+
// don't force es6 functions to include space before paren
42+
"space-before-function-paren": 0,
43+
44+
// allow specifying true explicitly for boolean props
45+
"react/jsx-boolean-value": 0,
46+
47+
"max-len": [2, {"code":120,"ignoreComments":true}],
48+
49+
"prettier/prettier": [
50+
"error",
51+
{
52+
"singleQuote": false,
53+
"trailingComma": "es5",
54+
"tabWidth": 2,
55+
"printWidth": 80,
56+
"semi": true,
57+
"bracketSpacing": true,
58+
"jsxBracketSameLine": false
59+
}
60+
]
61+
}
62+
}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010

1111
# files
1212
node_modules/
13-
example/dist/
1413
dist/
14+
build/

.travis.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,37 @@ cache:
33
directories:
44
- node_modules
55
node_js:
6-
- "8"
6+
- 12
77
notifications:
88
email:
99
recipients:
1010
- aron.helser@kitware.com
1111
on_success: change
1212
on_failure: always
1313
install:
14-
- npm install
14+
- yarn
1515

1616
script:
17-
- npm run build
17+
- yarn build
1818
- git config --global user.name "Travis CI"
1919
- git config --global user.email "aron.helser@kitware.com"
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
20+
- cd example
21+
- yarn
22+
- yarn build
23+
- cd ..
2224

2325
after_success:
24-
- npm run semantic-release
25-
26+
- yarn semantic-release
27+
28+
deploy:
29+
provider: pages
30+
local_dir: example/build
31+
skip_cleanup: true
32+
token: $GH_TOKEN
33+
keep_history: true
34+
on:
35+
branch: master
36+
2637
branches:
2738
except:
2839
- "/^v\\d+\\.\\d+\\.\\d+$/"

Makefile

Lines changed: 0 additions & 62 deletions
This file was deleted.

README.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,32 @@
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+
## Demo
11+
12+
[![Edit ReactTooltip](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/heuristic-curran-bddeu?fontsize=14&hidenavigation=1&theme=dark)
13+
1014
## Maintainers
1115

12-
[huumanoid](https://github.com/huumanoid)
16+
[aronhelser](https://github.com/aronhelser) Passive maintainer - accepting PRs and doing minor testing, but not fixing issues or doing active development.
17+
18+
[Rogger794](https://github.com/Rogger794) Active maintainer - accepting PRs and doing minor testing, fixing issues or doing active development.
1319

14-
[aronhelser](https://github.com/aronhelser)
20+
[huumanoid](https://github.com/huumanoid) (inactive)
21+
22+
We would gladly accept a new maintainer to help out!
1523

1624
## Installation
1725

1826
```sh
1927
npm install react-tooltip
2028
```
2129

30+
or
31+
32+
```sh
33+
yarn add react-tooltip
34+
```
35+
2236
## Usage
2337
**Using NPM**
2438

@@ -29,20 +43,20 @@ import ReactTooltip from 'react-tooltip'
2943
```
3044

3145
2 . Add data-tip = "your placeholder" to your element
46+
3247
```jsx
3348
<p data-tip="hello world">Tooltip</p>
3449
```
3550

3651
3 . Include react-tooltip component
3752

38-
3953
```js
4054
<ReactTooltip />
4155
```
4256

4357
**Standalone**
4458

45-
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.
59+
You can import `node_modules/react-tooltip/dist/index.js` into your page. Please make sure that you have already imported `react` and `react-dom` into your page.
4660

4761
## Options
4862
Notes:
@@ -84,9 +98,6 @@ className | data-class | String | | extra custom class, can use !importan
8498

8599
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.
86100

87-
## Using react component as tooltip
88-
Check the example [React-tooltip Test](https://react-tooltip.netlify.com/)
89-
90101
##### Note:
91102
1. **data-tip** is necessary, because `<ReactTooltip />` finds the tooltip via this attribute
92103
2. **data-for** corresponds to the **id** of `<ReactTooltip />`

bin/transferSass.js

Lines changed: 43 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,50 @@
1-
var sass = require('node-sass')
2-
var fs = require('fs')
3-
var path = require('path')
1+
var sass = require("node-sass");
2+
var fs = require("fs");
3+
var path = require("path");
44

5-
function transferSass () {
6-
sass.render({
7-
file: path.resolve(__dirname, '../src/index.scss'),
8-
outputStyle: 'compressed'
9-
}, function (err, result) {
10-
if (err) {
11-
console.log(err)
12-
return
13-
}
14-
var cssSource = result.css.toString()
15-
fs.writeFile(path.resolve(__dirname, '../src/style.js'), "export default '" + cssSource.replace(/\n/g, '') + "'", function (err) {
5+
function transferSass() {
6+
sass.render(
7+
{
8+
file: path.resolve(__dirname, "../src/index.scss"),
9+
outputStyle: "compressed",
10+
},
11+
function(err, result) {
1612
if (err) {
17-
console.error(err)
13+
console.log(err);
14+
return;
1815
}
19-
console.log('css file has been transformed to JS successful')
20-
fs.writeFile(path.resolve(__dirname, '../src/style.css'), cssSource, function (err) {
21-
if (err) {
22-
console.error(err)
16+
var cssSource = result.css.toString();
17+
fs.writeFile(
18+
path.resolve(__dirname, "../src/style.js"),
19+
"export default '" + cssSource.replace(/\n/g, "") + "'",
20+
function(err) {
21+
if (err) {
22+
console.error(err);
23+
}
24+
console.log("css file has been transformed to JS successful");
25+
fs.writeFile(
26+
path.resolve(__dirname, "../src/style.css"),
27+
cssSource,
28+
function(err) {
29+
if (err) {
30+
console.error(err);
31+
}
32+
console.log("css file has been transformed successful");
33+
process.exit();
34+
}
35+
);
2336
}
24-
console.log('css file has been transformed successful')
25-
process.exit()
26-
})
27-
})
28-
})
37+
);
38+
}
39+
);
2940
}
3041

31-
transferSass()
42+
transferSass();
3243

33-
fs.watch(path.resolve(__dirname, '../src/index.scss'), function (event, filename) {
34-
console.log(event, filename)
35-
transferSass()
36-
})
44+
fs.watch(path.resolve(__dirname, "../src/index.scss"), function(
45+
event,
46+
filename
47+
) {
48+
console.log(event, filename);
49+
transferSass();
50+
});

contributing.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,31 @@ This doc needs help! Please submit your PR...
44

55
## Commit messages
66

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.
7+
We are using semantic-release to automate the release process, and this depends on a specific format for commit messages. Please run `yarn commit` to use `commitizen` to properly format your commit messages so they can be automatically processed and included in release notes.
88

99
## Pull request testing
1010

1111
Some notes on testing and releasing.
1212
* 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.
13+
* To start a development server:
14+
15+
```sh
16+
yarn build
17+
cd example
18+
yarn
19+
yarn start
20+
```
21+
1422
* Provide feedback on the PR about your results.
1523

1624
## Doing a release
1725

1826
We are using semantic-release instead of this:
1927

20-
* `make deploy` updates the files in the `standalone` directory
2128
* 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
29+
- Fixes update the patch number, features update the minor number.
30+
- Major version update is reserved for API breaking changes, not just additions.
31+
* `yarn github-changes -- -n 3.X.Y` to update the changelog
2532
* `git add`, `git commit` and `git push` to get the version to master.
2633
* `git tag -a 3.X.Y -m 3.X.Y` `git push --tags`
2734
* `npm publish`

example/index.html

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)