@dump247/storybook-state
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -12,3 +12,6 @@ import React from 'react'; | ||
<input {...store.state} type="text" onChange={({ target: { value } }) => store.set({ value })}/> | ||
))); | ||
))) | ||
.add('no state', () => ( | ||
<div>No stuff</div> | ||
)); | ||
}, module); |
@@ -111,3 +111,3 @@ 'use strict'; | ||
_this.setState({ storyState: storyState }); | ||
channel.emit('dump247/state/change', storyState); | ||
channel.emit('dump247/state/change', { state: storyState }); | ||
}, _temp), _possibleConstructorReturn(_this, _ret); | ||
@@ -126,3 +126,3 @@ } | ||
channel.on('dump247/state/reset', this.handleResetEvent); | ||
channel.emit('dump247/state/change', store.state); | ||
channel.emit('dump247/state/change', { state: store.state }); | ||
} | ||
@@ -139,2 +139,3 @@ }, { | ||
channel.removeListener('dump247/state/reset', this.handleResetEvent); | ||
channel.emit('dump247/state/change', { state: null }); | ||
} | ||
@@ -141,0 +142,0 @@ }, { |
@@ -73,4 +73,6 @@ 'use strict'; | ||
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = StatePanel.__proto__ || Object.getPrototypeOf(StatePanel)).call.apply(_ref, [this].concat(args))), _this), _this.state = { | ||
storyState: {} | ||
}, _this.handleChangeEvent = function (storyState) { | ||
storyState: null | ||
}, _this.handleChangeEvent = function (_ref2) { | ||
var storyState = _ref2.state; | ||
_this.setState({ storyState: storyState }); | ||
@@ -107,2 +109,6 @@ }, _this.handleResetClick = function () { | ||
if (storyState === null) { | ||
return null; | ||
} | ||
return _react2.default.createElement( | ||
@@ -109,0 +115,0 @@ 'div', |
{ | ||
"name": "@dump247/storybook-state", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Manage component state in storybook stories.", | ||
@@ -10,3 +10,3 @@ "main": "dist/index.js", | ||
"test": "jest", | ||
"storybook": "start-storybook -p 9001 -c .storybook" | ||
"storybook": "npm run build && start-storybook -p 9001 -c .storybook" | ||
}, | ||
@@ -13,0 +13,0 @@ "repository": { |
@@ -60,3 +60,3 @@ import React from 'react'; | ||
channel.on('dump247/state/reset', this.handleResetEvent); | ||
channel.emit('dump247/state/change', store.state); | ||
channel.emit('dump247/state/change', { state: store.state }); | ||
} | ||
@@ -69,2 +69,3 @@ | ||
channel.removeListener('dump247/state/reset', this.handleResetEvent); | ||
channel.emit('dump247/state/change', { state: null }); | ||
} | ||
@@ -82,3 +83,3 @@ | ||
this.setState({ storyState }); | ||
channel.emit('dump247/state/change', storyState); | ||
channel.emit('dump247/state/change', { state: storyState }); | ||
}; | ||
@@ -85,0 +86,0 @@ |
@@ -39,3 +39,3 @@ import React from 'react'; | ||
state = { | ||
storyState: {}, | ||
storyState: null, | ||
}; | ||
@@ -55,3 +55,3 @@ | ||
handleChangeEvent = (storyState) => { | ||
handleChangeEvent = ({ state: storyState }) => { | ||
this.setState({ storyState }); | ||
@@ -69,2 +69,6 @@ }; | ||
if (storyState === null) { | ||
return null; | ||
} | ||
return ( | ||
@@ -71,0 +75,0 @@ <div style={styles.panel}> |
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
203501
5587