@kadira/storybook-addons
Advanced tools
Comparing version 1.6.0 to 1.6.1
@@ -6,2 +6,8 @@ ## Changelog | ||
Revert stuff introduce with v1.6.0. It might break react-native-storybook. | ||
We have [another way](https://github.com/kadirahq/react-storybook/pull/582#issuecomment-256840165) to do what we support to do with preview decorators. | ||
### v1.6.0 | ||
28 Oct 2016 | ||
* Add `setPreviewDecorator` and `getPreviewDecorator` methods. | ||
@@ -8,0 +14,0 @@ * Now following methods can only be set once and they accept an option name as the second argument. |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
"use strict"; | ||
@@ -17,52 +17,44 @@ Object.defineProperty(exports, "__esModule", { | ||
this._panels = {}; | ||
this._store = {}; | ||
this._channel = null; | ||
this._preview = null; | ||
this._database = null; | ||
} | ||
_createClass(AddonStore, [{ | ||
key: 'getPanels', | ||
value: function getPanels() { | ||
return this._panels; | ||
key: "getChannel", | ||
value: function getChannel() { | ||
return this._channel; | ||
} | ||
}, { | ||
key: 'setChannel', | ||
value: function setChannel(channel, name) { | ||
this._set('channel', channel, name); | ||
key: "setChannel", | ||
value: function setChannel(channel) { | ||
this._channel = channel; | ||
} | ||
}, { | ||
key: 'getChannel', | ||
value: function getChannel() { | ||
return this._get('channel'); | ||
key: "getPreview", | ||
value: function getPreview() { | ||
return this._preview; | ||
} | ||
}, { | ||
key: 'setDatabase', | ||
value: function setDatabase(database, name) { | ||
this._set('database', database, name); | ||
key: "setPreview", | ||
value: function setPreview(preview) { | ||
this._preview = preview; | ||
} | ||
}, { | ||
key: 'getDatabase', | ||
key: "getDatabase", | ||
value: function getDatabase() { | ||
return this._get('database'); | ||
return this._database; | ||
} | ||
}, { | ||
key: 'setPreview', | ||
value: function setPreview(preview, name) { | ||
this._set('preview', preview, name); | ||
key: "setDatabase", | ||
value: function setDatabase(database) { | ||
this._database = database; | ||
} | ||
}, { | ||
key: 'getPreview', | ||
value: function getPreview() { | ||
return this._get('preview'); | ||
key: "getPanels", | ||
value: function getPanels() { | ||
return this._panels; | ||
} | ||
}, { | ||
key: 'setPreviewDecorator', | ||
value: function setPreviewDecorator(decorator, name) { | ||
this._set('preview decorator', decorator, name); | ||
} | ||
}, { | ||
key: 'getPreviewDecorator', | ||
value: function getPreviewDecorator() { | ||
return this._get('preview decorator'); | ||
} | ||
}, { | ||
key: 'addPanel', | ||
key: "addPanel", | ||
value: function addPanel(name, panel) { | ||
@@ -72,3 +64,3 @@ this._panels[name] = panel; | ||
}, { | ||
key: 'register', | ||
key: "register", | ||
value: function register(name, loader) { | ||
@@ -78,3 +70,3 @@ this._loaders[name] = loader; | ||
}, { | ||
key: 'loadAddons', | ||
key: "loadAddons", | ||
value: function loadAddons(api) { | ||
@@ -89,21 +81,2 @@ var _this = this; | ||
} | ||
}, { | ||
key: '_set', | ||
value: function _set(key, value, name) { | ||
if (this._store[key]) { | ||
throw new Error('There\'s ' + key + ' called "' + this._store[key].name + '". You can only have a single ' + key + '.'); | ||
} | ||
this._store[key] = { value: value, name: name }; | ||
} | ||
}, { | ||
key: '_get', | ||
value: function _get(key) { | ||
var item = this._store[key]; | ||
if (!item) { | ||
return null; | ||
} | ||
return item.value; | ||
} | ||
}]); | ||
@@ -110,0 +83,0 @@ |
{ | ||
"name": "@kadira/storybook-addons", | ||
"version": "1.6.0", | ||
"version": "1.6.1", | ||
"description": "Storybook addons store", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -5,41 +5,35 @@ export class AddonStore { | ||
this._panels = {}; | ||
this._store = {}; | ||
this._channel = null; | ||
this._preview = null; | ||
this._database = null; | ||
} | ||
getPanels() { | ||
return this._panels; | ||
getChannel() { | ||
return this._channel; | ||
} | ||
setChannel(channel, name) { | ||
this._set('channel', channel, name); | ||
setChannel(channel) { | ||
this._channel = channel; | ||
} | ||
getChannel() { | ||
return this._get('channel'); | ||
getPreview() { | ||
return this._preview; | ||
} | ||
setDatabase(database, name) { | ||
this._set('database', database, name); | ||
setPreview(preview) { | ||
this._preview = preview; | ||
} | ||
getDatabase() { | ||
return this._get('database'); | ||
return this._database; | ||
} | ||
setPreview(preview, name) { | ||
this._set('preview', preview, name); | ||
setDatabase(database) { | ||
this._database = database; | ||
} | ||
getPreview() { | ||
return this._get('preview'); | ||
getPanels() { | ||
return this._panels; | ||
} | ||
setPreviewDecorator(decorator, name) { | ||
this._set('preview decorator', decorator, name); | ||
} | ||
getPreviewDecorator() { | ||
return this._get('preview decorator'); | ||
} | ||
addPanel(name, panel) { | ||
@@ -58,21 +52,4 @@ this._panels[name] = panel; | ||
} | ||
_set(key, value, name) { | ||
if (this._store[key]) { | ||
throw new Error(`There's ${key} called "${this._store[key].name}". You can only have a single ${key}.`); | ||
} | ||
this._store[key] = { value, name }; | ||
} | ||
_get(key) { | ||
const item = this._store[key]; | ||
if (!item) { | ||
return null; | ||
} | ||
return item.value; | ||
} | ||
} | ||
export default new AddonStore(); |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
72318
121