@storybook/addon-docs 6.5.0-alpha.6 → 6.5.0-alpha.62
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/README.md +4 -13
- package/angular/README.md +0 -6
- package/angular/index.d.ts +1 -1
- package/angular/index.js +7 -1
- package/dist/cjs/blocks/Anchor.js +1 -1
- package/dist/cjs/blocks/ArgsTable.js +49 -13
- package/dist/cjs/blocks/Canvas.js +13 -11
- package/dist/cjs/blocks/Description.js +10 -10
- package/dist/cjs/blocks/DocsContainer.js +8 -6
- package/dist/cjs/blocks/DocsContext.js +2 -2
- package/dist/cjs/blocks/Heading.js +2 -2
- package/dist/cjs/blocks/Meta.js +8 -6
- package/dist/cjs/blocks/Primary.js +7 -7
- package/dist/cjs/blocks/Source.js +23 -10
- package/dist/cjs/blocks/SourceContainer.js +28 -18
- package/dist/cjs/blocks/Stories.js +14 -7
- package/dist/cjs/blocks/Story.js +12 -30
- package/dist/cjs/blocks/Subheading.js +2 -2
- package/dist/cjs/blocks/Subtitle.js +5 -5
- package/dist/cjs/blocks/Title.js +8 -8
- package/dist/cjs/blocks/enhanceSource.js +5 -5
- package/dist/cjs/blocks/index.js +6 -4
- package/dist/cjs/blocks/mdx.js +18 -10
- package/dist/cjs/blocks/useStory.js +8 -6
- package/dist/cjs/blocks/utils.js +3 -3
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/{register.js → manager.js} +0 -0
- package/dist/cjs/preset.js +226 -0
- package/dist/cjs/{frameworks/common/config.js → preview.js} +11 -17
- package/dist/esm/blocks/ArgsTable.js +39 -6
- package/dist/esm/blocks/Canvas.js +5 -3
- package/dist/esm/blocks/Description.js +1 -1
- package/dist/esm/blocks/DocsContainer.js +3 -2
- package/dist/esm/blocks/DocsContext.js +2 -2
- package/dist/esm/blocks/Heading.js +1 -1
- package/dist/esm/blocks/Meta.js +3 -2
- package/dist/esm/blocks/Primary.js +1 -0
- package/dist/esm/blocks/Source.js +16 -2
- package/dist/esm/blocks/SourceContainer.js +22 -13
- package/dist/esm/blocks/Stories.js +7 -0
- package/dist/esm/blocks/Story.js +6 -25
- package/dist/esm/blocks/Subheading.js +1 -1
- package/dist/esm/blocks/Title.js +1 -1
- package/dist/esm/blocks/enhanceSource.js +3 -3
- package/dist/esm/blocks/mdx.js +16 -9
- package/dist/esm/blocks/useStory.js +15 -15
- package/dist/esm/blocks/utils.js +1 -1
- package/dist/esm/{register.js → manager.js} +0 -0
- package/dist/esm/preset.js +197 -0
- package/dist/esm/{frameworks/common/config.js → preview.js} +5 -9
- package/dist/modern/blocks/ArgsTable.js +24 -3
- package/dist/modern/blocks/Canvas.js +3 -1
- package/dist/modern/blocks/Description.js +1 -1
- package/dist/modern/blocks/DocsContext.js +2 -2
- package/dist/modern/blocks/Source.js +17 -2
- package/dist/modern/blocks/SourceContainer.js +18 -12
- package/dist/modern/blocks/Stories.js +5 -0
- package/dist/modern/blocks/Story.js +2 -24
- package/dist/modern/blocks/mdx.js +13 -8
- package/dist/modern/{register.js → manager.js} +0 -0
- package/dist/modern/{frameworks/common/preset.js → preset.js} +16 -17
- package/dist/modern/preview.js +6 -0
- package/dist/ts3.4/blocks/Source.d.ts +5 -3
- package/dist/ts3.4/blocks/SourceContainer.d.ts +5 -1
- package/dist/ts3.4/{register.d.ts → manager.d.ts} +0 -0
- package/dist/ts3.4/preset.d.ts +11 -0
- package/dist/ts3.4/preview.d.ts +6 -0
- package/dist/ts3.9/blocks/DocsContext.d.ts +2 -2
- package/dist/ts3.9/blocks/Source.d.ts +5 -3
- package/dist/ts3.9/blocks/SourceContainer.d.ts +6 -2
- package/dist/ts3.9/blocks/enhanceSource.d.ts +2 -2
- package/dist/ts3.9/blocks/useStory.d.ts +2 -2
- package/dist/ts3.9/{register.d.ts → manager.d.ts} +0 -0
- package/dist/ts3.9/preset.d.ts +11 -0
- package/dist/ts3.9/preview.d.ts +6 -0
- package/ember/index.js +6 -1
- package/jest-transform-mdx.js +2 -5
- package/manager.js +1 -0
- package/mdx-compiler-plugin.js +1 -1
- package/package.json +24 -118
- package/preset.js +1 -16
- package/preview.js +1 -0
- package/register.js +6 -1
- package/{dist/cjs/frameworks/svelte → svelte}/HOC.svelte +0 -0
- package/common-preset.js +0 -19
- package/dist/cjs/frameworks/angular/compodoc.js +0 -397
- package/dist/cjs/frameworks/angular/config.js +0 -31
- package/dist/cjs/frameworks/angular/index.js +0 -22
- package/dist/cjs/frameworks/angular/prepareForInline.js +0 -96
- package/dist/cjs/frameworks/angular/sourceDecorator.js +0 -159
- package/dist/cjs/frameworks/angular/types.js +0 -1
- package/dist/cjs/frameworks/common/enhanceArgTypes.js +0 -21
- package/dist/cjs/frameworks/common/preset.js +0 -187
- package/dist/cjs/frameworks/ember/config.js +0 -17
- package/dist/cjs/frameworks/ember/index.js +0 -13
- package/dist/cjs/frameworks/ember/jsondoc.js +0 -87
- package/dist/cjs/frameworks/html/config.js +0 -26
- package/dist/cjs/frameworks/html/prepareForInline.js +0 -29
- package/dist/cjs/frameworks/html/sourceDecorator.js +0 -67
- package/dist/cjs/frameworks/react/config.js +0 -27
- package/dist/cjs/frameworks/react/extractArgTypes.js +0 -52
- package/dist/cjs/frameworks/react/extractProps.js +0 -77
- package/dist/cjs/frameworks/react/jsxDecorator.js +0 -277
- package/dist/cjs/frameworks/react/lib/captions.js +0 -18
- package/dist/cjs/frameworks/react/lib/componentTypes.js +0 -24
- package/dist/cjs/frameworks/react/lib/defaultValues/createDefaultValue.js +0 -81
- package/dist/cjs/frameworks/react/lib/defaultValues/createFromRawDefaultProp.js +0 -225
- package/dist/cjs/frameworks/react/lib/defaultValues/generateArray.js +0 -29
- package/dist/cjs/frameworks/react/lib/defaultValues/generateObject.js +0 -29
- package/dist/cjs/frameworks/react/lib/defaultValues/index.js +0 -35
- package/dist/cjs/frameworks/react/lib/defaultValues/prettyIdentifier.js +0 -34
- package/dist/cjs/frameworks/react/lib/generateCode.js +0 -89
- package/dist/cjs/frameworks/react/lib/index.js +0 -61
- package/dist/cjs/frameworks/react/lib/inspection/acornParser.js +0 -254
- package/dist/cjs/frameworks/react/lib/inspection/index.js +0 -35
- package/dist/cjs/frameworks/react/lib/inspection/inspectValue.js +0 -26
- package/dist/cjs/frameworks/react/lib/inspection/types.js +0 -19
- package/dist/cjs/frameworks/react/lib/isHtmlTag.js +0 -18
- package/dist/cjs/frameworks/react/propTypes/createType.js +0 -467
- package/dist/cjs/frameworks/react/propTypes/generateFuncSignature.js +0 -78
- package/dist/cjs/frameworks/react/propTypes/handleProp.js +0 -54
- package/dist/cjs/frameworks/react/propTypes/rawDefaultPropResolvers.js +0 -47
- package/dist/cjs/frameworks/react/propTypes/sortProps.js +0 -35
- package/dist/cjs/frameworks/react/react-argtypes.stories.js +0 -153
- package/dist/cjs/frameworks/react/typeScript/handleProp.js +0 -38
- package/dist/cjs/frameworks/svelte/config.js +0 -26
- package/dist/cjs/frameworks/svelte/extractArgTypes.js +0 -159
- package/dist/cjs/frameworks/svelte/extractComponentDescription.js +0 -21
- package/dist/cjs/frameworks/svelte/prepareForInline.js +0 -35
- package/dist/cjs/frameworks/svelte/preset.js +0 -54
- package/dist/cjs/frameworks/svelte/sample/MockButton.svelte +0 -45
- package/dist/cjs/frameworks/svelte/sourceDecorator.js +0 -262
- package/dist/cjs/frameworks/svelte/svelte-docgen-loader.js +0 -191
- package/dist/cjs/frameworks/vue/config.js +0 -26
- package/dist/cjs/frameworks/vue/extractArgTypes.js +0 -153
- package/dist/cjs/frameworks/vue/prepareForInline.js +0 -56
- package/dist/cjs/frameworks/vue/preset.js +0 -43
- package/dist/cjs/frameworks/vue/sourceDecorator.js +0 -343
- package/dist/cjs/frameworks/vue3/config.js +0 -22
- package/dist/cjs/frameworks/vue3/extractArgTypes.js +0 -62
- package/dist/cjs/frameworks/vue3/prepareForInline.js +0 -61
- package/dist/cjs/frameworks/vue3/preset.js +0 -43
- package/dist/cjs/frameworks/web-components/config.js +0 -30
- package/dist/cjs/frameworks/web-components/custom-elements.js +0 -163
- package/dist/cjs/frameworks/web-components/prepareForInline.js +0 -96
- package/dist/cjs/frameworks/web-components/sourceDecorator.js +0 -60
- package/dist/cjs/lib/convert/flow/convert.js +0 -112
- package/dist/cjs/lib/convert/flow/index.js +0 -35
- package/dist/cjs/lib/convert/flow/types.js +0 -1
- package/dist/cjs/lib/convert/index.js +0 -24
- package/dist/cjs/lib/convert/proptypes/convert.js +0 -135
- package/dist/cjs/lib/convert/proptypes/index.js +0 -35
- package/dist/cjs/lib/convert/proptypes/types.js +0 -1
- package/dist/cjs/lib/convert/typescript/convert.js +0 -82
- package/dist/cjs/lib/convert/typescript/index.js +0 -35
- package/dist/cjs/lib/convert/typescript/types.js +0 -1
- package/dist/cjs/lib/convert/utils.js +0 -18
- package/dist/cjs/lib/docgen/PropDef.js +0 -1
- package/dist/cjs/lib/docgen/createPropDef.js +0 -171
- package/dist/cjs/lib/docgen/extractDocgenProps.js +0 -113
- package/dist/cjs/lib/docgen/flow/createDefaultValue.js +0 -24
- package/dist/cjs/lib/docgen/flow/createPropDef.js +0 -30
- package/dist/cjs/lib/docgen/flow/createType.js +0 -119
- package/dist/cjs/lib/docgen/index.js +0 -48
- package/dist/cjs/lib/docgen/typeScript/createDefaultValue.js +0 -24
- package/dist/cjs/lib/docgen/typeScript/createPropDef.js +0 -28
- package/dist/cjs/lib/docgen/typeScript/createType.js +0 -30
- package/dist/cjs/lib/docgen/types.js +0 -17
- package/dist/cjs/lib/docgen/utils/defaultValue.js +0 -13
- package/dist/cjs/lib/docgen/utils/docgenInfo.js +0 -34
- package/dist/cjs/lib/docgen/utils/index.js +0 -48
- package/dist/cjs/lib/docgen/utils/string.js +0 -20
- package/dist/cjs/lib/index.js +0 -22
- package/dist/cjs/lib/jsdocParser.js +0 -229
- package/dist/cjs/lib/utils.js +0 -45
- package/dist/cjs/typings.d.js +0 -1
- package/dist/esm/frameworks/angular/compodoc.js +0 -347
- package/dist/esm/frameworks/angular/config.js +0 -18
- package/dist/esm/frameworks/angular/index.js +0 -1
- package/dist/esm/frameworks/angular/prepareForInline.js +0 -75
- package/dist/esm/frameworks/angular/sourceDecorator.js +0 -116
- package/dist/esm/frameworks/angular/types.js +0 -0
- package/dist/esm/frameworks/common/enhanceArgTypes.js +0 -11
- package/dist/esm/frameworks/common/preset.js +0 -161
- package/dist/esm/frameworks/ember/config.js +0 -8
- package/dist/esm/frameworks/ember/index.js +0 -1
- package/dist/esm/frameworks/ember/jsondoc.js +0 -66
- package/dist/esm/frameworks/html/config.js +0 -14
- package/dist/esm/frameworks/html/prepareForInline.js +0 -19
- package/dist/esm/frameworks/html/sourceDecorator.js +0 -56
- package/dist/esm/frameworks/react/config.js +0 -15
- package/dist/esm/frameworks/react/extractArgTypes.js +0 -38
- package/dist/esm/frameworks/react/extractProps.js +0 -53
- package/dist/esm/frameworks/react/jsxDecorator.js +0 -218
- package/dist/esm/frameworks/react/lib/captions.js +0 -6
- package/dist/esm/frameworks/react/lib/componentTypes.js +0 -9
- package/dist/esm/frameworks/react/lib/defaultValues/createDefaultValue.js +0 -67
- package/dist/esm/frameworks/react/lib/defaultValues/createFromRawDefaultProp.js +0 -191
- package/dist/esm/frameworks/react/lib/defaultValues/generateArray.js +0 -19
- package/dist/esm/frameworks/react/lib/defaultValues/generateObject.js +0 -19
- package/dist/esm/frameworks/react/lib/defaultValues/index.js +0 -2
- package/dist/esm/frameworks/react/lib/defaultValues/prettyIdentifier.js +0 -22
- package/dist/esm/frameworks/react/lib/generateCode.js +0 -68
- package/dist/esm/frameworks/react/lib/index.js +0 -4
- package/dist/esm/frameworks/react/lib/inspection/acornParser.js +0 -213
- package/dist/esm/frameworks/react/lib/inspection/index.js +0 -2
- package/dist/esm/frameworks/react/lib/inspection/inspectValue.js +0 -16
- package/dist/esm/frameworks/react/lib/inspection/types.js +0 -12
- package/dist/esm/frameworks/react/lib/isHtmlTag.js +0 -6
- package/dist/esm/frameworks/react/propTypes/createType.js +0 -448
- package/dist/esm/frameworks/react/propTypes/generateFuncSignature.js +0 -62
- package/dist/esm/frameworks/react/propTypes/handleProp.js +0 -39
- package/dist/esm/frameworks/react/propTypes/rawDefaultPropResolvers.js +0 -32
- package/dist/esm/frameworks/react/propTypes/sortProps.js +0 -23
- package/dist/esm/frameworks/react/react-argtypes.stories.js +0 -122
- package/dist/esm/frameworks/react/typeScript/handleProp.js +0 -27
- package/dist/esm/frameworks/svelte/HOC.svelte +0 -7
- package/dist/esm/frameworks/svelte/config.js +0 -13
- package/dist/esm/frameworks/svelte/extractArgTypes.js +0 -138
- package/dist/esm/frameworks/svelte/extractComponentDescription.js +0 -12
- package/dist/esm/frameworks/svelte/prepareForInline.js +0 -20
- package/dist/esm/frameworks/svelte/preset.js +0 -42
- package/dist/esm/frameworks/svelte/sample/MockButton.svelte +0 -45
- package/dist/esm/frameworks/svelte/sourceDecorator.js +0 -232
- package/dist/esm/frameworks/svelte/svelte-docgen-loader.js +0 -142
- package/dist/esm/frameworks/vue/config.js +0 -13
- package/dist/esm/frameworks/vue/extractArgTypes.js +0 -128
- package/dist/esm/frameworks/vue/prepareForInline.js +0 -39
- package/dist/esm/frameworks/vue/preset.js +0 -31
- package/dist/esm/frameworks/vue/sourceDecorator.js +0 -292
- package/dist/esm/frameworks/vue3/config.js +0 -11
- package/dist/esm/frameworks/vue3/extractArgTypes.js +0 -45
- package/dist/esm/frameworks/vue3/prepareForInline.js +0 -22
- package/dist/esm/frameworks/vue3/preset.js +0 -31
- package/dist/esm/frameworks/web-components/config.js +0 -17
- package/dist/esm/frameworks/web-components/custom-elements.js +0 -139
- package/dist/esm/frameworks/web-components/prepareForInline.js +0 -74
- package/dist/esm/frameworks/web-components/sourceDecorator.js +0 -50
- package/dist/esm/lib/convert/flow/convert.js +0 -98
- package/dist/esm/lib/convert/flow/index.js +0 -2
- package/dist/esm/lib/convert/flow/types.js +0 -0
- package/dist/esm/lib/convert/index.js +0 -12
- package/dist/esm/lib/convert/proptypes/convert.js +0 -116
- package/dist/esm/lib/convert/proptypes/index.js +0 -2
- package/dist/esm/lib/convert/proptypes/types.js +0 -0
- package/dist/esm/lib/convert/typescript/convert.js +0 -70
- package/dist/esm/lib/convert/typescript/index.js +0 -2
- package/dist/esm/lib/convert/typescript/types.js +0 -0
- package/dist/esm/lib/convert/utils.js +0 -6
- package/dist/esm/lib/docgen/PropDef.js +0 -0
- package/dist/esm/lib/docgen/createPropDef.js +0 -141
- package/dist/esm/lib/docgen/extractDocgenProps.js +0 -87
- package/dist/esm/lib/docgen/flow/createDefaultValue.js +0 -14
- package/dist/esm/lib/docgen/flow/createPropDef.js +0 -17
- package/dist/esm/lib/docgen/flow/createType.js +0 -106
- package/dist/esm/lib/docgen/index.js +0 -3
- package/dist/esm/lib/docgen/typeScript/createDefaultValue.js +0 -15
- package/dist/esm/lib/docgen/typeScript/createPropDef.js +0 -15
- package/dist/esm/lib/docgen/typeScript/createType.js +0 -19
- package/dist/esm/lib/docgen/types.js +0 -10
- package/dist/esm/lib/docgen/utils/defaultValue.js +0 -6
- package/dist/esm/lib/docgen/utils/docgenInfo.js +0 -18
- package/dist/esm/lib/docgen/utils/index.js +0 -3
- package/dist/esm/lib/docgen/utils/string.js +0 -11
- package/dist/esm/lib/index.js +0 -1
- package/dist/esm/lib/jsdocParser.js +0 -207
- package/dist/esm/lib/utils.js +0 -25
- package/dist/esm/typings.d.js +0 -0
- package/dist/modern/frameworks/angular/compodoc.js +0 -296
- package/dist/modern/frameworks/angular/config.js +0 -18
- package/dist/modern/frameworks/angular/index.js +0 -1
- package/dist/modern/frameworks/angular/prepareForInline.js +0 -36
- package/dist/modern/frameworks/angular/sourceDecorator.js +0 -81
- package/dist/modern/frameworks/angular/types.js +0 -0
- package/dist/modern/frameworks/common/config.js +0 -10
- package/dist/modern/frameworks/common/enhanceArgTypes.js +0 -16
- package/dist/modern/frameworks/ember/config.js +0 -8
- package/dist/modern/frameworks/ember/index.js +0 -1
- package/dist/modern/frameworks/ember/jsondoc.js +0 -57
- package/dist/modern/frameworks/html/config.js +0 -14
- package/dist/modern/frameworks/html/prepareForInline.js +0 -17
- package/dist/modern/frameworks/html/sourceDecorator.js +0 -56
- package/dist/modern/frameworks/react/config.js +0 -13
- package/dist/modern/frameworks/react/extractArgTypes.js +0 -38
- package/dist/modern/frameworks/react/extractProps.js +0 -41
- package/dist/modern/frameworks/react/jsxDecorator.js +0 -176
- package/dist/modern/frameworks/react/lib/captions.js +0 -6
- package/dist/modern/frameworks/react/lib/componentTypes.js +0 -2
- package/dist/modern/frameworks/react/lib/defaultValues/createDefaultValue.js +0 -72
- package/dist/modern/frameworks/react/lib/defaultValues/createFromRawDefaultProp.js +0 -181
- package/dist/modern/frameworks/react/lib/defaultValues/generateArray.js +0 -21
- package/dist/modern/frameworks/react/lib/defaultValues/generateObject.js +0 -21
- package/dist/modern/frameworks/react/lib/defaultValues/index.js +0 -2
- package/dist/modern/frameworks/react/lib/defaultValues/prettyIdentifier.js +0 -24
- package/dist/modern/frameworks/react/lib/generateCode.js +0 -59
- package/dist/modern/frameworks/react/lib/index.js +0 -4
- package/dist/modern/frameworks/react/lib/inspection/acornParser.js +0 -212
- package/dist/modern/frameworks/react/lib/inspection/index.js +0 -2
- package/dist/modern/frameworks/react/lib/inspection/inspectValue.js +0 -15
- package/dist/modern/frameworks/react/lib/inspection/types.js +0 -12
- package/dist/modern/frameworks/react/lib/isHtmlTag.js +0 -4
- package/dist/modern/frameworks/react/propTypes/createType.js +0 -446
- package/dist/modern/frameworks/react/propTypes/generateFuncSignature.js +0 -57
- package/dist/modern/frameworks/react/propTypes/handleProp.js +0 -39
- package/dist/modern/frameworks/react/propTypes/rawDefaultPropResolvers.js +0 -31
- package/dist/modern/frameworks/react/propTypes/sortProps.js +0 -14
- package/dist/modern/frameworks/react/react-argtypes.stories.js +0 -78
- package/dist/modern/frameworks/react/typeScript/handleProp.js +0 -28
- package/dist/modern/frameworks/svelte/HOC.svelte +0 -7
- package/dist/modern/frameworks/svelte/config.js +0 -13
- package/dist/modern/frameworks/svelte/extractArgTypes.js +0 -118
- package/dist/modern/frameworks/svelte/extractComponentDescription.js +0 -10
- package/dist/modern/frameworks/svelte/prepareForInline.js +0 -18
- package/dist/modern/frameworks/svelte/preset.js +0 -11
- package/dist/modern/frameworks/svelte/sample/MockButton.svelte +0 -45
- package/dist/modern/frameworks/svelte/sourceDecorator.js +0 -187
- package/dist/modern/frameworks/svelte/svelte-docgen-loader.js +0 -89
- package/dist/modern/frameworks/vue/config.js +0 -13
- package/dist/modern/frameworks/vue/extractArgTypes.js +0 -103
- package/dist/modern/frameworks/vue/prepareForInline.js +0 -40
- package/dist/modern/frameworks/vue/preset.js +0 -24
- package/dist/modern/frameworks/vue/sourceDecorator.js +0 -195
- package/dist/modern/frameworks/vue3/config.js +0 -11
- package/dist/modern/frameworks/vue3/extractArgTypes.js +0 -43
- package/dist/modern/frameworks/vue3/prepareForInline.js +0 -22
- package/dist/modern/frameworks/vue3/preset.js +0 -24
- package/dist/modern/frameworks/web-components/config.js +0 -17
- package/dist/modern/frameworks/web-components/custom-elements.js +0 -125
- package/dist/modern/frameworks/web-components/prepareForInline.js +0 -23
- package/dist/modern/frameworks/web-components/sourceDecorator.js +0 -47
- package/dist/modern/lib/convert/flow/convert.js +0 -89
- package/dist/modern/lib/convert/flow/index.js +0 -2
- package/dist/modern/lib/convert/flow/types.js +0 -0
- package/dist/modern/lib/convert/index.js +0 -14
- package/dist/modern/lib/convert/proptypes/convert.js +0 -102
- package/dist/modern/lib/convert/proptypes/index.js +0 -2
- package/dist/modern/lib/convert/proptypes/types.js +0 -0
- package/dist/modern/lib/convert/typescript/convert.js +0 -67
- package/dist/modern/lib/convert/typescript/index.js +0 -2
- package/dist/modern/lib/convert/typescript/types.js +0 -0
- package/dist/modern/lib/convert/utils.js +0 -2
- package/dist/modern/lib/docgen/PropDef.js +0 -0
- package/dist/modern/lib/docgen/createPropDef.js +0 -142
- package/dist/modern/lib/docgen/extractDocgenProps.js +0 -80
- package/dist/modern/lib/docgen/flow/createDefaultValue.js +0 -15
- package/dist/modern/lib/docgen/flow/createPropDef.js +0 -17
- package/dist/modern/lib/docgen/flow/createType.js +0 -103
- package/dist/modern/lib/docgen/index.js +0 -3
- package/dist/modern/lib/docgen/typeScript/createDefaultValue.js +0 -17
- package/dist/modern/lib/docgen/typeScript/createPropDef.js +0 -15
- package/dist/modern/lib/docgen/typeScript/createType.js +0 -16
- package/dist/modern/lib/docgen/types.js +0 -10
- package/dist/modern/lib/docgen/utils/defaultValue.js +0 -4
- package/dist/modern/lib/docgen/utils/docgenInfo.js +0 -14
- package/dist/modern/lib/docgen/utils/index.js +0 -3
- package/dist/modern/lib/docgen/utils/string.js +0 -11
- package/dist/modern/lib/index.js +0 -1
- package/dist/modern/lib/jsdocParser.js +0 -195
- package/dist/modern/lib/utils.js +0 -21
- package/dist/modern/typings.d.js +0 -0
- package/dist/ts3.4/frameworks/angular/compodoc.d.ts +0 -18
- package/dist/ts3.4/frameworks/angular/config.d.ts +0 -15
- package/dist/ts3.4/frameworks/angular/index.d.ts +0 -1
- package/dist/ts3.4/frameworks/angular/prepareForInline.d.ts +0 -7
- package/dist/ts3.4/frameworks/angular/sourceDecorator.d.ts +0 -9
- package/dist/ts3.4/frameworks/angular/types.d.ts +0 -102
- package/dist/ts3.4/frameworks/common/config.d.ts +0 -10
- package/dist/ts3.4/frameworks/common/enhanceArgTypes.d.ts +0 -2
- package/dist/ts3.4/frameworks/common/preset.d.ts +0 -1
- package/dist/ts3.4/frameworks/html/config.d.ts +0 -14
- package/dist/ts3.4/frameworks/html/prepareForInline.d.ts +0 -2
- package/dist/ts3.4/frameworks/html/sourceDecorator.d.ts +0 -3
- package/dist/ts3.4/frameworks/react/config.d.ts +0 -12
- package/dist/ts3.4/frameworks/react/extractArgTypes.d.ts +0 -2
- package/dist/ts3.4/frameworks/react/extractProps.d.ts +0 -5
- package/dist/ts3.4/frameworks/react/jsxDecorator.d.ts +0 -23
- package/dist/ts3.4/frameworks/react/lib/captions.d.ts +0 -6
- package/dist/ts3.4/frameworks/react/lib/componentTypes.d.ts +0 -2
- package/dist/ts3.4/frameworks/react/lib/defaultValues/createDefaultValue.d.ts +0 -2
- package/dist/ts3.4/frameworks/react/lib/defaultValues/createFromRawDefaultProp.d.ts +0 -12
- package/dist/ts3.4/frameworks/react/lib/defaultValues/generateArray.d.ts +0 -3
- package/dist/ts3.4/frameworks/react/lib/defaultValues/generateObject.d.ts +0 -3
- package/dist/ts3.4/frameworks/react/lib/defaultValues/index.d.ts +0 -2
- package/dist/ts3.4/frameworks/react/lib/defaultValues/prettyIdentifier.d.ts +0 -4
- package/dist/ts3.4/frameworks/react/lib/generateCode.d.ts +0 -3
- package/dist/ts3.4/frameworks/react/lib/index.d.ts +0 -4
- package/dist/ts3.4/frameworks/react/lib/inspection/acornParser.d.ts +0 -7
- package/dist/ts3.4/frameworks/react/lib/inspection/index.d.ts +0 -2
- package/dist/ts3.4/frameworks/react/lib/inspection/inspectValue.d.ts +0 -2
- package/dist/ts3.4/frameworks/react/lib/inspection/types.d.ts +0 -50
- package/dist/ts3.4/frameworks/react/lib/isHtmlTag.d.ts +0 -1
- package/dist/ts3.4/frameworks/react/propTypes/createType.d.ts +0 -3
- package/dist/ts3.4/frameworks/react/propTypes/generateFuncSignature.d.ts +0 -4
- package/dist/ts3.4/frameworks/react/propTypes/handleProp.d.ts +0 -4
- package/dist/ts3.4/frameworks/react/propTypes/rawDefaultPropResolvers.d.ts +0 -1
- package/dist/ts3.4/frameworks/react/propTypes/sortProps.d.ts +0 -3
- package/dist/ts3.4/frameworks/react/typeScript/handleProp.d.ts +0 -3
- package/dist/ts3.4/frameworks/svelte/config.d.ts +0 -11
- package/dist/ts3.4/frameworks/svelte/extractArgTypes.d.ts +0 -5
- package/dist/ts3.4/frameworks/svelte/extractComponentDescription.d.ts +0 -2
- package/dist/ts3.4/frameworks/svelte/prepareForInline.d.ts +0 -3
- package/dist/ts3.4/frameworks/svelte/preset.d.ts +0 -3
- package/dist/ts3.4/frameworks/svelte/sourceDecorator.d.ts +0 -16
- package/dist/ts3.4/frameworks/svelte/svelte-docgen-loader.d.ts +0 -5
- package/dist/ts3.4/frameworks/vue/config.d.ts +0 -11
- package/dist/ts3.4/frameworks/vue/extractArgTypes.d.ts +0 -2
- package/dist/ts3.4/frameworks/vue/prepareForInline.d.ts +0 -4
- package/dist/ts3.4/frameworks/vue/preset.d.ts +0 -2
- package/dist/ts3.4/frameworks/vue/sourceDecorator.d.ts +0 -5
- package/dist/ts3.4/frameworks/vue3/config.d.ts +0 -10
- package/dist/ts3.4/frameworks/vue3/extractArgTypes.d.ts +0 -2
- package/dist/ts3.4/frameworks/vue3/prepareForInline.d.ts +0 -4
- package/dist/ts3.4/frameworks/vue3/preset.d.ts +0 -2
- package/dist/ts3.4/frameworks/web-components/config.d.ts +0 -18
- package/dist/ts3.4/frameworks/web-components/custom-elements.d.ts +0 -36
- package/dist/ts3.4/frameworks/web-components/prepareForInline.d.ts +0 -4
- package/dist/ts3.4/frameworks/web-components/sourceDecorator.d.ts +0 -3
- package/dist/ts3.4/lib/convert/flow/convert.d.ts +0 -3
- package/dist/ts3.4/lib/convert/flow/index.d.ts +0 -2
- package/dist/ts3.4/lib/convert/flow/types.d.ts +0 -43
- package/dist/ts3.4/lib/convert/index.d.ts +0 -2
- package/dist/ts3.4/lib/convert/proptypes/convert.d.ts +0 -3
- package/dist/ts3.4/lib/convert/proptypes/index.d.ts +0 -2
- package/dist/ts3.4/lib/convert/proptypes/types.d.ts +0 -11
- package/dist/ts3.4/lib/convert/typescript/convert.d.ts +0 -3
- package/dist/ts3.4/lib/convert/typescript/index.d.ts +0 -2
- package/dist/ts3.4/lib/convert/typescript/types.d.ts +0 -39
- package/dist/ts3.4/lib/convert/utils.d.ts +0 -1
- package/dist/ts3.4/lib/docgen/PropDef.d.ts +0 -26
- package/dist/ts3.4/lib/docgen/createPropDef.d.ts +0 -8
- package/dist/ts3.4/lib/docgen/extractDocgenProps.d.ts +0 -14
- package/dist/ts3.4/lib/docgen/flow/createDefaultValue.d.ts +0 -3
- package/dist/ts3.4/lib/docgen/flow/createPropDef.d.ts +0 -2
- package/dist/ts3.4/lib/docgen/flow/createType.d.ts +0 -3
- package/dist/ts3.4/lib/docgen/index.d.ts +0 -3
- package/dist/ts3.4/lib/docgen/typeScript/createDefaultValue.d.ts +0 -3
- package/dist/ts3.4/lib/docgen/typeScript/createPropDef.d.ts +0 -2
- package/dist/ts3.4/lib/docgen/typeScript/createType.d.ts +0 -3
- package/dist/ts3.4/lib/docgen/types.d.ts +0 -46
- package/dist/ts3.4/lib/docgen/utils/defaultValue.d.ts +0 -1
- package/dist/ts3.4/lib/docgen/utils/docgenInfo.d.ts +0 -5
- package/dist/ts3.4/lib/docgen/utils/index.d.ts +0 -3
- package/dist/ts3.4/lib/docgen/utils/string.d.ts +0 -1
- package/dist/ts3.4/lib/index.d.ts +0 -1
- package/dist/ts3.4/lib/jsdocParser.d.ts +0 -28
- package/dist/ts3.4/lib/utils.d.ts +0 -7
- package/dist/ts3.9/frameworks/angular/compodoc.d.ts +0 -18
- package/dist/ts3.9/frameworks/angular/config.d.ts +0 -15
- package/dist/ts3.9/frameworks/angular/index.d.ts +0 -1
- package/dist/ts3.9/frameworks/angular/prepareForInline.d.ts +0 -7
- package/dist/ts3.9/frameworks/angular/sourceDecorator.d.ts +0 -9
- package/dist/ts3.9/frameworks/angular/types.d.ts +0 -102
- package/dist/ts3.9/frameworks/common/config.d.ts +0 -10
- package/dist/ts3.9/frameworks/common/enhanceArgTypes.d.ts +0 -2
- package/dist/ts3.9/frameworks/common/preset.d.ts +0 -1
- package/dist/ts3.9/frameworks/html/config.d.ts +0 -14
- package/dist/ts3.9/frameworks/html/prepareForInline.d.ts +0 -2
- package/dist/ts3.9/frameworks/html/sourceDecorator.d.ts +0 -3
- package/dist/ts3.9/frameworks/react/config.d.ts +0 -12
- package/dist/ts3.9/frameworks/react/extractArgTypes.d.ts +0 -2
- package/dist/ts3.9/frameworks/react/extractProps.d.ts +0 -5
- package/dist/ts3.9/frameworks/react/jsxDecorator.d.ts +0 -23
- package/dist/ts3.9/frameworks/react/lib/captions.d.ts +0 -6
- package/dist/ts3.9/frameworks/react/lib/componentTypes.d.ts +0 -2
- package/dist/ts3.9/frameworks/react/lib/defaultValues/createDefaultValue.d.ts +0 -2
- package/dist/ts3.9/frameworks/react/lib/defaultValues/createFromRawDefaultProp.d.ts +0 -12
- package/dist/ts3.9/frameworks/react/lib/defaultValues/generateArray.d.ts +0 -3
- package/dist/ts3.9/frameworks/react/lib/defaultValues/generateObject.d.ts +0 -3
- package/dist/ts3.9/frameworks/react/lib/defaultValues/index.d.ts +0 -2
- package/dist/ts3.9/frameworks/react/lib/defaultValues/prettyIdentifier.d.ts +0 -4
- package/dist/ts3.9/frameworks/react/lib/generateCode.d.ts +0 -3
- package/dist/ts3.9/frameworks/react/lib/index.d.ts +0 -4
- package/dist/ts3.9/frameworks/react/lib/inspection/acornParser.d.ts +0 -7
- package/dist/ts3.9/frameworks/react/lib/inspection/index.d.ts +0 -2
- package/dist/ts3.9/frameworks/react/lib/inspection/inspectValue.d.ts +0 -2
- package/dist/ts3.9/frameworks/react/lib/inspection/types.d.ts +0 -50
- package/dist/ts3.9/frameworks/react/lib/isHtmlTag.d.ts +0 -1
- package/dist/ts3.9/frameworks/react/propTypes/createType.d.ts +0 -3
- package/dist/ts3.9/frameworks/react/propTypes/generateFuncSignature.d.ts +0 -4
- package/dist/ts3.9/frameworks/react/propTypes/handleProp.d.ts +0 -4
- package/dist/ts3.9/frameworks/react/propTypes/rawDefaultPropResolvers.d.ts +0 -1
- package/dist/ts3.9/frameworks/react/propTypes/sortProps.d.ts +0 -3
- package/dist/ts3.9/frameworks/react/typeScript/handleProp.d.ts +0 -3
- package/dist/ts3.9/frameworks/svelte/config.d.ts +0 -11
- package/dist/ts3.9/frameworks/svelte/extractArgTypes.d.ts +0 -5
- package/dist/ts3.9/frameworks/svelte/extractComponentDescription.d.ts +0 -2
- package/dist/ts3.9/frameworks/svelte/prepareForInline.d.ts +0 -3
- package/dist/ts3.9/frameworks/svelte/preset.d.ts +0 -3
- package/dist/ts3.9/frameworks/svelte/sourceDecorator.d.ts +0 -16
- package/dist/ts3.9/frameworks/svelte/svelte-docgen-loader.d.ts +0 -5
- package/dist/ts3.9/frameworks/vue/config.d.ts +0 -11
- package/dist/ts3.9/frameworks/vue/extractArgTypes.d.ts +0 -2
- package/dist/ts3.9/frameworks/vue/prepareForInline.d.ts +0 -4
- package/dist/ts3.9/frameworks/vue/preset.d.ts +0 -2
- package/dist/ts3.9/frameworks/vue/sourceDecorator.d.ts +0 -5
- package/dist/ts3.9/frameworks/vue3/config.d.ts +0 -10
- package/dist/ts3.9/frameworks/vue3/extractArgTypes.d.ts +0 -2
- package/dist/ts3.9/frameworks/vue3/prepareForInline.d.ts +0 -4
- package/dist/ts3.9/frameworks/vue3/preset.d.ts +0 -2
- package/dist/ts3.9/frameworks/web-components/config.d.ts +0 -18
- package/dist/ts3.9/frameworks/web-components/custom-elements.d.ts +0 -35
- package/dist/ts3.9/frameworks/web-components/prepareForInline.d.ts +0 -4
- package/dist/ts3.9/frameworks/web-components/sourceDecorator.d.ts +0 -3
- package/dist/ts3.9/lib/convert/flow/convert.d.ts +0 -3
- package/dist/ts3.9/lib/convert/flow/index.d.ts +0 -2
- package/dist/ts3.9/lib/convert/flow/types.d.ts +0 -43
- package/dist/ts3.9/lib/convert/index.d.ts +0 -2
- package/dist/ts3.9/lib/convert/proptypes/convert.d.ts +0 -3
- package/dist/ts3.9/lib/convert/proptypes/index.d.ts +0 -2
- package/dist/ts3.9/lib/convert/proptypes/types.d.ts +0 -11
- package/dist/ts3.9/lib/convert/typescript/convert.d.ts +0 -3
- package/dist/ts3.9/lib/convert/typescript/index.d.ts +0 -2
- package/dist/ts3.9/lib/convert/typescript/types.d.ts +0 -39
- package/dist/ts3.9/lib/convert/utils.d.ts +0 -1
- package/dist/ts3.9/lib/docgen/PropDef.d.ts +0 -26
- package/dist/ts3.9/lib/docgen/createPropDef.d.ts +0 -8
- package/dist/ts3.9/lib/docgen/extractDocgenProps.d.ts +0 -14
- package/dist/ts3.9/lib/docgen/flow/createDefaultValue.d.ts +0 -3
- package/dist/ts3.9/lib/docgen/flow/createPropDef.d.ts +0 -2
- package/dist/ts3.9/lib/docgen/flow/createType.d.ts +0 -3
- package/dist/ts3.9/lib/docgen/index.d.ts +0 -3
- package/dist/ts3.9/lib/docgen/typeScript/createDefaultValue.d.ts +0 -3
- package/dist/ts3.9/lib/docgen/typeScript/createPropDef.d.ts +0 -2
- package/dist/ts3.9/lib/docgen/typeScript/createType.d.ts +0 -3
- package/dist/ts3.9/lib/docgen/types.d.ts +0 -46
- package/dist/ts3.9/lib/docgen/utils/defaultValue.d.ts +0 -1
- package/dist/ts3.9/lib/docgen/utils/docgenInfo.d.ts +0 -5
- package/dist/ts3.9/lib/docgen/utils/index.d.ts +0 -3
- package/dist/ts3.9/lib/docgen/utils/string.d.ts +0 -1
- package/dist/ts3.9/lib/index.d.ts +0 -1
- package/dist/ts3.9/lib/jsdocParser.d.ts +0 -28
- package/dist/ts3.9/lib/utils.d.ts +0 -7
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.convert = void 0;
|
|
7
|
-
|
|
8
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
|
9
|
-
|
|
10
|
-
require("core-js/modules/es.function.name.js");
|
|
11
|
-
|
|
12
|
-
require("core-js/modules/es.object.assign.js");
|
|
13
|
-
|
|
14
|
-
require("core-js/modules/es.array.map.js");
|
|
15
|
-
|
|
16
|
-
/* eslint-disable no-case-declarations */
|
|
17
|
-
var convertSig = function convertSig(type) {
|
|
18
|
-
switch (type.type) {
|
|
19
|
-
case 'function':
|
|
20
|
-
return {
|
|
21
|
-
name: 'function'
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
case 'object':
|
|
25
|
-
var values = {};
|
|
26
|
-
type.signature.properties.forEach(function (prop) {
|
|
27
|
-
values[prop.key] = convert(prop.value);
|
|
28
|
-
});
|
|
29
|
-
return {
|
|
30
|
-
name: 'object',
|
|
31
|
-
value: values
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
default:
|
|
35
|
-
throw new Error("Unknown: ".concat(type));
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
var convert = function convert(type) {
|
|
40
|
-
var name = type.name,
|
|
41
|
-
raw = type.raw;
|
|
42
|
-
var base = {};
|
|
43
|
-
if (typeof raw !== 'undefined') base.raw = raw;
|
|
44
|
-
|
|
45
|
-
switch (type.name) {
|
|
46
|
-
case 'string':
|
|
47
|
-
case 'number':
|
|
48
|
-
case 'symbol':
|
|
49
|
-
case 'boolean':
|
|
50
|
-
{
|
|
51
|
-
return Object.assign({}, base, {
|
|
52
|
-
name: name
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
case 'Array':
|
|
57
|
-
{
|
|
58
|
-
return Object.assign({}, base, {
|
|
59
|
-
name: 'array',
|
|
60
|
-
value: type.elements.map(convert)
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
case 'signature':
|
|
65
|
-
return Object.assign({}, base, convertSig(type));
|
|
66
|
-
|
|
67
|
-
case 'union':
|
|
68
|
-
case 'intersection':
|
|
69
|
-
return Object.assign({}, base, {
|
|
70
|
-
name: name,
|
|
71
|
-
value: type.elements.map(convert)
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
default:
|
|
75
|
-
return Object.assign({}, base, {
|
|
76
|
-
name: 'other',
|
|
77
|
-
value: name
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
exports.convert = convert;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
|
4
|
-
|
|
5
|
-
require("core-js/modules/es.object.keys.js");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
var _convert = require("./convert");
|
|
12
|
-
|
|
13
|
-
Object.keys(_convert).forEach(function (key) {
|
|
14
|
-
if (key === "default" || key === "__esModule") return;
|
|
15
|
-
if (key in exports && exports[key] === _convert[key]) return;
|
|
16
|
-
Object.defineProperty(exports, key, {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: function get() {
|
|
19
|
-
return _convert[key];
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
var _types = require("./types");
|
|
25
|
-
|
|
26
|
-
Object.keys(_types).forEach(function (key) {
|
|
27
|
-
if (key === "default" || key === "__esModule") return;
|
|
28
|
-
if (key in exports && exports[key] === _types[key]) return;
|
|
29
|
-
Object.defineProperty(exports, key, {
|
|
30
|
-
enumerable: true,
|
|
31
|
-
get: function get() {
|
|
32
|
-
return _types[key];
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.trimQuotes = void 0;
|
|
7
|
-
|
|
8
|
-
require("core-js/modules/es.string.replace.js");
|
|
9
|
-
|
|
10
|
-
require("core-js/modules/es.regexp.exec.js");
|
|
11
|
-
|
|
12
|
-
var QUOTE_REGEX = /^['"]|['"]$/g;
|
|
13
|
-
|
|
14
|
-
var trimQuotes = function trimQuotes(str) {
|
|
15
|
-
return str.replace(QUOTE_REGEX, '');
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
exports.trimQuotes = trimQuotes;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getPropDefFactory = exports.unknownFactory = exports.flowFactory = exports.tsFactory = exports.javaScriptFactory = void 0;
|
|
7
|
-
|
|
8
|
-
require("core-js/modules/es.function.name.js");
|
|
9
|
-
|
|
10
|
-
require("core-js/modules/es.symbol.js");
|
|
11
|
-
|
|
12
|
-
require("core-js/modules/es.symbol.description.js");
|
|
13
|
-
|
|
14
|
-
require("core-js/modules/es.array.map.js");
|
|
15
|
-
|
|
16
|
-
var _types = require("./types");
|
|
17
|
-
|
|
18
|
-
var _utils = require("../utils");
|
|
19
|
-
|
|
20
|
-
var _createPropDef = require("./flow/createPropDef");
|
|
21
|
-
|
|
22
|
-
var _defaultValue = require("./utils/defaultValue");
|
|
23
|
-
|
|
24
|
-
var _createPropDef2 = require("./typeScript/createPropDef");
|
|
25
|
-
|
|
26
|
-
var _convert = require("../convert");
|
|
27
|
-
|
|
28
|
-
function createType(type) {
|
|
29
|
-
// A type could be null if a defaultProp has been provided without a type definition.
|
|
30
|
-
return type != null ? (0, _utils.createSummaryValue)(type.name) : null;
|
|
31
|
-
} // A heuristic to tell if a defaultValue comes from RDT
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
function isReactDocgenTypescript(defaultValue) {
|
|
35
|
-
var computed = defaultValue.computed,
|
|
36
|
-
func = defaultValue.func;
|
|
37
|
-
return typeof computed === 'undefined' && typeof func === 'undefined';
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function isStringValued(type) {
|
|
41
|
-
if (!type) {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (type.name === 'string') {
|
|
46
|
-
return true;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (type.name === 'enum') {
|
|
50
|
-
return Array.isArray(type.value) && type.value.every(function (_ref) {
|
|
51
|
-
var tv = _ref.value;
|
|
52
|
-
return typeof tv === 'string' && tv[0] === '"' && tv[tv.length - 1] === '"';
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function createDefaultValue(defaultValue, type) {
|
|
60
|
-
if (defaultValue != null) {
|
|
61
|
-
var value = defaultValue.value;
|
|
62
|
-
|
|
63
|
-
if (!(0, _defaultValue.isDefaultValueBlacklisted)(value)) {
|
|
64
|
-
// Work around a bug in `react-docgen-typescript-loader`, which returns 'string' for a string
|
|
65
|
-
// default, instead of "'string'" -- which is incorrect
|
|
66
|
-
if (isReactDocgenTypescript(defaultValue) && isStringValued(type)) {
|
|
67
|
-
return (0, _utils.createSummaryValue)(JSON.stringify(value));
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return (0, _utils.createSummaryValue)(value);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return null;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function createBasicPropDef(name, type, docgenInfo) {
|
|
78
|
-
var description = docgenInfo.description,
|
|
79
|
-
required = docgenInfo.required,
|
|
80
|
-
defaultValue = docgenInfo.defaultValue;
|
|
81
|
-
return {
|
|
82
|
-
name: name,
|
|
83
|
-
type: createType(type),
|
|
84
|
-
required: required,
|
|
85
|
-
description: description,
|
|
86
|
-
defaultValue: createDefaultValue(defaultValue, type)
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function applyJsDocResult(propDef, jsDocParsingResult) {
|
|
91
|
-
if (jsDocParsingResult.includesJsDoc) {
|
|
92
|
-
var description = jsDocParsingResult.description,
|
|
93
|
-
extractedTags = jsDocParsingResult.extractedTags;
|
|
94
|
-
|
|
95
|
-
if (description != null) {
|
|
96
|
-
// eslint-disable-next-line no-param-reassign
|
|
97
|
-
propDef.description = jsDocParsingResult.description;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
var hasParams = extractedTags.params != null;
|
|
101
|
-
var hasReturns = extractedTags.returns != null && extractedTags.returns.type != null;
|
|
102
|
-
|
|
103
|
-
if (hasParams || hasReturns) {
|
|
104
|
-
// eslint-disable-next-line no-param-reassign
|
|
105
|
-
propDef.jsDocTags = {
|
|
106
|
-
params: hasParams && extractedTags.params.map(function (x) {
|
|
107
|
-
return {
|
|
108
|
-
name: x.getPrettyName(),
|
|
109
|
-
description: x.description
|
|
110
|
-
};
|
|
111
|
-
}),
|
|
112
|
-
returns: hasReturns && {
|
|
113
|
-
description: extractedTags.returns.description
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
return propDef;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
var javaScriptFactory = function javaScriptFactory(propName, docgenInfo, jsDocParsingResult) {
|
|
123
|
-
var propDef = createBasicPropDef(propName, docgenInfo.type, docgenInfo);
|
|
124
|
-
propDef.sbType = (0, _convert.convert)(docgenInfo);
|
|
125
|
-
return applyJsDocResult(propDef, jsDocParsingResult);
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
exports.javaScriptFactory = javaScriptFactory;
|
|
129
|
-
|
|
130
|
-
var tsFactory = function tsFactory(propName, docgenInfo, jsDocParsingResult) {
|
|
131
|
-
var propDef = (0, _createPropDef2.createTsPropDef)(propName, docgenInfo);
|
|
132
|
-
propDef.sbType = (0, _convert.convert)(docgenInfo);
|
|
133
|
-
return applyJsDocResult(propDef, jsDocParsingResult);
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
exports.tsFactory = tsFactory;
|
|
137
|
-
|
|
138
|
-
var flowFactory = function flowFactory(propName, docgenInfo, jsDocParsingResult) {
|
|
139
|
-
var propDef = (0, _createPropDef.createFlowPropDef)(propName, docgenInfo);
|
|
140
|
-
propDef.sbType = (0, _convert.convert)(docgenInfo);
|
|
141
|
-
return applyJsDocResult(propDef, jsDocParsingResult);
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
exports.flowFactory = flowFactory;
|
|
145
|
-
|
|
146
|
-
var unknownFactory = function unknownFactory(propName, docgenInfo, jsDocParsingResult) {
|
|
147
|
-
var propDef = createBasicPropDef(propName, {
|
|
148
|
-
name: 'unknown'
|
|
149
|
-
}, docgenInfo);
|
|
150
|
-
return applyJsDocResult(propDef, jsDocParsingResult);
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
exports.unknownFactory = unknownFactory;
|
|
154
|
-
|
|
155
|
-
var getPropDefFactory = function getPropDefFactory(typeSystem) {
|
|
156
|
-
switch (typeSystem) {
|
|
157
|
-
case _types.TypeSystem.JAVASCRIPT:
|
|
158
|
-
return javaScriptFactory;
|
|
159
|
-
|
|
160
|
-
case _types.TypeSystem.TYPESCRIPT:
|
|
161
|
-
return tsFactory;
|
|
162
|
-
|
|
163
|
-
case _types.TypeSystem.FLOW:
|
|
164
|
-
return flowFactory;
|
|
165
|
-
|
|
166
|
-
default:
|
|
167
|
-
return unknownFactory;
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
exports.getPropDefFactory = getPropDefFactory;
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.extractComponentDescription = extractComponentDescription;
|
|
7
|
-
exports.extractComponentProps = exports.extractComponentSectionObject = exports.extractComponentSectionArray = void 0;
|
|
8
|
-
|
|
9
|
-
require("core-js/modules/es.array.map.js");
|
|
10
|
-
|
|
11
|
-
require("core-js/modules/es.object.assign.js");
|
|
12
|
-
|
|
13
|
-
require("core-js/modules/es.function.name.js");
|
|
14
|
-
|
|
15
|
-
require("core-js/modules/es.object.keys.js");
|
|
16
|
-
|
|
17
|
-
require("core-js/modules/es.array.filter.js");
|
|
18
|
-
|
|
19
|
-
require("core-js/modules/es.symbol.js");
|
|
20
|
-
|
|
21
|
-
require("core-js/modules/es.symbol.description.js");
|
|
22
|
-
|
|
23
|
-
var _jsdocParser = require("../jsdocParser");
|
|
24
|
-
|
|
25
|
-
var _types = require("./types");
|
|
26
|
-
|
|
27
|
-
var _utils = require("./utils");
|
|
28
|
-
|
|
29
|
-
var _createPropDef = require("./createPropDef");
|
|
30
|
-
|
|
31
|
-
var getTypeSystem = function getTypeSystem(docgenInfo) {
|
|
32
|
-
if (docgenInfo.type != null) {
|
|
33
|
-
return _types.TypeSystem.JAVASCRIPT;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
if (docgenInfo.flowType != null) {
|
|
37
|
-
return _types.TypeSystem.FLOW;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (docgenInfo.tsType != null) {
|
|
41
|
-
return _types.TypeSystem.TYPESCRIPT;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return _types.TypeSystem.UNKNOWN;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
var extractComponentSectionArray = function extractComponentSectionArray(docgenSection) {
|
|
48
|
-
var typeSystem = getTypeSystem(docgenSection[0]);
|
|
49
|
-
var createPropDef = (0, _createPropDef.getPropDefFactory)(typeSystem);
|
|
50
|
-
return docgenSection.map(function (item) {
|
|
51
|
-
var _item$type;
|
|
52
|
-
|
|
53
|
-
var sanitizedItem = item;
|
|
54
|
-
|
|
55
|
-
if ((_item$type = item.type) !== null && _item$type !== void 0 && _item$type.elements) {
|
|
56
|
-
sanitizedItem = Object.assign({}, item, {
|
|
57
|
-
type: Object.assign({}, item.type, {
|
|
58
|
-
value: item.type.elements
|
|
59
|
-
})
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return extractProp(sanitizedItem.name, sanitizedItem, typeSystem, createPropDef);
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
exports.extractComponentSectionArray = extractComponentSectionArray;
|
|
68
|
-
|
|
69
|
-
var extractComponentSectionObject = function extractComponentSectionObject(docgenSection) {
|
|
70
|
-
var docgenPropsKeys = Object.keys(docgenSection);
|
|
71
|
-
var typeSystem = getTypeSystem(docgenSection[docgenPropsKeys[0]]);
|
|
72
|
-
var createPropDef = (0, _createPropDef.getPropDefFactory)(typeSystem);
|
|
73
|
-
return docgenPropsKeys.map(function (propName) {
|
|
74
|
-
var docgenInfo = docgenSection[propName];
|
|
75
|
-
return docgenInfo != null ? extractProp(propName, docgenInfo, typeSystem, createPropDef) : null;
|
|
76
|
-
}).filter(Boolean);
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
exports.extractComponentSectionObject = extractComponentSectionObject;
|
|
80
|
-
|
|
81
|
-
var extractComponentProps = function extractComponentProps(component, section) {
|
|
82
|
-
var docgenSection = (0, _utils.getDocgenSection)(component, section);
|
|
83
|
-
|
|
84
|
-
if (!(0, _utils.isValidDocgenSection)(docgenSection)) {
|
|
85
|
-
return [];
|
|
86
|
-
} // vue-docgen-api has diverged from react-docgen and returns an array
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
return Array.isArray(docgenSection) ? extractComponentSectionArray(docgenSection) : extractComponentSectionObject(docgenSection);
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
exports.extractComponentProps = extractComponentProps;
|
|
93
|
-
|
|
94
|
-
function extractProp(propName, docgenInfo, typeSystem, createPropDef) {
|
|
95
|
-
var jsDocParsingResult = (0, _jsdocParser.parseJsDoc)(docgenInfo.description);
|
|
96
|
-
var isIgnored = jsDocParsingResult.includesJsDoc && jsDocParsingResult.ignore;
|
|
97
|
-
|
|
98
|
-
if (!isIgnored) {
|
|
99
|
-
var propDef = createPropDef(propName, docgenInfo, jsDocParsingResult);
|
|
100
|
-
return {
|
|
101
|
-
propDef: propDef,
|
|
102
|
-
jsDocTags: jsDocParsingResult.extractedTags,
|
|
103
|
-
docgenInfo: docgenInfo,
|
|
104
|
-
typeSystem: typeSystem
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
return null;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
function extractComponentDescription(component) {
|
|
112
|
-
return component != null && (0, _utils.getDocgenDescription)(component);
|
|
113
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createDefaultValue = createDefaultValue;
|
|
7
|
-
|
|
8
|
-
require("core-js/modules/es.function.name.js");
|
|
9
|
-
|
|
10
|
-
var _utils = require("../../utils");
|
|
11
|
-
|
|
12
|
-
var _defaultValue = require("../utils/defaultValue");
|
|
13
|
-
|
|
14
|
-
function createDefaultValue(defaultValue, type) {
|
|
15
|
-
if (defaultValue != null) {
|
|
16
|
-
var value = defaultValue.value;
|
|
17
|
-
|
|
18
|
-
if (!(0, _defaultValue.isDefaultValueBlacklisted)(value)) {
|
|
19
|
-
return !(0, _utils.isTooLongForDefaultValueSummary)(value) ? (0, _utils.createSummaryValue)(value) : (0, _utils.createSummaryValue)(type.name, value);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createFlowPropDef = void 0;
|
|
7
|
-
|
|
8
|
-
require("core-js/modules/es.symbol.js");
|
|
9
|
-
|
|
10
|
-
require("core-js/modules/es.symbol.description.js");
|
|
11
|
-
|
|
12
|
-
var _createType = require("./createType");
|
|
13
|
-
|
|
14
|
-
var _createDefaultValue = require("./createDefaultValue");
|
|
15
|
-
|
|
16
|
-
var createFlowPropDef = function createFlowPropDef(propName, docgenInfo) {
|
|
17
|
-
var flowType = docgenInfo.flowType,
|
|
18
|
-
description = docgenInfo.description,
|
|
19
|
-
required = docgenInfo.required,
|
|
20
|
-
defaultValue = docgenInfo.defaultValue;
|
|
21
|
-
return {
|
|
22
|
-
name: propName,
|
|
23
|
-
type: (0, _createType.createType)(flowType),
|
|
24
|
-
required: required,
|
|
25
|
-
description: description,
|
|
26
|
-
defaultValue: (0, _createDefaultValue.createDefaultValue)(defaultValue, flowType)
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
exports.createFlowPropDef = createFlowPropDef;
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createType = createType;
|
|
7
|
-
|
|
8
|
-
require("core-js/modules/es.function.name.js");
|
|
9
|
-
|
|
10
|
-
require("core-js/modules/es.array.join.js");
|
|
11
|
-
|
|
12
|
-
require("core-js/modules/es.array.map.js");
|
|
13
|
-
|
|
14
|
-
require("core-js/modules/es.string.replace.js");
|
|
15
|
-
|
|
16
|
-
require("core-js/modules/es.regexp.exec.js");
|
|
17
|
-
|
|
18
|
-
var _utils = require("../../utils");
|
|
19
|
-
|
|
20
|
-
var FlowTypesType;
|
|
21
|
-
|
|
22
|
-
(function (FlowTypesType) {
|
|
23
|
-
FlowTypesType["UNION"] = "union";
|
|
24
|
-
FlowTypesType["SIGNATURE"] = "signature";
|
|
25
|
-
})(FlowTypesType || (FlowTypesType = {}));
|
|
26
|
-
|
|
27
|
-
function generateUnionElement(_ref) {
|
|
28
|
-
var name = _ref.name,
|
|
29
|
-
value = _ref.value,
|
|
30
|
-
elements = _ref.elements,
|
|
31
|
-
raw = _ref.raw;
|
|
32
|
-
|
|
33
|
-
if (value != null) {
|
|
34
|
-
return value;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (elements != null) {
|
|
38
|
-
return elements.map(generateUnionElement).join(' | ');
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (raw != null) {
|
|
42
|
-
return raw;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return name;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function generateUnion(_ref2) {
|
|
49
|
-
var name = _ref2.name,
|
|
50
|
-
raw = _ref2.raw,
|
|
51
|
-
elements = _ref2.elements;
|
|
52
|
-
|
|
53
|
-
if (elements != null) {
|
|
54
|
-
return (0, _utils.createSummaryValue)(elements.map(generateUnionElement).join(' | '));
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
if (raw != null) {
|
|
58
|
-
// Flow Unions can be defined with or without a leading `|` character, so try to remove it.
|
|
59
|
-
return (0, _utils.createSummaryValue)(raw.replace(/^\|\s*/, ''));
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return (0, _utils.createSummaryValue)(name);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function generateFuncSignature(_ref3) {
|
|
66
|
-
var type = _ref3.type,
|
|
67
|
-
raw = _ref3.raw;
|
|
68
|
-
|
|
69
|
-
if (raw != null) {
|
|
70
|
-
return (0, _utils.createSummaryValue)(raw);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return (0, _utils.createSummaryValue)(type);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function generateObjectSignature(_ref4) {
|
|
77
|
-
var type = _ref4.type,
|
|
78
|
-
raw = _ref4.raw;
|
|
79
|
-
|
|
80
|
-
if (raw != null) {
|
|
81
|
-
return !(0, _utils.isTooLongForTypeSummary)(raw) ? (0, _utils.createSummaryValue)(raw) : (0, _utils.createSummaryValue)(type, raw);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return (0, _utils.createSummaryValue)(type);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
function generateSignature(flowType) {
|
|
88
|
-
var type = flowType.type;
|
|
89
|
-
return type === 'object' ? generateObjectSignature(flowType) : generateFuncSignature(flowType);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function generateDefault(_ref5) {
|
|
93
|
-
var name = _ref5.name,
|
|
94
|
-
raw = _ref5.raw;
|
|
95
|
-
|
|
96
|
-
if (raw != null) {
|
|
97
|
-
return !(0, _utils.isTooLongForTypeSummary)(raw) ? (0, _utils.createSummaryValue)(raw) : (0, _utils.createSummaryValue)(name, raw);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return (0, _utils.createSummaryValue)(name);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function createType(type) {
|
|
104
|
-
// A type could be null if a defaultProp has been provided without a type definition.
|
|
105
|
-
if (type == null) {
|
|
106
|
-
return null;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
switch (type.name) {
|
|
110
|
-
case FlowTypesType.UNION:
|
|
111
|
-
return generateUnion(type);
|
|
112
|
-
|
|
113
|
-
case FlowTypesType.SIGNATURE:
|
|
114
|
-
return generateSignature(type);
|
|
115
|
-
|
|
116
|
-
default:
|
|
117
|
-
return generateDefault(type);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
|
4
|
-
|
|
5
|
-
require("core-js/modules/es.object.keys.js");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
var _types = require("./types");
|
|
12
|
-
|
|
13
|
-
Object.keys(_types).forEach(function (key) {
|
|
14
|
-
if (key === "default" || key === "__esModule") return;
|
|
15
|
-
if (key in exports && exports[key] === _types[key]) return;
|
|
16
|
-
Object.defineProperty(exports, key, {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: function get() {
|
|
19
|
-
return _types[key];
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
var _utils = require("./utils");
|
|
25
|
-
|
|
26
|
-
Object.keys(_utils).forEach(function (key) {
|
|
27
|
-
if (key === "default" || key === "__esModule") return;
|
|
28
|
-
if (key in exports && exports[key] === _utils[key]) return;
|
|
29
|
-
Object.defineProperty(exports, key, {
|
|
30
|
-
enumerable: true,
|
|
31
|
-
get: function get() {
|
|
32
|
-
return _utils[key];
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
var _extractDocgenProps = require("./extractDocgenProps");
|
|
38
|
-
|
|
39
|
-
Object.keys(_extractDocgenProps).forEach(function (key) {
|
|
40
|
-
if (key === "default" || key === "__esModule") return;
|
|
41
|
-
if (key in exports && exports[key] === _extractDocgenProps[key]) return;
|
|
42
|
-
Object.defineProperty(exports, key, {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
get: function get() {
|
|
45
|
-
return _extractDocgenProps[key];
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createDefaultValue = createDefaultValue;
|
|
7
|
-
|
|
8
|
-
var _utils = require("../../utils");
|
|
9
|
-
|
|
10
|
-
var _defaultValue = require("../utils/defaultValue");
|
|
11
|
-
|
|
12
|
-
function createDefaultValue(_ref) {
|
|
13
|
-
var defaultValue = _ref.defaultValue;
|
|
14
|
-
|
|
15
|
-
if (defaultValue != null) {
|
|
16
|
-
var value = defaultValue.value;
|
|
17
|
-
|
|
18
|
-
if (!(0, _defaultValue.isDefaultValueBlacklisted)(value)) {
|
|
19
|
-
return (0, _utils.createSummaryValue)(value);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return null;
|
|
24
|
-
}
|