diff --git a/CHANGELOG.md b/CHANGELOG.md
index 617b46d196b..2d6205b3f6a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,49 @@
+## 6.0.0-alpha.39 (April 18, 2020)
+
+### Breaking Changes
+
+- Addon-docs: Inline stories in Vue by default ([#10463](https://github.com/storybookjs/storybook/pull/10463))
+
+### Features
+
+- Addon-docs: Provide better props include/exclude features ([#10464](https://github.com/storybookjs/storybook/pull/10464))
+- UI: Improve loading state ([#10444](https://github.com/storybookjs/storybook/pull/10444))
+
+### Bug Fixes
+
+- UI: Fix bad shortcutpage layout ([#10445](https://github.com/storybookjs/storybook/pull/10445))
+
+## 6.0.0-alpha.38 (April 18, 2020)
+
+Failed publish
+
+## 6.0.0-alpha.37 (April 17, 2020)
+
+### Features
+
+- Addon-actions: Make arg auto-generation more aggressive ([#10451](https://github.com/storybookjs/storybook/pull/10451))
+
+### Maintenance
+
+- Examples: Format stringified parameters ([#10435](https://github.com/storybookjs/storybook/pull/10435))
+
+### Dependency Upgrades
+
+- Bump recast from 0.16.2 to 0.19.0 ([#10415](https://github.com/storybookjs/storybook/pull/10415))
+
+## 6.0.0-alpha.36 (April 16, 2020)
+
+### Bug Fixes
+
+- Server: Fix serialization of knobs params back to server ([#10391](https://github.com/storybookjs/storybook/pull/10391))
+- Core: Serve correctly hashed static files with the Cache-Control header ([#10390](https://github.com/storybookjs/storybook/pull/10390))
+- Addon-a11y: Fix default a11y parameters ([#10439](https://github.com/storybookjs/storybook/pull/10439))
+- Core: Fix event source handling ([#10416](https://github.com/storybookjs/storybook/pull/10416))
+
+### Maintenance
+
+- Addon-docs: Add blocks typings ([#10441](https://github.com/storybookjs/storybook/pull/10441))
+
## 6.0.0-alpha.35 (April 16, 2020)
### Bug Fixes
diff --git a/addons/a11y/package.json b/addons/a11y/package.json
index 2df0c9dc9d7..5bbed93795c 100644
--- a/addons/a11y/package.json
+++ b/addons/a11y/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-a11y",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "a11y addon for storybook",
"keywords": [
"a11y",
@@ -33,14 +33,14 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/api": "6.0.0-alpha.35",
- "@storybook/channels": "6.0.0-alpha.35",
- "@storybook/client-api": "6.0.0-alpha.35",
- "@storybook/client-logger": "6.0.0-alpha.35",
- "@storybook/components": "6.0.0-alpha.35",
- "@storybook/core-events": "6.0.0-alpha.35",
- "@storybook/theming": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/api": "6.0.0-alpha.39",
+ "@storybook/channels": "6.0.0-alpha.39",
+ "@storybook/client-api": "6.0.0-alpha.39",
+ "@storybook/client-logger": "6.0.0-alpha.39",
+ "@storybook/components": "6.0.0-alpha.39",
+ "@storybook/core-events": "6.0.0-alpha.39",
+ "@storybook/theming": "6.0.0-alpha.39",
"axe-core": "^3.5.2",
"core-js": "^3.0.1",
"global": "^4.3.2",
diff --git a/addons/actions/package.json b/addons/actions/package.json
index 1d10f7a1c39..6ea897e9344 100644
--- a/addons/actions/package.json
+++ b/addons/actions/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-actions",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Action Logger addon for storybook",
"keywords": [
"storybook"
@@ -28,15 +28,16 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/api": "6.0.0-alpha.35",
- "@storybook/client-api": "6.0.0-alpha.35",
- "@storybook/components": "6.0.0-alpha.35",
- "@storybook/core-events": "6.0.0-alpha.35",
- "@storybook/theming": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/api": "6.0.0-alpha.39",
+ "@storybook/client-api": "6.0.0-alpha.39",
+ "@storybook/components": "6.0.0-alpha.39",
+ "@storybook/core-events": "6.0.0-alpha.39",
+ "@storybook/theming": "6.0.0-alpha.39",
"core-js": "^3.0.1",
"fast-deep-equal": "^3.1.1",
"global": "^4.3.2",
+ "lodash": "^4.17.15",
"polished": "^3.4.4",
"prop-types": "^15.7.2",
"react": "^16.8.3",
diff --git a/addons/actions/src/preset/addArgs.test.ts b/addons/actions/src/preset/addArgs.test.ts
index 761985b00a2..ca72c7f4ad1 100644
--- a/addons/actions/src/preset/addArgs.test.ts
+++ b/addons/actions/src/preset/addArgs.test.ts
@@ -17,14 +17,18 @@ describe('actions parameter enhancers', () => {
expect(withDefaultValue(argTypes)).toEqual(['onClick', 'onFocus']);
});
- it('should prioritize pre-existing argTypes', () => {
+ it('should prioritize pre-existing argTypes unless they are null', () => {
const parameters = {
...baseParameters,
- argTypes: { onClick: { defaultValue: 'pre-existing value' }, onFocus: {} },
+ argTypes: {
+ onClick: { defaultValue: 'pre-existing value' },
+ onFocus: { defaultValue: null },
+ },
};
const argTypes = inferActionsFromArgTypesRegex({ parameters } as StoryContext);
expect(withDefaultValue(argTypes)).toEqual(['onClick', 'onFocus']);
expect(argTypes.onClick.defaultValue).toEqual('pre-existing value');
+ expect(argTypes.onFocus.defaultValue).not.toBeNull();
});
it('should do nothing if actions are disabled', () => {
diff --git a/addons/actions/src/preset/addArgs.ts b/addons/actions/src/preset/addArgs.ts
index 1c1d159748b..91d567d768b 100644
--- a/addons/actions/src/preset/addArgs.ts
+++ b/addons/actions/src/preset/addArgs.ts
@@ -1,5 +1,5 @@
-import { ArgTypesEnhancer, combineParameters } from '@storybook/client-api';
-import { ArgTypes, ArgType } from '@storybook/addons';
+import mapValues from 'lodash/mapValues';
+import { ArgTypesEnhancer } from '@storybook/client-api';
import { action } from '../index';
@@ -19,14 +19,12 @@ export const inferActionsFromArgTypesRegex: ArgTypesEnhancer = (context) => {
}
const argTypesRegex = new RegExp(actions.argTypesRegex);
- const actionArgTypes = Object.keys(argTypes).reduce((acc, name) => {
- if (argTypesRegex.test(name)) {
- acc[name] = { defaultValue: action(name) };
+ return mapValues(argTypes, (argType, name) => {
+ if (!argTypesRegex.test(name)) {
+ return argType;
}
- return acc;
- }, {} as ArgTypes);
-
- return combineParameters(actionArgTypes, argTypes) as ArgTypes;
+ return { ...argType, defaultValue: argType.defaultValue || action(name) };
+ });
};
/**
@@ -38,16 +36,13 @@ export const addActionsFromArgTypes: ArgTypesEnhancer = (context) => {
return argTypes;
}
- const actionArgTypes = Object.keys(argTypes).reduce((acc, argName) => {
- const argType: ArgType = argTypes[argName];
- if (argType.action) {
- const message = typeof argType.action === 'string' ? argType.action : argName;
- acc[argName] = { defaultValue: action(message) };
+ return mapValues(argTypes, (argType, name) => {
+ if (!argType.action) {
+ return argType;
}
- return acc;
- }, {} as ArgTypes);
-
- return combineParameters(actionArgTypes, argTypes) as ArgTypes;
+ const message = typeof argType.action === 'string' ? argType.action : name;
+ return { ...argType, defaultValue: argType.defaultValue || action(message) };
+ });
};
export const argTypesEnhancers = [addActionsFromArgTypes, inferActionsFromArgTypesRegex];
diff --git a/addons/backgrounds/package.json b/addons/backgrounds/package.json
index 0f26238d22d..56f4dcdf283 100644
--- a/addons/backgrounds/package.json
+++ b/addons/backgrounds/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-backgrounds",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "A storybook addon to show different backgrounds for your preview",
"keywords": [
"addon",
@@ -32,12 +32,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/api": "6.0.0-alpha.35",
- "@storybook/client-logger": "6.0.0-alpha.35",
- "@storybook/components": "6.0.0-alpha.35",
- "@storybook/core-events": "6.0.0-alpha.35",
- "@storybook/theming": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/api": "6.0.0-alpha.39",
+ "@storybook/client-logger": "6.0.0-alpha.39",
+ "@storybook/components": "6.0.0-alpha.39",
+ "@storybook/core-events": "6.0.0-alpha.39",
+ "@storybook/theming": "6.0.0-alpha.39",
"core-js": "^3.0.1",
"memoizerific": "^1.11.3",
"react": "^16.8.3",
diff --git a/addons/contexts/package.json b/addons/contexts/package.json
index 6f58febc799..1b436bf1cab 100644
--- a/addons/contexts/package.json
+++ b/addons/contexts/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-contexts",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Storybook Addon Contexts",
"keywords": [
"preact",
@@ -28,10 +28,10 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/api": "6.0.0-alpha.35",
- "@storybook/components": "6.0.0-alpha.35",
- "@storybook/core-events": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/api": "6.0.0-alpha.39",
+ "@storybook/components": "6.0.0-alpha.39",
+ "@storybook/core-events": "6.0.0-alpha.39",
"core-js": "^3.0.1",
"global": "^4.3.2",
"qs": "^6.6.0",
diff --git a/addons/cssresources/package.json b/addons/cssresources/package.json
index 2fa73b4a885..ce9845965e0 100644
--- a/addons/cssresources/package.json
+++ b/addons/cssresources/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-cssresources",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "A storybook addon to switch between css resources at runtime for your story",
"keywords": [
"addon",
@@ -32,11 +32,11 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/api": "6.0.0-alpha.35",
- "@storybook/components": "6.0.0-alpha.35",
- "@storybook/core-events": "6.0.0-alpha.35",
- "@storybook/theming": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/api": "6.0.0-alpha.39",
+ "@storybook/components": "6.0.0-alpha.39",
+ "@storybook/core-events": "6.0.0-alpha.39",
+ "@storybook/theming": "6.0.0-alpha.39",
"core-js": "^3.0.1",
"global": "^4.3.2",
"react": "^16.8.3",
diff --git a/addons/design-assets/package.json b/addons/design-assets/package.json
index d6cf1249db2..47b27e03b47 100644
--- a/addons/design-assets/package.json
+++ b/addons/design-assets/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-design-assets",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Design asset preview for storybook",
"keywords": [
"addon",
@@ -34,12 +34,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/api": "6.0.0-alpha.35",
- "@storybook/client-logger": "6.0.0-alpha.35",
- "@storybook/components": "6.0.0-alpha.35",
- "@storybook/core-events": "6.0.0-alpha.35",
- "@storybook/theming": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/api": "6.0.0-alpha.39",
+ "@storybook/client-logger": "6.0.0-alpha.39",
+ "@storybook/components": "6.0.0-alpha.39",
+ "@storybook/core-events": "6.0.0-alpha.39",
+ "@storybook/theming": "6.0.0-alpha.39",
"core-js": "^3.0.1",
"global": "^4.3.2",
"react": "^16.8.3",
diff --git a/addons/docs/README.md b/addons/docs/README.md
index 0247c1536c1..087a85f28e0 100644
--- a/addons/docs/README.md
+++ b/addons/docs/README.md
@@ -174,7 +174,7 @@ module.exports = {
// will configure everything with a preset)
addons: ['@storybook/addon-docs/register'],
// 2. manually configure webpack, since you're not using the preset
- webpackFinal: async config => {
+ webpackFinal: async (config) => {
config.module.rules.push({
// 2a. Load `.stories.mdx` / `.story.mdx` files as CSF and generate
// the docs page from the markdown
@@ -235,7 +235,6 @@ Install the preset with care. If you've already configured Typescript manually,
Want to learn more? Here are some more articles on Storybook Docs:
-- References: [DocsPage](./docs/docspage.md) / [MDX](./docs/mdx.md) / [FAQ](./docs/faq.md) / [Recipes](./docs/recipes.md) / [Theming](./docs/theming.md)
-- Vision: [Storybook Docs sneak peak](https://medium.com/storybookjs/storybook-docs-sneak-peak-5be78445094a)
-- Announcement: [DocsPage](https://medium.com/storybookjs/storybook-docspage-e185bc3622bf)
+- References: [DocsPage](./docs/docspage.md) / [MDX](./docs/mdx.md) / [FAQ](./docs/faq.md) / [Recipes](./docs/recipes.md) / [Theming](./docs/theming.md) / [Props](./docs/props-tables.md)
+- Announcements: [Vision](https://medium.com/storybookjs/storybook-docs-sneak-peak-5be78445094a) / [DocsPage](https://medium.com/storybookjs/storybook-docspage-e185bc3622bf) / [MDX](https://medium.com/storybookjs/rich-docs-with-storybook-mdx-61bc145ae7bc) / [Framework support](https://medium.com/storybookjs/storybook-docs-for-new-frameworks-b1f6090ee0ea)
- Example: [Storybook Design System](https://github.com/storybookjs/design-system)
diff --git a/addons/docs/angular/README.md b/addons/docs/angular/README.md
index d1b392115e6..d252201013c 100644
--- a/addons/docs/angular/README.md
+++ b/addons/docs/angular/README.md
@@ -10,11 +10,12 @@ Storybook Docs transforms your Storybook stories into world-class component docu
To learn more about Storybook Docs, read the [general documentation](../README.md). To learn the Angular specifics, read on!
-- [Installation](#installation)
-- [DocsPage](#docspage)
-- [MDX](#mdx)
-- [IFrame height](#iframe-height)
-- [More resources](#more-resources)
+- [Storybook Docs for Angular](#storybook-docs-for-angular)
+ - [Installation](#installation)
+ - [DocsPage](#docspage)
+ - [MDX](#mdx)
+ - [IFrame height](#iframe-height)
+ - [More resources](#more-resources)
## Installation
@@ -164,7 +165,6 @@ And for `MDX` you can modify it as an attribute on the `Story` element:
Want to learn more? Here are some more articles on Storybook Docs:
-- References: [DocsPage](../docs/docspage.md) / [MDX](../docs/mdx.md) / [FAQ](../docs/faq.md) / [Recipes](../docs/recipes.md) / [Theming](../docs/theming.md)
-- Vision: [Storybook Docs sneak peak](https://medium.com/storybookjs/storybook-docs-sneak-peak-5be78445094a)
-- Announcement: [DocsPage](https://medium.com/storybookjs/storybook-docspage-e185bc3622bf)
+- References: [DocsPage](../docs/docspage.md) / [MDX](../docs/mdx.md) / [FAQ](../docs/faq.md) / [Recipes](../docs/recipes.md) / [Theming](../docs/theming.md) / [Props](../docs/props-tables.md)
+- Announcements: [Vision](https://medium.com/storybookjs/storybook-docs-sneak-peak-5be78445094a) / [DocsPage](https://medium.com/storybookjs/storybook-docspage-e185bc3622bf) / [MDX](https://medium.com/storybookjs/rich-docs-with-storybook-mdx-61bc145ae7bc) / [Framework support](https://medium.com/storybookjs/storybook-docs-for-new-frameworks-b1f6090ee0ea)
- Example: [Storybook Design System](https://github.com/storybookjs/design-system)
diff --git a/addons/docs/blocks.d.ts b/addons/docs/blocks.d.ts
new file mode 100644
index 00000000000..58cda02960e
--- /dev/null
+++ b/addons/docs/blocks.d.ts
@@ -0,0 +1 @@
+export * from './dist/blocks.d';
diff --git a/addons/docs/docs/docspage.md b/addons/docs/docs/docspage.md
index 0bd95bb4dd6..5fe763220f2 100644
--- a/addons/docs/docs/docspage.md
+++ b/addons/docs/docs/docspage.md
@@ -173,7 +173,7 @@ import { addParameters } from '@storybook/vue';
addParameters({
docs: {
- prepareForInline: storyFn => {
+ prepareForInline: (storyFn) => {
const Story = toReact(storyFn());
return ;
},
@@ -185,7 +185,7 @@ With that function, anyone using the docs addon for `@storybook/vue` can make th
## More resources
-- References: [README](../README.md) / [DocsPage](docspage.md) / [MDX](mdx.md) / [FAQ](faq.md) / [Recipes](recipes.md) / [Theming](theming.md)
+- References: [README](../README.md) / [DocsPage](docspage.md) / [MDX](mdx.md) / [FAQ](faq.md) / [Recipes](recipes.md) / [Theming](theming.md) / [Props](props-tables.md)
- Framework-specific docs: [React](../react/README.md) / [Vue](../vue/README.md) / [Angular](../angular/README.md) / [Web components](../web-components/README.md) / [Ember](../ember/README.md)
- Announcements: [Vision](https://medium.com/storybookjs/storybook-docs-sneak-peak-5be78445094a) / [DocsPage](https://medium.com/storybookjs/storybook-docspage-e185bc3622bf) / [MDX](https://medium.com/storybookjs/rich-docs-with-storybook-mdx-61bc145ae7bc) / [Framework support](https://medium.com/storybookjs/storybook-docs-for-new-frameworks-b1f6090ee0ea)
- Example: [Storybook Design System](https://github.com/storybookjs/design-system)
diff --git a/addons/docs/docs/faq.md b/addons/docs/docs/faq.md
index ebde05fabc8..8030502baf1 100644
--- a/addons/docs/docs/faq.md
+++ b/addons/docs/docs/faq.md
@@ -43,7 +43,7 @@ This is [Component Story Format (CSF)](https://medium.com/storybookjs/component-
## More resources
-- References: [README](../README.md) / [DocsPage](docspage.md) / [MDX](mdx.md) / [FAQ](faq.md) / [Recipes](recipes.md) / [Theming](theming.md)
+- References: [README](../README.md) / [DocsPage](docspage.md) / [MDX](mdx.md) / [FAQ](faq.md) / [Recipes](recipes.md) / [Theming](theming.md) / [Props](props-tables.md)
- Framework-specific docs: [React](../react/README.md) / [Vue](../vue/README.md) / [Angular](../angular/README.md) / [Web components](../web-components/README.md) / [Ember](../ember/README.md)
- Announcements: [Vision](https://medium.com/storybookjs/storybook-docs-sneak-peak-5be78445094a) / [DocsPage](https://medium.com/storybookjs/storybook-docspage-e185bc3622bf) / [MDX](https://medium.com/storybookjs/rich-docs-with-storybook-mdx-61bc145ae7bc) / [Framework support](https://medium.com/storybookjs/storybook-docs-for-new-frameworks-b1f6090ee0ea)
- Example: [Storybook Design System](https://github.com/storybookjs/design-system)
diff --git a/addons/docs/docs/mdx.md b/addons/docs/docs/mdx.md
index ce6c932d735..dc19051f3b3 100644
--- a/addons/docs/docs/mdx.md
+++ b/addons/docs/docs/mdx.md
@@ -194,7 +194,7 @@ Be sure to update your Storybook config file to load `.stories.mdx` stories, as
## More resources
-- References: [README](../README.md) / [DocsPage](docspage.md) / [MDX](mdx.md) / [FAQ](faq.md) / [Recipes](recipes.md) / [Theming](theming.md)
+- References: [README](../README.md) / [DocsPage](docspage.md) / [MDX](mdx.md) / [FAQ](faq.md) / [Recipes](recipes.md) / [Theming](theming.md) / [Props](props-tables.md)
- Framework-specific docs: [React](../react/README.md) / [Vue](../vue/README.md) / [Angular](../angular/README.md) / [Web components](../web-components/README.md) / [Ember](../ember/README.md)
- Announcements: [Vision](https://medium.com/storybookjs/storybook-docs-sneak-peak-5be78445094a) / [DocsPage](https://medium.com/storybookjs/storybook-docspage-e185bc3622bf) / [MDX](https://medium.com/storybookjs/rich-docs-with-storybook-mdx-61bc145ae7bc) / [Framework support](https://medium.com/storybookjs/storybook-docs-for-new-frameworks-b1f6090ee0ea)
- Example: [Storybook Design System](https://github.com/storybookjs/design-system)
diff --git a/addons/docs/docs/media/args-controls.gif b/addons/docs/docs/media/args-controls.gif
new file mode 100644
index 00000000000..c60fa68c745
Binary files /dev/null and b/addons/docs/docs/media/args-controls.gif differ
diff --git a/addons/docs/docs/multiframework.md b/addons/docs/docs/multiframework.md
index c6b7077088e..75c56e2a711 100644
--- a/addons/docs/docs/multiframework.md
+++ b/addons/docs/docs/multiframework.md
@@ -88,7 +88,7 @@ import toReact from '@egoist/vue-to-react';
addParameters({
docs: {
// `container`, `page`, etc. here
- prepareForInline: storyFn => {
+ prepareForInline: (storyFn) => {
const Story = toReact(storyFn());
return ;
},
@@ -100,7 +100,7 @@ The input is the story function, and the output is a React element, because we r
## More resources
-- References: [README](../README.md) / [DocsPage](docspage.md) / [MDX](mdx.md) / [FAQ](faq.md) / [Recipes](recipes.md) / [Theming](theming.md)
+- References: [README](../README.md) / [DocsPage](docspage.md) / [MDX](mdx.md) / [FAQ](faq.md) / [Recipes](recipes.md) / [Theming](theming.md) / [Props](props-tables.md)
- Framework-specific docs: [React](../react/README.md) / [Vue](../vue/README.md) / [Angular](../angular/README.md) / [Web components](../web-components/README.md) / [Ember](../ember/README.md)
- Announcements: [Vision](https://medium.com/storybookjs/storybook-docs-sneak-peak-5be78445094a) / [DocsPage](https://medium.com/storybookjs/storybook-docspage-e185bc3622bf) / [MDX](https://medium.com/storybookjs/rich-docs-with-storybook-mdx-61bc145ae7bc) / [Framework support](https://medium.com/storybookjs/storybook-docs-for-new-frameworks-b1f6090ee0ea)
- Example: [Storybook Design System](https://github.com/storybookjs/design-system)
diff --git a/addons/docs/docs/props-tables.md b/addons/docs/docs/props-tables.md
index 18145e0e923..9092ba3ad5c 100644
--- a/addons/docs/docs/props-tables.md
+++ b/addons/docs/docs/props-tables.md
@@ -57,7 +57,7 @@ import { MyComponent } from './MyComponent';
Starting in SB 6.0, the `Props` block has built-in controls (formerly known as "knobs") for editing stories dynamically.
-
+
These controls are implemented appear automatically in the props table when your story accepts [Storybook Args](#https://github.com/storybookjs/storybook/blob/next/docs/src/pages/formats/component-story-format/index.md#args-story-inputs) as its input.
@@ -251,7 +251,7 @@ SB Docs for Ember uses `yui-doc` for prop table information.
## More resources
-- References: [README](../README.md) / [DocsPage](docspage.md) / [MDX](mdx.md) / [FAQ](faq.md) / [Recipes](recipes.md) / [Theming](theming.md)
+- References: [README](../README.md) / [DocsPage](docspage.md) / [MDX](mdx.md) / [FAQ](faq.md) / [Recipes](recipes.md) / [Theming](theming.md) / [Props](props-tables.md)
- Framework-specific docs: [React](../react/README.md) / [Vue](../vue/README.md) / [Angular](../angular/README.md) / [Web components](../web-components/README.md) / [Ember](../ember/README.md)
- Announcements: [Vision](https://medium.com/storybookjs/storybook-docs-sneak-peak-5be78445094a) / [DocsPage](https://medium.com/storybookjs/storybook-docspage-e185bc3622bf) / [MDX](https://medium.com/storybookjs/rich-docs-with-storybook-mdx-61bc145ae7bc) / [Framework support](https://medium.com/storybookjs/storybook-docs-for-new-frameworks-b1f6090ee0ea)
- Example: [Storybook Design System](https://github.com/storybookjs/design-system)
diff --git a/addons/docs/docs/recipes.md b/addons/docs/docs/recipes.md
index d76e006b066..83cac9434c6 100644
--- a/addons/docs/docs/recipes.md
+++ b/addons/docs/docs/recipes.md
@@ -59,7 +59,7 @@ basic.story = {
```md
import { Meta, Story } from '@storybook/addon-docs/blocks';
-import * as stories from './Button.stories.js';
+import \* as stories from './Button.stories.js';
import { SomeComponent } from 'path/to/SomeComponent';
@@ -138,8 +138,8 @@ const loadFn = () => {
const req = require.context('../src', true, /\.stories\.js$/);
return req
.keys()
- .map(fname => req(fname))
- .filter(exp => !!exp.default);
+ .map((fname) => req(fname))
+ .filter((exp) => !!exp.default);
};
configure(loadFn, module);
@@ -269,7 +269,7 @@ These two methods are complementary. The former is useful for story-specific, an
## More resources
-- References: [README](../README.md) / [DocsPage](docspage.md) / [MDX](mdx.md) / [FAQ](faq.md) / [Recipes](recipes.md) / [Theming](theming.md)
+- References: [README](../README.md) / [DocsPage](docspage.md) / [MDX](mdx.md) / [FAQ](faq.md) / [Recipes](recipes.md) / [Theming](theming.md) / [Props](props-tables.md)
- Framework-specific docs: [React](../react/README.md) / [Vue](../vue/README.md) / [Angular](../angular/README.md) / [Web components](../web-components/README.md) / [Ember](../ember/README.md)
- Announcements: [Vision](https://medium.com/storybookjs/storybook-docs-sneak-peak-5be78445094a) / [DocsPage](https://medium.com/storybookjs/storybook-docspage-e185bc3622bf) / [MDX](https://medium.com/storybookjs/rich-docs-with-storybook-mdx-61bc145ae7bc) / [Framework support](https://medium.com/storybookjs/storybook-docs-for-new-frameworks-b1f6090ee0ea)
- Example: [Storybook Design System](https://github.com/storybookjs/design-system)
diff --git a/addons/docs/docs/theming.md b/addons/docs/docs/theming.md
index 3bf272c6678..c691726d8e2 100644
--- a/addons/docs/docs/theming.md
+++ b/addons/docs/docs/theming.md
@@ -91,7 +91,7 @@ addParameters({
## More resources
-- References: [README](../README.md) / [DocsPage](docspage.md) / [MDX](mdx.md) / [FAQ](faq.md) / [Recipes](recipes.md) / [Theming](theming.md)
+- References: [README](../README.md) / [DocsPage](docspage.md) / [MDX](mdx.md) / [FAQ](faq.md) / [Recipes](recipes.md) / [Theming](theming.md) / [Props](props-tables.md)
- Framework-specific docs: [React](../react/README.md) / [Vue](../vue/README.md) / [Angular](../angular/README.md) / [Web components](../web-components/README.md) / [Ember](../ember/README.md)
- Announcements: [Vision](https://medium.com/storybookjs/storybook-docs-sneak-peak-5be78445094a) / [DocsPage](https://medium.com/storybookjs/storybook-docspage-e185bc3622bf) / [MDX](https://medium.com/storybookjs/rich-docs-with-storybook-mdx-61bc145ae7bc) / [Framework support](https://medium.com/storybookjs/storybook-docs-for-new-frameworks-b1f6090ee0ea)
- Example: [Storybook Design System](https://github.com/storybookjs/design-system)
diff --git a/addons/docs/ember/README.md b/addons/docs/ember/README.md
index 375b8b0de3e..c0c01fd8e2e 100644
--- a/addons/docs/ember/README.md
+++ b/addons/docs/ember/README.md
@@ -6,11 +6,12 @@ Storybook Docs transforms your Storybook stories into world-class component docu
To learn more about Storybook Docs, read the [general documentation](../README.md). To learn the Ember specifics, read on!
-- [Installation](#installation)
-- [DocsPage](#docspage)
-- [MDX](#mdx)
-- [IFrame height](#iframe-height)
-- [More resources](#more-resources)
+- [Storybook Docs for Ember](#storybook-docs-for-ember)
+ - [Installation](#installation)
+ - [DocsPage](#docspage)
+ - [MDX](#mdx)
+ - [IFrame height](#iframe-height)
+ - [More resources](#more-resources)
## Installation
@@ -146,7 +147,6 @@ And for `MDX` you can modify it as an attribute on the `Story` element:
Want to learn more? Here are some more articles on Storybook Docs:
-- References: [DocsPage](../docs/docspage.md) / [MDX](../docs/mdx.md) / [FAQ](../docs/faq.md) / [Recipes](../docs/recipes.md) / [Theming](../docs/theming.md)
-- Vision: [Storybook Docs sneak peak](https://medium.com/storybookjs/storybook-docs-sneak-peak-5be78445094a)
-- Announcement: [DocsPage](https://medium.com/storybookjs/storybook-docspage-e185bc3622bf)
+- References: [DocsPage](../docs/docspage.md) / [MDX](../docs/mdx.md) / [FAQ](../docs/faq.md) / [Recipes](../docs/recipes.md) / [Theming](../docs/theming.md) / [Props](../docs/props-tables.md)
+- Announcements: [Vision](https://medium.com/storybookjs/storybook-docs-sneak-peak-5be78445094a) / [DocsPage](https://medium.com/storybookjs/storybook-docspage-e185bc3622bf) / [MDX](https://medium.com/storybookjs/rich-docs-with-storybook-mdx-61bc145ae7bc) / [Framework support](https://medium.com/storybookjs/storybook-docs-for-new-frameworks-b1f6090ee0ea)
- Example: [Storybook Design System](https://github.com/storybookjs/design-system)
diff --git a/addons/docs/package.json b/addons/docs/package.json
index 37f28c3b02e..4b539bace2b 100644
--- a/addons/docs/package.json
+++ b/addons/docs/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-docs",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Superior documentation for your components",
"keywords": [
"addon",
@@ -48,16 +48,16 @@
"@mdx-js/loader": "^1.5.1",
"@mdx-js/mdx": "^1.5.1",
"@mdx-js/react": "^1.5.1",
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/api": "6.0.0-alpha.35",
- "@storybook/client-api": "6.0.0-alpha.35",
- "@storybook/components": "6.0.0-alpha.35",
- "@storybook/core-events": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/api": "6.0.0-alpha.39",
+ "@storybook/client-api": "6.0.0-alpha.39",
+ "@storybook/components": "6.0.0-alpha.39",
+ "@storybook/core-events": "6.0.0-alpha.39",
"@storybook/csf": "0.0.1",
- "@storybook/node-logger": "6.0.0-alpha.35",
- "@storybook/postinstall": "6.0.0-alpha.35",
- "@storybook/source-loader": "6.0.0-alpha.35",
- "@storybook/theming": "6.0.0-alpha.35",
+ "@storybook/node-logger": "6.0.0-alpha.39",
+ "@storybook/postinstall": "6.0.0-alpha.39",
+ "@storybook/source-loader": "6.0.0-alpha.39",
+ "@storybook/theming": "6.0.0-alpha.39",
"acorn": "^7.1.0",
"acorn-jsx": "^5.1.0",
"acorn-walk": "^7.0.0",
@@ -83,8 +83,8 @@
"@babel/core": "^7.8.4",
"@emotion/core": "^10.0.20",
"@emotion/styled": "^10.0.17",
- "@storybook/react": "6.0.0-alpha.35",
- "@storybook/web-components": "6.0.0-alpha.35",
+ "@storybook/react": "6.0.0-alpha.39",
+ "@storybook/web-components": "6.0.0-alpha.39",
"@types/doctrine": "^0.0.3",
"@types/enzyme": "^3.10.3",
"@types/jest": "^25.1.1",
diff --git a/addons/docs/react/README.md b/addons/docs/react/README.md
index 55d74e526ab..3b373b32731 100644
--- a/addons/docs/react/README.md
+++ b/addons/docs/react/README.md
@@ -10,11 +10,12 @@ Storybook Docs transforms your Storybook stories into world-class component docu
To learn more about Storybook Docs, read the [general documentation](../README.md). To learn the React specifics, read on!
-- [Installation](#installation)
-- [DocsPage](#docspage)
-- [MDX](#mdx)
-- [Inline stories](#inline-stories)
-- [More resources](#more-resources)
+- [Storybook Docs for React](#storybook-docs-for-react)
+ - [Installation](#installation)
+ - [DocsPage](#docspage)
+ - [MDX](#mdx)
+ - [Inline Stories](#inline-stories)
+ - [More resources](#more-resources)
## Installation
@@ -116,7 +117,6 @@ addParameters({
Want to learn more? Here are some more articles on Storybook Docs:
-- References: [DocsPage](../docs/docspage.md) / [MDX](../docs/mdx.md) / [FAQ](../docs/faq.md) / [Recipes](../docs/recipes.md) / [Theming](../docs/theming.md)
-- Vision: [Storybook Docs sneak peak](https://medium.com/storybookjs/storybook-docs-sneak-peak-5be78445094a)
-- Announcement: [DocsPage](https://medium.com/storybookjs/storybook-docspage-e185bc3622bf)
+- References: [DocsPage](../docs/docspage.md) / [MDX](../docs/mdx.md) / [FAQ](../docs/faq.md) / [Recipes](../docs/recipes.md) / [Theming](../docs/theming.md) / [Props](../docs/props-tables.md)
+- Announcements: [Vision](https://medium.com/storybookjs/storybook-docs-sneak-peak-5be78445094a) / [DocsPage](https://medium.com/storybookjs/storybook-docspage-e185bc3622bf) / [MDX](https://medium.com/storybookjs/rich-docs-with-storybook-mdx-61bc145ae7bc) / [Framework support](https://medium.com/storybookjs/storybook-docs-for-new-frameworks-b1f6090ee0ea)
- Example: [Storybook Design System](https://github.com/storybookjs/design-system)
diff --git a/addons/docs/src/blocks/Props.tsx b/addons/docs/src/blocks/Props.tsx
index d6c2f40eaf7..5af20998f2d 100644
--- a/addons/docs/src/blocks/Props.tsx
+++ b/addons/docs/src/blocks/Props.tsx
@@ -1,6 +1,7 @@
/* eslint-disable no-underscore-dangle */
import React, { FC, useContext, useEffect, useState, useCallback } from 'react';
import mapValues from 'lodash/mapValues';
+import pickBy from 'lodash/pickBy';
import {
ArgsTable,
ArgsTableProps,
@@ -18,8 +19,11 @@ import { getComponentName } from './utils';
import { ArgTypesExtractor } from '../lib/docgen/types';
import { lookupStoryId } from './Story';
+type PropDescriptor = string[] | RegExp;
+
interface BaseProps {
- exclude?: string[];
+ include?: PropDescriptor;
+ exclude?: PropDescriptor;
}
type OfProps = BaseProps & {
@@ -62,15 +66,18 @@ const useArgs = (storyId: string, storyStore: StoryStore): [Args, (args: Args) =
return [args, updateArgs];
};
-const filterArgTypes = (argTypes: ArgTypes, exclude?: string[]) => {
- if (!exclude) {
+const matches = (name: string, descriptor: PropDescriptor) =>
+ Array.isArray(descriptor) ? descriptor.includes(name) : name.match(descriptor);
+
+const filterArgTypes = (argTypes: ArgTypes, include?: PropDescriptor, exclude?: PropDescriptor) => {
+ if (!include && !exclude) {
return argTypes;
}
return (
argTypes &&
- mapValues(argTypes, (argType, key) => {
+ pickBy(argTypes, (argType, key) => {
const name = argType.name || key;
- return exclude.includes(name) ? undefined : argType;
+ return (!include || matches(name, include)) && (!exclude || !matches(name, exclude));
})
);
};
@@ -78,7 +85,8 @@ const filterArgTypes = (argTypes: ArgTypes, exclude?: string[]) => {
export const extractComponentArgTypes = (
component: Component,
{ parameters }: DocsContextProps,
- exclude?: string[]
+ include?: PropDescriptor,
+ exclude?: PropDescriptor
): ArgTypes => {
const params = parameters || {};
const { extractArgTypes }: { extractArgTypes: ArgTypesExtractor } = params.docs || {};
@@ -86,7 +94,7 @@ export const extractComponentArgTypes = (
throw new Error(ArgsTableError.ARGS_UNSUPPORTED);
}
let argTypes = extractArgTypes(component);
- argTypes = filterArgTypes(argTypes, exclude);
+ argTypes = filterArgTypes(argTypes, include, exclude);
return argTypes;
};
@@ -110,11 +118,12 @@ const addComponentTabs = (
tabs: Record,
components: Record,
context: DocsContextProps,
- exclude?: string[]
+ include?: PropDescriptor,
+ exclude?: PropDescriptor
) => ({
...tabs,
...mapValues(components, (comp) => ({
- rows: extractComponentArgTypes(comp, context, exclude),
+ rows: extractComponentArgTypes(comp, context, include, exclude),
})),
});
@@ -125,7 +134,7 @@ export const StoryTable: FC
parameters: { argTypes },
storyStore,
} = context;
- const { story, showComponents, components, exclude } = props;
+ const { story, showComponents, components, include, exclude } = props;
let storyArgTypes;
try {
let storyId;
@@ -137,14 +146,14 @@ export const StoryTable: FC
const data = storyStore.fromId(storyId);
storyArgTypes = data.parameters.argTypes;
}
- storyArgTypes = filterArgTypes(storyArgTypes, exclude);
+ storyArgTypes = filterArgTypes(storyArgTypes, include, exclude);
const [args, updateArgs] = useArgs(storyId, storyStore);
let tabs = { Story: { rows: storyArgTypes, args, updateArgs } } as Record<
string,
ArgsTableProps
>;
if (showComponents) {
- tabs = addComponentTabs(tabs, components, context, exclude);
+ tabs = addComponentTabs(tabs, components, context, include, exclude);
}
return ;
@@ -155,9 +164,9 @@ export const StoryTable: FC
export const ComponentsTable: FC = (props) => {
const context = useContext(DocsContext);
- const { components, exclude } = props;
+ const { components, include, exclude } = props;
- const tabs = addComponentTabs({}, components, context, exclude);
+ const tabs = addComponentTabs({}, components, context, include, exclude);
return ;
};
@@ -167,7 +176,7 @@ export const Props: FC = (props) => {
parameters: { subcomponents },
} = context;
- const { exclude, components } = props as ComponentsProps;
+ const { include, exclude, components } = props as ComponentsProps;
const { story } = props as StoryProps;
let allComponents = components;
@@ -185,14 +194,14 @@ export const Props: FC = (props) => {
if (!components && !subcomponents) {
let mainProps;
try {
- mainProps = { rows: extractComponentArgTypes(main, context, exclude) };
+ mainProps = { rows: extractComponentArgTypes(main, context, include, exclude) };
} catch (err) {
mainProps = { error: err.message };
}
return ;
}
- return ;
+ return ;
};
Props.defaultProps = {
diff --git a/addons/docs/src/frameworks/vue/config.tsx b/addons/docs/src/frameworks/vue/config.tsx
index fc141075443..bcc24788711 100644
--- a/addons/docs/src/frameworks/vue/config.tsx
+++ b/addons/docs/src/frameworks/vue/config.tsx
@@ -7,6 +7,7 @@ import { extractComponentDescription } from '../../lib/docgen';
addParameters({
docs: {
+ inlineStories: true,
prepareForInline: (storyFn: StoryFn) => {
const Story = toReact(storyFn());
return ;
diff --git a/addons/docs/vue/README.md b/addons/docs/vue/README.md
index 40175be3a12..1733036619b 100644
--- a/addons/docs/vue/README.md
+++ b/addons/docs/vue/README.md
@@ -10,11 +10,13 @@ Storybook Docs transforms your Storybook stories into world-class component docu
To learn more about Storybook Docs, read the [general documentation](../README.md). To learn the Vue specifics, read on!
-- [Installation](#installation)
-- [DocsPage](#docspage)
-- [MDX](#mdx)
-- [Inline stories](#inline-stories)
-- [More resources](#more-resources)
+- [Storybook Docs for Vue](#storybook-docs-for-vue)
+ - [Installation](#installation)
+ - [Preset options](#preset-options)
+ - [DocsPage](#docspage)
+ - [MDX](#mdx)
+ - [Inline Stories](#inline-stories)
+ - [More resources](#more-resources)
## Installation
@@ -131,7 +133,7 @@ Yes, it's redundant to declare `component` twice. [Coming soon](https://github.c
Storybook Docs renders all Vue stories inside IFrames, with a default height of `60px` (configurable using the `docs.iframeHeight` story parameter).
-Starting in 5.3, you can also render stories inline, and in 6.0 this will become the default behavior. To render inline, update `.storybook/preview.js`:
+Starting in 5.3, you can also render stories inline, and in 6.0 this has become the default behavior. To render inline, update `.storybook/preview.js`:
```js
import { addParameters } from '@storybook/vue';
@@ -147,7 +149,6 @@ addParameters({
Want to learn more? Here are some more articles on Storybook Docs:
-- References: [DocsPage](../docs/docspage.md) / [MDX](../docs/mdx.md) / [FAQ](../docs/faq.md) / [Recipes](../docs/recipes.md) / [Theming](../docs/theming.md)
-- Vision: [Storybook Docs sneak peak](https://medium.com/storybookjs/storybook-docs-sneak-peak-5be78445094a)
-- Announcement: [DocsPage](https://medium.com/storybookjs/storybook-docspage-e185bc3622bf)
+- References: [DocsPage](../docs/docspage.md) / [MDX](../docs/mdx.md) / [FAQ](../docs/faq.md) / [Recipes](../docs/recipes.md) / [Theming](../docs/theming.md) / [Props](../docs/props-tables.md)
+- Announcements: [Vision](https://medium.com/storybookjs/storybook-docs-sneak-peak-5be78445094a) / [DocsPage](https://medium.com/storybookjs/storybook-docspage-e185bc3622bf) / [MDX](https://medium.com/storybookjs/rich-docs-with-storybook-mdx-61bc145ae7bc) / [Framework support](https://medium.com/storybookjs/storybook-docs-for-new-frameworks-b1f6090ee0ea)
- Example: [Storybook Design System](https://github.com/storybookjs/design-system)
diff --git a/addons/docs/web-components/README.md b/addons/docs/web-components/README.md
index 35c0083f7a7..fdcb145b473 100644
--- a/addons/docs/web-components/README.md
+++ b/addons/docs/web-components/README.md
@@ -92,3 +92,11 @@ or add it to individual stories.
```js
```
+
+## More resources
+
+Want to learn more? Here are some more articles on Storybook Docs:
+
+- References: [DocsPage](../docs/docspage.md) / [MDX](../docs/mdx.md) / [FAQ](../docs/faq.md) / [Recipes](../docs/recipes.md) / [Theming](../docs/theming.md) / [Props](../docs/props-tables.md)
+- Announcements: [Vision](https://medium.com/storybookjs/storybook-docs-sneak-peak-5be78445094a) / [DocsPage](https://medium.com/storybookjs/storybook-docspage-e185bc3622bf) / [MDX](https://medium.com/storybookjs/rich-docs-with-storybook-mdx-61bc145ae7bc) / [Framework support](https://medium.com/storybookjs/storybook-docs-for-new-frameworks-b1f6090ee0ea)
+- Example: [Storybook Design System](https://github.com/storybookjs/design-system)
diff --git a/addons/essentials/package.json b/addons/essentials/package.json
index 7ea293fbe0c..3099a90c3a9 100644
--- a/addons/essentials/package.json
+++ b/addons/essentials/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-essentials",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Curated addons to bring out the best of Storybook",
"keywords": [
"addon",
@@ -28,11 +28,11 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/addon-backgrounds": "6.0.0-alpha.35",
- "@storybook/addon-viewport": "6.0.0-alpha.35",
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/api": "6.0.0-alpha.35",
- "@storybook/node-logger": "6.0.0-alpha.35",
+ "@storybook/addon-backgrounds": "6.0.0-alpha.39",
+ "@storybook/addon-viewport": "6.0.0-alpha.39",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/api": "6.0.0-alpha.39",
+ "@storybook/node-logger": "6.0.0-alpha.39",
"core-js": "^3.0.1",
"regenerator-runtime": "^0.13.3",
"ts-dedent": "^1.1.1"
diff --git a/addons/events/package.json b/addons/events/package.json
index 4885f6399de..9b91550f59c 100644
--- a/addons/events/package.json
+++ b/addons/events/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-events",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Add events to your Storybook stories.",
"keywords": [
"addon",
@@ -31,11 +31,11 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/api": "6.0.0-alpha.35",
- "@storybook/client-api": "6.0.0-alpha.35",
- "@storybook/core-events": "6.0.0-alpha.35",
- "@storybook/theming": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/api": "6.0.0-alpha.39",
+ "@storybook/client-api": "6.0.0-alpha.39",
+ "@storybook/core-events": "6.0.0-alpha.39",
+ "@storybook/theming": "6.0.0-alpha.39",
"core-js": "^3.0.1",
"format-json": "^1.0.3",
"lodash": "^4.17.15",
diff --git a/addons/google-analytics/package.json b/addons/google-analytics/package.json
index 7e9a8abd79f..3814dc89513 100644
--- a/addons/google-analytics/package.json
+++ b/addons/google-analytics/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-google-analytics",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Storybook addon for google analytics",
"keywords": [
"addon",
@@ -20,8 +20,8 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/core-events": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/core-events": "6.0.0-alpha.39",
"core-js": "^3.0.1",
"global": "^4.3.2",
"react-ga": "^2.5.7",
diff --git a/addons/graphql/package.json b/addons/graphql/package.json
index 2ee90056986..01bc5d894b8 100644
--- a/addons/graphql/package.json
+++ b/addons/graphql/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-graphql",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Storybook addon to display the GraphiQL IDE",
"keywords": [
"addon",
@@ -30,8 +30,8 @@
},
"dependencies": {
"@babel/plugin-transform-classes": "^7.9.2",
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/api": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/api": "6.0.0-alpha.39",
"core-js": "^3.0.1",
"global": "^4.3.2",
"graphiql": "^0.17.5",
diff --git a/addons/jest/package.json b/addons/jest/package.json
index 9af0bc66982..34c2b503335 100644
--- a/addons/jest/package.json
+++ b/addons/jest/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-jest",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "React storybook addon that show component jest report",
"keywords": [
"addon",
@@ -35,11 +35,11 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/api": "6.0.0-alpha.35",
- "@storybook/components": "6.0.0-alpha.35",
- "@storybook/core-events": "6.0.0-alpha.35",
- "@storybook/theming": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/api": "6.0.0-alpha.39",
+ "@storybook/components": "6.0.0-alpha.39",
+ "@storybook/core-events": "6.0.0-alpha.39",
+ "@storybook/theming": "6.0.0-alpha.39",
"core-js": "^3.0.1",
"global": "^4.3.2",
"react": "^16.8.3",
diff --git a/addons/knobs/package.json b/addons/knobs/package.json
index 209ae12b3ad..cfca9a1faf7 100644
--- a/addons/knobs/package.json
+++ b/addons/knobs/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-knobs",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Storybook Addon Prop Editor Component",
"keywords": [
"addon",
@@ -29,13 +29,13 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/api": "6.0.0-alpha.35",
- "@storybook/channels": "6.0.0-alpha.35",
- "@storybook/client-api": "6.0.0-alpha.35",
- "@storybook/components": "6.0.0-alpha.35",
- "@storybook/core-events": "6.0.0-alpha.35",
- "@storybook/theming": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/api": "6.0.0-alpha.39",
+ "@storybook/channels": "6.0.0-alpha.39",
+ "@storybook/client-api": "6.0.0-alpha.39",
+ "@storybook/components": "6.0.0-alpha.39",
+ "@storybook/core-events": "6.0.0-alpha.39",
+ "@storybook/theming": "6.0.0-alpha.39",
"@types/react-color": "^3.0.1",
"copy-to-clipboard": "^3.0.8",
"core-js": "^3.0.1",
diff --git a/addons/links/package.json b/addons/links/package.json
index 4b579db35a8..4cce82f5984 100644
--- a/addons/links/package.json
+++ b/addons/links/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-links",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Story Links addon for storybook",
"keywords": [
"addon",
@@ -29,11 +29,11 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/client-logger": "6.0.0-alpha.35",
- "@storybook/core-events": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/client-logger": "6.0.0-alpha.39",
+ "@storybook/core-events": "6.0.0-alpha.39",
"@storybook/csf": "0.0.1",
- "@storybook/router": "6.0.0-alpha.35",
+ "@storybook/router": "6.0.0-alpha.39",
"@types/qs": "^6.9.0",
"core-js": "^3.0.1",
"global": "^4.3.2",
diff --git a/addons/queryparams/README.md b/addons/queryparams/README.md
index d8f935da80b..0befd0e5e69 100644
--- a/addons/queryparams/README.md
+++ b/addons/queryparams/README.md
@@ -1,6 +1,6 @@
# storybook-addon-queryparams
-This storybook addon can be helpful if your components need special query parameters to work the way you want them.
+This storybook addon can be helpful if your components need special query parameters to work the way you want them to. It allows you to mock query params per story so that you can easily reproduce different states of your component.
## Getting started
@@ -10,7 +10,7 @@ First, install the addon.
$ yarn add @storybook/addon-queryparams --dev
```
-Add this line to your `main.js` file (create this file inside your storybook config directory if needed).
+Register it by adding it in the addons attribute in your `main.js` file (create this file inside your storybook config directory if needed).
```js
module.exports = {
@@ -18,6 +18,34 @@ module.exports = {
};
```
+In your story, add the `withQuery` decorator and define the query parameters you want to mock:
+
+```js
+import React from 'react';
+import { Button } from '@storybook/react/demo';
+import { withQuery } from '@storybook/addon-queryparams';
+
+export default {
+ title: 'Button',
+ component: Button,
+ decorators: [withQuery],
+ parameters: {
+ query: {
+ mock: 'Hello world!',
+ },
+ },
+};
+
+export const WithMockedSearch = () => {
+ const urlParams = new URLSearchParams(document.location.search);
+ const mockedParam = urlParams.get('mock');
+ return Mocked value: {mockedParam}
;
+};
+```
+
+
+ Example with storiesOf API
+
```js
import React from 'react';
import { storiesOf } from '@storybook/react';
@@ -25,12 +53,14 @@ import { storiesOf } from '@storybook/react';
storiesOf('button', module)
.addParameters({
query: {
- mock: true,
- }
+ mock: 'Hello World!',
+ },
})
- .add('Prints the document.search', () => (
-
- This is the current document.search: {document.search}, it includes `mock`!
-
- ));
+ .add('Prints the mocked parameter', () => {
+ const urlParams = new URLSearchParams(document.location.search);
+ const mockedParam = urlParams.get('mock');
+ return Mocked value: {mockedParam}
;
+ });
```
+
+
diff --git a/addons/queryparams/package.json b/addons/queryparams/package.json
index 85cdbfdf61a..95d1472910d 100644
--- a/addons/queryparams/package.json
+++ b/addons/queryparams/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-queryparams",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "parameter addon for storybook",
"keywords": [
"addon",
@@ -30,12 +30,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/api": "6.0.0-alpha.35",
- "@storybook/client-logger": "6.0.0-alpha.35",
- "@storybook/components": "6.0.0-alpha.35",
- "@storybook/core-events": "6.0.0-alpha.35",
- "@storybook/theming": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/api": "6.0.0-alpha.39",
+ "@storybook/client-logger": "6.0.0-alpha.39",
+ "@storybook/components": "6.0.0-alpha.39",
+ "@storybook/core-events": "6.0.0-alpha.39",
+ "@storybook/theming": "6.0.0-alpha.39",
"core-js": "^3.0.1",
"global": "^4.3.2",
"qs": "^6.6.0",
diff --git a/addons/storyshots/storyshots-core/package.json b/addons/storyshots/storyshots-core/package.json
index 422c0620857..b6fb9cd8ef1 100644
--- a/addons/storyshots/storyshots-core/package.json
+++ b/addons/storyshots/storyshots-core/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-storyshots",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "StoryShots is a Jest Snapshot Testing Addon for Storybook.",
"keywords": [
"addon",
@@ -33,9 +33,9 @@
},
"dependencies": {
"@jest/transform": "^25.2.4",
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/client-api": "6.0.0-alpha.35",
- "@storybook/core": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/client-api": "6.0.0-alpha.39",
+ "@storybook/core": "6.0.0-alpha.39",
"@types/glob": "^7.1.1",
"@types/jest": "^25.1.1",
"@types/jest-specific-snapshot": "^0.5.3",
@@ -50,8 +50,8 @@
"ts-dedent": "^1.1.1"
},
"devDependencies": {
- "@storybook/addon-docs": "6.0.0-alpha.35",
- "@storybook/react": "6.0.0-alpha.35",
+ "@storybook/addon-docs": "6.0.0-alpha.39",
+ "@storybook/react": "6.0.0-alpha.39",
"babel-loader": "^8.0.6",
"enzyme": "^3.11.0",
"enzyme-to-json": "^3.4.1",
diff --git a/addons/storyshots/storyshots-puppeteer/package.json b/addons/storyshots/storyshots-puppeteer/package.json
index c629aa7d448..c83bd2a012a 100644
--- a/addons/storyshots/storyshots-puppeteer/package.json
+++ b/addons/storyshots/storyshots-puppeteer/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-storyshots-puppeteer",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Image snapshots addition to StoryShots based on puppeteer",
"keywords": [
"addon",
@@ -30,7 +30,7 @@
},
"dependencies": {
"@storybook/csf": "0.0.1",
- "@storybook/node-logger": "6.0.0-alpha.35",
+ "@storybook/node-logger": "6.0.0-alpha.39",
"@types/jest-image-snapshot": "^2.8.0",
"@wordpress/jest-puppeteer-axe": "^1.5.0",
"core-js": "^3.0.1",
@@ -42,7 +42,7 @@
"@types/puppeteer": "^2.0.0"
},
"peerDependencies": {
- "@storybook/addon-storyshots": "6.0.0-alpha.35",
+ "@storybook/addon-storyshots": "6.0.0-alpha.39",
"puppeteer": "^1.12.2 || ^2.0.0"
},
"peerDependenciesMeta": {
diff --git a/addons/storysource/package.json b/addons/storysource/package.json
index e18f4bde711..ef2a30d433f 100644
--- a/addons/storysource/package.json
+++ b/addons/storysource/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-storysource",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Stories addon for storybook",
"keywords": [
"addon",
@@ -29,13 +29,13 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/api": "6.0.0-alpha.35",
- "@storybook/client-logger": "6.0.0-alpha.35",
- "@storybook/components": "6.0.0-alpha.35",
- "@storybook/router": "6.0.0-alpha.35",
- "@storybook/source-loader": "6.0.0-alpha.35",
- "@storybook/theming": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/api": "6.0.0-alpha.39",
+ "@storybook/client-logger": "6.0.0-alpha.39",
+ "@storybook/components": "6.0.0-alpha.39",
+ "@storybook/router": "6.0.0-alpha.39",
+ "@storybook/source-loader": "6.0.0-alpha.39",
+ "@storybook/theming": "6.0.0-alpha.39",
"core-js": "^3.0.1",
"estraverse": "^4.2.0",
"loader-utils": "^2.0.0",
diff --git a/addons/toolbars/package.json b/addons/toolbars/package.json
index 717eafdf66e..2747eb76d88 100644
--- a/addons/toolbars/package.json
+++ b/addons/toolbars/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-toolbars",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Storybook toolbars addon",
"keywords": [
"addon",
@@ -30,10 +30,10 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/api": "6.0.0-alpha.35",
- "@storybook/client-api": "6.0.0-alpha.35",
- "@storybook/components": "6.0.0-alpha.35"
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/api": "6.0.0-alpha.39",
+ "@storybook/client-api": "6.0.0-alpha.39",
+ "@storybook/components": "6.0.0-alpha.39"
},
"peerDependencies": {
"react": "*"
diff --git a/addons/viewport/package.json b/addons/viewport/package.json
index 03b1651bf91..a8cce96e7f1 100644
--- a/addons/viewport/package.json
+++ b/addons/viewport/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-viewport",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Storybook addon to change the viewport size to mobile",
"keywords": [
"addon",
@@ -29,12 +29,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/api": "6.0.0-alpha.35",
- "@storybook/client-logger": "6.0.0-alpha.35",
- "@storybook/components": "6.0.0-alpha.35",
- "@storybook/core-events": "6.0.0-alpha.35",
- "@storybook/theming": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/api": "6.0.0-alpha.39",
+ "@storybook/client-logger": "6.0.0-alpha.39",
+ "@storybook/components": "6.0.0-alpha.39",
+ "@storybook/core-events": "6.0.0-alpha.39",
+ "@storybook/theming": "6.0.0-alpha.39",
"core-js": "^3.0.1",
"global": "^4.3.2",
"memoizerific": "^1.11.3",
diff --git a/app/angular/package.json b/app/angular/package.json
index 2b0ae90f0b2..38003445110 100644
--- a/app/angular/package.json
+++ b/app/angular/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/angular",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Storybook for Angular: Develop Angular Components in isolation with Hot Reloading.",
"keywords": [
"storybook"
@@ -34,9 +34,9 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/core": "6.0.0-alpha.35",
- "@storybook/node-logger": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/core": "6.0.0-alpha.39",
+ "@storybook/node-logger": "6.0.0-alpha.39",
"@types/webpack-env": "^1.15.1",
"core-js": "^3.0.1",
"fork-ts-checker-webpack-plugin": "^4.0.3",
diff --git a/app/ember/package.json b/app/ember/package.json
index 29f221f721f..2dd1972ac5b 100644
--- a/app/ember/package.json
+++ b/app/ember/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/ember",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.",
"homepage": "https://github.com/storybookjs/storybook/tree/master/app/ember",
"bugs": {
@@ -32,7 +32,7 @@
},
"dependencies": {
"@ember/test-helpers": "^1.7.0",
- "@storybook/core": "6.0.0-alpha.35",
+ "@storybook/core": "6.0.0-alpha.39",
"core-js": "^3.0.1",
"global": "^4.3.2",
"regenerator-runtime": "^0.13.3",
diff --git a/app/html/package.json b/app/html/package.json
index 0e6bff09de7..a7826fd2874 100644
--- a/app/html/package.json
+++ b/app/html/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/html",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.",
"keywords": [
"storybook"
@@ -34,8 +34,8 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/core": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/core": "6.0.0-alpha.39",
"@types/webpack-env": "^1.15.1",
"core-js": "^3.0.1",
"global": "^4.3.2",
diff --git a/app/marionette/package.json b/app/marionette/package.json
index 6268129f322..78064968bad 100644
--- a/app/marionette/package.json
+++ b/app/marionette/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/marionette",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Storybook for Marionette: Develop Marionette.js component in isolation with Hot Reloading.",
"keywords": [
"storybook"
@@ -25,7 +25,7 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/core": "6.0.0-alpha.35",
+ "@storybook/core": "6.0.0-alpha.39",
"common-tags": "^1.8.0",
"core-js": "^3.0.1",
"global": "^4.3.2",
diff --git a/app/marko/package.json b/app/marko/package.json
index fa46b63116f..ad0a4ff5d0d 100644
--- a/app/marko/package.json
+++ b/app/marko/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/marko",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Storybook for Marko: Develop Marko Component in isolation with Hot Reloading.",
"keywords": [
"storybook"
@@ -34,8 +34,8 @@
},
"dependencies": {
"@marko/webpack": "^2.1.0",
- "@storybook/client-logger": "6.0.0-alpha.35",
- "@storybook/core": "6.0.0-alpha.35",
+ "@storybook/client-logger": "6.0.0-alpha.39",
+ "@storybook/core": "6.0.0-alpha.39",
"core-js": "^3.0.1",
"global": "^4.3.2",
"regenerator-runtime": "^0.13.3",
diff --git a/app/mithril/package.json b/app/mithril/package.json
index 3e1816fb6aa..692ccc34419 100644
--- a/app/mithril/package.json
+++ b/app/mithril/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/mithril",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Storybook for Mithril: Develop Mithril Component in isolation.",
"keywords": [
"storybook"
@@ -36,8 +36,8 @@
"dependencies": {
"@babel/core": "^7.8.4",
"@babel/plugin-transform-react-jsx": "^7.3.0",
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/core": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/core": "6.0.0-alpha.39",
"@types/mithril": "^2.0.0",
"@types/webpack-env": "^1.15.1",
"core-js": "^3.0.1",
diff --git a/app/preact/package.json b/app/preact/package.json
index 4eb083d21fa..72a125056ed 100644
--- a/app/preact/package.json
+++ b/app/preact/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/preact",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Storybook for Preact: Develop Preact Component in isolation.",
"keywords": [
"storybook"
@@ -35,8 +35,8 @@
},
"dependencies": {
"@babel/plugin-transform-react-jsx": "^7.3.0",
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/core": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/core": "6.0.0-alpha.39",
"@types/webpack-env": "^1.15.1",
"core-js": "^3.0.1",
"global": "^4.3.2",
diff --git a/app/rax/package.json b/app/rax/package.json
index c9150359f88..f83ce352cc0 100644
--- a/app/rax/package.json
+++ b/app/rax/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/rax",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Storybook for Rax: Develop Rax Component in isolation.",
"keywords": [
"rax",
@@ -34,7 +34,7 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/core": "6.0.0-alpha.35",
+ "@storybook/core": "6.0.0-alpha.39",
"babel-preset-rax": "^1.0.0-beta.0",
"core-js": "^3.0.1",
"driver-dom": "^2.0.0",
diff --git a/app/react/package.json b/app/react/package.json
index 4624e605dc9..138dcc0f772 100644
--- a/app/react/package.json
+++ b/app/react/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/react",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Storybook for React: Develop React Component in isolation with Hot Reloading.",
"keywords": [
"storybook"
@@ -37,9 +37,9 @@
"@babel/plugin-transform-react-constant-elements": "^7.6.3",
"@babel/preset-flow": "^7.0.0",
"@babel/preset-react": "^7.0.0",
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/core": "6.0.0-alpha.35",
- "@storybook/node-logger": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/core": "6.0.0-alpha.39",
+ "@storybook/node-logger": "6.0.0-alpha.39",
"@svgr/webpack": "^5.1.0",
"@types/webpack-env": "^1.15.1",
"babel-plugin-add-react-displayname": "^0.0.5",
@@ -57,7 +57,7 @@
"webpack": "^4.33.0"
},
"devDependencies": {
- "@storybook/client-api": "6.0.0-alpha.35",
+ "@storybook/client-api": "6.0.0-alpha.39",
"@types/mini-css-extract-plugin": "^0.9.0",
"@types/node": "^13.9.5",
"@types/webpack": "^4.41.9"
diff --git a/app/react/src/server/framework-preset-cra.ts b/app/react/src/server/framework-preset-cra.ts
index c10fac85194..205a22e2ae0 100644
--- a/app/react/src/server/framework-preset-cra.ts
+++ b/app/react/src/server/framework-preset-cra.ts
@@ -15,7 +15,7 @@ const checkForNewPreset = (presetsList: Preset[]) => {
if (!hasNewPreset) {
logger.warn('Storybook support for Create React App is now a separate preset.');
logger.warn(
- 'To get started with the new preset, simply add `@storybook/preset-create-react-app` to your project.'
+ 'To use the new preset, add `@storybook/preset-create-react-app` to the list of `addons` in your `.storybook/main.js` config file.'
);
logger.warn('The built-in preset will be disabled in Storybook 6.0.');
return false;
diff --git a/app/riot/package.json b/app/riot/package.json
index b059a3f9fbb..dafcccab88d 100644
--- a/app/riot/package.json
+++ b/app/riot/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/riot",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Storybook for riot.js: View riot snippets in isolation with Hot Reloading.",
"keywords": [
"storybook"
@@ -34,7 +34,7 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/core": "6.0.0-alpha.35",
+ "@storybook/core": "6.0.0-alpha.39",
"core-js": "^3.0.1",
"global": "^4.3.2",
"raw-loader": "^4.0.0",
diff --git a/app/server/package.json b/app/server/package.json
index bf8b93a7a07..6b9e8525b16 100644
--- a/app/server/package.json
+++ b/app/server/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/server",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.",
"keywords": [
"storybook"
@@ -34,8 +34,8 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/core": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/core": "6.0.0-alpha.39",
"@storybook/node-logger": "^5.2.8",
"@types/webpack-env": "^1.13.9",
"core-js": "^3.0.1",
diff --git a/app/server/src/lib/compiler/__testfixtures__/knobs.json b/app/server/src/lib/compiler/__testfixtures__/knobs.json
index b62edc82bdc..fc10ce3062e 100644
--- a/app/server/src/lib/compiler/__testfixtures__/knobs.json
+++ b/app/server/src/lib/compiler/__testfixtures__/knobs.json
@@ -12,7 +12,24 @@
},
"knobs": [
{ "type": "text", "name": "Name", "value": "John Doe", "param": "name"},
- { "type": "number", "name": "Age", "value": 44, "param": "age"}
+ { "type": "date", "name": "Birthday", "value": "1960-12-25T00:42:03.600Z", "param": "birthday"},
+ { "type": "color", "name": "Favorite Color", "value": "red", "param": "favorite_color"},
+ { "type": "boolean", "name": "Active", "value": true, "param": "active"},
+ { "type": "number", "name": "Pets", "value": 2, "param": "pets"},
+ { "type": "array", "name": "Sports", "value": ["football", "baseball"], "param": "sports"},
+ {
+ "type": "select",
+ "name": "Favorite Food",
+ "value": "Ice Cream",
+ "options": {
+ "hot_dog": "Hot Dog",
+ "pizza": "Pizza",
+ "burgers": "Burgers",
+ "ice_cream": "Ice Cream"
+ },
+ "param": "favorite_food"
+ },
+ { "type": "object", "name": "Other Things", "value": {"hair": "Brown", "eyes": "Blue"}, "param": "other_thinkgs"}
]
}
]
diff --git a/app/server/src/lib/compiler/__testfixtures__/knobs.snapshot b/app/server/src/lib/compiler/__testfixtures__/knobs.snapshot
index 0b385ccad0b..e6d54bc510d 100644
--- a/app/server/src/lib/compiler/__testfixtures__/knobs.snapshot
+++ b/app/server/src/lib/compiler/__testfixtures__/knobs.snapshot
@@ -18,7 +18,24 @@ export default {
export const Simple = () => {
return {
name: text('Name', 'John Doe'),
- age: number('Age', 44, {}),
+ birthday: new Date(date('Birthday', new Date('1960-12-25T00:42:03.600Z'))).toISOString(),
+ favorite_color: color('Favorite Color', 'red'),
+ active: boolean('Active', true),
+ pets: number('Pets', 2, {}),
+ sports: array('Sports', [
+ 'football',
+ 'baseball'
+ ], ',').join(','),
+ favorite_food: select('Favorite Food', {
+ hot_dog: 'Hot Dog',
+ pizza: 'Pizza',
+ burgers: 'Burgers',
+ ice_cream: 'Ice Cream'
+ }, 'Ice Cream'),
+ other_thinkgs: JSON.stringify(object('Other Things', {
+ hair: 'Brown',
+ eyes: 'Blue'
+ })),
};
};
Simple.story = {
diff --git a/app/server/src/lib/compiler/decorators/knobs.ts b/app/server/src/lib/compiler/decorators/knobs.ts
index c7e591f60e4..ac93b1842cc 100644
--- a/app/server/src/lib/compiler/decorators/knobs.ts
+++ b/app/server/src/lib/compiler/decorators/knobs.ts
@@ -27,14 +27,16 @@ function stringifyKnob(knob: StoryKnob) {
return `number('${name}', ${stringifiedValue}, ${stringifyObject(opts, level)})`;
case 'color':
return `color('${name}', ${stringifiedValue})`;
- case 'array':
- return `array('${name}', ${stringifiedValue}).join(',')`;
+ case 'array': {
+ const separator = opts.separator || ',';
+ return `array('${name}', ${stringifiedValue}, '${separator}').join('${separator}')`;
+ }
case 'boolean':
return `boolean('${name}', ${stringifiedValue})`;
case 'object':
- return `object('${name}', ${stringifiedValue})`;
+ return `JSON.stringify(object('${name}', ${stringifiedValue}))`;
case 'date':
- return `date('${name}', new Date(${stringifiedValue}))`;
+ return `new Date(date('${name}', new Date(${stringifiedValue}))).toISOString()`;
case 'select':
return `select('${name}', ${stringifyObject(opts.options, level)}, ${stringifiedValue})`;
default:
diff --git a/app/svelte/package.json b/app/svelte/package.json
index ac7bac68c36..8896eed2446 100644
--- a/app/svelte/package.json
+++ b/app/svelte/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/svelte",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.",
"keywords": [
"storybook"
@@ -34,8 +34,8 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/core": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/core": "6.0.0-alpha.39",
"core-js": "^3.0.1",
"global": "^4.3.2",
"regenerator-runtime": "^0.13.3",
diff --git a/app/vue/package.json b/app/vue/package.json
index 60f84532ffc..5711387eb70 100644
--- a/app/vue/package.json
+++ b/app/vue/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/vue",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Storybook for Vue: Develop Vue Component in isolation with Hot Reloading.",
"keywords": [
"storybook"
@@ -34,8 +34,8 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/core": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/core": "6.0.0-alpha.39",
"@types/webpack-env": "^1.15.1",
"core-js": "^3.0.1",
"global": "^4.3.2",
diff --git a/app/web-components/package.json b/app/web-components/package.json
index 4ec4145e000..4a6798a634a 100644
--- a/app/web-components/package.json
+++ b/app/web-components/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/web-components",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Storybook for web-components: View web components snippets in isolation with Hot Reloading.",
"keywords": [
"lit-html",
@@ -38,8 +38,8 @@
"dependencies": {
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/plugin-syntax-import-meta": "^7.2.0",
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/core": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/core": "6.0.0-alpha.39",
"@types/webpack-env": "^1.15.1",
"babel-plugin-bundled-import-meta": "^0.3.1",
"core-js": "^3.0.1",
diff --git a/dev-kits/addon-decorator/package.json b/dev-kits/addon-decorator/package.json
index b5730359d0c..4a70bdaa87f 100644
--- a/dev-kits/addon-decorator/package.json
+++ b/dev-kits/addon-decorator/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-decorator",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "decorator addon for storybook",
"keywords": [
"addon",
@@ -24,8 +24,8 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/client-api": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/client-api": "6.0.0-alpha.39",
"core-js": "^3.0.1",
"global": "^4.4.0"
},
diff --git a/dev-kits/addon-parameter/package.json b/dev-kits/addon-parameter/package.json
index b85935d30ea..875d3003772 100644
--- a/dev-kits/addon-parameter/package.json
+++ b/dev-kits/addon-parameter/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-parameter",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "parameter addon for storybook",
"keywords": [
"addon",
@@ -24,12 +24,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/api": "6.0.0-alpha.35",
- "@storybook/client-logger": "6.0.0-alpha.35",
- "@storybook/components": "6.0.0-alpha.35",
- "@storybook/core-events": "6.0.0-alpha.35",
- "@storybook/theming": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/api": "6.0.0-alpha.39",
+ "@storybook/client-logger": "6.0.0-alpha.39",
+ "@storybook/components": "6.0.0-alpha.39",
+ "@storybook/core-events": "6.0.0-alpha.39",
+ "@storybook/theming": "6.0.0-alpha.39",
"core-js": "^3.0.1",
"global": "^4.3.2",
"react": "^16.8.3",
diff --git a/dev-kits/addon-preview-wrapper/package.json b/dev-kits/addon-preview-wrapper/package.json
index 2a72b0b059b..d36b3b07324 100644
--- a/dev-kits/addon-preview-wrapper/package.json
+++ b/dev-kits/addon-preview-wrapper/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-preview-wrapper",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "preview wrapper addon for storybook",
"keywords": [
"addon",
@@ -24,7 +24,7 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/addons": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
"react": "^16.8.3"
},
"publishConfig": {
diff --git a/dev-kits/addon-roundtrip/package.json b/dev-kits/addon-roundtrip/package.json
index b7653b12567..d289a73fc1a 100644
--- a/dev-kits/addon-roundtrip/package.json
+++ b/dev-kits/addon-roundtrip/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-roundtrip",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "roundtrip addon for storybook",
"keywords": [
"addon",
@@ -24,13 +24,13 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/api": "6.0.0-alpha.35",
- "@storybook/client-api": "6.0.0-alpha.35",
- "@storybook/client-logger": "6.0.0-alpha.35",
- "@storybook/components": "6.0.0-alpha.35",
- "@storybook/core-events": "6.0.0-alpha.35",
- "@storybook/theming": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/api": "6.0.0-alpha.39",
+ "@storybook/client-api": "6.0.0-alpha.39",
+ "@storybook/client-logger": "6.0.0-alpha.39",
+ "@storybook/components": "6.0.0-alpha.39",
+ "@storybook/core-events": "6.0.0-alpha.39",
+ "@storybook/theming": "6.0.0-alpha.39",
"core-js": "^3.0.1",
"global": "^4.3.2",
"react": "^16.8.3",
diff --git a/docs/src/versions/next.json b/docs/src/versions/next.json
index 4d83834cfac..61f8349861b 100644
--- a/docs/src/versions/next.json
+++ b/docs/src/versions/next.json
@@ -1 +1 @@
-{"version":"6.0.0-alpha.35","info":{"plain":"### Bug Fixes\n\n- Core: Fix static build with DLL ([#10377](https://github.com/storybookjs/storybook/pull/10377))\n- Addon-Docs: Fix Args table generation for story with no component ([#10436](https://github.com/storybookjs/storybook/pull/10436))\n\n### Maintenance\n\n- Yarn 2: Fix compatibility with `.storybook/preview.js` file ([#10342](https://github.com/storybookjs/storybook/pull/10342))\n- Official-storybook: Fix passArgsFirst problems ([#10432](https://github.com/storybookjs/storybook/pull/10432))"}}
\ No newline at end of file
+{"version":"6.0.0-alpha.39","info":{"plain":"### Breaking Changes\n\n- Addon-docs: Inline stories in Vue by default ([#10463](https://github.com/storybookjs/storybook/pull/10463))\n\n### Features\n\n- Addon-docs: Provide better props include/exclude features ([#10464](https://github.com/storybookjs/storybook/pull/10464))\n- UI: Improve loading state ([#10444](https://github.com/storybookjs/storybook/pull/10444))\n\n### Bug Fixes\n\n- UI: Fix bad shortcutpage layout ([#10445](https://github.com/storybookjs/storybook/pull/10445))"}}
\ No newline at end of file
diff --git a/examples/angular-cli/package.json b/examples/angular-cli/package.json
index a57187b6d10..8e8f00e423a 100644
--- a/examples/angular-cli/package.json
+++ b/examples/angular-cli/package.json
@@ -1,6 +1,6 @@
{
"name": "angular-cli",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"private": true,
"license": "MIT",
"scripts": {
@@ -37,18 +37,18 @@
"@angular/cli": "^9.1.0",
"@angular/compiler-cli": "^9.1.0",
"@compodoc/compodoc": "^1.1.11",
- "@storybook/addon-a11y": "6.0.0-alpha.35",
- "@storybook/addon-actions": "6.0.0-alpha.35",
- "@storybook/addon-backgrounds": "6.0.0-alpha.35",
- "@storybook/addon-docs": "6.0.0-alpha.35",
- "@storybook/addon-jest": "6.0.0-alpha.35",
- "@storybook/addon-knobs": "6.0.0-alpha.35",
- "@storybook/addon-links": "6.0.0-alpha.35",
- "@storybook/addon-storyshots": "6.0.0-alpha.35",
- "@storybook/addon-storysource": "6.0.0-alpha.35",
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/angular": "6.0.0-alpha.35",
- "@storybook/source-loader": "6.0.0-alpha.35",
+ "@storybook/addon-a11y": "6.0.0-alpha.39",
+ "@storybook/addon-actions": "6.0.0-alpha.39",
+ "@storybook/addon-backgrounds": "6.0.0-alpha.39",
+ "@storybook/addon-docs": "6.0.0-alpha.39",
+ "@storybook/addon-jest": "6.0.0-alpha.39",
+ "@storybook/addon-knobs": "6.0.0-alpha.39",
+ "@storybook/addon-links": "6.0.0-alpha.39",
+ "@storybook/addon-storyshots": "6.0.0-alpha.39",
+ "@storybook/addon-storysource": "6.0.0-alpha.39",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/angular": "6.0.0-alpha.39",
+ "@storybook/source-loader": "6.0.0-alpha.39",
"@types/core-js": "^2.5.0",
"@types/jest": "^25.1.1",
"@types/node": "^13.9.5",
diff --git a/examples/angular-cli/src/stories/__snapshots__/core.stories.storyshot b/examples/angular-cli/src/stories/__snapshots__/core.stories.storyshot
index 2e30e5565a7..7dc28150d59 100644
--- a/examples/angular-cli/src/stories/__snapshots__/core.stories.storyshot
+++ b/examples/angular-cli/src/stories/__snapshots__/core.stories.storyshot
@@ -12,7 +12,16 @@ exports[`Storyshots Core/Parameters passed to story 1`] = `
- Parameters are {"docs":{"iframeHeight":"60px"},"globalParameter":"globalParameter","framework":"angular","chapterParameter":"chapterParameter","storyParameter":"storyParameter","__id":"core-parameters--passed-to-story"}
+ Parameters are {
+ "docs": {
+ "iframeHeight": "60px"
+ },
+ "globalParameter": "globalParameter",
+ "framework": "angular",
+ "chapterParameter": "chapterParameter",
+ "storyParameter": "storyParameter",
+ "__id": "core-parameters--passed-to-story"
+ }
diff --git a/examples/angular-cli/src/stories/core.stories.ts b/examples/angular-cli/src/stories/core.stories.ts
index 91898719d28..a90f94ec0fe 100644
--- a/examples/angular-cli/src/stories/core.stories.ts
+++ b/examples/angular-cli/src/stories/core.stories.ts
@@ -17,7 +17,7 @@ export default {
export const PassedToStory = ({ parameters: { fileName, ...parameters } }) => ({
component: Button,
props: {
- text: `Parameters are ${JSON.stringify(parameters)}`,
+ text: `Parameters are ${JSON.stringify(parameters, null, 2)}`,
onClick: () => 0,
},
});
diff --git a/examples/cra-kitchen-sink/package.json b/examples/cra-kitchen-sink/package.json
index 8bd6ad8c145..f51bf30f46e 100644
--- a/examples/cra-kitchen-sink/package.json
+++ b/examples/cra-kitchen-sink/package.json
@@ -1,6 +1,6 @@
{
"name": "cra-kitchen-sink",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"private": true,
"scripts": {
"build": "react-scripts build",
@@ -18,19 +18,19 @@
"react-lifecycles-compat": "^3.0.4"
},
"devDependencies": {
- "@storybook/addon-a11y": "6.0.0-alpha.35",
- "@storybook/addon-actions": "6.0.0-alpha.35",
- "@storybook/addon-backgrounds": "6.0.0-alpha.35",
- "@storybook/addon-docs": "6.0.0-alpha.35",
- "@storybook/addon-events": "6.0.0-alpha.35",
- "@storybook/addon-jest": "6.0.0-alpha.35",
- "@storybook/addon-knobs": "6.0.0-alpha.35",
- "@storybook/addon-links": "6.0.0-alpha.35",
- "@storybook/addon-storyshots": "6.0.0-alpha.35",
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/client-logger": "6.0.0-alpha.35",
- "@storybook/react": "6.0.0-alpha.35",
- "@storybook/theming": "6.0.0-alpha.35",
+ "@storybook/addon-a11y": "6.0.0-alpha.39",
+ "@storybook/addon-actions": "6.0.0-alpha.39",
+ "@storybook/addon-backgrounds": "6.0.0-alpha.39",
+ "@storybook/addon-docs": "6.0.0-alpha.39",
+ "@storybook/addon-events": "6.0.0-alpha.39",
+ "@storybook/addon-jest": "6.0.0-alpha.39",
+ "@storybook/addon-knobs": "6.0.0-alpha.39",
+ "@storybook/addon-links": "6.0.0-alpha.39",
+ "@storybook/addon-storyshots": "6.0.0-alpha.39",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/client-logger": "6.0.0-alpha.39",
+ "@storybook/react": "6.0.0-alpha.39",
+ "@storybook/theming": "6.0.0-alpha.39",
"react-scripts": "^3.0.1"
},
"storybook": {
diff --git a/examples/cra-react15/package.json b/examples/cra-react15/package.json
index 35df6331dee..f6df9a56aad 100644
--- a/examples/cra-react15/package.json
+++ b/examples/cra-react15/package.json
@@ -1,6 +1,6 @@
{
"name": "cra-react15",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"private": true,
"scripts": {
"build": "react-scripts build",
@@ -18,11 +18,11 @@
"react-scripts": "3.0.1"
},
"devDependencies": {
- "@storybook/addon-actions": "6.0.0-alpha.35",
- "@storybook/addon-links": "6.0.0-alpha.35",
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/react": "6.0.0-alpha.35",
- "@storybook/theming": "6.0.0-alpha.35",
+ "@storybook/addon-actions": "6.0.0-alpha.39",
+ "@storybook/addon-links": "6.0.0-alpha.39",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/react": "6.0.0-alpha.39",
+ "@storybook/theming": "6.0.0-alpha.39",
"babel-core": "6",
"babel-runtime": "6"
},
diff --git a/examples/cra-ts-essentials/package.json b/examples/cra-ts-essentials/package.json
index 43ec016cbfa..8179b3a5b63 100644
--- a/examples/cra-ts-essentials/package.json
+++ b/examples/cra-ts-essentials/package.json
@@ -1,6 +1,6 @@
{
"name": "cra-ts-essentials",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"private": true,
"scripts": {
"build": "react-scripts build",
@@ -34,10 +34,10 @@
"typescript": "3.8.3"
},
"devDependencies": {
- "@storybook/addon-essentials": "6.0.0-alpha.35",
- "@storybook/addons": "6.0.0-alpha.35",
+ "@storybook/addon-essentials": "6.0.0-alpha.39",
+ "@storybook/addons": "6.0.0-alpha.39",
"@storybook/preset-create-react-app": "^2.1.1",
- "@storybook/react": "6.0.0-alpha.35"
+ "@storybook/react": "6.0.0-alpha.39"
},
"storybook": {
"chromatic": {
diff --git a/examples/cra-ts-kitchen-sink/package.json b/examples/cra-ts-kitchen-sink/package.json
index fe4bda2c4c8..bbbe931bc70 100644
--- a/examples/cra-ts-kitchen-sink/package.json
+++ b/examples/cra-ts-kitchen-sink/package.json
@@ -1,6 +1,6 @@
{
"name": "cra-ts-kitchen-sink",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"private": true,
"scripts": {
"build": "react-scripts build",
@@ -34,13 +34,13 @@
"typescript": "3.8.3"
},
"devDependencies": {
- "@storybook/addon-a11y": "6.0.0-alpha.35",
- "@storybook/addon-actions": "6.0.0-alpha.35",
- "@storybook/addon-knobs": "6.0.0-alpha.35",
- "@storybook/addon-links": "6.0.0-alpha.35",
- "@storybook/addons": "6.0.0-alpha.35",
+ "@storybook/addon-a11y": "6.0.0-alpha.39",
+ "@storybook/addon-actions": "6.0.0-alpha.39",
+ "@storybook/addon-knobs": "6.0.0-alpha.39",
+ "@storybook/addon-links": "6.0.0-alpha.39",
+ "@storybook/addons": "6.0.0-alpha.39",
"@storybook/preset-create-react-app": "^2.1.1",
- "@storybook/react": "6.0.0-alpha.35",
+ "@storybook/react": "6.0.0-alpha.39",
"@types/enzyme": "^3.9.0",
"enzyme": "^3.9.0",
"enzyme-adapter-react-16": "^1.9.1",
diff --git a/examples/dev-kits/package.json b/examples/dev-kits/package.json
index 7b3385d7fab..d81410ea637 100644
--- a/examples/dev-kits/package.json
+++ b/examples/dev-kits/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/example-devkits",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"private": true,
"scripts": {
"build-storybook": "cross-env STORYBOOK_DISPLAY_WARNING=true DISPLAY_WARNING=true build-storybook -c ./",
@@ -8,18 +8,18 @@
"storybook": "cross-env STORYBOOK_DISPLAY_WARNING=true DISPLAY_WARNING=true start-storybook -p 9011 -c ./ --no-dll"
},
"devDependencies": {
- "@storybook/addon-decorator": "6.0.0-alpha.35",
- "@storybook/addon-parameter": "6.0.0-alpha.35",
- "@storybook/addon-preview-wrapper": "6.0.0-alpha.35",
- "@storybook/addon-roundtrip": "6.0.0-alpha.35",
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/api": "6.0.0-alpha.35",
- "@storybook/client-api": "6.0.0-alpha.35",
- "@storybook/components": "6.0.0-alpha.35",
- "@storybook/core-events": "6.0.0-alpha.35",
- "@storybook/node-logger": "6.0.0-alpha.35",
- "@storybook/react": "6.0.0-alpha.35",
- "@storybook/theming": "6.0.0-alpha.35",
+ "@storybook/addon-decorator": "6.0.0-alpha.39",
+ "@storybook/addon-parameter": "6.0.0-alpha.39",
+ "@storybook/addon-preview-wrapper": "6.0.0-alpha.39",
+ "@storybook/addon-roundtrip": "6.0.0-alpha.39",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/api": "6.0.0-alpha.39",
+ "@storybook/client-api": "6.0.0-alpha.39",
+ "@storybook/components": "6.0.0-alpha.39",
+ "@storybook/core-events": "6.0.0-alpha.39",
+ "@storybook/node-logger": "6.0.0-alpha.39",
+ "@storybook/react": "6.0.0-alpha.39",
+ "@storybook/theming": "6.0.0-alpha.39",
"cors": "^2.8.5",
"cross-env": "^7.0.0",
"enzyme-to-json": "^3.4.1",
diff --git a/examples/ember-cli/package.json b/examples/ember-cli/package.json
index 2822aa182c2..76b908f092f 100644
--- a/examples/ember-cli/package.json
+++ b/examples/ember-cli/package.json
@@ -1,6 +1,6 @@
{
"name": "ember-example",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"private": true,
"scripts": {
"build": "ember build --output-path ember-output",
@@ -16,18 +16,18 @@
"devDependencies": {
"@babel/core": "^7.8.4",
"@ember/optional-features": "^1.3.0",
- "@storybook/addon-a11y": "6.0.0-alpha.35",
- "@storybook/addon-actions": "6.0.0-alpha.35",
- "@storybook/addon-backgrounds": "6.0.0-alpha.35",
- "@storybook/addon-docs": "6.0.0-alpha.35",
- "@storybook/addon-knobs": "6.0.0-alpha.35",
- "@storybook/addon-links": "6.0.0-alpha.35",
- "@storybook/addon-storysource": "6.0.0-alpha.35",
- "@storybook/addon-viewport": "6.0.0-alpha.35",
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/ember": "6.0.0-alpha.35",
+ "@storybook/addon-a11y": "6.0.0-alpha.39",
+ "@storybook/addon-actions": "6.0.0-alpha.39",
+ "@storybook/addon-backgrounds": "6.0.0-alpha.39",
+ "@storybook/addon-docs": "6.0.0-alpha.39",
+ "@storybook/addon-knobs": "6.0.0-alpha.39",
+ "@storybook/addon-links": "6.0.0-alpha.39",
+ "@storybook/addon-storysource": "6.0.0-alpha.39",
+ "@storybook/addon-viewport": "6.0.0-alpha.39",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/ember": "6.0.0-alpha.39",
"@storybook/ember-cli-storybook": "^0.2.1",
- "@storybook/source-loader": "6.0.0-alpha.35",
+ "@storybook/source-loader": "6.0.0-alpha.39",
"babel-loader": "^8",
"broccoli-asset-rev": "^3.0.0",
"cross-env": "^7.0.0",
diff --git a/examples/html-kitchen-sink/package.json b/examples/html-kitchen-sink/package.json
index 4941fc0757b..193bcf78bf6 100644
--- a/examples/html-kitchen-sink/package.json
+++ b/examples/html-kitchen-sink/package.json
@@ -1,6 +1,6 @@
{
"name": "html-kitchen-sink",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"private": true,
"description": "",
"keywords": [],
@@ -13,23 +13,23 @@
"storybook": "start-storybook -p 9006"
},
"devDependencies": {
- "@storybook/addon-a11y": "6.0.0-alpha.35",
- "@storybook/addon-actions": "6.0.0-alpha.35",
- "@storybook/addon-backgrounds": "6.0.0-alpha.35",
- "@storybook/addon-docs": "6.0.0-alpha.35",
- "@storybook/addon-events": "6.0.0-alpha.35",
- "@storybook/addon-jest": "6.0.0-alpha.35",
- "@storybook/addon-knobs": "6.0.0-alpha.35",
- "@storybook/addon-links": "6.0.0-alpha.35",
- "@storybook/addon-storyshots": "6.0.0-alpha.35",
- "@storybook/addon-storysource": "6.0.0-alpha.35",
- "@storybook/addon-viewport": "6.0.0-alpha.35",
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/client-api": "6.0.0-alpha.35",
- "@storybook/core": "6.0.0-alpha.35",
- "@storybook/core-events": "6.0.0-alpha.35",
- "@storybook/html": "6.0.0-alpha.35",
- "@storybook/source-loader": "6.0.0-alpha.35",
+ "@storybook/addon-a11y": "6.0.0-alpha.39",
+ "@storybook/addon-actions": "6.0.0-alpha.39",
+ "@storybook/addon-backgrounds": "6.0.0-alpha.39",
+ "@storybook/addon-docs": "6.0.0-alpha.39",
+ "@storybook/addon-events": "6.0.0-alpha.39",
+ "@storybook/addon-jest": "6.0.0-alpha.39",
+ "@storybook/addon-knobs": "6.0.0-alpha.39",
+ "@storybook/addon-links": "6.0.0-alpha.39",
+ "@storybook/addon-storyshots": "6.0.0-alpha.39",
+ "@storybook/addon-storysource": "6.0.0-alpha.39",
+ "@storybook/addon-viewport": "6.0.0-alpha.39",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/client-api": "6.0.0-alpha.39",
+ "@storybook/core": "6.0.0-alpha.39",
+ "@storybook/core-events": "6.0.0-alpha.39",
+ "@storybook/html": "6.0.0-alpha.39",
+ "@storybook/source-loader": "6.0.0-alpha.39",
"eventemitter3": "^4.0.0",
"format-json": "^1.0.3",
"global": "^4.3.2",
diff --git a/examples/marko-cli/package.json b/examples/marko-cli/package.json
index ad7560a7527..fe3066cb304 100644
--- a/examples/marko-cli/package.json
+++ b/examples/marko-cli/package.json
@@ -1,6 +1,6 @@
{
"name": "marko-cli",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"private": true,
"description": "Demo of how to build an app using marko-starter",
"repository": {
@@ -23,13 +23,13 @@
"marko-starter": "^2.1.0"
},
"devDependencies": {
- "@storybook/addon-a11y": "6.0.0-alpha.35",
- "@storybook/addon-actions": "6.0.0-alpha.35",
- "@storybook/addon-knobs": "6.0.0-alpha.35",
- "@storybook/addon-storysource": "6.0.0-alpha.35",
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/marko": "6.0.0-alpha.35",
- "@storybook/source-loader": "6.0.0-alpha.35",
+ "@storybook/addon-a11y": "6.0.0-alpha.39",
+ "@storybook/addon-actions": "6.0.0-alpha.39",
+ "@storybook/addon-knobs": "6.0.0-alpha.39",
+ "@storybook/addon-storysource": "6.0.0-alpha.39",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/marko": "6.0.0-alpha.39",
+ "@storybook/source-loader": "6.0.0-alpha.39",
"prettier": "^2.0.2",
"webpack": "^4.33.0"
},
diff --git a/examples/mithril-kitchen-sink/package.json b/examples/mithril-kitchen-sink/package.json
index f86d4fc929c..27ede47b162 100644
--- a/examples/mithril-kitchen-sink/package.json
+++ b/examples/mithril-kitchen-sink/package.json
@@ -1,6 +1,6 @@
{
"name": "mithril-example",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"private": true,
"scripts": {
"build-storybook": "build-storybook",
@@ -10,17 +10,17 @@
"mithril": "^1.1.6"
},
"devDependencies": {
- "@storybook/addon-a11y": "6.0.0-alpha.35",
- "@storybook/addon-actions": "6.0.0-alpha.35",
- "@storybook/addon-backgrounds": "6.0.0-alpha.35",
- "@storybook/addon-knobs": "6.0.0-alpha.35",
- "@storybook/addon-links": "6.0.0-alpha.35",
- "@storybook/addon-storyshots": "6.0.0-alpha.35",
- "@storybook/addon-storysource": "6.0.0-alpha.35",
- "@storybook/addon-viewport": "6.0.0-alpha.35",
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/mithril": "6.0.0-alpha.35",
- "@storybook/source-loader": "6.0.0-alpha.35",
+ "@storybook/addon-a11y": "6.0.0-alpha.39",
+ "@storybook/addon-actions": "6.0.0-alpha.39",
+ "@storybook/addon-backgrounds": "6.0.0-alpha.39",
+ "@storybook/addon-knobs": "6.0.0-alpha.39",
+ "@storybook/addon-links": "6.0.0-alpha.39",
+ "@storybook/addon-storyshots": "6.0.0-alpha.39",
+ "@storybook/addon-storysource": "6.0.0-alpha.39",
+ "@storybook/addon-viewport": "6.0.0-alpha.39",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/mithril": "6.0.0-alpha.39",
+ "@storybook/source-loader": "6.0.0-alpha.39",
"webpack": "^4.33.0"
},
"storybook": {
diff --git a/examples/official-storybook/package.json b/examples/official-storybook/package.json
index b2860d033a3..ba54334780f 100644
--- a/examples/official-storybook/package.json
+++ b/examples/official-storybook/package.json
@@ -1,6 +1,6 @@
{
"name": "official-storybook",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"private": true,
"scripts": {
"build-storybook": "cross-env STORYBOOK_DISPLAY_WARNING=true DISPLAY_WARNING=true build-storybook -c ./",
@@ -14,32 +14,32 @@
},
"devDependencies": {
"@packtracker/webpack-plugin": "^2.0.1",
- "@storybook/addon-a11y": "6.0.0-alpha.35",
- "@storybook/addon-actions": "6.0.0-alpha.35",
- "@storybook/addon-backgrounds": "6.0.0-alpha.35",
- "@storybook/addon-contexts": "6.0.0-alpha.35",
- "@storybook/addon-cssresources": "6.0.0-alpha.35",
- "@storybook/addon-design-assets": "6.0.0-alpha.35",
- "@storybook/addon-docs": "6.0.0-alpha.35",
- "@storybook/addon-events": "6.0.0-alpha.35",
- "@storybook/addon-graphql": "6.0.0-alpha.35",
- "@storybook/addon-jest": "6.0.0-alpha.35",
- "@storybook/addon-knobs": "6.0.0-alpha.35",
- "@storybook/addon-links": "6.0.0-alpha.35",
- "@storybook/addon-queryparams": "6.0.0-alpha.35",
- "@storybook/addon-storyshots": "6.0.0-alpha.35",
- "@storybook/addon-storyshots-puppeteer": "6.0.0-alpha.35",
- "@storybook/addon-storysource": "6.0.0-alpha.35",
- "@storybook/addon-toolbars": "6.0.0-alpha.35",
- "@storybook/addon-viewport": "6.0.0-alpha.35",
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/cli": "6.0.0-alpha.35",
- "@storybook/components": "6.0.0-alpha.35",
- "@storybook/core-events": "6.0.0-alpha.35",
- "@storybook/node-logger": "6.0.0-alpha.35",
- "@storybook/react": "6.0.0-alpha.35",
- "@storybook/source-loader": "6.0.0-alpha.35",
- "@storybook/theming": "6.0.0-alpha.35",
+ "@storybook/addon-a11y": "6.0.0-alpha.39",
+ "@storybook/addon-actions": "6.0.0-alpha.39",
+ "@storybook/addon-backgrounds": "6.0.0-alpha.39",
+ "@storybook/addon-contexts": "6.0.0-alpha.39",
+ "@storybook/addon-cssresources": "6.0.0-alpha.39",
+ "@storybook/addon-design-assets": "6.0.0-alpha.39",
+ "@storybook/addon-docs": "6.0.0-alpha.39",
+ "@storybook/addon-events": "6.0.0-alpha.39",
+ "@storybook/addon-graphql": "6.0.0-alpha.39",
+ "@storybook/addon-jest": "6.0.0-alpha.39",
+ "@storybook/addon-knobs": "6.0.0-alpha.39",
+ "@storybook/addon-links": "6.0.0-alpha.39",
+ "@storybook/addon-queryparams": "6.0.0-alpha.39",
+ "@storybook/addon-storyshots": "6.0.0-alpha.39",
+ "@storybook/addon-storyshots-puppeteer": "6.0.0-alpha.39",
+ "@storybook/addon-storysource": "6.0.0-alpha.39",
+ "@storybook/addon-toolbars": "6.0.0-alpha.39",
+ "@storybook/addon-viewport": "6.0.0-alpha.39",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/cli": "6.0.0-alpha.39",
+ "@storybook/components": "6.0.0-alpha.39",
+ "@storybook/core-events": "6.0.0-alpha.39",
+ "@storybook/node-logger": "6.0.0-alpha.39",
+ "@storybook/react": "6.0.0-alpha.39",
+ "@storybook/source-loader": "6.0.0-alpha.39",
+ "@storybook/theming": "6.0.0-alpha.39",
"cors": "^2.8.5",
"cross-env": "^7.0.0",
"enzyme-to-json": "^3.4.1",
diff --git a/examples/official-storybook/stories/addon-docs/props-include-exclude.stories.mdx b/examples/official-storybook/stories/addon-docs/props-include-exclude.stories.mdx
new file mode 100644
index 00000000000..ebb880497ee
--- /dev/null
+++ b/examples/official-storybook/stories/addon-docs/props-include-exclude.stories.mdx
@@ -0,0 +1,24 @@
+import { Props, Meta } from '@storybook/addon-docs/blocks';
+import { DocgenButton } from '../../components/DocgenButton';
+
+
+
+## Include
+
+### Array
+
+
+
+### Regex
+
+
+
+## Exclude
+
+### Regex
+
+
+
+## Mixed
+
+
diff --git a/examples/official-storybook/stories/core/parameters.stories.js b/examples/official-storybook/stories/core/parameters.stories.js
index 4644ce98aa5..5f69e3e5f3d 100644
--- a/examples/official-storybook/stories/core/parameters.stories.js
+++ b/examples/official-storybook/stories/core/parameters.stories.js
@@ -15,7 +15,10 @@ export default {
// I'm not sure what we should recommend regarding propTypes? are they a good idea for examples?
// Given we sort of control the props, should we export a prop type?
export const Passed = (_args, { parameters: { options, fileName, ...parameters }, ...rest }) => (
- Parameters: {JSON.stringify(parameters, null, 2)}
+
+ Parameters:
+
{JSON.stringify(parameters, null, 2)}
+
);
Passed.story = {
name: 'passed to story',
diff --git a/examples/preact-kitchen-sink/package.json b/examples/preact-kitchen-sink/package.json
index d0fabc14bd5..e7e906729a2 100644
--- a/examples/preact-kitchen-sink/package.json
+++ b/examples/preact-kitchen-sink/package.json
@@ -1,6 +1,6 @@
{
"name": "preact-example",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"private": true,
"scripts": {
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules",
@@ -15,18 +15,18 @@
"devDependencies": {
"@babel/core": "^7.8.4",
"@babel/plugin-transform-runtime": "^7.2.0",
- "@storybook/addon-a11y": "6.0.0-alpha.35",
- "@storybook/addon-actions": "6.0.0-alpha.35",
- "@storybook/addon-backgrounds": "6.0.0-alpha.35",
- "@storybook/addon-contexts": "6.0.0-alpha.35",
- "@storybook/addon-knobs": "6.0.0-alpha.35",
- "@storybook/addon-links": "6.0.0-alpha.35",
- "@storybook/addon-storyshots": "6.0.0-alpha.35",
- "@storybook/addon-storysource": "6.0.0-alpha.35",
- "@storybook/addon-viewport": "6.0.0-alpha.35",
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/preact": "6.0.0-alpha.35",
- "@storybook/source-loader": "6.0.0-alpha.35",
+ "@storybook/addon-a11y": "6.0.0-alpha.39",
+ "@storybook/addon-actions": "6.0.0-alpha.39",
+ "@storybook/addon-backgrounds": "6.0.0-alpha.39",
+ "@storybook/addon-contexts": "6.0.0-alpha.39",
+ "@storybook/addon-knobs": "6.0.0-alpha.39",
+ "@storybook/addon-links": "6.0.0-alpha.39",
+ "@storybook/addon-storyshots": "6.0.0-alpha.39",
+ "@storybook/addon-storysource": "6.0.0-alpha.39",
+ "@storybook/addon-viewport": "6.0.0-alpha.39",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/preact": "6.0.0-alpha.39",
+ "@storybook/source-loader": "6.0.0-alpha.39",
"babel-loader": "^8.0.4",
"cross-env": "^7.0.0",
"file-loader": "^6.0.0",
diff --git a/examples/rax-kitchen-sink/package.json b/examples/rax-kitchen-sink/package.json
index 50f09b8c4da..e1741fbde71 100644
--- a/examples/rax-kitchen-sink/package.json
+++ b/examples/rax-kitchen-sink/package.json
@@ -1,6 +1,6 @@
{
"name": "rax-kitchen-sink",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"private": true,
"scripts": {
"build": "build-scripts build",
@@ -20,20 +20,20 @@
"devDependencies": {
"@alib/build-scripts": "^0.1.8",
"@babel/preset-react": "^7.7.4",
- "@storybook/addon-a11y": "6.0.0-alpha.35",
- "@storybook/addon-actions": "6.0.0-alpha.35",
- "@storybook/addon-backgrounds": "6.0.0-alpha.35",
- "@storybook/addon-events": "6.0.0-alpha.35",
- "@storybook/addon-jest": "6.0.0-alpha.35",
- "@storybook/addon-knobs": "6.0.0-alpha.35",
- "@storybook/addon-links": "6.0.0-alpha.35",
- "@storybook/addon-storyshots": "6.0.0-alpha.35",
- "@storybook/addon-storysource": "6.0.0-alpha.35",
- "@storybook/addon-viewport": "6.0.0-alpha.35",
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/rax": "6.0.0-alpha.35",
- "@storybook/source-loader": "6.0.0-alpha.35",
- "@storybook/theming": "6.0.0-alpha.35",
+ "@storybook/addon-a11y": "6.0.0-alpha.39",
+ "@storybook/addon-actions": "6.0.0-alpha.39",
+ "@storybook/addon-backgrounds": "6.0.0-alpha.39",
+ "@storybook/addon-events": "6.0.0-alpha.39",
+ "@storybook/addon-jest": "6.0.0-alpha.39",
+ "@storybook/addon-knobs": "6.0.0-alpha.39",
+ "@storybook/addon-links": "6.0.0-alpha.39",
+ "@storybook/addon-storyshots": "6.0.0-alpha.39",
+ "@storybook/addon-storysource": "6.0.0-alpha.39",
+ "@storybook/addon-viewport": "6.0.0-alpha.39",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/rax": "6.0.0-alpha.39",
+ "@storybook/source-loader": "6.0.0-alpha.39",
+ "@storybook/theming": "6.0.0-alpha.39",
"babel-eslint": "^10.0.3",
"build-plugin-rax-app": "^0.2.0",
"stylesheet-loader": "^0.8.0"
diff --git a/examples/riot-kitchen-sink/package.json b/examples/riot-kitchen-sink/package.json
index 13dbef8cb67..5d76f6fc023 100644
--- a/examples/riot-kitchen-sink/package.json
+++ b/examples/riot-kitchen-sink/package.json
@@ -1,6 +1,6 @@
{
"name": "riot-example",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"private": true,
"scripts": {
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules",
@@ -15,17 +15,17 @@
},
"devDependencies": {
"@babel/core": "^7.8.4",
- "@storybook/addon-a11y": "6.0.0-alpha.35",
- "@storybook/addon-actions": "6.0.0-alpha.35",
- "@storybook/addon-backgrounds": "6.0.0-alpha.35",
- "@storybook/addon-knobs": "6.0.0-alpha.35",
- "@storybook/addon-links": "6.0.0-alpha.35",
- "@storybook/addon-storyshots": "6.0.0-alpha.35",
- "@storybook/addon-storysource": "6.0.0-alpha.35",
- "@storybook/addon-viewport": "6.0.0-alpha.35",
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/riot": "6.0.0-alpha.35",
- "@storybook/source-loader": "6.0.0-alpha.35",
+ "@storybook/addon-a11y": "6.0.0-alpha.39",
+ "@storybook/addon-actions": "6.0.0-alpha.39",
+ "@storybook/addon-backgrounds": "6.0.0-alpha.39",
+ "@storybook/addon-knobs": "6.0.0-alpha.39",
+ "@storybook/addon-links": "6.0.0-alpha.39",
+ "@storybook/addon-storyshots": "6.0.0-alpha.39",
+ "@storybook/addon-storysource": "6.0.0-alpha.39",
+ "@storybook/addon-viewport": "6.0.0-alpha.39",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/riot": "6.0.0-alpha.39",
+ "@storybook/source-loader": "6.0.0-alpha.39",
"babel-loader": "^8.0.4",
"cross-env": "^7.0.0",
"file-loader": "^6.0.0",
diff --git a/examples/riot-kitchen-sink/src/stories/__snapshots__/core.stories.storyshot b/examples/riot-kitchen-sink/src/stories/__snapshots__/core.stories.storyshot
index 5422f7bbe0a..0e6717ef406 100644
--- a/examples/riot-kitchen-sink/src/stories/__snapshots__/core.stories.storyshot
+++ b/examples/riot-kitchen-sink/src/stories/__snapshots__/core.stories.storyshot
@@ -6,7 +6,18 @@ exports[`Storyshots Core/Parameters passed to story 1`] = `
id="root"
>
- Parameters are {"globalParameter":"globalParameter","framework":"riot","chapterParameter":"chapterParameter","__id":"core-parameters--passed-to-story","storyParameter":"storyParameter","id":"root","dataIs":"parameters"}
+ Parameters are
+
+ {
+ "globalParameter": "globalParameter",
+ "framework": "riot",
+ "chapterParameter": "chapterParameter",
+ "__id": "core-parameters--passed-to-story",
+ "storyParameter": "storyParameter",
+ "id": "root",
+ "dataIs": "parameters"
+}
+
`;
diff --git a/examples/riot-kitchen-sink/src/stories/core.stories.js b/examples/riot-kitchen-sink/src/stories/core.stories.js
index 769fe3c2983..f248e1f6def 100644
--- a/examples/riot-kitchen-sink/src/stories/core.stories.js
+++ b/examples/riot-kitchen-sink/src/stories/core.stories.js
@@ -4,7 +4,13 @@ const globalParameter = 'globalParameter';
const chapterParameter = 'chapterParameter';
const storyParameter = 'storyParameter';
-tag('parameters', 'Parameters are {JSON.stringify (this.opts)}
', '', '', () => {});
+tag(
+ 'parameters',
+ 'Parameters are
{JSON.stringify(this.opts, null, 2)} ',
+ '',
+ '',
+ () => {}
+);
addParameters({ globalParameter });
diff --git a/examples/server-kitchen-sink/package.json b/examples/server-kitchen-sink/package.json
index 92ebfd0398b..0182ff5a991 100644
--- a/examples/server-kitchen-sink/package.json
+++ b/examples/server-kitchen-sink/package.json
@@ -1,6 +1,6 @@
{
"name": "server-kitchen-sink",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"private": true,
"description": "",
"keywords": [],
@@ -14,13 +14,13 @@
"storybook": "SERVER_PORT=1137 start-storybook -p 9006 --quiet"
},
"devDependencies": {
- "@storybook/addon-a11y": "6.0.0-alpha.35",
- "@storybook/addon-actions": "6.0.0-alpha.35",
- "@storybook/addon-backgrounds": "6.0.0-alpha.35",
- "@storybook/addon-knobs": "6.0.0-alpha.35",
- "@storybook/addon-links": "6.0.0-alpha.35",
- "@storybook/node-logger": "6.0.0-alpha.35",
- "@storybook/server": "6.0.0-alpha.35",
+ "@storybook/addon-a11y": "6.0.0-alpha.39",
+ "@storybook/addon-actions": "6.0.0-alpha.39",
+ "@storybook/addon-backgrounds": "6.0.0-alpha.39",
+ "@storybook/addon-knobs": "6.0.0-alpha.39",
+ "@storybook/addon-links": "6.0.0-alpha.39",
+ "@storybook/node-logger": "6.0.0-alpha.39",
+ "@storybook/server": "6.0.0-alpha.39",
"concurrently": "^5.0.2",
"cors": "^2.8.5",
"express": "~4.17.1",
diff --git a/examples/standalone-preview/package.json b/examples/standalone-preview/package.json
index 4e2897e5c02..ab81b4fe8ee 100644
--- a/examples/standalone-preview/package.json
+++ b/examples/standalone-preview/package.json
@@ -1,12 +1,12 @@
{
"name": "standalone-preview",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"private": true,
"scripts": {
"storybook": "parcel ./storybook.html --port 1337"
},
"devDependencies": {
- "@storybook/react": "6.0.0-alpha.35",
+ "@storybook/react": "6.0.0-alpha.39",
"parcel": "^1.12.3",
"react": "^16.8.4",
"react-dom": "^16.8.4"
diff --git a/examples/svelte-kitchen-sink/package.json b/examples/svelte-kitchen-sink/package.json
index cd4cce1ce80..4eff15ce036 100644
--- a/examples/svelte-kitchen-sink/package.json
+++ b/examples/svelte-kitchen-sink/package.json
@@ -1,6 +1,6 @@
{
"name": "svelte-example",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"private": true,
"scripts": {
"build-storybook": "build-storybook -s public",
@@ -10,18 +10,18 @@
"global": "^4.3.2"
},
"devDependencies": {
- "@storybook/addon-a11y": "6.0.0-alpha.35",
- "@storybook/addon-actions": "6.0.0-alpha.35",
- "@storybook/addon-backgrounds": "6.0.0-alpha.35",
- "@storybook/addon-docs": "6.0.0-alpha.35",
- "@storybook/addon-knobs": "6.0.0-alpha.35",
- "@storybook/addon-links": "6.0.0-alpha.35",
- "@storybook/addon-storyshots": "6.0.0-alpha.35",
- "@storybook/addon-storysource": "6.0.0-alpha.35",
- "@storybook/addon-viewport": "6.0.0-alpha.35",
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/source-loader": "6.0.0-alpha.35",
- "@storybook/svelte": "6.0.0-alpha.35"
+ "@storybook/addon-a11y": "6.0.0-alpha.39",
+ "@storybook/addon-actions": "6.0.0-alpha.39",
+ "@storybook/addon-backgrounds": "6.0.0-alpha.39",
+ "@storybook/addon-docs": "6.0.0-alpha.39",
+ "@storybook/addon-knobs": "6.0.0-alpha.39",
+ "@storybook/addon-links": "6.0.0-alpha.39",
+ "@storybook/addon-storyshots": "6.0.0-alpha.39",
+ "@storybook/addon-storysource": "6.0.0-alpha.39",
+ "@storybook/addon-viewport": "6.0.0-alpha.39",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/source-loader": "6.0.0-alpha.39",
+ "@storybook/svelte": "6.0.0-alpha.39"
},
"storybook": {
"chromatic": {
diff --git a/examples/vue-kitchen-sink/.storybook/preview.js b/examples/vue-kitchen-sink/.storybook/preview.js
index 463518864b2..bbc8604d3ed 100644
--- a/examples/vue-kitchen-sink/.storybook/preview.js
+++ b/examples/vue-kitchen-sink/.storybook/preview.js
@@ -9,7 +9,6 @@ Vue.use(Vuex);
addParameters({
docs: {
- inlineStories: true,
iframeHeight: '60px',
},
});
diff --git a/examples/vue-kitchen-sink/package.json b/examples/vue-kitchen-sink/package.json
index 6c85fa84919..1c7eb550f5b 100644
--- a/examples/vue-kitchen-sink/package.json
+++ b/examples/vue-kitchen-sink/package.json
@@ -1,6 +1,6 @@
{
"name": "vue-example",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"private": true,
"scripts": {
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules",
@@ -14,19 +14,19 @@
},
"devDependencies": {
"@babel/core": "^7.8.4",
- "@storybook/addon-a11y": "6.0.0-alpha.35",
- "@storybook/addon-actions": "6.0.0-alpha.35",
- "@storybook/addon-backgrounds": "6.0.0-alpha.35",
- "@storybook/addon-contexts": "6.0.0-alpha.35",
- "@storybook/addon-docs": "6.0.0-alpha.35",
- "@storybook/addon-knobs": "6.0.0-alpha.35",
- "@storybook/addon-links": "6.0.0-alpha.35",
- "@storybook/addon-storyshots": "6.0.0-alpha.35",
- "@storybook/addon-storysource": "6.0.0-alpha.35",
- "@storybook/addon-viewport": "6.0.0-alpha.35",
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/source-loader": "6.0.0-alpha.35",
- "@storybook/vue": "6.0.0-alpha.35",
+ "@storybook/addon-a11y": "6.0.0-alpha.39",
+ "@storybook/addon-actions": "6.0.0-alpha.39",
+ "@storybook/addon-backgrounds": "6.0.0-alpha.39",
+ "@storybook/addon-contexts": "6.0.0-alpha.39",
+ "@storybook/addon-docs": "6.0.0-alpha.39",
+ "@storybook/addon-knobs": "6.0.0-alpha.39",
+ "@storybook/addon-links": "6.0.0-alpha.39",
+ "@storybook/addon-storyshots": "6.0.0-alpha.39",
+ "@storybook/addon-storysource": "6.0.0-alpha.39",
+ "@storybook/addon-viewport": "6.0.0-alpha.39",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/source-loader": "6.0.0-alpha.39",
+ "@storybook/vue": "6.0.0-alpha.39",
"babel-core": "^7.0.0-bridge.0",
"babel-loader": "^8.0.5",
"cross-env": "^7.0.0",
diff --git a/examples/vue-kitchen-sink/src/stories/__snapshots__/core.stories.storyshot b/examples/vue-kitchen-sink/src/stories/__snapshots__/core.stories.storyshot
index be4dc0a28a8..c14deee78a0 100644
--- a/examples/vue-kitchen-sink/src/stories/__snapshots__/core.stories.storyshot
+++ b/examples/vue-kitchen-sink/src/stories/__snapshots__/core.stories.storyshot
@@ -2,6 +2,18 @@
exports[`Storyshots Core/Parameters passed to story 1`] = `
- Parameters are {"docs":{"inlineStories":true,"iframeHeight":"60px"},"globalParameter":"globalParameter","framework":"vue","chapterParameter":"chapterParameter","storyParameter":"storyParameter","__id":"core-parameters--passed-to-story"}
+ Parameters are
+
+ {
+ "docs": {
+ "iframeHeight": "60px"
+ },
+ "globalParameter": "globalParameter",
+ "framework": "vue",
+ "chapterParameter": "chapterParameter",
+ "storyParameter": "storyParameter",
+ "__id": "core-parameters--passed-to-story"
+}
+
`;
diff --git a/examples/vue-kitchen-sink/src/stories/__snapshots__/custom-decorators.stories.storyshot b/examples/vue-kitchen-sink/src/stories/__snapshots__/custom-decorators.stories.storyshot
index df9bacb86f4..6c0dee74634 100644
--- a/examples/vue-kitchen-sink/src/stories/__snapshots__/custom-decorators.stories.storyshot
+++ b/examples/vue-kitchen-sink/src/stories/__snapshots__/custom-decorators.stories.storyshot
@@ -49,7 +49,6 @@ exports[`Storyshots Custom/Decorator for Vue With Data 1`] = `
"story": "With Data",
"parameters": {
"docs": {
- "inlineStories": true,
"iframeHeight": "60px"
},
"globalParameter": "globalParameter",
diff --git a/examples/vue-kitchen-sink/src/stories/core.stories.js b/examples/vue-kitchen-sink/src/stories/core.stories.js
index fbb1f7942be..496a8cf5f0b 100644
--- a/examples/vue-kitchen-sink/src/stories/core.stories.js
+++ b/examples/vue-kitchen-sink/src/stories/core.stories.js
@@ -14,7 +14,7 @@ export default {
};
export const PassedToStory = ({ parameters: { fileName, ...parameters } }) => ({
- template: `Parameters are ${JSON.stringify(parameters)}
`,
+ template: `Parameters are
${JSON.stringify(parameters, null, 2)} `,
});
PassedToStory.story = {
diff --git a/examples/web-components-kitchen-sink/package.json b/examples/web-components-kitchen-sink/package.json
index dfdf27c4339..e63d27f05bc 100644
--- a/examples/web-components-kitchen-sink/package.json
+++ b/examples/web-components-kitchen-sink/package.json
@@ -1,6 +1,6 @@
{
"name": "web-components-kitchen-sink",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"private": true,
"description": "",
"keywords": [],
@@ -12,23 +12,23 @@
"storybook": "start-storybook -p 9006"
},
"devDependencies": {
- "@storybook/addon-a11y": "6.0.0-alpha.35",
- "@storybook/addon-actions": "6.0.0-alpha.35",
- "@storybook/addon-backgrounds": "6.0.0-alpha.35",
- "@storybook/addon-docs": "6.0.0-alpha.35",
- "@storybook/addon-events": "6.0.0-alpha.35",
- "@storybook/addon-jest": "6.0.0-alpha.35",
- "@storybook/addon-knobs": "6.0.0-alpha.35",
- "@storybook/addon-links": "6.0.0-alpha.35",
- "@storybook/addon-storyshots": "6.0.0-alpha.35",
- "@storybook/addon-storysource": "6.0.0-alpha.35",
- "@storybook/addon-viewport": "6.0.0-alpha.35",
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/client-api": "6.0.0-alpha.35",
- "@storybook/core": "6.0.0-alpha.35",
- "@storybook/core-events": "6.0.0-alpha.35",
- "@storybook/source-loader": "6.0.0-alpha.35",
- "@storybook/web-components": "6.0.0-alpha.35",
+ "@storybook/addon-a11y": "6.0.0-alpha.39",
+ "@storybook/addon-actions": "6.0.0-alpha.39",
+ "@storybook/addon-backgrounds": "6.0.0-alpha.39",
+ "@storybook/addon-docs": "6.0.0-alpha.39",
+ "@storybook/addon-events": "6.0.0-alpha.39",
+ "@storybook/addon-jest": "6.0.0-alpha.39",
+ "@storybook/addon-knobs": "6.0.0-alpha.39",
+ "@storybook/addon-links": "6.0.0-alpha.39",
+ "@storybook/addon-storyshots": "6.0.0-alpha.39",
+ "@storybook/addon-storysource": "6.0.0-alpha.39",
+ "@storybook/addon-viewport": "6.0.0-alpha.39",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/client-api": "6.0.0-alpha.39",
+ "@storybook/core": "6.0.0-alpha.39",
+ "@storybook/core-events": "6.0.0-alpha.39",
+ "@storybook/source-loader": "6.0.0-alpha.39",
+ "@storybook/web-components": "6.0.0-alpha.39",
"babel-loader": "^8.0.5",
"eventemitter3": "^4.0.0",
"format-json": "^1.0.3",
diff --git a/lerna.json b/lerna.json
index fe0b6ff4d18..b60711c3323 100644
--- a/lerna.json
+++ b/lerna.json
@@ -2,5 +2,5 @@
"npmClient": "yarn",
"useWorkspaces": true,
"registry": "https://registry.npmjs.org",
- "version": "6.0.0-alpha.35"
+ "version": "6.0.0-alpha.39"
}
diff --git a/lib/addons/package.json b/lib/addons/package.json
index 8ac4ac43637..bc977d75b79 100644
--- a/lib/addons/package.json
+++ b/lib/addons/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/addons",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Storybook addons store",
"keywords": [
"storybook"
@@ -28,12 +28,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/api": "6.0.0-alpha.35",
- "@storybook/channels": "6.0.0-alpha.35",
- "@storybook/client-logger": "6.0.0-alpha.35",
- "@storybook/core-events": "6.0.0-alpha.35",
- "@storybook/router": "6.0.0-alpha.35",
- "@storybook/theming": "6.0.0-alpha.35",
+ "@storybook/api": "6.0.0-alpha.39",
+ "@storybook/channels": "6.0.0-alpha.39",
+ "@storybook/client-logger": "6.0.0-alpha.39",
+ "@storybook/core-events": "6.0.0-alpha.39",
+ "@storybook/router": "6.0.0-alpha.39",
+ "@storybook/theming": "6.0.0-alpha.39",
"core-js": "^3.0.1",
"global": "^4.3.2",
"regenerator-runtime": "^0.13.3"
diff --git a/lib/api/package.json b/lib/api/package.json
index 53cda77dde4..7367aafa9df 100644
--- a/lib/api/package.json
+++ b/lib/api/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/api",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Core Storybook API & Context",
"keywords": [
"storybook"
@@ -28,12 +28,12 @@
},
"dependencies": {
"@reach/router": "^1.3.3",
- "@storybook/channels": "6.0.0-alpha.35",
- "@storybook/client-logger": "6.0.0-alpha.35",
- "@storybook/core-events": "6.0.0-alpha.35",
+ "@storybook/channels": "6.0.0-alpha.39",
+ "@storybook/client-logger": "6.0.0-alpha.39",
+ "@storybook/core-events": "6.0.0-alpha.39",
"@storybook/csf": "0.0.1",
- "@storybook/router": "6.0.0-alpha.35",
- "@storybook/theming": "6.0.0-alpha.35",
+ "@storybook/router": "6.0.0-alpha.39",
+ "@storybook/theming": "6.0.0-alpha.39",
"@types/reach__router": "^1.2.3",
"core-js": "^3.0.1",
"fast-deep-equal": "^3.1.1",
diff --git a/lib/api/src/version.ts b/lib/api/src/version.ts
index d92c1e5f9c1..dd3d18c5350 100644
--- a/lib/api/src/version.ts
+++ b/lib/api/src/version.ts
@@ -1 +1 @@
-export const version = '6.0.0-alpha.35';
+export const version = '6.0.0-alpha.39';
diff --git a/lib/channel-postmessage/package.json b/lib/channel-postmessage/package.json
index 47452a7eb62..d6645c92039 100644
--- a/lib/channel-postmessage/package.json
+++ b/lib/channel-postmessage/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/channel-postmessage",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "",
"keywords": [
"storybook"
@@ -28,9 +28,9 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/channels": "6.0.0-alpha.35",
- "@storybook/client-logger": "6.0.0-alpha.35",
- "@storybook/core-events": "6.0.0-alpha.35",
+ "@storybook/channels": "6.0.0-alpha.39",
+ "@storybook/client-logger": "6.0.0-alpha.39",
+ "@storybook/core-events": "6.0.0-alpha.39",
"core-js": "^3.0.1",
"global": "^4.3.2",
"telejson": "^3.2.0"
diff --git a/lib/channel-postmessage/src/index.ts b/lib/channel-postmessage/src/index.ts
index f3400c1cfe2..9d37081ecd6 100644
--- a/lib/channel-postmessage/src/index.ts
+++ b/lib/channel-postmessage/src/index.ts
@@ -170,10 +170,11 @@ export class PostmsgTransport {
? `${event.type} `
: `${event.type} `;
- event.source = source || getEventSourceUrl(rawEvent);
+ event.source =
+ source || this.config.page === 'preview' ? rawEvent.origin : getEventSourceUrl(rawEvent);
if (!event.source) {
- logger.error(
+ pretty.error(
`${pageString} received ${eventString} but was unable to determine the source of the event`
);
@@ -195,8 +196,7 @@ export class PostmsgTransport {
}
const getEventSourceUrl = (event: MessageEvent) => {
- const frames: HTMLIFrameElement[] = [...document.getElementsByTagName('iframe')];
-
+ const frames = [...document.querySelectorAll('iframe[data-is-storybook]')];
// try to find the originating iframe by matching it's contentWindow
// This might not be cross-origin safe
const [frame, ...remainder] = frames.filter((element) => {
@@ -217,15 +217,19 @@ const getEventSourceUrl = (event: MessageEvent) => {
return origin === event.origin;
});
- // If we found multiple matches, there's going to be trouble
- if (remainder.length) {
- console.error('unable to locate origin of postmessage');
- return null;
+ if (frame && remainder.length === 0) {
+ const src = frame.getAttribute('src');
+ const { origin, pathname } = new URL(src, document.location);
+ return origin + pathname;
}
- const src = frame.getAttribute('src');
- const { origin, pathname } = new URL(src, document.location);
- return origin + pathname;
+ if (remainder.length > 0) {
+ // If we found multiple matches, there's going to be trouble
+ logger.error('found multiple candidates for event source');
+ }
+
+ // If we found no frames of matches
+ return null;
};
/**
diff --git a/lib/channel-websocket/package.json b/lib/channel-websocket/package.json
index 72ac549a90b..de52a4c9ff3 100644
--- a/lib/channel-websocket/package.json
+++ b/lib/channel-websocket/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/channel-websocket",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "",
"keywords": [
"storybook"
@@ -28,7 +28,7 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/channels": "6.0.0-alpha.35",
+ "@storybook/channels": "6.0.0-alpha.39",
"core-js": "^3.0.1",
"global": "^4.3.2",
"telejson": "^3.2.0"
diff --git a/lib/channels/package.json b/lib/channels/package.json
index 0a97cf9a202..1b8a77979bd 100644
--- a/lib/channels/package.json
+++ b/lib/channels/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/channels",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "",
"keywords": [
"storybook"
diff --git a/lib/cli-sb/package.json b/lib/cli-sb/package.json
index c737758fa91..d8ba1fcf957 100644
--- a/lib/cli-sb/package.json
+++ b/lib/cli-sb/package.json
@@ -1,6 +1,6 @@
{
"name": "sb",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Storybook CLI",
"keywords": [
"storybook"
@@ -22,7 +22,7 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/cli": "6.0.0-alpha.35"
+ "@storybook/cli": "6.0.0-alpha.39"
},
"publishConfig": {
"access": "public"
diff --git a/lib/cli-storybook/package.json b/lib/cli-storybook/package.json
index 2e21e0c2de2..630c2f96e19 100644
--- a/lib/cli-storybook/package.json
+++ b/lib/cli-storybook/package.json
@@ -1,6 +1,6 @@
{
"name": "storybook",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Storybook CLI",
"keywords": [
"storybook"
@@ -23,7 +23,7 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/cli": "6.0.0-alpha.35"
+ "@storybook/cli": "6.0.0-alpha.39"
},
"publishConfig": {
"access": "public"
diff --git a/lib/cli/package.json b/lib/cli/package.json
index 78e844f6aca..6da961b4c57 100644
--- a/lib/cli/package.json
+++ b/lib/cli/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/cli",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Storybook's CLI - easiest method of adding storybook to your projects",
"keywords": [
"cli",
@@ -39,8 +39,8 @@
"dependencies": {
"@babel/core": "^7.8.4",
"@babel/preset-env": "^7.8.4",
- "@storybook/codemod": "6.0.0-alpha.35",
- "@storybook/node-logger": "6.0.0-alpha.35",
+ "@storybook/codemod": "6.0.0-alpha.39",
+ "@storybook/node-logger": "6.0.0-alpha.39",
"chalk": "^3.0.0",
"commander": "^5.0.0",
"core-js": "^3.0.1",
@@ -62,30 +62,30 @@
"update-notifier": "^4.0.0"
},
"devDependencies": {
- "@storybook/addon-actions": "6.0.0-alpha.35",
- "@storybook/addon-graphql": "6.0.0-alpha.35",
- "@storybook/addon-knobs": "6.0.0-alpha.35",
- "@storybook/addon-links": "6.0.0-alpha.35",
- "@storybook/addon-storyshots": "6.0.0-alpha.35",
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/angular": "6.0.0-alpha.35",
- "@storybook/channel-postmessage": "6.0.0-alpha.35",
- "@storybook/channel-websocket": "6.0.0-alpha.35",
- "@storybook/channels": "6.0.0-alpha.35",
- "@storybook/ember": "6.0.0-alpha.35",
- "@storybook/html": "6.0.0-alpha.35",
- "@storybook/marionette": "6.0.0-alpha.35",
- "@storybook/marko": "6.0.0-alpha.35",
- "@storybook/mithril": "6.0.0-alpha.35",
- "@storybook/preact": "6.0.0-alpha.35",
- "@storybook/rax": "6.0.0-alpha.35",
- "@storybook/react": "6.0.0-alpha.35",
+ "@storybook/addon-actions": "6.0.0-alpha.39",
+ "@storybook/addon-graphql": "6.0.0-alpha.39",
+ "@storybook/addon-knobs": "6.0.0-alpha.39",
+ "@storybook/addon-links": "6.0.0-alpha.39",
+ "@storybook/addon-storyshots": "6.0.0-alpha.39",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/angular": "6.0.0-alpha.39",
+ "@storybook/channel-postmessage": "6.0.0-alpha.39",
+ "@storybook/channel-websocket": "6.0.0-alpha.39",
+ "@storybook/channels": "6.0.0-alpha.39",
+ "@storybook/ember": "6.0.0-alpha.39",
+ "@storybook/html": "6.0.0-alpha.39",
+ "@storybook/marionette": "6.0.0-alpha.39",
+ "@storybook/marko": "6.0.0-alpha.39",
+ "@storybook/mithril": "6.0.0-alpha.39",
+ "@storybook/preact": "6.0.0-alpha.39",
+ "@storybook/rax": "6.0.0-alpha.39",
+ "@storybook/react": "6.0.0-alpha.39",
"@storybook/react-native": "6.0.0-alpha.0",
- "@storybook/riot": "6.0.0-alpha.35",
- "@storybook/svelte": "6.0.0-alpha.35",
- "@storybook/ui": "6.0.0-alpha.35",
- "@storybook/vue": "6.0.0-alpha.35",
- "@storybook/web-components": "6.0.0-alpha.35"
+ "@storybook/riot": "6.0.0-alpha.39",
+ "@storybook/svelte": "6.0.0-alpha.39",
+ "@storybook/ui": "6.0.0-alpha.39",
+ "@storybook/vue": "6.0.0-alpha.39",
+ "@storybook/web-components": "6.0.0-alpha.39"
},
"peerDependencies": {
"jest": "*"
diff --git a/lib/client-api/package.json b/lib/client-api/package.json
index 54401fcfda1..32d5151616a 100644
--- a/lib/client-api/package.json
+++ b/lib/client-api/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/client-api",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Storybook Client API",
"keywords": [
"storybook"
@@ -28,11 +28,11 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/channel-postmessage": "6.0.0-alpha.35",
- "@storybook/channels": "6.0.0-alpha.35",
- "@storybook/client-logger": "6.0.0-alpha.35",
- "@storybook/core-events": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/channel-postmessage": "6.0.0-alpha.39",
+ "@storybook/channels": "6.0.0-alpha.39",
+ "@storybook/client-logger": "6.0.0-alpha.39",
+ "@storybook/core-events": "6.0.0-alpha.39",
"@storybook/csf": "0.0.1",
"@types/webpack-env": "^1.15.1",
"core-js": "^3.0.1",
diff --git a/lib/client-logger/package.json b/lib/client-logger/package.json
index ceef31c7013..bc164eb7bab 100644
--- a/lib/client-logger/package.json
+++ b/lib/client-logger/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/client-logger",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "",
"keywords": [
"storybook"
diff --git a/lib/codemod/package.json b/lib/codemod/package.json
index f5fdfc374f3..5c8e63d119d 100644
--- a/lib/codemod/package.json
+++ b/lib/codemod/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/codemod",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "A collection of codemod scripts written with JSCodeshift",
"keywords": [
"storybook"
@@ -30,14 +30,14 @@
"dependencies": {
"@mdx-js/mdx": "^1.5.1",
"@storybook/csf": "0.0.1",
- "@storybook/node-logger": "6.0.0-alpha.35",
+ "@storybook/node-logger": "6.0.0-alpha.39",
"core-js": "^3.0.1",
"cross-spawn": "^7.0.0",
"globby": "^11.0.0",
"jscodeshift": "^0.7.0",
"lodash": "^4.17.15",
"prettier": "^2.0.2",
- "recast": "^0.16.1",
+ "recast": "^0.19.0",
"regenerator-runtime": "^0.13.3"
},
"devDependencies": {
diff --git a/lib/codemod/src/transforms/csf-to-mdx.js b/lib/codemod/src/transforms/csf-to-mdx.js
index 435bf6d8363..533effb843b 100644
--- a/lib/codemod/src/transforms/csf-to-mdx.js
+++ b/lib/codemod/src/transforms/csf-to-mdx.js
@@ -1,4 +1,4 @@
-import recast from 'recast';
+import { prettyPrint } from 'recast';
import { isExportStory } from '@storybook/csf';
function exportMdx(root, options) {
@@ -8,7 +8,7 @@ function exportMdx(root, options) {
// FIXME: insert the title as markdown after all of the imports
return path.node.program.body
.map((n) => {
- const { code } = recast.prettyPrint(n, options);
+ const { code } = prettyPrint(n, options);
if (n.type === 'JSXElement') {
return `${code}\n`;
}
@@ -18,7 +18,7 @@ function exportMdx(root, options) {
}
function parseIncludeExclude(prop) {
- const { code } = recast.prettyPrint(prop, {});
+ const { code } = prettyPrint(prop, {});
// eslint-disable-next-line no-eval
return eval(code);
}
diff --git a/lib/components/package.json b/lib/components/package.json
index a3394361885..9035ba1271e 100644
--- a/lib/components/package.json
+++ b/lib/components/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/components",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Core Storybook Components",
"keywords": [
"storybook"
@@ -28,8 +28,8 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/client-logger": "6.0.0-alpha.35",
- "@storybook/theming": "6.0.0-alpha.35",
+ "@storybook/client-logger": "6.0.0-alpha.39",
+ "@storybook/theming": "6.0.0-alpha.39",
"@types/overlayscrollbars": "^1.9.0",
"@types/react-color": "^3.0.1",
"@types/react-syntax-highlighter": "11.0.4",
diff --git a/lib/core-events/package.json b/lib/core-events/package.json
index 6ac7e9523e4..b8559bf87b7 100644
--- a/lib/core-events/package.json
+++ b/lib/core-events/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/core-events",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Event names used in storybook core",
"keywords": [
"storybook"
diff --git a/lib/core/package.json b/lib/core/package.json
index db9402592b3..bf4d78707b8 100644
--- a/lib/core/package.json
+++ b/lib/core/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/core",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Storybook framework-agnostic API",
"keywords": [
"storybook"
@@ -38,17 +38,17 @@
"@babel/preset-react": "^7.8.3",
"@babel/preset-typescript": "^7.8.3",
"@babel/register": "^7.8.3",
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/api": "6.0.0-alpha.35",
- "@storybook/channel-postmessage": "6.0.0-alpha.35",
- "@storybook/client-api": "6.0.0-alpha.35",
- "@storybook/client-logger": "6.0.0-alpha.35",
- "@storybook/core-events": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/api": "6.0.0-alpha.39",
+ "@storybook/channel-postmessage": "6.0.0-alpha.39",
+ "@storybook/client-api": "6.0.0-alpha.39",
+ "@storybook/client-logger": "6.0.0-alpha.39",
+ "@storybook/core-events": "6.0.0-alpha.39",
"@storybook/csf": "0.0.1",
- "@storybook/node-logger": "6.0.0-alpha.35",
- "@storybook/router": "6.0.0-alpha.35",
- "@storybook/theming": "6.0.0-alpha.35",
- "@storybook/ui": "6.0.0-alpha.35",
+ "@storybook/node-logger": "6.0.0-alpha.39",
+ "@storybook/router": "6.0.0-alpha.39",
+ "@storybook/theming": "6.0.0-alpha.39",
+ "@storybook/ui": "6.0.0-alpha.39",
"@types/node-fetch": "^2.5.4",
"airbnb-js-shims": "^2.2.1",
"ansi-to-html": "^0.6.11",
diff --git a/lib/core/src/server/dev-server.js b/lib/core/src/server/dev-server.js
index 1f35dc8482b..7213b491b48 100644
--- a/lib/core/src/server/dev-server.js
+++ b/lib/core/src/server/dev-server.js
@@ -61,6 +61,11 @@ export default function (options) {
devMiddlewareOptions
);
+ router.get(/\/static\/media\/.*\..*/, (request, response, next) => {
+ response.set('Cache-Control', `public, max-age=31536000`);
+ next();
+ });
+
router.use(managerDevMiddlewareInstance);
return new Promise((resolve, reject) => {
diff --git a/lib/node-logger/package.json b/lib/node-logger/package.json
index 5358b680b3a..e01a9fc2c14 100644
--- a/lib/node-logger/package.json
+++ b/lib/node-logger/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/node-logger",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "",
"keywords": [
"storybook"
diff --git a/lib/postinstall/package.json b/lib/postinstall/package.json
index 223ee620db3..dd21fd629c9 100644
--- a/lib/postinstall/package.json
+++ b/lib/postinstall/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/postinstall",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Storybook addons postinstall utilities",
"keywords": [
"api",
diff --git a/lib/router/package.json b/lib/router/package.json
index f520292695f..287783e539e 100644
--- a/lib/router/package.json
+++ b/lib/router/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/router",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Core Storybook Router",
"keywords": [
"storybook"
diff --git a/lib/source-loader/package.json b/lib/source-loader/package.json
index 90bcdae865f..0a850161d97 100644
--- a/lib/source-loader/package.json
+++ b/lib/source-loader/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/source-loader",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Source loader",
"keywords": [
"lib",
@@ -29,8 +29,8 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/client-logger": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/client-logger": "6.0.0-alpha.39",
"@storybook/csf": "0.0.1",
"core-js": "^3.0.1",
"estraverse": "^4.2.0",
diff --git a/lib/theming/package.json b/lib/theming/package.json
index 84c05778036..1928c472259 100644
--- a/lib/theming/package.json
+++ b/lib/theming/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/theming",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Core Storybook Components",
"keywords": [
"storybook"
@@ -31,7 +31,7 @@
"@emotion/core": "^10.0.20",
"@emotion/is-prop-valid": "^0.8.6",
"@emotion/styled": "^10.0.17",
- "@storybook/client-logger": "6.0.0-alpha.35",
+ "@storybook/client-logger": "6.0.0-alpha.39",
"core-js": "^3.0.1",
"deep-object-diff": "^1.1.0",
"emotion-theming": "^10.0.19",
diff --git a/lib/ui/package.json b/lib/ui/package.json
index 35f986476ab..acb7bd8eeed 100644
--- a/lib/ui/package.json
+++ b/lib/ui/package.json
@@ -1,6 +1,6 @@
{
"name": "@storybook/ui",
- "version": "6.0.0-alpha.35",
+ "version": "6.0.0-alpha.39",
"description": "Core Storybook UI",
"keywords": [
"storybook"
@@ -29,14 +29,14 @@
},
"dependencies": {
"@emotion/core": "^10.0.20",
- "@storybook/addons": "6.0.0-alpha.35",
- "@storybook/api": "6.0.0-alpha.35",
- "@storybook/channels": "6.0.0-alpha.35",
- "@storybook/client-logger": "6.0.0-alpha.35",
- "@storybook/components": "6.0.0-alpha.35",
- "@storybook/core-events": "6.0.0-alpha.35",
- "@storybook/router": "6.0.0-alpha.35",
- "@storybook/theming": "6.0.0-alpha.35",
+ "@storybook/addons": "6.0.0-alpha.39",
+ "@storybook/api": "6.0.0-alpha.39",
+ "@storybook/channels": "6.0.0-alpha.39",
+ "@storybook/client-logger": "6.0.0-alpha.39",
+ "@storybook/components": "6.0.0-alpha.39",
+ "@storybook/core-events": "6.0.0-alpha.39",
+ "@storybook/router": "6.0.0-alpha.39",
+ "@storybook/theming": "6.0.0-alpha.39",
"@types/markdown-to-jsx": "^6.9.1",
"@types/rfdc": "^1.1.0",
"copy-to-clipboard": "^3.0.8",
@@ -66,9 +66,9 @@
},
"devDependencies": {
"@babel/core": "^7.8.4",
- "@storybook/addon-actions": "6.0.0-alpha.35",
- "@storybook/addon-knobs": "6.0.0-alpha.35",
- "@storybook/react": "6.0.0-alpha.35",
+ "@storybook/addon-actions": "6.0.0-alpha.39",
+ "@storybook/addon-knobs": "6.0.0-alpha.39",
+ "@storybook/react": "6.0.0-alpha.39",
"@testing-library/react": "^10.0.1",
"babel-loader": "^8.0.6",
"corejs-upgrade-webpack-plugin": "^4.0.1",
diff --git a/lib/ui/src/app.tsx b/lib/ui/src/app.tsx
index 65fbb81778b..e017d011e9e 100644
--- a/lib/ui/src/app.tsx
+++ b/lib/ui/src/app.tsx
@@ -58,11 +58,7 @@ const App = React.memo(
);
if (!width || !height) {
- content = (
-
- {width} x {height}
-
- );
+ content =
;
} else if (width < 600) {
content = ;
} else {
diff --git a/lib/ui/src/components/preview/FramesRenderer.tsx b/lib/ui/src/components/preview/FramesRenderer.tsx
index 6560e75476d..359eabb3c3d 100644
--- a/lib/ui/src/components/preview/FramesRenderer.tsx
+++ b/lib/ui/src/components/preview/FramesRenderer.tsx
@@ -4,6 +4,21 @@ import { IFrame } from './iframe';
import { FramesRendererProps } from './utils/types';
import { stringifyQueryParams } from './utils/stringifyQueryParams';
+const getActive = (
+ refId: FramesRendererProps['refId'],
+ storyId: FramesRendererProps['storyId']
+) => {
+ if (storyId === '*') {
+ return undefined;
+ }
+
+ if (refId) {
+ return `storybook-ref-${refId}`;
+ }
+
+ return 'storybook-preview-iframe';
+};
+
export const FramesRenderer: FunctionComponent = ({
refs,
story,
@@ -15,7 +30,7 @@ export const FramesRenderer: FunctionComponent = ({
storyId,
}) => {
const stringifiedQueryParams = stringifyQueryParams(queryParams);
- const active = refId ? `storybook-ref-${refId}` : 'storybook-preview-iframe';
+ const active = getActive(refId, storyId);
const styles = useMemo(() => {
return {
diff --git a/lib/ui/src/settings/index.tsx b/lib/ui/src/settings/index.tsx
index 571c9f6e087..8a91b8114ca 100644
--- a/lib/ui/src/settings/index.tsx
+++ b/lib/ui/src/settings/index.tsx
@@ -4,7 +4,8 @@ import ShortcutsPage from './shortcuts_page';
const SettingsPages: FunctionComponent = () => (
- ,
+
+
);
diff --git a/yarn.lock b/yarn.lock
index fc154fa2e2f..a58a99d433a 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -25304,6 +25304,16 @@ recast@^0.18.1:
private "^0.1.8"
source-map "~0.6.1"
+recast@^0.19.0:
+ version "0.19.0"
+ resolved "https://registry.yarnpkg.com/recast/-/recast-0.19.0.tgz#a6a9f95996f616dcbff60c9a8b9995922c5f4b74"
+ integrity sha512-HymYANYaUFpKoAkOZ2od16SB7A/BwCZbvYIs9Rc8K+wNThQctiCJ0AjLkPbo9eWdy3w5Eemk6I4MeEYbH12PBg==
+ dependencies:
+ ast-types "0.13.3"
+ esprima "~4.0.0"
+ private "^0.1.8"
+ source-map "~0.6.1"
+
rechoir@^0.6.2:
version "0.6.2"
resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"