Skip to content

Commit

Permalink
Merge branch '5.0.0' into tech/overhaul-ui
Browse files Browse the repository at this point in the history
# Conflicts:
#	addons/a11y/package.json
#	addons/actions/package.json
#	addons/backgrounds/package.json
#	addons/cssresources/package.json
#	addons/events/package.json
#	addons/google-analytics/package.json
#	addons/info/package.json
#	addons/jest/package.json
#	addons/knobs/package.json
#	addons/knobs/src/components/__tests__/Panel.js
#	addons/links/package.json
#	addons/notes/package.json
#	addons/ondevice-backgrounds/package.json
#	addons/ondevice-knobs/package.json
#	addons/ondevice-notes/package.json
#	addons/options/package.json
#	addons/storyshots/storyshots-core/package.json
#	addons/storyshots/storyshots-puppeteer/package.json
#	addons/storysource/package.json
#	addons/viewport/package.json
#	app/react/package.json
#	examples/angular-cli/package.json
#	examples/cra-kitchen-sink/package.json
#	examples/mithril-kitchen-sink/package.json
#	examples/official-storybook/package.json
#	examples/preact-kitchen-sink/package.json
#	lib/addons/package.json
#	lib/channel-websocket/package.json
#	lib/client-logger/src/index.js
#	lib/components/package.json
#	lib/core-events/index.js
#	lib/core/package.json
#	lib/ui/package.json
#	lib/ui/src/modules/ui/components/stories_panel/stories_tree/__snapshots__/index.stories.storyshot
#	lib/ui/src/modules/ui/components/stories_panel/stories_tree/tree_decorators.js
#	lib/ui/src/modules/ui/components/stories_panel/stories_tree/tree_decorators_utils.js
#	lib/ui/src/modules/ui/components/stories_panel/stories_tree/tree_decorators_utils.test.js
#	yarn.lock
  • Loading branch information
ndelangen committed Jan 7, 2019
2 parents 7cacf4b + a199a42 commit 2178a07
Show file tree
Hide file tree
Showing 74 changed files with 1,789 additions and 366 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
## 4.2.0-alpha.10 (January 6, 2019)

### Features

