Comparing version 1.7.0 to 1.7.1
@@ -251,6 +251,8 @@ 'use strict'; | ||
value: function componentDidMount() { | ||
var isOpen = this.props.isOpen; | ||
var _props = this.props, | ||
isOpen = _props.isOpen, | ||
startAt = _props.startAt; | ||
if (isOpen) { | ||
this.open(); | ||
this.open(startAt); | ||
} | ||
@@ -261,10 +263,10 @@ } | ||
value: function componentWillReceiveProps(nextProps) { | ||
var _props = this.props, | ||
isOpen = _props.isOpen, | ||
update = _props.update, | ||
updateDelay = _props.updateDelay; | ||
var _props2 = this.props, | ||
isOpen = _props2.isOpen, | ||
update = _props2.update, | ||
updateDelay = _props2.updateDelay; | ||
if (!isOpen && nextProps.isOpen) { | ||
this.open(); | ||
this.open(nextProps.startAt); | ||
} else if (isOpen && !nextProps.isOpen) { | ||
@@ -297,8 +299,6 @@ this.close(); | ||
key: 'open', | ||
value: function open() { | ||
value: function open(startAt) { | ||
var _this2 = this; | ||
var _props2 = this.props, | ||
onAfterOpen = _props2.onAfterOpen, | ||
startAt = _props2.startAt; | ||
var onAfterOpen = this.props.onAfterOpen; | ||
@@ -450,3 +450,3 @@ this.setState(function (prevState) { | ||
), | ||
_react2.default.createElement( | ||
(showButtons || showNavigation) && _react2.default.createElement( | ||
_index.Controls, | ||
@@ -453,0 +453,0 @@ null, |
{ | ||
"name": "reactour", | ||
"version": "1.7.0", | ||
"version": "1.7.1", | ||
"description": "Tourist Guide into your React Components", | ||
@@ -8,7 +8,7 @@ "main": "dist/index.js", | ||
"prepare": "npm run lib", | ||
"start": "cross-env NODE_ENV=development webpack-dev-server --hot --inline --config webpack.config.babel.js", | ||
"start": "webpack-dev-server --mode development --open", | ||
"prelib": "rimraf dist", | ||
"lib": "babel --out-dir dist --ignore *.test.js,src/demo src", | ||
"watch": "babel src --watch --out-dir dist --ignore *.test.js,src/demo", | ||
"build": "NODE_ENV=production webpack -p", | ||
"build": "webpack --mode production", | ||
"lint": "eslint --fix ./; exit 0" | ||
@@ -46,4 +46,4 @@ }, | ||
"babel-cli": "6.26.0", | ||
"babel-eslint": "^8.2.2", | ||
"babel-loader": "7.1.2", | ||
"babel-eslint": "8.2.3", | ||
"babel-loader": "7.1.4", | ||
"babel-preset-es2015": "6.24.1", | ||
@@ -53,15 +53,17 @@ "babel-preset-react": "6.24.1", | ||
"babel-register": "6.26.0", | ||
"cross-env": "5.1.3", | ||
"css-loader": "0.28.9", | ||
"css-loader": "0.28.11", | ||
"eslint": "^4.19.1", | ||
"eslint-config-prettier": "^2.9.0", | ||
"eslint-plugin-prettier": "^2.6.0", | ||
"prettier": "^1.12.0", | ||
"react": "16.2.0", | ||
"react-dom": "16.2.0", | ||
"html-loader": "0.5.5", | ||
"html-webpack-plugin": "3.2.0", | ||
"prettier": "1.12.1", | ||
"react": "16.3.2", | ||
"react-dom": "16.3.2", | ||
"reshake": "1.0.8", | ||
"rimraf": "2.6.2", | ||
"style-loader": "0.20.1", | ||
"webpack": "3.10.0", | ||
"webpack-dev-server": "2.11.1" | ||
"style-loader": "0.20.3", | ||
"webpack": "4.5.0", | ||
"webpack-cli": "2.0.14", | ||
"webpack-dev-server": "3.1.3" | ||
}, | ||
@@ -83,3 +85,3 @@ "peerDependencies": { | ||
"lodash.pick": "4.4.0", | ||
"prop-types": "15.6.0", | ||
"prop-types": "15.6.1", | ||
"scroll-smooth": "1.0.1", | ||
@@ -86,0 +88,0 @@ "scrollparent": "2.0.1", |
@@ -11,8 +11,7 @@ <p align="center"> | ||
<p align="center"> | ||
<a href="https://codesandbox.io/s/7kjp4nzv9q?module=%2FApp.js"> | ||
<img src="https://codesandbox.io/static/img/play-codesandbox.svg" alt="dit 7kjp4nzv9q"> | ||
<a href="https://codesandbox.io/s/1ql2n6l9o3?module=%2FApp.js"> | ||
<img src="https://codesandbox.io/static/img/play-codesandbox.svg" alt="Edit 1ql2n6l9o3"> | ||
</a> | ||
</p> | ||
### Install | ||
@@ -60,37 +59,37 @@ | ||
| Prop | Desc | Type | Default | Is Required | | ||
| ----- | ------------- | ----- | ------- | ------ | | ||
| `accentColor` | Change `--reactour-accent` color (helper number + dots) | `string` | `#007aff` | | | ||
| `badgeContent` | Function to customize Badge content `(current, total) => {} ` | `func` | | | | ||
| `className` | Custom class to add to the **helper** | `string` | | | | ||
| `closeWithMask` | Close clicking the **mask** | `bool` | `true` | | | ||
| `disableDotsNavigation` | Isn't possible to interact with helper dots | `bool` | | | | ||
| `disableInteraction` | Isn't possible to interact with highlighted elements | `bool` | | | | ||
| `disableKeyboardNavigation` | Isn't possible to interact with keyboard arrows | `bool` | | | | ||
| `getCurrentStep` | Function triggered each time current step change | `func` | `step => { /* 'step' is the current step index */ }` | | | ||
| `goToStep` | Programmatically change current step | `number` | | | | ||
| `highlightedMaskClassName` | Custom class name for element which is overlaid target element | `string` | | | | ||
| `inViewThreshold` | Scroll element to show when is outiside _viewport_ adding this threshold value | `number` | | | | ||
| `isOpen` | You know… | `bool` | | ✅ | | ||
| `lastStepNextButton` | Change _Next_ button in last step into a custom button to close the _Tour_ | `node` | | | | ||
| `maskClassName` | Custom class to add to the **mask** | `string` | | | | ||
| `maskSpace` | Padding between elemente showed and **mask** | `number` | `10` | | | ||
| `nextButton` | Next navigation button text | `node` | | | | ||
| `nextStep` | Override default `nextStep` function to use a custom one | `func` | | | | ||
| `onAfterOpen` | Function triggered after open | `func` | `() => { document.body.style.overflowY = 'hidden' }` | | | ||
| `onBeforeClose` | Function triggered before close | `func` | `() => { document.body.style.overflowY = 'auto' }` | | | ||
| `onRequestClose` | Function triggered to close | `func` | | | | ||
| `prevButton` | Prev navigation button text | `node` | | | | ||
| `prevStep` | Override default `prevStep` function to use a custom one | `func` | | | | ||
| `rounded` | Beautify helper + mask with border-radius (in px) | `number` | `0` | | | ||
| `scrollDuration` | Smooth scroll duration when positioning the target element | `number` | `1` | | | ||
| `scrollOffset` | Offset when positioning the target element | `number` | calculates the vertical center of the page | | | ||
| `showButtons` | Show **helper** navigation butons | `bool` | `true` | | | ||
| `showNavigation` | Show **helper** navigation dots | `bool` | `true` | | | ||
| `showNavigationNumber` | Show number when hovers on each navigation dots | `bool` | `true` | | | ||
| `showNumber` | Show **helper** number badge | `bool` | `true` | | | ||
| `startAt` | Starting step each time the Tour is open | `number` | | | | ||
| `steps` | Array of steps with info and `props` | [view bellow] | | ✅ | | ||
| `update` | Value to listen if a forced update is needed | `string` | | | | ||
| `updateDelay` | Delay time when forcing update. Useful when there are known animation/transitions | `number` | 1 | | | ||
| Prop | Desc | Type | Default | Is Required | | ||
| --------------------------- | --------------------------------------------------------------------------------- | ------------- | ---------------------------------------------------- | ----------- | | ||
| `accentColor` | Change `--reactour-accent` color (helper number + dots) | `string` | `#007aff` | | | ||
| `badgeContent` | Function to customize Badge content `(current, total) => {}` | `func` | | | | ||
| `className` | Custom class to add to the **helper** | `string` | | | | ||
| `closeWithMask` | Close clicking the **mask** | `bool` | `true` | | | ||
| `disableDotsNavigation` | Isn't possible to interact with helper dots | `bool` | | | | ||
| `disableInteraction` | Isn't possible to interact with highlighted elements | `bool` | | | | ||
| `disableKeyboardNavigation` | Isn't possible to interact with keyboard arrows | `bool` | | | | ||
| `getCurrentStep` | Function triggered each time current step change | `func` | `step => { /* 'step' is the current step index */ }` | | | ||
| `goToStep` | Programmatically change current step | `number` | | | | ||
| `highlightedMaskClassName` | Custom class name for element which is overlaid target element | `string` | | | | ||
| `inViewThreshold` | Scroll element to show when is outiside _viewport_ adding this threshold value | `number` | | | | ||
| `isOpen` | You know… | `bool` | | ✅ | | ||
| `lastStepNextButton` | Change _Next_ button in last step into a custom button to close the _Tour_ | `node` | | | | ||
| `maskClassName` | Custom class to add to the **mask** | `string` | | | | ||
| `maskSpace` | Padding between elemente showed and **mask** | `number` | `10` | | | ||
| `nextButton` | Next navigation button text | `node` | | | | ||
| `nextStep` | Override default `nextStep` function to use a custom one | `func` | | | | ||
| `onAfterOpen` | Function triggered after open | `func` | `() => { document.body.style.overflowY = 'hidden' }` | | | ||
| `onBeforeClose` | Function triggered before close | `func` | `() => { document.body.style.overflowY = 'auto' }` | | | ||
| `onRequestClose` | Function triggered to close | `func` | | | | ||
| `prevButton` | Prev navigation button text | `node` | | | | ||
| `prevStep` | Override default `prevStep` function to use a custom one | `func` | | | | ||
| `rounded` | Beautify helper + mask with border-radius (in px) | `number` | `0` | | | ||
| `scrollDuration` | Smooth scroll duration when positioning the target element | `number` | `1` | | | ||
| `scrollOffset` | Offset when positioning the target element | `number` | calculates the vertical center of the page | | | ||
| `showButtons` | Show **helper** navigation butons | `bool` | `true` | | | ||
| `showNavigation` | Show **helper** navigation dots | `bool` | `true` | | | ||
| `showNavigationNumber` | Show number when hovers on each navigation dots | `bool` | `true` | | | ||
| `showNumber` | Show **helper** number badge | `bool` | `true` | | | ||
| `startAt` | Starting step each time the Tour is open | `number` | | | | ||
| `steps` | Array of steps with info and `props` | [view bellow] | | ✅ | | ||
| `update` | Value to listen if a forced update is needed | `string` | | | | ||
| `updateDelay` | Delay time when forcing update. Useful when there are known animation/transitions | `number` | 1 | | | ||
@@ -120,3 +119,4 @@ ```js | ||
Lorem ipsum <button onClick={() => goTo(4)}>Go to Step 5</button> | ||
<br />{ inDOM && '🎉 Look at your step!'} | ||
<br /> | ||
{inDOM && '🎉 Look at your step!'} | ||
</div> | ||
@@ -123,0 +123,0 @@ ), |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
61529
22
+ Addedprop-types@15.6.1(transitive)
- Removedprop-types@15.6.0(transitive)
Updatedprop-types@15.6.1