Skip to content

Commit

Permalink
Merge branch 'next' 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/links/package.json
#	addons/notes/package.json
#	addons/storyshots/storyshots-core/package.json
#	addons/viewport/package.json
#	app/react/package.json
#	examples/cra-kitchen-sink/package.json
#	examples/official-storybook/package.json
#	examples/official-storybook/stories/addon-info.stories.js
#	lib/addons/package.json
#	lib/channel-websocket/package.json
#	lib/core/package.json
#	lib/ui/package.json
  • Loading branch information
ndelangen committed Dec 13, 2018
2 parents 2fae294 + 9d23c3d commit 6285702
Show file tree
Hide file tree
Showing 74 changed files with 984 additions and 514 deletions.
2 changes: 1 addition & 1 deletion .babelrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
presets: [
['@babel/preset-env', { shippedProposals: true, useBuiltIns: 'usage', modules: false }],
['@babel/preset-env', { shippedProposals: true, useBuiltIns: 'usage' }],
'@babel/preset-react',
'@babel/preset-flow',
],
Expand Down
56 changes: 56 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,59 @@
## 4.2.0-alpha.1 (December 12, 2018)

Fixes 4.2.0-alpha.0

### Features

* Addon-info: add forwardRef support ([#4961](https://github.com/storybooks/storybook/pull/4961))

### Bug Fixes

* Addon-knobs: Add missing key property in Panel ([#4507](https://github.com/storybooks/storybook/pull/4507))

### Maintenance

* Addon-notes: Migrated to TypeScript ([#4758](https://github.com/storybooks/storybook/pull/4758))

### Dependency Upgrades

* Fix: Add missing peer dependencies to addon-knobs ([#4928](https://github.com/storybooks/storybook/pull/4928))

## 4.2.0-alpha.0 (December 12, 2018)

Bad release

## 4.1.1 (December 12, 2018)

### Bug Fixes

* FIX react native by adding an empty array named dlls to the templateParameters ([#4985](https://github.com/storybooks/storybook/pull/4985))

## 4.1.0 (December 12, 2018)

Storybook 4.1 with performance and compatibility improvements! Highlights include:

* Core: Performance optimizations on separate manager preview split, improved cold start, restart & rebuild ([#4834](https://github.com/storybooks/storybook/pull/4834))
* React: add support for all versions of react ([#4808](https://github.com/storybooks/storybook/pull/4808))
* Addon-CSSResources: new adddon to dynamically add/remove css ([#4622](https://github.com/storybooks/storybook/pull/4622))
* React: use babel presets/plugins based on CRA. ([#4836](https://github.com/storybooks/storybook/pull/4836))
* React-native: Add ability to filter story list ([#4806](https://github.com/storybooks/storybook/pull/4806))
* React: Add TypeScript support for react-scripts ([#4824](https://github.com/storybooks/storybook/pull/4824))

There are dozens more fixes, features, and tweaks in the 4.1 release. See changelogs for `4.1.0-*` for details.

## 4.1.0-alpha.13 (December 12, 2018)

### Maintenance

* React-native: add core-js to addons ([#4981](https://github.com/storybooks/storybook/pull/4981))

## 4.1.0-alpha.12 (December 11, 2018)

### Bug Fixes

* Fix storyshots by compiling JS modules ([#4967](https://github.com/storybooks/storybook/pull/4967))
* Angular: move 'core-js/modules/es6.promise' into storyshots ([#4929](https://github.com/storybooks/storybook/pull/4929))

## 4.0.12 (December 5, 2018)

### Bug Fixes
Expand Down
15 changes: 6 additions & 9 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.1.0-alpha.11",
"version": "4.2.0-alpha.1",
"description": "a11y addon for storybook",
"keywords": [
"a11y",
Expand All @@ -26,21 +26,18 @@
},
"dependencies": {
"@emotion/styled": "^10.0.2",
"@storybook/addons": "4.1.0-alpha.11",
"@storybook/client-logger": "4.1.0-alpha.11",
"@storybook/components": "4.1.0-alpha.11",
"@storybook/core-events": "4.1.0-alpha.11",
"@storybook/addons": "4.2.0-alpha.1",
"@storybook/client-logger": "4.2.0-alpha.1",
"@storybook/components": "4.2.0-alpha.1",
"@storybook/core-events": "4.2.0-alpha.1",
"axe-core": "^3.1.2",
"core-js": "^2.5.7",
"react": "^16.7.0-alpha.2",
"react-dom": "^16.7.0-alpha.2",
"global": "^4.3.2",
"memoizerific": "^1.11.3",
"prop-types": "^15.6.2"
},
"peerDependencies": {
"react": "*",
"react-dom": "*"
},
"publishConfig": {
"access": "public"
}
Expand Down
12 changes: 5 additions & 7 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.1.0-alpha.11",
"version": "4.2.0-alpha.1",
"description": "Action Logger addon for storybook",
"keywords": [
"storybook"
Expand All @@ -22,9 +22,10 @@
"dependencies": {
"@emotion/core": "^10.0.2",
"@emotion/styled": "^10.0.2",
"@storybook/addons": "4.1.0-alpha.11",
"@storybook/components": "4.1.0-alpha.11",
"@storybook/core-events": "4.1.0-alpha.11",
"@storybook/addons": "4.2.0-alpha.1",
"@storybook/components": "4.2.0-alpha.1",
"@storybook/core-events": "4.2.0-alpha.1",
"core-js": "^2.5.7",
"emotion-theming": "^10.0.2",
"fast-deep-equal": "^2.0.1",
"global": "^4.3.2",
Expand All @@ -35,9 +36,6 @@
"react-inspector": "^2.3.0",
"uuid": "^3.3.2"
},
"peerDependencies": {
"react": "*"
},
"publishConfig": {
"access": "public"
}
Expand Down
12 changes: 5 additions & 7 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.1.0-alpha.11",
"version": "4.2.0-alpha.1",
"description": "A storybook addon to show different backgrounds for your preview",
"keywords": [
"addon",
Expand All @@ -26,19 +26,17 @@
"dependencies": {
"@emotion/core": "^10.0.2",
"@emotion/styled": "^10.0.2",
"@storybook/addons": "4.1.0-alpha.11",
"@storybook/components": "4.1.0-alpha.11",
"@storybook/core-events": "4.1.0-alpha.11",
"@storybook/addons": "4.2.0-alpha.1",
"@storybook/components": "4.2.0-alpha.1",
"@storybook/core-events": "4.2.0-alpha.1",
"core-js": "^2.5.7",
"eventemitter3": "^3.1.0",
"global": "^4.3.2",
"memoizerific": "^1.11.3",
"prop-types": "^15.6.2",
"react": "^16.7.0-alpha.2",
"util-deprecate": "^1.0.2"
},
"peerDependencies": {
"react": "*"
},
"publishConfig": {
"access": "public"
}
Expand Down
3 changes: 2 additions & 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.1.0-alpha.11",
"version": "4.2.0-alpha.1",
"description": "Storybook decorator to center components",
"keywords": [
"addon",
Expand All @@ -22,6 +22,7 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"core-js": "^2.5.7",
"global": "^4.3.2"
},
"publishConfig": {
Expand Down
9 changes: 5 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.1.0-alpha.11",
"version": "4.2.0-alpha.1",
"description": "A storybook addon to switch between css resources at runtime for your story",
"keywords": [
"addon",
Expand All @@ -25,9 +25,10 @@
},
"dependencies": {
"@emotion/styled": "10.0.2",
"@storybook/addons": "4.1.0-alpha.11",
"@storybook/components": "4.1.0-alpha.11",
"@storybook/core-events": "4.1.0-alpha.11",
"@storybook/addons": "4.2.0-alpha.1",
"@storybook/components": "4.2.0-alpha.1",
"@storybook/core-events": "4.2.0-alpha.1",
"core-js": "^2.5.7",
"global": "^4.3.2",
"prop-types": "^15.6.2",
"react": "^16.7.0-alpha.2",
Expand Down
7 changes: 4 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.1.0-alpha.11",
"version": "4.2.0-alpha.1",
"description": "Add events to your Storybook stories.",
"keywords": [
"addon",
Expand All @@ -24,8 +24,9 @@
},
"dependencies": {
"@emotion/styled": "^10.0.2",
"@storybook/addons": "4.1.0-alpha.11",
"@storybook/core-events": "4.1.0-alpha.11",
"@storybook/addons": "4.2.0-alpha.1",
"@storybook/core-events": "4.2.0-alpha.1",
"core-js": "^2.5.7",
"format-json": "^1.0.3",
"prop-types": "^15.6.2",
"react": "^16.7.0-alpha.2",
Expand Down
7 changes: 4 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.1.0-alpha.11",
"version": "4.2.0-alpha.1",
"description": "Storybook addon for google analytics",
"keywords": [
"addon",
Expand All @@ -20,8 +20,9 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "4.1.0-alpha.11",
"@storybook/core-events": "4.1.0-alpha.11",
"@storybook/addons": "4.2.0-alpha.1",
"@storybook/core-events": "4.2.0-alpha.1",
"core-js": "^2.5.7",
"global": "^4.3.2",
"react-ga": "^2.5.3"
},
Expand Down
3 changes: 2 additions & 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.1.0-alpha.11",
"version": "4.2.0-alpha.1",
"description": "Storybook addon to display the GraphiQL IDE",
"keywords": [
"addon",
Expand All @@ -21,6 +21,7 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"core-js": "^2.5.7",
"global": "^4.3.2",
"graphiql": "^0.12.0",
"graphql": "^14.0.2",
Expand Down
2 changes: 1 addition & 1 deletion addons/info/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ npm i -D @storybook/addon-info

## Basic usage

Then, add `withInfo` as a decarator to your book of stories.
Then, add `withInfo` as a decorator to your book of stories.
It is possible to add `info` by default to all or a subsection of stories by using a global or story decorator.

It is important to declare this decorator as **the first decorator**, otherwise it won't work well.
Expand Down
10 changes: 6 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.1.0-alpha.11",
"version": "4.2.0-alpha.1",
"description": "A Storybook addon to show additional information for your stories.",
"keywords": [
"addon",
Expand All @@ -22,16 +22,18 @@
},
"dependencies": {
"@emotion/styled": "^10.0.2",
"@storybook/addons": "4.1.0-alpha.11",
"@storybook/client-logger": "4.1.0-alpha.11",
"@storybook/components": "4.1.0-alpha.11",
"@storybook/addons": "4.2.0-alpha.1",
"@storybook/client-logger": "4.2.0-alpha.1",
"@storybook/components": "4.2.0-alpha.1",
"core-js": "^2.5.7",
"global": "^4.3.2",
"marksy": "^6.1.0",
"nested-object-assign": "^1.0.1",
"prop-types": "^15.6.2",
"react": "^16.7.0-alpha.2",
"react-addons-create-fragment": "^15.5.3",
"react-element-to-jsx-string": "^14.0.2",
"react-is": "^16.6.1",
"react-lifecycles-compat": "^3.0.4",
"util-deprecate": "^1.0.2"
},
Expand Down
38 changes: 38 additions & 0 deletions addons/info/src/components/Node.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import { isForwardRef } from 'react-is';
import PropTypes from 'prop-types';
import Props from './Props';

Expand Down Expand Up @@ -72,6 +73,43 @@ export default function Node(props) {
);
}

if (isForwardRef(node)) {
const childElement = node.type.render(node.props);
return (
<div>
<div style={containerStyleCopy}>
<span style={tagStyle}>
&lt;
{`ForwardRef`}
</span>
<Props
node={node}
maxPropsIntoLine={maxPropsIntoLine}
maxPropObjectKeys={maxPropObjectKeys}
maxPropArrayLength={maxPropArrayLength}
maxPropStringLength={maxPropStringLength}
/>
<span style={tagStyle}>&gt;</span>
</div>
<Node
node={childElement}
depth={depth + 1}
maxPropsIntoLine={maxPropsIntoLine}
maxPropObjectKeys={maxPropObjectKeys}
maxPropArrayLength={maxPropArrayLength}
maxPropStringLength={maxPropStringLength}
/>
<div style={containerStyleCopy}>
<span style={tagStyle}>
&lt;/
{`ForwardRef`}
&gt;
</span>
</div>
</div>
);
}

// Single-line tag
if (!children) {
return (
Expand Down
5 changes: 5 additions & 0 deletions addons/info/src/components/Story.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint no-underscore-dangle: 0 */

import React, { Component, createElement } from 'react';
import { isForwardRef } from 'react-is';
import { polyfill } from 'react-lifecycles-compat';
import PropTypes from 'prop-types';
import global from 'global';
Expand Down Expand Up @@ -326,9 +327,13 @@ class Story extends Component {
if (innerChildren.props && innerChildren.props.children) {
extract(innerChildren.props.children);
}
if (isForwardRef(innerChildren)) {
extract(innerChildren.type.render(innerChildren.props));
}
if (
typeof innerChildren === 'string' ||
typeof innerChildren.type === 'string' ||
isForwardRef(innerChildren) ||
(Array.isArray(propTablesExclude) && // also ignore excluded types
~propTablesExclude.indexOf(innerChildren.type)) // eslint-disable-line no-bitwise
) {
Expand Down
7 changes: 4 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.1.0-alpha.11",
"version": "4.2.0-alpha.1",
"description": "React storybook addon that show component jest report",
"keywords": [
"addon",
Expand Down Expand Up @@ -28,8 +28,9 @@
},
"dependencies": {
"@emotion/styled": "^10.0.2",
"@storybook/addons": "4.1.0-alpha.11",
"@storybook/components": "4.1.0-alpha.11",
"@storybook/addons": "4.2.0-alpha.1",
"@storybook/components": "4.2.0-alpha.1",
"core-js": "^2.5.7",
"global": "^4.3.2",
"prop-types": "^15.6.2",
"react": "^16.7.0-alpha.2",
Expand Down
Loading

0 comments on commit 6285702

Please sign in to comment.