-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Add left panel hierarchy support #1329
Merged
shilman
merged 16 commits into
storybookjs:151-story-hierarchy
from
igor-dv:left-panel-hierarchy
Jun 25, 2017
Merged
Changes from 7 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
a7a3900
Add left panel hierarchy support
ad32ffa
Fix a few related codebeat issues
6960d91
Add more tests for stories.js
3dbdb9e
Better UI for the hierarchy view + bugs fixes
6bfed5d
Merge remote-tracking branch 'origin/master' into left-panel-hierarchy
f27825d
Add shortcut to toggle hierarchy
9b00eb3
Extract hierarchy creation to the mapper
igor-dv 06a4c54
Remove shortcuts for the hierarchy toggling + change leftPanelHierarc…
igor-dv c16cc2d
Rename resolveStoryHierarchyNamespace to resolveStoryHierarchy
igor-dv 3fde529
Fix tests + Add tests for hierarchy
igor-dv 17fb4f5
Fix the cases when the separator is not a "."
igor-dv 87adce4
Add assertions to left_panel.test.js
igor-dv bbf6360
Fix warnings in stories.test.js
igor-dv 1c33fda
Fix tests + Add tests
igor-dv df26718
Remove require.resolve from libs/ui webpack.config.js
igor-dv 21d7173
Remove package-lock.json files
igor-dv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,25 +78,62 @@ export default class ReactProvider extends Provider { | |
this.api = api; | ||
this.api.setOptions({ | ||
name: 'REACT-STORYBOOK', | ||
sortStoriesByKind: true, | ||
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. "breaking"? 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. |
||
leftPanelHierarchy: true | ||
}); | ||
|
||
// set stories | ||
this.api.setStories([ | ||
this.api.setStories(this.createStories()); | ||
|
||
// listen to the story change and update the preview. | ||
this.api.onStory((kind, story) => { | ||
this.globalState.emit('change', kind, story); | ||
}); | ||
} | ||
|
||
createStories() { | ||
return [ | ||
{ | ||
kind: 'Component 1', | ||
kind: 'some.name.Component 1', | ||
stories: ['State 1', 'State 2'], | ||
}, | ||
|
||
{ | ||
kind: 'Component 2', | ||
kind: 'some.name.Component 2', | ||
stories: ['State a', 'State b'], | ||
}, | ||
]); | ||
|
||
// listen to the story change and update the preview. | ||
this.api.onStory((kind, story) => { | ||
this.globalState.emit('change', kind, story); | ||
}); | ||
{ | ||
kind: 'some.name2.Component 3', | ||
stories: ['State a', 'State b'], | ||
}, | ||
{ | ||
kind: 'some.name2', | ||
stories: ['State a', 'State b'], | ||
}, | ||
{ | ||
kind: 'some.name2.Component 4', | ||
stories: ['State a', 'State b'], | ||
}, | ||
{ | ||
kind: 'another.name3.Component 5', | ||
stories: ['State a', 'State b'], | ||
}, | ||
{ | ||
kind: 'another.name3.Component 6', | ||
stories: ['State a', 'State b'], | ||
}, | ||
{ | ||
kind: 'Bla 1', | ||
stories: ['State 1', 'State 2'], | ||
}, | ||
{ | ||
kind: 'Bla 2', | ||
stories: ['State 1', 'State 2'], | ||
}, | ||
{ | ||
kind: 'anotherComponent in the middle', | ||
stories: ['State a', 'State b'], | ||
}, | ||
] | ||
} | ||
|
||
_handlePreviewEvents() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think the order is backwards: Cells.Molecules.Atoms?
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.
possible we could get our existing kitchen-sink stuff and reorganize in a hierarchical way?