Merge branch 'next' into v5-style-refinements

This commit is contained in:
Norbert de Langen 2019-02-08 09:52:51 +01:00
commit 48e13aa738
30 changed files with 74 additions and 64 deletions

View File

@ -36,7 +36,7 @@
"global": "^4.3.2",
"memoizerific": "^1.11.3",
"prop-types": "^15.6.2",
"react": "^16.7.0",
"react": "^16.8.1",
"react-dom": "^16.7.0",
"util-deprecate": "^1.0.2"
},

View File

@ -30,7 +30,7 @@
"lodash": "^4.17.11",
"make-error": "^1.3.5",
"prop-types": "^15.6.2",
"react": "^16.7.0",
"react": "^16.8.1",
"react-inspector": "^2.3.0",
"uuid": "^3.3.2"
},

View File

@ -34,7 +34,7 @@
"global": "^4.3.2",
"memoizerific": "^1.11.3",
"prop-types": "^15.6.2",
"react": "^16.7.0",
"react": "^16.8.1",
"util-deprecate": "^1.0.2"
},
"publishConfig": {

View File

@ -28,26 +28,27 @@ You need add the all the css resources at compile time using the `withCssResourc
```js
// Import from @storybook/X where X is your framework
import { configure, addDecorator, storiesOf } from '@storybook/react';
import { configure, addDecorator, addParameters, storiesOf } from '@storybook/react';
import { withCssResources } from '@storybook/addon-cssresources';
// global
addDecorator(
withCssResources({
cssresources: [{
id: `bluetheme`,
code: `<style>body { background-color: lightblue; }</style>`,
picked: false,
},
],
})
);
addDecorator(withCssResources)
addParameters({
cssresources: [{
id: `bluetheme`,
code: `<style>body { background-color: lightblue; }</style>`,
picked: false,
},
],
});
You can use the `cssresources` parameter to override resources on each story individually:
// per story
storiesOf('Addons|Cssresources', module)
.addDecorator(
withCssResources({
cssresources: [{
.add('Camera Icon', () => <i className="fa fa-camera-retro"> Camera Icon</i>, {
cssresources: [
{
id: `fontawesome`,
code: `<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"></link>`,
picked: true,
@ -57,7 +58,5 @@ storiesOf('Addons|Cssresources', module)
picked: true,
},
],
})
)
.add('Camera Icon', () => <i className="fa fa-camera-retro"> Camera Icon</i>);
});
```

View File

@ -32,7 +32,7 @@
"core-js": "^2.6.2",
"global": "^4.3.2",
"prop-types": "^15.6.2",
"react": "^16.7.0",
"react": "^16.8.1",
"react-dom": "^16.7.0",
"react-syntax-highlighter": "^8.0.1",
"util-deprecate": "^1.0.2"

View File

@ -1,6 +1,6 @@
import React, { Component, Fragment } from 'react';
import { SyntaxHighlighter } from '@storybook/components';
import Eventtypes, { STORY_CHANGED } from '@storybook/core-events';
import Eventtypes, { STORY_RENDERED } from '@storybook/core-events';
import { EVENTS, PARAM_KEY } from './constants';
import { CssResource } from './CssResource';
@ -32,12 +32,12 @@ export class CssResourcePanel extends Component<CssResourcePanelProps, CssResour
componentDidMount() {
const { api } = this.props;
api.on(STORY_CHANGED, this.onStoryChange);
api.on(STORY_RENDERED, this.onStoryChange);
}
componentWillUnmount() {
const { api } = this.props;
api.off(STORY_CHANGED, this.onStoryChange);
api.off(STORY_RENDERED, this.onStoryChange);
}
onStoryChange = (id: string) => {

View File

@ -29,7 +29,7 @@
"core-js": "^2.6.2",
"format-json": "^1.0.3",
"prop-types": "^15.6.2",
"react": "^16.7.0",
"react": "^16.8.1",
"react-lifecycles-compat": "^3.0.4",
"react-textarea-autosize": "^7.0.4",
"util-deprecate": "^1.0.2"

View File

@ -30,7 +30,7 @@
"marksy": "^6.1.0",
"nested-object-assign": "^1.0.1",
"prop-types": "^15.6.2",
"react": "^16.7.0",
"react": "^16.8.1",
"react-addons-create-fragment": "^15.5.3",
"react-element-to-jsx-string": "^14.0.2",
"react-is": "^16.8.1",

View File

@ -34,7 +34,7 @@
"core-js": "^2.6.2",
"global": "^4.3.2",
"prop-types": "^15.6.2",
"react": "^16.7.0",
"react": "^16.8.1",
"upath": "^1.1.0",
"util-deprecate": "^1.0.2"
},

View File

@ -2,7 +2,7 @@ import * as React from 'react';
import * as PropTypes from 'prop-types';
import { types } from '@storybook/addons';
import { styled } from '@storybook/theming';
import { STORY_CHANGED } from '@storybook/core-events';
import { STORY_RENDERED } from '@storybook/core-events';
import { SyntaxHighlighter as SyntaxHighlighterBase, Placeholder, DocumentFormatting, Link } from '@storybook/components';
import Giphy from './giphy';
@ -75,12 +75,12 @@ export default class NotesPanel extends React.Component<Props, NotesPanelState>
componentDidMount() {
const { api } = this.props;
api.on(STORY_CHANGED, this.onStoryChange);
api.on(STORY_RENDERED, this.onStoryChange);
}
componentWillUnmount() {
const { api } = this.props;
api.off(STORY_CHANGED, this.onStoryChange);
api.off(STORY_RENDERED, this.onStoryChange);
}
onStoryChange = (id: string) => {

View File

@ -34,7 +34,7 @@
},
"devDependencies": {
"enzyme-to-json": "^3.3.4",
"react": "^16.7.0"
"react": "^16.8.1"
},
"publishConfig": {
"access": "public"

View File

@ -31,7 +31,7 @@
"core-js": "^2.6.2",
"fork-ts-checker-webpack-plugin": "^0.5.2",
"global": "^4.3.2",
"react": "^16.7.0",
"react": "^16.8.1",
"react-dom": "^16.7.0",
"regenerator-runtime": "^0.12.1",
"sass-loader": "^7.1.0",

View File

@ -27,7 +27,7 @@
"common-tags": "^1.8.0",
"core-js": "^2.6.2",
"global": "^4.3.2",
"react": "^16.7.0",
"react": "^16.8.1",
"react-dom": "^16.7.0",
"regenerator-runtime": "^0.12.1"
},

View File

@ -29,7 +29,7 @@
"core-js": "^2.6.2",
"global": "^4.3.2",
"html-loader": "^0.5.5",
"react": "^16.7.0",
"react": "^16.8.1",
"react-dom": "^16.7.0",
"regenerator-runtime": "^0.12.1"
},

View File

@ -31,7 +31,7 @@
"global": "^4.3.2",
"marko-loader": "^1.3.3",
"raw-loader": "^1.0.0",
"react": "^16.7.0",
"react": "^16.8.1",
"react-dom": "^16.7.0",
"regenerator-runtime": "^0.12.1"
},

View File

@ -30,7 +30,7 @@
"common-tags": "^1.8.0",
"core-js": "^2.6.2",
"global": "^4.3.2",
"react": "^16.7.0",
"react": "^16.8.1",
"react-dom": "^16.7.0",
"regenerator-runtime": "^0.12.1"
},

View File

@ -29,7 +29,7 @@
"common-tags": "^1.8.0",
"core-js": "^2.6.2",
"global": "^4.3.2",
"react": "^16.7.0",
"react": "^16.8.1",
"react-dom": "^16.7.0",
"regenerator-runtime": "^0.12.1",
"webpack": "^4.29.0"

View File

@ -30,7 +30,7 @@
"common-tags": "^1.8.0",
"core-js": "^2.6.2",
"global": "^4.3.2",
"react": "^16.7.0",
"react": "^16.8.1",
"react-dom": "^16.7.0",
"regenerator-runtime": "^0.12.1"
},

View File

@ -29,7 +29,7 @@
"core-js": "^2.6.2",
"global": "^4.3.2",
"raw-loader": "^1.0.0",
"react": "^16.7.0",
"react": "^16.8.1",
"react-dom": "^16.7.0",
"regenerator-runtime": "^0.12.1"
},

View File

@ -29,7 +29,7 @@
"common-tags": "^1.8.0",
"core-js": "^2.6.2",
"global": "^4.3.2",
"react": "^16.7.0",
"react": "^16.8.1",
"react-dom": "^16.7.0",
"regenerator-runtime": "^0.12.1"
},

View File

@ -29,15 +29,15 @@
"common-tags": "^1.8.0",
"core-js": "^2.6.2",
"global": "^4.3.2",
"react": "^16.7.0",
"react": "^16.8.1",
"react-dom": "^16.7.0",
"regenerator-runtime": "^0.12.1"
},
"devDependencies": {
"babel-preset-vue": "^2.0.2",
"vue": "^2.5.22",
"vue": "^2.6.3",
"vue-loader": "15.6.2",
"vue-template-compiler": "^2.5.22"
"vue-template-compiler": "^2.6.3"
},
"peerDependencies": {
"babel-loader": "^7.0.0 || ^8.0.0",

View File

@ -73,13 +73,13 @@ class MyPanel extends React.Component {
componentDidMount() {
const { api } = this.props;
api.on(STORY_CHANGED, this.onStoryChange);
api.on(STORY_RENDERED, this.onStoryChange);
}
componentWillUnmount() {
const { api } = this.props;
api.off(STORY_CHANGED, this.onStoryChange);
api.off(STORY_RENDERED, this.onStoryChange);
}
onStoryChange = id => {
@ -184,12 +184,12 @@ class MyPanel extends React.Component {
componentDidMount() {
const { api } = this.props;
api.on('foo/doSomeAction', this.onSomeAction);
api.on(STORY_CHANGED, this.onStoryChange);
api.on(STORY_RENDERED this.onStoryChange);
}
componentWillUnmount() {
const { api } = this.props;
api.off('foo/doSomeAction', this.onSomeAction);
api.off(STORY_CHANGED, this.onStoryChange);
api.off(STORY_RENDERED, this.onStoryChange);
}
render() {

View File

@ -13,7 +13,7 @@
"dependencies": {
"global": "^4.3.2",
"prop-types": "^15.6.2",
"react": "^16.7.0",
"react": "^16.8.1",
"react-dom": "^16.7.0",
"react-lifecycles-compat": "^3.0.4"
},

View File

@ -15,7 +15,7 @@
]
},
"dependencies": {
"react": "^16.7.0",
"react": "^16.8.1",
"react-dom": "^16.7.0"
},
"devDependencies": {

View File

@ -47,7 +47,7 @@
"jest-emotion": "^10.0.7",
"paths.macro": "^2.0.2",
"prop-types": "^15.6.2",
"react": "^16.7.0",
"react": "^16.8.1",
"react-dom": "^16.7.0",
"storybook-chromatic": "^1.2.6",
"ts-loader": "^5.3.3",

View File

@ -9,7 +9,7 @@
"storybook": "start-storybook -p 9009 -s public"
},
"dependencies": {
"vue": "^2.5.22",
"vue": "^2.6.3",
"vuex": "^3.1.0"
},
"devDependencies": {

View File

@ -33,7 +33,7 @@
"memoizerific": "^1.11.3",
"polished": "^2.3.3",
"prop-types": "^15.6.2",
"react": "^16.7.0",
"react": "^16.8.1",
"react-dom": "^16.7.0",
"react-focus-lock": "^1.17.7",
"react-helmet-async": "^0.2.0",

View File

@ -45,7 +45,7 @@
"polished": "^2.3.3",
"prop-types": "^15.6.2",
"qs": "^6.5.2",
"react": "^16.7.0",
"react": "^16.8.1",
"react-dom": "^16.7.0",
"react-draggable": "^3.1.1",
"react-helmet-async": "^0.2.0",

View File

@ -124,7 +124,7 @@
"npmlog": "^4.1.2",
"prettier": "^1.16.4",
"raf": "^3.4.0",
"react": "^16.7.0",
"react": "^16.8.1",
"react-dom": "^16.7.0",
"react-test-renderer": "^16.7.0",
"regenerator-runtime": "^0.12.1",

View File

@ -17330,14 +17330,15 @@ react-transition-group@^2.2.1:
prop-types "^15.6.2"
react-lifecycles-compat "^3.0.4"
react@^16.7.0:
version "16.7.0"
resolved "https://registry.yarnpkg.com/react/-/react-16.7.0.tgz#b674ec396b0a5715873b350446f7ea0802ab6381"
react@^16.8.1:
version "16.8.1"
resolved "https://registry.yarnpkg.com/react/-/react-16.8.1.tgz#ae11831f6cb2a05d58603a976afc8a558e852c4a"
integrity sha512-wLw5CFGPdo7p/AgteFz7GblI2JPOos0+biSoxf1FPsGxWQZdN/pj6oToJs1crn61DL3Ln7mN86uZ4j74p31ELQ==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.2"
scheduler "^0.12.0"
scheduler "^0.13.1"
reactcss@^1.2.0:
version "1.2.3"
@ -18513,6 +18514,14 @@ scheduler@^0.12.0:
loose-envify "^1.1.0"
object-assign "^4.1.1"
scheduler@^0.13.1:
version "0.13.1"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.1.tgz#1a217df1bfaabaf4f1b92a9127d5d732d85a9591"
integrity sha512-VJKOkiKIN2/6NOoexuypwSrybx13MY7NSy9RNt8wPvZDMRT1CW6qlpF5jXRToXNHz3uWzbm2elNpZfXfGPqP9A==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
schema-utils@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-0.3.0.tgz#f5877222ce3e931edae039f17eb3716e7137f8cf"
@ -21079,9 +21088,10 @@ vue-style-loader@^4.1.0:
hash-sum "^1.0.2"
loader-utils "^1.0.2"
vue-template-compiler@^2.5.22:
version "2.5.22"
resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.5.22.tgz#c3d3c02c65f1908205c4fbd3b0ef579e51239955"
vue-template-compiler@^2.6.3:
version "2.6.3"
resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.6.3.tgz#fe76b7755b038889f5e887895745f0d2bce3f778"
integrity sha512-SQ3lJk7fwquz8fGac7MwvP9cEBZntokTWITaDrLC0zmyBKjcOfJtWZkMsv+2uSUBDD8kwz8Bsad9xmBWaNULhg==
dependencies:
de-indent "^1.0.2"
he "^1.1.0"
@ -21090,9 +21100,10 @@ vue-template-es2015-compiler@^1.6.0:
version "1.8.1"
resolved "https://registry.yarnpkg.com/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.8.1.tgz#e2ec4f42d16b6c712e61899c6b20bcdb1df128ca"
vue@^2.5.22:
version "2.5.22"
resolved "https://registry.yarnpkg.com/vue/-/vue-2.5.22.tgz#3bf88041af08b8539c37b268b70ca79245e9cc30"
vue@^2.6.3:
version "2.6.3"
resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.3.tgz#180017ba25b94a9864b2921db8644e1062ea82a0"
integrity sha512-yftjtahz4UTAtOlXXuw7UaYD86fWrMDAAzqTdqJJx2FIBqcPmBN6kPBHiBJFGaQELVblb5ijbFMXsx0i0F7q3g==
vuex@^3.1.0:
version "3.1.0"