mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-26 05:02:32 +08:00
Merge branch 'next' into norbert/sb-798-figure-out-plan-for-package-structure-rework
This commit is contained in:
commit
b1a038ec54
21
CHANGELOG.md
21
CHANGELOG.md
@ -1,3 +1,24 @@
|
||||
## 7.0.0-alpha.49 (November 13, 2022)
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
- Essentials: Fix preview annotations for Vite pnpm support [#19689](https://github.com/storybooks/storybook/pull/19689)
|
||||
|
||||
#### Maintenance
|
||||
|
||||
- Build: convert addon-docs to use ts-up [#19790](https://github.com/storybooks/storybook/pull/19790)
|
||||
- Core: Allow overriding WebView and UrlStore [#19623](https://github.com/storybooks/storybook/pull/19623)
|
||||
- Storyshots: Support .cjs and .mjs file extensions [#19726](https://github.com/storybooks/storybook/pull/19726)
|
||||
|
||||
#### Build
|
||||
|
||||
- Build: less noise when compiling [#19808](https://github.com/storybooks/storybook/pull/19808)
|
||||
- Build: Upgrade bench to `next` [#19791](https://github.com/storybooks/storybook/pull/19791)
|
||||
- Maintenance: improve error feedback when tasks fail in CI [#19786](https://github.com/storybooks/storybook/pull/19786)
|
||||
- UI: Enable TurboSnap for UI Storybook [#19767](https://github.com/storybooks/storybook/pull/19767)
|
||||
- CI: Use a new cadence (ci, pr, merged, daily) and trigger CircleCI from github actions [#19768](https://github.com/storybooks/storybook/pull/19768)
|
||||
- Maintenance: provide expected failure metadata in junit reports [#19775](https://github.com/storybooks/storybook/pull/19775)
|
||||
|
||||
## 7.0.0-alpha.48 (November 7, 2022)
|
||||
|
||||
#### Breaking Changes
|
||||
|
23
MIGRATION.md
23
MIGRATION.md
@ -44,6 +44,7 @@
|
||||
- [`Story` type deprecated](#story-type-deprecated)
|
||||
- [`ComponentStory`, `ComponentStoryObj`, `ComponentStoryFn` and `ComponentMeta` types are deprecated](#componentstory-componentstoryobj-componentstoryfn-and-componentmeta-types-are-deprecated)
|
||||
- [Renamed `renderToDOM` to `renderToCanvas`](#renamed-rendertodom-to-rendertoroot)
|
||||
- [Renamed `XFramework` to `XRenderer`](#renamed-xframework-to-xrenderer)
|
||||
- [From version 6.4.x to 6.5.0](#from-version-64x-to-650)
|
||||
- [Vue 3 upgrade](#vue-3-upgrade)
|
||||
- [React18 new root API](#react18-new-root-api)
|
||||
@ -841,6 +842,28 @@ CSF2Story.args = { label: 'Label' };
|
||||
|
||||
The "rendering" function that renderers (ex-frameworks) must export (`renderToDOM`) has been renamed to `renderToCanvas` to acknowledge that some consumers of frameworks/the preview do not work with DOM elements.
|
||||
|
||||
#### Renamed `XFramework` to `XRenderer`
|
||||
|
||||
In 6.x you could import XFramework types:
|
||||
|
||||
```ts
|
||||
import type { ReactFramework } from '@storybook/react';
|
||||
import type { VueFramework } from '@storybook/vue';
|
||||
import type { SvelteFramework } from '@storybook/svelte';
|
||||
|
||||
// etc.
|
||||
```
|
||||
|
||||
Those are deprecated in 7.0 as they are renamed to:
|
||||
|
||||
```ts
|
||||
import type { ReactRenderer } from '@storybook/react';
|
||||
import type { VueRenderer } from '@storybook/vue';
|
||||
import type { SvelteRenderer } from '@storybook/svelte';
|
||||
|
||||
// etc.
|
||||
```
|
||||
|
||||
## From version 6.4.x to 6.5.0
|
||||
|
||||
### Vue 3 upgrade
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-a11y",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Test component compliance with web accessibility standards",
|
||||
"keywords": [
|
||||
"a11y",
|
||||
@ -62,15 +62,15 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/addon-highlight": "7.0.0-alpha.48",
|
||||
"@storybook/addons": "7.0.0-alpha.48",
|
||||
"@storybook/api": "7.0.0-alpha.48",
|
||||
"@storybook/channels": "7.0.0-alpha.48",
|
||||
"@storybook/client-logger": "7.0.0-alpha.48",
|
||||
"@storybook/components": "7.0.0-alpha.48",
|
||||
"@storybook/core-events": "7.0.0-alpha.48",
|
||||
"@storybook/theming": "7.0.0-alpha.48",
|
||||
"@storybook/types": "7.0.0-alpha.48",
|
||||
"@storybook/addon-highlight": "7.0.0-alpha.49",
|
||||
"@storybook/addons": "7.0.0-alpha.49",
|
||||
"@storybook/api": "7.0.0-alpha.49",
|
||||
"@storybook/channels": "7.0.0-alpha.49",
|
||||
"@storybook/client-logger": "7.0.0-alpha.49",
|
||||
"@storybook/components": "7.0.0-alpha.49",
|
||||
"@storybook/core-events": "7.0.0-alpha.49",
|
||||
"@storybook/theming": "7.0.0-alpha.49",
|
||||
"@storybook/types": "7.0.0-alpha.49",
|
||||
"axe-core": "^4.2.0",
|
||||
"global": "^4.4.0",
|
||||
"lodash": "^4.17.21",
|
||||
@ -102,7 +102,7 @@
|
||||
"./src/preview.tsx"
|
||||
]
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd",
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8",
|
||||
"storybook": {
|
||||
"displayName": "Accessibility",
|
||||
"icon": "https://user-images.githubusercontent.com/263385/101991665-47042f80-3c7c-11eb-8f00-64b5a18f498a.png",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-actions",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Get UI feedback when an action is performed on an interactive element",
|
||||
"keywords": [
|
||||
"storybook",
|
||||
@ -76,13 +76,13 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/addons": "7.0.0-alpha.48",
|
||||
"@storybook/api": "7.0.0-alpha.48",
|
||||
"@storybook/client-logger": "7.0.0-alpha.48",
|
||||
"@storybook/components": "7.0.0-alpha.48",
|
||||
"@storybook/core-events": "7.0.0-alpha.48",
|
||||
"@storybook/theming": "7.0.0-alpha.48",
|
||||
"@storybook/types": "7.0.0-alpha.48",
|
||||
"@storybook/addons": "7.0.0-alpha.49",
|
||||
"@storybook/api": "7.0.0-alpha.49",
|
||||
"@storybook/client-logger": "7.0.0-alpha.49",
|
||||
"@storybook/components": "7.0.0-alpha.49",
|
||||
"@storybook/core-events": "7.0.0-alpha.49",
|
||||
"@storybook/theming": "7.0.0-alpha.49",
|
||||
"@storybook/types": "7.0.0-alpha.49",
|
||||
"dequal": "^2.0.2",
|
||||
"global": "^4.4.0",
|
||||
"lodash": "^4.17.21",
|
||||
@ -120,7 +120,7 @@
|
||||
"./src/preview.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd",
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8",
|
||||
"storybook": {
|
||||
"displayName": "Actions",
|
||||
"unsupportedFrameworks": [
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { Args, Framework, ArgsEnhancer } from '@storybook/types';
|
||||
import type { Args, Renderer, ArgsEnhancer } from '@storybook/types';
|
||||
import { action } from './runtime/action';
|
||||
|
||||
// interface ActionsParameter {
|
||||
@ -14,7 +14,7 @@ const isInInitialArgs = (name: string, initialArgs: Args) =>
|
||||
* matches a regex, such as `^on.*` for react-style `onClick` etc.
|
||||
*/
|
||||
|
||||
export const inferActionsFromArgTypesRegex: ArgsEnhancer<Framework> = (context) => {
|
||||
export const inferActionsFromArgTypesRegex: ArgsEnhancer<Renderer> = (context) => {
|
||||
const {
|
||||
initialArgs,
|
||||
argTypes,
|
||||
@ -40,7 +40,7 @@ export const inferActionsFromArgTypesRegex: ArgsEnhancer<Framework> = (context)
|
||||
/**
|
||||
* Add action args for list of strings.
|
||||
*/
|
||||
export const addActionsFromArgTypes: ArgsEnhancer<Framework> = (context) => {
|
||||
export const addActionsFromArgTypes: ArgsEnhancer<Renderer> = (context) => {
|
||||
const {
|
||||
initialArgs,
|
||||
argTypes,
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-backgrounds",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Switch backgrounds to view components in different settings",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -75,13 +75,13 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/addons": "7.0.0-alpha.48",
|
||||
"@storybook/api": "7.0.0-alpha.48",
|
||||
"@storybook/client-logger": "7.0.0-alpha.48",
|
||||
"@storybook/components": "7.0.0-alpha.48",
|
||||
"@storybook/core-events": "7.0.0-alpha.48",
|
||||
"@storybook/theming": "7.0.0-alpha.48",
|
||||
"@storybook/types": "7.0.0-alpha.48",
|
||||
"@storybook/addons": "7.0.0-alpha.49",
|
||||
"@storybook/api": "7.0.0-alpha.49",
|
||||
"@storybook/client-logger": "7.0.0-alpha.49",
|
||||
"@storybook/components": "7.0.0-alpha.49",
|
||||
"@storybook/core-events": "7.0.0-alpha.49",
|
||||
"@storybook/theming": "7.0.0-alpha.49",
|
||||
"@storybook/types": "7.0.0-alpha.49",
|
||||
"global": "^4.4.0",
|
||||
"memoizerific": "^1.11.3",
|
||||
"ts-dedent": "^2.0.0"
|
||||
@ -111,7 +111,7 @@
|
||||
"./src/preview.tsx"
|
||||
]
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd",
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8",
|
||||
"storybook": {
|
||||
"displayName": "Backgrounds",
|
||||
"icon": "https://user-images.githubusercontent.com/263385/101991667-479cc600-3c7c-11eb-96d3-410e936252e7.png",
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { useMemo, useEffect } from '@storybook/addons';
|
||||
import type { Framework, PartialStoryFn as StoryFunction, StoryContext } from '@storybook/types';
|
||||
import type { Renderer, PartialStoryFn as StoryFunction, StoryContext } from '@storybook/types';
|
||||
|
||||
import { PARAM_KEY as BACKGROUNDS_PARAM_KEY } from '../constants';
|
||||
import {
|
||||
@ -10,8 +10,8 @@ import {
|
||||
} from '../helpers';
|
||||
|
||||
export const withBackground = (
|
||||
StoryFn: StoryFunction<Framework>,
|
||||
context: StoryContext<Framework>
|
||||
StoryFn: StoryFunction<Renderer>,
|
||||
context: StoryContext<Renderer>
|
||||
) => {
|
||||
const { globals, parameters } = context;
|
||||
const globalsBackgroundColor = globals[BACKGROUNDS_PARAM_KEY]?.value;
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { useMemo, useEffect } from '@storybook/addons';
|
||||
import type { Framework, PartialStoryFn as StoryFunction, StoryContext } from '@storybook/types';
|
||||
import type { Renderer, PartialStoryFn as StoryFunction, StoryContext } from '@storybook/types';
|
||||
|
||||
import { clearStyles, addGridStyle } from '../helpers';
|
||||
import { PARAM_KEY as BACKGROUNDS_PARAM_KEY } from '../constants';
|
||||
|
||||
export const withGrid = (StoryFn: StoryFunction<Framework>, context: StoryContext<Framework>) => {
|
||||
export const withGrid = (StoryFn: StoryFunction<Renderer>, context: StoryContext<Renderer>) => {
|
||||
const { globals, parameters } = context;
|
||||
const gridParameters = parameters[BACKGROUNDS_PARAM_KEY].grid;
|
||||
const isActive = globals[BACKGROUNDS_PARAM_KEY]?.grid === true && gridParameters.disable !== true;
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-controls",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Interact with component inputs dynamically in the Storybook UI",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -67,16 +67,16 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/addons": "7.0.0-alpha.48",
|
||||
"@storybook/api": "7.0.0-alpha.48",
|
||||
"@storybook/blocks": "7.0.0-alpha.48",
|
||||
"@storybook/client-logger": "7.0.0-alpha.48",
|
||||
"@storybook/components": "7.0.0-alpha.48",
|
||||
"@storybook/core-common": "7.0.0-alpha.48",
|
||||
"@storybook/node-logger": "7.0.0-alpha.48",
|
||||
"@storybook/store": "7.0.0-alpha.48",
|
||||
"@storybook/theming": "7.0.0-alpha.48",
|
||||
"@storybook/types": "7.0.0-alpha.48",
|
||||
"@storybook/addons": "7.0.0-alpha.49",
|
||||
"@storybook/api": "7.0.0-alpha.49",
|
||||
"@storybook/blocks": "7.0.0-alpha.49",
|
||||
"@storybook/client-logger": "7.0.0-alpha.49",
|
||||
"@storybook/components": "7.0.0-alpha.49",
|
||||
"@storybook/core-common": "7.0.0-alpha.49",
|
||||
"@storybook/node-logger": "7.0.0-alpha.49",
|
||||
"@storybook/store": "7.0.0-alpha.49",
|
||||
"@storybook/theming": "7.0.0-alpha.49",
|
||||
"@storybook/types": "7.0.0-alpha.49",
|
||||
"lodash": "^4.17.21",
|
||||
"ts-dedent": "^2.0.0"
|
||||
},
|
||||
@ -102,7 +102,7 @@
|
||||
],
|
||||
"platform": "browser"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd",
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8",
|
||||
"storybook": {
|
||||
"displayName": "Controls",
|
||||
"icon": "https://user-images.githubusercontent.com/263385/101991669-479cc600-3c7c-11eb-93d9-38b67e8371f2.png",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-docs",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Document component usage and properties in Markdown",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -87,15 +87,15 @@
|
||||
"@babel/plugin-transform-react-jsx": "^7.12.12",
|
||||
"@jest/transform": "^26.6.2",
|
||||
"@mdx-js/react": "^2.1.5",
|
||||
"@storybook/blocks": "7.0.0-alpha.48",
|
||||
"@storybook/components": "7.0.0-alpha.48",
|
||||
"@storybook/csf-plugin": "7.0.0-alpha.48",
|
||||
"@storybook/csf-tools": "7.0.0-alpha.48",
|
||||
"@storybook/blocks": "7.0.0-alpha.49",
|
||||
"@storybook/components": "7.0.0-alpha.49",
|
||||
"@storybook/csf-plugin": "7.0.0-alpha.49",
|
||||
"@storybook/csf-tools": "7.0.0-alpha.49",
|
||||
"@storybook/mdx2-csf": "next",
|
||||
"@storybook/node-logger": "7.0.0-alpha.48",
|
||||
"@storybook/postinstall": "7.0.0-alpha.48",
|
||||
"@storybook/preview-web": "7.0.0-alpha.48",
|
||||
"@storybook/types": "7.0.0-alpha.48",
|
||||
"@storybook/node-logger": "7.0.0-alpha.49",
|
||||
"@storybook/postinstall": "7.0.0-alpha.49",
|
||||
"@storybook/preview-web": "7.0.0-alpha.49",
|
||||
"@storybook/types": "7.0.0-alpha.49",
|
||||
"fs-extra": "^9.0.1",
|
||||
"global": "^4.4.0",
|
||||
"remark-external-links": "^8.0.0",
|
||||
@ -128,7 +128,7 @@
|
||||
"./src/preview.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd",
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8",
|
||||
"storybook": {
|
||||
"displayName": "Docs",
|
||||
"icon": "https://user-images.githubusercontent.com/263385/101991672-48355c80-3c7c-11eb-82d9-95fa12438f64.png",
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import type { Framework, Parameters } from '@storybook/types';
|
||||
import type { Renderer, Parameters } from '@storybook/types';
|
||||
import type { DocsContextProps, DocsRenderFunction } from '@storybook/preview-web';
|
||||
import { components as htmlComponents } from '@storybook/components';
|
||||
import { Docs, CodeOrSourceMdx, AnchorMdx, HeadersMdx } from '@storybook/blocks';
|
||||
@ -14,14 +14,14 @@ export const defaultComponents: Record<string, any> = {
|
||||
...HeadersMdx,
|
||||
};
|
||||
|
||||
export class DocsRenderer<TFramework extends Framework> {
|
||||
public render: DocsRenderFunction<TFramework>;
|
||||
export class DocsRenderer<TRenderer extends Renderer> {
|
||||
public render: DocsRenderFunction<TRenderer>;
|
||||
|
||||
public unmount: (element: HTMLElement) => void;
|
||||
|
||||
constructor() {
|
||||
this.render = (
|
||||
context: DocsContextProps<TFramework>,
|
||||
context: DocsContextProps<TRenderer>,
|
||||
docsParameter: Parameters,
|
||||
element: HTMLElement,
|
||||
callback: () => void
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-essentials",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Curated addons to bring out the best of Storybook",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -111,24 +111,24 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/addon-actions": "7.0.0-alpha.48",
|
||||
"@storybook/addon-backgrounds": "7.0.0-alpha.48",
|
||||
"@storybook/addon-controls": "7.0.0-alpha.48",
|
||||
"@storybook/addon-docs": "7.0.0-alpha.48",
|
||||
"@storybook/addon-highlight": "7.0.0-alpha.48",
|
||||
"@storybook/addon-measure": "7.0.0-alpha.48",
|
||||
"@storybook/addon-outline": "7.0.0-alpha.48",
|
||||
"@storybook/addon-toolbars": "7.0.0-alpha.48",
|
||||
"@storybook/addon-viewport": "7.0.0-alpha.48",
|
||||
"@storybook/addons": "7.0.0-alpha.48",
|
||||
"@storybook/api": "7.0.0-alpha.48",
|
||||
"@storybook/core-common": "7.0.0-alpha.48",
|
||||
"@storybook/node-logger": "7.0.0-alpha.48",
|
||||
"@storybook/addon-actions": "7.0.0-alpha.49",
|
||||
"@storybook/addon-backgrounds": "7.0.0-alpha.49",
|
||||
"@storybook/addon-controls": "7.0.0-alpha.49",
|
||||
"@storybook/addon-docs": "7.0.0-alpha.49",
|
||||
"@storybook/addon-highlight": "7.0.0-alpha.49",
|
||||
"@storybook/addon-measure": "7.0.0-alpha.49",
|
||||
"@storybook/addon-outline": "7.0.0-alpha.49",
|
||||
"@storybook/addon-toolbars": "7.0.0-alpha.49",
|
||||
"@storybook/addon-viewport": "7.0.0-alpha.49",
|
||||
"@storybook/addons": "7.0.0-alpha.49",
|
||||
"@storybook/api": "7.0.0-alpha.49",
|
||||
"@storybook/core-common": "7.0.0-alpha.49",
|
||||
"@storybook/node-logger": "7.0.0-alpha.49",
|
||||
"ts-dedent": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.12.10",
|
||||
"@storybook/vue": "7.0.0-alpha.48",
|
||||
"@storybook/vue": "7.0.0-alpha.49",
|
||||
"@types/jest": "^26.0.16",
|
||||
"typescript": "~4.6.3"
|
||||
},
|
||||
@ -158,5 +158,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-highlight",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Highlight DOM nodes within your stories",
|
||||
"keywords": [
|
||||
"storybook-addons",
|
||||
@ -60,8 +60,8 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/addons": "7.0.0-alpha.48",
|
||||
"@storybook/core-events": "7.0.0-alpha.48",
|
||||
"@storybook/addons": "7.0.0-alpha.49",
|
||||
"@storybook/core-events": "7.0.0-alpha.49",
|
||||
"global": "^4.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -77,7 +77,7 @@
|
||||
"./src/preview.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd",
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8",
|
||||
"sbmodern": "dist/modern/index.js",
|
||||
"storybook": {
|
||||
"displayName": "Highlight",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-interactions",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Automate, test and debug user interactions",
|
||||
"keywords": [
|
||||
"storybook-addons",
|
||||
@ -72,15 +72,15 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@devtools-ds/object-inspector": "^1.1.2",
|
||||
"@storybook/addons": "7.0.0-alpha.48",
|
||||
"@storybook/api": "7.0.0-alpha.48",
|
||||
"@storybook/client-logger": "7.0.0-alpha.48",
|
||||
"@storybook/components": "7.0.0-alpha.48",
|
||||
"@storybook/core-common": "7.0.0-alpha.48",
|
||||
"@storybook/core-events": "7.0.0-alpha.48",
|
||||
"@storybook/instrumenter": "7.0.0-alpha.48",
|
||||
"@storybook/theming": "7.0.0-alpha.48",
|
||||
"@storybook/types": "7.0.0-alpha.48",
|
||||
"@storybook/addons": "7.0.0-alpha.49",
|
||||
"@storybook/api": "7.0.0-alpha.49",
|
||||
"@storybook/client-logger": "7.0.0-alpha.49",
|
||||
"@storybook/components": "7.0.0-alpha.49",
|
||||
"@storybook/core-common": "7.0.0-alpha.49",
|
||||
"@storybook/core-events": "7.0.0-alpha.49",
|
||||
"@storybook/instrumenter": "7.0.0-alpha.49",
|
||||
"@storybook/theming": "7.0.0-alpha.49",
|
||||
"@storybook/types": "7.0.0-alpha.49",
|
||||
"global": "^4.4.0",
|
||||
"jest-mock": "^27.0.6",
|
||||
"polished": "^4.2.2",
|
||||
@ -117,7 +117,7 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd",
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8",
|
||||
"storybook": {
|
||||
"displayName": "Interactions",
|
||||
"unsupportedFrameworks": [
|
||||
|
@ -3,7 +3,7 @@
|
||||
import { addons } from '@storybook/addons';
|
||||
import { FORCE_REMOUNT, STORY_RENDER_PHASE_CHANGED } from '@storybook/core-events';
|
||||
import type {
|
||||
Framework,
|
||||
Renderer,
|
||||
ArgsEnhancer,
|
||||
PlayFunction,
|
||||
PlayFunctionContext,
|
||||
@ -52,7 +52,7 @@ const addSpies = (id: string, val: any, key?: string): any => {
|
||||
return val;
|
||||
};
|
||||
|
||||
const addActionsFromArgTypes: ArgsEnhancer<Framework> = ({ id, initialArgs }) =>
|
||||
const addActionsFromArgTypes: ArgsEnhancer<Renderer> = ({ id, initialArgs }) =>
|
||||
addSpies(id, initialArgs);
|
||||
|
||||
export const argsEnhancers = [addActionsFromArgTypes];
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-jest",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "React storybook addon that show component jest report",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -69,12 +69,12 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/addons": "7.0.0-alpha.48",
|
||||
"@storybook/api": "7.0.0-alpha.48",
|
||||
"@storybook/client-logger": "7.0.0-alpha.48",
|
||||
"@storybook/components": "7.0.0-alpha.48",
|
||||
"@storybook/core-events": "7.0.0-alpha.48",
|
||||
"@storybook/theming": "7.0.0-alpha.48",
|
||||
"@storybook/addons": "7.0.0-alpha.49",
|
||||
"@storybook/api": "7.0.0-alpha.49",
|
||||
"@storybook/client-logger": "7.0.0-alpha.49",
|
||||
"@storybook/components": "7.0.0-alpha.49",
|
||||
"@storybook/core-events": "7.0.0-alpha.49",
|
||||
"@storybook/theming": "7.0.0-alpha.49",
|
||||
"global": "^4.4.0",
|
||||
"react-sizeme": "^3.0.1",
|
||||
"upath": "^1.2.0"
|
||||
@ -104,7 +104,7 @@
|
||||
],
|
||||
"platform": "browser"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd",
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8",
|
||||
"storybook": {
|
||||
"displayName": "Jest",
|
||||
"icon": "https://pbs.twimg.com/profile_images/821713465245102080/mMtKIMax_400x400.jpg",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-links",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Link stories together to build demos and prototypes with your UI components",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -76,12 +76,12 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/addons": "7.0.0-alpha.48",
|
||||
"@storybook/client-logger": "7.0.0-alpha.48",
|
||||
"@storybook/core-events": "7.0.0-alpha.48",
|
||||
"@storybook/csf": "next",
|
||||
"@storybook/router": "7.0.0-alpha.48",
|
||||
"@storybook/types": "7.0.0-alpha.48",
|
||||
"@storybook/addons": "7.0.0-alpha.49",
|
||||
"@storybook/client-logger": "7.0.0-alpha.49",
|
||||
"@storybook/core-events": "7.0.0-alpha.49",
|
||||
"@storybook/csf": "0.0.2-next.5",
|
||||
"@storybook/router": "7.0.0-alpha.49",
|
||||
"@storybook/types": "7.0.0-alpha.49",
|
||||
"global": "^4.4.0",
|
||||
"prop-types": "^15.7.2",
|
||||
"ts-dedent": "^2.0.0"
|
||||
@ -112,7 +112,7 @@
|
||||
"./src/react/index.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd",
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8",
|
||||
"storybook": {
|
||||
"displayName": "Links",
|
||||
"icon": "https://user-images.githubusercontent.com/263385/101991673-48355c80-3c7c-11eb-9b6e-b627c96a75f6.png",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-measure",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Inspect layouts by visualizing the box model",
|
||||
"keywords": [
|
||||
"storybook-addons",
|
||||
@ -74,12 +74,12 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/addons": "7.0.0-alpha.48",
|
||||
"@storybook/api": "7.0.0-alpha.48",
|
||||
"@storybook/client-logger": "7.0.0-alpha.48",
|
||||
"@storybook/components": "7.0.0-alpha.48",
|
||||
"@storybook/core-events": "7.0.0-alpha.48",
|
||||
"@storybook/types": "7.0.0-alpha.48",
|
||||
"@storybook/addons": "7.0.0-alpha.49",
|
||||
"@storybook/api": "7.0.0-alpha.49",
|
||||
"@storybook/client-logger": "7.0.0-alpha.49",
|
||||
"@storybook/components": "7.0.0-alpha.49",
|
||||
"@storybook/core-events": "7.0.0-alpha.49",
|
||||
"@storybook/types": "7.0.0-alpha.49",
|
||||
"global": "^4.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -107,7 +107,7 @@
|
||||
"./src/preview.tsx"
|
||||
]
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd",
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8",
|
||||
"storybook": {
|
||||
"displayName": "Measure",
|
||||
"unsupportedFrameworks": [
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* eslint-env browser */
|
||||
import { useEffect } from '@storybook/addons';
|
||||
import type { Framework, PartialStoryFn as StoryFunction, StoryContext } from '@storybook/types';
|
||||
import type { Renderer, PartialStoryFn as StoryFunction, StoryContext } from '@storybook/types';
|
||||
import { drawSelectedElement } from './box-model/visualizer';
|
||||
import { init, rescale, destroy } from './box-model/canvas';
|
||||
import { deepElementFromPoint } from './util';
|
||||
@ -13,10 +13,7 @@ function findAndDrawElement(x: number, y: number) {
|
||||
drawSelectedElement(nodeAtPointerRef);
|
||||
}
|
||||
|
||||
export const withMeasure = (
|
||||
StoryFn: StoryFunction<Framework>,
|
||||
context: StoryContext<Framework>
|
||||
) => {
|
||||
export const withMeasure = (StoryFn: StoryFunction<Renderer>, context: StoryContext<Renderer>) => {
|
||||
const { measureEnabled } = context.globals;
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-outline",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Outline all elements with CSS to help with layout placement and alignment",
|
||||
"keywords": [
|
||||
"storybook-addons",
|
||||
@ -77,12 +77,12 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/addons": "7.0.0-alpha.48",
|
||||
"@storybook/api": "7.0.0-alpha.48",
|
||||
"@storybook/client-logger": "7.0.0-alpha.48",
|
||||
"@storybook/components": "7.0.0-alpha.48",
|
||||
"@storybook/core-events": "7.0.0-alpha.48",
|
||||
"@storybook/types": "7.0.0-alpha.48",
|
||||
"@storybook/addons": "7.0.0-alpha.49",
|
||||
"@storybook/api": "7.0.0-alpha.49",
|
||||
"@storybook/client-logger": "7.0.0-alpha.49",
|
||||
"@storybook/components": "7.0.0-alpha.49",
|
||||
"@storybook/core-events": "7.0.0-alpha.49",
|
||||
"@storybook/types": "7.0.0-alpha.49",
|
||||
"global": "^4.4.0",
|
||||
"ts-dedent": "^2.0.0"
|
||||
},
|
||||
@ -111,7 +111,7 @@
|
||||
"./src/preview.tsx"
|
||||
]
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd",
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8",
|
||||
"storybook": {
|
||||
"displayName": "Outline",
|
||||
"unsupportedFrameworks": [
|
||||
|
@ -1,14 +1,11 @@
|
||||
import { useMemo, useEffect } from '@storybook/addons';
|
||||
import type { Framework, PartialStoryFn as StoryFunction, StoryContext } from '@storybook/types';
|
||||
import type { Renderer, PartialStoryFn as StoryFunction, StoryContext } from '@storybook/types';
|
||||
|
||||
import { clearStyles, addOutlineStyles } from './helpers';
|
||||
import { PARAM_KEY } from './constants';
|
||||
import outlineCSS from './outlineCSS';
|
||||
|
||||
export const withOutline = (
|
||||
StoryFn: StoryFunction<Framework>,
|
||||
context: StoryContext<Framework>
|
||||
) => {
|
||||
export const withOutline = (StoryFn: StoryFunction<Renderer>, context: StoryContext<Renderer>) => {
|
||||
const { globals } = context;
|
||||
const isActive = globals[PARAM_KEY] === true;
|
||||
const isInDocs = context.viewMode === 'docs';
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-storyshots",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Take a code snapshot of every story automatically with Jest",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -38,13 +38,13 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@jest/transform": "^26.6.2",
|
||||
"@storybook/addons": "7.0.0-alpha.48",
|
||||
"@storybook/addons": "7.0.0-alpha.49",
|
||||
"@storybook/babel-plugin-require-context-hook": "1.0.1",
|
||||
"@storybook/client-api": "7.0.0-alpha.48",
|
||||
"@storybook/core-client": "7.0.0-alpha.48",
|
||||
"@storybook/core-common": "7.0.0-alpha.48",
|
||||
"@storybook/core-webpack": "7.0.0-alpha.48",
|
||||
"@storybook/types": "7.0.0-alpha.48",
|
||||
"@storybook/client-api": "7.0.0-alpha.49",
|
||||
"@storybook/core-client": "7.0.0-alpha.49",
|
||||
"@storybook/core-common": "7.0.0-alpha.49",
|
||||
"@storybook/core-webpack": "7.0.0-alpha.49",
|
||||
"@storybook/types": "7.0.0-alpha.49",
|
||||
"@types/glob": "^7.1.3",
|
||||
"@types/jest": "^26.0.16",
|
||||
"@types/jest-specific-snapshot": "^0.5.3",
|
||||
@ -62,11 +62,11 @@
|
||||
"@angular/core": "^13.3.6",
|
||||
"@angular/platform-browser-dynamic": "^13.3.6",
|
||||
"@emotion/jest": "^11.8.0",
|
||||
"@storybook/addon-docs": "7.0.0-alpha.48",
|
||||
"@storybook/angular": "7.0.0-alpha.48",
|
||||
"@storybook/react": "7.0.0-alpha.48",
|
||||
"@storybook/vue": "7.0.0-alpha.48",
|
||||
"@storybook/vue3": "7.0.0-alpha.48",
|
||||
"@storybook/addon-docs": "7.0.0-alpha.49",
|
||||
"@storybook/angular": "7.0.0-alpha.49",
|
||||
"@storybook/react": "7.0.0-alpha.49",
|
||||
"@storybook/vue": "7.0.0-alpha.49",
|
||||
"@storybook/vue3": "7.0.0-alpha.49",
|
||||
"babel-loader": "^8.2.5",
|
||||
"enzyme": "^3.11.0",
|
||||
"enzyme-to-json": "^3.6.1",
|
||||
@ -144,7 +144,7 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd",
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8",
|
||||
"storybook": {
|
||||
"displayName": "Storyshots",
|
||||
"icon": "https://user-images.githubusercontent.com/263385/101991676-48cdf300-3c7c-11eb-8aa1-944dab6ab29b.png",
|
||||
|
@ -1,11 +1,11 @@
|
||||
import type { Framework, Addon_Loadable } from '@storybook/types';
|
||||
import type { Renderer, Addon_Loadable } from '@storybook/types';
|
||||
import type { ClientApi as ClientApiClass } from '@storybook/client-api';
|
||||
import type { StoryshotsOptions } from '../api/StoryshotsOptions';
|
||||
import type { SupportedFramework } from './SupportedFramework';
|
||||
|
||||
export type RenderTree = (story: any, context?: any, options?: any) => any;
|
||||
|
||||
export interface ClientApi<TFramework extends Framework> extends ClientApiClass<Framework> {
|
||||
export interface ClientApi<TRenderer extends Renderer> extends ClientApiClass<Renderer> {
|
||||
configure(
|
||||
loader: Addon_Loadable,
|
||||
module: NodeModule | false,
|
||||
@ -19,7 +19,7 @@ export interface Loader {
|
||||
framework: SupportedFramework;
|
||||
renderTree: RenderTree;
|
||||
renderShallowTree: any;
|
||||
storybook: ClientApi<Framework>;
|
||||
storybook: ClientApi<Renderer>;
|
||||
};
|
||||
test: (options: StoryshotsOptions) => boolean;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import type {
|
||||
Framework,
|
||||
Renderer,
|
||||
ArgsEnhancer,
|
||||
ArgTypesEnhancer,
|
||||
CoreCommon_NormalizedStoriesSpecifier,
|
||||
@ -87,9 +87,9 @@ function getConfigPathParts(input: string): Output {
|
||||
return { preview: configDir };
|
||||
}
|
||||
|
||||
function configure<TFramework extends Framework>(
|
||||
function configure<TRenderer extends Renderer>(
|
||||
options: {
|
||||
storybook: ClientApi<TFramework>;
|
||||
storybook: ClientApi<TRenderer>;
|
||||
} & StoryshotsOptions
|
||||
): void {
|
||||
const { configPath = '.storybook', config, storybook } = options;
|
||||
@ -125,7 +125,7 @@ function configure<TFramework extends Framework>(
|
||||
} = jest.requireActual(preview);
|
||||
|
||||
if (decorators) {
|
||||
decorators.forEach((decorator: DecoratorFunction<TFramework>) =>
|
||||
decorators.forEach((decorator: DecoratorFunction<TRenderer>) =>
|
||||
storybook.addDecorator(decorator)
|
||||
);
|
||||
}
|
||||
@ -136,12 +136,12 @@ function configure<TFramework extends Framework>(
|
||||
storybook.addStepRunner(runStep);
|
||||
}
|
||||
if (argsEnhancers) {
|
||||
argsEnhancers.forEach((enhancer: ArgsEnhancer<TFramework>) =>
|
||||
argsEnhancers.forEach((enhancer: ArgsEnhancer<TRenderer>) =>
|
||||
storybook.addArgsEnhancer(enhancer as any)
|
||||
);
|
||||
}
|
||||
if (argTypesEnhancers) {
|
||||
argTypesEnhancers.forEach((enhancer: ArgTypesEnhancer<TFramework>) =>
|
||||
argTypesEnhancers.forEach((enhancer: ArgTypesEnhancer<TRenderer>) =>
|
||||
storybook.addArgTypesEnhancer(enhancer as any)
|
||||
);
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-storyshots-puppeteer",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Image snapshots addition to StoryShots based on puppeteer",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -34,9 +34,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@axe-core/puppeteer": "^4.2.0",
|
||||
"@storybook/csf": "next",
|
||||
"@storybook/node-logger": "7.0.0-alpha.48",
|
||||
"@storybook/types": "7.0.0-alpha.48",
|
||||
"@storybook/csf": "0.0.2-next.5",
|
||||
"@storybook/node-logger": "7.0.0-alpha.49",
|
||||
"@storybook/types": "7.0.0-alpha.49",
|
||||
"@types/jest-image-snapshot": "^4.1.3",
|
||||
"jest-image-snapshot": "^4.3.0"
|
||||
},
|
||||
@ -45,7 +45,7 @@
|
||||
"puppeteer": "^2.0.0 || ^3.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@storybook/addon-storyshots": "7.0.0-alpha.48",
|
||||
"@storybook/addon-storyshots": "7.0.0-alpha.49",
|
||||
"puppeteer": ">=2.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
@ -56,5 +56,5 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-storysource",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "View a story’s source code to see how it works and paste into your app",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -53,13 +53,13 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/addons": "7.0.0-alpha.48",
|
||||
"@storybook/api": "7.0.0-alpha.48",
|
||||
"@storybook/client-logger": "7.0.0-alpha.48",
|
||||
"@storybook/components": "7.0.0-alpha.48",
|
||||
"@storybook/router": "7.0.0-alpha.48",
|
||||
"@storybook/source-loader": "7.0.0-alpha.48",
|
||||
"@storybook/theming": "7.0.0-alpha.48",
|
||||
"@storybook/addons": "7.0.0-alpha.49",
|
||||
"@storybook/api": "7.0.0-alpha.49",
|
||||
"@storybook/client-logger": "7.0.0-alpha.49",
|
||||
"@storybook/components": "7.0.0-alpha.49",
|
||||
"@storybook/router": "7.0.0-alpha.49",
|
||||
"@storybook/source-loader": "7.0.0-alpha.49",
|
||||
"@storybook/theming": "7.0.0-alpha.49",
|
||||
"estraverse": "^5.2.0",
|
||||
"prop-types": "^15.7.2",
|
||||
"react-syntax-highlighter": "^15.5.0"
|
||||
@ -91,7 +91,7 @@
|
||||
"./src/preset.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd",
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8",
|
||||
"storybook": {
|
||||
"displayName": "Storysource",
|
||||
"icon": "https://user-images.githubusercontent.com/263385/101991675-48cdf300-3c7c-11eb-9400-58de5ac6daa7.png",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-toolbars",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Create your own toolbar items that control story rendering",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -67,11 +67,11 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/addons": "7.0.0-alpha.48",
|
||||
"@storybook/api": "7.0.0-alpha.48",
|
||||
"@storybook/client-logger": "7.0.0-alpha.48",
|
||||
"@storybook/components": "7.0.0-alpha.48",
|
||||
"@storybook/theming": "7.0.0-alpha.48"
|
||||
"@storybook/addons": "7.0.0-alpha.49",
|
||||
"@storybook/api": "7.0.0-alpha.49",
|
||||
"@storybook/client-logger": "7.0.0-alpha.49",
|
||||
"@storybook/components": "7.0.0-alpha.49",
|
||||
"@storybook/theming": "7.0.0-alpha.49"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "~4.6.3"
|
||||
@ -98,7 +98,7 @@
|
||||
],
|
||||
"platform": "browser"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd",
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8",
|
||||
"storybook": {
|
||||
"displayName": "Toolbars",
|
||||
"icon": "https://user-images.githubusercontent.com/263385/101991677-48cdf300-3c7c-11eb-93b4-19b0e3366959.png",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-viewport",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Build responsive components by adjusting Storybook’s viewport size and orientation",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -72,12 +72,12 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/addons": "7.0.0-alpha.48",
|
||||
"@storybook/api": "7.0.0-alpha.48",
|
||||
"@storybook/client-logger": "7.0.0-alpha.48",
|
||||
"@storybook/components": "7.0.0-alpha.48",
|
||||
"@storybook/core-events": "7.0.0-alpha.48",
|
||||
"@storybook/theming": "7.0.0-alpha.48",
|
||||
"@storybook/addons": "7.0.0-alpha.49",
|
||||
"@storybook/api": "7.0.0-alpha.49",
|
||||
"@storybook/client-logger": "7.0.0-alpha.49",
|
||||
"@storybook/components": "7.0.0-alpha.49",
|
||||
"@storybook/core-events": "7.0.0-alpha.49",
|
||||
"@storybook/theming": "7.0.0-alpha.49",
|
||||
"global": "^4.4.0",
|
||||
"memoizerific": "^1.11.3",
|
||||
"prop-types": "^15.7.2"
|
||||
@ -108,7 +108,7 @@
|
||||
"./src/preview.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd",
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8",
|
||||
"storybook": {
|
||||
"displayName": "Viewport",
|
||||
"icon": "https://user-images.githubusercontent.com/263385/101991678-48cdf300-3c7c-11eb-9764-f8af293c1b28.png",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/angular",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.",
|
||||
"keywords": [
|
||||
"storybook",
|
||||
@ -34,19 +34,19 @@
|
||||
"prep": "rimraf dist && ../../../scripts/node_modules/.bin/tsc --project tsconfig.build.json && echo \"Preventing passing flags to tsc\""
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/addons": "7.0.0-alpha.48",
|
||||
"@storybook/api": "7.0.0-alpha.48",
|
||||
"@storybook/builder-webpack5": "7.0.0-alpha.48",
|
||||
"@storybook/client-logger": "7.0.0-alpha.48",
|
||||
"@storybook/core-client": "7.0.0-alpha.48",
|
||||
"@storybook/core-common": "7.0.0-alpha.48",
|
||||
"@storybook/core-events": "7.0.0-alpha.48",
|
||||
"@storybook/core-server": "7.0.0-alpha.48",
|
||||
"@storybook/core-webpack": "7.0.0-alpha.48",
|
||||
"@storybook/docs-tools": "7.0.0-alpha.48",
|
||||
"@storybook/node-logger": "7.0.0-alpha.48",
|
||||
"@storybook/store": "7.0.0-alpha.48",
|
||||
"@storybook/types": "7.0.0-alpha.48",
|
||||
"@storybook/addons": "7.0.0-alpha.49",
|
||||
"@storybook/api": "7.0.0-alpha.49",
|
||||
"@storybook/builder-webpack5": "7.0.0-alpha.49",
|
||||
"@storybook/client-logger": "7.0.0-alpha.49",
|
||||
"@storybook/core-client": "7.0.0-alpha.49",
|
||||
"@storybook/core-common": "7.0.0-alpha.49",
|
||||
"@storybook/core-events": "7.0.0-alpha.49",
|
||||
"@storybook/core-server": "7.0.0-alpha.49",
|
||||
"@storybook/core-webpack": "7.0.0-alpha.49",
|
||||
"@storybook/docs-tools": "7.0.0-alpha.49",
|
||||
"@storybook/node-logger": "7.0.0-alpha.49",
|
||||
"@storybook/store": "7.0.0-alpha.49",
|
||||
"@storybook/types": "7.0.0-alpha.49",
|
||||
"@types/node": "^16.0.0",
|
||||
"@types/react": "^16.14.23",
|
||||
"@types/react-dom": "^16.9.14",
|
||||
@ -123,5 +123,5 @@
|
||||
"access": "public"
|
||||
},
|
||||
"builders": "dist/builders/builders.json",
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import { Subscriber, Observable, ReplaySubject } from 'rxjs';
|
||||
import { PartialStoryFn } from '@storybook/types';
|
||||
import { AppComponent } from './app.component';
|
||||
import { STORY } from './app.token';
|
||||
import { NgModuleMetadata, StoryFnAngularReturnType, AngularFramework } from '../types';
|
||||
import { NgModuleMetadata, StoryFnAngularReturnType, AngularRenderer } from '../types';
|
||||
|
||||
const { document } = global;
|
||||
|
||||
@ -131,7 +131,7 @@ const getExistenceOfComponentInModules = (
|
||||
});
|
||||
};
|
||||
|
||||
const initModule = (storyFn: PartialStoryFn<AngularFramework>) => {
|
||||
const initModule = (storyFn: PartialStoryFn<AngularRenderer>) => {
|
||||
const storyObj = storyFn();
|
||||
const { component, template, props, styles, moduleMetadata = {} } = storyObj;
|
||||
|
||||
@ -198,7 +198,7 @@ const draw = (newModule: DynamicComponentType): void => {
|
||||
}
|
||||
};
|
||||
|
||||
export const renderNgApp = (storyFn: PartialStoryFn<AngularFramework>, forced: boolean) => {
|
||||
export const renderNgApp = (storyFn: PartialStoryFn<AngularRenderer>, forced: boolean) => {
|
||||
if (!forced) {
|
||||
draw(initModule(storyFn));
|
||||
} else {
|
||||
|
@ -3,12 +3,12 @@ import { DecoratorFunction, StoryContext } from '@storybook/types';
|
||||
import { componentWrapperDecorator } from './decorators';
|
||||
|
||||
import decorateStory from './decorateStory';
|
||||
import { AngularFramework } from './types';
|
||||
import { AngularRenderer } from './types';
|
||||
|
||||
describe('decorateStory', () => {
|
||||
describe('angular behavior', () => {
|
||||
it('should use componentWrapperDecorator with args', () => {
|
||||
const decorators: DecoratorFunction<AngularFramework>[] = [
|
||||
const decorators: DecoratorFunction<AngularRenderer>[] = [
|
||||
componentWrapperDecorator(ParentComponent, ({ args }) => args),
|
||||
componentWrapperDecorator(
|
||||
(story) => `<grandparent [grandparentInput]="grandparentInput">${story}</grandparent>`,
|
||||
@ -42,7 +42,7 @@ describe('decorateStory', () => {
|
||||
});
|
||||
|
||||
it('should use componentWrapperDecorator with input / output', () => {
|
||||
const decorators: DecoratorFunction<AngularFramework>[] = [
|
||||
const decorators: DecoratorFunction<AngularRenderer>[] = [
|
||||
componentWrapperDecorator(ParentComponent, {
|
||||
parentInput: 'Parent input',
|
||||
parentOutput: () => {},
|
||||
@ -81,7 +81,7 @@ describe('decorateStory', () => {
|
||||
});
|
||||
|
||||
it('should use componentWrapperDecorator', () => {
|
||||
const decorators: DecoratorFunction<AngularFramework>[] = [
|
||||
const decorators: DecoratorFunction<AngularRenderer>[] = [
|
||||
componentWrapperDecorator(ParentComponent),
|
||||
componentWrapperDecorator((story) => `<grandparent>${story}</grandparent>`),
|
||||
componentWrapperDecorator((story) => `<great-grandparent>${story}</great-grandparent>`),
|
||||
@ -96,7 +96,7 @@ describe('decorateStory', () => {
|
||||
});
|
||||
|
||||
it('should use template in preference to component parameters', () => {
|
||||
const decorators: DecoratorFunction<AngularFramework>[] = [
|
||||
const decorators: DecoratorFunction<AngularRenderer>[] = [
|
||||
(s) => {
|
||||
const story = s();
|
||||
return {
|
||||
@ -129,7 +129,7 @@ describe('decorateStory', () => {
|
||||
});
|
||||
|
||||
it('should include story templates in decorators', () => {
|
||||
const decorators: DecoratorFunction<AngularFramework>[] = [
|
||||
const decorators: DecoratorFunction<AngularRenderer>[] = [
|
||||
(s) => {
|
||||
const story = s();
|
||||
return {
|
||||
@ -162,7 +162,7 @@ describe('decorateStory', () => {
|
||||
});
|
||||
|
||||
it('should include story components in decorators', () => {
|
||||
const decorators: DecoratorFunction<AngularFramework>[] = [
|
||||
const decorators: DecoratorFunction<AngularRenderer>[] = [
|
||||
(s) => {
|
||||
const story = s();
|
||||
return {
|
||||
@ -195,7 +195,7 @@ describe('decorateStory', () => {
|
||||
});
|
||||
|
||||
it('should include legacy story components in decorators', () => {
|
||||
const decorators: DecoratorFunction<AngularFramework>[] = [
|
||||
const decorators: DecoratorFunction<AngularRenderer>[] = [
|
||||
(s) => {
|
||||
const story = s();
|
||||
return {
|
||||
@ -229,7 +229,7 @@ describe('decorateStory', () => {
|
||||
});
|
||||
|
||||
it('should keep template with an empty value', () => {
|
||||
const decorators: DecoratorFunction<AngularFramework>[] = [
|
||||
const decorators: DecoratorFunction<AngularRenderer>[] = [
|
||||
componentWrapperDecorator(ParentComponent),
|
||||
];
|
||||
const decorated = decorateStory(() => ({ template: '' }), decorators);
|
||||
@ -272,7 +272,7 @@ describe('decorateStory', () => {
|
||||
|
||||
describe('default behavior', () => {
|
||||
it('calls decorators in out to in order', () => {
|
||||
const decorators: DecoratorFunction<AngularFramework>[] = [
|
||||
const decorators: DecoratorFunction<AngularRenderer>[] = [
|
||||
(s) => {
|
||||
const story = s();
|
||||
return { ...story, props: { a: [...story.props.a, 1] } };
|
||||
@ -292,7 +292,7 @@ describe('decorateStory', () => {
|
||||
});
|
||||
|
||||
it('passes context through to sub decorators', () => {
|
||||
const decorators: DecoratorFunction<AngularFramework>[] = [
|
||||
const decorators: DecoratorFunction<AngularRenderer>[] = [
|
||||
(s, c) => {
|
||||
const story = s({ ...c, k: 1 });
|
||||
return { ...story, props: { a: [...story.props.a, c.k] } };
|
||||
@ -312,7 +312,7 @@ describe('decorateStory', () => {
|
||||
});
|
||||
|
||||
it('DOES NOT merge parameter or pass through parameters key in context', () => {
|
||||
const decorators: DecoratorFunction<AngularFramework>[] = [
|
||||
const decorators: DecoratorFunction<AngularRenderer>[] = [
|
||||
(s, c) => {
|
||||
const story = s({ ...c, k: 1, parameters: { p: 1 } });
|
||||
return {
|
||||
@ -347,7 +347,7 @@ describe('decorateStory', () => {
|
||||
});
|
||||
});
|
||||
|
||||
function makeContext(input: Record<string, unknown>): StoryContext<AngularFramework> {
|
||||
function makeContext(input: Record<string, unknown>): StoryContext<AngularRenderer> {
|
||||
return {
|
||||
id: 'id',
|
||||
kind: 'kind',
|
||||
@ -355,7 +355,7 @@ function makeContext(input: Record<string, unknown>): StoryContext<AngularFramew
|
||||
viewMode: 'story',
|
||||
parameters: {},
|
||||
...input,
|
||||
} as StoryContext<AngularFramework>;
|
||||
} as StoryContext<AngularRenderer>;
|
||||
}
|
||||
|
||||
@Component({
|
||||
|
@ -2,15 +2,15 @@ import { DecoratorFunction, LegacyStoryFn, StoryContext } from '@storybook/types
|
||||
import { sanitizeStoryContextUpdate } from '@storybook/store';
|
||||
import { computesTemplateFromComponent } from './angular-beta/ComputesTemplateFromComponent';
|
||||
|
||||
import { AngularFramework } from './types';
|
||||
import { AngularRenderer } from './types';
|
||||
|
||||
export default function decorateStory(
|
||||
mainStoryFn: LegacyStoryFn<AngularFramework>,
|
||||
decorators: DecoratorFunction<AngularFramework>[]
|
||||
): LegacyStoryFn<AngularFramework> {
|
||||
mainStoryFn: LegacyStoryFn<AngularRenderer>,
|
||||
decorators: DecoratorFunction<AngularRenderer>[]
|
||||
): LegacyStoryFn<AngularRenderer> {
|
||||
const returnDecorators = [cleanArgsDecorator, ...decorators].reduce(
|
||||
(previousStoryFn: LegacyStoryFn<AngularFramework>, decorator) =>
|
||||
(context: StoryContext<AngularFramework>) => {
|
||||
(previousStoryFn: LegacyStoryFn<AngularRenderer>, decorator) =>
|
||||
(context: StoryContext<AngularRenderer>) => {
|
||||
const decoratedStory = decorator((update) => {
|
||||
return previousStoryFn({
|
||||
...context,
|
||||
@ -29,9 +29,9 @@ export default function decorateStory(
|
||||
export { decorateStory };
|
||||
|
||||
const prepareMain = (
|
||||
story: AngularFramework['storyResult'],
|
||||
context: StoryContext<AngularFramework>
|
||||
): AngularFramework['storyResult'] => {
|
||||
story: AngularRenderer['storyResult'],
|
||||
context: StoryContext<AngularRenderer>
|
||||
): AngularRenderer['storyResult'] => {
|
||||
let { template } = story;
|
||||
|
||||
const component = story.component ?? context.component;
|
||||
@ -50,7 +50,7 @@ function hasNoTemplate(template: string | null | undefined): template is undefin
|
||||
return template === null || template === undefined;
|
||||
}
|
||||
|
||||
const cleanArgsDecorator: DecoratorFunction<AngularFramework> = (storyFn, context) => {
|
||||
const cleanArgsDecorator: DecoratorFunction<AngularRenderer> = (storyFn, context) => {
|
||||
if (!context.argTypes || !context.args) {
|
||||
return storyFn();
|
||||
}
|
||||
|
@ -2,9 +2,9 @@ import { Addon_StoryContext } from '@storybook/types';
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
import { moduleMetadata } from './decorators';
|
||||
import { AngularFramework } from './types';
|
||||
import { AngularRenderer } from './types';
|
||||
|
||||
const defaultContext: Addon_StoryContext<AngularFramework> = {
|
||||
const defaultContext: Addon_StoryContext<AngularRenderer> = {
|
||||
componentId: 'unspecified',
|
||||
kind: 'unspecified',
|
||||
title: 'unspecified',
|
||||
|
@ -3,12 +3,12 @@ import { Type } from '@angular/core';
|
||||
import { DecoratorFunction, StoryContext } from '@storybook/types';
|
||||
import { computesTemplateFromComponent } from './angular-beta/ComputesTemplateFromComponent';
|
||||
import { isComponent } from './angular-beta/utils/NgComponentAnalyzer';
|
||||
import { ICollection, NgModuleMetadata, AngularFramework } from './types';
|
||||
import { ICollection, NgModuleMetadata, AngularRenderer } from './types';
|
||||
|
||||
// We use `any` here as the default type rather than `Args` because we need something that is
|
||||
// castable to any component-specific args type when the user is being careful.
|
||||
export const moduleMetadata =
|
||||
<TArgs = any>(metadata: Partial<NgModuleMetadata>): DecoratorFunction<AngularFramework, TArgs> =>
|
||||
<TArgs = any>(metadata: Partial<NgModuleMetadata>): DecoratorFunction<AngularRenderer, TArgs> =>
|
||||
(storyFn) => {
|
||||
const story = storyFn();
|
||||
const storyMetadata = story.moduleMetadata || {};
|
||||
@ -32,8 +32,8 @@ export const moduleMetadata =
|
||||
export const componentWrapperDecorator =
|
||||
<TArgs = any>(
|
||||
element: Type<unknown> | ((story: string) => string),
|
||||
props?: ICollection | ((storyContext: StoryContext<AngularFramework, TArgs>) => ICollection)
|
||||
): DecoratorFunction<AngularFramework, TArgs> =>
|
||||
props?: ICollection | ((storyContext: StoryContext<AngularRenderer, TArgs>) => ICollection)
|
||||
): DecoratorFunction<AngularRenderer, TArgs> =>
|
||||
(storyFn, storyContext) => {
|
||||
const story = storyFn();
|
||||
const currentProps = typeof props === 'function' ? (props(storyContext) as ICollection) : props;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { addons, useEffect } from '@storybook/addons';
|
||||
import { PartialStoryFn } from '@storybook/types';
|
||||
import { SNIPPET_RENDERED, SourceType } from '@storybook/docs-tools';
|
||||
import { StoryContext, AngularFramework } from '../types';
|
||||
import { StoryContext, AngularRenderer } from '../types';
|
||||
import { computesTemplateSourceFromComponent } from '../../renderer';
|
||||
|
||||
export const skipSourceRender = (context: StoryContext) => {
|
||||
@ -22,7 +22,7 @@ export const skipSourceRender = (context: StoryContext) => {
|
||||
* @param context StoryContext
|
||||
*/
|
||||
export const sourceDecorator = (
|
||||
storyFn: PartialStoryFn<AngularFramework>,
|
||||
storyFn: PartialStoryFn<AngularRenderer>,
|
||||
context: StoryContext
|
||||
) => {
|
||||
const story = storyFn();
|
||||
|
@ -3,20 +3,20 @@ import { Addon_ClientStoryApi, Addon_Loadable } from '@storybook/types';
|
||||
import { start } from '@storybook/core-client';
|
||||
import { renderToCanvas, render } from './render';
|
||||
import decorateStory from './decorateStory';
|
||||
import { AngularFramework } from './types';
|
||||
import { AngularRenderer } from './types';
|
||||
|
||||
export * from './public-types';
|
||||
|
||||
const FRAMEWORK = 'angular';
|
||||
|
||||
interface ClientApi extends Addon_ClientStoryApi<AngularFramework['storyResult']> {
|
||||
interface ClientApi extends Addon_ClientStoryApi<AngularRenderer['storyResult']> {
|
||||
configure(loader: Addon_Loadable, module: NodeModule): void;
|
||||
forceReRender(): void;
|
||||
raw: () => any; // todo add type
|
||||
load: (...args: any[]) => void;
|
||||
}
|
||||
|
||||
const api = start<AngularFramework>(renderToCanvas, { decorateStory, render });
|
||||
const api = start<AngularRenderer>(renderToCanvas, { decorateStory, render });
|
||||
|
||||
export const storiesOf: ClientApi['storiesOf'] = (kind, m) => {
|
||||
return (api.clientApi.storiesOf(kind, m) as ReturnType<ClientApi['storiesOf']>).addParameters({
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { AnnotatedStoryFn, Args, ComponentAnnotations, StoryAnnotations } from '@storybook/types';
|
||||
import { AngularFramework } from './types';
|
||||
import { AngularRenderer } from './types';
|
||||
|
||||
export type { Args, ArgTypes } from '@storybook/types';
|
||||
|
||||
@ -8,21 +8,21 @@ export type { Args, ArgTypes } from '@storybook/types';
|
||||
*
|
||||
* @see [Default export](https://storybook.js.org/docs/formats/component-story-format/#default-export)
|
||||
*/
|
||||
export type Meta<TArgs = Args> = ComponentAnnotations<AngularFramework, TArgs>;
|
||||
export type Meta<TArgs = Args> = ComponentAnnotations<AngularRenderer, TArgs>;
|
||||
|
||||
/**
|
||||
* Story function that represents a CSFv2 component example.
|
||||
*
|
||||
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
|
||||
*/
|
||||
export type StoryFn<TArgs = Args> = AnnotatedStoryFn<AngularFramework, TArgs>;
|
||||
export type StoryFn<TArgs = Args> = AnnotatedStoryFn<AngularRenderer, TArgs>;
|
||||
|
||||
/**
|
||||
* Story function that represents a CSFv3 component example.
|
||||
*
|
||||
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
|
||||
*/
|
||||
export type StoryObj<TArgs = Args> = StoryAnnotations<AngularFramework, TArgs>;
|
||||
export type StoryObj<TArgs = Args> = StoryAnnotations<AngularRenderer, TArgs>;
|
||||
|
||||
/**
|
||||
* @deprecated Use `StoryFn` instead.
|
||||
|
@ -1,13 +1,13 @@
|
||||
import { Store_RenderContext, ArgsStoryFn } from '@storybook/types';
|
||||
|
||||
import { renderNgApp } from './angular/helpers';
|
||||
import { AngularFramework } from './types';
|
||||
import { AngularRenderer } from './types';
|
||||
|
||||
import { RendererFactory } from './angular-beta/RendererFactory';
|
||||
|
||||
export const rendererFactory = new RendererFactory();
|
||||
|
||||
export const render: ArgsStoryFn<AngularFramework> = (props) => ({ props });
|
||||
export const render: ArgsStoryFn<AngularRenderer> = (props) => ({ props });
|
||||
|
||||
export async function renderToCanvas(
|
||||
{
|
||||
@ -16,7 +16,7 @@ export async function renderToCanvas(
|
||||
forceRemount,
|
||||
storyContext: { parameters, component },
|
||||
id,
|
||||
}: Store_RenderContext<AngularFramework>,
|
||||
}: Store_RenderContext<AngularRenderer>,
|
||||
element: HTMLElement
|
||||
) {
|
||||
showMain();
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {
|
||||
Parameters as DefaultParameters,
|
||||
StoryContext as DefaultStoryContext,
|
||||
WebFramework,
|
||||
WebRenderer,
|
||||
} from '@storybook/types';
|
||||
|
||||
export interface NgModuleMetadata {
|
||||
@ -27,7 +27,11 @@ export interface StoryFnAngularReturnType {
|
||||
userDefinedTemplate?: boolean;
|
||||
}
|
||||
|
||||
export interface AngularFramework extends WebFramework {
|
||||
/**
|
||||
* @deprecated Use `AngularRenderer` instead.
|
||||
*/
|
||||
export type AngularFramework = AngularRenderer;
|
||||
export interface AngularRenderer extends WebRenderer {
|
||||
component: any;
|
||||
storyResult: StoryFnAngularReturnType;
|
||||
}
|
||||
@ -38,4 +42,4 @@ export type Parameters = DefaultParameters & {
|
||||
bootstrapModuleOptions?: unknown;
|
||||
};
|
||||
|
||||
export type StoryContext = DefaultStoryContext<AngularFramework> & { parameters: Parameters };
|
||||
export type StoryContext = DefaultStoryContext<AngularRenderer> & { parameters: Parameters };
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/ember",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.",
|
||||
"homepage": "https://github.com/storybookjs/storybook/tree/main/frameworks/ember",
|
||||
"bugs": {
|
||||
@ -31,12 +31,12 @@
|
||||
"prep": "node ../../../scripts/prepare.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-webpack5": "7.0.0-alpha.48",
|
||||
"@storybook/core-client": "7.0.0-alpha.48",
|
||||
"@storybook/core-common": "7.0.0-alpha.48",
|
||||
"@storybook/docs-tools": "7.0.0-alpha.48",
|
||||
"@storybook/store": "7.0.0-alpha.48",
|
||||
"@storybook/types": "7.0.0-alpha.48",
|
||||
"@storybook/builder-webpack5": "7.0.0-alpha.49",
|
||||
"@storybook/core-client": "7.0.0-alpha.49",
|
||||
"@storybook/core-common": "7.0.0-alpha.49",
|
||||
"@storybook/docs-tools": "7.0.0-alpha.49",
|
||||
"@storybook/store": "7.0.0-alpha.49",
|
||||
"@storybook/types": "7.0.0-alpha.49",
|
||||
"global": "^4.4.0",
|
||||
"react": "16.14.0",
|
||||
"react-dom": "16.14.0",
|
||||
@ -60,5 +60,5 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ import { dedent } from 'ts-dedent';
|
||||
import type { Store_RenderContext } from '@storybook/types';
|
||||
// @ts-expect-error (Converted from ts-ignore)
|
||||
import Component from '@ember/component'; // eslint-disable-line import/no-unresolved
|
||||
import type { OptionsArgs, EmberFramework } from './types';
|
||||
import type { OptionsArgs, EmberRenderer } from './types';
|
||||
|
||||
const { window: globalWindow, document } = global;
|
||||
|
||||
@ -20,7 +20,7 @@ let lastPromise = app.boot();
|
||||
let hasRendered = false;
|
||||
let isRendering = false;
|
||||
|
||||
function render(options: OptionsArgs, el: EmberFramework['canvasElement']) {
|
||||
function render(options: OptionsArgs, el: EmberRenderer['canvasElement']) {
|
||||
if (isRendering) return;
|
||||
isRendering = true;
|
||||
|
||||
@ -61,8 +61,8 @@ function render(options: OptionsArgs, el: EmberFramework['canvasElement']) {
|
||||
}
|
||||
|
||||
export function renderToCanvas(
|
||||
{ storyFn, kind, name, showMain, showError }: Store_RenderContext<EmberFramework>,
|
||||
canvasElement: EmberFramework['canvasElement']
|
||||
{ storyFn, kind, name, showMain, showError }: Store_RenderContext<EmberRenderer>,
|
||||
canvasElement: EmberRenderer['canvasElement']
|
||||
) {
|
||||
const element = storyFn();
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { WebFramework } from '@storybook/types';
|
||||
import type { WebRenderer } from '@storybook/types';
|
||||
|
||||
export type { RenderContext } from '@storybook/types';
|
||||
|
||||
@ -13,7 +13,11 @@ export interface OptionsArgs {
|
||||
element: any;
|
||||
}
|
||||
|
||||
export interface EmberFramework extends WebFramework {
|
||||
/**
|
||||
* @deprecated Use `EmberRenderer` instead.
|
||||
*/
|
||||
export type EmberFramework = EmberRenderer;
|
||||
export interface EmberRenderer extends WebRenderer {
|
||||
component: any;
|
||||
storyResult: OptionsArgs;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/html-webpack5",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -50,10 +50,10 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-webpack5": "7.0.0-alpha.48",
|
||||
"@storybook/core-common": "7.0.0-alpha.48",
|
||||
"@storybook/html": "7.0.0-alpha.48",
|
||||
"@storybook/preset-html-webpack": "7.0.0-alpha.48",
|
||||
"@storybook/builder-webpack5": "7.0.0-alpha.49",
|
||||
"@storybook/core-common": "7.0.0-alpha.49",
|
||||
"@storybook/html": "7.0.0-alpha.49",
|
||||
"@storybook/preset-html-webpack": "7.0.0-alpha.49",
|
||||
"@types/node": "^16.0.0",
|
||||
"global": "^4.4.0",
|
||||
"react": "16.14.0",
|
||||
@ -78,5 +78,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/nextjs",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Storybook for Next.js",
|
||||
"keywords": [
|
||||
"storybook",
|
||||
@ -60,12 +60,12 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/preset-typescript": "^7.18.6",
|
||||
"@storybook/addons": "7.0.0-alpha.48",
|
||||
"@storybook/builder-webpack5": "7.0.0-alpha.48",
|
||||
"@storybook/core-common": "7.0.0-alpha.48",
|
||||
"@storybook/node-logger": "7.0.0-alpha.48",
|
||||
"@storybook/preset-react-webpack": "7.0.0-alpha.48",
|
||||
"@storybook/react": "7.0.0-alpha.48",
|
||||
"@storybook/addons": "7.0.0-alpha.49",
|
||||
"@storybook/builder-webpack5": "7.0.0-alpha.49",
|
||||
"@storybook/core-common": "7.0.0-alpha.49",
|
||||
"@storybook/node-logger": "7.0.0-alpha.49",
|
||||
"@storybook/preset-react-webpack": "7.0.0-alpha.49",
|
||||
"@storybook/react": "7.0.0-alpha.49",
|
||||
"@types/node": "^14.14.20 || ^16.0.0",
|
||||
"find-up": "^5.0.0",
|
||||
"fs-extra": "^9.0.1",
|
||||
@ -81,7 +81,7 @@
|
||||
"tsconfig-paths-webpack-plugin": "^3.5.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@storybook/addon-actions": "7.0.0-alpha.48",
|
||||
"@storybook/addon-actions": "7.0.0-alpha.49",
|
||||
"@types/loader-utils": "^2.0.3",
|
||||
"next": "^12.2.4",
|
||||
"typescript": "~4.6.3",
|
||||
@ -121,5 +121,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/preact-webpack5",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Storybook for Preact: Develop Preact Component in isolation.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -50,10 +50,10 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-webpack5": "7.0.0-alpha.48",
|
||||
"@storybook/core-common": "7.0.0-alpha.48",
|
||||
"@storybook/preact": "7.0.0-alpha.48",
|
||||
"@storybook/preset-preact-webpack": "7.0.0-alpha.48",
|
||||
"@storybook/builder-webpack5": "7.0.0-alpha.49",
|
||||
"@storybook/core-common": "7.0.0-alpha.49",
|
||||
"@storybook/preact": "7.0.0-alpha.49",
|
||||
"@storybook/preset-preact-webpack": "7.0.0-alpha.49",
|
||||
"@types/node": "^16.0.0",
|
||||
"react": "16.14.0",
|
||||
"react-dom": "16.14.0"
|
||||
@ -79,5 +79,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/react-vite",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Storybook for React and Vite: Develop React components in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -53,13 +53,13 @@
|
||||
"dependencies": {
|
||||
"@joshwooding/vite-plugin-react-docgen-typescript": "^0.0.5",
|
||||
"@rollup/pluginutils": "^4.2.0",
|
||||
"@storybook/addons": "7.0.0-alpha.48",
|
||||
"@storybook/builder-vite": "7.0.0-alpha.48",
|
||||
"@storybook/channel-postmessage": "7.0.0-alpha.48",
|
||||
"@storybook/channel-websocket": "7.0.0-alpha.48",
|
||||
"@storybook/client-api": "7.0.0-alpha.48",
|
||||
"@storybook/preview-web": "7.0.0-alpha.48",
|
||||
"@storybook/react": "7.0.0-alpha.48",
|
||||
"@storybook/addons": "7.0.0-alpha.49",
|
||||
"@storybook/builder-vite": "7.0.0-alpha.49",
|
||||
"@storybook/channel-postmessage": "7.0.0-alpha.49",
|
||||
"@storybook/channel-websocket": "7.0.0-alpha.49",
|
||||
"@storybook/client-api": "7.0.0-alpha.49",
|
||||
"@storybook/preview-web": "7.0.0-alpha.49",
|
||||
"@storybook/react": "7.0.0-alpha.49",
|
||||
"@vitejs/plugin-react": "^2.0.0",
|
||||
"ast-types": "^0.14.2",
|
||||
"magic-string": "^0.26.1",
|
||||
@ -88,5 +88,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/react-webpack5",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Storybook for React: Develop React Component in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -51,9 +51,9 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-webpack5": "7.0.0-alpha.48",
|
||||
"@storybook/preset-react-webpack": "7.0.0-alpha.48",
|
||||
"@storybook/react": "7.0.0-alpha.48",
|
||||
"@storybook/builder-webpack5": "7.0.0-alpha.49",
|
||||
"@storybook/preset-react-webpack": "7.0.0-alpha.49",
|
||||
"@storybook/react": "7.0.0-alpha.49",
|
||||
"@types/node": "^16.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -86,5 +86,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/server-webpack5",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -50,10 +50,10 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-webpack5": "7.0.0-alpha.48",
|
||||
"@storybook/core-common": "7.0.0-alpha.48",
|
||||
"@storybook/preset-server-webpack": "7.0.0-alpha.48",
|
||||
"@storybook/server": "7.0.0-alpha.48",
|
||||
"@storybook/builder-webpack5": "7.0.0-alpha.49",
|
||||
"@storybook/core-common": "7.0.0-alpha.49",
|
||||
"@storybook/preset-server-webpack": "7.0.0-alpha.49",
|
||||
"@storybook/server": "7.0.0-alpha.49",
|
||||
"@types/node": "^16.0.0",
|
||||
"react": "16.14.0",
|
||||
"react-dom": "16.14.0"
|
||||
@ -74,5 +74,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/svelte-vite",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Storybook for Svelte and Vite: Develop Svelte components in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -52,14 +52,14 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/addon-svelte-csf": "^2.0.0",
|
||||
"@storybook/addons": "7.0.0-alpha.48",
|
||||
"@storybook/builder-vite": "7.0.0-alpha.48",
|
||||
"@storybook/channel-postmessage": "7.0.0-alpha.48",
|
||||
"@storybook/channel-websocket": "7.0.0-alpha.48",
|
||||
"@storybook/client-api": "7.0.0-alpha.48",
|
||||
"@storybook/node-logger": "7.0.0-alpha.48",
|
||||
"@storybook/preview-web": "7.0.0-alpha.48",
|
||||
"@storybook/svelte": "7.0.0-alpha.48",
|
||||
"@storybook/addons": "7.0.0-alpha.49",
|
||||
"@storybook/builder-vite": "7.0.0-alpha.49",
|
||||
"@storybook/channel-postmessage": "7.0.0-alpha.49",
|
||||
"@storybook/channel-websocket": "7.0.0-alpha.49",
|
||||
"@storybook/client-api": "7.0.0-alpha.49",
|
||||
"@storybook/node-logger": "7.0.0-alpha.49",
|
||||
"@storybook/preview-web": "7.0.0-alpha.49",
|
||||
"@storybook/svelte": "7.0.0-alpha.49",
|
||||
"@sveltejs/vite-plugin-svelte": "^1.0.0",
|
||||
"magic-string": "^0.26.1",
|
||||
"svelte": "^3.0.0",
|
||||
@ -92,5 +92,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/svelte-webpack5",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -51,10 +51,10 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-webpack5": "7.0.0-alpha.48",
|
||||
"@storybook/core-common": "7.0.0-alpha.48",
|
||||
"@storybook/preset-svelte-webpack": "7.0.0-alpha.48",
|
||||
"@storybook/svelte": "7.0.0-alpha.48",
|
||||
"@storybook/builder-webpack5": "7.0.0-alpha.49",
|
||||
"@storybook/core-common": "7.0.0-alpha.49",
|
||||
"@storybook/preset-svelte-webpack": "7.0.0-alpha.49",
|
||||
"@storybook/svelte": "7.0.0-alpha.49",
|
||||
"react": "16.14.0",
|
||||
"react-dom": "16.14.0"
|
||||
},
|
||||
@ -81,5 +81,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/vue-vite",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Storybook for Vue2 and Vite: Develop Vue2 Components in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -50,15 +50,15 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/addons": "7.0.0-alpha.48",
|
||||
"@storybook/builder-vite": "7.0.0-alpha.48",
|
||||
"@storybook/channel-postmessage": "7.0.0-alpha.48",
|
||||
"@storybook/channel-websocket": "7.0.0-alpha.48",
|
||||
"@storybook/client-api": "7.0.0-alpha.48",
|
||||
"@storybook/core-common": "7.0.0-alpha.48",
|
||||
"@storybook/core-server": "7.0.0-alpha.48",
|
||||
"@storybook/preview-web": "7.0.0-alpha.48",
|
||||
"@storybook/vue": "7.0.0-alpha.48",
|
||||
"@storybook/addons": "7.0.0-alpha.49",
|
||||
"@storybook/builder-vite": "7.0.0-alpha.49",
|
||||
"@storybook/channel-postmessage": "7.0.0-alpha.49",
|
||||
"@storybook/channel-websocket": "7.0.0-alpha.49",
|
||||
"@storybook/client-api": "7.0.0-alpha.49",
|
||||
"@storybook/core-common": "7.0.0-alpha.49",
|
||||
"@storybook/core-server": "7.0.0-alpha.49",
|
||||
"@storybook/preview-web": "7.0.0-alpha.49",
|
||||
"@storybook/vue": "7.0.0-alpha.49",
|
||||
"magic-string": "^0.26.1",
|
||||
"vite": "^3.1.3",
|
||||
"vue-docgen-api": "^4.40.0"
|
||||
@ -83,5 +83,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/vue-webpack5",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Storybook for Vue: Develop Vue Component in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -50,10 +50,10 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-webpack5": "7.0.0-alpha.48",
|
||||
"@storybook/core-common": "7.0.0-alpha.48",
|
||||
"@storybook/preset-vue-webpack": "7.0.0-alpha.48",
|
||||
"@storybook/vue": "7.0.0-alpha.48",
|
||||
"@storybook/builder-webpack5": "7.0.0-alpha.49",
|
||||
"@storybook/core-common": "7.0.0-alpha.49",
|
||||
"@storybook/preset-vue-webpack": "7.0.0-alpha.49",
|
||||
"@storybook/vue": "7.0.0-alpha.49",
|
||||
"@types/node": "^16.0.0",
|
||||
"react": "16.14.0",
|
||||
"react-dom": "16.14.0"
|
||||
@ -85,5 +85,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/vue3-vite",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Storybook for Vue3 and Vite: Develop Vue3 components in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -51,14 +51,14 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/addons": "7.0.0-alpha.48",
|
||||
"@storybook/builder-vite": "7.0.0-alpha.48",
|
||||
"@storybook/channel-postmessage": "7.0.0-alpha.48",
|
||||
"@storybook/channel-websocket": "7.0.0-alpha.48",
|
||||
"@storybook/client-api": "7.0.0-alpha.48",
|
||||
"@storybook/core-server": "7.0.0-alpha.48",
|
||||
"@storybook/preview-web": "7.0.0-alpha.48",
|
||||
"@storybook/vue3": "7.0.0-alpha.48",
|
||||
"@storybook/addons": "7.0.0-alpha.49",
|
||||
"@storybook/builder-vite": "7.0.0-alpha.49",
|
||||
"@storybook/channel-postmessage": "7.0.0-alpha.49",
|
||||
"@storybook/channel-websocket": "7.0.0-alpha.49",
|
||||
"@storybook/client-api": "7.0.0-alpha.49",
|
||||
"@storybook/core-server": "7.0.0-alpha.49",
|
||||
"@storybook/preview-web": "7.0.0-alpha.49",
|
||||
"@storybook/vue3": "7.0.0-alpha.49",
|
||||
"@vitejs/plugin-vue": "^3.0.0",
|
||||
"magic-string": "^0.26.1",
|
||||
"vite": "^3.1.3",
|
||||
@ -82,5 +82,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/vue3-webpack5",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -50,10 +50,10 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-webpack5": "7.0.0-alpha.48",
|
||||
"@storybook/core-common": "7.0.0-alpha.48",
|
||||
"@storybook/preset-vue3-webpack": "7.0.0-alpha.48",
|
||||
"@storybook/vue3": "7.0.0-alpha.48",
|
||||
"@storybook/builder-webpack5": "7.0.0-alpha.49",
|
||||
"@storybook/core-common": "7.0.0-alpha.49",
|
||||
"@storybook/preset-vue3-webpack": "7.0.0-alpha.49",
|
||||
"@storybook/vue3": "7.0.0-alpha.49",
|
||||
"@types/node": "^16.0.0",
|
||||
"react": "16.14.0",
|
||||
"react-dom": "16.14.0"
|
||||
@ -82,5 +82,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/web-components-vite",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Storybook for web-components and Vite: Develop Web Components in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -51,15 +51,15 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/addons": "7.0.0-alpha.48",
|
||||
"@storybook/builder-vite": "7.0.0-alpha.48",
|
||||
"@storybook/channel-postmessage": "7.0.0-alpha.48",
|
||||
"@storybook/channel-websocket": "7.0.0-alpha.48",
|
||||
"@storybook/client-api": "7.0.0-alpha.48",
|
||||
"@storybook/core-server": "7.0.0-alpha.48",
|
||||
"@storybook/node-logger": "7.0.0-alpha.48",
|
||||
"@storybook/preview-web": "7.0.0-alpha.48",
|
||||
"@storybook/web-components": "7.0.0-alpha.48",
|
||||
"@storybook/addons": "7.0.0-alpha.49",
|
||||
"@storybook/builder-vite": "7.0.0-alpha.49",
|
||||
"@storybook/channel-postmessage": "7.0.0-alpha.49",
|
||||
"@storybook/channel-websocket": "7.0.0-alpha.49",
|
||||
"@storybook/client-api": "7.0.0-alpha.49",
|
||||
"@storybook/core-server": "7.0.0-alpha.49",
|
||||
"@storybook/node-logger": "7.0.0-alpha.49",
|
||||
"@storybook/preview-web": "7.0.0-alpha.49",
|
||||
"@storybook/web-components": "7.0.0-alpha.49",
|
||||
"magic-string": "^0.26.1",
|
||||
"vite": "3"
|
||||
},
|
||||
@ -81,5 +81,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/web-components-webpack5",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Storybook for web-components: View web components snippets in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"lit-html",
|
||||
@ -53,10 +53,10 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/preset-env": "^7.12.11",
|
||||
"@storybook/builder-webpack5": "7.0.0-alpha.48",
|
||||
"@storybook/core-common": "7.0.0-alpha.48",
|
||||
"@storybook/preset-web-components-webpack": "7.0.0-alpha.48",
|
||||
"@storybook/web-components": "7.0.0-alpha.48",
|
||||
"@storybook/builder-webpack5": "7.0.0-alpha.49",
|
||||
"@storybook/core-common": "7.0.0-alpha.49",
|
||||
"@storybook/preset-web-components-webpack": "7.0.0-alpha.49",
|
||||
"@storybook/web-components": "7.0.0-alpha.49",
|
||||
"@types/node": "^16.0.0",
|
||||
"react": "16.14.0",
|
||||
"react-dom": "16.14.0"
|
||||
@ -81,5 +81,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -2,5 +2,5 @@
|
||||
"npmClient": "yarn",
|
||||
"useWorkspaces": true,
|
||||
"registry": "https://registry.npmjs.org",
|
||||
"version": "7.0.0-alpha.48"
|
||||
"version": "7.0.0-alpha.49"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addons",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Storybook addons store",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -42,13 +42,13 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/api": "7.0.0-alpha.48",
|
||||
"@storybook/channels": "7.0.0-alpha.48",
|
||||
"@storybook/client-logger": "7.0.0-alpha.48",
|
||||
"@storybook/core-events": "7.0.0-alpha.48",
|
||||
"@storybook/router": "7.0.0-alpha.48",
|
||||
"@storybook/theming": "7.0.0-alpha.48",
|
||||
"@storybook/types": "7.0.0-alpha.48",
|
||||
"@storybook/api": "7.0.0-alpha.49",
|
||||
"@storybook/channels": "7.0.0-alpha.49",
|
||||
"@storybook/client-logger": "7.0.0-alpha.49",
|
||||
"@storybook/core-events": "7.0.0-alpha.49",
|
||||
"@storybook/router": "7.0.0-alpha.49",
|
||||
"@storybook/theming": "7.0.0-alpha.49",
|
||||
"@storybook/types": "7.0.0-alpha.49",
|
||||
"global": "^4.4.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
@ -63,5 +63,5 @@
|
||||
"./src/index.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import global from 'global';
|
||||
import { logger } from '@storybook/client-logger';
|
||||
import type {
|
||||
Framework,
|
||||
Renderer,
|
||||
Args,
|
||||
DecoratorApplicator,
|
||||
DecoratorFunction,
|
||||
@ -32,7 +32,7 @@ interface Effect {
|
||||
|
||||
type AbstractFunction = (...args: any[]) => any;
|
||||
|
||||
export class HooksContext<TFramework extends Framework> {
|
||||
export class HooksContext<TRenderer extends Renderer> {
|
||||
hookListsMap: WeakMap<AbstractFunction, Hook[]>;
|
||||
|
||||
mountedDecorators: Set<AbstractFunction>;
|
||||
@ -53,7 +53,7 @@ export class HooksContext<TFramework extends Framework> {
|
||||
|
||||
hasUpdates: boolean;
|
||||
|
||||
currentContext: StoryContext<TFramework> | null;
|
||||
currentContext: StoryContext<TRenderer> | null;
|
||||
|
||||
renderListener = (storyId: StoryId) => {
|
||||
if (storyId !== this.currentContext.id) return;
|
||||
@ -126,15 +126,15 @@ export class HooksContext<TFramework extends Framework> {
|
||||
}
|
||||
}
|
||||
|
||||
function hookify<TFramework extends Framework>(
|
||||
storyFn: LegacyStoryFn<TFramework>
|
||||
): LegacyStoryFn<TFramework>;
|
||||
function hookify<TFramework extends Framework>(
|
||||
decorator: DecoratorFunction<TFramework>
|
||||
): DecoratorFunction<TFramework>;
|
||||
function hookify<TFramework extends Framework>(fn: AbstractFunction) {
|
||||
function hookify<TRenderer extends Renderer>(
|
||||
storyFn: LegacyStoryFn<TRenderer>
|
||||
): LegacyStoryFn<TRenderer>;
|
||||
function hookify<TRenderer extends Renderer>(
|
||||
decorator: DecoratorFunction<TRenderer>
|
||||
): DecoratorFunction<TRenderer>;
|
||||
function hookify<TRenderer extends Renderer>(fn: AbstractFunction) {
|
||||
return (...args: any[]) => {
|
||||
const { hooks }: { hooks: HooksContext<TFramework> } =
|
||||
const { hooks }: { hooks: HooksContext<TRenderer> } =
|
||||
typeof args[0] === 'function' ? args[1] : args[0];
|
||||
|
||||
const prevPhase = hooks.currentPhase;
|
||||
@ -177,16 +177,16 @@ function hookify<TFramework extends Framework>(fn: AbstractFunction) {
|
||||
let numberOfRenders = 0;
|
||||
const RENDER_LIMIT = 25;
|
||||
export const applyHooks =
|
||||
<TFramework extends Framework>(
|
||||
applyDecorators: DecoratorApplicator<TFramework>
|
||||
): DecoratorApplicator<TFramework> =>
|
||||
(storyFn: LegacyStoryFn<TFramework>, decorators: DecoratorFunction<TFramework>[]) => {
|
||||
<TRenderer extends Renderer>(
|
||||
applyDecorators: DecoratorApplicator<TRenderer>
|
||||
): DecoratorApplicator<TRenderer> =>
|
||||
(storyFn: LegacyStoryFn<TRenderer>, decorators: DecoratorFunction<TRenderer>[]) => {
|
||||
const decorated = applyDecorators(
|
||||
hookify(storyFn),
|
||||
decorators.map((decorator) => hookify(decorator))
|
||||
);
|
||||
return (context) => {
|
||||
const { hooks } = context as { hooks: HooksContext<TFramework> };
|
||||
const { hooks } = context as { hooks: HooksContext<TRenderer> };
|
||||
hooks.prevMountedDecorators = hooks.mountedDecorators;
|
||||
hooks.mountedDecorators = new Set([storyFn, ...decorators]);
|
||||
hooks.currentContext = context;
|
||||
@ -215,12 +215,12 @@ const areDepsEqual = (deps: any[], nextDeps: any[]) =>
|
||||
const invalidHooksError = () =>
|
||||
new Error('Storybook preview hooks can only be called inside decorators and story functions.');
|
||||
|
||||
function getHooksContextOrNull<TFramework extends Framework>(): HooksContext<TFramework> | null {
|
||||
function getHooksContextOrNull<TRenderer extends Renderer>(): HooksContext<TRenderer> | null {
|
||||
return global.STORYBOOK_HOOKS_CONTEXT || null;
|
||||
}
|
||||
|
||||
function getHooksContextOrThrow<TFramework extends Framework>(): HooksContext<TFramework> {
|
||||
const hooks = getHooksContextOrNull<TFramework>();
|
||||
function getHooksContextOrThrow<TRenderer extends Renderer>(): HooksContext<TRenderer> {
|
||||
const hooks = getHooksContextOrNull<TRenderer>();
|
||||
if (hooks == null) {
|
||||
throw invalidHooksError();
|
||||
}
|
||||
@ -404,7 +404,7 @@ export function useChannel(eventMap: EventMap, deps: any[] = []) {
|
||||
}
|
||||
|
||||
/* Returns current story context */
|
||||
export function useStoryContext<TFramework extends Framework>(): StoryContext<TFramework> {
|
||||
export function useStoryContext<TRenderer extends Renderer>(): StoryContext<TRenderer> {
|
||||
const { currentContext } = getHooksContextOrThrow();
|
||||
if (currentContext == null) {
|
||||
throw invalidHooksError();
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/api",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Core Storybook API & Context",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -40,13 +40,13 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/channels": "7.0.0-alpha.48",
|
||||
"@storybook/client-logger": "7.0.0-alpha.48",
|
||||
"@storybook/core-events": "7.0.0-alpha.48",
|
||||
"@storybook/csf": "next",
|
||||
"@storybook/router": "7.0.0-alpha.48",
|
||||
"@storybook/theming": "7.0.0-alpha.48",
|
||||
"@storybook/types": "7.0.0-alpha.48",
|
||||
"@storybook/channels": "7.0.0-alpha.49",
|
||||
"@storybook/client-logger": "7.0.0-alpha.49",
|
||||
"@storybook/core-events": "7.0.0-alpha.49",
|
||||
"@storybook/csf": "0.0.2-next.5",
|
||||
"@storybook/router": "7.0.0-alpha.49",
|
||||
"@storybook/theming": "7.0.0-alpha.49",
|
||||
"@storybook/types": "7.0.0-alpha.49",
|
||||
"dequal": "^2.0.2",
|
||||
"global": "^4.4.0",
|
||||
"lodash": "^4.17.21",
|
||||
@ -59,7 +59,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "^26.6.2",
|
||||
"@storybook/core-common": "7.0.0-alpha.48",
|
||||
"@storybook/core-common": "7.0.0-alpha.49",
|
||||
"@types/lodash": "^4.14.167",
|
||||
"@types/qs": "^6",
|
||||
"flush-promises": "^1.0.2",
|
||||
@ -78,5 +78,5 @@
|
||||
"./src/index.tsx"
|
||||
]
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
export const version = '7.0.0-alpha.48';
|
||||
export const version = '7.0.0-alpha.49';
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/builder-manager",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Storybook manager builder",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -42,9 +42,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@fal-works/esbuild-plugin-global-externals": "^2.1.2",
|
||||
"@storybook/core-common": "7.0.0-alpha.48",
|
||||
"@storybook/manager": "7.0.0-alpha.48",
|
||||
"@storybook/node-logger": "7.0.0-alpha.48",
|
||||
"@storybook/core-common": "7.0.0-alpha.49",
|
||||
"@storybook/manager": "7.0.0-alpha.49",
|
||||
"@storybook/node-logger": "7.0.0-alpha.49",
|
||||
"@types/ejs": "^3.1.1",
|
||||
"@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.10",
|
||||
"browser-assert": "^1.2.1",
|
||||
@ -69,5 +69,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/builder-vite",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "A plugin to run and build Storybooks with Vite",
|
||||
"homepage": "https://github.com/storybookjs/storybook/tree/main/code/lib/builder-vite/#readme",
|
||||
"repository": {
|
||||
@ -19,15 +19,15 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@joshwooding/vite-plugin-react-docgen-typescript": "0.0.5",
|
||||
"@storybook/client-api": "7.0.0-alpha.48",
|
||||
"@storybook/client-logger": "7.0.0-alpha.48",
|
||||
"@storybook/core-common": "7.0.0-alpha.48",
|
||||
"@storybook/client-api": "7.0.0-alpha.49",
|
||||
"@storybook/client-logger": "7.0.0-alpha.49",
|
||||
"@storybook/core-common": "7.0.0-alpha.49",
|
||||
"@storybook/mdx2-csf": "next",
|
||||
"@storybook/node-logger": "7.0.0-alpha.48",
|
||||
"@storybook/preview": "7.0.0-alpha.48",
|
||||
"@storybook/preview-web": "7.0.0-alpha.48",
|
||||
"@storybook/source-loader": "7.0.0-alpha.48",
|
||||
"@storybook/types": "7.0.0-alpha.48",
|
||||
"@storybook/node-logger": "7.0.0-alpha.49",
|
||||
"@storybook/preview": "7.0.0-alpha.49",
|
||||
"@storybook/preview-web": "7.0.0-alpha.49",
|
||||
"@storybook/source-loader": "7.0.0-alpha.49",
|
||||
"@storybook/types": "7.0.0-alpha.49",
|
||||
"@vitejs/plugin-react": "^2.0.0",
|
||||
"browser-assert": "^1.2.1",
|
||||
"es-module-lexer": "^0.9.3",
|
||||
@ -48,5 +48,5 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/builder-webpack5",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Storybook framework-agnostic API",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -54,23 +54,23 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.12.10",
|
||||
"@storybook/addons": "7.0.0-alpha.48",
|
||||
"@storybook/api": "7.0.0-alpha.48",
|
||||
"@storybook/channel-postmessage": "7.0.0-alpha.48",
|
||||
"@storybook/channel-websocket": "7.0.0-alpha.48",
|
||||
"@storybook/channels": "7.0.0-alpha.48",
|
||||
"@storybook/client-api": "7.0.0-alpha.48",
|
||||
"@storybook/client-logger": "7.0.0-alpha.48",
|
||||
"@storybook/components": "7.0.0-alpha.48",
|
||||
"@storybook/core-common": "7.0.0-alpha.48",
|
||||
"@storybook/core-events": "7.0.0-alpha.48",
|
||||
"@storybook/core-webpack": "7.0.0-alpha.48",
|
||||
"@storybook/node-logger": "7.0.0-alpha.48",
|
||||
"@storybook/preview": "7.0.0-alpha.48",
|
||||
"@storybook/preview-web": "7.0.0-alpha.48",
|
||||
"@storybook/router": "7.0.0-alpha.48",
|
||||
"@storybook/store": "7.0.0-alpha.48",
|
||||
"@storybook/theming": "7.0.0-alpha.48",
|
||||
"@storybook/addons": "7.0.0-alpha.49",
|
||||
"@storybook/api": "7.0.0-alpha.49",
|
||||
"@storybook/channel-postmessage": "7.0.0-alpha.49",
|
||||
"@storybook/channel-websocket": "7.0.0-alpha.49",
|
||||
"@storybook/channels": "7.0.0-alpha.49",
|
||||
"@storybook/client-api": "7.0.0-alpha.49",
|
||||
"@storybook/client-logger": "7.0.0-alpha.49",
|
||||
"@storybook/components": "7.0.0-alpha.49",
|
||||
"@storybook/core-common": "7.0.0-alpha.49",
|
||||
"@storybook/core-events": "7.0.0-alpha.49",
|
||||
"@storybook/core-webpack": "7.0.0-alpha.49",
|
||||
"@storybook/node-logger": "7.0.0-alpha.49",
|
||||
"@storybook/preview": "7.0.0-alpha.49",
|
||||
"@storybook/preview-web": "7.0.0-alpha.49",
|
||||
"@storybook/router": "7.0.0-alpha.49",
|
||||
"@storybook/store": "7.0.0-alpha.49",
|
||||
"@storybook/theming": "7.0.0-alpha.49",
|
||||
"@types/node": "^16.0.0",
|
||||
"@types/semver": "^7.3.4",
|
||||
"babel-loader": "^8.2.5",
|
||||
@ -124,5 +124,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/channel-postmessage",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -42,9 +42,9 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/channels": "7.0.0-alpha.48",
|
||||
"@storybook/client-logger": "7.0.0-alpha.48",
|
||||
"@storybook/core-events": "7.0.0-alpha.48",
|
||||
"@storybook/channels": "7.0.0-alpha.49",
|
||||
"@storybook/client-logger": "7.0.0-alpha.49",
|
||||
"@storybook/core-events": "7.0.0-alpha.49",
|
||||
"global": "^4.4.0",
|
||||
"qs": "^6.10.0",
|
||||
"telejson": "^6.0.8"
|
||||
@ -60,5 +60,5 @@
|
||||
"./src/index.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/channel-websocket",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -34,8 +34,8 @@
|
||||
"prep": "node ../../../scripts/prepare.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/channels": "7.0.0-alpha.48",
|
||||
"@storybook/client-logger": "7.0.0-alpha.48",
|
||||
"@storybook/channels": "7.0.0-alpha.49",
|
||||
"@storybook/client-logger": "7.0.0-alpha.49",
|
||||
"global": "^4.4.0",
|
||||
"telejson": "^6.0.8"
|
||||
},
|
||||
@ -45,5 +45,5 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/channels",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -52,5 +52,5 @@
|
||||
"./src/index.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sb",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Storybook CLI",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -24,7 +24,7 @@
|
||||
"prep": "node ../../../scripts/prepare.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/cli": "7.0.0-alpha.48"
|
||||
"@storybook/cli": "7.0.0-alpha.49"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "~4.6.3"
|
||||
@ -32,5 +32,5 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "storybook",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Storybook CLI",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -27,7 +27,7 @@
|
||||
"prep": "node ../../../scripts/prepare.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/cli": "7.0.0-alpha.48"
|
||||
"@storybook/cli": "7.0.0-alpha.49"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "~4.6.3"
|
||||
@ -35,5 +35,5 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/cli",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Storybook's CLI - easiest method of adding storybook to your projects",
|
||||
"keywords": [
|
||||
"cli",
|
||||
@ -43,13 +43,13 @@
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.12.10",
|
||||
"@babel/preset-env": "^7.12.11",
|
||||
"@storybook/codemod": "7.0.0-alpha.48",
|
||||
"@storybook/core-common": "7.0.0-alpha.48",
|
||||
"@storybook/core-server": "7.0.0-alpha.48",
|
||||
"@storybook/csf-tools": "7.0.0-alpha.48",
|
||||
"@storybook/node-logger": "7.0.0-alpha.48",
|
||||
"@storybook/telemetry": "7.0.0-alpha.48",
|
||||
"@storybook/types": "7.0.0-alpha.48",
|
||||
"@storybook/codemod": "7.0.0-alpha.49",
|
||||
"@storybook/core-common": "7.0.0-alpha.49",
|
||||
"@storybook/core-server": "7.0.0-alpha.49",
|
||||
"@storybook/csf-tools": "7.0.0-alpha.49",
|
||||
"@storybook/node-logger": "7.0.0-alpha.49",
|
||||
"@storybook/telemetry": "7.0.0-alpha.49",
|
||||
"@storybook/types": "7.0.0-alpha.49",
|
||||
"@types/semver": "^7.3.4",
|
||||
"boxen": "^5.1.2",
|
||||
"chalk": "^4.1.0",
|
||||
@ -77,7 +77,7 @@
|
||||
"util-deprecate": "^1.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@storybook/client-api": "7.0.0-alpha.48",
|
||||
"@storybook/client-api": "7.0.0-alpha.49",
|
||||
"@types/cross-spawn": "^6.0.2",
|
||||
"@types/degit": "^2.8.3",
|
||||
"@types/prompts": "^2.0.9",
|
||||
@ -99,5 +99,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,85 +1,85 @@
|
||||
// auto generated file, do not edit
|
||||
export default {
|
||||
'@storybook/addon-a11y': '7.0.0-alpha.48',
|
||||
'@storybook/addon-actions': '7.0.0-alpha.48',
|
||||
'@storybook/addon-backgrounds': '7.0.0-alpha.48',
|
||||
'@storybook/addon-controls': '7.0.0-alpha.48',
|
||||
'@storybook/addon-docs': '7.0.0-alpha.48',
|
||||
'@storybook/addon-essentials': '7.0.0-alpha.48',
|
||||
'@storybook/addon-highlight': '7.0.0-alpha.48',
|
||||
'@storybook/addon-interactions': '7.0.0-alpha.48',
|
||||
'@storybook/addon-jest': '7.0.0-alpha.48',
|
||||
'@storybook/addon-links': '7.0.0-alpha.48',
|
||||
'@storybook/addon-measure': '7.0.0-alpha.48',
|
||||
'@storybook/addon-outline': '7.0.0-alpha.48',
|
||||
'@storybook/addon-storyshots': '7.0.0-alpha.48',
|
||||
'@storybook/addon-storyshots-puppeteer': '7.0.0-alpha.48',
|
||||
'@storybook/addon-storysource': '7.0.0-alpha.48',
|
||||
'@storybook/addon-toolbars': '7.0.0-alpha.48',
|
||||
'@storybook/addon-viewport': '7.0.0-alpha.48',
|
||||
'@storybook/addons': '7.0.0-alpha.48',
|
||||
'@storybook/angular': '7.0.0-alpha.48',
|
||||
'@storybook/api': '7.0.0-alpha.48',
|
||||
'@storybook/blocks': '7.0.0-alpha.48',
|
||||
'@storybook/builder-manager': '7.0.0-alpha.48',
|
||||
'@storybook/builder-vite': '7.0.0-alpha.48',
|
||||
'@storybook/builder-webpack5': '7.0.0-alpha.48',
|
||||
'@storybook/channel-postmessage': '7.0.0-alpha.48',
|
||||
'@storybook/channel-websocket': '7.0.0-alpha.48',
|
||||
'@storybook/channels': '7.0.0-alpha.48',
|
||||
'@storybook/cli': '7.0.0-alpha.48',
|
||||
'@storybook/client-api': '7.0.0-alpha.48',
|
||||
'@storybook/client-logger': '7.0.0-alpha.48',
|
||||
'@storybook/codemod': '7.0.0-alpha.48',
|
||||
'@storybook/components': '7.0.0-alpha.48',
|
||||
'@storybook/core-client': '7.0.0-alpha.48',
|
||||
'@storybook/core-common': '7.0.0-alpha.48',
|
||||
'@storybook/core-events': '7.0.0-alpha.48',
|
||||
'@storybook/core-server': '7.0.0-alpha.48',
|
||||
'@storybook/core-webpack': '7.0.0-alpha.48',
|
||||
'@storybook/csf-tools': '7.0.0-alpha.48',
|
||||
'@storybook/docs-tools': '7.0.0-alpha.48',
|
||||
'@storybook/ember': '7.0.0-alpha.48',
|
||||
'@storybook/html': '7.0.0-alpha.48',
|
||||
'@storybook/html-webpack5': '7.0.0-alpha.48',
|
||||
'@storybook/instrumenter': '7.0.0-alpha.48',
|
||||
'@storybook/nextjs': '7.0.0-alpha.48',
|
||||
'@storybook/node-logger': '7.0.0-alpha.48',
|
||||
'@storybook/postinstall': '7.0.0-alpha.48',
|
||||
'@storybook/preact': '7.0.0-alpha.48',
|
||||
'@storybook/preact-webpack5': '7.0.0-alpha.48',
|
||||
'@storybook/preset-html-webpack': '7.0.0-alpha.48',
|
||||
'@storybook/preset-preact-webpack': '7.0.0-alpha.48',
|
||||
'@storybook/preset-react-webpack': '7.0.0-alpha.48',
|
||||
'@storybook/preset-server-webpack': '7.0.0-alpha.48',
|
||||
'@storybook/preset-svelte-webpack': '7.0.0-alpha.48',
|
||||
'@storybook/preset-vue-webpack': '7.0.0-alpha.48',
|
||||
'@storybook/preset-vue3-webpack': '7.0.0-alpha.48',
|
||||
'@storybook/preset-web-components-webpack': '7.0.0-alpha.48',
|
||||
'@storybook/preview-web': '7.0.0-alpha.48',
|
||||
'@storybook/react': '7.0.0-alpha.48',
|
||||
'@storybook/react-vite': '7.0.0-alpha.48',
|
||||
'@storybook/react-webpack5': '7.0.0-alpha.48',
|
||||
'@storybook/router': '7.0.0-alpha.48',
|
||||
'@storybook/server': '7.0.0-alpha.48',
|
||||
'@storybook/server-webpack5': '7.0.0-alpha.48',
|
||||
'@storybook/source-loader': '7.0.0-alpha.48',
|
||||
'@storybook/store': '7.0.0-alpha.48',
|
||||
'@storybook/svelte': '7.0.0-alpha.48',
|
||||
'@storybook/svelte-vite': '7.0.0-alpha.48',
|
||||
'@storybook/svelte-webpack5': '7.0.0-alpha.48',
|
||||
'@storybook/telemetry': '7.0.0-alpha.48',
|
||||
'@storybook/theming': '7.0.0-alpha.48',
|
||||
'@storybook/manager': '7.0.0-alpha.48',
|
||||
'@storybook/vue': '7.0.0-alpha.48',
|
||||
'@storybook/vue-vite': '7.0.0-alpha.48',
|
||||
'@storybook/vue-webpack5': '7.0.0-alpha.48',
|
||||
'@storybook/vue3': '7.0.0-alpha.48',
|
||||
'@storybook/vue3-vite': '7.0.0-alpha.48',
|
||||
'@storybook/vue3-webpack5': '7.0.0-alpha.48',
|
||||
'@storybook/web-components': '7.0.0-alpha.48',
|
||||
'@storybook/web-components-webpack5': '7.0.0-alpha.48',
|
||||
'@storybook/web-components-vite': '7.0.0-alpha.48',
|
||||
sb: '7.0.0-alpha.48',
|
||||
storybook: '7.0.0-alpha.48',
|
||||
'@storybook/addon-a11y': '7.0.0-alpha.49',
|
||||
'@storybook/addon-actions': '7.0.0-alpha.49',
|
||||
'@storybook/addon-backgrounds': '7.0.0-alpha.49',
|
||||
'@storybook/addon-controls': '7.0.0-alpha.49',
|
||||
'@storybook/addon-docs': '7.0.0-alpha.49',
|
||||
'@storybook/addon-essentials': '7.0.0-alpha.49',
|
||||
'@storybook/addon-highlight': '7.0.0-alpha.49',
|
||||
'@storybook/addon-interactions': '7.0.0-alpha.49',
|
||||
'@storybook/addon-jest': '7.0.0-alpha.49',
|
||||
'@storybook/addon-links': '7.0.0-alpha.49',
|
||||
'@storybook/addon-measure': '7.0.0-alpha.49',
|
||||
'@storybook/addon-outline': '7.0.0-alpha.49',
|
||||
'@storybook/addon-storyshots': '7.0.0-alpha.49',
|
||||
'@storybook/addon-storyshots-puppeteer': '7.0.0-alpha.49',
|
||||
'@storybook/addon-storysource': '7.0.0-alpha.49',
|
||||
'@storybook/addon-toolbars': '7.0.0-alpha.49',
|
||||
'@storybook/addon-viewport': '7.0.0-alpha.49',
|
||||
'@storybook/addons': '7.0.0-alpha.49',
|
||||
'@storybook/angular': '7.0.0-alpha.49',
|
||||
'@storybook/api': '7.0.0-alpha.49',
|
||||
'@storybook/blocks': '7.0.0-alpha.49',
|
||||
'@storybook/builder-manager': '7.0.0-alpha.49',
|
||||
'@storybook/builder-vite': '7.0.0-alpha.49',
|
||||
'@storybook/builder-webpack5': '7.0.0-alpha.49',
|
||||
'@storybook/channel-postmessage': '7.0.0-alpha.49',
|
||||
'@storybook/channel-websocket': '7.0.0-alpha.49',
|
||||
'@storybook/channels': '7.0.0-alpha.49',
|
||||
'@storybook/cli': '7.0.0-alpha.49',
|
||||
'@storybook/client-api': '7.0.0-alpha.49',
|
||||
'@storybook/client-logger': '7.0.0-alpha.49',
|
||||
'@storybook/codemod': '7.0.0-alpha.49',
|
||||
'@storybook/components': '7.0.0-alpha.49',
|
||||
'@storybook/core-client': '7.0.0-alpha.49',
|
||||
'@storybook/core-common': '7.0.0-alpha.49',
|
||||
'@storybook/core-events': '7.0.0-alpha.49',
|
||||
'@storybook/core-server': '7.0.0-alpha.49',
|
||||
'@storybook/core-webpack': '7.0.0-alpha.49',
|
||||
'@storybook/csf-tools': '7.0.0-alpha.49',
|
||||
'@storybook/docs-tools': '7.0.0-alpha.49',
|
||||
'@storybook/ember': '7.0.0-alpha.49',
|
||||
'@storybook/html': '7.0.0-alpha.49',
|
||||
'@storybook/html-webpack5': '7.0.0-alpha.49',
|
||||
'@storybook/instrumenter': '7.0.0-alpha.49',
|
||||
'@storybook/nextjs': '7.0.0-alpha.49',
|
||||
'@storybook/node-logger': '7.0.0-alpha.49',
|
||||
'@storybook/postinstall': '7.0.0-alpha.49',
|
||||
'@storybook/preact': '7.0.0-alpha.49',
|
||||
'@storybook/preact-webpack5': '7.0.0-alpha.49',
|
||||
'@storybook/preset-html-webpack': '7.0.0-alpha.49',
|
||||
'@storybook/preset-preact-webpack': '7.0.0-alpha.49',
|
||||
'@storybook/preset-react-webpack': '7.0.0-alpha.49',
|
||||
'@storybook/preset-server-webpack': '7.0.0-alpha.49',
|
||||
'@storybook/preset-svelte-webpack': '7.0.0-alpha.49',
|
||||
'@storybook/preset-vue-webpack': '7.0.0-alpha.49',
|
||||
'@storybook/preset-vue3-webpack': '7.0.0-alpha.49',
|
||||
'@storybook/preset-web-components-webpack': '7.0.0-alpha.49',
|
||||
'@storybook/preview-web': '7.0.0-alpha.49',
|
||||
'@storybook/react': '7.0.0-alpha.49',
|
||||
'@storybook/react-vite': '7.0.0-alpha.49',
|
||||
'@storybook/react-webpack5': '7.0.0-alpha.49',
|
||||
'@storybook/router': '7.0.0-alpha.49',
|
||||
'@storybook/server': '7.0.0-alpha.49',
|
||||
'@storybook/server-webpack5': '7.0.0-alpha.49',
|
||||
'@storybook/source-loader': '7.0.0-alpha.49',
|
||||
'@storybook/store': '7.0.0-alpha.49',
|
||||
'@storybook/svelte': '7.0.0-alpha.49',
|
||||
'@storybook/svelte-vite': '7.0.0-alpha.49',
|
||||
'@storybook/svelte-webpack5': '7.0.0-alpha.49',
|
||||
'@storybook/telemetry': '7.0.0-alpha.49',
|
||||
'@storybook/theming': '7.0.0-alpha.49',
|
||||
'@storybook/manager': '7.0.0-alpha.49',
|
||||
'@storybook/vue': '7.0.0-alpha.49',
|
||||
'@storybook/vue-vite': '7.0.0-alpha.49',
|
||||
'@storybook/vue-webpack5': '7.0.0-alpha.49',
|
||||
'@storybook/vue3': '7.0.0-alpha.49',
|
||||
'@storybook/vue3-vite': '7.0.0-alpha.49',
|
||||
'@storybook/vue3-webpack5': '7.0.0-alpha.49',
|
||||
'@storybook/web-components': '7.0.0-alpha.49',
|
||||
'@storybook/web-components-webpack5': '7.0.0-alpha.49',
|
||||
'@storybook/web-components-vite': '7.0.0-alpha.49',
|
||||
sb: '7.0.0-alpha.49',
|
||||
storybook: '7.0.0-alpha.49',
|
||||
};
|
||||
|
4
code/lib/cli/src/window.d.ts
vendored
4
code/lib/cli/src/window.d.ts
vendored
@ -1,8 +1,8 @@
|
||||
import type { Framework } from '@storybook/types';
|
||||
import type { Renderer } from '@storybook/types';
|
||||
import type { StoryStore } from '@storybook/client-api';
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
__STORYBOOK_STORY_STORE__: StoryStore<Framework>;
|
||||
__STORYBOOK_STORY_STORE__: StoryStore<Renderer>;
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/client-api",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Storybook Client API",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -42,11 +42,11 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/addons": "7.0.0-alpha.48",
|
||||
"@storybook/client-logger": "7.0.0-alpha.48",
|
||||
"@storybook/csf": "next",
|
||||
"@storybook/store": "7.0.0-alpha.48",
|
||||
"@storybook/types": "7.0.0-alpha.48",
|
||||
"@storybook/addons": "7.0.0-alpha.49",
|
||||
"@storybook/client-logger": "7.0.0-alpha.49",
|
||||
"@storybook/csf": "0.0.2-next.5",
|
||||
"@storybook/store": "7.0.0-alpha.49",
|
||||
"@storybook/types": "7.0.0-alpha.49",
|
||||
"@types/qs": "^6.9.5",
|
||||
"@types/webpack-env": "^1.16.4",
|
||||
"global": "^4.4.0",
|
||||
@ -56,7 +56,7 @@
|
||||
"util-deprecate": "^1.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@storybook/core-common": "7.0.0-alpha.48",
|
||||
"@storybook/core-common": "7.0.0-alpha.49",
|
||||
"typescript": "~4.6.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
@ -71,5 +71,5 @@
|
||||
"./src/index.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import type {
|
||||
Args,
|
||||
StepRunner,
|
||||
ArgTypes,
|
||||
Framework,
|
||||
Renderer,
|
||||
DecoratorFunction,
|
||||
Parameters,
|
||||
ArgTypesEnhancer,
|
||||
@ -31,7 +31,7 @@ import { StoryStoreFacade } from './StoryStoreFacade';
|
||||
|
||||
// ClientApi (and StoreStore) are really singletons. However they are not created until the
|
||||
// relevant framework instanciates them via `start.js`. The good news is this happens right away.
|
||||
let singleton: ClientApi<Framework>;
|
||||
let singleton: ClientApi<Renderer>;
|
||||
|
||||
const warningAlternatives = {
|
||||
addDecorator: `Instead, use \`export const decorators = [];\` in your \`preview.js\`.`,
|
||||
@ -60,7 +60,7 @@ const checkMethod = (method: keyof typeof warningAlternatives) => {
|
||||
}
|
||||
};
|
||||
|
||||
export const addDecorator = (decorator: DecoratorFunction<Framework>) => {
|
||||
export const addDecorator = (decorator: DecoratorFunction<Renderer>) => {
|
||||
checkMethod('addDecorator');
|
||||
singleton.addDecorator(decorator);
|
||||
};
|
||||
@ -70,7 +70,7 @@ export const addParameters = (parameters: Parameters) => {
|
||||
singleton.addParameters(parameters);
|
||||
};
|
||||
|
||||
export const addLoader = (loader: LoaderFunction<Framework>) => {
|
||||
export const addLoader = (loader: LoaderFunction<Renderer>) => {
|
||||
checkMethod('addLoader');
|
||||
singleton.addLoader(loader);
|
||||
};
|
||||
@ -85,12 +85,12 @@ export const addArgTypes = (argTypes: ArgTypes) => {
|
||||
singleton.addArgTypes(argTypes);
|
||||
};
|
||||
|
||||
export const addArgsEnhancer = (enhancer: ArgsEnhancer<Framework>) => {
|
||||
export const addArgsEnhancer = (enhancer: ArgsEnhancer<Renderer>) => {
|
||||
checkMethod('addArgsEnhancer');
|
||||
singleton.addArgsEnhancer(enhancer);
|
||||
};
|
||||
|
||||
export const addArgTypesEnhancer = (enhancer: ArgTypesEnhancer<Framework>) => {
|
||||
export const addArgTypesEnhancer = (enhancer: ArgTypesEnhancer<Renderer>) => {
|
||||
checkMethod('addArgTypesEnhancer');
|
||||
singleton.addArgTypesEnhancer(enhancer);
|
||||
};
|
||||
@ -105,18 +105,18 @@ export const getGlobalRender = () => {
|
||||
return singleton.facade.projectAnnotations.render;
|
||||
};
|
||||
|
||||
export const setGlobalRender = (render: StoryFn<Framework>) => {
|
||||
export const setGlobalRender = (render: StoryFn<Renderer>) => {
|
||||
checkMethod('setGlobalRender');
|
||||
singleton.facade.projectAnnotations.render = render;
|
||||
};
|
||||
|
||||
const invalidStoryTypes = new Set(['string', 'number', 'boolean', 'symbol']);
|
||||
export class ClientApi<TFramework extends Framework> {
|
||||
facade: StoryStoreFacade<TFramework>;
|
||||
export class ClientApi<TRenderer extends Renderer> {
|
||||
facade: StoryStoreFacade<TRenderer>;
|
||||
|
||||
storyStore?: StoryStore<TFramework>;
|
||||
storyStore?: StoryStore<TRenderer>;
|
||||
|
||||
private addons: Addon_ClientApiAddons<TFramework['storyResult']>;
|
||||
private addons: Addon_ClientApiAddons<TRenderer['storyResult']>;
|
||||
|
||||
onImportFnChanged?: ({ importFn }: { importFn: Store_ModuleImportFn }) => void;
|
||||
|
||||
@ -124,7 +124,7 @@ export class ClientApi<TFramework extends Framework> {
|
||||
// just use numeric indexes
|
||||
private lastFileName = 0;
|
||||
|
||||
constructor({ storyStore }: { storyStore?: StoryStore<TFramework> } = {}) {
|
||||
constructor({ storyStore }: { storyStore?: StoryStore<TRenderer> } = {}) {
|
||||
this.facade = new StoryStoreFacade();
|
||||
|
||||
this.addons = {};
|
||||
@ -146,7 +146,7 @@ export class ClientApi<TFramework extends Framework> {
|
||||
return this.facade.getStoryIndex(this.storyStore);
|
||||
}
|
||||
|
||||
addDecorator = (decorator: DecoratorFunction<TFramework>) => {
|
||||
addDecorator = (decorator: DecoratorFunction<TRenderer>) => {
|
||||
this.facade.projectAnnotations.decorators.push(decorator);
|
||||
};
|
||||
|
||||
@ -179,7 +179,7 @@ export class ClientApi<TFramework extends Framework> {
|
||||
);
|
||||
};
|
||||
|
||||
addLoader = (loader: LoaderFunction<TFramework>) => {
|
||||
addLoader = (loader: LoaderFunction<TRenderer>) => {
|
||||
this.facade.projectAnnotations.loaders.push(loader);
|
||||
};
|
||||
|
||||
@ -197,11 +197,11 @@ export class ClientApi<TFramework extends Framework> {
|
||||
};
|
||||
};
|
||||
|
||||
addArgsEnhancer = (enhancer: ArgsEnhancer<TFramework>) => {
|
||||
addArgsEnhancer = (enhancer: ArgsEnhancer<TRenderer>) => {
|
||||
this.facade.projectAnnotations.argsEnhancers.push(enhancer);
|
||||
};
|
||||
|
||||
addArgTypesEnhancer = (enhancer: ArgTypesEnhancer<TFramework>) => {
|
||||
addArgTypesEnhancer = (enhancer: ArgTypesEnhancer<TRenderer>) => {
|
||||
this.facade.projectAnnotations.argTypesEnhancers.push(enhancer);
|
||||
};
|
||||
|
||||
@ -219,7 +219,7 @@ export class ClientApi<TFramework extends Framework> {
|
||||
}
|
||||
|
||||
// what are the occasions that "m" is a boolean vs an obj
|
||||
storiesOf = (kind: string, m?: NodeModule): Addon_StoryApi<TFramework['storyResult']> => {
|
||||
storiesOf = (kind: string, m?: NodeModule): Addon_StoryApi<TRenderer['storyResult']> => {
|
||||
if (!kind && typeof kind !== 'string') {
|
||||
throw new Error('Invalid or missing kind provided for stories, should be a string');
|
||||
}
|
||||
@ -275,7 +275,7 @@ export class ClientApi<TFramework extends Framework> {
|
||||
}
|
||||
|
||||
let hasAdded = false;
|
||||
const api: Addon_StoryApi<TFramework['storyResult']> = {
|
||||
const api: Addon_StoryApi<TRenderer['storyResult']> = {
|
||||
kind: kind.toString(),
|
||||
add: () => api,
|
||||
addDecorator: () => api,
|
||||
@ -292,7 +292,7 @@ export class ClientApi<TFramework extends Framework> {
|
||||
};
|
||||
});
|
||||
|
||||
const meta: Store_NormalizedComponentAnnotations<TFramework> = {
|
||||
const meta: Store_NormalizedComponentAnnotations<TRenderer> = {
|
||||
id: sanitize(kind),
|
||||
title: kind,
|
||||
decorators: [],
|
||||
@ -304,7 +304,7 @@ export class ClientApi<TFramework extends Framework> {
|
||||
this._addedExports[fileName] = { default: meta };
|
||||
|
||||
let counter = 0;
|
||||
api.add = (storyName: string, storyFn: StoryFn<TFramework>, parameters: Parameters = {}) => {
|
||||
api.add = (storyName: string, storyFn: StoryFn<TRenderer>, parameters: Parameters = {}) => {
|
||||
hasAdded = true;
|
||||
|
||||
if (typeof storyName !== 'string') {
|
||||
@ -340,7 +340,7 @@ export class ClientApi<TFramework extends Framework> {
|
||||
return api;
|
||||
};
|
||||
|
||||
api.addDecorator = (decorator: DecoratorFunction<TFramework>) => {
|
||||
api.addDecorator = (decorator: DecoratorFunction<TRenderer>) => {
|
||||
if (hasAdded)
|
||||
throw new Error(`You cannot add a decorator after the first story for a kind.
|
||||
Read more here: https://github.com/storybookjs/storybook/blob/master/MIGRATION.md#can-no-longer-add-decoratorsparameters-after-stories`);
|
||||
@ -349,7 +349,7 @@ Read more here: https://github.com/storybookjs/storybook/blob/master/MIGRATION.m
|
||||
return api;
|
||||
};
|
||||
|
||||
api.addLoader = (loader: LoaderFunction<TFramework>) => {
|
||||
api.addLoader = (loader: LoaderFunction<TRenderer>) => {
|
||||
if (hasAdded) throw new Error(`You cannot add a loader after the first story for a kind.`);
|
||||
|
||||
meta.loaders.push(loader);
|
||||
|
@ -5,7 +5,7 @@ import { SynchronousPromise } from 'synchronous-promise';
|
||||
import { toId, isExportStory, storyNameFromExport } from '@storybook/csf';
|
||||
import type {
|
||||
Addon_IndexEntry,
|
||||
Framework,
|
||||
Renderer,
|
||||
ComponentId,
|
||||
DocsOptions,
|
||||
Parameters,
|
||||
@ -21,8 +21,8 @@ import type { StoryStore } from '@storybook/store';
|
||||
import { userOrAutoTitle, sortStoriesV6 } from '@storybook/store';
|
||||
import { logger } from '@storybook/client-logger';
|
||||
|
||||
export class StoryStoreFacade<TFramework extends Framework> {
|
||||
projectAnnotations: Store_NormalizedProjectAnnotations<TFramework>;
|
||||
export class StoryStoreFacade<TRenderer extends Renderer> {
|
||||
projectAnnotations: Store_NormalizedProjectAnnotations<TRenderer>;
|
||||
|
||||
entries: Record<StoryId, Addon_IndexEntry & { componentId?: ComponentId }>;
|
||||
|
||||
@ -54,22 +54,22 @@ export class StoryStoreFacade<TFramework extends Framework> {
|
||||
});
|
||||
}
|
||||
|
||||
getStoryIndex(store: StoryStore<TFramework>) {
|
||||
getStoryIndex(store: StoryStore<TRenderer>) {
|
||||
const fileNameOrder = Object.keys(this.csfExports);
|
||||
const storySortParameter = this.projectAnnotations.parameters?.options?.storySort;
|
||||
|
||||
const storyEntries = Object.entries(this.entries);
|
||||
// Add the kind parameters and global parameters to each entry
|
||||
const sortableV6: [StoryId, Store_Story<TFramework>, Parameters, Parameters][] =
|
||||
const sortableV6: [StoryId, Store_Story<TRenderer>, Parameters, Parameters][] =
|
||||
storyEntries.map(([storyId, { type, importPath, ...entry }]) => {
|
||||
const exports = this.csfExports[importPath];
|
||||
const csfFile = store.processCSFFileWithCache<TFramework>(
|
||||
const csfFile = store.processCSFFileWithCache<TRenderer>(
|
||||
exports,
|
||||
importPath,
|
||||
exports.default.title
|
||||
);
|
||||
|
||||
let storyLike: Store_Story<TFramework>;
|
||||
let storyLike: Store_Story<TRenderer>;
|
||||
if (type === 'story') {
|
||||
storyLike = store.storyFromCSFFile({ storyId, csfFile });
|
||||
} else {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/client-logger",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -55,5 +55,5 @@
|
||||
"./src/index.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/codemod",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "A collection of codemod scripts written with JSCodeshift",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -38,10 +38,10 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.12.11",
|
||||
"@storybook/csf": "next",
|
||||
"@storybook/csf-tools": "7.0.0-alpha.48",
|
||||
"@storybook/node-logger": "7.0.0-alpha.48",
|
||||
"@storybook/types": "7.0.0-alpha.48",
|
||||
"@storybook/csf": "0.0.2-next.5",
|
||||
"@storybook/csf-tools": "7.0.0-alpha.49",
|
||||
"@storybook/node-logger": "7.0.0-alpha.49",
|
||||
"@storybook/types": "7.0.0-alpha.49",
|
||||
"cross-spawn": "^7.0.3",
|
||||
"globby": "^11.0.2",
|
||||
"jscodeshift": "^0.13.1",
|
||||
@ -64,5 +64,5 @@
|
||||
"./src/index.js"
|
||||
]
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/core-client",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Storybook framework-agnostic API",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -35,17 +35,17 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/addons": "7.0.0-alpha.48",
|
||||
"@storybook/channel-postmessage": "7.0.0-alpha.48",
|
||||
"@storybook/channel-websocket": "7.0.0-alpha.48",
|
||||
"@storybook/channels": "7.0.0-alpha.48",
|
||||
"@storybook/client-api": "7.0.0-alpha.48",
|
||||
"@storybook/client-logger": "7.0.0-alpha.48",
|
||||
"@storybook/core-events": "7.0.0-alpha.48",
|
||||
"@storybook/csf": "next",
|
||||
"@storybook/preview-web": "7.0.0-alpha.48",
|
||||
"@storybook/store": "7.0.0-alpha.48",
|
||||
"@storybook/types": "7.0.0-alpha.48",
|
||||
"@storybook/addons": "7.0.0-alpha.49",
|
||||
"@storybook/channel-postmessage": "7.0.0-alpha.49",
|
||||
"@storybook/channel-websocket": "7.0.0-alpha.49",
|
||||
"@storybook/channels": "7.0.0-alpha.49",
|
||||
"@storybook/client-api": "7.0.0-alpha.49",
|
||||
"@storybook/client-logger": "7.0.0-alpha.49",
|
||||
"@storybook/core-events": "7.0.0-alpha.49",
|
||||
"@storybook/csf": "0.0.2-next.5",
|
||||
"@storybook/preview-web": "7.0.0-alpha.49",
|
||||
"@storybook/store": "7.0.0-alpha.49",
|
||||
"@storybook/types": "7.0.0-alpha.49",
|
||||
"global": "^4.4.0",
|
||||
"util-deprecate": "^1.0.2"
|
||||
},
|
||||
@ -65,5 +65,5 @@
|
||||
"./src/index.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
import global from 'global';
|
||||
import { ClientApi } from '@storybook/client-api';
|
||||
import { PreviewWeb } from '@storybook/preview-web';
|
||||
import type { Framework, ArgsStoryFn, Loadable, Path, ProjectAnnotations } from '@storybook/types';
|
||||
import type { Renderer, ArgsStoryFn, Loadable, Path, ProjectAnnotations } from '@storybook/types';
|
||||
import { createChannel } from '@storybook/channel-postmessage';
|
||||
import { addons } from '@storybook/addons';
|
||||
import { FORCE_RE_RENDER } from '@storybook/core-events';
|
||||
@ -15,9 +15,9 @@ const removedApi = (name: string) => () => {
|
||||
throw new Error(`@storybook/client-api:${name} was removed in storyStoreV7.`);
|
||||
};
|
||||
|
||||
interface CoreClient_RendererImplementation<TFramework extends Framework> {
|
||||
decorateStory?: ProjectAnnotations<TFramework>['applyDecorators'];
|
||||
render?: ArgsStoryFn<TFramework>;
|
||||
interface CoreClient_RendererImplementation<TRenderer extends Renderer> {
|
||||
decorateStory?: ProjectAnnotations<TRenderer>['applyDecorators'];
|
||||
render?: ArgsStoryFn<TRenderer>;
|
||||
}
|
||||
|
||||
interface CoreClient_ClientAPIFacade {
|
||||
@ -27,19 +27,19 @@ interface CoreClient_ClientAPIFacade {
|
||||
raw: (...args: any[]) => never;
|
||||
}
|
||||
|
||||
interface CoreClient_StartReturnValue<TFramework extends Framework> {
|
||||
interface CoreClient_StartReturnValue<TRenderer extends Renderer> {
|
||||
/* deprecated */
|
||||
forceReRender: () => void;
|
||||
/* deprecated */
|
||||
configure: any;
|
||||
/* deprecated */
|
||||
clientApi: ClientApi<TFramework> | CoreClient_ClientAPIFacade;
|
||||
clientApi: ClientApi<TRenderer> | CoreClient_ClientAPIFacade;
|
||||
}
|
||||
|
||||
export function start<TFramework extends Framework>(
|
||||
renderToCanvas: ProjectAnnotations<TFramework>['renderToCanvas'],
|
||||
{ decorateStory, render }: CoreClient_RendererImplementation<TFramework> = {}
|
||||
): CoreClient_StartReturnValue<TFramework> {
|
||||
export function start<TRenderer extends Renderer>(
|
||||
renderToCanvas: ProjectAnnotations<TRenderer>['renderToCanvas'],
|
||||
{ decorateStory, render }: CoreClient_RendererImplementation<TRenderer> = {}
|
||||
): CoreClient_StartReturnValue<TRenderer> {
|
||||
if (globalWindow) {
|
||||
// To enable user code to detect if it is running in Storybook
|
||||
globalWindow.IS_STORYBOOK = true;
|
||||
@ -59,8 +59,8 @@ export function start<TFramework extends Framework>(
|
||||
const channel = createChannel({ page: 'preview' });
|
||||
addons.setChannel(channel);
|
||||
|
||||
const clientApi = new ClientApi<TFramework>();
|
||||
const preview = new PreviewWeb<TFramework>();
|
||||
const clientApi = new ClientApi<TRenderer>();
|
||||
const preview = new PreviewWeb<TRenderer>();
|
||||
let initialized = false;
|
||||
|
||||
const importFn = (path: Path) => clientApi.importFn(path);
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/core-common",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Storybook framework-agnostic API",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -47,8 +47,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.12.10",
|
||||
"@storybook/node-logger": "7.0.0-alpha.48",
|
||||
"@storybook/types": "7.0.0-alpha.48",
|
||||
"@storybook/node-logger": "7.0.0-alpha.49",
|
||||
"@storybook/types": "7.0.0-alpha.49",
|
||||
"@types/babel__core": "^7.0.0",
|
||||
"@types/express": "^4.7.0",
|
||||
"@types/node": "^16.0.0",
|
||||
@ -97,5 +97,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/core-events",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Event names used in storybook core",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -52,5 +52,5 @@
|
||||
"./src/index.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/core-server",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Storybook framework-agnostic API",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -35,17 +35,17 @@
|
||||
"dependencies": {
|
||||
"@aw-web-design/x-default-browser": "1.4.88",
|
||||
"@discoveryjs/json-ext": "^0.5.3",
|
||||
"@storybook/builder-manager": "7.0.0-alpha.48",
|
||||
"@storybook/core-client": "7.0.0-alpha.48",
|
||||
"@storybook/core-common": "7.0.0-alpha.48",
|
||||
"@storybook/core-events": "7.0.0-alpha.48",
|
||||
"@storybook/csf": "next",
|
||||
"@storybook/csf-tools": "7.0.0-alpha.48",
|
||||
"@storybook/builder-manager": "7.0.0-alpha.49",
|
||||
"@storybook/core-client": "7.0.0-alpha.49",
|
||||
"@storybook/core-common": "7.0.0-alpha.49",
|
||||
"@storybook/core-events": "7.0.0-alpha.49",
|
||||
"@storybook/csf": "0.0.2-next.5",
|
||||
"@storybook/csf-tools": "7.0.0-alpha.49",
|
||||
"@storybook/docs-mdx": "0.0.1-canary.12433cf.0",
|
||||
"@storybook/node-logger": "7.0.0-alpha.48",
|
||||
"@storybook/store": "7.0.0-alpha.48",
|
||||
"@storybook/telemetry": "7.0.0-alpha.48",
|
||||
"@storybook/types": "7.0.0-alpha.48",
|
||||
"@storybook/node-logger": "7.0.0-alpha.49",
|
||||
"@storybook/store": "7.0.0-alpha.49",
|
||||
"@storybook/telemetry": "7.0.0-alpha.49",
|
||||
"@storybook/types": "7.0.0-alpha.49",
|
||||
"@types/node": "^16.0.0",
|
||||
"@types/node-fetch": "^2.5.7",
|
||||
"@types/pretty-hrtime": "^1.0.0",
|
||||
@ -77,7 +77,7 @@
|
||||
"ws": "^8.2.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@storybook/builder-webpack5": "7.0.0-alpha.48",
|
||||
"@storybook/builder-webpack5": "7.0.0-alpha.49",
|
||||
"@types/compression": "^1.7.0",
|
||||
"@types/ip": "^1.1.0",
|
||||
"@types/serve-favicon": "^2.5.2",
|
||||
@ -103,5 +103,5 @@
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/core-webpack",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Storybook framework-agnostic API",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -42,9 +42,9 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/core-common": "7.0.0-alpha.48",
|
||||
"@storybook/node-logger": "7.0.0-alpha.48",
|
||||
"@storybook/types": "7.0.0-alpha.48",
|
||||
"@storybook/core-common": "7.0.0-alpha.49",
|
||||
"@storybook/node-logger": "7.0.0-alpha.49",
|
||||
"@storybook/types": "7.0.0-alpha.49",
|
||||
"@types/node": "^16.0.0",
|
||||
"ts-dedent": "^2.0.0"
|
||||
},
|
||||
@ -61,5 +61,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/csf-plugin",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Enrich CSF files via static analysis",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -42,7 +42,7 @@
|
||||
"prep": "node ../../../scripts/prepare.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/csf-tools": "7.0.0-alpha.48",
|
||||
"@storybook/csf-tools": "7.0.0-alpha.49",
|
||||
"unplugin": "^0.10.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -56,5 +56,5 @@
|
||||
"./src/index.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/csf-tools",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -43,8 +43,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.12.11",
|
||||
"@storybook/csf": "next",
|
||||
"@storybook/types": "7.0.0-alpha.48",
|
||||
"@storybook/csf": "0.0.2-next.5",
|
||||
"@storybook/types": "7.0.0-alpha.49",
|
||||
"fs-extra": "^9.0.1",
|
||||
"ts-dedent": "^2.0.0"
|
||||
},
|
||||
@ -64,5 +64,5 @@
|
||||
"./src/index.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/docs-tools",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Shared utility functions for frameworks to implement docs",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -43,9 +43,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.12.10",
|
||||
"@storybook/core-common": "7.0.0-alpha.48",
|
||||
"@storybook/store": "7.0.0-alpha.48",
|
||||
"@storybook/types": "7.0.0-alpha.48",
|
||||
"@storybook/core-common": "7.0.0-alpha.49",
|
||||
"@storybook/store": "7.0.0-alpha.49",
|
||||
"@storybook/types": "7.0.0-alpha.49",
|
||||
"doctrine": "^3.0.0",
|
||||
"lodash": "^4.17.21"
|
||||
},
|
||||
@ -62,5 +62,5 @@
|
||||
"./src/index.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
import type { Framework, StoryContextForEnhancers } from '@storybook/types';
|
||||
import type { Renderer, StoryContextForEnhancers } from '@storybook/types';
|
||||
import { combineParameters } from '@storybook/store';
|
||||
|
||||
export const enhanceArgTypes = <TFramework extends Framework>(
|
||||
context: StoryContextForEnhancers<TFramework>
|
||||
export const enhanceArgTypes = <TRenderer extends Renderer>(
|
||||
context: StoryContextForEnhancers<TRenderer>
|
||||
) => {
|
||||
const {
|
||||
component,
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/instrumenter",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -42,10 +42,10 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/addons": "7.0.0-alpha.48",
|
||||
"@storybook/channels": "7.0.0-alpha.48",
|
||||
"@storybook/client-logger": "7.0.0-alpha.48",
|
||||
"@storybook/core-events": "7.0.0-alpha.48",
|
||||
"@storybook/addons": "7.0.0-alpha.49",
|
||||
"@storybook/channels": "7.0.0-alpha.49",
|
||||
"@storybook/client-logger": "7.0.0-alpha.49",
|
||||
"@storybook/core-events": "7.0.0-alpha.49",
|
||||
"core-js": "^3.8.2",
|
||||
"global": "^4.4.0"
|
||||
},
|
||||
@ -60,5 +60,5 @@
|
||||
"./src/index.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/node-logger",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -59,5 +59,5 @@
|
||||
"./src/index.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/postinstall",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "Storybook addons postinstall utilities",
|
||||
"keywords": [
|
||||
"api",
|
||||
@ -56,5 +56,5 @@
|
||||
"./src/index.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/preview-web",
|
||||
"version": "7.0.0-alpha.48",
|
||||
"version": "7.0.0-alpha.49",
|
||||
"description": "",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -42,12 +42,12 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/addons": "7.0.0-alpha.48",
|
||||
"@storybook/channels": "7.0.0-alpha.48",
|
||||
"@storybook/client-logger": "7.0.0-alpha.48",
|
||||
"@storybook/core-events": "7.0.0-alpha.48",
|
||||
"@storybook/store": "7.0.0-alpha.48",
|
||||
"@storybook/types": "7.0.0-alpha.48",
|
||||
"@storybook/addons": "7.0.0-alpha.49",
|
||||
"@storybook/channels": "7.0.0-alpha.49",
|
||||
"@storybook/client-logger": "7.0.0-alpha.49",
|
||||
"@storybook/core-events": "7.0.0-alpha.49",
|
||||
"@storybook/store": "7.0.0-alpha.49",
|
||||
"@storybook/types": "7.0.0-alpha.49",
|
||||
"ansi-to-html": "^0.6.11",
|
||||
"global": "^4.4.0",
|
||||
"lodash": "^4.17.21",
|
||||
@ -57,7 +57,7 @@
|
||||
"util-deprecate": "^1.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@storybook/channel-postmessage": "7.0.0-alpha.48",
|
||||
"@storybook/channel-postmessage": "7.0.0-alpha.49",
|
||||
"react": "16.14.0",
|
||||
"ts-jest": "^28.0.8",
|
||||
"typescript": "~4.6.3"
|
||||
@ -70,5 +70,5 @@
|
||||
"./src/index.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd"
|
||||
"gitHead": "d7eb433300cac55d3c7256c8181eb6fd7a47b4c8"
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ import { logger, deprecate } from '@storybook/client-logger';
|
||||
import type { Channel } from '@storybook/channels';
|
||||
import { addons } from '@storybook/addons';
|
||||
import type {
|
||||
Framework,
|
||||
Renderer,
|
||||
Args,
|
||||
Globals,
|
||||
Store_ModuleImportFn,
|
||||
@ -41,7 +41,7 @@ const STORY_INDEX_PATH = './index.json';
|
||||
|
||||
export type MaybePromise<T> = Promise<T> | T;
|
||||
|
||||
export class Preview<TFramework extends Framework> {
|
||||
export class Preview<TFramework extends Renderer> {
|
||||
serverChannel?: Channel;
|
||||
|
||||
storyStore: StoryStore<TFramework>;
|
||||
|
@ -29,7 +29,7 @@ import {
|
||||
} from '@storybook/core-events';
|
||||
import { logger } from '@storybook/client-logger';
|
||||
import { addons, mockChannel as createMockChannel } from '@storybook/addons';
|
||||
import type { Framework } from '@storybook/types';
|
||||
import type { Renderer } from '@storybook/types';
|
||||
import type { ModuleImportFn, WebProjectAnnotations } from '@storybook/store';
|
||||
import { mocked } from 'ts-jest/utils';
|
||||
|
||||
@ -110,7 +110,7 @@ async function createAndRenderPreview({
|
||||
getProjectAnnotations: inputGetProjectAnnotations = getProjectAnnotations,
|
||||
}: {
|
||||
importFn?: ModuleImportFn;
|
||||
getProjectAnnotations?: () => WebProjectAnnotations<Framework>;
|
||||
getProjectAnnotations?: () => WebProjectAnnotations<Renderer>;
|
||||
} = {}) {
|
||||
const preview = new PreviewWeb();
|
||||
await preview.initialize({
|
||||
|
@ -1,10 +1,10 @@
|
||||
import type { Framework } from '@storybook/types';
|
||||
import type { Renderer } from '@storybook/types';
|
||||
|
||||
import { PreviewWithSelection } from './PreviewWithSelection';
|
||||
import { UrlStore } from './UrlStore';
|
||||
import { WebView } from './WebView';
|
||||
|
||||
export class PreviewWeb<TFramework extends Framework> extends PreviewWithSelection<TFramework> {
|
||||
export class PreviewWeb<TFramework extends Renderer> extends PreviewWithSelection<TFramework> {
|
||||
constructor() {
|
||||
super(new UrlStore(), new WebView());
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ import {
|
||||
} from '@storybook/core-events';
|
||||
import { logger } from '@storybook/client-logger';
|
||||
import type {
|
||||
Framework,
|
||||
Renderer,
|
||||
Args,
|
||||
Globals,
|
||||
Store_ModuleImportFn,
|
||||
@ -48,18 +48,18 @@ function focusInInput(event: Event) {
|
||||
return /input|textarea/i.test(target.tagName) || target.getAttribute('contenteditable') !== null;
|
||||
}
|
||||
|
||||
type PossibleRender<TFramework extends Framework> =
|
||||
type PossibleRender<TFramework extends Renderer> =
|
||||
| StoryRender<TFramework>
|
||||
| TemplateDocsRender<TFramework>
|
||||
| StandaloneDocsRender<TFramework>;
|
||||
|
||||
function isStoryRender<TFramework extends Framework>(
|
||||
function isStoryRender<TFramework extends Renderer>(
|
||||
r: PossibleRender<TFramework>
|
||||
): r is StoryRender<TFramework> {
|
||||
return r.type === 'story';
|
||||
}
|
||||
|
||||
export class PreviewWithSelection<TFramework extends Framework> extends Preview<TFramework> {
|
||||
export class PreviewWithSelection<TFramework extends Renderer> extends Preview<TFramework> {
|
||||
currentSelection?: Store_Selection;
|
||||
|
||||
currentRender?: PossibleRender<TFramework>;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type {
|
||||
Framework,
|
||||
Renderer,
|
||||
Store_CSFFile,
|
||||
Store_ModuleExport,
|
||||
Store_ModuleExports,
|
||||
@ -13,23 +13,23 @@ import type { Channel } from '@storybook/channels';
|
||||
|
||||
import type { DocsContextProps } from './DocsContextProps';
|
||||
|
||||
export class DocsContext<TFramework extends Framework> implements DocsContextProps<TFramework> {
|
||||
private componentStoriesValue: Store_Story<TFramework>[];
|
||||
export class DocsContext<TRenderer extends Renderer> implements DocsContextProps<TRenderer> {
|
||||
private componentStoriesValue: Store_Story<TRenderer>[];
|
||||
|
||||
private storyIdToCSFFile: Map<StoryId, Store_CSFFile<TFramework>>;
|
||||
private storyIdToCSFFile: Map<StoryId, Store_CSFFile<TRenderer>>;
|
||||
|
||||
private exportToStoryId: Map<Store_ModuleExport, StoryId>;
|
||||
|
||||
private nameToStoryId: Map<StoryName, StoryId>;
|
||||
|
||||
private primaryStory?: Store_Story<TFramework>;
|
||||
private primaryStory?: Store_Story<TRenderer>;
|
||||
|
||||
constructor(
|
||||
public channel: Channel,
|
||||
protected store: StoryStore<TFramework>,
|
||||
protected store: StoryStore<TRenderer>,
|
||||
public renderStoryToElement: DocsContextProps['renderStoryToElement'],
|
||||
/** The CSF files known (via the index) to be refererenced by this docs file */
|
||||
csfFiles: Store_CSFFile<TFramework>[],
|
||||
csfFiles: Store_CSFFile<TRenderer>[],
|
||||
componentStoriesFromAllCsfFiles = true
|
||||
) {
|
||||
this.storyIdToCSFFile = new Map();
|
||||
@ -45,7 +45,7 @@ export class DocsContext<TFramework extends Framework> implements DocsContextPro
|
||||
// This docs entry references this CSF file and can syncronously load the stories, as well
|
||||
// as reference them by module export. If the CSF is part of the "component" stories, they
|
||||
// can also be referenced by name and are in the componentStories list.
|
||||
referenceCSFFile(csfFile: Store_CSFFile<TFramework>, addToComponentStories: boolean) {
|
||||
referenceCSFFile(csfFile: Store_CSFFile<TRenderer>, addToComponentStories: boolean) {
|
||||
Object.values(csfFile.stories).forEach((annotation) => {
|
||||
this.storyIdToCSFFile.set(annotation.id, csfFile);
|
||||
this.exportToStoryId.set(annotation.moduleExport, annotation.id);
|
||||
@ -96,11 +96,11 @@ export class DocsContext<TFramework extends Framework> implements DocsContextPro
|
||||
return this.store.storyFromCSFFile({ storyId, csfFile });
|
||||
};
|
||||
|
||||
getStoryContext = (story: Store_Story<TFramework>) => {
|
||||
getStoryContext = (story: Store_Story<TRenderer>) => {
|
||||
return {
|
||||
...this.store.getStoryContext(story),
|
||||
viewMode: 'docs',
|
||||
} as StoryContextForLoaders<TFramework>;
|
||||
} as StoryContextForLoaders<TRenderer>;
|
||||
};
|
||||
|
||||
loadStory = (id: StoryId) => {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type {
|
||||
Framework,
|
||||
Renderer,
|
||||
Store_ModuleExport,
|
||||
Store_ModuleExports,
|
||||
Store_Story,
|
||||
@ -10,7 +10,7 @@ import type {
|
||||
import type { Channel } from '@storybook/channels';
|
||||
import type { StoryRenderOptions } from '../render/StoryRender';
|
||||
|
||||
export interface DocsContextProps<TFramework extends Framework = Framework> {
|
||||
export interface DocsContextProps<TRenderer extends Renderer = Renderer> {
|
||||
/**
|
||||
* Register the CSF file that this docs entry represents.
|
||||
* Used by the `<Meta of={} />` block.
|
||||
@ -35,26 +35,26 @@ export interface DocsContextProps<TFramework extends Framework = Framework> {
|
||||
* Syncronously find a story by id (if the id is not provided, this will look up the primary
|
||||
* story in the CSF file, if such a file exists).
|
||||
*/
|
||||
storyById: (id?: StoryId) => Store_Story<TFramework>;
|
||||
storyById: (id?: StoryId) => Store_Story<TRenderer>;
|
||||
/**
|
||||
* Syncronously find all stories of the component referenced by the CSF file.
|
||||
*/
|
||||
componentStories: () => Store_Story<TFramework>[];
|
||||
componentStories: () => Store_Story<TRenderer>[];
|
||||
|
||||
/**
|
||||
* Get the story context of the referenced story.
|
||||
*/
|
||||
getStoryContext: (story: Store_Story<TFramework>) => StoryContextForLoaders<TFramework>;
|
||||
getStoryContext: (story: Store_Story<TRenderer>) => StoryContextForLoaders<TRenderer>;
|
||||
/**
|
||||
* Asyncronously load an arbitrary story by id.
|
||||
*/
|
||||
loadStory: (id: StoryId) => Promise<Store_Story<TFramework>>;
|
||||
loadStory: (id: StoryId) => Promise<Store_Story<TRenderer>>;
|
||||
|
||||
/**
|
||||
* Render a story to a given HTML element and keep it up to date across context changes
|
||||
*/
|
||||
renderStoryToElement: (
|
||||
story: Store_Story<TFramework>,
|
||||
story: Store_Story<TRenderer>,
|
||||
element: HTMLElement,
|
||||
options: StoryRenderOptions
|
||||
) => () => Promise<void>;
|
||||
|
@ -1,8 +1,8 @@
|
||||
import type { Framework, Parameters } from '@storybook/types';
|
||||
import type { Renderer, Parameters } from '@storybook/types';
|
||||
import type { DocsContextProps } from './DocsContextProps';
|
||||
|
||||
export type DocsRenderFunction<TFramework extends Framework> = (
|
||||
docsContext: DocsContextProps<TFramework>,
|
||||
export type DocsRenderFunction<TRenderer extends Renderer> = (
|
||||
docsContext: DocsContextProps<TRenderer>,
|
||||
docsParameters: Parameters,
|
||||
element: HTMLElement,
|
||||
callback: () => void
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { StoryId, Framework } from '@storybook/types';
|
||||
import type { StoryId, Renderer } from '@storybook/types';
|
||||
import type { StoryRenderOptions } from './StoryRender';
|
||||
|
||||
export type RenderType = 'story' | 'docs';
|
||||
@ -10,16 +10,16 @@ export type RenderType = 'story' | 'docs';
|
||||
* - Tracking the state of the rendering as it moves between preparing, rendering and tearing down.
|
||||
* - Tracking what is rendered to know if a change requires re-rendering or teardown + recreation.
|
||||
*/
|
||||
export interface Render<TFramework extends Framework> {
|
||||
export interface Render<TRenderer extends Renderer> {
|
||||
type: RenderType;
|
||||
id: StoryId;
|
||||
isPreparing: () => boolean;
|
||||
isEqual: (other: Render<TFramework>) => boolean;
|
||||
isEqual: (other: Render<TRenderer>) => boolean;
|
||||
disableKeyListeners: boolean;
|
||||
teardown?: (options: { viewModeChanged: boolean }) => Promise<void>;
|
||||
torndown: boolean;
|
||||
renderToElement: (
|
||||
canvasElement: TFramework['canvasElement'],
|
||||
canvasElement: TRenderer['canvasElement'],
|
||||
renderStoryToElement?: any,
|
||||
options?: StoryRenderOptions
|
||||
) => Promise<void>;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { jest, describe, it, expect } from '@jest/globals';
|
||||
import { Channel } from '@storybook/channels';
|
||||
import type { Framework, Addon_StandaloneDocsIndexEntry } from '@storybook/types';
|
||||
import type { Renderer, Addon_StandaloneDocsIndexEntry } from '@storybook/types';
|
||||
import type { StoryStore } from '@storybook/store';
|
||||
import { PREPARE_ABORTED } from './Render';
|
||||
|
||||
@ -36,7 +36,7 @@ describe('StandaloneDocsRender', () => {
|
||||
|
||||
const render = new StandaloneDocsRender(
|
||||
new Channel(),
|
||||
mockStore as unknown as StoryStore<Framework>,
|
||||
mockStore as unknown as StoryStore<Renderer>,
|
||||
entry
|
||||
);
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user