Skip to content

Commit

Permalink
Merge pull request #22 from kadirahq/custom-panels
Browse files Browse the repository at this point in the history
Support custom panels with addons
  • Loading branch information
Muhammed Thanish authored Aug 2, 2016
2 parents 865bec0 + c983c0b commit 765becf
Show file tree
Hide file tree
Showing 30 changed files with 435 additions and 617 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ import { Provider } from '@kadira/storybook-ui';
import React from 'react';

export default class MyProvider extends Provider {
getPanels() {
return {};
}

renderPreview() {
return (
<p>This is the Preview</p>
Expand Down
17 changes: 1 addition & 16 deletions dist/modules/api/actions/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,9 @@ exports.default = {
direction: direction
});
},
clearActions: function clearActions(_ref4) {
setOptions: function setOptions(_ref4, options) {
var reduxStore = _ref4.reduxStore;

reduxStore.dispatch({
type: _.types.CLEAR_ACTIONS
});
},
addAction: function addAction(_ref5, action) {
var reduxStore = _ref5.reduxStore;

reduxStore.dispatch({
type: _.types.ADD_ACTION,
action: action
});
},
setOptions: function setOptions(_ref6, options) {
var reduxStore = _ref6.reduxStore;

reduxStore.dispatch({
type: _.types.SET_OPTIONS,
options: options
Expand Down
2 changes: 0 additions & 2 deletions dist/modules/api/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ var types = exports.types = {
SET_STORIES: 'API_SET_STORIES',
SELECT_STORY: 'API_SELECT_STORY',
JUMP_TO_STORY: 'API_JUMP_TO_STORY',
CLEAR_ACTIONS: 'API_CLEAR_ACTIONS',
ADD_ACTION: 'API_ADD_ACTION',
SET_OPTIONS: 'API_SET_OPTIONS'
};

Expand Down
1 change: 0 additions & 1 deletion dist/modules/api/configs/init_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ exports.default = function (provider, reduxStore, actions) {
},


addAction: actions.api.addAction,
setStories: actions.api.setStories,
selectStory: actions.api.selectStory,
setOptions: actions.api.setOptions,
Expand Down
29 changes: 0 additions & 29 deletions dist/modules/api/configs/reducers/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ Object.defineProperty(exports, "__esModule", {
value: true
});

var _toConsumableArray2 = require('babel-runtime/helpers/toConsumableArray');

var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);

var _extends2 = require('babel-runtime/helpers/extends');

var _extends3 = _interopRequireDefault(_extends2);
Expand Down Expand Up @@ -44,13 +40,6 @@ exports.default = function () {
});
}

case _actions.types.CLEAR_ACTIONS:
{
return (0, _extends3.default)({}, state, {
actions: []
});
}

case _actions.types.SET_STORIES:
{
var newState = (0, _extends3.default)({}, state, {
Expand All @@ -63,24 +52,6 @@ exports.default = function () {
return newState;
}

case _actions.types.ADD_ACTION:
{
var previewAction = (0, _extends3.default)({}, action.action);
var actions = [].concat((0, _toConsumableArray3.default)(state.actions || []));

var lastAction = actions.length > 0 && actions[0];
if (lastAction && (0, _deepEqual2.default)(lastAction.data, previewAction.data)) {
lastAction.count++;
} else {
previewAction.count = 1;
actions.unshift(previewAction);
}

return (0, _extends3.default)({}, state, {
actions: actions
});
}

case _actions.types.SET_OPTIONS:
{
var newOptions = (0, _extends3.default)({}, state.options, action.options);
Expand Down
190 changes: 0 additions & 190 deletions dist/modules/ui/components/action_logger/index.js

This file was deleted.

Loading

0 comments on commit 765becf

Please sign in to comment.