@storybook/react 6.5.9 → 7.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -47
- package/dist/cjs/config.js +43 -0
- package/dist/cjs/{client/docs → docs}/config.js +3 -7
- package/dist/cjs/docs/extractArgTypes.js +47 -0
- package/dist/cjs/{client/docs → docs}/extractProps.js +9 -29
- package/dist/cjs/docs/jsxDecorator.js +210 -0
- package/dist/cjs/{client/docs → docs}/lib/captions.js +6 -6
- package/dist/cjs/docs/lib/componentTypes.js +14 -0
- package/dist/cjs/{client/docs → docs}/lib/defaultValues/createDefaultValue.js +16 -11
- package/dist/cjs/{client/docs → docs}/lib/defaultValues/createFromRawDefaultProp.js +38 -58
- package/dist/cjs/{client/docs → docs}/lib/defaultValues/generateArray.js +8 -6
- package/dist/cjs/{client/docs → docs}/lib/defaultValues/generateObject.js +8 -6
- package/dist/cjs/{client/docs → docs}/lib/defaultValues/index.js +2 -8
- package/dist/cjs/{client/docs → docs}/lib/defaultValues/prettyIdentifier.js +12 -10
- package/dist/cjs/{client/docs → docs}/lib/generateCode.js +10 -25
- package/dist/cjs/{client/docs → docs}/lib/index.js +4 -10
- package/dist/cjs/{client/docs → docs}/lib/inspection/acornParser.js +34 -58
- package/dist/cjs/{client/docs → docs}/lib/inspection/index.js +2 -8
- package/dist/cjs/{client/docs → docs}/lib/inspection/inspectValue.js +1 -3
- package/dist/cjs/{client/docs → docs}/lib/inspection/types.js +1 -1
- package/dist/cjs/{client/docs → docs}/lib/isHtmlTag.js +0 -4
- package/dist/cjs/{client/docs → docs}/propTypes/createType.js +102 -115
- package/dist/cjs/{client/docs → docs}/propTypes/generateFuncSignature.js +13 -23
- package/dist/cjs/{client/docs → docs}/propTypes/handleProp.js +13 -15
- package/dist/cjs/{client/docs → docs}/propTypes/rawDefaultPropResolvers.js +10 -14
- package/dist/cjs/docs/propTypes/sortProps.js +21 -0
- package/dist/cjs/docs/react-argtypes.stories.js +67 -0
- package/dist/cjs/{client/docs → docs}/typeScript/handleProp.js +11 -11
- package/dist/cjs/{client/index.js → index.js} +14 -19
- package/dist/cjs/{client/preview → preview}/config.js +3 -9
- package/dist/cjs/{client/preview → preview}/globals.js +3 -1
- package/dist/cjs/preview/index.js +44 -0
- package/dist/cjs/preview/render.js +165 -0
- package/dist/cjs/{client/preview → preview}/types-6-0.js +0 -0
- package/dist/cjs/{client/preview → preview}/types-6-3.js +1 -7
- package/dist/cjs/{client/preview → preview}/types-7-0.js +0 -0
- package/dist/cjs/{client/preview → preview}/types.js +0 -0
- package/dist/cjs/{client/testing → testing}/index.js +3 -3
- package/dist/esm/config.js +6 -0
- package/dist/{modern/client → esm}/docs/config.js +0 -2
- package/dist/{modern/client → esm}/docs/extractArgTypes.js +0 -1
- package/dist/{modern/client → esm}/docs/extractProps.js +0 -0
- package/dist/{modern/client → esm}/docs/jsxDecorator.js +11 -18
- package/dist/{modern/client → esm}/docs/lib/captions.js +0 -0
- package/dist/{modern/client → esm}/docs/lib/componentTypes.js +0 -0
- package/dist/{modern/client → esm}/docs/lib/defaultValues/createDefaultValue.js +0 -0
- package/dist/{modern/client → esm}/docs/lib/defaultValues/createFromRawDefaultProp.js +1 -0
- package/dist/{modern/client → esm}/docs/lib/defaultValues/generateArray.js +0 -0
- package/dist/{modern/client → esm}/docs/lib/defaultValues/generateObject.js +0 -0
- package/dist/esm/{client/docs → docs}/lib/defaultValues/index.js +0 -0
- package/dist/{modern/client → esm}/docs/lib/defaultValues/prettyIdentifier.js +6 -6
- package/dist/{modern/client → esm}/docs/lib/generateCode.js +0 -0
- package/dist/esm/{client/docs → docs}/lib/index.js +0 -0
- package/dist/{modern/client → esm}/docs/lib/inspection/acornParser.js +0 -0
- package/dist/esm/{client/docs → docs}/lib/inspection/index.js +0 -0
- package/dist/{modern/client → esm}/docs/lib/inspection/inspectValue.js +0 -0
- package/dist/{modern/client → esm}/docs/lib/inspection/types.js +0 -0
- package/dist/{modern/client → esm}/docs/lib/isHtmlTag.js +0 -0
- package/dist/{modern/client → esm}/docs/propTypes/createType.js +0 -1
- package/dist/{modern/client → esm}/docs/propTypes/generateFuncSignature.js +0 -0
- package/dist/{modern/client → esm}/docs/propTypes/handleProp.js +0 -0
- package/dist/{modern/client → esm}/docs/propTypes/rawDefaultPropResolvers.js +0 -0
- package/dist/{modern/client → esm}/docs/propTypes/sortProps.js +0 -0
- package/dist/{modern/client → esm}/docs/react-argtypes.stories.js +0 -0
- package/dist/{modern/client → esm}/docs/typeScript/handleProp.js +0 -0
- package/dist/{modern/client → esm}/index.js +2 -4
- package/dist/esm/preview/config.js +1 -0
- package/dist/{modern/client → esm}/preview/globals.js +0 -0
- package/dist/{modern/client → esm}/preview/index.js +1 -1
- package/dist/{modern/client → esm}/preview/render.js +2 -2
- package/dist/esm/{client/preview → preview}/types-6-0.js +0 -0
- package/dist/esm/{client/preview → preview}/types-6-3.js +0 -0
- package/dist/esm/{client/preview → preview}/types-7-0.js +0 -0
- package/dist/esm/{client/preview → preview}/types.js +0 -0
- package/dist/{modern/client → esm}/testing/index.js +0 -0
- package/dist/types/config.d.ts +10 -0
- package/dist/types/docs/config.d.ts +10 -0
- package/dist/{ts3.9/client → types}/docs/extractArgTypes.d.ts +0 -0
- package/dist/{ts3.9/client → types}/docs/extractProps.d.ts +0 -0
- package/dist/{ts3.9/client → types}/docs/jsxDecorator.d.ts +0 -0
- package/dist/{ts3.9/client → types}/docs/lib/captions.d.ts +0 -0
- package/dist/{ts3.9/client → types}/docs/lib/componentTypes.d.ts +0 -0
- package/dist/{ts3.9/client → types}/docs/lib/defaultValues/createDefaultValue.d.ts +0 -0
- package/dist/{ts3.9/client → types}/docs/lib/defaultValues/createFromRawDefaultProp.d.ts +0 -0
- package/dist/{ts3.9/client → types}/docs/lib/defaultValues/generateArray.d.ts +0 -0
- package/dist/{ts3.9/client → types}/docs/lib/defaultValues/generateObject.d.ts +0 -0
- package/dist/{ts3.9/client → types}/docs/lib/defaultValues/index.d.ts +0 -0
- package/dist/{ts3.9/client → types}/docs/lib/defaultValues/prettyIdentifier.d.ts +1 -1
- package/dist/{ts3.9/client → types}/docs/lib/generateCode.d.ts +0 -0
- package/dist/{ts3.9/client → types}/docs/lib/index.d.ts +0 -0
- package/dist/{ts3.9/client → types}/docs/lib/inspection/acornParser.d.ts +0 -0
- package/dist/{ts3.9/client → types}/docs/lib/inspection/index.d.ts +0 -0
- package/dist/{ts3.9/client → types}/docs/lib/inspection/inspectValue.d.ts +0 -0
- package/dist/{ts3.9/client → types}/docs/lib/inspection/types.d.ts +0 -0
- package/dist/{ts3.9/client → types}/docs/lib/isHtmlTag.d.ts +0 -0
- package/dist/{ts3.9/client → types}/docs/propTypes/createType.d.ts +0 -0
- package/dist/{ts3.9/client → types}/docs/propTypes/generateFuncSignature.d.ts +0 -0
- package/dist/{ts3.9/client → types}/docs/propTypes/handleProp.d.ts +0 -0
- package/dist/{ts3.9/client → types}/docs/propTypes/rawDefaultPropResolvers.d.ts +0 -0
- package/dist/{ts3.9/client → types}/docs/propTypes/sortProps.d.ts +0 -0
- package/dist/{ts3.9/client → types}/docs/react-argtypes.stories.d.ts +0 -0
- package/dist/{ts3.9/client → types}/docs/typeScript/handleProp.d.ts +0 -0
- package/dist/{ts3.9/client → types}/index.d.ts +0 -0
- package/dist/types/preview/config.d.ts +1 -0
- package/dist/{ts3.9/client → types}/preview/globals.d.ts +0 -0
- package/dist/{ts3.9/client → types}/preview/index.d.ts +0 -0
- package/dist/{ts3.9/client → types}/preview/render.d.ts +0 -0
- package/dist/{ts3.9/client → types}/preview/types-6-0.d.ts +0 -0
- package/dist/{ts3.9/client → types}/preview/types-6-3.d.ts +0 -0
- package/dist/{ts3.9/client → types}/preview/types-7-0.d.ts +0 -0
- package/dist/{ts3.9/client → types}/preview/types.d.ts +0 -0
- package/dist/{ts3.9/client → types}/testing/index.d.ts +1 -1
- package/package.json +17 -61
- package/preview.js +1 -0
- package/bin/build.js +0 -4
- package/bin/index.js +0 -3
- package/demo.d.ts +0 -32
- package/demo.js +0 -5
- package/dist/cjs/client/docs/extractArgTypes.js +0 -54
- package/dist/cjs/client/docs/jsxDecorator.js +0 -277
- package/dist/cjs/client/docs/lib/componentTypes.js +0 -24
- package/dist/cjs/client/docs/propTypes/sortProps.js +0 -37
- package/dist/cjs/client/docs/react-argtypes.stories.js +0 -129
- package/dist/cjs/client/preview/index.js +0 -52
- package/dist/cjs/client/preview/render.js +0 -296
- package/dist/cjs/demo/Button.js +0 -37
- package/dist/cjs/demo/Welcome.js +0 -126
- package/dist/cjs/server/build.js +0 -9
- package/dist/cjs/server/cra-config.js +0 -69
- package/dist/cjs/server/framework-preset-cra.js +0 -35
- package/dist/cjs/server/framework-preset-react-docs.js +0 -68
- package/dist/cjs/server/framework-preset-react-dom-hack.js +0 -31
- package/dist/cjs/server/framework-preset-react.js +0 -98
- package/dist/cjs/server/index.js +0 -9
- package/dist/cjs/server/options.js +0 -17
- package/dist/cjs/server/preset.js +0 -16
- package/dist/esm/client/docs/config.js +0 -16
- package/dist/esm/client/docs/extractArgTypes.js +0 -39
- package/dist/esm/client/docs/extractProps.js +0 -54
- package/dist/esm/client/docs/jsxDecorator.js +0 -218
- package/dist/esm/client/docs/lib/captions.js +0 -6
- package/dist/esm/client/docs/lib/componentTypes.js +0 -9
- package/dist/esm/client/docs/lib/defaultValues/createDefaultValue.js +0 -67
- package/dist/esm/client/docs/lib/defaultValues/createFromRawDefaultProp.js +0 -191
- package/dist/esm/client/docs/lib/defaultValues/generateArray.js +0 -19
- package/dist/esm/client/docs/lib/defaultValues/generateObject.js +0 -19
- package/dist/esm/client/docs/lib/defaultValues/prettyIdentifier.js +0 -22
- package/dist/esm/client/docs/lib/generateCode.js +0 -68
- package/dist/esm/client/docs/lib/inspection/acornParser.js +0 -213
- package/dist/esm/client/docs/lib/inspection/inspectValue.js +0 -16
- package/dist/esm/client/docs/lib/inspection/types.js +0 -12
- package/dist/esm/client/docs/lib/isHtmlTag.js +0 -6
- package/dist/esm/client/docs/propTypes/createType.js +0 -449
- package/dist/esm/client/docs/propTypes/generateFuncSignature.js +0 -62
- package/dist/esm/client/docs/propTypes/handleProp.js +0 -39
- package/dist/esm/client/docs/propTypes/rawDefaultPropResolvers.js +0 -32
- package/dist/esm/client/docs/propTypes/sortProps.js +0 -24
- package/dist/esm/client/docs/react-argtypes.stories.js +0 -97
- package/dist/esm/client/docs/typeScript/handleProp.js +0 -27
- package/dist/esm/client/index.js +0 -7
- package/dist/esm/client/preview/config.js +0 -4
- package/dist/esm/client/preview/globals.js +0 -6
- package/dist/esm/client/preview/index.js +0 -29
- package/dist/esm/client/preview/render.js +0 -255
- package/dist/esm/client/testing/index.js +0 -96
- package/dist/esm/demo/Button.js +0 -26
- package/dist/esm/demo/Welcome.js +0 -114
- package/dist/esm/server/build.js +0 -3
- package/dist/esm/server/cra-config.js +0 -49
- package/dist/esm/server/framework-preset-cra.js +0 -25
- package/dist/esm/server/framework-preset-react-docs.js +0 -49
- package/dist/esm/server/framework-preset-react-dom-hack.js +0 -21
- package/dist/esm/server/framework-preset-react.js +0 -78
- package/dist/esm/server/index.js +0 -3
- package/dist/esm/server/options.js +0 -8
- package/dist/esm/server/preset.js +0 -5
- package/dist/modern/client/docs/lib/defaultValues/index.js +0 -2
- package/dist/modern/client/docs/lib/index.js +0 -4
- package/dist/modern/client/docs/lib/inspection/index.js +0 -2
- package/dist/modern/client/preview/config.js +0 -4
- package/dist/modern/client/preview/types-6-0.js +0 -1
- package/dist/modern/client/preview/types-6-3.js +0 -10
- package/dist/modern/client/preview/types-7-0.js +0 -1
- package/dist/modern/client/preview/types.js +0 -1
- package/dist/modern/demo/Button.js +0 -25
- package/dist/modern/demo/Welcome.js +0 -108
- package/dist/modern/server/build.js +0 -3
- package/dist/modern/server/cra-config.js +0 -49
- package/dist/modern/server/framework-preset-cra.js +0 -25
- package/dist/modern/server/framework-preset-react-docs.js +0 -49
- package/dist/modern/server/framework-preset-react-dom-hack.js +0 -21
- package/dist/modern/server/framework-preset-react.js +0 -78
- package/dist/modern/server/index.js +0 -3
- package/dist/modern/server/options.js +0 -8
- package/dist/modern/server/preset.js +0 -5
- package/dist/ts3.4/client/docs/config.d.ts +0 -13
- package/dist/ts3.4/client/docs/extractArgTypes.d.ts +0 -2
- package/dist/ts3.4/client/docs/extractProps.d.ts +0 -5
- package/dist/ts3.4/client/docs/jsxDecorator.d.ts +0 -23
- package/dist/ts3.4/client/docs/lib/captions.d.ts +0 -6
- package/dist/ts3.4/client/docs/lib/componentTypes.d.ts +0 -2
- package/dist/ts3.4/client/docs/lib/defaultValues/createDefaultValue.d.ts +0 -2
- package/dist/ts3.4/client/docs/lib/defaultValues/createFromRawDefaultProp.d.ts +0 -11
- package/dist/ts3.4/client/docs/lib/defaultValues/generateArray.d.ts +0 -3
- package/dist/ts3.4/client/docs/lib/defaultValues/generateObject.d.ts +0 -3
- package/dist/ts3.4/client/docs/lib/defaultValues/index.d.ts +0 -2
- package/dist/ts3.4/client/docs/lib/defaultValues/prettyIdentifier.d.ts +0 -4
- package/dist/ts3.4/client/docs/lib/generateCode.d.ts +0 -3
- package/dist/ts3.4/client/docs/lib/index.d.ts +0 -4
- package/dist/ts3.4/client/docs/lib/inspection/acornParser.d.ts +0 -7
- package/dist/ts3.4/client/docs/lib/inspection/index.d.ts +0 -2
- package/dist/ts3.4/client/docs/lib/inspection/inspectValue.d.ts +0 -2
- package/dist/ts3.4/client/docs/lib/inspection/types.d.ts +0 -50
- package/dist/ts3.4/client/docs/lib/isHtmlTag.d.ts +0 -1
- package/dist/ts3.4/client/docs/propTypes/createType.d.ts +0 -2
- package/dist/ts3.4/client/docs/propTypes/generateFuncSignature.d.ts +0 -4
- package/dist/ts3.4/client/docs/propTypes/handleProp.d.ts +0 -5
- package/dist/ts3.4/client/docs/propTypes/rawDefaultPropResolvers.d.ts +0 -1
- package/dist/ts3.4/client/docs/propTypes/sortProps.d.ts +0 -4
- package/dist/ts3.4/client/docs/react-argtypes.stories.d.ts +0 -1
- package/dist/ts3.4/client/docs/typeScript/handleProp.d.ts +0 -3
- package/dist/ts3.4/client/index.d.ts +0 -4
- package/dist/ts3.4/client/preview/config.d.ts +0 -4
- package/dist/ts3.4/client/preview/globals.d.ts +0 -1
- package/dist/ts3.4/client/preview/index.d.ts +0 -25
- package/dist/ts3.4/client/preview/render.d.ts +0 -5
- package/dist/ts3.4/client/preview/types-6-0.d.ts +0 -35
- package/dist/ts3.4/client/preview/types-6-3.d.ts +0 -40
- package/dist/ts3.4/client/preview/types-7-0.d.ts +0 -21
- package/dist/ts3.4/client/preview/types.d.ts +0 -16
- package/dist/ts3.4/client/testing/index.d.ts +0 -84
- package/dist/ts3.4/demo/Button.d.ts +0 -4
- package/dist/ts3.4/demo/Welcome.d.ts +0 -6
- package/dist/ts3.4/server/build.d.ts +0 -1
- package/dist/ts3.4/server/cra-config.d.ts +0 -4
- package/dist/ts3.4/server/framework-preset-cra.d.ts +0 -3
- package/dist/ts3.4/server/framework-preset-react-docs.d.ts +0 -6
- package/dist/ts3.4/server/framework-preset-react-dom-hack.d.ts +0 -32
- package/dist/ts3.4/server/framework-preset-react.d.ts +0 -6
- package/dist/ts3.4/server/index.d.ts +0 -1
- package/dist/ts3.4/server/options.d.ts +0 -3
- package/dist/ts3.4/server/preset.d.ts +0 -3
- package/dist/ts3.9/client/docs/config.d.ts +0 -13
- package/dist/ts3.9/client/preview/config.d.ts +0 -4
- package/dist/ts3.9/demo/Button.d.ts +0 -4
- package/dist/ts3.9/demo/Welcome.d.ts +0 -6
- package/dist/ts3.9/server/build.d.ts +0 -1
- package/dist/ts3.9/server/cra-config.d.ts +0 -4
- package/dist/ts3.9/server/framework-preset-cra.d.ts +0 -3
- package/dist/ts3.9/server/framework-preset-react-docs.d.ts +0 -6
- package/dist/ts3.9/server/framework-preset-react-dom-hack.d.ts +0 -32
- package/dist/ts3.9/server/framework-preset-react.d.ts +0 -6
- package/dist/ts3.9/server/index.d.ts +0 -1
- package/dist/ts3.9/server/options.d.ts +0 -3
- package/dist/ts3.9/server/preset.d.ts +0 -3
- package/preset.js +0 -1
- package/standalone.js +0 -8
- package/types/index.ts +0 -19
- package/types-6-0.d.ts +0 -1
- package/types-7-0.d.ts +0 -1
package/README.md
CHANGED
|
@@ -1,47 +1 @@
|
|
|
1
|
-
# Storybook
|
|
2
|
-
|
|
3
|
-
Storybook for React is a UI development environment for your React components.
|
|
4
|
-
With it, you can visualize different states of your UI components and develop them interactively.
|
|
5
|
-
|
|
6
|
-

