@storybook/addon-docs 6.5.0-alpha.47 → 6.5.0-alpha.48
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/angular/index.d.ts +1 -1
- package/angular/index.js +7 -1
- package/dist/cjs/blocks/Description.js +4 -4
- package/dist/cjs/frameworks/common/config.js +2 -6
- package/dist/esm/blocks/Description.js +1 -1
- package/dist/esm/frameworks/common/config.js +1 -3
- package/dist/modern/blocks/Description.js +1 -1
- package/dist/modern/frameworks/common/config.js +1 -3
- package/dist/ts3.4/frameworks/common/config.d.ts +0 -1
- package/dist/ts3.9/frameworks/common/config.d.ts +0 -1
- package/ember/index.js +6 -1
- package/package.json +15 -110
- package/preset.js +14 -14
- 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 -24
- 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/ember/config.js +0 -17
- package/dist/cjs/frameworks/ember/index.js +0 -13
- package/dist/cjs/frameworks/ember/jsondoc.js +0 -89
- 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 -54
- package/dist/cjs/frameworks/react/extractProps.js +0 -77
- package/dist/cjs/frameworks/react/jsxDecorator.js +0 -279
- 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 -37
- 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 -63
- package/dist/cjs/frameworks/react/lib/inspection/acornParser.js +0 -254
- package/dist/cjs/frameworks/react/lib/inspection/index.js +0 -37
- 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 -469
- 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 -37
- package/dist/cjs/frameworks/react/react-argtypes.stories.js +0 -155
- 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 -162
- package/dist/cjs/frameworks/svelte/extractComponentDescription.js +0 -21
- package/dist/cjs/frameworks/svelte/prepareForInline.js +0 -34
- package/dist/cjs/frameworks/svelte/preset.js +0 -54
- package/dist/cjs/frameworks/svelte/sourceDecorator.js +0 -264
- 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 -155
- package/dist/cjs/frameworks/vue/prepareForInline.js +0 -56
- package/dist/cjs/frameworks/vue/preset.js +0 -45
- 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 -64
- package/dist/cjs/frameworks/vue3/prepareForInline.js +0 -61
- package/dist/cjs/frameworks/vue3/preset.js +0 -45
- package/dist/cjs/frameworks/web-components/config.js +0 -30
- package/dist/cjs/frameworks/web-components/custom-elements.js +0 -165
- 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 -114
- package/dist/cjs/lib/convert/flow/index.js +0 -37
- 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 -140
- package/dist/cjs/lib/convert/proptypes/index.js +0 -37
- package/dist/cjs/lib/convert/proptypes/types.js +0 -1
- package/dist/cjs/lib/convert/typescript/convert.js +0 -84
- package/dist/cjs/lib/convert/typescript/index.js +0 -37
- package/dist/cjs/lib/convert/typescript/types.js +0 -1
- package/dist/cjs/lib/convert/utils.js +0 -24
- package/dist/cjs/lib/docgen/PropDef.js +0 -1
- package/dist/cjs/lib/docgen/createPropDef.js +0 -173
- package/dist/cjs/lib/docgen/extractDocgenProps.js +0 -115
- 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 -50
- 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 -16
- package/dist/cjs/lib/docgen/utils/docgenInfo.js +0 -34
- package/dist/cjs/lib/docgen/utils/index.js +0 -50
- package/dist/cjs/lib/docgen/utils/string.js +0 -20
- package/dist/cjs/lib/index.js +0 -24
- package/dist/cjs/lib/jsdocParser.js +0 -229
- package/dist/cjs/lib/utils.js +0 -46
- 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/ember/config.js +0 -8
- package/dist/esm/frameworks/ember/index.js +0 -1
- package/dist/esm/frameworks/ember/jsondoc.js +0 -67
- 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 -39
- package/dist/esm/frameworks/react/extractProps.js +0 -53
- package/dist/esm/frameworks/react/jsxDecorator.js +0 -219
- 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 -449
- 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 -24
- package/dist/esm/frameworks/react/react-argtypes.stories.js +0 -123
- package/dist/esm/frameworks/react/typeScript/handleProp.js +0 -27
- package/dist/esm/frameworks/svelte/config.js +0 -13
- package/dist/esm/frameworks/svelte/extractArgTypes.js +0 -140
- package/dist/esm/frameworks/svelte/extractComponentDescription.js +0 -12
- package/dist/esm/frameworks/svelte/prepareForInline.js +0 -19
- package/dist/esm/frameworks/svelte/preset.js +0 -42
- package/dist/esm/frameworks/svelte/sourceDecorator.js +0 -233
- 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 -129
- package/dist/esm/frameworks/vue/prepareForInline.js +0 -39
- package/dist/esm/frameworks/vue/preset.js +0 -32
- 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 -46
- package/dist/esm/frameworks/vue3/prepareForInline.js +0 -22
- package/dist/esm/frameworks/vue3/preset.js +0 -32
- package/dist/esm/frameworks/web-components/config.js +0 -17
- package/dist/esm/frameworks/web-components/custom-elements.js +0 -140
- 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 -99
- 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 -119
- 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 -71
- 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 -9
- package/dist/esm/lib/docgen/PropDef.js +0 -0
- package/dist/esm/lib/docgen/createPropDef.js +0 -142
- package/dist/esm/lib/docgen/extractDocgenProps.js +0 -88
- 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 -7
- 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/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/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 -178
- 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 -211
- 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/config.js +0 -13
- package/dist/modern/frameworks/svelte/extractArgTypes.js +0 -119
- package/dist/modern/frameworks/svelte/extractComponentDescription.js +0 -10
- package/dist/modern/frameworks/svelte/prepareForInline.js +0 -17
- package/dist/modern/frameworks/svelte/preset.js +0 -11
- 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 -105
- 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 -3
- 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/ts3.4/frameworks/angular/compodoc.d.ts +0 -18
- package/dist/ts3.4/frameworks/angular/config.d.ts +0 -14
- 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/enhanceArgTypes.d.ts +0 -2
- 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 -10
- 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 -10
- 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 -9
- 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 -17
- 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 -2
- 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 -14
- 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/enhanceArgTypes.d.ts +0 -2
- 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 -10
- 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 -10
- 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 -9
- 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 -17
- 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 -2
- 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,469 +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.regexp.exec.js");
|
|
11
|
-
|
|
12
|
-
require("core-js/modules/es.string.replace.js");
|
|
13
|
-
|
|
14
|
-
require("core-js/modules/es.string.split.js");
|
|
15
|
-
|
|
16
|
-
require("core-js/modules/es.array.join.js");
|
|
17
|
-
|
|
18
|
-
require("core-js/modules/es.array.map.js");
|
|
19
|
-
|
|
20
|
-
require("core-js/modules/es.object.keys.js");
|
|
21
|
-
|
|
22
|
-
require("core-js/modules/es.array.concat.js");
|
|
23
|
-
|
|
24
|
-
require("core-js/modules/es.object.to-string.js");
|
|
25
|
-
|
|
26
|
-
var _lib = require("../../../lib");
|
|
27
|
-
|
|
28
|
-
var _generateFuncSignature = require("./generateFuncSignature");
|
|
29
|
-
|
|
30
|
-
var _lib2 = require("../lib");
|
|
31
|
-
|
|
32
|
-
var _inspection = require("../lib/inspection");
|
|
33
|
-
|
|
34
|
-
var MAX_FUNC_LENGTH = 150;
|
|
35
|
-
var PropTypesType;
|
|
36
|
-
|
|
37
|
-
(function (PropTypesType) {
|
|
38
|
-
PropTypesType["CUSTOM"] = "custom";
|
|
39
|
-
PropTypesType["ANY"] = "any";
|
|
40
|
-
PropTypesType["FUNC"] = "func";
|
|
41
|
-
PropTypesType["SHAPE"] = "shape";
|
|
42
|
-
PropTypesType["OBJECT"] = "object";
|
|
43
|
-
PropTypesType["INSTANCEOF"] = "instanceOf";
|
|
44
|
-
PropTypesType["OBJECTOF"] = "objectOf";
|
|
45
|
-
PropTypesType["UNION"] = "union";
|
|
46
|
-
PropTypesType["ENUM"] = "enum";
|
|
47
|
-
PropTypesType["ARRAYOF"] = "arrayOf";
|
|
48
|
-
PropTypesType["ELEMENT"] = "element";
|
|
49
|
-
PropTypesType["ELEMENTTYPE"] = "elementType";
|
|
50
|
-
PropTypesType["NODE"] = "node";
|
|
51
|
-
})(PropTypesType || (PropTypesType = {}));
|
|
52
|
-
|
|
53
|
-
function createTypeDef(_ref) {
|
|
54
|
-
var name = _ref.name,
|
|
55
|
-
short = _ref.short,
|
|
56
|
-
compact = _ref.compact,
|
|
57
|
-
full = _ref.full,
|
|
58
|
-
inferredType = _ref.inferredType;
|
|
59
|
-
return {
|
|
60
|
-
name: name,
|
|
61
|
-
short: short,
|
|
62
|
-
compact: compact,
|
|
63
|
-
full: full != null ? full : short,
|
|
64
|
-
inferredType: inferredType
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function cleanPropTypes(value) {
|
|
69
|
-
return value.replace(/PropTypes./g, '').replace(/.isRequired/g, '');
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function splitIntoLines(value) {
|
|
73
|
-
return value.split(/\r?\n/);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function prettyObject(ast) {
|
|
77
|
-
var compact = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
78
|
-
return cleanPropTypes((0, _lib2.generateObjectCode)(ast, compact));
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function prettyArray(ast) {
|
|
82
|
-
var compact = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
83
|
-
return cleanPropTypes((0, _lib2.generateCode)(ast, compact));
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
function getCaptionForInspectionType(type) {
|
|
87
|
-
switch (type) {
|
|
88
|
-
case _inspection.InspectionType.OBJECT:
|
|
89
|
-
return _lib2.OBJECT_CAPTION;
|
|
90
|
-
|
|
91
|
-
case _inspection.InspectionType.ARRAY:
|
|
92
|
-
return _lib2.ARRAY_CAPTION;
|
|
93
|
-
|
|
94
|
-
case _inspection.InspectionType.CLASS:
|
|
95
|
-
return _lib2.CLASS_CAPTION;
|
|
96
|
-
|
|
97
|
-
case _inspection.InspectionType.FUNCTION:
|
|
98
|
-
return _lib2.FUNCTION_CAPTION;
|
|
99
|
-
|
|
100
|
-
case _inspection.InspectionType.ELEMENT:
|
|
101
|
-
return _lib2.ELEMENT_CAPTION;
|
|
102
|
-
|
|
103
|
-
default:
|
|
104
|
-
return _lib2.CUSTOM_CAPTION;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
function generateTypeFromString(value, originalTypeName) {
|
|
109
|
-
var _inspectValue = (0, _inspection.inspectValue)(value),
|
|
110
|
-
inferredType = _inspectValue.inferredType,
|
|
111
|
-
ast = _inspectValue.ast;
|
|
112
|
-
|
|
113
|
-
var type = inferredType.type;
|
|
114
|
-
var short;
|
|
115
|
-
var compact;
|
|
116
|
-
var full;
|
|
117
|
-
|
|
118
|
-
switch (type) {
|
|
119
|
-
case _inspection.InspectionType.IDENTIFIER:
|
|
120
|
-
case _inspection.InspectionType.LITERAL:
|
|
121
|
-
short = value;
|
|
122
|
-
compact = value;
|
|
123
|
-
break;
|
|
124
|
-
|
|
125
|
-
case _inspection.InspectionType.OBJECT:
|
|
126
|
-
{
|
|
127
|
-
var _ref2 = inferredType,
|
|
128
|
-
depth = _ref2.depth;
|
|
129
|
-
short = _lib2.OBJECT_CAPTION;
|
|
130
|
-
compact = depth === 1 ? prettyObject(ast, true) : null;
|
|
131
|
-
full = prettyObject(ast);
|
|
132
|
-
break;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
case _inspection.InspectionType.ELEMENT:
|
|
136
|
-
{
|
|
137
|
-
var _ref3 = inferredType,
|
|
138
|
-
identifier = _ref3.identifier;
|
|
139
|
-
short = identifier != null && !(0, _lib2.isHtmlTag)(identifier) ? identifier : _lib2.ELEMENT_CAPTION;
|
|
140
|
-
compact = splitIntoLines(value).length === 1 ? value : null;
|
|
141
|
-
full = value;
|
|
142
|
-
break;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
case _inspection.InspectionType.ARRAY:
|
|
146
|
-
{
|
|
147
|
-
var _ref4 = inferredType,
|
|
148
|
-
_depth = _ref4.depth;
|
|
149
|
-
short = _lib2.ARRAY_CAPTION;
|
|
150
|
-
compact = _depth <= 2 ? prettyArray(ast, true) : null;
|
|
151
|
-
full = prettyArray(ast);
|
|
152
|
-
break;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
default:
|
|
156
|
-
short = getCaptionForInspectionType(type);
|
|
157
|
-
compact = splitIntoLines(value).length === 1 ? value : null;
|
|
158
|
-
full = value;
|
|
159
|
-
break;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
return createTypeDef({
|
|
163
|
-
name: originalTypeName,
|
|
164
|
-
short: short,
|
|
165
|
-
compact: compact,
|
|
166
|
-
full: full,
|
|
167
|
-
inferredType: type
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
function generateCustom(_ref5) {
|
|
172
|
-
var raw = _ref5.raw;
|
|
173
|
-
|
|
174
|
-
if (raw != null) {
|
|
175
|
-
return generateTypeFromString(raw, PropTypesType.CUSTOM);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
return createTypeDef({
|
|
179
|
-
name: PropTypesType.CUSTOM,
|
|
180
|
-
short: _lib2.CUSTOM_CAPTION,
|
|
181
|
-
compact: _lib2.CUSTOM_CAPTION
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
function generateFunc(extractedProp) {
|
|
186
|
-
var jsDocTags = extractedProp.jsDocTags;
|
|
187
|
-
|
|
188
|
-
if (jsDocTags != null) {
|
|
189
|
-
if (jsDocTags.params != null || jsDocTags.returns != null) {
|
|
190
|
-
return createTypeDef({
|
|
191
|
-
name: PropTypesType.FUNC,
|
|
192
|
-
short: (0, _generateFuncSignature.generateShortFuncSignature)(jsDocTags.params, jsDocTags.returns),
|
|
193
|
-
compact: null,
|
|
194
|
-
full: (0, _generateFuncSignature.generateFuncSignature)(jsDocTags.params, jsDocTags.returns)
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
return createTypeDef({
|
|
200
|
-
name: PropTypesType.FUNC,
|
|
201
|
-
short: _lib2.FUNCTION_CAPTION,
|
|
202
|
-
compact: _lib2.FUNCTION_CAPTION
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
function generateShape(type, extractedProp) {
|
|
207
|
-
var fields = Object.keys(type.value).map(function (key) {
|
|
208
|
-
return "".concat(key, ": ").concat(generateType(type.value[key], extractedProp).full);
|
|
209
|
-
}).join(', ');
|
|
210
|
-
|
|
211
|
-
var _inspectValue2 = (0, _inspection.inspectValue)("{ ".concat(fields, " }")),
|
|
212
|
-
inferredType = _inspectValue2.inferredType,
|
|
213
|
-
ast = _inspectValue2.ast;
|
|
214
|
-
|
|
215
|
-
var _ref6 = inferredType,
|
|
216
|
-
depth = _ref6.depth;
|
|
217
|
-
return createTypeDef({
|
|
218
|
-
name: PropTypesType.SHAPE,
|
|
219
|
-
short: _lib2.OBJECT_CAPTION,
|
|
220
|
-
compact: depth === 1 && ast ? prettyObject(ast, true) : null,
|
|
221
|
-
full: ast ? prettyObject(ast) : null
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
function objectOf(of) {
|
|
226
|
-
return "objectOf(".concat(of, ")");
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
function generateObjectOf(type, extractedProp) {
|
|
230
|
-
var _generateType = generateType(type.value, extractedProp),
|
|
231
|
-
short = _generateType.short,
|
|
232
|
-
compact = _generateType.compact,
|
|
233
|
-
full = _generateType.full;
|
|
234
|
-
|
|
235
|
-
return createTypeDef({
|
|
236
|
-
name: PropTypesType.OBJECTOF,
|
|
237
|
-
short: objectOf(short),
|
|
238
|
-
compact: compact != null ? objectOf(compact) : null,
|
|
239
|
-
full: objectOf(full)
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
function generateUnion(type, extractedProp) {
|
|
244
|
-
if (Array.isArray(type.value)) {
|
|
245
|
-
var values = type.value.reduce(function (acc, v) {
|
|
246
|
-
var _generateType2 = generateType(v, extractedProp),
|
|
247
|
-
short = _generateType2.short,
|
|
248
|
-
compact = _generateType2.compact,
|
|
249
|
-
full = _generateType2.full;
|
|
250
|
-
|
|
251
|
-
acc.short.push(short);
|
|
252
|
-
acc.compact.push(compact);
|
|
253
|
-
acc.full.push(full);
|
|
254
|
-
return acc;
|
|
255
|
-
}, {
|
|
256
|
-
short: [],
|
|
257
|
-
compact: [],
|
|
258
|
-
full: []
|
|
259
|
-
});
|
|
260
|
-
return createTypeDef({
|
|
261
|
-
name: PropTypesType.UNION,
|
|
262
|
-
short: values.short.join(' | '),
|
|
263
|
-
compact: values.compact.every(function (x) {
|
|
264
|
-
return x != null;
|
|
265
|
-
}) ? values.compact.join(' | ') : null,
|
|
266
|
-
full: values.full.join(' | ')
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
return createTypeDef({
|
|
271
|
-
name: PropTypesType.UNION,
|
|
272
|
-
short: type.value,
|
|
273
|
-
compact: null
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
function generateEnumValue(_ref7) {
|
|
278
|
-
var value = _ref7.value,
|
|
279
|
-
computed = _ref7.computed;
|
|
280
|
-
return computed ? generateTypeFromString(value, 'enumvalue') : createTypeDef({
|
|
281
|
-
name: 'enumvalue',
|
|
282
|
-
short: value,
|
|
283
|
-
compact: value
|
|
284
|
-
});
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
function generateEnum(type) {
|
|
288
|
-
if (Array.isArray(type.value)) {
|
|
289
|
-
var values = type.value.reduce(function (acc, v) {
|
|
290
|
-
var _generateEnumValue = generateEnumValue(v),
|
|
291
|
-
short = _generateEnumValue.short,
|
|
292
|
-
compact = _generateEnumValue.compact,
|
|
293
|
-
full = _generateEnumValue.full;
|
|
294
|
-
|
|
295
|
-
acc.short.push(short);
|
|
296
|
-
acc.compact.push(compact);
|
|
297
|
-
acc.full.push(full);
|
|
298
|
-
return acc;
|
|
299
|
-
}, {
|
|
300
|
-
short: [],
|
|
301
|
-
compact: [],
|
|
302
|
-
full: []
|
|
303
|
-
});
|
|
304
|
-
return createTypeDef({
|
|
305
|
-
name: PropTypesType.ENUM,
|
|
306
|
-
short: values.short.join(' | '),
|
|
307
|
-
compact: values.compact.every(function (x) {
|
|
308
|
-
return x != null;
|
|
309
|
-
}) ? values.compact.join(' | ') : null,
|
|
310
|
-
full: values.full.join(' | ')
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
return createTypeDef({
|
|
315
|
-
name: PropTypesType.ENUM,
|
|
316
|
-
short: type.value,
|
|
317
|
-
compact: type.value
|
|
318
|
-
});
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
function braceAfter(of) {
|
|
322
|
-
return "".concat(of, "[]");
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
function braceAround(of) {
|
|
326
|
-
return "[".concat(of, "]");
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
function createArrayOfObjectTypeDef(short, compact, full) {
|
|
330
|
-
return createTypeDef({
|
|
331
|
-
name: PropTypesType.ARRAYOF,
|
|
332
|
-
short: braceAfter(short),
|
|
333
|
-
compact: compact != null ? braceAround(compact) : null,
|
|
334
|
-
full: braceAround(full)
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
function generateArray(type, extractedProp) {
|
|
339
|
-
var _generateType3 = generateType(type.value, extractedProp),
|
|
340
|
-
name = _generateType3.name,
|
|
341
|
-
short = _generateType3.short,
|
|
342
|
-
compact = _generateType3.compact,
|
|
343
|
-
full = _generateType3.full,
|
|
344
|
-
inferredType = _generateType3.inferredType;
|
|
345
|
-
|
|
346
|
-
if (name === PropTypesType.CUSTOM) {
|
|
347
|
-
if (inferredType === _inspection.InspectionType.OBJECT) {
|
|
348
|
-
return createArrayOfObjectTypeDef(short, compact, full);
|
|
349
|
-
}
|
|
350
|
-
} else if (name === PropTypesType.SHAPE) {
|
|
351
|
-
return createArrayOfObjectTypeDef(short, compact, full);
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
return createTypeDef({
|
|
355
|
-
name: PropTypesType.ARRAYOF,
|
|
356
|
-
short: braceAfter(short),
|
|
357
|
-
compact: braceAfter(short)
|
|
358
|
-
});
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
function generateType(type, extractedProp) {
|
|
362
|
-
try {
|
|
363
|
-
switch (type.name) {
|
|
364
|
-
case PropTypesType.CUSTOM:
|
|
365
|
-
return generateCustom(type);
|
|
366
|
-
|
|
367
|
-
case PropTypesType.FUNC:
|
|
368
|
-
return generateFunc(extractedProp);
|
|
369
|
-
|
|
370
|
-
case PropTypesType.SHAPE:
|
|
371
|
-
return generateShape(type, extractedProp);
|
|
372
|
-
|
|
373
|
-
case PropTypesType.INSTANCEOF:
|
|
374
|
-
return createTypeDef({
|
|
375
|
-
name: PropTypesType.INSTANCEOF,
|
|
376
|
-
short: type.value,
|
|
377
|
-
compact: type.value
|
|
378
|
-
});
|
|
379
|
-
|
|
380
|
-
case PropTypesType.OBJECTOF:
|
|
381
|
-
return generateObjectOf(type, extractedProp);
|
|
382
|
-
|
|
383
|
-
case PropTypesType.UNION:
|
|
384
|
-
return generateUnion(type, extractedProp);
|
|
385
|
-
|
|
386
|
-
case PropTypesType.ENUM:
|
|
387
|
-
return generateEnum(type);
|
|
388
|
-
|
|
389
|
-
case PropTypesType.ARRAYOF:
|
|
390
|
-
return generateArray(type, extractedProp);
|
|
391
|
-
|
|
392
|
-
default:
|
|
393
|
-
return createTypeDef({
|
|
394
|
-
name: type.name,
|
|
395
|
-
short: type.name,
|
|
396
|
-
compact: type.name
|
|
397
|
-
});
|
|
398
|
-
}
|
|
399
|
-
} catch (e) {
|
|
400
|
-
// eslint-disable-next-line no-console
|
|
401
|
-
console.error(e);
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
return createTypeDef({
|
|
405
|
-
name: 'unknown',
|
|
406
|
-
short: 'unknown',
|
|
407
|
-
compact: 'unknown'
|
|
408
|
-
});
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
function createType(extractedProp) {
|
|
412
|
-
var type = extractedProp.docgenInfo.type; // A type could be null if a defaultProp has been provided without a type definition.
|
|
413
|
-
|
|
414
|
-
if (type == null) {
|
|
415
|
-
return null;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
try {
|
|
419
|
-
switch (type.name) {
|
|
420
|
-
case PropTypesType.CUSTOM:
|
|
421
|
-
case PropTypesType.SHAPE:
|
|
422
|
-
case PropTypesType.INSTANCEOF:
|
|
423
|
-
case PropTypesType.OBJECTOF:
|
|
424
|
-
case PropTypesType.UNION:
|
|
425
|
-
case PropTypesType.ENUM:
|
|
426
|
-
case PropTypesType.ARRAYOF:
|
|
427
|
-
{
|
|
428
|
-
var _generateType4 = generateType(type, extractedProp),
|
|
429
|
-
short = _generateType4.short,
|
|
430
|
-
compact = _generateType4.compact,
|
|
431
|
-
full = _generateType4.full;
|
|
432
|
-
|
|
433
|
-
if (compact != null) {
|
|
434
|
-
if (!(0, _lib.isTooLongForTypeSummary)(compact)) {
|
|
435
|
-
return (0, _lib.createSummaryValue)(compact);
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
return (0, _lib.createSummaryValue)(short, full);
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
case PropTypesType.FUNC:
|
|
443
|
-
{
|
|
444
|
-
var _generateType5 = generateType(type, extractedProp),
|
|
445
|
-
_short = _generateType5.short,
|
|
446
|
-
_full = _generateType5.full;
|
|
447
|
-
|
|
448
|
-
var summary = _short;
|
|
449
|
-
var detail;
|
|
450
|
-
|
|
451
|
-
if (_full.length < MAX_FUNC_LENGTH) {
|
|
452
|
-
summary = _full;
|
|
453
|
-
} else {
|
|
454
|
-
detail = (0, _generateFuncSignature.toMultilineSignature)(_full);
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
return (0, _lib.createSummaryValue)(summary, detail);
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
default:
|
|
461
|
-
return null;
|
|
462
|
-
}
|
|
463
|
-
} catch (e) {
|
|
464
|
-
// eslint-disable-next-line no-console
|
|
465
|
-
console.error(e);
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
return null;
|
|
469
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.generateFuncSignature = generateFuncSignature;
|
|
7
|
-
exports.generateShortFuncSignature = generateShortFuncSignature;
|
|
8
|
-
exports.toMultilineSignature = toMultilineSignature;
|
|
9
|
-
|
|
10
|
-
require("core-js/modules/es.array.map.js");
|
|
11
|
-
|
|
12
|
-
require("core-js/modules/es.array.concat.js");
|
|
13
|
-
|
|
14
|
-
require("core-js/modules/es.array.join.js");
|
|
15
|
-
|
|
16
|
-
require("core-js/modules/es.regexp.exec.js");
|
|
17
|
-
|
|
18
|
-
require("core-js/modules/es.string.replace.js");
|
|
19
|
-
|
|
20
|
-
function generateFuncSignature(params, returns) {
|
|
21
|
-
var hasParams = params != null;
|
|
22
|
-
var hasReturns = returns != null;
|
|
23
|
-
|
|
24
|
-
if (!hasParams && !hasReturns) {
|
|
25
|
-
return '';
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
var funcParts = [];
|
|
29
|
-
|
|
30
|
-
if (hasParams) {
|
|
31
|
-
var funcParams = params.map(function (x) {
|
|
32
|
-
var prettyName = x.getPrettyName();
|
|
33
|
-
var typeName = x.getTypeName();
|
|
34
|
-
|
|
35
|
-
if (typeName != null) {
|
|
36
|
-
return "".concat(prettyName, ": ").concat(typeName);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return prettyName;
|
|
40
|
-
});
|
|
41
|
-
funcParts.push("(".concat(funcParams.join(', '), ")"));
|
|
42
|
-
} else {
|
|
43
|
-
funcParts.push('()');
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (hasReturns) {
|
|
47
|
-
funcParts.push("=> ".concat(returns.getTypeName()));
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return funcParts.join(' ');
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function generateShortFuncSignature(params, returns) {
|
|
54
|
-
var hasParams = params != null;
|
|
55
|
-
var hasReturns = returns != null;
|
|
56
|
-
|
|
57
|
-
if (!hasParams && !hasReturns) {
|
|
58
|
-
return '';
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
var funcParts = [];
|
|
62
|
-
|
|
63
|
-
if (hasParams) {
|
|
64
|
-
funcParts.push('( ... )');
|
|
65
|
-
} else {
|
|
66
|
-
funcParts.push('()');
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if (hasReturns) {
|
|
70
|
-
funcParts.push("=> ".concat(returns.getTypeName()));
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return funcParts.join(' ');
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function toMultilineSignature(signature) {
|
|
77
|
-
return signature.replace(/,/g, ',\r\n');
|
|
78
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.enhancePropTypesProp = enhancePropTypesProp;
|
|
7
|
-
exports.enhancePropTypesProps = enhancePropTypesProps;
|
|
8
|
-
|
|
9
|
-
require("core-js/modules/es.array.map.js");
|
|
10
|
-
|
|
11
|
-
require("core-js/modules/es.function.name.js");
|
|
12
|
-
|
|
13
|
-
var _createType = require("./createType");
|
|
14
|
-
|
|
15
|
-
var _defaultValues = require("../lib/defaultValues");
|
|
16
|
-
|
|
17
|
-
var _sortProps = require("./sortProps");
|
|
18
|
-
|
|
19
|
-
var _rawDefaultPropResolvers = require("./rawDefaultPropResolvers");
|
|
20
|
-
|
|
21
|
-
function enhancePropTypesProp(extractedProp, rawDefaultProp) {
|
|
22
|
-
var propDef = extractedProp.propDef;
|
|
23
|
-
var newtype = (0, _createType.createType)(extractedProp);
|
|
24
|
-
|
|
25
|
-
if (newtype != null) {
|
|
26
|
-
propDef.type = newtype;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
var defaultValue = extractedProp.docgenInfo.defaultValue;
|
|
30
|
-
|
|
31
|
-
if (defaultValue != null && defaultValue.value != null) {
|
|
32
|
-
var newDefaultValue = (0, _defaultValues.createDefaultValue)(defaultValue.value);
|
|
33
|
-
|
|
34
|
-
if (newDefaultValue != null) {
|
|
35
|
-
propDef.defaultValue = newDefaultValue;
|
|
36
|
-
}
|
|
37
|
-
} else if (rawDefaultProp != null) {
|
|
38
|
-
var _newDefaultValue = (0, _defaultValues.createDefaultValueFromRawDefaultProp)(rawDefaultProp, propDef, _rawDefaultPropResolvers.rawDefaultPropTypeResolvers);
|
|
39
|
-
|
|
40
|
-
if (_newDefaultValue != null) {
|
|
41
|
-
propDef.defaultValue = _newDefaultValue;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return propDef;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function enhancePropTypesProps(extractedProps, component) {
|
|
49
|
-
var rawDefaultProps = component.defaultProps != null ? component.defaultProps : {};
|
|
50
|
-
var enhancedProps = extractedProps.map(function (x) {
|
|
51
|
-
return enhancePropTypesProp(x, rawDefaultProps[x.propDef.name]);
|
|
52
|
-
});
|
|
53
|
-
return (0, _sortProps.keepOriginalDefinitionOrder)(enhancedProps, component);
|
|
54
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.rawDefaultPropTypeResolvers = void 0;
|
|
7
|
-
|
|
8
|
-
require("core-js/modules/es.function.name.js");
|
|
9
|
-
|
|
10
|
-
require("core-js/modules/es.object.to-string.js");
|
|
11
|
-
|
|
12
|
-
require("core-js/modules/es.regexp.to-string.js");
|
|
13
|
-
|
|
14
|
-
var _defaultValues = require("../lib/defaultValues");
|
|
15
|
-
|
|
16
|
-
var _lib = require("../../../lib");
|
|
17
|
-
|
|
18
|
-
var _lib2 = require("../lib");
|
|
19
|
-
|
|
20
|
-
var _prettyIdentifier = require("../lib/defaultValues/prettyIdentifier");
|
|
21
|
-
|
|
22
|
-
var _inspection = require("../lib/inspection");
|
|
23
|
-
|
|
24
|
-
var funcResolver = function funcResolver(rawDefaultProp, _ref) {
|
|
25
|
-
var name = _ref.name,
|
|
26
|
-
type = _ref.type;
|
|
27
|
-
var isElement = type.summary === 'element' || type.summary === 'elementType';
|
|
28
|
-
var funcName = (0, _defaultValues.extractFunctionName)(rawDefaultProp, name);
|
|
29
|
-
|
|
30
|
-
if (funcName != null) {
|
|
31
|
-
// Try to display the name of the component. The body of the component is omitted since the code has been transpiled.
|
|
32
|
-
if (isElement) {
|
|
33
|
-
return (0, _lib.createSummaryValue)((0, _prettyIdentifier.getPrettyElementIdentifier)(funcName));
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
var _ref2 = (0, _inspection.inspectValue)(rawDefaultProp.toString()).inferredType,
|
|
37
|
-
hasParams = _ref2.hasParams;
|
|
38
|
-
return (0, _lib.createSummaryValue)((0, _prettyIdentifier.getPrettyFuncIdentifier)(funcName, hasParams));
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return (0, _lib.createSummaryValue)(isElement ? _lib2.ELEMENT_CAPTION : _lib2.FUNCTION_CAPTION);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
var rawDefaultPropTypeResolvers = (0, _defaultValues.createTypeResolvers)({
|
|
45
|
-
function: funcResolver
|
|
46
|
-
});
|
|
47
|
-
exports.rawDefaultPropTypeResolvers = rawDefaultPropTypeResolvers;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.keepOriginalDefinitionOrder = keepOriginalDefinitionOrder;
|
|
7
|
-
|
|
8
|
-
require("core-js/modules/es.array.filter.js");
|
|
9
|
-
|
|
10
|
-
require("core-js/modules/es.object.to-string.js");
|
|
11
|
-
|
|
12
|
-
require("core-js/modules/es.array.map.js");
|
|
13
|
-
|
|
14
|
-
require("core-js/modules/es.object.keys.js");
|
|
15
|
-
|
|
16
|
-
require("core-js/modules/es.array.find.js");
|
|
17
|
-
|
|
18
|
-
require("core-js/modules/es.function.name.js");
|
|
19
|
-
|
|
20
|
-
// react-docgen doesn't returned the props in the order they were defined in the "propTypes" object of the component.
|
|
21
|
-
// This function re-order them by their original definition order.
|
|
22
|
-
function keepOriginalDefinitionOrder(extractedProps, component) {
|
|
23
|
-
// eslint-disable-next-line react/forbid-foreign-prop-types
|
|
24
|
-
var propTypes = component.propTypes;
|
|
25
|
-
|
|
26
|
-
if (propTypes != null) {
|
|
27
|
-
return Object.keys(propTypes).map(function (x) {
|
|
28
|
-
return extractedProps.find(function (y) {
|
|
29
|
-
return y.name === x;
|
|
30
|
-
});
|
|
31
|
-
}).filter(function (x) {
|
|
32
|
-
return x;
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return extractedProps;
|
|
37
|
-
}
|