@storybook/addon-docs 6.4.0-beta.3 → 6.4.0-beta.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/blocks/ArgsTable.js +3 -4
- package/dist/cjs/blocks/Canvas.js +2 -1
- package/dist/cjs/blocks/DocsStory.js +2 -1
- package/dist/cjs/blocks/Source.js +1 -1
- package/dist/cjs/blocks/Story.js +65 -30
- package/dist/cjs/blocks/enhanceSource.js +2 -2
- package/dist/cjs/blocks/useStory.js +8 -3
- package/dist/cjs/frameworks/angular/compodoc.js +3 -1
- package/dist/cjs/frameworks/angular/prepareForInline.js +52 -53
- package/dist/cjs/frameworks/angular/sourceDecorator.js +99 -23
- package/dist/cjs/frameworks/common/config.js +87 -3
- package/dist/cjs/frameworks/html/sourceDecorator.js +9 -2
- package/dist/cjs/frameworks/react/react-argtypes.stories.js +2 -2
- package/dist/cjs/frameworks/vue/extractArgTypes.js +106 -15
- package/dist/cjs/frameworks/vue/sourceDecorator.js +80 -33
- package/dist/cjs/frameworks/web-components/custom-elements.js +63 -25
- package/dist/esm/blocks/ArgsTable.js +3 -4
- package/dist/esm/blocks/Canvas.js +3 -2
- package/dist/esm/blocks/DocsStory.js +2 -1
- package/dist/esm/blocks/Source.js +1 -1
- package/dist/esm/blocks/Story.js +63 -27
- package/dist/esm/blocks/enhanceSource.js +7 -1
- package/dist/esm/blocks/useStory.js +8 -3
- package/dist/esm/frameworks/angular/compodoc.js +3 -1
- package/dist/esm/frameworks/angular/prepareForInline.js +46 -50
- package/dist/esm/frameworks/angular/sourceDecorator.js +72 -20
- package/dist/esm/frameworks/common/config.js +60 -3
- package/dist/esm/frameworks/html/sourceDecorator.js +9 -2
- package/dist/esm/frameworks/react/react-argtypes.stories.js +1 -1
- package/dist/esm/frameworks/vue/extractArgTypes.js +97 -14
- package/dist/esm/frameworks/vue/sourceDecorator.js +60 -23
- package/dist/esm/frameworks/web-components/custom-elements.js +60 -24
- package/dist/modern/blocks/ArgsTable.js +3 -5
- package/dist/modern/blocks/Canvas.js +3 -2
- package/dist/modern/blocks/DocsStory.js +2 -1
- package/dist/modern/blocks/Source.js +1 -1
- package/dist/modern/blocks/Story.js +37 -29
- package/dist/modern/blocks/enhanceSource.js +7 -1
- package/dist/modern/blocks/useStory.js +14 -3
- package/dist/modern/frameworks/angular/compodoc.js +3 -1
- package/dist/modern/frameworks/angular/prepareForInline.js +20 -15
- package/dist/modern/frameworks/angular/sourceDecorator.js +33 -20
- package/dist/modern/frameworks/common/config.js +2 -3
- package/dist/modern/frameworks/html/sourceDecorator.js +9 -2
- package/dist/modern/frameworks/react/react-argtypes.stories.js +1 -1
- package/dist/modern/frameworks/vue/extractArgTypes.js +64 -4
- package/dist/modern/frameworks/vue/sourceDecorator.js +14 -9
- package/dist/modern/frameworks/web-components/custom-elements.js +55 -23
- package/dist/ts3.4/blocks/Story.d.ts +1 -1
- package/dist/ts3.4/frameworks/angular/config.d.ts +1 -1
- package/dist/ts3.4/frameworks/angular/prepareForInline.d.ts +1 -1
- package/dist/ts3.4/frameworks/angular/sourceDecorator.d.ts +1 -1
- package/dist/ts3.4/frameworks/common/config.d.ts +2 -2
- package/dist/ts3.4/frameworks/web-components/custom-elements.d.ts +4 -3
- package/dist/ts3.9/blocks/Story.d.ts +1 -1
- package/dist/ts3.9/frameworks/angular/config.d.ts +1 -1
- package/dist/ts3.9/frameworks/angular/prepareForInline.d.ts +1 -1
- package/dist/ts3.9/frameworks/angular/sourceDecorator.d.ts +1 -1
- package/dist/ts3.9/frameworks/common/config.d.ts +2 -2
- package/dist/ts3.9/frameworks/web-components/custom-elements.d.ts +4 -3
- package/package.json +29 -30
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { addons, useEffect } from '@storybook/addons';
|
|
2
2
|
import { computesTemplateSourceFromComponent } from '@storybook/angular/renderer';
|
|
3
|
-
import prettierHtml from 'prettier/parser-html';
|
|
4
|
-
import prettier from 'prettier/standalone';
|
|
5
3
|
import { SNIPPET_RENDERED, SourceType } from '../../shared';
|
|
6
4
|
export const skipSourceRender = context => {
|
|
7
5
|
var _context$parameters$d;
|
|
@@ -16,16 +14,28 @@ export const skipSourceRender = context => {
|
|
|
16
14
|
|
|
17
15
|
return (sourceParams === null || sourceParams === void 0 ? void 0 : sourceParams.code) || (sourceParams === null || sourceParams === void 0 ? void 0 : sourceParams.type) === SourceType.CODE;
|
|
18
16
|
};
|
|
17
|
+
let prettyUpInternal;
|
|
19
18
|
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
const makePrettyUp = async () => {
|
|
20
|
+
if (prettyUpInternal) {
|
|
21
|
+
return prettyUpInternal;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const prettierHtml = await import('prettier/parser-html');
|
|
25
|
+
const prettier = await import('prettier/standalone');
|
|
26
|
+
|
|
27
|
+
prettyUpInternal = source => {
|
|
28
|
+
return prettier.format(source, {
|
|
29
|
+
parser: 'angular',
|
|
30
|
+
plugins: [prettierHtml],
|
|
31
|
+
htmlWhitespaceSensitivity: 'ignore'
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
return prettyUpInternal;
|
|
26
36
|
};
|
|
27
37
|
/**
|
|
28
|
-
*
|
|
38
|
+
* Angular source decorator.
|
|
29
39
|
* @param storyFn Fn
|
|
30
40
|
* @param context StoryContext
|
|
31
41
|
*/
|
|
@@ -49,20 +59,23 @@ export const sourceDecorator = (storyFn, context) => {
|
|
|
49
59
|
argTypes
|
|
50
60
|
} = context;
|
|
51
61
|
let toEmit;
|
|
62
|
+
const prettyUpPromise = makePrettyUp();
|
|
52
63
|
useEffect(() => {
|
|
53
|
-
|
|
64
|
+
prettyUpPromise.then(prettyUp => {
|
|
65
|
+
if (toEmit) channel.emit(SNIPPET_RENDERED, context.id, prettyUp(toEmit));
|
|
66
|
+
});
|
|
54
67
|
});
|
|
68
|
+
prettyUpPromise.then(prettyUp => {
|
|
69
|
+
if (component && !userDefinedTemplate) {
|
|
70
|
+
const source = computesTemplateSourceFromComponent(component, props, argTypes); // We might have a story with a Directive or Service defined as the component
|
|
71
|
+
// In these cases there might exist a template, even if we aren't able to create source from component
|
|
55
72
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
toEmit = prettyUp(source || template);
|
|
73
|
+
if (source || template) {
|
|
74
|
+
toEmit = prettyUp(source || template);
|
|
75
|
+
}
|
|
76
|
+
} else if (template) {
|
|
77
|
+
toEmit = prettyUp(template);
|
|
62
78
|
}
|
|
63
|
-
}
|
|
64
|
-
toEmit = prettyUp(template);
|
|
65
|
-
}
|
|
66
|
-
|
|
79
|
+
});
|
|
67
80
|
return story;
|
|
68
81
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { DocsContainer, DocsPage } from '../../blocks';
|
|
2
1
|
import { enhanceArgTypes } from './enhanceArgTypes';
|
|
3
2
|
export const parameters = {
|
|
4
3
|
docs: {
|
|
5
4
|
inlineStories: false,
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
getContainer: async () => (await import('../../blocks')).DocsContainer,
|
|
6
|
+
getPage: async () => (await import('../../blocks')).DocsPage,
|
|
8
7
|
iframeHeight: 100
|
|
9
8
|
}
|
|
10
9
|
};
|
|
@@ -38,8 +38,15 @@ export function sourceDecorator(storyFn, context) {
|
|
|
38
38
|
const story = context !== null && context !== void 0 && (_context$parameters$d3 = context.parameters.docs) !== null && _context$parameters$d3 !== void 0 && (_context$parameters$d4 = _context$parameters$d3.source) !== null && _context$parameters$d4 !== void 0 && _context$parameters$d4.excludeDecorators ? context.originalStoryFn(context.args, context) : storyFn();
|
|
39
39
|
let source;
|
|
40
40
|
|
|
41
|
-
if (
|
|
42
|
-
|
|
41
|
+
if (!skipSourceRender(context)) {
|
|
42
|
+
if (typeof story === 'string') {
|
|
43
|
+
source = story;
|
|
44
|
+
} // eslint-disable-next-line no-undef
|
|
45
|
+
else if (story instanceof Element) {
|
|
46
|
+
source = story.outerHTML;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (source) source = applyTransformSource(source, context);
|
|
43
50
|
}
|
|
44
51
|
|
|
45
52
|
useEffect(() => {
|
|
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
|
|
|
2
2
|
import mapValues from 'lodash/mapValues';
|
|
3
3
|
import { storiesOf } from '@storybook/react';
|
|
4
4
|
import { ArgsTable } from '@storybook/components';
|
|
5
|
-
import { inferControls } from '@storybook/
|
|
5
|
+
import { inferControls } from '@storybook/store';
|
|
6
6
|
import { extractArgTypes } from './extractArgTypes';
|
|
7
7
|
|
|
8
8
|
const argsTableProps = component => {
|
|
@@ -1,6 +1,58 @@
|
|
|
1
1
|
import { hasDocgen, extractComponentProps } from '../../lib/docgen';
|
|
2
2
|
import { convert } from '../../lib/convert';
|
|
3
3
|
const SECTIONS = ['props', 'events', 'slots'];
|
|
4
|
+
/**
|
|
5
|
+
* Check if "@values" tag is defined within docgenInfo.
|
|
6
|
+
* If true, then propDef is mutated.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
function isEnum(propDef, docgenInfo) {
|
|
10
|
+
// cast as any, since "values" doesn't exist in DocgenInfo type
|
|
11
|
+
const {
|
|
12
|
+
type,
|
|
13
|
+
values
|
|
14
|
+
} = docgenInfo;
|
|
15
|
+
const matched = Array.isArray(values) && values.length && type.name !== 'enum';
|
|
16
|
+
if (!matched) return false;
|
|
17
|
+
const enumString = values.join(', ');
|
|
18
|
+
let {
|
|
19
|
+
summary
|
|
20
|
+
} = propDef.type;
|
|
21
|
+
summary = summary ? `${summary}: ${enumString}` : enumString;
|
|
22
|
+
Object.assign(propDef.type, Object.assign({}, propDef.type, {
|
|
23
|
+
name: 'enum',
|
|
24
|
+
value: values,
|
|
25
|
+
summary
|
|
26
|
+
}));
|
|
27
|
+
return propDef;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @returns {Array} result
|
|
31
|
+
* @returns {PropDef} result.def - propDef
|
|
32
|
+
* @returns {boolean} result.isChanged - flag whether propDef is mutated or not.
|
|
33
|
+
* this is needed to prevent sbType from performing convert(docgenInfo).
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
function verifyPropDef(propDef, docgenInfo) {
|
|
38
|
+
let def = propDef;
|
|
39
|
+
let isChanged = false; // another callback can be added here.
|
|
40
|
+
// callback is mutually exclusive from each other.
|
|
41
|
+
|
|
42
|
+
const callbacks = [isEnum];
|
|
43
|
+
|
|
44
|
+
for (let i = 0, len = callbacks.length; i < len; i += 1) {
|
|
45
|
+
const matched = callbacks[i](propDef, docgenInfo);
|
|
46
|
+
|
|
47
|
+
if (matched) {
|
|
48
|
+
def = matched;
|
|
49
|
+
isChanged = true;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return [def, isChanged];
|
|
54
|
+
}
|
|
55
|
+
|
|
4
56
|
export const extractArgTypes = component => {
|
|
5
57
|
if (!hasDocgen(component)) {
|
|
6
58
|
return null;
|
|
@@ -14,16 +66,24 @@ export const extractArgTypes = component => {
|
|
|
14
66
|
docgenInfo,
|
|
15
67
|
jsDocTags
|
|
16
68
|
}) => {
|
|
69
|
+
const [result, isPropDefChanged] = verifyPropDef(propDef, docgenInfo);
|
|
17
70
|
const {
|
|
18
71
|
name,
|
|
19
72
|
type,
|
|
20
73
|
description,
|
|
21
74
|
defaultValue: defaultSummary,
|
|
22
75
|
required
|
|
23
|
-
} =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
76
|
+
} = result;
|
|
77
|
+
let sbType;
|
|
78
|
+
|
|
79
|
+
if (isPropDefChanged) {
|
|
80
|
+
sbType = type;
|
|
81
|
+
} else {
|
|
82
|
+
sbType = section === 'props' ? convert(docgenInfo) : {
|
|
83
|
+
name: 'void'
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
27
87
|
results[name] = {
|
|
28
88
|
name,
|
|
29
89
|
description,
|
|
@@ -3,8 +3,6 @@ import "core-js/modules/es.array.reduce.js";
|
|
|
3
3
|
/* eslint no-underscore-dangle: ["error", { "allow": ["_vnode"] }] */
|
|
4
4
|
import { addons } from '@storybook/addons';
|
|
5
5
|
import { logger } from '@storybook/client-logger';
|
|
6
|
-
import prettier from 'prettier/standalone';
|
|
7
|
-
import prettierHtml from 'prettier/parser-html';
|
|
8
6
|
import { SourceType, SNIPPET_RENDERED } from '../../shared';
|
|
9
7
|
export const skipSourceRender = context => {
|
|
10
8
|
var _context$parameters$d;
|
|
@@ -46,13 +44,20 @@ export const sourceDecorator = (storyFn, context) => {
|
|
|
46
44
|
try {
|
|
47
45
|
const storyNode = lookupStoryInstance(this, storyComponent);
|
|
48
46
|
const code = vnodeToString(storyNode._vnode);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
47
|
+
|
|
48
|
+
const emitFormattedTemplate = async () => {
|
|
49
|
+
const prettier = await import('prettier/standalone');
|
|
50
|
+
const prettierHtml = await import('prettier/parser-html');
|
|
51
|
+
channel.emit(SNIPPET_RENDERED, (context || {}).id, prettier.format(`<template>${code}</template>`, {
|
|
52
|
+
parser: 'vue',
|
|
53
|
+
plugins: [prettierHtml],
|
|
54
|
+
// Because the parsed vnode missing spaces right before/after the surround tag,
|
|
55
|
+
// we always get weird wrapped code without this option.
|
|
56
|
+
htmlWhitespaceSensitivity: 'ignore'
|
|
57
|
+
}));
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
emitFormattedTemplate();
|
|
56
61
|
} catch (e) {
|
|
57
62
|
logger.warn(`Failed to generate dynamic story source: ${e}`);
|
|
58
63
|
}
|
|
@@ -3,34 +3,66 @@ import { getCustomElements, isValidComponent, isValidMetaData } from '@storybook
|
|
|
3
3
|
import { logger } from '@storybook/client-logger';
|
|
4
4
|
|
|
5
5
|
function mapData(data, category) {
|
|
6
|
-
return data && data.filter(item =>
|
|
7
|
-
var _item$type, _item$type2;
|
|
8
|
-
|
|
6
|
+
return data && data.filter(item => item && item.name).reduce((acc, item) => {
|
|
9
7
|
if (item.kind === 'method') return acc;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
summary: ((_item$type2 = item.type) === null || _item$type2 === void 0 ? void 0 : _item$type2.text) || item.type
|
|
24
|
-
},
|
|
25
|
-
defaultValue: {
|
|
26
|
-
summary: item.default !== undefined ? item.default : item.defaultValue
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
};
|
|
8
|
+
|
|
9
|
+
switch (category) {
|
|
10
|
+
case 'events':
|
|
11
|
+
mapEvent(item).forEach(argType => {
|
|
12
|
+
acc[argType.name] = argType;
|
|
13
|
+
});
|
|
14
|
+
break;
|
|
15
|
+
|
|
16
|
+
default:
|
|
17
|
+
acc[item.name] = mapItem(item, category);
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
|
|
30
21
|
return acc;
|
|
31
22
|
}, {});
|
|
32
23
|
}
|
|
33
24
|
|
|
25
|
+
function mapItem(item, category) {
|
|
26
|
+
var _item$type, _item$type2;
|
|
27
|
+
|
|
28
|
+
const type = category === 'properties' ? {
|
|
29
|
+
name: ((_item$type = item.type) === null || _item$type === void 0 ? void 0 : _item$type.text) || item.type
|
|
30
|
+
} : {
|
|
31
|
+
name: 'void'
|
|
32
|
+
};
|
|
33
|
+
return {
|
|
34
|
+
name: item.name,
|
|
35
|
+
required: false,
|
|
36
|
+
description: item.description,
|
|
37
|
+
type,
|
|
38
|
+
table: {
|
|
39
|
+
category,
|
|
40
|
+
type: {
|
|
41
|
+
summary: ((_item$type2 = item.type) === null || _item$type2 === void 0 ? void 0 : _item$type2.text) || item.type
|
|
42
|
+
},
|
|
43
|
+
defaultValue: {
|
|
44
|
+
summary: item.default !== undefined ? item.default : item.defaultValue
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function mapEvent(item) {
|
|
51
|
+
let name = item.name.replace(/(-|_|:|\.|\s)+(.)?/g, (_match, _separator, chr) => {
|
|
52
|
+
return chr ? chr.toUpperCase() : '';
|
|
53
|
+
}).replace(/^([A-Z])/, match => match.toLowerCase());
|
|
54
|
+
name = `on${name.charAt(0).toUpperCase() + name.substr(1)}`;
|
|
55
|
+
return [{
|
|
56
|
+
name,
|
|
57
|
+
action: {
|
|
58
|
+
name: item.name
|
|
59
|
+
},
|
|
60
|
+
table: {
|
|
61
|
+
disable: true
|
|
62
|
+
}
|
|
63
|
+
}, mapItem(item, 'events')];
|
|
64
|
+
}
|
|
65
|
+
|
|
34
66
|
const getMetaDataExperimental = (tagName, customElements) => {
|
|
35
67
|
if (!isValidComponent(tagName) || !isValidMetaData(customElements)) {
|
|
36
68
|
return null;
|
|
@@ -23,6 +23,6 @@ declare type StoryImportProps = {
|
|
|
23
23
|
export declare type StoryProps = (StoryDefProps | StoryRefProps | StoryImportProps) & CommonProps;
|
|
24
24
|
export declare const lookupStoryId: (storyName: string, { mdxStoryNameToKey, mdxComponentAnnotations }: DocsContextProps) => string;
|
|
25
25
|
export declare const getStoryId: (props: StoryProps, context: DocsContextProps) => StoryId;
|
|
26
|
-
export declare const getStoryProps: <TFramework extends AnyFramework>({ height, inline }: StoryProps, story: StoryType<TFramework>, context: DocsContextProps<TFramework
|
|
26
|
+
export declare const getStoryProps: <TFramework extends AnyFramework>({ height, inline }: StoryProps, story: StoryType<TFramework>, context: DocsContextProps<TFramework>, onStoryFnCalled: () => void) => PureStoryProps;
|
|
27
27
|
declare const Story: FunctionComponent<StoryProps>;
|
|
28
28
|
export { Story };
|
|
@@ -3,7 +3,7 @@ import { SourceType } from '../../shared';
|
|
|
3
3
|
export declare const parameters: {
|
|
4
4
|
docs: {
|
|
5
5
|
inlineStories: boolean;
|
|
6
|
-
prepareForInline: (storyFn: import("@storybook/csf").PartialStoryFn<import("@storybook/angular").AngularFramework, import("@storybook/csf").Args>, { id, parameters }: import("@storybook/angular").StoryContext) => import("react").DetailedReactHTMLElement<import("react").HTMLAttributes<
|
|
6
|
+
prepareForInline: (storyFn: import("@storybook/csf").PartialStoryFn<import("@storybook/angular").AngularFramework, import("@storybook/csf").Args>, { id, parameters, component }: import("@storybook/angular").StoryContext) => import("react").DetailedReactHTMLElement<import("react").HTMLAttributes<undefined>, undefined>;
|
|
7
7
|
extractArgTypes: (component: import("./types").Directive) => import("@storybook/api").ArgTypes;
|
|
8
8
|
extractComponentDescription: (component: import("./types").Directive) => string;
|
|
9
9
|
source: {
|
|
@@ -4,4 +4,4 @@ import { PartialStoryFn } from '@storybook/csf';
|
|
|
4
4
|
/**
|
|
5
5
|
* Uses the angular renderer to generate a story. Uses p-limit to run synchronously
|
|
6
6
|
*/
|
|
7
|
-
export declare const prepareForInline: (storyFn: PartialStoryFn<AngularFramework>, { id, parameters }: StoryContext) => React.DetailedReactHTMLElement<React.HTMLAttributes<
|
|
7
|
+
export declare const prepareForInline: (storyFn: PartialStoryFn<AngularFramework>, { id, parameters, component }: StoryContext) => React.DetailedReactHTMLElement<React.HTMLAttributes<undefined>, undefined>;
|
|
@@ -2,7 +2,7 @@ import { PartialStoryFn } from '@storybook/csf';
|
|
|
2
2
|
import { StoryContext, AngularFramework } from '@storybook/angular';
|
|
3
3
|
export declare const skipSourceRender: (context: StoryContext) => any;
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Angular source decorator.
|
|
6
6
|
* @param storyFn Fn
|
|
7
7
|
* @param context StoryContext
|
|
8
8
|
*/
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
export declare const parameters: {
|
|
3
3
|
docs: {
|
|
4
4
|
inlineStories: boolean;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
getContainer: () => Promise<import("react").FunctionComponent<import("../../blocks").DocsContainerProps<import("@storybook/csf").AnyFramework>>>;
|
|
6
|
+
getPage: () => Promise<import("react").FC<{}>>;
|
|
7
7
|
iframeHeight: number;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { ArgType } from '@storybook/api';
|
|
1
2
|
interface TagItem {
|
|
2
3
|
name: string;
|
|
3
4
|
type: {
|
|
4
|
-
|
|
5
|
+
[key: string]: any;
|
|
5
6
|
};
|
|
6
7
|
description: string;
|
|
7
8
|
default?: any;
|
|
@@ -26,10 +27,10 @@ interface CustomElements {
|
|
|
26
27
|
];
|
|
27
28
|
}
|
|
28
29
|
export declare const extractArgTypesFromElements: (tagName: string, customElements: CustomElements) => {
|
|
29
|
-
[x: string]:
|
|
30
|
+
[x: string]: ArgType;
|
|
30
31
|
};
|
|
31
32
|
export declare const extractArgTypes: (tagName: string) => {
|
|
32
|
-
[x: string]:
|
|
33
|
+
[x: string]: ArgType;
|
|
33
34
|
};
|
|
34
35
|
export declare const extractComponentDescription: (tagName: string) => string;
|
|
35
36
|
export {};
|
|
@@ -23,6 +23,6 @@ declare type StoryImportProps = {
|
|
|
23
23
|
export declare type StoryProps = (StoryDefProps | StoryRefProps | StoryImportProps) & CommonProps;
|
|
24
24
|
export declare const lookupStoryId: (storyName: string, { mdxStoryNameToKey, mdxComponentAnnotations }: DocsContextProps) => string;
|
|
25
25
|
export declare const getStoryId: (props: StoryProps, context: DocsContextProps) => StoryId;
|
|
26
|
-
export declare const getStoryProps: <TFramework extends AnyFramework>({ height, inline }: StoryProps, story: StoryType<TFramework>, context: DocsContextProps<TFramework
|
|
26
|
+
export declare const getStoryProps: <TFramework extends AnyFramework>({ height, inline }: StoryProps, story: StoryType<TFramework>, context: DocsContextProps<TFramework>, onStoryFnCalled: () => void) => PureStoryProps;
|
|
27
27
|
declare const Story: FunctionComponent<StoryProps>;
|
|
28
28
|
export { Story };
|
|
@@ -3,7 +3,7 @@ import { SourceType } from '../../shared';
|
|
|
3
3
|
export declare const parameters: {
|
|
4
4
|
docs: {
|
|
5
5
|
inlineStories: boolean;
|
|
6
|
-
prepareForInline: (storyFn: import("@storybook/csf").PartialStoryFn<import("@storybook/angular").AngularFramework, import("@storybook/csf").Args>, { id, parameters }: import("@storybook/angular").StoryContext) => import("react").DetailedReactHTMLElement<import("react").HTMLAttributes<
|
|
6
|
+
prepareForInline: (storyFn: import("@storybook/csf").PartialStoryFn<import("@storybook/angular").AngularFramework, import("@storybook/csf").Args>, { id, parameters, component }: import("@storybook/angular").StoryContext) => import("react").DetailedReactHTMLElement<import("react").HTMLAttributes<undefined>, undefined>;
|
|
7
7
|
extractArgTypes: (component: import("./types").Directive) => import("@storybook/api").ArgTypes;
|
|
8
8
|
extractComponentDescription: (component: import("./types").Directive) => string;
|
|
9
9
|
source: {
|
|
@@ -4,4 +4,4 @@ import { PartialStoryFn } from '@storybook/csf';
|
|
|
4
4
|
/**
|
|
5
5
|
* Uses the angular renderer to generate a story. Uses p-limit to run synchronously
|
|
6
6
|
*/
|
|
7
|
-
export declare const prepareForInline: (storyFn: PartialStoryFn<AngularFramework>, { id, parameters }: StoryContext) => React.DetailedReactHTMLElement<React.HTMLAttributes<
|
|
7
|
+
export declare const prepareForInline: (storyFn: PartialStoryFn<AngularFramework>, { id, parameters, component }: StoryContext) => React.DetailedReactHTMLElement<React.HTMLAttributes<undefined>, undefined>;
|
|
@@ -2,7 +2,7 @@ import { PartialStoryFn } from '@storybook/csf';
|
|
|
2
2
|
import { StoryContext, AngularFramework } from '@storybook/angular';
|
|
3
3
|
export declare const skipSourceRender: (context: StoryContext) => any;
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Angular source decorator.
|
|
6
6
|
* @param storyFn Fn
|
|
7
7
|
* @param context StoryContext
|
|
8
8
|
*/
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
export declare const parameters: {
|
|
3
3
|
docs: {
|
|
4
4
|
inlineStories: boolean;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
getContainer: () => Promise<import("react").FunctionComponent<import("../../blocks").DocsContainerProps<import("@storybook/csf").AnyFramework>>>;
|
|
6
|
+
getPage: () => Promise<import("react").FC<{}>>;
|
|
7
7
|
iframeHeight: number;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { ArgType } from '@storybook/api';
|
|
1
2
|
interface TagItem {
|
|
2
3
|
name: string;
|
|
3
4
|
type: {
|
|
4
|
-
|
|
5
|
+
[key: string]: any;
|
|
5
6
|
};
|
|
6
7
|
description: string;
|
|
7
8
|
default?: any;
|
|
@@ -25,10 +26,10 @@ interface CustomElements {
|
|
|
25
26
|
modules?: [];
|
|
26
27
|
}
|
|
27
28
|
export declare const extractArgTypesFromElements: (tagName: string, customElements: CustomElements) => {
|
|
28
|
-
[x: string]:
|
|
29
|
+
[x: string]: ArgType;
|
|
29
30
|
};
|
|
30
31
|
export declare const extractArgTypes: (tagName: string) => {
|
|
31
|
-
[x: string]:
|
|
32
|
+
[x: string]: ArgType;
|
|
32
33
|
};
|
|
33
34
|
export declare const extractComponentDescription: (tagName: string) => string;
|
|
34
35
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/addon-docs",
|
|
3
|
-
"version": "6.4.0-beta.
|
|
3
|
+
"version": "6.4.0-beta.33",
|
|
4
4
|
"description": "Document component usage and properties in Markdown",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"addon",
|
|
@@ -63,22 +63,21 @@
|
|
|
63
63
|
"@mdx-js/loader": "^1.6.22",
|
|
64
64
|
"@mdx-js/mdx": "^1.6.22",
|
|
65
65
|
"@mdx-js/react": "^1.6.22",
|
|
66
|
-
"@storybook/addons": "6.4.0-beta.
|
|
67
|
-
"@storybook/api": "6.4.0-beta.
|
|
68
|
-
"@storybook/builder-webpack4": "6.4.0-beta.
|
|
69
|
-
"@storybook/client-
|
|
70
|
-
"@storybook/
|
|
71
|
-
"@storybook/
|
|
72
|
-
"@storybook/core": "6.4.0-beta.
|
|
73
|
-
"@storybook/
|
|
74
|
-
"@storybook/csf": "
|
|
75
|
-
"@storybook/
|
|
76
|
-
"@storybook/
|
|
77
|
-
"@storybook/
|
|
78
|
-
"@storybook/
|
|
79
|
-
"@storybook/
|
|
80
|
-
"@storybook/
|
|
81
|
-
"@storybook/theming": "6.4.0-beta.3",
|
|
66
|
+
"@storybook/addons": "6.4.0-beta.33",
|
|
67
|
+
"@storybook/api": "6.4.0-beta.33",
|
|
68
|
+
"@storybook/builder-webpack4": "6.4.0-beta.33",
|
|
69
|
+
"@storybook/client-logger": "6.4.0-beta.33",
|
|
70
|
+
"@storybook/components": "6.4.0-beta.33",
|
|
71
|
+
"@storybook/core": "6.4.0-beta.33",
|
|
72
|
+
"@storybook/core-events": "6.4.0-beta.33",
|
|
73
|
+
"@storybook/csf": "0.0.2--canary.87bc651.0",
|
|
74
|
+
"@storybook/csf-tools": "6.4.0-beta.33",
|
|
75
|
+
"@storybook/node-logger": "6.4.0-beta.33",
|
|
76
|
+
"@storybook/postinstall": "6.4.0-beta.33",
|
|
77
|
+
"@storybook/preview-web": "6.4.0-beta.33",
|
|
78
|
+
"@storybook/source-loader": "6.4.0-beta.33",
|
|
79
|
+
"@storybook/store": "6.4.0-beta.33",
|
|
80
|
+
"@storybook/theming": "6.4.0-beta.33",
|
|
82
81
|
"acorn": "^7.4.1",
|
|
83
82
|
"acorn-jsx": "^5.3.1",
|
|
84
83
|
"acorn-walk": "^7.2.0",
|
|
@@ -95,7 +94,7 @@
|
|
|
95
94
|
"p-limit": "^3.1.0",
|
|
96
95
|
"prettier": "^2.2.1",
|
|
97
96
|
"prop-types": "^15.7.2",
|
|
98
|
-
"react-element-to-jsx-string": "^14.3.
|
|
97
|
+
"react-element-to-jsx-string": "^14.3.4",
|
|
99
98
|
"regenerator-runtime": "^0.13.7",
|
|
100
99
|
"remark-external-links": "^8.0.0",
|
|
101
100
|
"remark-slug": "^6.0.0",
|
|
@@ -107,11 +106,11 @@
|
|
|
107
106
|
"@babel/core": "^7.12.10",
|
|
108
107
|
"@emotion/core": "^10.1.1",
|
|
109
108
|
"@emotion/styled": "^10.0.27",
|
|
110
|
-
"@storybook/angular": "6.4.0-beta.
|
|
111
|
-
"@storybook/html": "6.4.0-beta.
|
|
112
|
-
"@storybook/react": "6.4.0-beta.
|
|
113
|
-
"@storybook/vue": "6.4.0-beta.
|
|
114
|
-
"@storybook/web-components": "6.4.0-beta.
|
|
109
|
+
"@storybook/angular": "6.4.0-beta.33",
|
|
110
|
+
"@storybook/html": "6.4.0-beta.33",
|
|
111
|
+
"@storybook/react": "6.4.0-beta.33",
|
|
112
|
+
"@storybook/vue": "6.4.0-beta.33",
|
|
113
|
+
"@storybook/web-components": "6.4.0-beta.33",
|
|
115
114
|
"@types/cross-spawn": "^6.0.2",
|
|
116
115
|
"@types/doctrine": "^0.0.3",
|
|
117
116
|
"@types/enzyme": "^3.10.8",
|
|
@@ -141,12 +140,12 @@
|
|
|
141
140
|
"zone.js": "^0.11.3"
|
|
142
141
|
},
|
|
143
142
|
"peerDependencies": {
|
|
144
|
-
"@storybook/angular": "6.4.0-beta.
|
|
145
|
-
"@storybook/html": "6.4.0-beta.
|
|
146
|
-
"@storybook/react": "6.4.0-beta.
|
|
147
|
-
"@storybook/vue": "6.4.0-beta.
|
|
148
|
-
"@storybook/vue3": "6.4.0-beta.
|
|
149
|
-
"@storybook/web-components": "6.4.0-beta.
|
|
143
|
+
"@storybook/angular": "6.4.0-beta.33",
|
|
144
|
+
"@storybook/html": "6.4.0-beta.33",
|
|
145
|
+
"@storybook/react": "6.4.0-beta.33",
|
|
146
|
+
"@storybook/vue": "6.4.0-beta.33",
|
|
147
|
+
"@storybook/vue3": "6.4.0-beta.33",
|
|
148
|
+
"@storybook/web-components": "6.4.0-beta.33",
|
|
150
149
|
"lit": "^2.0.0-rc.1",
|
|
151
150
|
"lit-html": "^1.4.1 || ^2.0.0-rc.3",
|
|
152
151
|
"react": "^16.8.0 || ^17.0.0",
|
|
@@ -203,7 +202,7 @@
|
|
|
203
202
|
"publishConfig": {
|
|
204
203
|
"access": "public"
|
|
205
204
|
},
|
|
206
|
-
"gitHead": "
|
|
205
|
+
"gitHead": "c85171dc319d1d3a31eee1b762f01ba84ae45194",
|
|
207
206
|
"sbmodern": "dist/modern/index.js",
|
|
208
207
|
"storybook": {
|
|
209
208
|
"displayName": "Docs",
|