@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,155 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
require("core-js/modules/es.symbol.js");
|
|
6
|
-
|
|
7
|
-
require("core-js/modules/es.symbol.description.js");
|
|
8
|
-
|
|
9
|
-
require("core-js/modules/es.symbol.iterator.js");
|
|
10
|
-
|
|
11
|
-
require("core-js/modules/es.array.iterator.js");
|
|
12
|
-
|
|
13
|
-
require("core-js/modules/es.string.iterator.js");
|
|
14
|
-
|
|
15
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
16
|
-
|
|
17
|
-
require("core-js/modules/es.array.slice.js");
|
|
18
|
-
|
|
19
|
-
require("core-js/modules/es.function.name.js");
|
|
20
|
-
|
|
21
|
-
require("core-js/modules/es.array.from.js");
|
|
22
|
-
|
|
23
|
-
require("core-js/modules/es.regexp.exec.js");
|
|
24
|
-
|
|
25
|
-
require("core-js/modules/es.weak-map.js");
|
|
26
|
-
|
|
27
|
-
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
28
|
-
|
|
29
|
-
require("core-js/modules/es.object.assign.js");
|
|
30
|
-
|
|
31
|
-
require("core-js/modules/es.array.map.js");
|
|
32
|
-
|
|
33
|
-
require("core-js/modules/es.object.entries.js");
|
|
34
|
-
|
|
35
|
-
require("core-js/modules/es.object.to-string.js");
|
|
36
|
-
|
|
37
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
38
|
-
|
|
39
|
-
var _mapValues = _interopRequireDefault(require("lodash/mapValues"));
|
|
40
|
-
|
|
41
|
-
var _react2 = require("@storybook/react");
|
|
42
|
-
|
|
43
|
-
var _components = require("@storybook/components");
|
|
44
|
-
|
|
45
|
-
var _store = require("@storybook/store");
|
|
46
|
-
|
|
47
|
-
var _extractArgTypes = require("./extractArgTypes");
|
|
48
|
-
|
|
49
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
50
|
-
|
|
51
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
52
|
-
|
|
53
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
54
|
-
|
|
55
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
56
|
-
|
|
57
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
58
|
-
|
|
59
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
60
|
-
|
|
61
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
62
|
-
|
|
63
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
64
|
-
|
|
65
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
66
|
-
|
|
67
|
-
var argsTableProps = function argsTableProps(component) {
|
|
68
|
-
var argTypes = (0, _extractArgTypes.extractArgTypes)(component);
|
|
69
|
-
var parameters = {
|
|
70
|
-
__isArgsStory: true
|
|
71
|
-
};
|
|
72
|
-
var rows = (0, _store.inferControls)({
|
|
73
|
-
argTypes: argTypes,
|
|
74
|
-
parameters: parameters
|
|
75
|
-
});
|
|
76
|
-
return {
|
|
77
|
-
rows: rows
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
var ArgsStory = function ArgsStory(_ref) {
|
|
82
|
-
var component = _ref.component;
|
|
83
|
-
|
|
84
|
-
var _argsTableProps = argsTableProps(component),
|
|
85
|
-
rows = _argsTableProps.rows;
|
|
86
|
-
|
|
87
|
-
var initialArgs = (0, _mapValues.default)(rows, function (argType) {
|
|
88
|
-
return argType.defaultValue;
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
var _useState = (0, _react.useState)(initialArgs),
|
|
92
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
93
|
-
args = _useState2[0],
|
|
94
|
-
setArgs = _useState2[1];
|
|
95
|
-
|
|
96
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("p", null, /*#__PURE__*/_react.default.createElement("b", null, "NOTE:"), " these stories are to help visualise the snapshot tests in", ' ', /*#__PURE__*/_react.default.createElement("code", null, "./react-properties.test.js"), "."), /*#__PURE__*/_react.default.createElement(_components.ArgsTable, {
|
|
97
|
-
rows: rows,
|
|
98
|
-
args: args,
|
|
99
|
-
updateArgs: function updateArgs(val) {
|
|
100
|
-
return setArgs(Object.assign({}, args, val));
|
|
101
|
-
}
|
|
102
|
-
}), /*#__PURE__*/_react.default.createElement("table", null, /*#__PURE__*/_react.default.createElement("thead", null, /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("th", null, "arg name"), /*#__PURE__*/_react.default.createElement("th", null, "argType"))), /*#__PURE__*/_react.default.createElement("tbody", null, Object.entries(args).map(function (_ref2) {
|
|
103
|
-
var _ref3 = _slicedToArray(_ref2, 2),
|
|
104
|
-
key = _ref3[0],
|
|
105
|
-
val = _ref3[1];
|
|
106
|
-
|
|
107
|
-
return /*#__PURE__*/_react.default.createElement("tr", {
|
|
108
|
-
key: key
|
|
109
|
-
}, /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement("code", null, key)), /*#__PURE__*/_react.default.createElement("td", null, /*#__PURE__*/_react.default.createElement("pre", null, JSON.stringify(rows[key]))));
|
|
110
|
-
}))));
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
var typescriptFixtures = ['aliases', 'arrays', 'enums', 'functions', 'interfaces', 'intersections', 'records', 'scalars', 'tuples', 'unions', 'optionals'];
|
|
114
|
-
var typescriptStories = (0, _react2.storiesOf)('ArgTypes/TypeScript', module);
|
|
115
|
-
typescriptFixtures.forEach(function (fixture) {
|
|
116
|
-
// eslint-disable-next-line import/no-dynamic-require, global-require, no-shadow
|
|
117
|
-
var _require = require("../../lib/convert/__testfixtures__/typescript/".concat(fixture)),
|
|
118
|
-
Component = _require.Component;
|
|
119
|
-
|
|
120
|
-
typescriptStories.add(fixture, function () {
|
|
121
|
-
return /*#__PURE__*/_react.default.createElement(ArgsStory, {
|
|
122
|
-
component: Component
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
var proptypesFixtures = ['arrays', 'enums', 'misc', 'objects', 'react', 'scalars'];
|
|
127
|
-
var proptypesStories = (0, _react2.storiesOf)('ArgTypes/PropTypes', module);
|
|
128
|
-
proptypesFixtures.forEach(function (fixture) {
|
|
129
|
-
// eslint-disable-next-line import/no-dynamic-require, global-require, no-shadow
|
|
130
|
-
var _require2 = require("../../lib/convert/__testfixtures__/proptypes/".concat(fixture)),
|
|
131
|
-
Component = _require2.Component;
|
|
132
|
-
|
|
133
|
-
proptypesStories.add(fixture, function () {
|
|
134
|
-
return /*#__PURE__*/_react.default.createElement(ArgsStory, {
|
|
135
|
-
component: Component
|
|
136
|
-
});
|
|
137
|
-
});
|
|
138
|
-
});
|
|
139
|
-
var issuesFixtures = ['js-class-component', 'js-function-component', 'js-function-component-inline-defaults', 'js-function-component-inline-defaults-no-propTypes', 'ts-function-component', 'ts-function-component-inline-defaults', '9399-js-proptypes-shape', '8663-js-styled-components', '9626-js-default-values', '9668-js-proptypes-no-jsdoc', '8143-ts-react-fc-generics', '8143-ts-imported-types', '8279-js-styled-docgen', '8140-js-prop-types-oneof', '9023-js-hoc', '8740-ts-multi-props', '9556-ts-react-default-exports', '9592-ts-styled-props', '9591-ts-import-types', '9721-ts-deprecated-jsdoc', '9827-ts-default-values', '9586-js-react-memo', '9575-ts-camel-case', '9493-ts-display-name', '8894-9511-ts-forward-ref', '9465-ts-type-props', '8428-js-static-prop-types', '9764-ts-extend-props', '9922-ts-component-props'];
|
|
140
|
-
var issuesStories = (0, _react2.storiesOf)('ArgTypes/Issues', module);
|
|
141
|
-
issuesFixtures.forEach(function (fixture) {
|
|
142
|
-
// eslint-disable-next-line import/no-dynamic-require, global-require
|
|
143
|
-
var _require3 = require("./__testfixtures__/".concat(fixture, "/input")),
|
|
144
|
-
component = _require3.component;
|
|
145
|
-
|
|
146
|
-
issuesStories.add(fixture, function () {
|
|
147
|
-
return /*#__PURE__*/_react.default.createElement(ArgsStory, {
|
|
148
|
-
component: component
|
|
149
|
-
});
|
|
150
|
-
}, {
|
|
151
|
-
chromatic: {
|
|
152
|
-
disable: true
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
});
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.enhanceTypeScriptProp = enhanceTypeScriptProp;
|
|
7
|
-
exports.enhanceTypeScriptProps = enhanceTypeScriptProps;
|
|
8
|
-
|
|
9
|
-
require("core-js/modules/es.array.map.js");
|
|
10
|
-
|
|
11
|
-
var _defaultValues = require("../lib/defaultValues");
|
|
12
|
-
|
|
13
|
-
function enhanceTypeScriptProp(extractedProp, rawDefaultProp) {
|
|
14
|
-
var propDef = extractedProp.propDef;
|
|
15
|
-
var defaultValue = extractedProp.docgenInfo.defaultValue;
|
|
16
|
-
|
|
17
|
-
if (defaultValue != null && defaultValue.value != null) {
|
|
18
|
-
var newDefaultValue = (0, _defaultValues.createDefaultValue)(defaultValue.value);
|
|
19
|
-
|
|
20
|
-
if (newDefaultValue != null) {
|
|
21
|
-
propDef.defaultValue = newDefaultValue;
|
|
22
|
-
}
|
|
23
|
-
} else if (rawDefaultProp != null) {
|
|
24
|
-
var _newDefaultValue = (0, _defaultValues.createDefaultValueFromRawDefaultProp)(rawDefaultProp, propDef);
|
|
25
|
-
|
|
26
|
-
if (_newDefaultValue != null) {
|
|
27
|
-
propDef.defaultValue = _newDefaultValue;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return propDef;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function enhanceTypeScriptProps(extractedProps) {
|
|
35
|
-
return extractedProps.map(function (prop) {
|
|
36
|
-
return enhanceTypeScriptProp(prop);
|
|
37
|
-
});
|
|
38
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.parameters = exports.decorators = void 0;
|
|
7
|
-
|
|
8
|
-
var _extractArgTypes = require("./extractArgTypes");
|
|
9
|
-
|
|
10
|
-
var _extractComponentDescription = require("./extractComponentDescription");
|
|
11
|
-
|
|
12
|
-
var _prepareForInline = require("./prepareForInline");
|
|
13
|
-
|
|
14
|
-
var _sourceDecorator = require("./sourceDecorator");
|
|
15
|
-
|
|
16
|
-
var parameters = {
|
|
17
|
-
docs: {
|
|
18
|
-
inlineStories: true,
|
|
19
|
-
prepareForInline: _prepareForInline.prepareForInline,
|
|
20
|
-
extractArgTypes: _extractArgTypes.extractArgTypes,
|
|
21
|
-
extractComponentDescription: _extractComponentDescription.extractComponentDescription
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
exports.parameters = parameters;
|
|
25
|
-
var decorators = [_sourceDecorator.sourceDecorator];
|
|
26
|
-
exports.decorators = decorators;
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.extractArgTypes = exports.createArgTypes = void 0;
|
|
7
|
-
|
|
8
|
-
require("core-js/modules/es.array.find.js");
|
|
9
|
-
|
|
10
|
-
require("core-js/modules/es.object.to-string.js");
|
|
11
|
-
|
|
12
|
-
require("core-js/modules/es.function.name.js");
|
|
13
|
-
|
|
14
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
|
15
|
-
|
|
16
|
-
require("core-js/modules/es.symbol.js");
|
|
17
|
-
|
|
18
|
-
require("core-js/modules/es.symbol.description.js");
|
|
19
|
-
|
|
20
|
-
require("core-js/modules/es.array.join.js");
|
|
21
|
-
|
|
22
|
-
require("core-js/modules/es.array.filter.js");
|
|
23
|
-
|
|
24
|
-
require("core-js/modules/es.array.map.js");
|
|
25
|
-
|
|
26
|
-
var _clientLogger = require("@storybook/client-logger");
|
|
27
|
-
|
|
28
|
-
function hasKeyword(keyword, keywords) {
|
|
29
|
-
return keywords ? keywords.find(function (k) {
|
|
30
|
-
return k.name === keyword;
|
|
31
|
-
}) != null : false;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
var extractArgTypes = function extractArgTypes(component) {
|
|
35
|
-
try {
|
|
36
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
37
|
-
var docgen = component.__docgen;
|
|
38
|
-
|
|
39
|
-
if (docgen) {
|
|
40
|
-
return createArgTypes(docgen);
|
|
41
|
-
}
|
|
42
|
-
} catch (err) {
|
|
43
|
-
_clientLogger.logger.log("Error extracting argTypes: ".concat(err));
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return {};
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
exports.extractArgTypes = extractArgTypes;
|
|
50
|
-
|
|
51
|
-
var createArgTypes = function createArgTypes(docgen) {
|
|
52
|
-
var results = {};
|
|
53
|
-
docgen.data.forEach(function (item) {
|
|
54
|
-
var _item$type, _item$type2;
|
|
55
|
-
|
|
56
|
-
results[item.name] = {
|
|
57
|
-
control: parseTypeToControl(item.type),
|
|
58
|
-
name: item.name,
|
|
59
|
-
description: item.description,
|
|
60
|
-
type: {
|
|
61
|
-
required: hasKeyword('required', item.keywords),
|
|
62
|
-
name: (_item$type = item.type) === null || _item$type === void 0 ? void 0 : _item$type.text
|
|
63
|
-
},
|
|
64
|
-
table: {
|
|
65
|
-
type: {
|
|
66
|
-
summary: (_item$type2 = item.type) === null || _item$type2 === void 0 ? void 0 : _item$type2.text
|
|
67
|
-
},
|
|
68
|
-
defaultValue: {
|
|
69
|
-
summary: item.defaultValue
|
|
70
|
-
},
|
|
71
|
-
category: 'properties'
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
});
|
|
75
|
-
docgen.events.forEach(function (item) {
|
|
76
|
-
results["event_".concat(item.name)] = {
|
|
77
|
-
name: item.name,
|
|
78
|
-
description: item.description,
|
|
79
|
-
type: {
|
|
80
|
-
name: 'other',
|
|
81
|
-
value: 'void'
|
|
82
|
-
},
|
|
83
|
-
table: {
|
|
84
|
-
category: 'events'
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
});
|
|
88
|
-
docgen.slots.forEach(function (item) {
|
|
89
|
-
var _item$params;
|
|
90
|
-
|
|
91
|
-
results["slot_".concat(item.name)] = {
|
|
92
|
-
name: item.name,
|
|
93
|
-
description: [item.description, (_item$params = item.params) === null || _item$params === void 0 ? void 0 : _item$params.map(function (p) {
|
|
94
|
-
return "`".concat(p.name, "`");
|
|
95
|
-
}).join(' ')].filter(function (p) {
|
|
96
|
-
return p;
|
|
97
|
-
}).join('\n\n'),
|
|
98
|
-
type: {
|
|
99
|
-
name: 'other',
|
|
100
|
-
value: 'void'
|
|
101
|
-
},
|
|
102
|
-
table: {
|
|
103
|
-
category: 'slots'
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
});
|
|
107
|
-
return results;
|
|
108
|
-
};
|
|
109
|
-
/**
|
|
110
|
-
* Function to convert the type from sveltedoc-parser to a storybook type
|
|
111
|
-
* @param typeName
|
|
112
|
-
* @returns string
|
|
113
|
-
*/
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
exports.createArgTypes = createArgTypes;
|
|
117
|
-
|
|
118
|
-
var parseTypeToControl = function parseTypeToControl(type) {
|
|
119
|
-
if (!type) {
|
|
120
|
-
return null;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
if (type.kind === 'type') {
|
|
124
|
-
switch (type.type) {
|
|
125
|
-
case 'string':
|
|
126
|
-
return {
|
|
127
|
-
type: 'text'
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
case 'enum':
|
|
131
|
-
return {
|
|
132
|
-
type: 'radio'
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
case 'any':
|
|
136
|
-
return {
|
|
137
|
-
type: 'object'
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
default:
|
|
141
|
-
return {
|
|
142
|
-
type: type.type
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
} else if (type.kind === 'union') {
|
|
146
|
-
// @ts-ignore TODO: fix, this seems like a broke in package update
|
|
147
|
-
if (Array.isArray(type.type) && !type.type.find(function (t) {
|
|
148
|
-
return t.type !== 'string';
|
|
149
|
-
})) {
|
|
150
|
-
return {
|
|
151
|
-
type: 'radio',
|
|
152
|
-
options: type.type.filter(function (t) {
|
|
153
|
-
return t.kind === 'const';
|
|
154
|
-
}).map(function (t) {
|
|
155
|
-
return t.value;
|
|
156
|
-
})
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
return null;
|
|
162
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.extractComponentDescription = extractComponentDescription;
|
|
7
|
-
|
|
8
|
-
require("core-js/modules/es.symbol.js");
|
|
9
|
-
|
|
10
|
-
require("core-js/modules/es.symbol.description.js");
|
|
11
|
-
|
|
12
|
-
function extractComponentDescription(component) {
|
|
13
|
-
if (!component) {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
var _component$__docgen = component.__docgen,
|
|
18
|
-
__docgen = _component$__docgen === void 0 ? {} : _component$__docgen;
|
|
19
|
-
|
|
20
|
-
return __docgen.description;
|
|
21
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.prepareForInline = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _HOC = _interopRequireDefault(require("@storybook/addon-docs/svelte/HOC.svelte"));
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
|
-
var prepareForInline = function prepareForInline(storyFn) {
|
|
15
|
-
var el = _react.default.useRef(null);
|
|
16
|
-
|
|
17
|
-
_react.default.useEffect(function () {
|
|
18
|
-
var root = new _HOC.default({
|
|
19
|
-
target: el.current,
|
|
20
|
-
props: {
|
|
21
|
-
storyFn: storyFn
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
return function () {
|
|
25
|
-
return root.$destroy();
|
|
26
|
-
};
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
return /*#__PURE__*/_react.default.createElement('div', {
|
|
30
|
-
ref: el
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
exports.prepareForInline = prepareForInline;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.webpackFinal = webpackFinal;
|
|
7
|
-
|
|
8
|
-
require("regenerator-runtime/runtime.js");
|
|
9
|
-
|
|
10
|
-
require("core-js/modules/es.object.to-string.js");
|
|
11
|
-
|
|
12
|
-
require("core-js/modules/es.promise.js");
|
|
13
|
-
|
|
14
|
-
var _path = _interopRequireDefault(require("path"));
|
|
15
|
-
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
19
|
-
|
|
20
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
21
|
-
|
|
22
|
-
function webpackFinal(_x, _x2) {
|
|
23
|
-
return _webpackFinal.apply(this, arguments);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function _webpackFinal() {
|
|
27
|
-
_webpackFinal = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(webpackConfig, options) {
|
|
28
|
-
var svelteOptions;
|
|
29
|
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
30
|
-
while (1) {
|
|
31
|
-
switch (_context.prev = _context.next) {
|
|
32
|
-
case 0:
|
|
33
|
-
_context.next = 2;
|
|
34
|
-
return options.presets.apply('svelteOptions', {}, options);
|
|
35
|
-
|
|
36
|
-
case 2:
|
|
37
|
-
svelteOptions = _context.sent;
|
|
38
|
-
webpackConfig.module.rules.push({
|
|
39
|
-
test: /\.svelte$/,
|
|
40
|
-
loader: _path.default.resolve("".concat(__dirname, "/svelte-docgen-loader")),
|
|
41
|
-
enforce: 'post',
|
|
42
|
-
options: svelteOptions
|
|
43
|
-
});
|
|
44
|
-
return _context.abrupt("return", webpackConfig);
|
|
45
|
-
|
|
46
|
-
case 5:
|
|
47
|
-
case "end":
|
|
48
|
-
return _context.stop();
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}, _callee);
|
|
52
|
-
}));
|
|
53
|
-
return _webpackFinal.apply(this, arguments);
|
|
54
|
-
}
|