* Addon-a11y: fix addon, add ability to configure context ([#5101](https://github.com/storybooks/storybook/pull/5101))

### Bug Fixes

* Addon-knobs: Render non-grouped knobs in the ALL tab ([#5106](https://github.com/storybooks/storybook/pull/5106))
* Addon-actions: import utils directly to prevent import cycles ([#5107](https://github.com/storybooks/storybook/pull/5107))

### Maintenance

* TypeScript: Migrate @storybook/node-logger ([#5153](https://github.com/storybooks/storybook/pull/5153))
* TypeScript: Migrate @storybook/core-events ([#5140](https://github.com/storybooks/storybook/pull/5140))

### Dependency Upgrades

* bump puppeteer from 1.9.0 to 1.11.0 ([#5119](https://github.com/storybooks/storybook/pull/5119))
* Bump lerna from 3.6.0 to 3.8.4 ([#5142](https://github.com/storybooks/storybook/pull/5142))
* Bump svelte from 2.15.3 to 2.16.0 ([#5145](https://github.com/storybooks/storybook/pull/5145))
* Bump react-dev-utils from 6.1.1 to 7.0.0 ([#5146](https://github.com/storybooks/storybook/pull/5146))
* Bump react-is from 16.6.3 to 16.7.0 ([#5144](https://github.com/storybooks/storybook/pull/5144))

## 4.2.0-alpha.9 (January 4, 2019)

### Bug Fixes
Expand Down
10 changes: 5 additions & 5 deletions addons/a11y/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-a11y",
"version": "4.2.0-alpha.9",
"version": "4.2.0-alpha.10",
"description": "a11y addon for storybook",
"keywords": [
"a11y",
Expand All @@ -26,10 +26,10 @@
},
"dependencies": {
"@emotion/styled": "^10.0.5",
"@storybook/addons": "4.2.0-alpha.9",
"@storybook/client-logger": "4.2.0-alpha.9",
"@storybook/components": "4.2.0-alpha.9",
"@storybook/core-events": "4.2.0-alpha.9",
"@storybook/addons": "4.2.0-alpha.10",
"@storybook/client-logger": "4.2.0-alpha.10",
"@storybook/components": "4.2.0-alpha.10",
"@storybook/core-events": "4.2.0-alpha.10",
"axe-core": "^3.1.2",
"core-js": "^2.6.1",
"global": "^4.3.2",
Expand Down
8 changes: 4 additions & 4 deletions addons/actions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-actions",
"version": "4.2.0-alpha.9",
"version": "4.2.0-alpha.10",
"description": "Action Logger addon for storybook",
"keywords": [
"storybook"
Expand All @@ -22,9 +22,9 @@
"dependencies": {
"@emotion/core": "^10.0.5",
"@emotion/styled": "^10.0.5",
"@storybook/addons": "4.2.0-alpha.9",
"@storybook/components": "4.2.0-alpha.9",
"@storybook/core-events": "4.2.0-alpha.9",
"@storybook/addons": "4.2.0-alpha.10",
"@storybook/components": "4.2.0-alpha.10",
"@storybook/core-events": "4.2.0-alpha.10",
"core-js": "^2.6.1",
"emotion-theming": "^10.0.5",
"fast-deep-equal": "^2.0.1",
Expand Down
10 changes: 5 additions & 5 deletions addons/backgrounds/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-backgrounds",
"version": "4.2.0-alpha.9",
"version": "4.2.0-alpha.10",
"description": "A storybook addon to show different backgrounds for your preview",
"keywords": [
"addon",
Expand All @@ -26,10 +26,10 @@
"dependencies": {
"@emotion/core": "^10.0.5",
"@emotion/styled": "^10.0.5",
"@storybook/addons": "4.2.0-alpha.9",
"@storybook/client-logger": "4.2.0-alpha.9",
"@storybook/components": "4.2.0-alpha.9",
"@storybook/core-events": "4.2.0-alpha.9",
"@storybook/addons": "4.2.0-alpha.10",
"@storybook/client-logger": "4.2.0-alpha.10",
"@storybook/components": "4.2.0-alpha.10",
"@storybook/core-events": "4.2.0-alpha.10",
"core-js": "^2.6.1",
"eventemitter3": "^3.1.0",
"global": "^4.3.2",
Expand Down
2 changes: 1 addition & 1 deletion addons/centered/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-centered",
"version": "4.2.0-alpha.9",
"version": "4.2.0-alpha.10",
"description": "Storybook decorator to center components",
"keywords": [
"addon",
Expand Down
8 changes: 4 additions & 4 deletions addons/cssresources/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-cssresources",
"version": "4.2.0-alpha.9",
"version": "4.2.0-alpha.10",
"description": "A storybook addon to switch between css resources at runtime for your story",
"keywords": [
"addon",
Expand All @@ -25,9 +25,9 @@
},
"dependencies": {
"@emotion/styled": "10.0.5",
"@storybook/addons": "4.2.0-alpha.9",
"@storybook/components": "4.2.0-alpha.9",
"@storybook/core-events": "4.2.0-alpha.9",
"@storybook/addons": "4.2.0-alpha.10",
"@storybook/components": "4.2.0-alpha.10",
"@storybook/core-events": "4.2.0-alpha.10",
"core-js": "^2.6.1",
"global": "^4.3.2",
"prop-types": "^15.6.2",
Expand Down
6 changes: 3 additions & 3 deletions addons/events/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-events",
"version": "4.2.0-alpha.9",
"version": "4.2.0-alpha.10",
"description": "Add events to your Storybook stories.",
"keywords": [
"addon",
Expand All @@ -24,8 +24,8 @@
},
"dependencies": {
"@emotion/styled": "^10.0.5",
"@storybook/addons": "4.2.0-alpha.9",
"@storybook/core-events": "4.2.0-alpha.9",
"@storybook/addons": "4.2.0-alpha.10",
"@storybook/core-events": "4.2.0-alpha.10",
"core-js": "^2.6.1",
"format-json": "^1.0.3",
"prop-types": "^15.6.2",
Expand Down
6 changes: 3 additions & 3 deletions addons/google-analytics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-google-analytics",
"version": "4.2.0-alpha.9",
"version": "4.2.0-alpha.10",
"description": "Storybook addon for google analytics",
"keywords": [
"addon",
Expand All @@ -20,8 +20,8 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "4.2.0-alpha.9",
"@storybook/core-events": "4.2.0-alpha.9",
"@storybook/addons": "4.2.0-alpha.10",
"@storybook/core-events": "4.2.0-alpha.10",
"core-js": "^2.6.1",
"global": "^4.3.2",
"react-ga": "^2.5.3"
Expand Down
2 changes: 1 addition & 1 deletion addons/graphql/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-graphql",
"version": "4.2.0-alpha.9",
"version": "4.2.0-alpha.10",
"description": "Storybook addon to display the GraphiQL IDE",
"keywords": [
"addon",
Expand Down
8 changes: 4 additions & 4 deletions addons/info/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-info",
"version": "4.2.0-alpha.9",
"version": "4.2.0-alpha.10",
"description": "A Storybook addon to show additional information for your stories.",
"keywords": [
"addon",
Expand All @@ -22,9 +22,9 @@
},
"dependencies": {
"@emotion/styled": "^10.0.5",
"@storybook/addons": "4.2.0-alpha.9",
"@storybook/client-logger": "4.2.0-alpha.9",
"@storybook/components": "4.2.0-alpha.9",
"@storybook/addons": "4.2.0-alpha.10",
"@storybook/client-logger": "4.2.0-alpha.10",
"@storybook/components": "4.2.0-alpha.10",
"core-js": "^2.6.1",
"global": "^4.3.2",
"marksy": "^6.1.0",
Expand Down
6 changes: 3 additions & 3 deletions addons/jest/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-jest",
"version": "4.2.0-alpha.9",
"version": "4.2.0-alpha.10",
"description": "React storybook addon that show component jest report",
"keywords": [
"addon",
Expand Down Expand Up @@ -28,8 +28,8 @@
},
"dependencies": {
"@emotion/styled": "^10.0.5",
"@storybook/addons": "4.2.0-alpha.9",
"@storybook/components": "4.2.0-alpha.9",
"@storybook/addons": "4.2.0-alpha.10",
"@storybook/components": "4.2.0-alpha.10",
"core-js": "^2.6.1",
"global": "^4.3.2",
"prop-types": "^15.6.2",
Expand Down
8 changes: 4 additions & 4 deletions addons/knobs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-knobs",
"version": "4.2.0-alpha.9",
"version": "4.2.0-alpha.10",
"description": "Storybook Addon Prop Editor Component",
"keywords": [
"addon",
Expand All @@ -23,9 +23,9 @@
"dependencies": {
"@emotion/core": "^10.0.5",
"@emotion/styled": "^10.0.5",
"@storybook/addons": "4.2.0-alpha.9",
"@storybook/components": "4.2.0-alpha.9",
"@storybook/core-events": "4.2.0-alpha.9",
"@storybook/addons": "4.2.0-alpha.10",
"@storybook/components": "4.2.0-alpha.10",
"@storybook/core-events": "4.2.0-alpha.10",
"copy-to-clipboard": "^3.0.8",
"core-js": "^2.6.1",
"escape-html": "^1.0.3",
Expand Down
33 changes: 28 additions & 5 deletions addons/knobs/src/components/Panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ const PanelWrapper = styled.div({
export default class KnobPanel extends PureComponent {
constructor(props) {
super(props);
this.state = { knobs: {} };
this.state = {
knobs: {},
};
this.options = {};

this.lastEdit = getTimestamp();
Expand Down Expand Up @@ -142,9 +144,9 @@ export default class KnobPanel extends PureComponent {
const groups = {};
const groupIds = [];

let knobsArray = Object.keys(knobs).filter(key => knobs[key].used);
const knobKeysArray = Object.keys(knobs).filter(key => knobs[key].used);

knobsArray
knobKeysArray
.filter(key => knobs[key].groupId)
.forEach(key => {
const knobKeyGroupId = knobs[key].groupId;
Expand All @@ -153,6 +155,8 @@ export default class KnobPanel extends PureComponent {
render: ({ active: groupActive, selected }) => (
<TabWrapper active={groupActive || selected === DEFAULT_GROUP_ID}>
<PropForm
// false positive
// eslint-disable-next-line no-use-before-define
knobs={knobsArray.filter(knob => knob.groupId === knobKeyGroupId)}
onFieldChange={this.handleChange}
onFieldClick={this.handleClick}
Expand All @@ -164,11 +168,30 @@ export default class KnobPanel extends PureComponent {
});

groups[DEFAULT_GROUP_ID] = {
render: () => null,
render: ({ active: groupActive }) => {
// false positive
// eslint-disable-next-line no-use-before-define
const defaultKnobs = knobsArray.filter(
knob => !knob.groupId || knob.groupId === DEFAULT_GROUP_ID
);

if (defaultKnobs.length === 0) {
return null;
}
return (
<TabWrapper active={groupActive}>
<PropForm
knobs={defaultKnobs}
onFieldChange={this.handleChange}
onFieldClick={this.handleClick}
/>
</TabWrapper>
);
},
title: DEFAULT_GROUP_ID,
};

knobsArray = knobsArray.map(key => knobs[key]);
const knobsArray = knobKeysArray.map(key => knobs[key]);

if (knobsArray.length === 0) {
return <Placeholder>NO KNOBS</Placeholder>;
Expand Down
Loading

0 comments on commit 2178a07

Please sign in to comment.