storybook-addon-react-live-edit
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -22,2 +22,11 @@ 'use strict'; | ||
var _withLiveEdit = require('./withLiveEdit'); | ||
Object.defineProperty(exports, 'withLiveEdit', { | ||
enumerable: true, | ||
get: function get() { | ||
return _interopRequireDefault(_withLiveEdit).default; | ||
} | ||
}); | ||
var _withLiveEditScope = require('./withLiveEditScope'); | ||
@@ -24,0 +33,0 @@ |
@@ -14,5 +14,5 @@ 'use strict'; | ||
context[_constants.symbol.Scope] = _extends({}, context[_constants.symbol.Scope], scope); | ||
return story(); | ||
return story(context); | ||
}; | ||
}; | ||
//# sourceMappingURL=withLiveEditScope.js.map |
{ | ||
"name": "storybook-addon-react-live-edit", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "storybook.js addon providing live react story editing and preview", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -61,2 +61,11 @@ # storybook-addon-react-live-edit | ||
> or | ||
You can use `withLiveEdit` story creator | ||
```javascript | ||
storiesOf("Demo", module) | ||
.add('demo', withLiveEdit(`render(<div>{scopeTest}</div>)`)); | ||
``` | ||
## API | ||
@@ -76,2 +85,14 @@ | ||
### `withLiveEdit` | ||
``` | ||
withLiveEdit(source[, scope]) | ||
``` | ||
- `source` (string, required) - story source to be rendered in preview and | ||
available for editing in "Live edit" panel | ||
- `scope` (object, optional) - variables provided to rendered story, | ||
these can be additional components, utilities or any other data. | ||
Scope is merged with all variables previously provided | ||
by `withLiveEditScope` decorators. | ||
### `withLiveEditScope` decorator | ||
@@ -78,0 +99,0 @@ ``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
41744
27
360
111