@storybook/addon-docs 5.3.13 → 5.3.14
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/frameworks/react/typeScript/handleProp.js +3 -1
- package/package.json +20 -12
- package/ts3.5/dist/blocks/Anchor.d.ts +6 -0
- package/ts3.5/dist/blocks/Description.d.ts +21 -0
- package/ts3.5/dist/blocks/DocsContainer.d.ts +7 -0
- package/ts3.5/dist/blocks/DocsContext.d.ts +17 -0
- package/ts3.5/dist/blocks/DocsPage.d.ts +3 -0
- package/ts3.5/dist/blocks/DocsPage.test.d.ts +1 -0
- package/ts3.5/dist/blocks/DocsStory.d.ts +3 -0
- package/ts3.5/dist/blocks/Heading.d.ts +6 -0
- package/ts3.5/dist/blocks/Meta.d.ts +14 -0
- package/ts3.5/dist/blocks/Preview.d.ts +13 -0
- package/ts3.5/dist/blocks/Primary.d.ts +7 -0
- package/ts3.5/dist/blocks/Props.d.ts +16 -0
- package/ts3.5/dist/blocks/Source.d.ts +26 -0
- package/ts3.5/dist/blocks/Stories.d.ts +8 -0
- package/ts3.5/dist/blocks/Story.d.ts +19 -0
- package/ts3.5/dist/blocks/Subheading.d.ts +3 -0
- package/ts3.5/dist/blocks/Subtitle.d.ts +8 -0
- package/ts3.5/dist/blocks/Title.d.ts +9 -0
- package/ts3.5/dist/blocks/Wrapper.d.ts +2 -0
- package/ts3.5/dist/blocks/index.d.ts +21 -0
- package/ts3.5/dist/blocks/mdx.d.ts +20 -0
- package/ts3.5/dist/blocks/shared.d.ts +33 -0
- package/ts3.5/dist/blocks/utils.d.ts +5 -0
- package/ts3.5/dist/frameworks/angular/compodoc.d.ts +11 -0
- package/ts3.5/dist/frameworks/angular/config.d.ts +1 -0
- package/ts3.5/dist/frameworks/angular/index.d.ts +1 -0
- package/ts3.5/dist/frameworks/angular/types.d.ts +36 -0
- package/ts3.5/dist/frameworks/common/config.d.ts +1 -0
- package/ts3.5/dist/frameworks/common/makePreset.d.ts +3 -0
- package/ts3.5/dist/frameworks/common/preset.d.ts +3 -0
- package/ts3.5/dist/frameworks/react/config.d.ts +1 -0
- package/ts3.5/dist/frameworks/react/extractProps.d.ts +6 -0
- package/ts3.5/dist/frameworks/react/lib/captions.d.ts +6 -0
- package/ts3.5/dist/frameworks/react/lib/defaultValues/createDefaultValue.d.ts +2 -0
- package/ts3.5/dist/frameworks/react/lib/defaultValues/createFromRawDefaultProp.d.ts +11 -0
- package/ts3.5/dist/frameworks/react/lib/defaultValues/generateArray.d.ts +3 -0
- package/ts3.5/dist/frameworks/react/lib/defaultValues/generateObject.d.ts +3 -0
- package/ts3.5/dist/frameworks/react/lib/defaultValues/index.d.ts +2 -0
- package/ts3.5/dist/frameworks/react/lib/defaultValues/prettyIdentifier.d.ts +4 -0
- package/ts3.5/dist/frameworks/react/lib/generateCode.d.ts +3 -0
- package/ts3.5/dist/frameworks/react/lib/index.d.ts +3 -0
- package/ts3.5/dist/frameworks/react/lib/inspection/acornParser.d.ts +7 -0
- package/ts3.5/dist/frameworks/react/lib/inspection/acornParser.test.d.ts +1 -0
- package/ts3.5/dist/frameworks/react/lib/inspection/index.d.ts +2 -0
- package/ts3.5/dist/frameworks/react/lib/inspection/inspectValue.d.ts +2 -0
- package/ts3.5/dist/frameworks/react/lib/inspection/types.d.ts +50 -0
- package/ts3.5/dist/frameworks/react/lib/isHtmlTag.d.ts +1 -0
- package/ts3.5/dist/frameworks/react/propTypes/createType.d.ts +3 -0
- package/ts3.5/dist/frameworks/react/propTypes/generateFuncSignature.d.ts +4 -0
- package/ts3.5/dist/frameworks/react/propTypes/generateFuncSignature.test.d.ts +1 -0
- package/ts3.5/dist/frameworks/react/propTypes/handleProp.d.ts +5 -0
- package/ts3.5/dist/frameworks/react/propTypes/handleProp.test.d.ts +1 -0
- package/ts3.5/dist/frameworks/react/propTypes/rawDefaultPropResolvers.d.ts +1 -0
- package/ts3.5/dist/frameworks/react/propTypes/sortProps.d.ts +3 -0
- package/ts3.5/dist/frameworks/react/typeScript/handleProp.d.ts +4 -0
- package/ts3.5/dist/frameworks/react/typeScript/handleProp.test.d.ts +1 -0
- package/ts3.5/dist/frameworks/vue/config.d.ts +1 -0
- package/ts3.5/dist/frameworks/vue/extractProps.d.ts +2 -0
- package/ts3.5/dist/frameworks/vue/preset.d.ts +1 -0
- package/ts3.5/dist/lib/docgen/createPropDef.d.ts +9 -0
- package/ts3.5/dist/lib/docgen/extractDocgenProps.d.ts +15 -0
- package/ts3.5/dist/lib/docgen/extractDocgenProps.test.d.ts +1 -0
- package/ts3.5/dist/lib/docgen/flow/createDefaultValue.d.ts +3 -0
- package/ts3.5/dist/lib/docgen/flow/createPropDef.d.ts +2 -0
- package/ts3.5/dist/lib/docgen/flow/createPropDef.test.d.ts +1 -0
- package/ts3.5/dist/lib/docgen/flow/createType.d.ts +3 -0
- package/ts3.5/dist/lib/docgen/index.d.ts +3 -0
- package/ts3.5/dist/lib/docgen/typeScript/createDefaultValue.d.ts +3 -0
- package/ts3.5/dist/lib/docgen/typeScript/createPropDef.d.ts +2 -0
- package/ts3.5/dist/lib/docgen/typeScript/createPropDef.test.d.ts +1 -0
- package/ts3.5/dist/lib/docgen/typeScript/createType.d.ts +3 -0
- package/ts3.5/dist/lib/docgen/types.d.ts +38 -0
- package/ts3.5/dist/lib/docgen/utils/defaultValue.d.ts +1 -0
- package/ts3.5/dist/lib/docgen/utils/docgenInfo.d.ts +5 -0
- package/ts3.5/dist/lib/docgen/utils/index.d.ts +3 -0
- package/ts3.5/dist/lib/docgen/utils/string.d.ts +1 -0
- package/ts3.5/dist/lib/index.d.ts +1 -0
- package/ts3.5/dist/lib/jsdocParser.d.ts +28 -0
- package/ts3.5/dist/lib/jsdocParser.test.d.ts +1 -0
- package/ts3.5/dist/lib/utils.d.ts +6 -0
- package/ts3.5/dist/preset.d.ts +1 -0
- package/ts3.5/dist/public_api.d.ts +0 -0
- package/ts3.5/dist/register.d.ts +1 -0
- package/ts3.5/dist/shared.d.ts +3 -0
- package/web-components/README.md +10 -1
|
@@ -34,5 +34,7 @@ function enhanceTypeScriptProp(extractedProp, rawDefaultProp) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
function enhanceTypeScriptProps(extractedProps) {
|
|
37
|
-
return extractedProps.map(
|
|
37
|
+
return extractedProps.map(function (prop) {
|
|
38
|
+
return enhanceTypeScriptProp(prop);
|
|
39
|
+
});
|
|
38
40
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/addon-docs",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.14",
|
|
4
4
|
"description": "Superior documentation for your components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"addon",
|
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
"directory": "addons/docs"
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
|
+
"main": "dist/public_api.js",
|
|
21
|
+
"types": "dist/public_api.d.ts",
|
|
20
22
|
"files": [
|
|
21
23
|
"dist/**/*",
|
|
22
24
|
"angular/**/*",
|
|
@@ -29,10 +31,9 @@
|
|
|
29
31
|
"web-components/**/*",
|
|
30
32
|
"README.md",
|
|
31
33
|
"*.js",
|
|
32
|
-
"*.d.ts"
|
|
34
|
+
"*.d.ts",
|
|
35
|
+
"ts3.5/**/*"
|
|
33
36
|
],
|
|
34
|
-
"main": "dist/public_api.js",
|
|
35
|
-
"types": "dist/public_api.d.ts",
|
|
36
37
|
"scripts": {
|
|
37
38
|
"prepare": "node ../../scripts/prepare.js"
|
|
38
39
|
},
|
|
@@ -45,14 +46,14 @@
|
|
|
45
46
|
"@mdx-js/loader": "^1.5.1",
|
|
46
47
|
"@mdx-js/mdx": "^1.5.1",
|
|
47
48
|
"@mdx-js/react": "^1.5.1",
|
|
48
|
-
"@storybook/addons": "5.3.
|
|
49
|
-
"@storybook/api": "5.3.
|
|
50
|
-
"@storybook/components": "5.3.
|
|
51
|
-
"@storybook/core-events": "5.3.
|
|
49
|
+
"@storybook/addons": "5.3.14",
|
|
50
|
+
"@storybook/api": "5.3.14",
|
|
51
|
+
"@storybook/components": "5.3.14",
|
|
52
|
+
"@storybook/core-events": "5.3.14",
|
|
52
53
|
"@storybook/csf": "0.0.1",
|
|
53
|
-
"@storybook/postinstall": "5.3.
|
|
54
|
-
"@storybook/source-loader": "5.3.
|
|
55
|
-
"@storybook/theming": "5.3.
|
|
54
|
+
"@storybook/postinstall": "5.3.14",
|
|
55
|
+
"@storybook/source-loader": "5.3.14",
|
|
56
|
+
"@storybook/theming": "5.3.14",
|
|
56
57
|
"acorn": "^7.1.0",
|
|
57
58
|
"acorn-jsx": "^5.1.0",
|
|
58
59
|
"acorn-walk": "^7.0.0",
|
|
@@ -88,5 +89,12 @@
|
|
|
88
89
|
"publishConfig": {
|
|
89
90
|
"access": "public"
|
|
90
91
|
},
|
|
91
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "91d9c0c4e0afd7e494b23ec8076b21e45b7a8906",
|
|
93
|
+
"typesVersions": {
|
|
94
|
+
"<=3.5": {
|
|
95
|
+
"*": [
|
|
96
|
+
"ts3.5/*"
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
}
|
|
92
100
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { DescriptionProps as PureDescriptionProps } from '@storybook/components';
|
|
3
|
+
import { DocsContextProps } from './DocsContext';
|
|
4
|
+
import { Component, DescriptionSlot } from './shared';
|
|
5
|
+
export declare enum DescriptionType {
|
|
6
|
+
INFO = "info",
|
|
7
|
+
NOTES = "notes",
|
|
8
|
+
DOCGEN = "docgen",
|
|
9
|
+
LEGACY_5_2 = "legacy-5.2",
|
|
10
|
+
AUTO = "auto"
|
|
11
|
+
}
|
|
12
|
+
interface DescriptionProps {
|
|
13
|
+
slot?: DescriptionSlot;
|
|
14
|
+
of?: '.' | Component;
|
|
15
|
+
type?: DescriptionType;
|
|
16
|
+
markdown?: string;
|
|
17
|
+
children?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const getDescriptionProps: ({ of, type, markdown, children }: DescriptionProps, { parameters }: DocsContextProps) => PureDescriptionProps;
|
|
20
|
+
declare const DescriptionContainer: FunctionComponent<DescriptionProps>;
|
|
21
|
+
export { DescriptionContainer as Description };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Context } from 'react';
|
|
2
|
+
export interface DocsContextProps {
|
|
3
|
+
id?: string;
|
|
4
|
+
selectedKind?: string;
|
|
5
|
+
selectedStory?: string;
|
|
6
|
+
/**
|
|
7
|
+
* mdxStoryNameToKey is an MDX-compiler-generated mapping of an MDX story's
|
|
8
|
+
* display name to its story key for ID generation. It's used internally by the `<Story>`
|
|
9
|
+
* and `Preview` doc blocks.
|
|
10
|
+
*/
|
|
11
|
+
mdxStoryNameToKey?: Record<string, string>;
|
|
12
|
+
mdxComponentMeta?: any;
|
|
13
|
+
parameters?: any;
|
|
14
|
+
storyStore?: any;
|
|
15
|
+
forceRender?: () => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const DocsContext: Context<DocsContextProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
declare type Decorator = (...args: any) => any;
|
|
3
|
+
interface MetaProps {
|
|
4
|
+
title: string;
|
|
5
|
+
component?: any;
|
|
6
|
+
decorators?: [Decorator];
|
|
7
|
+
parameters?: any;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* This component is used to declare component metadata in docs
|
|
11
|
+
* and gets transformed into a default export underneath the hood.
|
|
12
|
+
*/
|
|
13
|
+
export declare const Meta: FC<MetaProps>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { PreviewProps as PurePreviewProps } from '@storybook/components';
|
|
3
|
+
export declare enum SourceState {
|
|
4
|
+
OPEN = "open",
|
|
5
|
+
CLOSED = "closed",
|
|
6
|
+
NONE = "none"
|
|
7
|
+
}
|
|
8
|
+
declare type PreviewProps = PurePreviewProps & {
|
|
9
|
+
withSource?: SourceState;
|
|
10
|
+
mdxSource?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const Preview: FunctionComponent<PreviewProps>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { PropsTableProps } from '@storybook/components';
|
|
3
|
+
import { DocsContextProps } from './DocsContext';
|
|
4
|
+
import { Component, PropsSlot } from './shared';
|
|
5
|
+
interface PropsProps {
|
|
6
|
+
exclude?: string[];
|
|
7
|
+
of?: '.' | Component;
|
|
8
|
+
components?: {
|
|
9
|
+
[label: string]: Component;
|
|
10
|
+
};
|
|
11
|
+
slot?: PropsSlot;
|
|
12
|
+
}
|
|
13
|
+
export declare const getComponentProps: (component: any, { exclude }: PropsProps, { parameters }: DocsContextProps) => PropsTableProps;
|
|
14
|
+
export declare const getComponent: (props: PropsProps, context: DocsContextProps) => any;
|
|
15
|
+
declare const PropsContainer: FunctionComponent<PropsProps>;
|
|
16
|
+
export { PropsContainer as Props };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { SourceProps as PureSourceProps } from '@storybook/components';
|
|
3
|
+
import { DocsContextProps } from './DocsContext';
|
|
4
|
+
interface CommonProps {
|
|
5
|
+
language?: string;
|
|
6
|
+
dark?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare type SingleSourceProps = {
|
|
9
|
+
id: string;
|
|
10
|
+
} & CommonProps;
|
|
11
|
+
declare type MultiSourceProps = {
|
|
12
|
+
ids: string[];
|
|
13
|
+
} & CommonProps;
|
|
14
|
+
declare type CodeProps = {
|
|
15
|
+
code: string;
|
|
16
|
+
} & CommonProps;
|
|
17
|
+
declare type NoneProps = CommonProps;
|
|
18
|
+
declare type SourceProps = SingleSourceProps | MultiSourceProps | CodeProps | NoneProps;
|
|
19
|
+
export declare const getSourceProps: (props: SourceProps, { id: currentId, storyStore }: DocsContextProps) => PureSourceProps;
|
|
20
|
+
/**
|
|
21
|
+
* Story source doc block renders source code if provided,
|
|
22
|
+
* or the source for a story if `storyId` is provided, or
|
|
23
|
+
* the source for the current story if nothing is provided.
|
|
24
|
+
*/
|
|
25
|
+
declare const SourceContainer: FunctionComponent<SourceProps>;
|
|
26
|
+
export { SourceContainer as Source };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FunctionComponent, ReactNode } from 'react';
|
|
2
|
+
import { StoryProps as PureStoryProps } from '@storybook/components';
|
|
3
|
+
import { DocsContextProps } from './DocsContext';
|
|
4
|
+
export declare const storyBlockIdFromId: (storyId: string) => string;
|
|
5
|
+
interface CommonProps {
|
|
6
|
+
height?: string;
|
|
7
|
+
inline?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare type StoryDefProps = {
|
|
10
|
+
name: string;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
} & CommonProps;
|
|
13
|
+
declare type StoryRefProps = {
|
|
14
|
+
id?: string;
|
|
15
|
+
} & CommonProps;
|
|
16
|
+
export declare type StoryProps = StoryDefProps | StoryRefProps;
|
|
17
|
+
export declare const getStoryProps: (props: StoryProps, { id: currentId, storyStore, mdxStoryNameToKey, mdxComponentMeta }: DocsContextProps) => PureStoryProps;
|
|
18
|
+
declare const StoryContainer: FunctionComponent<StoryProps>;
|
|
19
|
+
export { StoryContainer as Story };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { StringSlot } from './shared';
|
|
3
|
+
interface TitleProps {
|
|
4
|
+
slot?: StringSlot;
|
|
5
|
+
children?: JSX.Element | string;
|
|
6
|
+
}
|
|
7
|
+
export declare const defaultTitleSlot: StringSlot;
|
|
8
|
+
export declare const Title: FunctionComponent<TitleProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { ColorPalette, ColorItem, IconGallery, IconItem, Typeset } from '@storybook/components';
|
|
2
|
+
export * from './Anchor';
|
|
3
|
+
export * from './Description';
|
|
4
|
+
export * from './DocsContext';
|
|
5
|
+
export * from './DocsPage';
|
|
6
|
+
export * from './DocsContainer';
|
|
7
|
+
export * from './DocsStory';
|
|
8
|
+
export * from './Heading';
|
|
9
|
+
export * from './Meta';
|
|
10
|
+
export * from './Preview';
|
|
11
|
+
export * from './Primary';
|
|
12
|
+
export * from './Props';
|
|
13
|
+
export * from './Source';
|
|
14
|
+
export * from './Stories';
|
|
15
|
+
export * from './Story';
|
|
16
|
+
export * from './Subheading';
|
|
17
|
+
export * from './Subtitle';
|
|
18
|
+
export * from './Title';
|
|
19
|
+
export * from './Wrapper';
|
|
20
|
+
export * from './shared';
|
|
21
|
+
export * from './mdx';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { DocsContextProps } from './DocsContext';
|
|
3
|
+
export declare const assertIsFn: (val: any) => any;
|
|
4
|
+
export declare const AddContext: FC<DocsContextProps>;
|
|
5
|
+
interface CodeOrSourceMdxProps {
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const CodeOrSourceMdx: FC<CodeOrSourceMdxProps>;
|
|
9
|
+
interface AnchorMdxProps {
|
|
10
|
+
href: string;
|
|
11
|
+
target: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const AnchorMdx: FC<AnchorMdxProps>;
|
|
14
|
+
interface HeaderMdxProps {
|
|
15
|
+
as: string;
|
|
16
|
+
id: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const HeaderMdx: FC<HeaderMdxProps>;
|
|
19
|
+
export declare const HeadersMdx: {};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { PropsTableProps } from '@storybook/components';
|
|
2
|
+
export declare const CURRENT_SELECTION = ".";
|
|
3
|
+
export declare type Component = any;
|
|
4
|
+
export interface StoryData {
|
|
5
|
+
id?: string;
|
|
6
|
+
kind?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
parameters?: any;
|
|
9
|
+
}
|
|
10
|
+
export declare type DocsStoryProps = StoryData & {
|
|
11
|
+
expanded?: boolean;
|
|
12
|
+
withToolbar?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export interface SlotContext {
|
|
15
|
+
id?: string;
|
|
16
|
+
selectedKind?: string;
|
|
17
|
+
selectedStory?: string;
|
|
18
|
+
parameters?: any;
|
|
19
|
+
storyStore?: any;
|
|
20
|
+
}
|
|
21
|
+
export declare type StringSlot = (context: SlotContext) => string;
|
|
22
|
+
export declare type DescriptionSlot = (description: string, context: SlotContext) => string;
|
|
23
|
+
export declare type PropsSlot = (context: SlotContext, component: Component) => PropsTableProps;
|
|
24
|
+
export declare type StorySlot = (stories: StoryData[], context: SlotContext) => DocsStoryProps;
|
|
25
|
+
export declare type StoriesSlot = (stories: StoryData[], context: SlotContext) => DocsStoryProps[];
|
|
26
|
+
export interface DocsPageProps {
|
|
27
|
+
titleSlot?: StringSlot;
|
|
28
|
+
subtitleSlot?: StringSlot;
|
|
29
|
+
descriptionSlot?: DescriptionSlot;
|
|
30
|
+
primarySlot?: StorySlot;
|
|
31
|
+
propsSlot?: PropsSlot;
|
|
32
|
+
storiesSlot?: StoriesSlot;
|
|
33
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DocsContextProps } from './DocsContext';
|
|
2
|
+
import { StoryData } from './shared';
|
|
3
|
+
export declare const getDocsStories: (context: DocsContextProps) => StoryData[];
|
|
4
|
+
export declare const getComponentName: (component: any) => string;
|
|
5
|
+
export declare function scrollToElement(element: any, block?: string): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PropDef } from '@storybook/components';
|
|
2
|
+
import { CompodocJson, Method, Property, Directive } from './types';
|
|
3
|
+
export declare const isMethod: (methodOrProp: Method | Property) => methodOrProp is Method;
|
|
4
|
+
export declare const setCompodocJson: (compodocJson: CompodocJson) => void;
|
|
5
|
+
export declare const getCompdocJson: () => CompodocJson;
|
|
6
|
+
export declare const checkValidComponentOrDirective: (component: Directive) => void;
|
|
7
|
+
export declare const checkValidCompodocJson: (compodocJson: CompodocJson) => void;
|
|
8
|
+
export declare const extractProps: (component: Directive) => {
|
|
9
|
+
sections: Record<string, PropDef[]>;
|
|
10
|
+
};
|
|
11
|
+
export declare const extractComponentDescription: (component: Directive) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './compodoc';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface Method {
|
|
2
|
+
name: string;
|
|
3
|
+
args: Argument[];
|
|
4
|
+
returnType: string;
|
|
5
|
+
decorators: Decorator[];
|
|
6
|
+
description: string;
|
|
7
|
+
}
|
|
8
|
+
export interface Property {
|
|
9
|
+
name: string;
|
|
10
|
+
decorators: Decorator[];
|
|
11
|
+
type: string;
|
|
12
|
+
optional: boolean;
|
|
13
|
+
defaultValue?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface Directive {
|
|
17
|
+
name: string;
|
|
18
|
+
propertiesClass: Property[];
|
|
19
|
+
inputsClass: Property[];
|
|
20
|
+
outputsClass: Property[];
|
|
21
|
+
methodsClass: Method[];
|
|
22
|
+
rawdescription: string;
|
|
23
|
+
}
|
|
24
|
+
export declare type Component = Directive;
|
|
25
|
+
export interface Argument {
|
|
26
|
+
name: string;
|
|
27
|
+
type: string;
|
|
28
|
+
optional?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface Decorator {
|
|
31
|
+
name: string;
|
|
32
|
+
}
|
|
33
|
+
export interface CompodocJson {
|
|
34
|
+
directives: Directive[];
|
|
35
|
+
components: Component[];
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const CUSTOM_CAPTION = "custom";
|
|
2
|
+
export declare const OBJECT_CAPTION = "object";
|
|
3
|
+
export declare const ARRAY_CAPTION = "array";
|
|
4
|
+
export declare const CLASS_CAPTION = "class";
|
|
5
|
+
export declare const FUNCTION_CAPTION = "func";
|
|
6
|
+
export declare const ELEMENT_CAPTION = "element";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PropDefaultValue, PropDef } from '@storybook/components';
|
|
2
|
+
export declare type TypeResolver = (rawDefaultProp: any, propDef: PropDef) => PropDefaultValue;
|
|
3
|
+
export interface TypeResolvers {
|
|
4
|
+
string: TypeResolver;
|
|
5
|
+
object: TypeResolver;
|
|
6
|
+
function: TypeResolver;
|
|
7
|
+
default: TypeResolver;
|
|
8
|
+
}
|
|
9
|
+
export declare function extractFunctionName(func: Function, propName: string): string;
|
|
10
|
+
export declare function createTypeResolvers(customResolvers?: Partial<TypeResolvers>): TypeResolvers;
|
|
11
|
+
export declare function createDefaultValueFromRawDefaultProp(rawDefaultProp: any, propDef: PropDef, typeResolvers?: TypeResolvers): PropDefaultValue;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { InspectionIdentifiableInferedType } from '../inspection';
|
|
2
|
+
export declare function getPrettyIdentifier(inferedType: InspectionIdentifiableInferedType): string;
|
|
3
|
+
export declare function getPrettyFuncIdentifier(identifier: string, hasArguments: boolean): string;
|
|
4
|
+
export declare function getPrettyElementIdentifier(identifier: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export declare enum InspectionType {
|
|
2
|
+
IDENTIFIER = "Identifier",
|
|
3
|
+
LITERAL = "Literal",
|
|
4
|
+
OBJECT = "Object",
|
|
5
|
+
ARRAY = "Array",
|
|
6
|
+
FUNCTION = "Function",
|
|
7
|
+
CLASS = "Class",
|
|
8
|
+
ELEMENT = "Element",
|
|
9
|
+
UNKNOWN = "Unknown"
|
|
10
|
+
}
|
|
11
|
+
export interface InspectionInferedType {
|
|
12
|
+
type: InspectionType;
|
|
13
|
+
}
|
|
14
|
+
export interface InspectionIdentifier extends InspectionInferedType {
|
|
15
|
+
type: InspectionType.IDENTIFIER;
|
|
16
|
+
identifier: string;
|
|
17
|
+
}
|
|
18
|
+
export interface InspectionLiteral extends InspectionInferedType {
|
|
19
|
+
type: InspectionType.LITERAL;
|
|
20
|
+
}
|
|
21
|
+
export interface InspectionObject extends InspectionInferedType {
|
|
22
|
+
type: InspectionType.OBJECT;
|
|
23
|
+
depth: number;
|
|
24
|
+
}
|
|
25
|
+
export interface InspectionArray extends InspectionInferedType {
|
|
26
|
+
type: InspectionType.ARRAY;
|
|
27
|
+
depth: number;
|
|
28
|
+
}
|
|
29
|
+
export interface InspectionClass extends InspectionInferedType {
|
|
30
|
+
type: InspectionType.CLASS;
|
|
31
|
+
identifier: string;
|
|
32
|
+
}
|
|
33
|
+
export interface InspectionFunction extends InspectionInferedType {
|
|
34
|
+
type: InspectionType.FUNCTION;
|
|
35
|
+
identifier?: string;
|
|
36
|
+
params: any[];
|
|
37
|
+
hasParams: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface InspectionElement extends InspectionInferedType {
|
|
40
|
+
type: InspectionType.ELEMENT;
|
|
41
|
+
identifier?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface InspectionUnknown extends InspectionInferedType {
|
|
44
|
+
type: InspectionType.UNKNOWN;
|
|
45
|
+
}
|
|
46
|
+
export declare type InspectionIdentifiableInferedType = InspectionIdentifier | InspectionClass | InspectionFunction | InspectionElement;
|
|
47
|
+
export interface InspectionResult {
|
|
48
|
+
inferedType: InspectionInferedType;
|
|
49
|
+
ast?: any;
|
|
50
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isHtmlTag(tagName: string): boolean;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ExtractedJsDocParam, ExtractedJsDocReturns } from '../../../lib/jsdocParser';
|
|
2
|
+
export declare function generateFuncSignature(params: ExtractedJsDocParam[], returns: ExtractedJsDocReturns): string;
|
|
3
|
+
export declare function generateShortFuncSignature(params: ExtractedJsDocParam[], returns: ExtractedJsDocReturns): string;
|
|
4
|
+
export declare function toMultilineSignature(signature: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PropDef } from '@storybook/components';
|
|
2
|
+
import { ExtractedProp } from '../../../lib/docgen';
|
|
3
|
+
import { Component } from '../../../blocks/shared';
|
|
4
|
+
export declare function enhancePropTypesProp(extractedProp: ExtractedProp, rawDefaultProp?: any): PropDef;
|
|
5
|
+
export declare function enhancePropTypesProps(extractedProps: ExtractedProp[], component: Component): PropDef[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const rawDefaultPropTypeResolvers: import("../lib/defaultValues").TypeResolvers;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PropDef } from '@storybook/components';
|
|
2
|
+
import { ExtractedProp } from '../../../lib/docgen';
|
|
3
|
+
export declare function enhanceTypeScriptProp(extractedProp: ExtractedProp, rawDefaultProp?: any): PropDef;
|
|
4
|
+
export declare function enhanceTypeScriptProps(extractedProps: ExtractedProp[]): PropDef[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function webpack(webpackConfig?: any, options?: any): any;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PropDef } from '@storybook/components';
|
|
2
|
+
import { TypeSystem, DocgenInfo } from './types';
|
|
3
|
+
import { JsDocParsingResult } from '../jsdocParser';
|
|
4
|
+
export declare type PropDefFactory = (propName: string, docgenInfo: DocgenInfo, jsDocParsingResult?: JsDocParsingResult) => PropDef;
|
|
5
|
+
export declare const javaScriptFactory: PropDefFactory;
|
|
6
|
+
export declare const tsFactory: PropDefFactory;
|
|
7
|
+
export declare const flowFactory: PropDefFactory;
|
|
8
|
+
export declare const unknownFactory: PropDefFactory;
|
|
9
|
+
export declare const getPropDefFactory: (typeSystem: TypeSystem) => PropDefFactory;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PropDef } from '@storybook/components';
|
|
2
|
+
import { Component } from '../../blocks/shared';
|
|
3
|
+
import { ExtractedJsDoc } from '../jsdocParser';
|
|
4
|
+
import { DocgenInfo, TypeSystem } from './types';
|
|
5
|
+
export interface ExtractedProp {
|
|
6
|
+
propDef: PropDef;
|
|
7
|
+
docgenInfo: DocgenInfo;
|
|
8
|
+
jsDocTags: ExtractedJsDoc;
|
|
9
|
+
typeSystem: TypeSystem;
|
|
10
|
+
}
|
|
11
|
+
export declare type ExtractProps = (component: Component, section: string) => ExtractedProp[];
|
|
12
|
+
export declare const extractComponentSectionArray: (docgenSection: any) => any;
|
|
13
|
+
export declare const extractComponentSectionObject: (docgenSection: any) => ExtractedProp[];
|
|
14
|
+
export declare const extractComponentProps: ExtractProps;
|
|
15
|
+
export declare function extractComponentDescription(component?: Component): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { PropsTableProps } from '@storybook/components';
|
|
2
|
+
import { Component } from '../../blocks/shared';
|
|
3
|
+
export declare type PropsExtractor = (component: Component) => PropsTableProps | null;
|
|
4
|
+
export interface DocgenType {
|
|
5
|
+
name: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface DocgenPropType extends DocgenType {
|
|
10
|
+
value?: any;
|
|
11
|
+
raw?: string;
|
|
12
|
+
computed?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface DocgenFlowType extends DocgenType {
|
|
15
|
+
type?: string;
|
|
16
|
+
raw?: string;
|
|
17
|
+
signature?: any;
|
|
18
|
+
elements?: any[];
|
|
19
|
+
}
|
|
20
|
+
export interface DocgenTypeScriptType extends DocgenType {
|
|
21
|
+
}
|
|
22
|
+
export interface DocgenPropDefaultValue {
|
|
23
|
+
value: string;
|
|
24
|
+
}
|
|
25
|
+
export interface DocgenInfo {
|
|
26
|
+
type?: DocgenPropType;
|
|
27
|
+
flowType?: DocgenFlowType;
|
|
28
|
+
tsType?: DocgenTypeScriptType;
|
|
29
|
+
required: boolean;
|
|
30
|
+
description?: string;
|
|
31
|
+
defaultValue?: DocgenPropDefaultValue;
|
|
32
|
+
}
|
|
33
|
+
export declare enum TypeSystem {
|
|
34
|
+
JAVASCRIPT = "JavaScript",
|
|
35
|
+
FLOW = "Flow",
|
|
36
|
+
TYPESCRIPT = "TypeScript",
|
|
37
|
+
UNKNOWN = "Unknown"
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isDefaultValueBlacklisted(value: string): boolean;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Component } from '../../../blocks/shared';
|
|
2
|
+
export declare function hasDocgen(component: Component): boolean;
|
|
3
|
+
export declare function isValidDocgenSection(docgenSection: any): boolean;
|
|
4
|
+
export declare function getDocgenSection(component: Component, section: string): any;
|
|
5
|
+
export declare function getDocgenDescription(component: Component): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const str: (obj: any) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './utils';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface ExtractedJsDocParam {
|
|
2
|
+
name: string;
|
|
3
|
+
type?: any;
|
|
4
|
+
description?: string;
|
|
5
|
+
getPrettyName: () => string;
|
|
6
|
+
getTypeName: () => string;
|
|
7
|
+
}
|
|
8
|
+
export interface ExtractedJsDocReturns {
|
|
9
|
+
type?: any;
|
|
10
|
+
description?: string;
|
|
11
|
+
getTypeName: () => string;
|
|
12
|
+
}
|
|
13
|
+
export interface ExtractedJsDoc {
|
|
14
|
+
params?: ExtractedJsDocParam[];
|
|
15
|
+
returns?: ExtractedJsDocReturns;
|
|
16
|
+
ignore: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface JsDocParsingOptions {
|
|
19
|
+
tags?: string[];
|
|
20
|
+
}
|
|
21
|
+
export interface JsDocParsingResult {
|
|
22
|
+
includesJsDoc: boolean;
|
|
23
|
+
ignore: boolean;
|
|
24
|
+
description?: string;
|
|
25
|
+
extractedTags?: ExtractedJsDoc;
|
|
26
|
+
}
|
|
27
|
+
export declare type ParseJsDoc = (value?: string, options?: JsDocParsingOptions) => JsDocParsingResult;
|
|
28
|
+
export declare const parseJsDoc: ParseJsDoc;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PropSummaryValue } from '@storybook/components';
|
|
2
|
+
export declare const MAX_TYPE_SUMMARY_LENGTH = 90;
|
|
3
|
+
export declare const MAX_DEFALUT_VALUE_SUMMARY_LENGTH = 50;
|
|
4
|
+
export declare function isTooLongForTypeSummary(value: string): boolean;
|
|
5
|
+
export declare function isTooLongForDefaultValueSummary(value: string): boolean;
|
|
6
|
+
export declare function createSummaryValue(summary: string, detail?: string): PropSummaryValue;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/web-components/README.md
CHANGED
|
@@ -35,7 +35,16 @@ Known analyzers that output `custom-elements.json`:
|
|
|
35
35
|
- [stenciljs](https://stenciljs.com/)
|
|
36
36
|
- Supports Stencil (but does not have all metadata)
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
To generate this file with Stencil, add `docs-vscode` to outputTargets in `stencil.config.ts`:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
{
|
|
42
|
+
type: 'docs-vscode',
|
|
43
|
+
file: 'custom-elements.json'
|
|
44
|
+
},
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The file looks somewthing like this:
|
|
39
48
|
|
|
40
49
|
```json
|
|
41
50
|
{
|