Skip to content

Commit 1bc4630

Browse files
committed
v0.7.5
1 parent 70f9cef commit 1bc4630

File tree

3 files changed

+7
-33
lines changed

3 files changed

+7
-33
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "storybook-adk",
3-
"version": "0.7.4",
3+
"version": "0.7.5",
44
"description": "React Storybook Addon Development Kit",
55
"main": "dist/index.js",
66
"scripts": {

src/register.js

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import initStore, { ENQ_ASK } from './store/store';
44
import initComposer from './store/composer';
55
import { ADDON_ID, PANEL_ID, ADDON_TITLE, CSS_CLASS } from './';
66

7-
//const defaults = {
7+
// const defaults = {
88
// initData: 'Panel',
99
// defaultData: {},
1010
// api: {},
@@ -13,7 +13,7 @@ import { ADDON_ID, PANEL_ID, ADDON_TITLE, CSS_CLASS } from './';
1313
// PANEL_ID,
1414
// ADDON_TITLE,
1515
// CSS_CLASS,
16-
//};
16+
// };
1717

1818
export default function (addonSettings, onRegister) {
1919
const settings = addonSettings.config;
@@ -26,9 +26,10 @@ export default function (addonSettings, onRegister) {
2626
const PanelContainer = initComposer(addonStoreEnv);
2727
const getID = () => `pd${Math.round(Math.random() * 100)}`;
2828
const addonPanel = addonSettings.render ? addonSettings.render(addonStoreEnv) : null;
29-
const addonDisabled = addonSettings.renderDisabled ? addonSettings.renderDisabled(addonStoreEnv) : null;
29+
const addonDisabled = addonSettings.renderDisabled ?
30+
addonSettings.renderDisabled(addonStoreEnv) : null;
3031
const addonRender = addonPanel || addonDisabled || null;
31-
32+
3233
if (addonRender) {
3334
addons.addPanel(settings.PANEL_ID, {
3435
title: settings.ADDON_TITLE,
@@ -39,24 +40,14 @@ export default function (addonSettings, onRegister) {
3940
initData={addonSettings.initData}
4041
rootProps={{ enquiry: ENQ_ASK, ID: getID() }}
4142
addonRender={addonPanel()}
42-
addonRenderDisabled={addonDisabled ? addonDisabled() : () => {}}
43+
addonRenderDisabled={addonDisabled ? addonDisabled() : null}
4344
style={{ width: '100%' }}
4445
className={`${settings.CSS_CLASS}-panel`}
4546
onChannelInit={addonSettings.onChannelInit || null}
4647
/>),
4748
});
4849
}
49-
// else {
50-
// addons.addPanel('no', {
51-
// title: 'no',
52-
// render: () => {
53-
// if (onRegister) onRegister(addonStoreEnv);
54-
// return null
55-
// }
56-
// });
57-
// }
5850

5951
if (onRegister) onRegister(addonStoreEnv);
60-
6152
});
6253
}

src/store/decorator.jsx

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -79,25 +79,8 @@ class AddonManager {
7979
this.storesMap[key] = store;
8080
}
8181

82-
// storeCheckout(context, keyPref) {
83-
// const key = `${keyPref}::${context.kind}`;
84-
// const currentStore = this.storesMap[key] || initStore(
85-
// this.defaultData,
86-
// this.addonApi,
87-
// this.setConfig,
88-
// );
89-
// this.fireSubscriptions(currentStore);
90-
// return currentStore;
91-
// }
92-
93-
94-
9582
}
9683

97-
//const addonManager = new AddonManager();
98-
//
99-
//export { addonManager };
100-
10184
const decorStoresMap = {};
10285

10386
function newStore() {

0 commit comments

Comments
 (0)