This commit is contained in:
Angela Papadopoulou 2021-04-28 01:55:10 +03:00
commit e52207d8d7
121 changed files with 2859 additions and 1428 deletions

View File

@ -1,3 +1,19 @@
## 6.3.0-alpha.15 (April 28, 2021)
### Features
- Storyshots: Add `beforeAxeTest` hook ([#14563](https://github.com/storybookjs/storybook/pull/14563))
- API: Add addon keyboard shortcuts & create shortcuts for addon-viewport ([#14658](https://github.com/storybookjs/storybook/pull/14658))
### Bug Fixes
- Storyshots/Preact: Add pragma @jsxRuntime classic ([#13849](https://github.com/storybookjs/storybook/pull/13849))
- Core: Don't recreate a bound story function each time we call a decorated story ([#14692](https://github.com/storybookjs/storybook/pull/14692))
### Maintenance
- Build: Add NX bootstrap optimization ([#14535](https://github.com/storybookjs/storybook/pull/14535))
## 6.2.9 (April 23, 2021)
### Bug Fixes

View File

@ -118,10 +118,9 @@ A good way to do that is using the example `cra-kitchen-sink` app embedded in th
# Download and build this repository:
git clone https://github.com/storybookjs/storybook.git
cd storybook
yarn
yarn bootstrap --core
# NOTE: on windows you may need to run `yarn` before `yarn bootstrap`!
# make changes to try and reproduce the problem, such as adding components + stories
cd examples/cra-kitchen-sink
yarn storybook

View File

@ -36,11 +36,82 @@ export const inaccessible = () => (
);
```
## Handling failing rules
When a Story has failing rules (accessibility violations), there are mutliple ways to handle these failures.
### Global overrides
When an exception should apply to all stories, set `parameters.a11y.config.rules` in your Storybooks `preview.ts` file.
For example, to add support for autocomplete in Chrome across all your stories:
```js
// .storybook/preview.ts
export const parameters = {
a11y: {
config: {
rules: [
{
// Add support for `autocomplete="nope"`, a workaround to prevent autocomplete in Chrome
// @link https://bugs.chromium.org/p/chromium/issues/detail?id=468153
id: 'autocomplete-valid',
selector: '*:not([autocomplete="nope"])',
},
],
},
},
};
```
At the Story level, instead of disabling a11y checks, override rules using `parameters.a11y.options.rules`.
```js
MyStory.parameters = {
a11y: {
// Avoid doing this! It will fully disable all accessibility checks for this story.
disable: true,
// Instead, override rules 👇
// axe-core optionsParameter (https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#options-parameter)
options: {
// Learn more about the rules API: https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#parameters-1
rules: [
{
// You can exclude some elements from being checked by a specific rule
id: 'autocomplete-valid',
selector: '*:not([autocomplete="nope"])',
},
{
// When theres a false positive, it's okay to disable a specific rule.
// For example, if an entire component is disabled, color contrast ratio doesn't need to meet 4.5:1.
// @link https://dequeuniversity.com/rules/axe/4.1/color-contrast?application=axeAPI
id: 'color-contrast',
enabled: false,
},
{
// Sometimes, you just need tests to pass so you can ship…
// Dont set { a11y: { disable: true } }, as it will fully disable all accessibility checks for this story.
// Instead, signify that a violation will need to be fixed in the future:
id: 'landmark-complementary-is-top-level',
reviewOnFail: true, // Override the result of a rule to return "Needs Review" rather than "Violation" if the rule fails.
},
],
},
},
};
```
Tip: when you override a rule, expain why in a comment. That context will be helpful to you and your team when debugging particularly gnarly accessibility issues.
### Disabling checks
If you wish to selectively disable `a11y` checks for a subset of stories, you can control this with story parameters:
```js
export const MyNonCheckedStory = () => <SomeComponent />;
MyNonCheckedStory.parameters = {
// Avoid doing this, as it fully disables all accessibility checks for this story.
a11y: { disable: true },
};
```

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-a11y",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Test component compliance with web accessibility standards",
"keywords": [
"a11y",
@ -45,14 +45,14 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/api": "6.3.0-alpha.14",
"@storybook/channels": "6.3.0-alpha.14",
"@storybook/client-api": "6.3.0-alpha.14",
"@storybook/client-logger": "6.3.0-alpha.14",
"@storybook/components": "6.3.0-alpha.14",
"@storybook/core-events": "6.3.0-alpha.14",
"@storybook/theming": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/api": "6.3.0-alpha.15",
"@storybook/channels": "6.3.0-alpha.15",
"@storybook/client-api": "6.3.0-alpha.15",
"@storybook/client-logger": "6.3.0-alpha.15",
"@storybook/components": "6.3.0-alpha.15",
"@storybook/core-events": "6.3.0-alpha.15",
"@storybook/theming": "6.3.0-alpha.15",
"axe-core": "^4.1.1",
"core-js": "^3.8.2",
"global": "^4.4.0",
@ -81,7 +81,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100",
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5",
"storybook": {
"displayName": "Accessibility",
"icon": "https://user-images.githubusercontent.com/263385/101991665-47042f80-3c7c-11eb-8f00-64b5a18f498a.png",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-actions",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Get UI feedback when an action is performed on an interactive element",
"keywords": [
"storybook",
@ -41,12 +41,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/api": "6.3.0-alpha.14",
"@storybook/client-api": "6.3.0-alpha.14",
"@storybook/components": "6.3.0-alpha.14",
"@storybook/core-events": "6.3.0-alpha.14",
"@storybook/theming": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/api": "6.3.0-alpha.15",
"@storybook/client-api": "6.3.0-alpha.15",
"@storybook/components": "6.3.0-alpha.15",
"@storybook/core-events": "6.3.0-alpha.15",
"@storybook/theming": "6.3.0-alpha.15",
"core-js": "^3.8.2",
"fast-deep-equal": "^3.1.3",
"global": "^4.4.0",
@ -78,7 +78,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100",
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5",
"storybook": {
"displayName": "Actions",
"unsupportedFrameworks": [

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-backgrounds",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Switch backgrounds to view components in different settings",
"keywords": [
"addon",
@ -45,12 +45,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/api": "6.3.0-alpha.14",
"@storybook/client-logger": "6.3.0-alpha.14",
"@storybook/components": "6.3.0-alpha.14",
"@storybook/core-events": "6.3.0-alpha.14",
"@storybook/theming": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/api": "6.3.0-alpha.15",
"@storybook/client-logger": "6.3.0-alpha.15",
"@storybook/components": "6.3.0-alpha.15",
"@storybook/core-events": "6.3.0-alpha.15",
"@storybook/theming": "6.3.0-alpha.15",
"core-js": "^3.8.2",
"global": "^4.4.0",
"memoizerific": "^1.11.3",
@ -76,7 +76,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100",
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5",
"storybook": {
"displayName": "Backgrounds",
"icon": "https://user-images.githubusercontent.com/263385/101991667-479cc600-3c7c-11eb-96d3-410e936252e7.png",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-controls",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Interact with component inputs dynamically in the Storybook UI",
"keywords": [
"addon",
@ -45,12 +45,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/api": "6.3.0-alpha.14",
"@storybook/client-api": "6.3.0-alpha.14",
"@storybook/components": "6.3.0-alpha.14",
"@storybook/node-logger": "6.3.0-alpha.14",
"@storybook/theming": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/api": "6.3.0-alpha.15",
"@storybook/client-api": "6.3.0-alpha.15",
"@storybook/components": "6.3.0-alpha.15",
"@storybook/node-logger": "6.3.0-alpha.15",
"@storybook/theming": "6.3.0-alpha.15",
"core-js": "^3.8.2",
"ts-dedent": "^2.0.0"
},
@ -69,7 +69,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100",
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5",
"storybook": {
"displayName": "Controls",
"icon": "https://user-images.githubusercontent.com/263385/101991669-479cc600-3c7c-11eb-93d9-38b67e8371f2.png",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-cssresources",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "A storybook addon to switch between css resources at runtime for your story",
"keywords": [
"addon",
@ -44,11 +44,11 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/api": "6.3.0-alpha.14",
"@storybook/components": "6.3.0-alpha.14",
"@storybook/core-events": "6.3.0-alpha.14",
"@storybook/theming": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/api": "6.3.0-alpha.15",
"@storybook/components": "6.3.0-alpha.15",
"@storybook/core-events": "6.3.0-alpha.15",
"@storybook/theming": "6.3.0-alpha.15",
"core-js": "^3.8.2",
"global": "^4.4.0",
"regenerator-runtime": "^0.13.7"
@ -71,7 +71,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100",
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5",
"storybook": {
"displayName": "CSS Resources",
"unsupportedFrameworks": [

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-design-assets",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Design asset preview for storybook",
"keywords": [
"addon",
@ -45,12 +45,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/api": "6.3.0-alpha.14",
"@storybook/client-logger": "6.3.0-alpha.14",
"@storybook/components": "6.3.0-alpha.14",
"@storybook/core-events": "6.3.0-alpha.14",
"@storybook/theming": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/api": "6.3.0-alpha.15",
"@storybook/client-logger": "6.3.0-alpha.15",
"@storybook/components": "6.3.0-alpha.15",
"@storybook/core-events": "6.3.0-alpha.15",
"@storybook/theming": "6.3.0-alpha.15",
"core-js": "^3.8.2",
"global": "^4.4.0",
"regenerator-runtime": "^0.13.7",
@ -72,7 +72,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100",
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5",
"storybook": {
"displayName": "Design assets",
"unsupportedFrameworks": [

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-docs",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Document component usage and properties in Markdown",
"keywords": [
"addon",
@ -62,19 +62,19 @@
"@mdx-js/loader": "^1.6.22",
"@mdx-js/mdx": "^1.6.22",
"@mdx-js/react": "^1.6.22",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/api": "6.3.0-alpha.14",
"@storybook/builder-webpack4": "6.3.0-alpha.14",
"@storybook/client-api": "6.3.0-alpha.14",
"@storybook/client-logger": "6.3.0-alpha.14",
"@storybook/components": "6.3.0-alpha.14",
"@storybook/core": "6.3.0-alpha.14",
"@storybook/core-events": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/api": "6.3.0-alpha.15",
"@storybook/builder-webpack4": "6.3.0-alpha.15",
"@storybook/client-api": "6.3.0-alpha.15",
"@storybook/client-logger": "6.3.0-alpha.15",
"@storybook/components": "6.3.0-alpha.15",
"@storybook/core": "6.3.0-alpha.15",
"@storybook/core-events": "6.3.0-alpha.15",
"@storybook/csf": "0.0.1",
"@storybook/node-logger": "6.3.0-alpha.14",
"@storybook/postinstall": "6.3.0-alpha.14",
"@storybook/source-loader": "6.3.0-alpha.14",
"@storybook/theming": "6.3.0-alpha.14",
"@storybook/node-logger": "6.3.0-alpha.15",
"@storybook/postinstall": "6.3.0-alpha.15",
"@storybook/source-loader": "6.3.0-alpha.15",
"@storybook/theming": "6.3.0-alpha.15",
"acorn": "^7.4.1",
"acorn-jsx": "^5.3.1",
"acorn-walk": "^7.2.0",
@ -101,10 +101,10 @@
"@babel/core": "^7.12.10",
"@emotion/core": "^10.1.1",
"@emotion/styled": "^10.0.27",
"@storybook/angular": "6.3.0-alpha.14",
"@storybook/react": "6.3.0-alpha.14",
"@storybook/vue": "6.3.0-alpha.14",
"@storybook/web-components": "6.3.0-alpha.14",
"@storybook/angular": "6.3.0-alpha.15",
"@storybook/react": "6.3.0-alpha.15",
"@storybook/vue": "6.3.0-alpha.15",
"@storybook/web-components": "6.3.0-alpha.15",
"@types/cross-spawn": "^6.0.2",
"@types/doctrine": "^0.0.3",
"@types/enzyme": "^3.10.8",
@ -134,10 +134,10 @@
"zone.js": "^0.11.3"
},
"peerDependencies": {
"@storybook/angular": "6.3.0-alpha.14",
"@storybook/vue": "6.3.0-alpha.14",
"@storybook/vue3": "6.3.0-alpha.14",
"@storybook/web-components": "6.3.0-alpha.14",
"@storybook/angular": "6.3.0-alpha.15",
"@storybook/vue": "6.3.0-alpha.15",
"@storybook/vue3": "6.3.0-alpha.15",
"@storybook/web-components": "6.3.0-alpha.15",
"lit-html": "^1.0.0",
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0",
@ -184,7 +184,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100",
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5",
"storybook": {
"displayName": "Docs",
"icon": "https://user-images.githubusercontent.com/263385/101991672-48355c80-3c7c-11eb-82d9-95fa12438f64.png",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-essentials",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Curated addons to bring out the best of Storybook",
"keywords": [
"addon",
@ -39,29 +39,29 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addon-actions": "6.3.0-alpha.14",
"@storybook/addon-backgrounds": "6.3.0-alpha.14",
"@storybook/addon-controls": "6.3.0-alpha.14",
"@storybook/addon-docs": "6.3.0-alpha.14",
"@storybook/addon-toolbars": "6.3.0-alpha.14",
"@storybook/addon-viewport": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/api": "6.3.0-alpha.14",
"@storybook/node-logger": "6.3.0-alpha.14",
"@storybook/addon-actions": "6.3.0-alpha.15",
"@storybook/addon-backgrounds": "6.3.0-alpha.15",
"@storybook/addon-controls": "6.3.0-alpha.15",
"@storybook/addon-docs": "6.3.0-alpha.15",
"@storybook/addon-toolbars": "6.3.0-alpha.15",
"@storybook/addon-viewport": "6.3.0-alpha.15",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/api": "6.3.0-alpha.15",
"@storybook/node-logger": "6.3.0-alpha.15",
"core-js": "^3.8.2",
"regenerator-runtime": "^0.13.7",
"ts-dedent": "^2.0.0"
},
"devDependencies": {
"@babel/core": "^7.12.10",
"@storybook/vue": "6.3.0-alpha.14",
"@storybook/vue": "6.3.0-alpha.15",
"@types/jest": "^26.0.16",
"@types/webpack-env": "^1.16.0"
},
"peerDependencies": {
"@babel/core": "^7.9.6",
"@storybook/vue": "6.3.0-alpha.14",
"@storybook/web-components": "6.3.0-alpha.14",
"@storybook/vue": "6.3.0-alpha.15",
"@storybook/web-components": "6.3.0-alpha.15",
"babel-loader": "^8.0.0",
"lit-html": "^1.0.0",
"react": "^16.8.0 || ^17.0.0",
@ -91,5 +91,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-events",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Add events to your Storybook stories.",
"keywords": [
"addon",
@ -43,11 +43,11 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/api": "6.3.0-alpha.14",
"@storybook/client-api": "6.3.0-alpha.14",
"@storybook/core-events": "6.3.0-alpha.14",
"@storybook/theming": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/api": "6.3.0-alpha.15",
"@storybook/client-api": "6.3.0-alpha.15",
"@storybook/core-events": "6.3.0-alpha.15",
"@storybook/theming": "6.3.0-alpha.15",
"core-js": "^3.8.2",
"format-json": "^1.0.3",
"lodash": "^4.17.20",
@ -74,7 +74,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100",
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5",
"storybook": {
"displayName": "Events",
"unsupportedFrameworks": [

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-google-analytics",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Storybook addon for google analytics",
"keywords": [
"addon",
@ -35,8 +35,8 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/core-events": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/core-events": "6.3.0-alpha.15",
"core-js": "^3.8.2",
"global": "^4.4.0",
"react-ga": "^2.7.0",
@ -57,7 +57,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100",
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5",
"storybook": {
"displayName": "Google Analytics",
"icon": "https://pbs.twimg.com/profile_images/1021848775885651968/cU74ahCn_400x400.jpg",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-graphql",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Storybook addon to display the GraphiQL IDE",
"keywords": [
"addon",
@ -43,8 +43,8 @@
"dependencies": {
"@babel/core": "^7.12.10",
"@babel/plugin-transform-classes": "^7.12.1",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/api": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/api": "6.3.0-alpha.15",
"babel-loader": "^8.2.2",
"core-js": "^3.8.2",
"global": "^4.4.0",
@ -69,7 +69,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100",
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5",
"storybook": {
"displayName": "GraphiQL IDE",
"icon": "https://pbs.twimg.com/profile_images/618131103509909504/VQLBJ0TR_400x400.png",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-jest",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "React storybook addon that show component jest report",
"keywords": [
"addon",
@ -47,11 +47,11 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/api": "6.3.0-alpha.14",
"@storybook/components": "6.3.0-alpha.14",
"@storybook/core-events": "6.3.0-alpha.14",
"@storybook/theming": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/api": "6.3.0-alpha.15",
"@storybook/components": "6.3.0-alpha.15",
"@storybook/core-events": "6.3.0-alpha.15",
"@storybook/theming": "6.3.0-alpha.15",
"core-js": "^3.8.2",
"global": "^4.4.0",
"react-sizeme": "^3.0.1",
@ -76,7 +76,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100",
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5",
"storybook": {
"displayName": "Jest",
"icon": "https://pbs.twimg.com/profile_images/821713465245102080/mMtKIMax_400x400.jpg",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-knobs",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Storybook addon prop editor component",
"keywords": [
"addon",
@ -41,13 +41,13 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/api": "6.3.0-alpha.14",
"@storybook/channels": "6.3.0-alpha.14",
"@storybook/client-api": "6.3.0-alpha.14",
"@storybook/components": "6.3.0-alpha.14",
"@storybook/core-events": "6.3.0-alpha.14",
"@storybook/theming": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/api": "6.3.0-alpha.15",
"@storybook/channels": "6.3.0-alpha.15",
"@storybook/client-api": "6.3.0-alpha.15",
"@storybook/components": "6.3.0-alpha.15",
"@storybook/core-events": "6.3.0-alpha.15",
"@storybook/theming": "6.3.0-alpha.15",
"copy-to-clipboard": "^3.3.1",
"core-js": "^3.8.2",
"escape-html": "^1.0.3",
@ -84,7 +84,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100",
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5",
"storybook": {
"displayName": "Knobs",
"unsupportedFrameworks": [

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-links",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Link stories together to build demos and prototypes with your UI components",
"keywords": [
"addon",
@ -41,11 +41,11 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/client-logger": "6.3.0-alpha.14",
"@storybook/core-events": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/client-logger": "6.3.0-alpha.15",
"@storybook/core-events": "6.3.0-alpha.15",
"@storybook/csf": "0.0.1",
"@storybook/router": "6.3.0-alpha.14",
"@storybook/router": "6.3.0-alpha.15",
"@types/qs": "^6.9.5",
"core-js": "^3.8.2",
"global": "^4.4.0",
@ -72,7 +72,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100",
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5",
"storybook": {
"displayName": "Links",
"icon": "https://user-images.githubusercontent.com/263385/101991673-48355c80-3c7c-11eb-9b6e-b627c96a75f6.png",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-queryparams",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "parameter addon for storybook",
"keywords": [
"addon",
@ -42,12 +42,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/api": "6.3.0-alpha.14",
"@storybook/client-logger": "6.3.0-alpha.14",
"@storybook/components": "6.3.0-alpha.14",
"@storybook/core-events": "6.3.0-alpha.14",
"@storybook/theming": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/api": "6.3.0-alpha.15",
"@storybook/client-logger": "6.3.0-alpha.15",
"@storybook/components": "6.3.0-alpha.15",
"@storybook/core-events": "6.3.0-alpha.15",
"@storybook/theming": "6.3.0-alpha.15",
"core-js": "^3.8.2",
"global": "^4.4.0",
"qs": "^6.10.0",
@ -72,7 +72,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100",
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5",
"storybook": {
"displayName": "Query params",
"unsupportedFrameworks": [

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-storyshots",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Take a code snapshot of every story automatically with Jest",
"keywords": [
"addon",
@ -45,10 +45,10 @@
},
"dependencies": {
"@jest/transform": "^26.6.2",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/client-api": "6.3.0-alpha.14",
"@storybook/core": "6.3.0-alpha.14",
"@storybook/core-common": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/client-api": "6.3.0-alpha.15",
"@storybook/core": "6.3.0-alpha.15",
"@storybook/core-common": "6.3.0-alpha.15",
"@types/glob": "^7.1.3",
"@types/jest": "^26.0.16",
"@types/jest-specific-snapshot": "^0.5.3",
@ -67,11 +67,11 @@
"devDependencies": {
"@angular/core": "^11.2.0",
"@angular/platform-browser-dynamic": "^11.2.0",
"@storybook/addon-docs": "6.3.0-alpha.14",
"@storybook/angular": "6.3.0-alpha.14",
"@storybook/react": "6.3.0-alpha.14",
"@storybook/vue": "6.3.0-alpha.14",
"@storybook/vue3": "6.3.0-alpha.14",
"@storybook/addon-docs": "6.3.0-alpha.15",
"@storybook/angular": "6.3.0-alpha.15",
"@storybook/react": "6.3.0-alpha.15",
"@storybook/vue": "6.3.0-alpha.15",
"@storybook/vue3": "6.3.0-alpha.15",
"babel-loader": "^8.2.2",
"enzyme": "^3.11.0",
"enzyme-to-json": "^3.6.1",
@ -139,7 +139,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100",
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5",
"storybook": {
"displayName": "Storyshots",
"icon": "https://user-images.githubusercontent.com/263385/101991676-48cdf300-3c7c-11eb-8aa1-944dab6ab29b.png",

View File

@ -1,3 +1,4 @@
/** @jsxRuntime classic */
/** @jsx h */
import global from 'global';

View File

@ -228,6 +228,25 @@ initStoryshots({ suite: 'A11y checks', test: axeTest() });
For configuration, it uses the same `story.parameters.a11y` parameter as [`@storybook/addon-a11y`](https://github.com/storybookjs/storybook/tree/next/addons/a11y#parameters)
### Specifying options to `axeTest`
```js
import initStoryshots from '@storybook/addon-storyshots';
import { axeTest } from '@storybook/addon-storyshots-puppeteer';
const beforeAxeTest = (page, { context: { kind, story }, url }) => {
return new Promise((resolve) =>
setTimeout(() => {
resolve();
}, 600)
);
};
initStoryshots({ suite: 'A11y checks', test: axeTest({ beforeAxeTest }) });
```
`beforeAxeTest` receives the [Puppeteer page instance](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#class-page) and an object: `{ context: {kind, story}, url}`. _kind_ is the kind of the story and the _story_ its name. _url_ is the URL the browser will use to screenshot. `beforeAxeTest` is part of the promise chain and is called after the browser navigation is completed but before the screenshot is taken. It allows for triggering events on the page elements and delaying the axe test .
## _imageSnapshots_
Generates and compares screenshots of your stories using [jest-image-snapshot](https://github.com/americanexpress/jest-image-snapshot).
@ -317,4 +336,4 @@ initStoryshots({
suite: 'Image storyshots',
test: imageSnapshot({ storybookUrl: 'http://localhost:6006', beforeScreenshot }),
});
```
```

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-storyshots-puppeteer",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Image snapshots addition to StoryShots based on puppeteer",
"keywords": [
"addon",
@ -41,7 +41,7 @@
},
"dependencies": {
"@storybook/csf": "0.0.1",
"@storybook/node-logger": "6.3.0-alpha.14",
"@storybook/node-logger": "6.3.0-alpha.15",
"@types/jest-image-snapshot": "^4.1.3",
"@wordpress/jest-puppeteer-axe": "^1.10.0",
"core-js": "^3.8.2",
@ -53,7 +53,7 @@
"@types/puppeteer": "^5.4.0"
},
"peerDependencies": {
"@storybook/addon-storyshots": "6.3.0-alpha.14",
"@storybook/addon-storyshots": "6.3.0-alpha.15",
"puppeteer": "^2.0.0 || ^3.0.0"
},
"peerDependenciesMeta": {
@ -64,5 +64,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,5 +1,5 @@
import '@wordpress/jest-puppeteer-axe';
import { defaultCommonConfig, CommonConfig } from './config';
import { defaultAxeConfig, AxeConfig } from './config';
import { puppeteerTest } from './puppeteerTest';
declare global {
@ -11,13 +11,17 @@ declare global {
}
}
export const axeTest = (customConfig: Partial<CommonConfig> = {}) =>
export const axeTest = (customConfig: Partial<AxeConfig> = {}) => {
const config = { ...defaultAxeConfig, ...customConfig };
const { beforeAxeTest } = config;
puppeteerTest({
...defaultCommonConfig,
...customConfig,
...config,
async testBody(page, options) {
const parameters = options.context.parameters.a11y;
const include = parameters?.element ?? '#root';
await beforeAxeTest(page, options);
await expect(page).toPassAxeTests({ ...parameters, include });
},
});
};

View File

@ -43,6 +43,10 @@ export interface ImageSnapshotConfig extends CommonConfig {
afterScreenshot: (options: { image: string; context: Context }) => Promise<void>;
}
export interface AxeConfig extends CommonConfig {
beforeAxeTest: (page: Page, options: Options) => Promise<void>;
}
const noop: () => undefined = () => undefined;
const asyncNoop: () => Promise<undefined> = async () => undefined;
@ -82,3 +86,8 @@ export const defaultImageSnapshotConfig: ImageSnapshotConfig = {
beforeScreenshot: noop,
afterScreenshot: noop,
};
export const defaultAxeConfig: AxeConfig = {
...defaultCommonConfig,
beforeAxeTest: noop,
};

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-storysource",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "View a storys source code to see how it works and paste into your app",
"keywords": [
"addon",
@ -41,13 +41,13 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/api": "6.3.0-alpha.14",
"@storybook/client-logger": "6.3.0-alpha.14",
"@storybook/components": "6.3.0-alpha.14",
"@storybook/router": "6.3.0-alpha.14",
"@storybook/source-loader": "6.3.0-alpha.14",
"@storybook/theming": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/api": "6.3.0-alpha.15",
"@storybook/client-logger": "6.3.0-alpha.15",
"@storybook/components": "6.3.0-alpha.15",
"@storybook/router": "6.3.0-alpha.15",
"@storybook/source-loader": "6.3.0-alpha.15",
"@storybook/theming": "6.3.0-alpha.15",
"core-js": "^3.8.2",
"estraverse": "^5.2.0",
"loader-utils": "^2.0.0",
@ -75,7 +75,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100",
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5",
"storybook": {
"displayName": "Storysource",
"icon": "https://user-images.githubusercontent.com/263385/101991675-48cdf300-3c7c-11eb-9400-58de5ac6daa7.png",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-toolbars",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Create your own toolbar items that control story rendering",
"keywords": [
"addon",
@ -45,10 +45,10 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/api": "6.3.0-alpha.14",
"@storybook/client-api": "6.3.0-alpha.14",
"@storybook/components": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/api": "6.3.0-alpha.15",
"@storybook/client-api": "6.3.0-alpha.15",
"@storybook/components": "6.3.0-alpha.15",
"core-js": "^3.8.2"
},
"peerDependencies": {
@ -66,7 +66,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100",
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5",
"storybook": {
"displayName": "Toolbars",
"icon": "https://user-images.githubusercontent.com/263385/101991677-48cdf300-3c7c-11eb-93b4-19b0e3366959.png",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-viewport",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Build responsive components by adjusting Storybooks viewport size and orientation",
"keywords": [
"addon",
@ -42,12 +42,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/api": "6.3.0-alpha.14",
"@storybook/client-logger": "6.3.0-alpha.14",
"@storybook/components": "6.3.0-alpha.14",
"@storybook/core-events": "6.3.0-alpha.14",
"@storybook/theming": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/api": "6.3.0-alpha.15",
"@storybook/client-logger": "6.3.0-alpha.15",
"@storybook/components": "6.3.0-alpha.15",
"@storybook/core-events": "6.3.0-alpha.15",
"@storybook/theming": "6.3.0-alpha.15",
"core-js": "^3.8.2",
"global": "^4.4.0",
"memoizerific": "^1.11.3",
@ -69,7 +69,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100",
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5",
"storybook": {
"displayName": "Viewport",
"icon": "https://user-images.githubusercontent.com/263385/101991678-48cdf300-3c7c-11eb-9764-f8af293c1b28.png",

View File

@ -6,7 +6,8 @@ import { styled, Global, Theme, withTheme } from '@storybook/theming';
import { Icons, IconButton, WithTooltip, TooltipLinkList } from '@storybook/components';
import { useParameter, useAddonState } from '@storybook/api';
import { useStorybookApi, useParameter, useAddonState } from '@storybook/api';
import { registerShortcuts } from './shortcuts';
import { PARAM_KEY, ADDON_ID } from './constants';
import { MINIMAL_VIEWPORTS } from './defaults';
import { ViewportAddonParameter, ViewportMap, ViewportStyles, Styles } from './models';
@ -135,13 +136,19 @@ export const ViewportTool: FunctionComponent = memo(
});
const list = toList(viewports);
const api = useStorybookApi();
if (!list.find((i) => i.id === defaultViewport)) {
// eslint-disable-next-line no-console
console.warn(
`Cannot find "defaultViewport" of "${defaultViewport}" in addon-viewport configs, please check the "viewports" setting in the configuration.`
);
}
useEffect(() => {
registerShortcuts(api, setState, Object.keys(viewports));
}, [viewports]);
useEffect(() => {
setState({
selected:

View File

@ -0,0 +1,60 @@
import { API } from '@storybook/api';
import { ADDON_ID } from './constants';
const getCurrentViewportIndex = (viewportsKeys: string[], current: string): number =>
viewportsKeys.indexOf(current);
const getNextViewport = (viewportsKeys: string[], current: string): string => {
const currentViewportIndex = getCurrentViewportIndex(viewportsKeys, current);
return currentViewportIndex === viewportsKeys.length - 1
? viewportsKeys[0]
: viewportsKeys[currentViewportIndex + 1];
};
const getPreviousViewport = (viewportsKeys: string[], current: string): string => {
const currentViewportIndex = getCurrentViewportIndex(viewportsKeys, current);
return currentViewportIndex < 1
? viewportsKeys[viewportsKeys.length - 1]
: viewportsKeys[currentViewportIndex - 1];
};
export const registerShortcuts = async (api: API, setState: any, viewportsKeys: string[]) => {
await api.setAddonShortcut(ADDON_ID, {
label: 'Previous viewport',
defaultShortcut: ['shift', 'V'],
actionName: 'previous',
action: () => {
const { selected, isRotated } = api.getAddonState(ADDON_ID);
setState({
selected: getPreviousViewport(viewportsKeys, selected),
isRotated,
});
},
});
await api.setAddonShortcut(ADDON_ID, {
label: 'Next viewport',
defaultShortcut: ['V'],
actionName: 'next',
action: () => {
const { selected, isRotated } = api.getAddonState(ADDON_ID);
setState({
selected: getNextViewport(viewportsKeys, selected),
isRotated,
});
},
});
await api.setAddonShortcut(ADDON_ID, {
label: 'Reset viewport',
defaultShortcut: ['alt', 'V'],
actionName: 'reset',
action: () => {
const { isRotated } = api.getAddonState(ADDON_ID);
setState({
selected: 'reset',
isRotated,
});
},
});
};

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/angular",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Storybook for Angular: Develop Angular Components in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -45,11 +45,11 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/api": "6.3.0-alpha.14",
"@storybook/core": "6.3.0-alpha.14",
"@storybook/core-common": "6.3.0-alpha.14",
"@storybook/node-logger": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/api": "6.3.0-alpha.15",
"@storybook/core": "6.3.0-alpha.15",
"@storybook/core-common": "6.3.0-alpha.15",
"@storybook/node-logger": "6.3.0-alpha.15",
"@types/webpack-env": "^1.16.0",
"autoprefixer": "^9.8.6",
"core-js": "^3.8.2",
@ -81,7 +81,7 @@
"@angular/forms": "^11.2.0",
"@angular/platform-browser": "^11.2.0",
"@angular/platform-browser-dynamic": "^11.2.0",
"@nrwl/workspace": "^11.1.5",
"@nrwl/workspace": "^11.6.3",
"@types/autoprefixer": "^9.7.2",
"@types/jest": "^26.0.16",
"@webcomponents/custom-elements": "^1.4.3",
@ -124,5 +124,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -24,6 +24,7 @@ export const readAngularWorkspaceConfig = async (
const nxWorkspace = require('@nrwl/workspace').readWorkspaceConfig({
format: 'angularCli',
path: dirToSearch,
});
// Use the workspace version of nx when angular looks for the angular.json file

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/aurelia",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Storybook for Aurelia: Develop Aurelia Components in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -39,11 +39,11 @@
},
"dependencies": {
"@aurelia/webpack-loader": "^0.7.0",
"@storybook/addon-knobs": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/core": "6.3.0-alpha.14",
"@storybook/core-common": "6.3.0-alpha.14",
"@storybook/node-logger": "6.3.0-alpha.14",
"@storybook/addon-knobs": "6.3.0-alpha.15",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/core": "6.3.0-alpha.15",
"@storybook/core-common": "6.3.0-alpha.15",
"@storybook/node-logger": "6.3.0-alpha.15",
"fork-ts-checker-webpack-plugin": "^4.1.6",
"global": "^4.4.0",
"react": "16.14.0",
@ -74,5 +74,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/ember",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.",
"homepage": "https://github.com/storybookjs/storybook/tree/master/app/ember",
"bugs": {
@ -43,8 +43,8 @@
},
"dependencies": {
"@ember/test-helpers": "^2.1.4",
"@storybook/core": "6.3.0-alpha.14",
"@storybook/core-common": "6.3.0-alpha.14",
"@storybook/core": "6.3.0-alpha.15",
"@storybook/core-common": "6.3.0-alpha.15",
"core-js": "^3.8.2",
"global": "^4.4.0",
"react": "16.14.0",
@ -65,5 +65,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/html",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -45,10 +45,10 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/client-api": "6.3.0-alpha.14",
"@storybook/core": "6.3.0-alpha.14",
"@storybook/core-common": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/client-api": "6.3.0-alpha.15",
"@storybook/core": "6.3.0-alpha.15",
"@storybook/core-common": "6.3.0-alpha.15",
"@types/webpack-env": "^1.16.0",
"core-js": "^3.8.2",
"global": "^4.4.0",
@ -68,5 +68,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/marionette",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Storybook for Marionette: Develop Marionette.js component in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -38,8 +38,8 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/core": "6.3.0-alpha.14",
"@storybook/core-common": "6.3.0-alpha.14",
"@storybook/core": "6.3.0-alpha.15",
"@storybook/core-common": "6.3.0-alpha.15",
"common-tags": "^1.8.0",
"core-js": "^3.8.2",
"global": "^4.4.0",
@ -66,5 +66,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/marko",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Storybook for Marko: Develop Marko Component in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -46,9 +46,9 @@
},
"dependencies": {
"@marko/webpack": "^6.2.10",
"@storybook/client-logger": "6.3.0-alpha.14",
"@storybook/core": "6.3.0-alpha.14",
"@storybook/core-common": "6.3.0-alpha.14",
"@storybook/client-logger": "6.3.0-alpha.15",
"@storybook/core": "6.3.0-alpha.15",
"@storybook/core-common": "6.3.0-alpha.15",
"@types/webpack-env": "^1.16.0",
"core-js": "^3.8.2",
"global": "^4.4.0",
@ -69,5 +69,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/mithril",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Storybook for Mithril: Develop Mithril Component in isolation.",
"keywords": [
"storybook"
@ -47,9 +47,9 @@
"dependencies": {
"@babel/core": "^7.12.10",
"@babel/plugin-transform-react-jsx": "^7.12.12",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/core": "6.3.0-alpha.14",
"@storybook/core-common": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/core": "6.3.0-alpha.15",
"@storybook/core-common": "6.3.0-alpha.15",
"@types/mithril": "^2.0.6",
"@types/webpack-env": "^1.16.0",
"core-js": "^3.8.2",
@ -73,5 +73,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/preact",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Storybook for Preact: Develop Preact Component in isolation.",
"keywords": [
"storybook"
@ -46,9 +46,9 @@
},
"dependencies": {
"@babel/plugin-transform-react-jsx": "^7.12.12",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/core": "6.3.0-alpha.14",
"@storybook/core-common": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/core": "6.3.0-alpha.15",
"@storybook/core-common": "6.3.0-alpha.15",
"@types/webpack-env": "^1.16.0",
"core-js": "^3.8.2",
"global": "^4.4.0",
@ -72,5 +72,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/rax",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Storybook for Rax: Develop Rax Component in isolation.",
"keywords": [
"rax",
@ -46,8 +46,8 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/core": "6.3.0-alpha.14",
"@storybook/core-common": "6.3.0-alpha.14",
"@storybook/core": "6.3.0-alpha.15",
"@storybook/core-common": "6.3.0-alpha.15",
"babel-preset-rax": "^1.0.0-beta.0",
"core-js": "^3.8.2",
"driver-dom": "^2.2.0",
@ -69,5 +69,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/react",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Storybook for React: Develop React Component in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -49,10 +49,10 @@
"@babel/preset-flow": "^7.12.1",
"@babel/preset-react": "^7.12.10",
"@pmmmwh/react-refresh-webpack-plugin": "^0.4.3",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/core": "6.3.0-alpha.14",
"@storybook/core-common": "6.3.0-alpha.14",
"@storybook/node-logger": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/core": "6.3.0-alpha.15",
"@storybook/core-common": "6.3.0-alpha.15",
"@storybook/node-logger": "6.3.0-alpha.15",
"@storybook/semver": "^7.3.2",
"@types/webpack-env": "^1.16.0",
"babel-plugin-add-react-displayname": "^0.0.5",
@ -71,7 +71,7 @@
"webpack": "4"
},
"devDependencies": {
"@storybook/client-api": "6.3.0-alpha.14",
"@storybook/client-api": "6.3.0-alpha.15",
"@types/node": "^14.14.20",
"@types/prompts": "^2.0.9"
},
@ -94,5 +94,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/riot",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Storybook for riot.js: View riot snippets in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -46,8 +46,8 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/core": "6.3.0-alpha.14",
"@storybook/core-common": "6.3.0-alpha.14",
"@storybook/core": "6.3.0-alpha.15",
"@storybook/core-common": "6.3.0-alpha.15",
"core-js": "^3.8.2",
"global": "^4.4.0",
"raw-loader": "^4.0.2",
@ -78,5 +78,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/server",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -45,12 +45,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/api": "6.3.0-alpha.14",
"@storybook/client-api": "6.3.0-alpha.14",
"@storybook/core": "6.3.0-alpha.14",
"@storybook/core-common": "6.3.0-alpha.14",
"@storybook/node-logger": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/api": "6.3.0-alpha.15",
"@storybook/client-api": "6.3.0-alpha.15",
"@storybook/core": "6.3.0-alpha.15",
"@storybook/core-common": "6.3.0-alpha.15",
"@storybook/node-logger": "6.3.0-alpha.15",
"@types/webpack-env": "^1.16.0",
"core-js": "^3.8.2",
"global": "^4.4.0",
@ -70,5 +70,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/svelte",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -45,9 +45,9 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/core": "6.3.0-alpha.14",
"@storybook/core-common": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/core": "6.3.0-alpha.15",
"@storybook/core-common": "6.3.0-alpha.15",
"core-js": "^3.8.2",
"global": "^4.4.0",
"react": "16.14.0",
@ -73,5 +73,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/vue",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Storybook for Vue: Develop Vue Component in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -45,9 +45,9 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/core": "6.3.0-alpha.14",
"@storybook/core-common": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/core": "6.3.0-alpha.15",
"@storybook/core-common": "6.3.0-alpha.15",
"@types/webpack-env": "^1.16.0",
"core-js": "^3.8.2",
"global": "^4.4.0",
@ -81,5 +81,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/vue3",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -45,9 +45,9 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/core": "6.3.0-alpha.14",
"@storybook/core-common": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/core": "6.3.0-alpha.15",
"@storybook/core-common": "6.3.0-alpha.15",
"@types/webpack-env": "^1.16.0",
"core-js": "^3.8.2",
"global": "^4.4.0",
@ -80,5 +80,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/web-components",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Storybook for web-components: View web components snippets in isolation with Hot Reloading.",
"keywords": [
"lit-html",
@ -50,10 +50,10 @@
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-syntax-import-meta": "^7.10.4",
"@babel/preset-env": "^7.12.11",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/client-api": "6.3.0-alpha.14",
"@storybook/core": "6.3.0-alpha.14",
"@storybook/core-common": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/client-api": "6.3.0-alpha.15",
"@storybook/core": "6.3.0-alpha.15",
"@storybook/core-common": "6.3.0-alpha.15",
"@types/webpack-env": "^1.16.0",
"babel-plugin-bundled-import-meta": "^0.3.1",
"core-js": "^3.8.2",
@ -78,5 +78,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-decorator",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "decorator addon for storybook",
"keywords": [
"addon",
@ -29,13 +29,13 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/client-api": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/client-api": "6.3.0-alpha.15",
"core-js": "^3.8.2",
"global": "^4.4.0"
},
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-parameter",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "parameter addon for storybook",
"keywords": [
"addon",
@ -29,12 +29,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/api": "6.3.0-alpha.14",
"@storybook/client-logger": "6.3.0-alpha.14",
"@storybook/components": "6.3.0-alpha.14",
"@storybook/core-events": "6.3.0-alpha.14",
"@storybook/theming": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/api": "6.3.0-alpha.15",
"@storybook/client-logger": "6.3.0-alpha.15",
"@storybook/components": "6.3.0-alpha.15",
"@storybook/core-events": "6.3.0-alpha.15",
"@storybook/theming": "6.3.0-alpha.15",
"core-js": "^3.8.2",
"global": "^4.4.0",
"react": "^16.8.0 || ^17.0.0",
@ -43,5 +43,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-preview-wrapper",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "preview wrapper addon for storybook",
"keywords": [
"addon",
@ -29,11 +29,11 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"react": "^16.8.0 || ^17.0.0"
},
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-roundtrip",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "roundtrip addon for storybook",
"keywords": [
"addon",
@ -29,13 +29,13 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/api": "6.3.0-alpha.14",
"@storybook/client-api": "6.3.0-alpha.14",
"@storybook/client-logger": "6.3.0-alpha.14",
"@storybook/components": "6.3.0-alpha.14",
"@storybook/core-events": "6.3.0-alpha.14",
"@storybook/theming": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/api": "6.3.0-alpha.15",
"@storybook/client-api": "6.3.0-alpha.15",
"@storybook/client-logger": "6.3.0-alpha.15",
"@storybook/components": "6.3.0-alpha.15",
"@storybook/core-events": "6.3.0-alpha.15",
"@storybook/theming": "6.3.0-alpha.15",
"core-js": "^3.8.2",
"global": "^4.4.0",
"react": "^16.8.0 || ^17.0.0",
@ -44,5 +44,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -128,3 +128,12 @@ You can change your story through [parameters](../writing-stories/parameters.md)
/>
<!-- prettier-ignore-end -->
### Keyboard shortcuts
* Previous viewport: <kbd>shift</kbd> + <kbd>v</kbd>
* Next viewport: <kbd>v</kbd>
* Reset viewport: <kbd>alt</kbd> + <kbd>v</kbd>
These shortcuts can be edited in Storybook's Keyboard shortcuts page.

View File

@ -1 +1 @@
{"version":"6.3.0-alpha.14","info":{"plain":"### Bug Fixes\n\n- Core: Fix URL handling in Firefox ([#14556](https://github.com/storybookjs/storybook/pull/14556))\n- Build: Create webpack stats target directory if needed and accept boolean flag ([#14690](https://github.com/storybookjs/storybook/pull/14690))\n\n### Maintenance\n\n- Docs: Remove `babel-loader` and `@babel/core` peer deps ([#14689](https://github.com/storybookjs/storybook/pull/14689))\n- Use Storybook's built-in accessibility icon for VisionDeficiency tab. ([#14681](https://github.com/storybookjs/storybook/pull/14681))"}}
{"version":"6.3.0-alpha.15","info":{"plain":"### Features\n\n- Storyshots: Add `beforeAxeTest` hook ([#14563](https://github.com/storybookjs/storybook/pull/14563))\n- API: Add addon keyboard shortcuts & create shortcuts for addon-viewport ([#14658](https://github.com/storybookjs/storybook/pull/14658))\n\n### Bug Fixes\n\n- Storyshots/Preact: Add pragma @jsxRuntime classic ([#13849](https://github.com/storybookjs/storybook/pull/13849))\n- Core: Don't recreate a bound story function each time we call a decorated story ([#14692](https://github.com/storybookjs/storybook/pull/14692))\n\n### Maintenance\n\n- Build: Add NX bootstrap optimization ([#14535](https://github.com/storybookjs/storybook/pull/14535))"}}

View File

@ -1,6 +1,6 @@
{
"name": "angular-cli",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"private": true,
"license": "MIT",
"scripts": {
@ -37,19 +37,19 @@
"@angular/compiler-cli": "^11.2.0",
"@angular/elements": "^11.2.0",
"@compodoc/compodoc": "^1.1.11",
"@storybook/addon-a11y": "6.3.0-alpha.14",
"@storybook/addon-actions": "6.3.0-alpha.14",
"@storybook/addon-backgrounds": "6.3.0-alpha.14",
"@storybook/addon-controls": "6.3.0-alpha.14",
"@storybook/addon-docs": "6.3.0-alpha.14",
"@storybook/addon-jest": "6.3.0-alpha.14",
"@storybook/addon-knobs": "6.3.0-alpha.14",
"@storybook/addon-links": "6.3.0-alpha.14",
"@storybook/addon-storyshots": "6.3.0-alpha.14",
"@storybook/addon-storysource": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/angular": "6.3.0-alpha.14",
"@storybook/source-loader": "6.3.0-alpha.14",
"@storybook/addon-a11y": "6.3.0-alpha.15",
"@storybook/addon-actions": "6.3.0-alpha.15",
"@storybook/addon-backgrounds": "6.3.0-alpha.15",
"@storybook/addon-controls": "6.3.0-alpha.15",
"@storybook/addon-docs": "6.3.0-alpha.15",
"@storybook/addon-jest": "6.3.0-alpha.15",
"@storybook/addon-knobs": "6.3.0-alpha.15",
"@storybook/addon-links": "6.3.0-alpha.15",
"@storybook/addon-storyshots": "6.3.0-alpha.15",
"@storybook/addon-storysource": "6.3.0-alpha.15",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/angular": "6.3.0-alpha.15",
"@storybook/source-loader": "6.3.0-alpha.15",
"@types/core-js": "^2.5.4",
"@types/jest": "^26.0.16",
"@types/node": "^14.14.20",

View File

@ -1,6 +1,6 @@
{
"name": "aurelia-kitchen-sink",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"private": true,
"description": "An Aurelia client application.",
"repository": {
@ -22,18 +22,18 @@
},
"devDependencies": {
"@aurelia/webpack-loader": "^0.7.0",
"@storybook/addon-a11y": "6.3.0-alpha.14",
"@storybook/addon-actions": "6.3.0-alpha.14",
"@storybook/addon-backgrounds": "6.3.0-alpha.14",
"@storybook/addon-docs": "6.3.0-alpha.14",
"@storybook/addon-jest": "6.3.0-alpha.14",
"@storybook/addon-knobs": "6.3.0-alpha.14",
"@storybook/addon-links": "6.3.0-alpha.14",
"@storybook/addon-storyshots": "6.3.0-alpha.14",
"@storybook/addon-storysource": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/aurelia": "6.3.0-alpha.14",
"@storybook/source-loader": "6.3.0-alpha.14",
"@storybook/addon-a11y": "6.3.0-alpha.15",
"@storybook/addon-actions": "6.3.0-alpha.15",
"@storybook/addon-backgrounds": "6.3.0-alpha.15",
"@storybook/addon-docs": "6.3.0-alpha.15",
"@storybook/addon-jest": "6.3.0-alpha.15",
"@storybook/addon-knobs": "6.3.0-alpha.15",
"@storybook/addon-links": "6.3.0-alpha.15",
"@storybook/addon-storyshots": "6.3.0-alpha.15",
"@storybook/addon-storysource": "6.3.0-alpha.15",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/aurelia": "6.3.0-alpha.15",
"@storybook/source-loader": "6.3.0-alpha.15",
"@types/node": "^14.14.20",
"css-loader": "^3.6.0",
"file-loader": "^4.3.0",

View File

@ -1,6 +1,6 @@
{
"name": "cra-kitchen-sink",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"private": true,
"scripts": {
"build": "react-scripts build",
@ -11,7 +11,7 @@
"test": "react-scripts test --env=jsdom"
},
"dependencies": {
"@storybook/client-logger": "6.3.0-alpha.14",
"@storybook/client-logger": "6.3.0-alpha.15",
"global": "^4.4.0",
"prop-types": "^15.7.2",
"react": "16.14.0",
@ -21,20 +21,20 @@
},
"devDependencies": {
"@pmmmwh/react-refresh-webpack-plugin": "^0.4.3",
"@storybook/addon-a11y": "6.3.0-alpha.14",
"@storybook/addon-actions": "6.3.0-alpha.14",
"@storybook/addon-backgrounds": "6.3.0-alpha.14",
"@storybook/addon-docs": "6.3.0-alpha.14",
"@storybook/addon-events": "6.3.0-alpha.14",
"@storybook/addon-jest": "6.3.0-alpha.14",
"@storybook/addon-knobs": "6.3.0-alpha.14",
"@storybook/addon-links": "6.3.0-alpha.14",
"@storybook/addon-storyshots": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/builder-webpack4": "6.3.0-alpha.14",
"@storybook/addon-a11y": "6.3.0-alpha.15",
"@storybook/addon-actions": "6.3.0-alpha.15",
"@storybook/addon-backgrounds": "6.3.0-alpha.15",
"@storybook/addon-docs": "6.3.0-alpha.15",
"@storybook/addon-events": "6.3.0-alpha.15",
"@storybook/addon-jest": "6.3.0-alpha.15",
"@storybook/addon-knobs": "6.3.0-alpha.15",
"@storybook/addon-links": "6.3.0-alpha.15",
"@storybook/addon-storyshots": "6.3.0-alpha.15",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/builder-webpack4": "6.3.0-alpha.15",
"@storybook/preset-create-react-app": "^3.1.6",
"@storybook/react": "6.3.0-alpha.14",
"@storybook/theming": "6.3.0-alpha.14",
"@storybook/react": "6.3.0-alpha.15",
"@storybook/theming": "6.3.0-alpha.15",
"webpack": "4"
},
"storybook": {

View File

@ -1,6 +1,6 @@
{
"name": "cra-react15",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"private": true,
"scripts": {
"build": "react-scripts build",
@ -18,13 +18,13 @@
"react-scripts": "3.4.4"
},
"devDependencies": {
"@storybook/addon-actions": "6.3.0-alpha.14",
"@storybook/addon-links": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/builder-webpack4": "6.3.0-alpha.14",
"@storybook/addon-actions": "6.3.0-alpha.15",
"@storybook/addon-links": "6.3.0-alpha.15",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/builder-webpack4": "6.3.0-alpha.15",
"@storybook/preset-create-react-app": "^3.1.6",
"@storybook/react": "6.3.0-alpha.14",
"@storybook/theming": "6.3.0-alpha.14",
"@storybook/react": "6.3.0-alpha.15",
"@storybook/theming": "6.3.0-alpha.15",
"babel-core": "6",
"babel-runtime": "6",
"webpack": "4"

View File

@ -1,6 +1,6 @@
{
"name": "cra-ts-essentials",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"private": true,
"scripts": {
"build": "react-scripts build",
@ -34,11 +34,11 @@
"typescript": "^3.9.7"
},
"devDependencies": {
"@storybook/addon-essentials": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/builder-webpack4": "6.3.0-alpha.14",
"@storybook/addon-essentials": "6.3.0-alpha.15",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/builder-webpack4": "6.3.0-alpha.15",
"@storybook/preset-create-react-app": "^3.1.6",
"@storybook/react": "6.3.0-alpha.14",
"@storybook/react": "6.3.0-alpha.15",
"webpack": "4"
},
"storybook": {

View File

@ -1,6 +1,6 @@
{
"name": "cra-ts-kitchen-sink",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"private": true,
"scripts": {
"build": "react-scripts build",
@ -34,15 +34,15 @@
"typescript": "^3.9.7"
},
"devDependencies": {
"@storybook/addon-a11y": "6.3.0-alpha.14",
"@storybook/addon-actions": "6.3.0-alpha.14",
"@storybook/addon-docs": "6.3.0-alpha.14",
"@storybook/addon-knobs": "6.3.0-alpha.14",
"@storybook/addon-links": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/builder-webpack4": "6.3.0-alpha.14",
"@storybook/addon-a11y": "6.3.0-alpha.15",
"@storybook/addon-actions": "6.3.0-alpha.15",
"@storybook/addon-docs": "6.3.0-alpha.15",
"@storybook/addon-knobs": "6.3.0-alpha.15",
"@storybook/addon-links": "6.3.0-alpha.15",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/builder-webpack4": "6.3.0-alpha.15",
"@storybook/preset-create-react-app": "^3.1.6",
"@storybook/react": "6.3.0-alpha.14",
"@storybook/react": "6.3.0-alpha.15",
"@types/enzyme": "^3.10.8",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.9.1",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/example-devkits",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"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 ./"
},
"devDependencies": {
"@storybook/addon-decorator": "6.3.0-alpha.14",
"@storybook/addon-parameter": "6.3.0-alpha.14",
"@storybook/addon-preview-wrapper": "6.3.0-alpha.14",
"@storybook/addon-roundtrip": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/api": "6.3.0-alpha.14",
"@storybook/client-api": "6.3.0-alpha.14",
"@storybook/components": "6.3.0-alpha.14",
"@storybook/core-events": "6.3.0-alpha.14",
"@storybook/node-logger": "6.3.0-alpha.14",
"@storybook/react": "6.3.0-alpha.14",
"@storybook/theming": "6.3.0-alpha.14",
"@storybook/addon-decorator": "6.3.0-alpha.15",
"@storybook/addon-parameter": "6.3.0-alpha.15",
"@storybook/addon-preview-wrapper": "6.3.0-alpha.15",
"@storybook/addon-roundtrip": "6.3.0-alpha.15",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/api": "6.3.0-alpha.15",
"@storybook/client-api": "6.3.0-alpha.15",
"@storybook/components": "6.3.0-alpha.15",
"@storybook/core-events": "6.3.0-alpha.15",
"@storybook/node-logger": "6.3.0-alpha.15",
"@storybook/react": "6.3.0-alpha.15",
"@storybook/theming": "6.3.0-alpha.15",
"cors": "^2.8.5",
"cross-env": "^7.0.3",
"enzyme-to-json": "^3.6.1",

View File

@ -1,6 +1,6 @@
{
"name": "ember-example",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"private": true,
"scripts": {
"build": "ember build --output-path ember-output",
@ -17,19 +17,19 @@
"devDependencies": {
"@babel/core": "^7.12.10",
"@ember/optional-features": "^2.0.0",
"@storybook/addon-a11y": "6.3.0-alpha.14",
"@storybook/addon-actions": "6.3.0-alpha.14",
"@storybook/addon-backgrounds": "6.3.0-alpha.14",
"@storybook/addon-controls": "6.3.0-alpha.14",
"@storybook/addon-docs": "6.3.0-alpha.14",
"@storybook/addon-knobs": "6.3.0-alpha.14",
"@storybook/addon-links": "6.3.0-alpha.14",
"@storybook/addon-storysource": "6.3.0-alpha.14",
"@storybook/addon-viewport": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/ember": "6.3.0-alpha.14",
"@storybook/addon-a11y": "6.3.0-alpha.15",
"@storybook/addon-actions": "6.3.0-alpha.15",
"@storybook/addon-backgrounds": "6.3.0-alpha.15",
"@storybook/addon-controls": "6.3.0-alpha.15",
"@storybook/addon-docs": "6.3.0-alpha.15",
"@storybook/addon-knobs": "6.3.0-alpha.15",
"@storybook/addon-links": "6.3.0-alpha.15",
"@storybook/addon-storysource": "6.3.0-alpha.15",
"@storybook/addon-viewport": "6.3.0-alpha.15",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/ember": "6.3.0-alpha.15",
"@storybook/ember-cli-storybook": "^0.2.1",
"@storybook/source-loader": "6.3.0-alpha.14",
"@storybook/source-loader": "6.3.0-alpha.15",
"babel-loader": "^8",
"broccoli-asset-rev": "^3.0.0",
"cross-env": "^7.0.3",

View File

@ -1,6 +1,6 @@
{
"name": "html-kitchen-sink",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"private": true,
"description": "",
"keywords": [],
@ -13,25 +13,25 @@
"storybook": "start-storybook -p 9006"
},
"devDependencies": {
"@storybook/addon-a11y": "6.3.0-alpha.14",
"@storybook/addon-actions": "6.3.0-alpha.14",
"@storybook/addon-backgrounds": "6.3.0-alpha.14",
"@storybook/addon-controls": "6.3.0-alpha.14",
"@storybook/addon-docs": "6.3.0-alpha.14",
"@storybook/addon-events": "6.3.0-alpha.14",
"@storybook/addon-jest": "6.3.0-alpha.14",
"@storybook/addon-knobs": "6.3.0-alpha.14",
"@storybook/addon-links": "6.3.0-alpha.14",
"@storybook/addon-a11y": "6.3.0-alpha.15",
"@storybook/addon-actions": "6.3.0-alpha.15",
"@storybook/addon-backgrounds": "6.3.0-alpha.15",
"@storybook/addon-controls": "6.3.0-alpha.15",
"@storybook/addon-docs": "6.3.0-alpha.15",
"@storybook/addon-events": "6.3.0-alpha.15",
"@storybook/addon-jest": "6.3.0-alpha.15",
"@storybook/addon-knobs": "6.3.0-alpha.15",
"@storybook/addon-links": "6.3.0-alpha.15",
"@storybook/addon-postcss": "^2.0.0",
"@storybook/addon-storyshots": "6.3.0-alpha.14",
"@storybook/addon-storysource": "6.3.0-alpha.14",
"@storybook/addon-viewport": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/client-api": "6.3.0-alpha.14",
"@storybook/core": "6.3.0-alpha.14",
"@storybook/core-events": "6.3.0-alpha.14",
"@storybook/html": "6.3.0-alpha.14",
"@storybook/source-loader": "6.3.0-alpha.14",
"@storybook/addon-storyshots": "6.3.0-alpha.15",
"@storybook/addon-storysource": "6.3.0-alpha.15",
"@storybook/addon-viewport": "6.3.0-alpha.15",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/client-api": "6.3.0-alpha.15",
"@storybook/core": "6.3.0-alpha.15",
"@storybook/core-events": "6.3.0-alpha.15",
"@storybook/html": "6.3.0-alpha.15",
"@storybook/source-loader": "6.3.0-alpha.15",
"autoprefixer": "^10.0.1",
"eventemitter3": "^4.0.7",
"format-json": "^1.0.3",

View File

@ -1,6 +1,6 @@
{
"name": "marko-cli",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"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.3.0-alpha.14",
"@storybook/addon-actions": "6.3.0-alpha.14",
"@storybook/addon-knobs": "6.3.0-alpha.14",
"@storybook/addon-storysource": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/marko": "6.3.0-alpha.14",
"@storybook/source-loader": "6.3.0-alpha.14",
"@storybook/addon-a11y": "6.3.0-alpha.15",
"@storybook/addon-actions": "6.3.0-alpha.15",
"@storybook/addon-knobs": "6.3.0-alpha.15",
"@storybook/addon-storysource": "6.3.0-alpha.15",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/marko": "6.3.0-alpha.15",
"@storybook/source-loader": "6.3.0-alpha.15",
"prettier": "~2.2.1",
"webpack": "4"
},

View File

@ -1,6 +1,6 @@
{
"name": "mithril-example",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"private": true,
"scripts": {
"build-storybook": "build-storybook",
@ -10,17 +10,17 @@
"mithril": "^1.1.7"
},
"devDependencies": {
"@storybook/addon-a11y": "6.3.0-alpha.14",
"@storybook/addon-actions": "6.3.0-alpha.14",
"@storybook/addon-backgrounds": "6.3.0-alpha.14",
"@storybook/addon-knobs": "6.3.0-alpha.14",
"@storybook/addon-links": "6.3.0-alpha.14",
"@storybook/addon-storyshots": "6.3.0-alpha.14",
"@storybook/addon-storysource": "6.3.0-alpha.14",
"@storybook/addon-viewport": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/mithril": "6.3.0-alpha.14",
"@storybook/source-loader": "6.3.0-alpha.14",
"@storybook/addon-a11y": "6.3.0-alpha.15",
"@storybook/addon-actions": "6.3.0-alpha.15",
"@storybook/addon-backgrounds": "6.3.0-alpha.15",
"@storybook/addon-knobs": "6.3.0-alpha.15",
"@storybook/addon-links": "6.3.0-alpha.15",
"@storybook/addon-storyshots": "6.3.0-alpha.15",
"@storybook/addon-storysource": "6.3.0-alpha.15",
"@storybook/addon-viewport": "6.3.0-alpha.15",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/mithril": "6.3.0-alpha.15",
"@storybook/source-loader": "6.3.0-alpha.15",
"webpack": "4"
},
"storybook": {

View File

@ -1,6 +1,6 @@
{
"name": "official-storybook",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"private": true,
"scripts": {
"build-storybook": "cross-env STORYBOOK_DISPLAY_WARNING=true DISPLAY_WARNING=true build-storybook -c ./",
@ -15,33 +15,33 @@
"devDependencies": {
"@packtracker/webpack-plugin": "^2.3.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.4.3",
"@storybook/addon-a11y": "6.3.0-alpha.14",
"@storybook/addon-actions": "6.3.0-alpha.14",
"@storybook/addon-backgrounds": "6.3.0-alpha.14",
"@storybook/addon-controls": "6.3.0-alpha.14",
"@storybook/addon-cssresources": "6.3.0-alpha.14",
"@storybook/addon-design-assets": "6.3.0-alpha.14",
"@storybook/addon-docs": "6.3.0-alpha.14",
"@storybook/addon-events": "6.3.0-alpha.14",
"@storybook/addon-graphql": "6.3.0-alpha.14",
"@storybook/addon-jest": "6.3.0-alpha.14",
"@storybook/addon-knobs": "6.3.0-alpha.14",
"@storybook/addon-links": "6.3.0-alpha.14",
"@storybook/addon-queryparams": "6.3.0-alpha.14",
"@storybook/addon-storyshots": "6.3.0-alpha.14",
"@storybook/addon-storyshots-puppeteer": "6.3.0-alpha.14",
"@storybook/addon-storysource": "6.3.0-alpha.14",
"@storybook/addon-toolbars": "6.3.0-alpha.14",
"@storybook/addon-viewport": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/cli": "6.3.0-alpha.14",
"@storybook/components": "6.3.0-alpha.14",
"@storybook/core-events": "6.3.0-alpha.14",
"@storybook/addon-a11y": "6.3.0-alpha.15",
"@storybook/addon-actions": "6.3.0-alpha.15",
"@storybook/addon-backgrounds": "6.3.0-alpha.15",
"@storybook/addon-controls": "6.3.0-alpha.15",
"@storybook/addon-cssresources": "6.3.0-alpha.15",
"@storybook/addon-design-assets": "6.3.0-alpha.15",
"@storybook/addon-docs": "6.3.0-alpha.15",
"@storybook/addon-events": "6.3.0-alpha.15",
"@storybook/addon-graphql": "6.3.0-alpha.15",
"@storybook/addon-jest": "6.3.0-alpha.15",
"@storybook/addon-knobs": "6.3.0-alpha.15",
"@storybook/addon-links": "6.3.0-alpha.15",
"@storybook/addon-queryparams": "6.3.0-alpha.15",
"@storybook/addon-storyshots": "6.3.0-alpha.15",
"@storybook/addon-storyshots-puppeteer": "6.3.0-alpha.15",
"@storybook/addon-storysource": "6.3.0-alpha.15",
"@storybook/addon-toolbars": "6.3.0-alpha.15",
"@storybook/addon-viewport": "6.3.0-alpha.15",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/cli": "6.3.0-alpha.15",
"@storybook/components": "6.3.0-alpha.15",
"@storybook/core-events": "6.3.0-alpha.15",
"@storybook/design-system": "^5.4.7",
"@storybook/node-logger": "6.3.0-alpha.14",
"@storybook/react": "6.3.0-alpha.14",
"@storybook/source-loader": "6.3.0-alpha.14",
"@storybook/theming": "6.3.0-alpha.14",
"@storybook/node-logger": "6.3.0-alpha.15",
"@storybook/react": "6.3.0-alpha.15",
"@storybook/source-loader": "6.3.0-alpha.15",
"@storybook/theming": "6.3.0-alpha.15",
"chromatic": "^5.6.0",
"cors": "^2.8.5",
"cross-env": "^7.0.3",

View File

@ -1,20 +1,55 @@
import React, { useRef } from 'react';
import React, { useEffect, useRef } from 'react';
import { useArgs } from '@storybook/client-api';
export default {
title: 'Core/Rendering',
};
// NOTE: in our example apps each component is mounted twice as we render in strict mode
let timesMounted = 0;
let timesCounterMounted = 0;
export const Counter = () => {
const countRef = useRef();
if (!countRef.current) timesMounted += 1;
if (!countRef.current) timesCounterMounted += 1;
countRef.current = (countRef.current || 0) + 1;
return (
<div>
Mounted: {timesMounted}, rendered (this mount): {countRef.current}
Mounted: {timesCounterMounted}, rendered (this mount): {countRef.current}
</div>
);
};
// An example to test what happens when the story is remounted due to argChanges
let timesArgsChangeMounted = 0;
export const ArgsChange = () => {
const countRef = useRef();
if (!countRef.current) timesArgsChangeMounted += 1;
countRef.current = true;
return (
<div>
Mounted: {timesArgsChangeMounted} (NOTE: we use strict mode so this number is 2x what you'd
expect -- it should be 2, not 4 though!)
</div>
);
};
ArgsChange.args = {
first: 0,
};
ArgsChange.decorators = [
(StoryFn) => {
const [args, updateArgs] = useArgs();
useEffect(() => {
if (args.first === 0) {
updateArgs({ first: 1 });
}
}, []);
return <StoryFn />;
},
];

View File

@ -1,6 +1,6 @@
{
"name": "preact-example",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"private": true,
"scripts": {
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules",
@ -15,17 +15,17 @@
"devDependencies": {
"@babel/core": "^7.12.10",
"@babel/plugin-transform-runtime": "^7.12.10",
"@storybook/addon-a11y": "6.3.0-alpha.14",
"@storybook/addon-actions": "6.3.0-alpha.14",
"@storybook/addon-backgrounds": "6.3.0-alpha.14",
"@storybook/addon-knobs": "6.3.0-alpha.14",
"@storybook/addon-links": "6.3.0-alpha.14",
"@storybook/addon-storyshots": "6.3.0-alpha.14",
"@storybook/addon-storysource": "6.3.0-alpha.14",
"@storybook/addon-viewport": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/preact": "6.3.0-alpha.14",
"@storybook/source-loader": "6.3.0-alpha.14",
"@storybook/addon-a11y": "6.3.0-alpha.15",
"@storybook/addon-actions": "6.3.0-alpha.15",
"@storybook/addon-backgrounds": "6.3.0-alpha.15",
"@storybook/addon-knobs": "6.3.0-alpha.15",
"@storybook/addon-links": "6.3.0-alpha.15",
"@storybook/addon-storyshots": "6.3.0-alpha.15",
"@storybook/addon-storysource": "6.3.0-alpha.15",
"@storybook/addon-viewport": "6.3.0-alpha.15",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/preact": "6.3.0-alpha.15",
"@storybook/source-loader": "6.3.0-alpha.15",
"@types/prop-types": "^15.7.3",
"@types/react": "^17",
"@types/react-dom": "^17",

View File

@ -1,6 +1,6 @@
{
"name": "rax-kitchen-sink",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"private": true,
"scripts": {
"build": "build-scripts build",
@ -20,20 +20,20 @@
"devDependencies": {
"@alib/build-scripts": "^0.1.8",
"@babel/preset-react": "^7.12.10",
"@storybook/addon-a11y": "6.3.0-alpha.14",
"@storybook/addon-actions": "6.3.0-alpha.14",
"@storybook/addon-backgrounds": "6.3.0-alpha.14",
"@storybook/addon-events": "6.3.0-alpha.14",
"@storybook/addon-jest": "6.3.0-alpha.14",
"@storybook/addon-knobs": "6.3.0-alpha.14",
"@storybook/addon-links": "6.3.0-alpha.14",
"@storybook/addon-storyshots": "6.3.0-alpha.14",
"@storybook/addon-storysource": "6.3.0-alpha.14",
"@storybook/addon-viewport": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/rax": "6.3.0-alpha.14",
"@storybook/source-loader": "6.3.0-alpha.14",
"@storybook/theming": "6.3.0-alpha.14",
"@storybook/addon-a11y": "6.3.0-alpha.15",
"@storybook/addon-actions": "6.3.0-alpha.15",
"@storybook/addon-backgrounds": "6.3.0-alpha.15",
"@storybook/addon-events": "6.3.0-alpha.15",
"@storybook/addon-jest": "6.3.0-alpha.15",
"@storybook/addon-knobs": "6.3.0-alpha.15",
"@storybook/addon-links": "6.3.0-alpha.15",
"@storybook/addon-storyshots": "6.3.0-alpha.15",
"@storybook/addon-storysource": "6.3.0-alpha.15",
"@storybook/addon-viewport": "6.3.0-alpha.15",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/rax": "6.3.0-alpha.15",
"@storybook/source-loader": "6.3.0-alpha.15",
"@storybook/theming": "6.3.0-alpha.15",
"babel-eslint": "^10.1.0",
"build-plugin-rax-app": "^0.2.0",
"stylesheet-loader": "^0.8.0"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/example-react-ts-webpack4",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"private": true,
"scripts": {
"build-storybook": "cross-env STORYBOOK_DISPLAY_WARNING=true DISPLAY_WARNING=true build-storybook -c ./",
@ -8,10 +8,10 @@
"storybook": "cross-env STORYBOOK_DISPLAY_WARNING=true DISPLAY_WARNING=true start-storybook -p 9011 -c ./"
},
"dependencies": {
"@storybook/addon-controls": "6.3.0-alpha.14",
"@storybook/addon-essentials": "6.3.0-alpha.14",
"@storybook/builder-webpack4": "6.3.0-alpha.14",
"@storybook/react": "6.3.0-alpha.14",
"@storybook/addon-controls": "6.3.0-alpha.15",
"@storybook/addon-essentials": "6.3.0-alpha.15",
"@storybook/builder-webpack4": "6.3.0-alpha.15",
"@storybook/react": "6.3.0-alpha.15",
"@types/react": "^16.14.2",
"@types/react-dom": "^16.9.10",
"prop-types": "15.7.2",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/example-react-ts",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"private": true,
"scripts": {
"build-storybook": "cross-env STORYBOOK_DISPLAY_WARNING=true DISPLAY_WARNING=true build-storybook -c ./",
@ -8,9 +8,9 @@
"storybook": "cross-env STORYBOOK_DISPLAY_WARNING=true DISPLAY_WARNING=true start-storybook -p 9011 -c ./"
},
"dependencies": {
"@storybook/addon-controls": "6.3.0-alpha.14",
"@storybook/addon-essentials": "6.3.0-alpha.14",
"@storybook/react": "6.3.0-alpha.14",
"@storybook/addon-controls": "6.3.0-alpha.15",
"@storybook/addon-essentials": "6.3.0-alpha.15",
"@storybook/react": "6.3.0-alpha.15",
"@types/react": "^16.14.2",
"@types/react-dom": "^16.9.10",
"prop-types": "15.7.2",

View File

@ -1,6 +1,6 @@
{
"name": "riot-example",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"private": true,
"scripts": {
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules",
@ -15,17 +15,17 @@
},
"devDependencies": {
"@babel/core": "^7.12.10",
"@storybook/addon-a11y": "6.3.0-alpha.14",
"@storybook/addon-actions": "6.3.0-alpha.14",
"@storybook/addon-backgrounds": "6.3.0-alpha.14",
"@storybook/addon-knobs": "6.3.0-alpha.14",
"@storybook/addon-links": "6.3.0-alpha.14",
"@storybook/addon-storyshots": "6.3.0-alpha.14",
"@storybook/addon-storysource": "6.3.0-alpha.14",
"@storybook/addon-viewport": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/riot": "6.3.0-alpha.14",
"@storybook/source-loader": "6.3.0-alpha.14",
"@storybook/addon-a11y": "6.3.0-alpha.15",
"@storybook/addon-actions": "6.3.0-alpha.15",
"@storybook/addon-backgrounds": "6.3.0-alpha.15",
"@storybook/addon-knobs": "6.3.0-alpha.15",
"@storybook/addon-links": "6.3.0-alpha.15",
"@storybook/addon-storyshots": "6.3.0-alpha.15",
"@storybook/addon-storysource": "6.3.0-alpha.15",
"@storybook/addon-viewport": "6.3.0-alpha.15",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/riot": "6.3.0-alpha.15",
"@storybook/source-loader": "6.3.0-alpha.15",
"babel-loader": "^8.2.2",
"cross-env": "^7.0.3",
"file-loader": "^6.2.0",

View File

@ -1,6 +1,6 @@
{
"name": "server-kitchen-sink",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"private": true,
"description": "",
"keywords": [],
@ -14,13 +14,13 @@
"storybook": "SERVER_PORT=1137 start-storybook -p 9006 --quiet"
},
"devDependencies": {
"@storybook/addon-a11y": "6.3.0-alpha.14",
"@storybook/addon-actions": "6.3.0-alpha.14",
"@storybook/addon-backgrounds": "6.3.0-alpha.14",
"@storybook/addon-controls": "6.3.0-alpha.14",
"@storybook/addon-links": "6.3.0-alpha.14",
"@storybook/node-logger": "6.3.0-alpha.14",
"@storybook/server": "6.3.0-alpha.14",
"@storybook/addon-a11y": "6.3.0-alpha.15",
"@storybook/addon-actions": "6.3.0-alpha.15",
"@storybook/addon-backgrounds": "6.3.0-alpha.15",
"@storybook/addon-controls": "6.3.0-alpha.15",
"@storybook/addon-links": "6.3.0-alpha.15",
"@storybook/node-logger": "6.3.0-alpha.15",
"@storybook/server": "6.3.0-alpha.15",
"concurrently": "^5.3.0",
"cors": "^2.8.5",
"express": "~4.17.1",

View File

@ -1,12 +1,12 @@
{
"name": "standalone-preview",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"private": true,
"scripts": {
"storybook": "parcel ./storybook.html --port 1337"
},
"devDependencies": {
"@storybook/react": "6.3.0-alpha.14",
"@storybook/react": "6.3.0-alpha.15",
"parcel": "^1.12.4",
"react": "16.14.0",
"react-dom": "16.14.0"

View File

@ -1,6 +1,6 @@
{
"name": "svelte-example",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"private": true,
"scripts": {
"build-storybook": "build-storybook -s public",
@ -10,19 +10,19 @@
"global": "^4.4.0"
},
"devDependencies": {
"@storybook/addon-a11y": "6.3.0-alpha.14",
"@storybook/addon-actions": "6.3.0-alpha.14",
"@storybook/addon-backgrounds": "6.3.0-alpha.14",
"@storybook/addon-controls": "6.3.0-alpha.14",
"@storybook/addon-docs": "6.3.0-alpha.14",
"@storybook/addon-knobs": "6.3.0-alpha.14",
"@storybook/addon-links": "6.3.0-alpha.14",
"@storybook/addon-storyshots": "6.3.0-alpha.14",
"@storybook/addon-storysource": "6.3.0-alpha.14",
"@storybook/addon-viewport": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/source-loader": "6.3.0-alpha.14",
"@storybook/svelte": "6.3.0-alpha.14",
"@storybook/addon-a11y": "6.3.0-alpha.15",
"@storybook/addon-actions": "6.3.0-alpha.15",
"@storybook/addon-backgrounds": "6.3.0-alpha.15",
"@storybook/addon-controls": "6.3.0-alpha.15",
"@storybook/addon-docs": "6.3.0-alpha.15",
"@storybook/addon-knobs": "6.3.0-alpha.15",
"@storybook/addon-links": "6.3.0-alpha.15",
"@storybook/addon-storyshots": "6.3.0-alpha.15",
"@storybook/addon-storysource": "6.3.0-alpha.15",
"@storybook/addon-viewport": "6.3.0-alpha.15",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/source-loader": "6.3.0-alpha.15",
"@storybook/svelte": "6.3.0-alpha.15",
"svelte-jester": "1.3.0",
"svelte-preprocess": "4.6.8"
},

View File

@ -1,6 +1,6 @@
{
"name": "vue-3-cli-example",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"private": true,
"scripts": {
"build": "vue-cli-service build",
@ -14,11 +14,11 @@
},
"devDependencies": {
"@babel/core": "^7.12.10",
"@storybook/addon-actions": "6.3.0-alpha.14",
"@storybook/addon-essentials": "6.3.0-alpha.14",
"@storybook/addon-links": "6.3.0-alpha.14",
"@storybook/addon-storyshots": "6.3.0-alpha.14",
"@storybook/vue3": "6.3.0-alpha.14",
"@storybook/addon-actions": "6.3.0-alpha.15",
"@storybook/addon-essentials": "6.3.0-alpha.15",
"@storybook/addon-links": "6.3.0-alpha.15",
"@storybook/addon-storyshots": "6.3.0-alpha.15",
"@storybook/vue3": "6.3.0-alpha.15",
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-typescript": "~4.5.0",
"@vue/cli-service": "~4.5.0",

View File

@ -1,6 +1,6 @@
{
"name": "vue-cli-example",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"private": true,
"scripts": {
"build": "vue-cli-service build",
@ -15,11 +15,11 @@
"vue-property-decorator": "^9.1.2"
},
"devDependencies": {
"@storybook/addon-controls": "6.3.0-alpha.14",
"@storybook/addon-essentials": "6.3.0-alpha.14",
"@storybook/addon-controls": "6.3.0-alpha.15",
"@storybook/addon-essentials": "6.3.0-alpha.15",
"@storybook/preset-scss": "^1.0.3",
"@storybook/source-loader": "6.3.0-alpha.14",
"@storybook/vue": "6.3.0-alpha.14",
"@storybook/source-loader": "6.3.0-alpha.15",
"@storybook/vue": "6.3.0-alpha.15",
"@vue/cli-plugin-babel": "~4.3.1",
"@vue/cli-plugin-typescript": "~4.3.1",
"@vue/cli-service": "~4.3.1",

View File

@ -1,6 +1,6 @@
{
"name": "vue-example",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"private": true,
"scripts": {
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules",
@ -14,19 +14,19 @@
},
"devDependencies": {
"@babel/core": "^7.12.10",
"@storybook/addon-a11y": "6.3.0-alpha.14",
"@storybook/addon-actions": "6.3.0-alpha.14",
"@storybook/addon-backgrounds": "6.3.0-alpha.14",
"@storybook/addon-controls": "6.3.0-alpha.14",
"@storybook/addon-docs": "6.3.0-alpha.14",
"@storybook/addon-knobs": "6.3.0-alpha.14",
"@storybook/addon-links": "6.3.0-alpha.14",
"@storybook/addon-storyshots": "6.3.0-alpha.14",
"@storybook/addon-storysource": "6.3.0-alpha.14",
"@storybook/addon-viewport": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/source-loader": "6.3.0-alpha.14",
"@storybook/vue": "6.3.0-alpha.14",
"@storybook/addon-a11y": "6.3.0-alpha.15",
"@storybook/addon-actions": "6.3.0-alpha.15",
"@storybook/addon-backgrounds": "6.3.0-alpha.15",
"@storybook/addon-controls": "6.3.0-alpha.15",
"@storybook/addon-docs": "6.3.0-alpha.15",
"@storybook/addon-knobs": "6.3.0-alpha.15",
"@storybook/addon-links": "6.3.0-alpha.15",
"@storybook/addon-storyshots": "6.3.0-alpha.15",
"@storybook/addon-storysource": "6.3.0-alpha.15",
"@storybook/addon-viewport": "6.3.0-alpha.15",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/source-loader": "6.3.0-alpha.15",
"@storybook/vue": "6.3.0-alpha.15",
"@vue/babel-preset-jsx": "^1.2.4",
"babel-loader": "^8.2.2",
"cross-env": "^7.0.3",

View File

@ -1,6 +1,6 @@
{
"name": "web-components-kitchen-sink",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"private": true,
"description": "",
"keywords": [],
@ -12,24 +12,24 @@
"storybook": "start-storybook -p 9006"
},
"devDependencies": {
"@storybook/addon-a11y": "6.3.0-alpha.14",
"@storybook/addon-actions": "6.3.0-alpha.14",
"@storybook/addon-backgrounds": "6.3.0-alpha.14",
"@storybook/addon-controls": "6.3.0-alpha.14",
"@storybook/addon-docs": "6.3.0-alpha.14",
"@storybook/addon-events": "6.3.0-alpha.14",
"@storybook/addon-jest": "6.3.0-alpha.14",
"@storybook/addon-knobs": "6.3.0-alpha.14",
"@storybook/addon-links": "6.3.0-alpha.14",
"@storybook/addon-storyshots": "6.3.0-alpha.14",
"@storybook/addon-storysource": "6.3.0-alpha.14",
"@storybook/addon-viewport": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/client-api": "6.3.0-alpha.14",
"@storybook/core": "6.3.0-alpha.14",
"@storybook/core-events": "6.3.0-alpha.14",
"@storybook/source-loader": "6.3.0-alpha.14",
"@storybook/web-components": "6.3.0-alpha.14",
"@storybook/addon-a11y": "6.3.0-alpha.15",
"@storybook/addon-actions": "6.3.0-alpha.15",
"@storybook/addon-backgrounds": "6.3.0-alpha.15",
"@storybook/addon-controls": "6.3.0-alpha.15",
"@storybook/addon-docs": "6.3.0-alpha.15",
"@storybook/addon-events": "6.3.0-alpha.15",
"@storybook/addon-jest": "6.3.0-alpha.15",
"@storybook/addon-knobs": "6.3.0-alpha.15",
"@storybook/addon-links": "6.3.0-alpha.15",
"@storybook/addon-storyshots": "6.3.0-alpha.15",
"@storybook/addon-storysource": "6.3.0-alpha.15",
"@storybook/addon-viewport": "6.3.0-alpha.15",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/client-api": "6.3.0-alpha.15",
"@storybook/core": "6.3.0-alpha.15",
"@storybook/core-events": "6.3.0-alpha.15",
"@storybook/source-loader": "6.3.0-alpha.15",
"@storybook/web-components": "6.3.0-alpha.15",
"babel-loader": "^8.2.2",
"eventemitter3": "^4.0.7",
"format-json": "^1.0.3",

View File

@ -2,5 +2,5 @@
"npmClient": "yarn",
"useWorkspaces": true,
"registry": "https://registry.npmjs.org",
"version": "6.3.0-alpha.14"
"version": "6.3.0-alpha.15"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addons",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Storybook addons store",
"keywords": [
"storybook"
@ -40,12 +40,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/api": "6.3.0-alpha.14",
"@storybook/channels": "6.3.0-alpha.14",
"@storybook/client-logger": "6.3.0-alpha.14",
"@storybook/core-events": "6.3.0-alpha.14",
"@storybook/router": "6.3.0-alpha.14",
"@storybook/theming": "6.3.0-alpha.14",
"@storybook/api": "6.3.0-alpha.15",
"@storybook/channels": "6.3.0-alpha.15",
"@storybook/client-logger": "6.3.0-alpha.15",
"@storybook/core-events": "6.3.0-alpha.15",
"@storybook/router": "6.3.0-alpha.15",
"@storybook/theming": "6.3.0-alpha.15",
"core-js": "^3.8.2",
"global": "^4.4.0",
"regenerator-runtime": "^0.13.7"
@ -57,5 +57,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -53,6 +53,7 @@ export interface StoryIdentifier {
name: StoryName;
}
export type StoryContextUpdate = Partial<StoryContext>;
export type StoryContext = StoryIdentifier & {
[key: string]: any;
parameters: Parameters;
@ -93,8 +94,13 @@ export interface OptionsParameter extends Object {
export type StoryGetter = (context: StoryContext) => any;
// This is the type of story function passed to a decorator -- does not rely on being passed any context
export type PartialStoryFn<ReturnType = unknown> = (p?: StoryContextUpdate) => ReturnType;
// This is a passArgsFirst: false user story function
export type LegacyStoryFn<ReturnType = unknown> = (p?: StoryContext) => ReturnType;
// This is a passArgsFirst: true user story function
export type ArgsStoryFn<ReturnType = unknown> = (a?: Args, p?: StoryContext) => ReturnType;
// This is either type of user story function
export type StoryFn<ReturnType = unknown> = LegacyStoryFn<ReturnType> | ArgsStoryFn<ReturnType>;
export type StoryWrapper = (
@ -136,16 +142,16 @@ export interface StoryApi<StoryFnReturnType = unknown> {
}
export type DecoratorFunction<StoryFnReturnType = unknown> = (
fn: StoryFn<StoryFnReturnType>,
fn: PartialStoryFn<StoryFnReturnType>,
c: StoryContext
) => ReturnType<StoryFn<StoryFnReturnType>>;
) => ReturnType<LegacyStoryFn<StoryFnReturnType>>;
export type LoaderFunction = (c: StoryContext) => Promise<Record<string, any>>;
export type DecorateStoryFunction<StoryFnReturnType = unknown> = (
storyFn: StoryFn<StoryFnReturnType>,
storyFn: LegacyStoryFn<StoryFnReturnType>,
decorators: DecoratorFunction<StoryFnReturnType>[]
) => StoryFn<StoryFnReturnType>;
) => LegacyStoryFn<StoryFnReturnType>;
export interface ClientStoryApi<StoryFnReturnType = unknown> {
storiesOf(kind: StoryKind, module: NodeModule): StoryApi<StoryFnReturnType>;

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/api",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Core Storybook API & Context",
"keywords": [
"storybook"
@ -39,13 +39,13 @@
},
"dependencies": {
"@reach/router": "^1.3.4",
"@storybook/channels": "6.3.0-alpha.14",
"@storybook/client-logger": "6.3.0-alpha.14",
"@storybook/core-events": "6.3.0-alpha.14",
"@storybook/channels": "6.3.0-alpha.15",
"@storybook/client-logger": "6.3.0-alpha.15",
"@storybook/core-events": "6.3.0-alpha.15",
"@storybook/csf": "0.0.1",
"@storybook/router": "6.3.0-alpha.14",
"@storybook/router": "6.3.0-alpha.15",
"@storybook/semver": "^7.3.2",
"@storybook/theming": "6.3.0-alpha.14",
"@storybook/theming": "6.3.0-alpha.15",
"@types/reach__router": "^1.3.7",
"core-js": "^3.8.2",
"fast-deep-equal": "^3.1.3",
@ -72,5 +72,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -20,8 +20,13 @@ export interface SubState {
export interface SubAPI {
getShortcutKeys(): Shortcuts;
getDefaultShortcuts(): Shortcuts | AddonShortcutDefaults;
getAddonsShortcuts(): AddonShortcuts;
getAddonsShortcutLabels(): AddonShortcutLabels;
getAddonsShortcutDefaults(): AddonShortcutDefaults;
setShortcuts(shortcuts: Shortcuts): Promise<Shortcuts>;
setShortcut(action: Action, value: KeyCollection): Promise<KeyCollection>;
setAddonShortcut(addon: string, shortcut: AddonShortcut): Promise<AddonShortcut>;
restoreAllDefaultShortcuts(): Promise<Shortcuts>;
restoreDefaultShortcut(action: Action): Promise<KeyCollection>;
handleKeydownEvent(event: Event): void;
@ -52,6 +57,17 @@ export interface Shortcuts {
export type Action = keyof Shortcuts;
interface AddonShortcut {
label: string;
defaultShortcut: KeyCollection;
actionName: string;
showInMenu?: boolean;
action: (...args: any[]) => any;
}
type AddonShortcuts = Record<string, AddonShortcut>;
type AddonShortcutLabels = Record<string, string>;
type AddonShortcutDefaults = Record<string, KeyCollection>;
export const defaultShortcuts: Shortcuts = Object.freeze({
fullScreen: ['F'],
togglePanel: ['A'],
@ -73,6 +89,7 @@ export const defaultShortcuts: Shortcuts = Object.freeze({
expandAll: [controlOrMetaKey(), 'shift', 'ArrowDown'],
});
const addonsShortcuts: AddonShortcuts = {};
export interface Event extends KeyboardEvent {
target: {
tagName: string;
@ -96,20 +113,54 @@ export const init: ModuleFn = ({ store, fullAPI }) => {
getShortcutKeys(): Shortcuts {
return store.getState().shortcuts;
},
getDefaultShortcuts(): Shortcuts | AddonShortcutDefaults {
return {
...defaultShortcuts,
...api.getAddonsShortcutDefaults(),
};
},
getAddonsShortcuts(): AddonShortcuts {
return addonsShortcuts;
},
getAddonsShortcutLabels(): AddonShortcutLabels {
const labels: AddonShortcutLabels = {};
Object.entries(api.getAddonsShortcuts()).forEach(([actionName, { label }]) => {
labels[actionName] = label;
});
return labels;
},
getAddonsShortcutDefaults(): AddonShortcutDefaults {
const defaults: AddonShortcutDefaults = {};
Object.entries(api.getAddonsShortcuts()).forEach(([actionName, { defaultShortcut }]) => {
defaults[actionName] = defaultShortcut;
});
return defaults;
},
async setShortcuts(shortcuts: Shortcuts) {
await store.setState({ shortcuts }, { persistence: 'permanent' });
return shortcuts;
},
async restoreAllDefaultShortcuts() {
return api.setShortcuts(defaultShortcuts);
return api.setShortcuts(api.getDefaultShortcuts() as Shortcuts);
},
async setShortcut(action, value) {
const shortcuts = api.getShortcutKeys();
await api.setShortcuts({ ...shortcuts, [action]: value });
return value;
},
async setAddonShortcut(addon: string, shortcut: AddonShortcut) {
const shortcuts = api.getShortcutKeys();
await api.setShortcuts({
...shortcuts,
[`${addon}-${shortcut.actionName}`]: shortcut.defaultShortcut,
});
addonsShortcuts[`${addon}-${shortcut.actionName}`] = shortcut;
return shortcut;
},
async restoreDefaultShortcut(action) {
const defaultShortcut = defaultShortcuts[action];
const defaultShortcut = api.getDefaultShortcuts()[action];
return api.setShortcut(action, defaultShortcut);
},
@ -277,6 +328,7 @@ export const init: ModuleFn = ({ store, fullAPI }) => {
break;
}
default:
addonsShortcuts[feature].action();
break;
}
},

View File

@ -10,7 +10,134 @@ function createMockStore() {
};
}
const mockAddonShortcut = {
addon: 'my-addon',
shortcut: {
label: 'Do something',
defaultShortcut: ['O'],
actionName: 'doSomething',
action: () => {
//
},
},
};
const mockAddonSecondShortcut = {
addon: 'my-addon',
shortcut: {
label: 'Do something else',
defaultShortcut: ['P'],
actionName: 'doSomethingElse',
action: () => {
//
},
},
};
const mockSecondAddonShortcut = {
addon: 'my-other-addon',
shortcut: {
label: 'Create issue',
defaultShortcut: ['N'],
actionName: 'createIssue',
action: () => {
//
},
},
};
describe('shortcuts api', () => {
it('gets defaults', () => {
const store = createMockStore();
const { api, state } = initShortcuts({ store });
store.setState(state);
expect(api.getDefaultShortcuts()).toHaveProperty('fullScreen', ['F']);
});
it('gets defaults including addon ones', async () => {
const store = createMockStore();
const { api, state } = initShortcuts({ store });
store.setState(state);
await api.setAddonShortcut(mockAddonShortcut.addon, mockAddonShortcut.shortcut);
await api.setAddonShortcut(mockAddonSecondShortcut.addon, mockAddonSecondShortcut.shortcut);
await api.setAddonShortcut(mockSecondAddonShortcut.addon, mockSecondAddonShortcut.shortcut);
expect(api.getDefaultShortcuts()).toHaveProperty('fullScreen', ['F']);
expect(api.getDefaultShortcuts()).toHaveProperty(
`${mockAddonShortcut.addon}-${mockAddonShortcut.shortcut.actionName}`,
mockAddonShortcut.shortcut.defaultShortcut
);
expect(api.getDefaultShortcuts()).toHaveProperty(
`${mockAddonSecondShortcut.addon}-${mockAddonSecondShortcut.shortcut.actionName}`,
mockAddonSecondShortcut.shortcut.defaultShortcut
);
expect(api.getDefaultShortcuts()).toHaveProperty(
`${mockSecondAddonShortcut.addon}-${mockSecondAddonShortcut.shortcut.actionName}`,
mockSecondAddonShortcut.shortcut.defaultShortcut
);
});
it('gets addons shortcuts', async () => {
const store = createMockStore();
const { api, state } = initShortcuts({ store });
store.setState(state);
await api.setAddonShortcut(mockAddonShortcut.addon, mockAddonShortcut.shortcut);
await api.setAddonShortcut(mockAddonSecondShortcut.addon, mockAddonSecondShortcut.shortcut);
await api.setAddonShortcut(mockSecondAddonShortcut.addon, mockSecondAddonShortcut.shortcut);
expect(api.getAddonsShortcuts()).toStrictEqual({
[`${mockAddonShortcut.addon}-${mockAddonShortcut.shortcut.actionName}`]: mockAddonShortcut.shortcut,
[`${mockAddonSecondShortcut.addon}-${mockAddonSecondShortcut.shortcut.actionName}`]: mockAddonSecondShortcut.shortcut,
[`${mockSecondAddonShortcut.addon}-${mockSecondAddonShortcut.shortcut.actionName}`]: mockSecondAddonShortcut.shortcut,
});
});
it('gets addons shortcut labels', async () => {
const store = createMockStore();
const { api, state } = initShortcuts({ store });
store.setState(state);
await api.setAddonShortcut(mockAddonShortcut.addon, mockAddonShortcut.shortcut);
await api.setAddonShortcut(mockAddonSecondShortcut.addon, mockAddonSecondShortcut.shortcut);
await api.setAddonShortcut(mockSecondAddonShortcut.addon, mockSecondAddonShortcut.shortcut);
expect(api.getAddonsShortcutLabels()).toStrictEqual({
[`${mockAddonShortcut.addon}-${mockAddonShortcut.shortcut.actionName}`]: mockAddonShortcut
.shortcut.label,
[`${mockAddonSecondShortcut.addon}-${mockAddonSecondShortcut.shortcut.actionName}`]: mockAddonSecondShortcut
.shortcut.label,
[`${mockSecondAddonShortcut.addon}-${mockSecondAddonShortcut.shortcut.actionName}`]: mockSecondAddonShortcut
.shortcut.label,
});
});
it('gets addons shortcut defaults', async () => {
const store = createMockStore();
const { api, state } = initShortcuts({ store });
store.setState(state);
await api.setAddonShortcut(mockAddonShortcut.addon, mockAddonShortcut.shortcut);
await api.setAddonShortcut(mockAddonSecondShortcut.addon, mockAddonSecondShortcut.shortcut);
await api.setAddonShortcut(mockSecondAddonShortcut.addon, mockSecondAddonShortcut.shortcut);
expect(api.getAddonsShortcutDefaults()).toStrictEqual({
[`${mockAddonShortcut.addon}-${mockAddonShortcut.shortcut.actionName}`]: mockAddonShortcut
.shortcut.defaultShortcut,
[`${mockAddonSecondShortcut.addon}-${mockAddonSecondShortcut.shortcut.actionName}`]: mockAddonSecondShortcut
.shortcut.defaultShortcut,
[`${mockSecondAddonShortcut.addon}-${mockSecondAddonShortcut.shortcut.actionName}`]: mockSecondAddonShortcut
.shortcut.defaultShortcut,
});
});
it('sets defaults', () => {
const store = createMockStore();
@ -20,6 +147,31 @@ describe('shortcuts api', () => {
expect(api.getShortcutKeys().fullScreen).toEqual(['F']);
});
it('sets addon shortcut with default value', async () => {
const store = createMockStore();
const { api, state } = initShortcuts({ store });
store.setState(state);
await api.setAddonShortcut(mockAddonShortcut.addon, mockAddonShortcut.shortcut);
await api.setAddonShortcut(mockAddonSecondShortcut.addon, mockAddonSecondShortcut.shortcut);
await api.setAddonShortcut(mockSecondAddonShortcut.addon, mockSecondAddonShortcut.shortcut);
expect(api.getDefaultShortcuts()).toHaveProperty('fullScreen', ['F']);
expect(api.getDefaultShortcuts()).toHaveProperty(
`${mockAddonShortcut.addon}-${mockAddonShortcut.shortcut.actionName}`,
mockAddonShortcut.shortcut.defaultShortcut
);
expect(api.getDefaultShortcuts()).toHaveProperty(
`${mockAddonSecondShortcut.addon}-${mockAddonSecondShortcut.shortcut.actionName}`,
mockAddonSecondShortcut.shortcut.defaultShortcut
);
expect(api.getDefaultShortcuts()).toHaveProperty(
`${mockSecondAddonShortcut.addon}-${mockSecondAddonShortcut.shortcut.actionName}`,
mockSecondAddonShortcut.shortcut.defaultShortcut
);
});
it('sets defaults, augmenting anything that was persisted', () => {
const store = createMockStore();
store.setState({ shortcuts: { fullScreen: ['Z'] } });
@ -51,17 +203,38 @@ describe('shortcuts api', () => {
expect(api.getShortcutKeys().fullScreen).toEqual(['X']);
});
it('sets new values for addon shortcuts', async () => {
const store = createMockStore();
const { api, state } = initShortcuts({ store });
store.setState(state);
const { addon, shortcut } = mockAddonShortcut;
await api.setAddonShortcut(addon, shortcut);
await api.setShortcut(`${addon}-${shortcut.actionName}`, ['I']);
expect(api.getShortcutKeys()[`${addon}-${shortcut.actionName}`]).toEqual(['I']);
});
it('restores all defaults', async () => {
const store = createMockStore();
const { api, state } = initShortcuts({ store });
store.setState(state);
const { addon, shortcut } = mockAddonShortcut;
await api.setAddonShortcut(addon, shortcut);
await api.setShortcut('fullScreen', ['X']);
await api.setShortcut('togglePanel', ['B']);
await api.setShortcut(`${addon}-${shortcut.actionName}`, ['I']);
await api.restoreAllDefaultShortcuts();
expect(api.getShortcutKeys().fullScreen).toEqual(['F']);
expect(api.getShortcutKeys().togglePanel).toEqual(['A']);
expect(api.getShortcutKeys()[`${addon}-${shortcut.actionName}`]).toEqual(
shortcut.defaultShortcut
);
});
it('restores single default', async () => {
@ -70,10 +243,42 @@ describe('shortcuts api', () => {
const { api, state } = initShortcuts({ store });
store.setState(state);
await api.setAddonShortcut(mockAddonShortcut.addon, mockAddonShortcut.shortcut);
await api.setAddonShortcut(mockAddonSecondShortcut.addon, mockAddonSecondShortcut.shortcut);
await api.setAddonShortcut(mockSecondAddonShortcut.addon, mockSecondAddonShortcut.shortcut);
await api.setShortcut('fullScreen', ['X']);
await api.setShortcut('togglePanel', ['B']);
await api.setShortcut(`${mockAddonShortcut.addon}-${mockAddonShortcut.shortcut.actionName}`, [
'I',
]);
await api.setShortcut(
`${mockAddonSecondShortcut.addon}-${mockAddonSecondShortcut.shortcut.actionName}`,
['H']
);
await api.setShortcut(
`${mockSecondAddonShortcut.addon}-${mockSecondAddonShortcut.shortcut.actionName}`,
['G']
);
await api.restoreDefaultShortcut('fullScreen');
await api.restoreDefaultShortcut(
`${mockAddonShortcut.addon}-${mockAddonShortcut.shortcut.actionName}`
);
expect(api.getShortcutKeys().fullScreen).toEqual(['F']);
expect(api.getShortcutKeys().togglePanel).toEqual(['B']);
expect(
api.getShortcutKeys()[`${mockAddonShortcut.addon}-${mockAddonShortcut.shortcut.actionName}`]
).toEqual(mockAddonShortcut.shortcut.defaultShortcut);
expect(
api.getShortcutKeys()[
`${mockAddonSecondShortcut.addon}-${mockAddonSecondShortcut.shortcut.actionName}`
]
).toEqual(['H']);
expect(
api.getShortcutKeys()[
`${mockSecondAddonShortcut.addon}-${mockSecondAddonShortcut.shortcut.actionName}`
]
).toEqual(['G']);
});
});

View File

@ -1 +1 @@
export const version = '6.3.0-alpha.14';
export const version = '6.3.0-alpha.15';

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/builder-webpack4",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Storybook framework-agnostic API",
"keywords": [
"storybook"
@ -61,20 +61,20 @@
"@babel/preset-env": "^7.12.11",
"@babel/preset-react": "^7.12.10",
"@babel/preset-typescript": "^7.12.7",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/api": "6.3.0-alpha.14",
"@storybook/channel-postmessage": "6.3.0-alpha.14",
"@storybook/channels": "6.3.0-alpha.14",
"@storybook/client-api": "6.3.0-alpha.14",
"@storybook/client-logger": "6.3.0-alpha.14",
"@storybook/components": "6.3.0-alpha.14",
"@storybook/core-common": "6.3.0-alpha.14",
"@storybook/core-events": "6.3.0-alpha.14",
"@storybook/node-logger": "6.3.0-alpha.14",
"@storybook/router": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/api": "6.3.0-alpha.15",
"@storybook/channel-postmessage": "6.3.0-alpha.15",
"@storybook/channels": "6.3.0-alpha.15",
"@storybook/client-api": "6.3.0-alpha.15",
"@storybook/client-logger": "6.3.0-alpha.15",
"@storybook/components": "6.3.0-alpha.15",
"@storybook/core-common": "6.3.0-alpha.15",
"@storybook/core-events": "6.3.0-alpha.15",
"@storybook/node-logger": "6.3.0-alpha.15",
"@storybook/router": "6.3.0-alpha.15",
"@storybook/semver": "^7.3.2",
"@storybook/theming": "6.3.0-alpha.14",
"@storybook/ui": "6.3.0-alpha.14",
"@storybook/theming": "6.3.0-alpha.15",
"@storybook/ui": "6.3.0-alpha.15",
"@types/node": "^14.0.10",
"@types/webpack": "^4.41.26",
"autoprefixer": "^9.8.6",
@ -132,5 +132,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/builder-webpack5",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Storybook framework-agnostic API",
"keywords": [
"storybook"
@ -60,19 +60,19 @@
"@babel/preset-env": "^7.12.11",
"@babel/preset-react": "^7.12.10",
"@babel/preset-typescript": "^7.12.7",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/api": "6.3.0-alpha.14",
"@storybook/channel-postmessage": "6.3.0-alpha.14",
"@storybook/channels": "6.3.0-alpha.14",
"@storybook/client-api": "6.3.0-alpha.14",
"@storybook/client-logger": "6.3.0-alpha.14",
"@storybook/components": "6.3.0-alpha.14",
"@storybook/core-common": "6.3.0-alpha.14",
"@storybook/core-events": "6.3.0-alpha.14",
"@storybook/node-logger": "6.3.0-alpha.14",
"@storybook/router": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/api": "6.3.0-alpha.15",
"@storybook/channel-postmessage": "6.3.0-alpha.15",
"@storybook/channels": "6.3.0-alpha.15",
"@storybook/client-api": "6.3.0-alpha.15",
"@storybook/client-logger": "6.3.0-alpha.15",
"@storybook/components": "6.3.0-alpha.15",
"@storybook/core-common": "6.3.0-alpha.15",
"@storybook/core-events": "6.3.0-alpha.15",
"@storybook/node-logger": "6.3.0-alpha.15",
"@storybook/router": "6.3.0-alpha.15",
"@storybook/semver": "^7.3.2",
"@storybook/theming": "6.3.0-alpha.14",
"@storybook/theming": "6.3.0-alpha.15",
"@types/node": "^14.0.10",
"babel-loader": "^8.2.2",
"babel-plugin-macros": "^3.0.1",
@ -122,5 +122,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/channel-postmessage",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "",
"keywords": [
"storybook"
@ -40,9 +40,9 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/channels": "6.3.0-alpha.14",
"@storybook/client-logger": "6.3.0-alpha.14",
"@storybook/core-events": "6.3.0-alpha.14",
"@storybook/channels": "6.3.0-alpha.15",
"@storybook/client-logger": "6.3.0-alpha.15",
"@storybook/core-events": "6.3.0-alpha.15",
"core-js": "^3.8.2",
"global": "^4.4.0",
"qs": "^6.10.0",
@ -51,5 +51,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/channel-websocket",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "",
"keywords": [
"storybook"
@ -40,7 +40,7 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/channels": "6.3.0-alpha.14",
"@storybook/channels": "6.3.0-alpha.15",
"core-js": "^3.8.2",
"global": "^4.4.0",
"telejson": "^5.1.0"
@ -48,5 +48,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/channels",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "",
"keywords": [
"storybook"
@ -47,5 +47,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,6 +1,6 @@
{
"name": "sb",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Storybook CLI",
"keywords": [
"storybook"
@ -24,10 +24,10 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/cli": "6.3.0-alpha.14"
"@storybook/cli": "6.3.0-alpha.15"
},
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,6 +1,6 @@
{
"name": "storybook",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Storybook CLI",
"keywords": [
"storybook"
@ -27,10 +27,10 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/cli": "6.3.0-alpha.14"
"@storybook/cli": "6.3.0-alpha.15"
},
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/cli",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Storybook's CLI - easiest method of adding storybook to your projects",
"keywords": [
"cli",
@ -48,8 +48,8 @@
"dependencies": {
"@babel/core": "^7.12.10",
"@babel/preset-env": "^7.12.11",
"@storybook/codemod": "6.3.0-alpha.14",
"@storybook/node-logger": "6.3.0-alpha.14",
"@storybook/codemod": "6.3.0-alpha.15",
"@storybook/node-logger": "6.3.0-alpha.15",
"@storybook/semver": "^7.3.2",
"chalk": "^4.1.0",
"commander": "^6.2.1",
@ -72,7 +72,7 @@
"update-notifier": "^5.0.1"
},
"devDependencies": {
"@storybook/client-api": "6.3.0-alpha.14",
"@storybook/client-api": "6.3.0-alpha.15",
"@types/cross-spawn": "^6.0.2",
"@types/prompts": "^2.0.9",
"@types/puppeteer-core": "^2.1.0",
@ -88,5 +88,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,61 +1,61 @@
{
"@storybook/addon-a11y": "6.3.0-alpha.14",
"@storybook/addon-actions": "6.3.0-alpha.14",
"@storybook/addon-backgrounds": "6.3.0-alpha.14",
"@storybook/addon-controls": "6.3.0-alpha.14",
"@storybook/addon-cssresources": "6.3.0-alpha.14",
"@storybook/addon-design-assets": "6.3.0-alpha.14",
"@storybook/addon-docs": "6.3.0-alpha.14",
"@storybook/addon-essentials": "6.3.0-alpha.14",
"@storybook/addon-events": "6.3.0-alpha.14",
"@storybook/addon-google-analytics": "6.3.0-alpha.14",
"@storybook/addon-graphql": "6.3.0-alpha.14",
"@storybook/addon-jest": "6.3.0-alpha.14",
"@storybook/addon-knobs": "6.3.0-alpha.14",
"@storybook/addon-links": "6.3.0-alpha.14",
"@storybook/addon-queryparams": "6.3.0-alpha.14",
"@storybook/addon-storyshots": "6.3.0-alpha.14",
"@storybook/addon-storyshots-puppeteer": "6.3.0-alpha.14",
"@storybook/addon-storysource": "6.3.0-alpha.14",
"@storybook/addon-toolbars": "6.3.0-alpha.14",
"@storybook/addon-viewport": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/angular": "6.3.0-alpha.14",
"@storybook/api": "6.3.0-alpha.14",
"@storybook/aurelia": "6.3.0-alpha.14",
"@storybook/builder-webpack4": "6.3.0-alpha.14",
"@storybook/builder-webpack5": "6.3.0-alpha.14",
"@storybook/channel-postmessage": "6.3.0-alpha.14",
"@storybook/channel-websocket": "6.3.0-alpha.14",
"@storybook/channels": "6.3.0-alpha.14",
"@storybook/cli": "6.3.0-alpha.14",
"@storybook/client-api": "6.3.0-alpha.14",
"@storybook/client-logger": "6.3.0-alpha.14",
"@storybook/codemod": "6.3.0-alpha.14",
"@storybook/components": "6.3.0-alpha.14",
"@storybook/core": "6.3.0-alpha.14",
"@storybook/core-client": "6.3.0-alpha.14",
"@storybook/core-common": "6.3.0-alpha.14",
"@storybook/core-events": "6.3.0-alpha.14",
"@storybook/core-server": "6.3.0-alpha.14",
"@storybook/ember": "6.3.0-alpha.14",
"@storybook/html": "6.3.0-alpha.14",
"@storybook/marionette": "6.3.0-alpha.14",
"@storybook/marko": "6.3.0-alpha.14",
"@storybook/mithril": "6.3.0-alpha.14",
"@storybook/node-logger": "6.3.0-alpha.14",
"@storybook/postinstall": "6.3.0-alpha.14",
"@storybook/preact": "6.3.0-alpha.14",
"@storybook/rax": "6.3.0-alpha.14",
"@storybook/react": "6.3.0-alpha.14",
"@storybook/riot": "6.3.0-alpha.14",
"@storybook/router": "6.3.0-alpha.14",
"@storybook/server": "6.3.0-alpha.14",
"@storybook/source-loader": "6.3.0-alpha.14",
"@storybook/svelte": "6.3.0-alpha.14",
"@storybook/theming": "6.3.0-alpha.14",
"@storybook/ui": "6.3.0-alpha.14",
"@storybook/vue": "6.3.0-alpha.14",
"@storybook/vue3": "6.3.0-alpha.14",
"@storybook/web-components": "6.3.0-alpha.14"
"@storybook/addon-a11y": "6.3.0-alpha.15",
"@storybook/addon-actions": "6.3.0-alpha.15",
"@storybook/addon-backgrounds": "6.3.0-alpha.15",
"@storybook/addon-controls": "6.3.0-alpha.15",
"@storybook/addon-cssresources": "6.3.0-alpha.15",
"@storybook/addon-design-assets": "6.3.0-alpha.15",
"@storybook/addon-docs": "6.3.0-alpha.15",
"@storybook/addon-essentials": "6.3.0-alpha.15",
"@storybook/addon-events": "6.3.0-alpha.15",
"@storybook/addon-google-analytics": "6.3.0-alpha.15",
"@storybook/addon-graphql": "6.3.0-alpha.15",
"@storybook/addon-jest": "6.3.0-alpha.15",
"@storybook/addon-knobs": "6.3.0-alpha.15",
"@storybook/addon-links": "6.3.0-alpha.15",
"@storybook/addon-queryparams": "6.3.0-alpha.15",
"@storybook/addon-storyshots": "6.3.0-alpha.15",
"@storybook/addon-storyshots-puppeteer": "6.3.0-alpha.15",
"@storybook/addon-storysource": "6.3.0-alpha.15",
"@storybook/addon-toolbars": "6.3.0-alpha.15",
"@storybook/addon-viewport": "6.3.0-alpha.15",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/angular": "6.3.0-alpha.15",
"@storybook/api": "6.3.0-alpha.15",
"@storybook/aurelia": "6.3.0-alpha.15",
"@storybook/builder-webpack4": "6.3.0-alpha.15",
"@storybook/builder-webpack5": "6.3.0-alpha.15",
"@storybook/channel-postmessage": "6.3.0-alpha.15",
"@storybook/channel-websocket": "6.3.0-alpha.15",
"@storybook/channels": "6.3.0-alpha.15",
"@storybook/cli": "6.3.0-alpha.15",
"@storybook/client-api": "6.3.0-alpha.15",
"@storybook/client-logger": "6.3.0-alpha.15",
"@storybook/codemod": "6.3.0-alpha.15",
"@storybook/components": "6.3.0-alpha.15",
"@storybook/core": "6.3.0-alpha.15",
"@storybook/core-client": "6.3.0-alpha.15",
"@storybook/core-common": "6.3.0-alpha.15",
"@storybook/core-events": "6.3.0-alpha.15",
"@storybook/core-server": "6.3.0-alpha.15",
"@storybook/ember": "6.3.0-alpha.15",
"@storybook/html": "6.3.0-alpha.15",
"@storybook/marionette": "6.3.0-alpha.15",
"@storybook/marko": "6.3.0-alpha.15",
"@storybook/mithril": "6.3.0-alpha.15",
"@storybook/node-logger": "6.3.0-alpha.15",
"@storybook/postinstall": "6.3.0-alpha.15",
"@storybook/preact": "6.3.0-alpha.15",
"@storybook/rax": "6.3.0-alpha.15",
"@storybook/react": "6.3.0-alpha.15",
"@storybook/riot": "6.3.0-alpha.15",
"@storybook/router": "6.3.0-alpha.15",
"@storybook/server": "6.3.0-alpha.15",
"@storybook/source-loader": "6.3.0-alpha.15",
"@storybook/svelte": "6.3.0-alpha.15",
"@storybook/theming": "6.3.0-alpha.15",
"@storybook/ui": "6.3.0-alpha.15",
"@storybook/vue": "6.3.0-alpha.15",
"@storybook/vue3": "6.3.0-alpha.15",
"@storybook/web-components": "6.3.0-alpha.15"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/client-api",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Storybook Client API",
"keywords": [
"storybook"
@ -40,11 +40,11 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.3.0-alpha.14",
"@storybook/channel-postmessage": "6.3.0-alpha.14",
"@storybook/channels": "6.3.0-alpha.14",
"@storybook/client-logger": "6.3.0-alpha.14",
"@storybook/core-events": "6.3.0-alpha.14",
"@storybook/addons": "6.3.0-alpha.15",
"@storybook/channel-postmessage": "6.3.0-alpha.15",
"@storybook/channels": "6.3.0-alpha.15",
"@storybook/client-logger": "6.3.0-alpha.15",
"@storybook/core-events": "6.3.0-alpha.15",
"@storybook/csf": "0.0.1",
"@types/qs": "^6.9.5",
"@types/webpack-env": "^1.16.0",
@ -66,5 +66,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -2,7 +2,7 @@ import { StoryContext } from '@storybook/addons';
import { defaultDecorateStory } from './decorators';
function makeContext(input: Record<string, any>): StoryContext {
function makeContext(input: Record<string, any> = {}): StoryContext {
return {
id: 'id',
kind: 'kind',
@ -24,7 +24,7 @@ describe('client-api.decorators', () => {
const decorated = defaultDecorateStory(() => order.push(4), decorators);
expect(order).toEqual([]);
decorated();
decorated(makeContext());
expect(order).toEqual([3, 2, 1, 4]);
});
@ -42,6 +42,50 @@ describe('client-api.decorators', () => {
expect(contexts.map((c) => c.k)).toEqual([0, 3, 2, 1]);
});
it('does not recreate decorated story functions each time', () => {
const decoratedStories = [];
const decorators = [
(s, c) => {
decoratedStories.push = s;
return s();
},
];
const decorated = defaultDecorateStory(() => 0, decorators);
decorated(makeContext());
decorated(makeContext());
expect(decoratedStories[0]).toBe(decoratedStories[1]);
});
// NOTE: important point--this test would not work if we called `decoratedOne` twice simultaneously
// both story functions would receive {story: 2}. The assumption here is that we'll never render
// the same story twice at the same time.
it('does not interleave contexts if two decorated stories are call simultaneously', async () => {
const contexts = [];
let resolve;
const fence = new Promise((r) => {
resolve = r;
});
const decorators = [
async (s, c) => {
// The fence here simulates async-ness in react rendering an element (`<S />` doesn't run `S()` straight away)
await fence;
s();
},
];
const decoratedOne = defaultDecorateStory((c) => contexts.push(c), decorators);
const decoratedTwo = defaultDecorateStory((c) => contexts.push(c), decorators);
decoratedOne(makeContext({ value: 1 }));
decoratedTwo(makeContext({ value: 2 }));
resolve();
await fence;
expect(contexts[0].value).toBe(1);
expect(contexts[1].value).toBe(2);
});
it('merges contexts', () => {
const contexts = [];
const decorators = [(s, c) => contexts.push(c) && s({ c: 'd' })];

View File

@ -1,10 +1,6 @@
import { StoryContext, StoryFn } from '@storybook/addons';
import { StoryContext, StoryContextUpdate, PartialStoryFn, LegacyStoryFn } from '@storybook/addons';
import { DecoratorFunction } from './types';
interface StoryContextUpdate {
[key: string]: any;
}
const defaultContext: StoryContext = {
id: 'unspecified',
name: 'unspecified',
@ -25,15 +21,44 @@ const defaultContext: StoryContext = {
* This will override the `foo` property on the `innerContext`, which gets
* merged in with the default context
*/
export const decorateStory = (storyFn: StoryFn, decorator: DecoratorFunction) => {
return (context: StoryContext = defaultContext) =>
decorator(
// You cannot override the parameters key, it is fixed
({ parameters, ...innerContext }: StoryContextUpdate = {}) =>
storyFn({ ...context, ...innerContext }),
context
);
const bindWithContext = (
storyFn: LegacyStoryFn,
getStoryContext: () => StoryContext
): PartialStoryFn =>
// (NOTE: You cannot override the parameters key, it is fixed)
({ parameters, ...contextUpdate }: StoryContextUpdate = {}) =>
storyFn({ ...getStoryContext(), ...contextUpdate });
export const decorateStory = (
storyFn: LegacyStoryFn,
decorator: DecoratorFunction,
getStoryContext: () => StoryContext
): LegacyStoryFn => {
// Bind the partially decorated storyFn so that when it is called it always knows about the story context,
// no matter what it is passed directly. This is because we cannot guarantee a decorator will
// pass the context down to the next decorated story in the chain.
const boundStoryFunction = bindWithContext(storyFn, getStoryContext);
return (context: StoryContext) => decorator(boundStoryFunction, context);
};
export const defaultDecorateStory = (storyFn: StoryFn, decorators: DecoratorFunction[]) =>
decorators.reduce(decorateStory, storyFn);
export const defaultDecorateStory = (
storyFn: LegacyStoryFn,
decorators: DecoratorFunction[]
): LegacyStoryFn => {
// We use a trick to avoid recreating the bound story function inside `decorateStory`.
// Instead we pass it a context "getter", which is defined once (at "decoration time")
// The getter reads a variable which is scoped to this call of `decorateStory`
// (ie to this story), so there is no possibility of overlap.
// This will break if you call the same story twice interleaved
// (React might do it if you rendered the same story twice in the one ReactDom.render call, for instance)
let contextStore: StoryContext;
const decoratedWithContextStore = decorators.reduce(
(story, decorator) => decorateStory(story, decorator, () => contextStore),
storyFn
);
return (context = defaultContext) => {
contextStore = context;
return decoratedWithContextStore(context); // Pass the context directly into the first decorator
};
};

View File

@ -394,7 +394,9 @@ export default class StoryStore {
return acc;
}, {} as Args),
};
return passArgsFirst ? (original as ArgsStoryFn)(mapped.args, mapped) : original(mapped);
return passArgsFirst
? (original as ArgsStoryFn)(mapped.args, mapped)
: (original as LegacyStoryFn)(mapped);
};
// lazily decorate the story when it's loaded

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/client-logger",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "",
"keywords": [
"storybook"
@ -46,5 +46,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/codemod",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "A collection of codemod scripts written with JSCodeshift",
"keywords": [
"storybook"
@ -43,7 +43,7 @@
"dependencies": {
"@mdx-js/mdx": "^1.6.22",
"@storybook/csf": "0.0.1",
"@storybook/node-logger": "6.3.0-alpha.14",
"@storybook/node-logger": "6.3.0-alpha.15",
"core-js": "^3.8.2",
"cross-spawn": "^7.0.3",
"globby": "^11.0.2",
@ -60,5 +60,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/components",
"version": "6.3.0-alpha.14",
"version": "6.3.0-alpha.15",
"description": "Core Storybook Components",
"keywords": [
"storybook"
@ -41,9 +41,9 @@
},
"dependencies": {
"@popperjs/core": "^2.6.0",
"@storybook/client-logger": "6.3.0-alpha.14",
"@storybook/client-logger": "6.3.0-alpha.15",
"@storybook/csf": "0.0.1",
"@storybook/theming": "6.3.0-alpha.14",
"@storybook/theming": "6.3.0-alpha.15",
"@types/color-convert": "^2.0.0",
"@types/overlayscrollbars": "^1.12.0",
"@types/react-syntax-highlighter": "11.0.5",
@ -76,5 +76,5 @@
"publishConfig": {
"access": "public"
},
"gitHead": "eb1e3a913f3c5329539a7a908e7cb955ffaa8100"
"gitHead": "11ea895ed3be540d4a353eed8bc50aa08cf5fcf5"
}

Some files were not shown because too many files have changed in this diff Show More