|
|
7
|
-
|
|
8
|
-
Storybook runs outside of your app.
|
|
9
|
-
So you can develop UI components in isolation without worrying about app specific dependencies and requirements.
|
|
10
|
-
|
|
11
|
-
## Getting Started
|
|
12
|
-
|
|
13
|
-
```sh
|
|
14
|
-
cd my-react-app
|
|
15
|
-
npx sb init
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
For more information visit: [storybook.js.org](https://storybook.js.org)
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
Storybook also comes with a lot of [addons](https://storybook.js.org/addons) and a great API to customize as you wish.
|
|
23
|
-
You can also build a [static version](https://storybook.js.org/docs/react/sharing/publish-storybook) of your Storybook and deploy it anywhere you want.
|
|
24
|
-
|
|
25
|
-
Here are some featured storybooks that you can reference to see how Storybook works:
|
|
26
|
-
|
|
27
|
-
- [Demo of Storybook Design System](https://storybook.js.org/design-system) - [source](https://github.com/storybookjs/design-system)
|
|
28
|
-
|
|
29
|
-
## Create React App
|
|
30
|
-
|
|
31
|
-
Support for [Create React App](https://create-react-app.dev/) is handled by [`@storybook/preset-create-react-app`](https://github.com/storybookjs/presets/tree/master/packages/preset-create-react-app).
|
|
32
|
-
|
|
33
|
-
This preset enables support for all Create React App features, including Sass/SCSS and TypeScript.
|
|
34
|
-
|
|
35
|
-
If you're working on an app that was initialized manually (i.e., without the use of Create React App), ensure that your app has [react-dom](https://www.npmjs.com/package/react-dom) included as a dependency. Failing to do so can lead to unforeseen issues with Storybook and your project.
|
|
36
|
-
|
|
37
|
-
## Typescript
|
|
38
|
-
|
|
39
|
-
`@storybook/react` is now exporting its own types to use with Typescript.
|
|
40
|
-
You don't need to have `@types/storybook__react` installed anymore if it was your case.
|
|
41
|
-
But you probably also need to use types from `@types/node @types/react`.
|
|
42
|
-
|
|
43
|
-
## Docs
|
|
44
|
-
|
|
45
|
-
- [Basics](https://storybook.js.org/docs/react/get-started/introduction)
|
|
46
|
-
- [Configurations](https://storybook.js.org/docs/react/configure/overview)
|
|
47
|
-
- [Addons](https://storybook.js.org/docs/react/configure/storybook-addons)
|
|
1
|
+
# Storybook React renderer
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
parameters: true,
|
|
8
|
+
decorators: true,
|
|
9
|
+
argTypesEnhancers: true
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "argTypesEnhancers", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () {
|
|
14
|
+
return _config.argTypesEnhancers;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "decorators", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function () {
|
|
20
|
+
return _config.decorators;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
exports.parameters = void 0;
|
|
24
|
+
|
|
25
|
+
var _config = require("./docs/config");
|
|
26
|
+
|
|
27
|
+
var _config2 = require("./preview/config");
|
|
28
|
+
|
|
29
|
+
Object.keys(_config2).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
32
|
+
if (key in exports && exports[key] === _config2[key]) return;
|
|
33
|
+
Object.defineProperty(exports, key, {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function () {
|
|
36
|
+
return _config2[key];
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
const parameters = Object.assign({
|
|
41
|
+
framework: 'react'
|
|
42
|
+
}, _config.parameters);
|
|
43
|
+
exports.parameters = parameters;
|
|
@@ -11,19 +11,15 @@ var _extractArgTypes = require("./extractArgTypes");
|
|
|
11
11
|
|
|
12
12
|
var _jsxDecorator = require("./jsxDecorator");
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const parameters = {
|
|
15
15
|
docs: {
|
|
16
16
|
inlineStories: true,
|
|
17
|
-
// NOTE: that the result is a react element. Hooks support is provided by the outer code.
|
|
18
|
-
prepareForInline: function prepareForInline(storyFn) {
|
|
19
|
-
return storyFn();
|
|
20
|
-
},
|
|
21
17
|
extractArgTypes: _extractArgTypes.extractArgTypes,
|
|
22
18
|
extractComponentDescription: _docsTools.extractComponentDescription
|
|
23
19
|
}
|
|
24
20
|
};
|
|
25
21
|
exports.parameters = parameters;
|
|
26
|
-
|
|
22
|
+
const decorators = [_jsxDecorator.jsxDecorator];
|
|
27
23
|
exports.decorators = decorators;
|
|
28
|
-
|
|
24
|
+
const argTypesEnhancers = [_docsTools.enhanceArgTypes];
|
|
29
25
|
exports.argTypesEnhancers = argTypesEnhancers;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.extractArgTypes = void 0;
|
|
7
|
+
|
|
8
|
+
var _extractProps = require("./extractProps");
|
|
9
|
+
|
|
10
|
+
const extractArgTypes = component => {
|
|
11
|
+
if (component) {
|
|
12
|
+
const {
|
|
13
|
+
rows
|
|
14
|
+
} = (0, _extractProps.extractProps)(component);
|
|
15
|
+
|
|
16
|
+
if (rows) {
|
|
17
|
+
return rows.reduce((acc, row) => {
|
|
18
|
+
const {
|
|
19
|
+
name,
|
|
20
|
+
description,
|
|
21
|
+
type,
|
|
22
|
+
sbType,
|
|
23
|
+
defaultValue: defaultSummary,
|
|
24
|
+
jsDocTags,
|
|
25
|
+
required
|
|
26
|
+
} = row;
|
|
27
|
+
acc[name] = {
|
|
28
|
+
name,
|
|
29
|
+
description,
|
|
30
|
+
type: Object.assign({
|
|
31
|
+
required
|
|
32
|
+
}, sbType),
|
|
33
|
+
table: {
|
|
34
|
+
type,
|
|
35
|
+
jsDocTags,
|
|
36
|
+
defaultValue: defaultSummary
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
return acc;
|
|
40
|
+
}, {});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return null;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
exports.extractArgTypes = extractArgTypes;
|
|
@@ -5,22 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.extractProps = void 0;
|
|
7
7
|
|
|
8
|
-
require("core-js/modules/es.array.iterator.js");
|
|
9
|
-
|
|
10
|
-
require("core-js/modules/es.map.js");
|
|
11
|
-
|
|
12
|
-
require("core-js/modules/es.object.to-string.js");
|
|
13
|
-
|
|
14
|
-
require("core-js/modules/es.string.iterator.js");
|
|
15
|
-
|
|
16
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
17
|
-
|
|
18
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
|
19
|
-
|
|
20
|
-
require("core-js/modules/es.object.keys.js");
|
|
21
|
-
|
|
22
|
-
require("core-js/modules/es.array.map.js");
|
|
23
|
-
|
|
24
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
9
|
|
|
26
10
|
var _docsTools = require("@storybook/docs-tools");
|
|
@@ -33,22 +17,22 @@ var _lib = require("./lib");
|
|
|
33
17
|
|
|
34
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
35
19
|
|
|
36
|
-
|
|
37
|
-
Object.keys(_propTypes.default).forEach(
|
|
20
|
+
const propTypesMap = new Map();
|
|
21
|
+
Object.keys(_propTypes.default).forEach(typeName => {
|
|
38
22
|
// @ts-ignore
|
|
39
|
-
|
|
23
|
+
const type = _propTypes.default[typeName];
|
|
40
24
|
propTypesMap.set(type, typeName);
|
|
41
25
|
propTypesMap.set(type.isRequired, typeName);
|
|
42
26
|
});
|
|
43
27
|
|
|
44
28
|
function getPropDefs(component, section) {
|
|
45
|
-
|
|
29
|
+
let processedComponent = component; // eslint-disable-next-line react/forbid-foreign-prop-types
|
|
46
30
|
|
|
47
31
|
if (!(0, _docsTools.hasDocgen)(component) && !component.propTypes && (0, _lib.isMemo)(component)) {
|
|
48
32
|
processedComponent = component.type;
|
|
49
33
|
}
|
|
50
34
|
|
|
51
|
-
|
|
35
|
+
const extractedProps = (0, _docsTools.extractComponentProps)(processedComponent, section);
|
|
52
36
|
|
|
53
37
|
if (extractedProps.length === 0) {
|
|
54
38
|
return [];
|
|
@@ -62,16 +46,12 @@ function getPropDefs(component, section) {
|
|
|
62
46
|
return (0, _handleProp2.enhanceTypeScriptProps)(extractedProps);
|
|
63
47
|
|
|
64
48
|
default:
|
|
65
|
-
return extractedProps.map(
|
|
66
|
-
return x.propDef;
|
|
67
|
-
});
|
|
49
|
+
return extractedProps.map(x => x.propDef);
|
|
68
50
|
}
|
|
69
51
|
}
|
|
70
52
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
};
|
|
75
|
-
};
|
|
53
|
+
const extractProps = component => ({
|
|
54
|
+
rows: getPropDefs(component, 'props')
|
|
55
|
+
});
|
|
76
56
|
|
|
77
57
|
exports.extractProps = extractProps;
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.skipJsxRender = exports.renderJsx = exports.jsxDecorator = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactElementToJsxString = _interopRequireDefault(require("react-element-to-jsx-string"));
|
|
11
|
+
|
|
12
|
+
var _tsDedent = _interopRequireDefault(require("ts-dedent"));
|
|
13
|
+
|
|
14
|
+
var _utilDeprecate = _interopRequireDefault(require("util-deprecate"));
|
|
15
|
+
|
|
16
|
+
var _addons = require("@storybook/addons");
|
|
17
|
+
|
|
18
|
+
var _docsTools = require("@storybook/docs-tools");
|
|
19
|
+
|
|
20
|
+
var _clientLogger = require("@storybook/client-logger");
|
|
21
|
+
|
|
22
|
+
var _lib = require("./lib");
|
|
23
|
+
|
|
24
|
+
const _excluded = ["mdxType", "originalType", "children"];
|
|
25
|
+
|
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
|
+
|
|
28
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
32
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
33
|
+
|
|
34
|
+
/** Run the user supplied onBeforeRender function if it exists */
|
|
35
|
+
const applyBeforeRender = (domString, options) => {
|
|
36
|
+
if (typeof options.onBeforeRender !== 'function') {
|
|
37
|
+
return domString;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const deprecatedOnBeforeRender = (0, _utilDeprecate.default)(options.onBeforeRender, (0, _tsDedent.default)`
|
|
41
|
+
StoryFn.parameters.jsx.onBeforeRender was deprecated.
|
|
42
|
+
Prefer StoryFn.parameters.jsx.transformSource instead.
|
|
43
|
+
See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated-onbeforerender for details.
|
|
44
|
+
`);
|
|
45
|
+
return deprecatedOnBeforeRender(domString);
|
|
46
|
+
};
|
|
47
|
+
/** Run the user supplied transformSource function if it exists */
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
const applyTransformSource = (domString, options, context) => {
|
|
51
|
+
if (typeof options.transformSource !== 'function') {
|
|
52
|
+
return domString;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return options.transformSource(domString, context);
|
|
56
|
+
};
|
|
57
|
+
/** Apply the users parameters and render the jsx for a story */
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
const renderJsx = (code, options) => {
|
|
61
|
+
if (typeof code === 'undefined') {
|
|
62
|
+
_clientLogger.logger.warn('Too many skip or undefined component');
|
|
63
|
+
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
let renderedJSX = code;
|
|
68
|
+
const Type = renderedJSX.type;
|
|
69
|
+
|
|
70
|
+
for (let i = 0; i < options.skip; i += 1) {
|
|
71
|
+
if (typeof renderedJSX === 'undefined') {
|
|
72
|
+
_clientLogger.logger.warn('Cannot skip undefined element');
|
|
73
|
+
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (_react.default.Children.count(renderedJSX) > 1) {
|
|
78
|
+
_clientLogger.logger.warn('Trying to skip an array of elements');
|
|
79
|
+
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (typeof renderedJSX.props.children === 'undefined') {
|
|
84
|
+
_clientLogger.logger.warn('Not enough children to skip elements.');
|
|
85
|
+
|
|
86
|
+
if (typeof renderedJSX.type === 'function' && renderedJSX.type.name === '') {
|
|
87
|
+
renderedJSX = /*#__PURE__*/_react.default.createElement(Type, renderedJSX.props);
|
|
88
|
+
}
|
|
89
|
+
} else if (typeof renderedJSX.props.children === 'function') {
|
|
90
|
+
renderedJSX = renderedJSX.props.children();
|
|
91
|
+
} else {
|
|
92
|
+
renderedJSX = renderedJSX.props.children;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const displayNameDefaults = typeof options.displayName === 'string' ? {
|
|
97
|
+
showFunctions: true,
|
|
98
|
+
displayName: () => options.displayName
|
|
99
|
+
} : {
|
|
100
|
+
// To get exotic component names resolving properly
|
|
101
|
+
displayName: el => el.type.displayName || (0, _docsTools.getDocgenSection)(el.type, 'displayName') || (el.type.name !== '_default' ? el.type.name : null) || (typeof el.type === 'function' ? 'No Display Name' : null) || ((0, _lib.isForwardRef)(el.type) ? el.type.render.name : null) || ((0, _lib.isMemo)(el.type) ? el.type.type.name : null) || el.type
|
|
102
|
+
};
|
|
103
|
+
const filterDefaults = {
|
|
104
|
+
filterProps: (value, key) => value !== undefined
|
|
105
|
+
};
|
|
106
|
+
const opts = Object.assign({}, displayNameDefaults, filterDefaults, options);
|
|
107
|
+
|
|
108
|
+
const result = _react.default.Children.map(code, c => {
|
|
109
|
+
// @ts-ignore FIXME: workaround react-element-to-jsx-string
|
|
110
|
+
const child = typeof c === 'number' ? c.toString() : c;
|
|
111
|
+
let string = applyBeforeRender((0, _reactElementToJsxString.default)(child, opts), options);
|
|
112
|
+
|
|
113
|
+
if (string.indexOf('"') > -1) {
|
|
114
|
+
const matches = string.match(/\S+=\\"([^"]*)\\"/g);
|
|
115
|
+
|
|
116
|
+
if (matches) {
|
|
117
|
+
matches.forEach(match => {
|
|
118
|
+
string = string.replace(match, match.replace(/"/g, "'"));
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return string;
|
|
124
|
+
}).join('\n');
|
|
125
|
+
|
|
126
|
+
return result.replace(/function\s+noRefCheck\(\)\s+\{\}/, '() => {}');
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
exports.renderJsx = renderJsx;
|
|
130
|
+
const defaultOpts = {
|
|
131
|
+
skip: 0,
|
|
132
|
+
showFunctions: false,
|
|
133
|
+
enableBeautify: true,
|
|
134
|
+
showDefaultProps: false
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
const skipJsxRender = context => {
|
|
138
|
+
var _context$parameters$d;
|
|
139
|
+
|
|
140
|
+
const sourceParams = context === null || context === void 0 ? void 0 : (_context$parameters$d = context.parameters.docs) === null || _context$parameters$d === void 0 ? void 0 : _context$parameters$d.source;
|
|
141
|
+
const isArgsStory = context === null || context === void 0 ? void 0 : context.parameters.__isArgsStory; // always render if the user forces it
|
|
142
|
+
|
|
143
|
+
if ((sourceParams === null || sourceParams === void 0 ? void 0 : sourceParams.type) === _docsTools.SourceType.DYNAMIC) {
|
|
144
|
+
return false;
|
|
145
|
+
} // never render if the user is forcing the block to render code, or
|
|
146
|
+
// if the user provides code, or if it's not an args story.
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
return !isArgsStory || (sourceParams === null || sourceParams === void 0 ? void 0 : sourceParams.code) || (sourceParams === null || sourceParams === void 0 ? void 0 : sourceParams.type) === _docsTools.SourceType.CODE;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
exports.skipJsxRender = skipJsxRender;
|
|
153
|
+
|
|
154
|
+
const isMdx = node => {
|
|
155
|
+
var _node$type, _node$props;
|
|
156
|
+
|
|
157
|
+
return ((_node$type = node.type) === null || _node$type === void 0 ? void 0 : _node$type.displayName) === 'MDXCreateElement' && !!((_node$props = node.props) !== null && _node$props !== void 0 && _node$props.mdxType);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const mdxToJsx = node => {
|
|
161
|
+
if (!isMdx(node)) return node;
|
|
162
|
+
|
|
163
|
+
const _node$props2 = node.props,
|
|
164
|
+
{
|
|
165
|
+
originalType,
|
|
166
|
+
children
|
|
167
|
+
} = _node$props2,
|
|
168
|
+
rest = _objectWithoutPropertiesLoose(_node$props2, _excluded);
|
|
169
|
+
|
|
170
|
+
let jsxChildren = [];
|
|
171
|
+
|
|
172
|
+
if (children) {
|
|
173
|
+
const array = Array.isArray(children) ? children : [children];
|
|
174
|
+
jsxChildren = array.map(mdxToJsx);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return /*#__PURE__*/(0, _react.createElement)(originalType, rest, ...jsxChildren);
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
const jsxDecorator = (storyFn, context) => {
|
|
181
|
+
var _context$parameters$d2, _context$parameters$d3;
|
|
182
|
+
|
|
183
|
+
const channel = _addons.addons.getChannel();
|
|
184
|
+
|
|
185
|
+
const skip = skipJsxRender(context);
|
|
186
|
+
const story = storyFn();
|
|
187
|
+
let jsx = '';
|
|
188
|
+
(0, _addons.useEffect)(() => {
|
|
189
|
+
if (!skip) channel.emit(_docsTools.SNIPPET_RENDERED, (context || {}).id, jsx);
|
|
190
|
+
}); // We only need to render JSX if the source block is actually going to
|
|
191
|
+
// consume it. Otherwise it's just slowing us down.
|
|
192
|
+
|
|
193
|
+
if (skip) {
|
|
194
|
+
return story;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const options = Object.assign({}, defaultOpts, (context === null || context === void 0 ? void 0 : context.parameters.jsx) || {}); // Exclude decorators from source code snippet by default
|
|
198
|
+
|
|
199
|
+
const storyJsx = context !== null && context !== void 0 && (_context$parameters$d2 = context.parameters.docs) !== null && _context$parameters$d2 !== void 0 && (_context$parameters$d3 = _context$parameters$d2.source) !== null && _context$parameters$d3 !== void 0 && _context$parameters$d3.excludeDecorators ? context.originalStoryFn(context.args, context) : story;
|
|
200
|
+
const sourceJsx = mdxToJsx(storyJsx);
|
|
201
|
+
const rendered = renderJsx(sourceJsx, options);
|
|
202
|
+
|
|
203
|
+
if (rendered) {
|
|
204
|
+
jsx = applyTransformSource(rendered, options, context);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
return story;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
exports.jsxDecorator = jsxDecorator;
|
|
@@ -4,15 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.OBJECT_CAPTION = exports.FUNCTION_CAPTION = exports.ELEMENT_CAPTION = exports.CUSTOM_CAPTION = exports.CLASS_CAPTION = exports.ARRAY_CAPTION = void 0;
|
|
7
|
-
|
|
7
|
+
const CUSTOM_CAPTION = 'custom';
|
|
8
8
|
exports.CUSTOM_CAPTION = CUSTOM_CAPTION;
|
|
9
|
-
|
|
9
|
+
const OBJECT_CAPTION = 'object';
|
|
10
10
|
exports.OBJECT_CAPTION = OBJECT_CAPTION;
|
|
11
|
-
|
|
11
|
+
const ARRAY_CAPTION = 'array';
|
|
12
12
|
exports.ARRAY_CAPTION = ARRAY_CAPTION;
|
|
13
|
-
|
|
13
|
+
const CLASS_CAPTION = 'class';
|
|
14
14
|
exports.CLASS_CAPTION = CLASS_CAPTION;
|
|
15
|
-
|
|
15
|
+
const FUNCTION_CAPTION = 'func';
|
|
16
16
|
exports.FUNCTION_CAPTION = FUNCTION_CAPTION;
|
|
17
|
-
|
|
17
|
+
const ELEMENT_CAPTION = 'element';
|
|
18
18
|
exports.ELEMENT_CAPTION = ELEMENT_CAPTION;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isMemo = exports.isForwardRef = void 0;
|
|
7
|
+
|
|
8
|
+
const isMemo = component => component.$$typeof === Symbol.for('react.memo');
|
|
9
|
+
|
|
10
|
+
exports.isMemo = isMemo;
|
|
11
|
+
|
|
12
|
+
const isForwardRef = component => component.$$typeof === Symbol.for('react.forward_ref');
|
|
13
|
+
|
|
14
|
+
exports.isForwardRef = isForwardRef;
|
|
@@ -21,30 +21,35 @@ var _generateArray = require("./generateArray");
|
|
|
21
21
|
|
|
22
22
|
var _prettyIdentifier = require("./prettyIdentifier");
|
|
23
23
|
|
|
24
|
-
function generateFunc(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
function generateFunc({
|
|
25
|
+
inferredType,
|
|
26
|
+
ast
|
|
27
|
+
}) {
|
|
28
|
+
const {
|
|
29
|
+
identifier
|
|
30
|
+
} = inferredType;
|
|
29
31
|
|
|
30
32
|
if (identifier != null) {
|
|
31
33
|
return (0, _docsTools.createSummaryValue)((0, _prettyIdentifier.getPrettyIdentifier)(inferredType), (0, _generateCode.generateCode)(ast));
|
|
32
34
|
}
|
|
33
35
|
|
|
34
|
-
|
|
36
|
+
const prettyCaption = (0, _generateCode.generateCode)(ast, true);
|
|
35
37
|
return !(0, _docsTools.isTooLongForDefaultValueSummary)(prettyCaption) ? (0, _docsTools.createSummaryValue)(prettyCaption) : (0, _docsTools.createSummaryValue)(_captions.FUNCTION_CAPTION, (0, _generateCode.generateCode)(ast));
|
|
36
38
|
} // All elements are JSX elements.
|
|
37
39
|
// JSX elements are not supported by escodegen.
|
|
38
40
|
|
|
39
41
|
|
|
40
42
|
function generateElement(defaultValue, inspectionResult) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
const {
|
|
44
|
+
inferredType
|
|
45
|
+
} = inspectionResult;
|
|
46
|
+
const {
|
|
47
|
+
identifier
|
|
48
|
+
} = inferredType;
|
|
44
49
|
|
|
45
50
|
if (identifier != null) {
|
|
46
51
|
if (!(0, _isHtmlTag.isHtmlTag)(identifier)) {
|
|
47
|
-
|
|
52
|
+
const prettyIdentifier = (0, _prettyIdentifier.getPrettyIdentifier)(inferredType);
|
|
48
53
|
return (0, _docsTools.createSummaryValue)(prettyIdentifier, defaultValue);
|
|
49
54
|
}
|
|
50
55
|
}
|
|
@@ -54,7 +59,7 @@ function generateElement(defaultValue, inspectionResult) {
|
|
|
54
59
|
|
|
55
60
|
function createDefaultValue(defaultValue) {
|
|
56
61
|
try {
|
|
57
|
-
|
|
62
|
+
const inspectionResult = (0, _inspection.inspectValue)(defaultValue);
|
|
58
63
|
|
|
59
64
|
switch (inspectionResult.inferredType.type) {
|
|
60
65
|
case _inspection.InspectionType.OBJECT:
|