-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Story Hierarchy improved UI #1356
Changes from 17 commits
a7a3900
ad32ffa
6960d91
3dbdb9e
6bfed5d
f27825d
9b00eb3
06a4c54
c16cc2d
3fde529
17fb4f5
87adce4
bbf6360
1c33fda
df26718
21d7173
f57a602
dbb04c1
279e198
43ca59b
8262b7b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,3 @@ yarn.lock | |
/**/LICENSE | ||
docs/public | ||
packs/*.tgz | ||
package-lock.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,8 +15,7 @@ module.exports = latestVersion('@storybook/react-native').then(version => { | |
packageJson.devDependencies['@storybook/react-native'] = `^${version}`; | ||
|
||
if (!packageJson.dependencies['react-dom'] && !packageJson.devDependencies['react-dom']) { | ||
const reactVersion = packageJson.dependencies.react; | ||
packageJson.devDependencies['react-dom'] = reactVersion; | ||
packageJson.devDependencies['react-dom'] = '^15.5.4'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. idk what is this ¯\(ツ)/¯ ? Maybe it was somehow merged from the previous PR ? |
||
} | ||
|
||
packageJson.scripts = packageJson.scripts || {}; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ export default { | |
name: 'STORYBOOK', | ||
url: 'https://github.com/storybooks/storybook', | ||
sortStoriesByKind: false, | ||
resolveStoryHierarchy: storyName => [storyName], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess we'll lose a serialized function after passing through the channel.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I'll just change it to be symbol/regex. |
||
}, | ||
}, | ||
load({ clientStore, provider }, _actions) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,13 @@ const mainStyle = { | |
padding: '10px 0 10px 10px', | ||
}; | ||
|
||
const storyProps = ['stories', 'selectedKind', 'selectedStory', 'onSelectStory']; | ||
const storyProps = [ | ||
'storiesHierarchy', | ||
'selectedKind', | ||
'selectedHierarchy', | ||
'selectedStory', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't we need to have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think linter cries that they are not in use in here. these props just passed further to stories.js where they are actually defined in prop types. |
||
'onSelectStory', | ||
]; | ||
|
||
const LeftPanel = props => | ||
<div style={mainStyle}> | ||
|
@@ -26,12 +32,12 @@ const LeftPanel = props => | |
onChange={text => props.onStoryFilter(text)} | ||
/> | ||
<div style={scrollStyle}> | ||
{props.stories ? <Stories {...pick(props, storyProps)} /> : null} | ||
{props.storiesHierarchy ? <Stories {...pick(props, storyProps)} /> : null} | ||
</div> | ||
</div>; | ||
|
||
LeftPanel.defaultProps = { | ||
stories: null, | ||
storiesHierarchy: null, | ||
storyFilter: null, | ||
onStoryFilter: () => {}, | ||
openShortcutsHelp: null, | ||
|
@@ -40,7 +46,11 @@ LeftPanel.defaultProps = { | |
}; | ||
|
||
LeftPanel.propTypes = { | ||
stories: PropTypes.arrayOf(PropTypes.object), | ||
storiesHierarchy: PropTypes.shape({ | ||
namespaces: PropTypes.arrayOf(PropTypes.string), | ||
current: PropTypes.string, | ||
map: PropTypes.object, | ||
}), | ||
storyFilter: PropTypes.string, | ||
onStoryFilter: PropTypes.func, | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm?