Skip to content

chore: dependencies upgrade #799

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Oct 13, 2022
Merged
1 change: 1 addition & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ jobs:
run: |
yarn build
yarn run semantic-release
yarn gh-pages
26 changes: 13 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# [4.3.0](https://github.com/wwayne/react-tooltip/compare/v4.2.21...v4.3.0) (2022-10-13)
# [4.3.0](https://github.com/wwayne/react-tooltip/compare/v4.2.21...v4.3.0) (2022-10-12)

### Bug Fixes

- [#759](https://github.com/wwayne/react-tooltip/issues/759) - Disable tooltip when disable prop changes ([8e9cca0](https://github.com/wwayne/react-tooltip/commit/8e9cca016f8eb59036c0c4623b85bf3f465ba262))
- **aftershow:** call afterShow only after state has fully updated ([54752e8](https://github.com/wwayne/react-tooltip/commit/54752e81093f4c41bae1b49f7de65f28cf54df1a))
- effect and type not properly applied at first render ([a8d0e51](https://github.com/wwayne/react-tooltip/commit/a8d0e51dd5dc0eb85d985232da90d54fd031ae4b))
- **getposition:** no error when all placements outside ([249b925](https://github.com/wwayne/react-tooltip/commit/249b925a30ac2e7f04648a20bc9976e85358205b))
- performance issue caused by excessive use of clearTimeout/Interval ([22aea50](https://github.com/wwayne/react-tooltip/commit/22aea5086db47727feae609bb7a6f8e269b7f2de))
- **react18:** tip not hiding with React 18 StrictMode enabled ([83b72c6](https://github.com/wwayne/react-tooltip/commit/83b72c63ea9fe527bcbfb0b85414527e172c970b))
- set aria-describedby value wrong when custom id ([a04d26c](https://github.com/wwayne/react-tooltip/commit/a04d26cc0639054b474ca8b373c95a09b199973a))
- #759 (https://github.com/wwayne/react-tooltip/issues/759) - Disable tooltip when disable prop changes (8e9cca0 (https://github.com/wwayne/react-tooltip/commit/8e9cca016f8eb59036c0c4623b85bf3f465ba262))
- \*aftershow: call afterShow only after state has fully updated (54752e8 (https://github.com/wwayne/react-tooltip/commit/54752e81093f4c41bae1b49f7de65f28cf54df1a))
- effect and type not properly applied at first render (a8d0e51 (https://github.com/wwayne/react-tooltip/commit/a8d0e51dd5dc0eb85d985232da90d54fd031ae4b))
- getposition: no error when all placements outside (249b925 (https://github.com/wwayne/react-tooltip/commit/249b925a30ac2e7f04648a20bc9976e85358205b))
- performance issue caused by excessive use of clearTimeout/Interval (22aea50 (https://github.com/wwayne/react-tooltip/commit/22aea5086db47727feae609bb7a6f8e269b7f2de))
- **react18: tip not hiding with React 18 StrictMode enabled** (83b72c6 (https://github.com/wwayne/react-tooltip/commit/83b72c63ea9fe527bcbfb0b85414527e172c970b))
- set aria-describedby value wrong when custom id (a04d26c (https://github.com/wwayne/react-tooltip/commit/a04d26cc0639054b474ca8b373c95a09b199973a))

### Features

- **component:** adding "padding" property to customize padding style ([9ae765a](https://github.com/wwayne/react-tooltip/commit/9ae765a3cc38b36ce5ea77edd8fcc0f7bd9646a6))
- **getposition:** support desired-place-list (by priority) ([982d89d](https://github.com/wwayne/react-tooltip/commit/982d89d2b9d663ed92d41743f63069d0c8a4aac0))
- **parent_body_mode:** [#535](https://github.com/wwayne/react-tooltip/issues/535) search parents for data-tip if in body mode ([71da348](https://github.com/wwayne/react-tooltip/commit/71da34870163c4377a82b009ac63692e34eeb444))
- **pencil:** readme updated to trigger next minor release (react 18 support release) ([bb9c79e](https://github.com/wwayne/react-tooltip/commit/bb9c79e248918e4b0641b9305752e59019a60a72))
- **pencil:** readme updated to trigger next minor release (react 18 support release) ([3a6ec6c](https://github.com/wwayne/react-tooltip/commit/3a6ec6c1a1c61434532a9350e7ceafe17e8794b9))
- component: adding "padding" property to customize padding style (9ae765a (https://github.com/wwayne/react-tooltip/commit/9ae765a3cc38b36ce5ea77edd8fcc0f7bd9646a6))
- getposition: support desired-place-list (by priority) (982d89d (https://github.com/wwayne/react-tooltip/commit/982d89d2b9d663ed92d41743f63069d0c8a4aac0))
- parent_body_mode: #535 (https://github.com/wwayne/react-tooltip/issues/535) search parents for data-tip if in body mode (71da348 (https://github.com/wwayne/react-tooltip/commit/71da34870163c4377a82b009ac63692e34eeb444))
- pencil: readme updated to trigger next minor release (react 18 support release) (bb9c79e (https://github.com/wwayne/react-tooltip/commit/bb9c79e248918e4b0641b9305752e59019a60a72))
- pencil: readme updated to trigger next minor release (react 18 support release) (3a6ec6c (https://github.com/wwayne/react-tooltip/commit/3a6ec6c1a1c61434532a9350e7ceafe17e8794b9))

# [4.2.21](https://github.com/wwayne/react-tooltip/compare/v4.2.20...v4.2.21) (2021-05-28)

Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

[![Edit ReactTooltip](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/heuristic-curran-bddeu?fontsize=14&hidenavigation=1&theme=dark)

Or see it on [Github Page](https://wwayne.github.io/react-tooltip).
Or see it on [Github Page](https://reacttooltip.github.io/react-tooltip/).

## Installation

Expand Down Expand Up @@ -226,9 +226,11 @@ return(

[alexgurr](https://github.com/alexgurr) Casual maintainer - accepting PRs and doing minor testing/development.

[pdeszynski](https://github.com/pdeszynski) Casual maintainer - accepting PRs and doing minor testing/development.

[aronhelser](https://github.com/aronhelser) Passive maintainer - accepting PRs and doing minor testing, but not fixing issues or doing active development.

[roggervalf](https://github.com/roggervalf) inactive maintainer - no longer seems to be doing development.
[roggervalf](https://github.com/roggervalf) (inactive).

[huumanoid](https://github.com/huumanoid) (inactive)

Expand Down
25 changes: 9 additions & 16 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,17 @@
"name": "react-tooltip",
"description": "react tooltip component",
"main": "standalone/react-tooltip.js",
"moduleType": [
"globals",
"amd",
"node"
],
"moduleType": ["globals", "amd", "node"],
"license": "MIT",
"ignore": [
"bin",
"example"
],
"keywords": [
"react",
"react-component",
"tooltip",
"react-tooltip"
],
"ignore": ["bin", "example"],
"keywords": ["react", "react-component", "tooltip", "react-tooltip"],
"authors": [
"wwayne"
"wwayne",
"danielbarion",
"alexgurr",
"aronhelser",
"roggervalf",
"huumanoid"
],
"homepage": "https://github.com/wwayne/react-tooltip",
"repository": {
Expand Down
66 changes: 34 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "react-tooltip",
"version": "4.3.0",
"description": "react tooltip component",
"private": false,
"main": "dist/index.js",
"types": "dist/react-tooltip.d.ts",
"module": "dist/index.es.js",
Expand All @@ -22,7 +23,7 @@
"build:watch": "rollup -c -w",
"start": "npm-run-all clean build:watch",
"gh-pages": "gh-pages -d example",
"github-changes": "github-changes -o wwayne -r react-tooltip -a --only-pulls --use-commit-body",
"github-changes": "github-changes -o ReactTooltip -r react-tooltip -a --only-pulls --use-commit-body",
"copy:types": "cpy ./react-tooltip.d.ts ./dist --parents --dot",
"cm": "git cz",
"semantic-release": "semantic-release",
Expand All @@ -33,22 +34,19 @@
"path": "node_modules/cz-conventional-changelog"
}
},
"repository": {
"type": "git",
"url": "https://github.com/wwayne/react-tooltip"
},
"repository": "https://github.com/ReactTooltip/react-tooltip",
"keywords": [
"react",
"react-component",
"tooltip",
"react-tooltip"
],
"author": "wwayne",
"author": "ReactTooltip",
"license": "MIT",
"bugs": {
"url": "https://github.com/wwayne/react-tooltip/issues"
"url": "https://github.com/ReactTooltip/react-tooltip/issues"
},
"homepage": "https://github.com/wwayne/react-tooltip#readme",
"homepage": "https://github.com/ReactTooltip/react-tooltip#readme",
"browserify-shim": {
"react": "global:React",
"react-dom": "global:ReactDOM"
Expand All @@ -59,29 +57,33 @@
},
"dependencies": {
"prop-types": "^15.8.1",
"uuid": "^8.3.2"
"uuid": "9.0.0"
},
"devDependencies": {
"@babel/cli": "^7.18.10",
"@babel/core": "^7.18.10",
"@babel/eslint-parser": "^7.18.9",
"@babel/cli": "7.19.3",
"@babel/core": "7.19.3",
"@babel/eslint-parser": "7.19.1",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-decorators": "^7.18.10",
"@babel/plugin-proposal-object-rest-spread": "^7.18.9",
"@babel/plugin-proposal-decorators": "7.19.3",
"@babel/plugin-proposal-json-strings": "^7.18.6",
"@babel/plugin-proposal-object-rest-spread": "7.19.4",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-syntax-import-meta": "^7.10.4",
"@babel/preset-env": "^7.19.4",
"@babel/preset-react": "^7.18.6",
"@babel/register": "^7.18.9",
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@commitlint/travis-cli": "^17.0.3",
"@rollup/plugin-commonjs": "^22.0.1",
"@commitlint/cli": "17.1.2",
"@commitlint/config-conventional": "17.1.0",
"@commitlint/travis-cli": "17.1.2",
"@rollup/plugin-commonjs": "23.0.0",
"@rollup/plugin-node-resolve": "^13.3.0",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/commit-analyzer": "^9.0.2",
"@semantic-release/git": "^10.0.1",
"@semantic-release/npm": "^9.0.1",
"@semantic-release/release-notes-generator": "^10.0.3",
"@svgr/rollup": "^6.3.1",
"@testing-library/react": "^13.3.0",
"@svgr/rollup": "6.4.0",
"@testing-library/react": "13.4.0",
"babel-loader": "8.2.5",
"babelify": "^10.0.0",
"browserify": "^17.0.0",
Expand All @@ -90,35 +92,35 @@
"chai-enzyme": "^1.0.0-beta.1",
"chai-spies": "^1.0.0",
"commitizen": "4.2.5",
"concurrently": "^7.3.0",
"core-js": "^3.24.1",
"cpy-cli": "^4.1.0",
"concurrently": "7.4.0",
"core-js": "3.25.5",
"cpy-cli": "4.2.0",
"cz-conventional-changelog": "^3.3.0",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.6",
"eslint": ">=8.21.0",
"eslint": "8.25.0",
"eslint-config-jss": ">=5.0.1",
"eslint-config-prettier": ">=8.5.0",
"eslint-config-standard": "^17.0.0",
"eslint-config-standard-react": ">=11.0.1",
"eslint-plugin-import": ">=2.26.0",
"eslint-plugin-node": ">=11.1.0",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-promise": ">=6.0.0",
"eslint-plugin-react": ">=7.30.1",
"eslint-plugin-promise": "6.1.0",
"eslint-plugin-react": "7.31.10",
"gh-pages": "4.0.0",
"github-changes": "^2.0.3",
"http-server": "^14.1.1",
"husky": "^8.0.0",
"ignore-styles": "5.0.1",
"jsdom": "^20.0.0",
"jsdom": "20.0.1",
"lint-staged": "^13.0.3",
"mocha": "^10.0.0",
"mocha-each": "^2.0.1",
"mocha-jsdom": "^2.0.0",
"npm-run-all": "^4.1.5",
"postcss-nested": "^5.0.6",
"postcss-scss": "^4.0.4",
"postcss-scss": "4.0.5",
"postcss-simple-vars": "^6.0.3",
"prettier": "2.7.1",
"pretty-quick": "^3.1.3",
Expand All @@ -131,14 +133,14 @@
"rollup-plugin-eslint": "7.0.0",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-sass": "^1.2.13",
"rollup-plugin-sass": "1.12.16",
"rollup-plugin-stylelint": "1.0.0",
"rollup-plugin-url": "^3.0.1",
"sass": "^1.54.1",
"semantic-release": "^19.0.3",
"sass": "1.55.0",
"semantic-release": "19.0.5",
"snazzy": "^9.0.0",
"standard": "^17.0.0",
"stylelint": "14.9.1",
"stylelint": "14.13.0",
"stylelint-config-standard": "26.0.0",
"uglifyjs": "^2.4.10",
"watchify": "^4.0.0"
Expand Down
38 changes: 17 additions & 21 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class ReactTooltip extends React.Component {
* For unify the bind and unbind listener
*/
bind(methodArray) {
methodArray.forEach(method => {
methodArray.forEach((method) => {
this[method] = this[method].bind(this);
});
}
Expand All @@ -158,7 +158,7 @@ class ReactTooltip extends React.Component {
static getDerivedStateFromProps(nextProps, prevState) {
const { ariaProps } = prevState;
const newAriaProps = parseAria(nextProps);
const isChanged = Object.keys(newAriaProps).some(props => {
const isChanged = Object.keys(newAriaProps).some((props) => {
return newAriaProps[props] !== ariaProps[props];
});
if (!isChanged) {
Expand Down Expand Up @@ -254,8 +254,8 @@ class ReactTooltip extends React.Component {

// Scan document for shadow DOM elements
nodeListToArray(document.getElementsByTagName('*'))
.filter(element => element.shadowRoot)
.forEach(element => {
.filter((element) => element.shadowRoot)
.forEach((element) => {
targetArray = targetArray.concat(
nodeListToArray(element.shadowRoot.querySelectorAll(selector))
);
Expand All @@ -273,7 +273,7 @@ class ReactTooltip extends React.Component {
const { id, globalEventOff, isCapture } = this.props;
const targetArray = this.getTargetArray(id);

targetArray.forEach(target => {
targetArray.forEach((target) => {
if (target.getAttribute('currentItem') === null) {
target.setAttribute('currentItem', 'false');
}
Expand All @@ -286,7 +286,7 @@ class ReactTooltip extends React.Component {
if (this.isBodyMode()) {
this.bindBodyListener(targetArray);
} else {
targetArray.forEach(target => {
targetArray.forEach((target) => {
const isCaptureMode = this.isCapture(target);
const effect = this.getEffect(target);
if (this.isCustomEvent(target)) {
Expand Down Expand Up @@ -327,7 +327,7 @@ class ReactTooltip extends React.Component {
this.unbindBodyListener();
} else {
const targetArray = this.getTargetArray(id);
targetArray.forEach(target => {
targetArray.forEach((target) => {
this.unbindBasicListener(target);
if (this.isCustomEvent(target)) this.customUnbindListener(target);
});
Expand Down Expand Up @@ -389,7 +389,7 @@ class ReactTooltip extends React.Component {
if (isGlobalCall) {
// Don't trigger other elements belongs to other ReactTooltip
const targetArray = this.getTargetArray(this.props.id);
const isMyElement = targetArray.some(ele => ele === e.currentTarget);
const isMyElement = targetArray.some((ele) => ele === e.currentTarget);
if (!isMyElement) return;
}
// Get the tooltip content
Expand Down Expand Up @@ -641,7 +641,7 @@ class ReactTooltip extends React.Component {
if (hasTarget) {
// Don't trigger other elements belongs to other ReactTooltip
const targetArray = this.getTargetArray(this.props.id);
const isMyElement = targetArray.some(ele => ele === e.currentTarget);
const isMyElement = targetArray.some((ele) => ele === e.currentTarget);
if (!isMyElement || !this.state.show) return;
}

Expand Down Expand Up @@ -703,14 +703,8 @@ class ReactTooltip extends React.Component {

// Calculation the position
updatePosition(callbackAfter) {
const {
currentEvent,
currentTarget,
place,
desiredPlace,
effect,
offset
} = this.state;
const { currentEvent, currentTarget, place, desiredPlace, effect, offset } =
this.state;
const node = this.tooltipRef;
const result = getPosition(
currentEvent,
Expand Down Expand Up @@ -741,7 +735,9 @@ class ReactTooltip extends React.Component {
});
}

callbackAfter();
if (callbackAfter && typeof callbackAfter === 'function') {
callbackAfter();
}

// Set tooltip position
node.style.left = result.position.left + 'px';
Expand Down Expand Up @@ -773,7 +769,7 @@ class ReactTooltip extends React.Component {
hasCustomColors() {
return Boolean(
Object.keys(this.state.customColors).find(
color => color !== 'border' && this.state.customColors[color]
(color) => color !== 'border' && this.state.customColors[color]
) ||
(this.state.border && this.state.customColors['border'])
);
Expand Down Expand Up @@ -818,7 +814,7 @@ class ReactTooltip extends React.Component {
<Wrapper
className={`${wrapperClassName}`}
id={this.props.id || uuid}
ref={ref => (this.tooltipRef = ref)}
ref={(ref) => (this.tooltipRef = ref)}
{...ariaProps}
data-id="tooltip"
dangerouslySetInnerHTML={{ __html: htmlContent }}
Expand All @@ -830,7 +826,7 @@ class ReactTooltip extends React.Component {
className={`${wrapperClassName}`}
id={this.props.id || uuid}
{...ariaProps}
ref={ref => (this.tooltipRef = ref)}
ref={(ref) => (this.tooltipRef = ref)}
data-id="tooltip"
>
<style
Expand Down
Loading