@storybook/addon-notes
Advanced tools
Comparing version 4.0.0-alpha.1 to 4.0.0-alpha.2
@@ -8,2 +8,6 @@ 'use strict'; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _utilDeprecate = require('util-deprecate'); | ||
@@ -25,7 +29,7 @@ | ||
var withMarkdownNotes = exports.withMarkdownNotes = function withMarkdownNotes(text) { | ||
var withMarkdownNotes = exports.withMarkdownNotes = function withMarkdownNotes(text, options) { | ||
var channel = _addons2.default.getChannel(); | ||
return function (getStory) { | ||
return function (context) { | ||
_marked2.default.setOptions((0, _extends3.default)({}, _marked2.default.defaults, { options: options })); | ||
// send the notes to the channel before the story is rendered | ||
@@ -32,0 +36,0 @@ channel.emit('storybook/notes/add_notes', (0, _marked2.default)(text)); |
{ | ||
"name": "@storybook/addon-notes", | ||
"version": "4.0.0-alpha.1", | ||
"version": "4.0.0-alpha.2", | ||
"description": "Write notes for your Storybook stories.", | ||
@@ -23,2 +23,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@storybook/addons": "4.0.0-alpha.2", | ||
"babel-runtime": "^6.26.0", | ||
@@ -30,9 +31,8 @@ "marked": "^0.3.19", | ||
"devDependencies": { | ||
"@storybook/react": "4.0.0-alpha.1", | ||
"@types/react": "^16.1.0" | ||
"@storybook/react": "4.0.0-alpha.2", | ||
"@types/react": "^16.3.5" | ||
}, | ||
"peerDependencies": { | ||
"@storybook/addons": "^3.3.0", | ||
"react": "*" | ||
} | ||
} |
@@ -6,6 +6,6 @@ import deprecate from 'util-deprecate'; | ||
export const withMarkdownNotes = text => { | ||
export const withMarkdownNotes = (text, options) => { | ||
const channel = addons.getChannel(); | ||
return getStory => context => { | ||
marked.setOptions({ ...marked.defaults, options }); | ||
// send the notes to the channel before the story is rendered | ||
@@ -12,0 +12,0 @@ channel.emit('storybook/notes/add_notes', marked(text)); |
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
177473
343
+ Added@storybook/addons@4.0.0-alpha.2(transitive)
+ Added@storybook/channels@4.0.0-alpha.2(transitive)
+ Addeddom-walk@0.1.2(transitive)
+ Addedglobal@4.4.0(transitive)
+ Addedmin-document@2.19.0(transitive)
+ Addedprocess@0.11.10(transitive)
- Removed@storybook/addons@3.4.12(transitive)