@storybook/react 6.5.7 → 7.0.0-alpha.0
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 +51 -0
- package/dist/cjs/{client/docs → docs}/config.js +0 -0
- package/dist/cjs/{client/docs → docs}/extractArgTypes.js +0 -0
- package/dist/cjs/{client/docs → docs}/extractProps.js +0 -0
- package/dist/cjs/{client/docs → docs}/jsxDecorator.js +0 -0
- package/dist/cjs/{client/docs → docs}/lib/captions.js +0 -0
- package/dist/cjs/{client/docs → docs}/lib/componentTypes.js +0 -0
- package/dist/cjs/{client/docs → docs}/lib/defaultValues/createDefaultValue.js +0 -0
- package/dist/cjs/{client/docs → docs}/lib/defaultValues/createFromRawDefaultProp.js +0 -0
- package/dist/cjs/{client/docs → docs}/lib/defaultValues/generateArray.js +0 -0
- package/dist/cjs/{client/docs → docs}/lib/defaultValues/generateObject.js +0 -0
- package/dist/cjs/{client/docs → docs}/lib/defaultValues/index.js +0 -0
- package/dist/cjs/{client/docs → docs}/lib/defaultValues/prettyIdentifier.js +8 -8
- package/dist/cjs/{client/docs → docs}/lib/generateCode.js +0 -0
- package/dist/cjs/{client/docs → docs}/lib/index.js +0 -0
- package/dist/cjs/{client/docs → docs}/lib/inspection/acornParser.js +0 -0
- package/dist/cjs/{client/docs → docs}/lib/inspection/index.js +0 -0
- package/dist/cjs/{client/docs → docs}/lib/inspection/inspectValue.js +0 -0
- package/dist/cjs/{client/docs → docs}/lib/inspection/types.js +0 -0
- package/dist/cjs/{client/docs → docs}/lib/isHtmlTag.js +0 -0
- package/dist/cjs/{client/docs → docs}/propTypes/createType.js +0 -0
- package/dist/cjs/{client/docs → docs}/propTypes/generateFuncSignature.js +0 -0
- package/dist/cjs/{client/docs → docs}/propTypes/handleProp.js +0 -0
- package/dist/cjs/{client/docs → docs}/propTypes/rawDefaultPropResolvers.js +0 -0
- package/dist/cjs/{client/docs → docs}/propTypes/sortProps.js +0 -0
- package/dist/cjs/{client/docs → docs}/react-argtypes.stories.js +0 -0
- package/dist/cjs/{client/docs → docs}/typeScript/handleProp.js +0 -0
- package/dist/cjs/{client/index.js → index.js} +4 -3
- package/dist/cjs/{client/preview → preview}/config.js +1 -7
- package/dist/cjs/{client/preview → preview}/globals.js +0 -0
- package/dist/cjs/{client/preview → preview}/index.js +2 -2
- package/dist/cjs/preview/render.js +310 -0
- package/dist/cjs/{client/preview → preview}/types-6-0.js +0 -0
- package/dist/cjs/{client/preview → preview}/types-6-3.js +0 -0
- 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 +0 -0
- package/dist/esm/config.js +6 -0
- package/dist/{modern/client → esm}/docs/config.js +0 -0
- 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 +11 -0
- package/dist/{ts3.9/client → types}/docs/config.d.ts +1 -1
- 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/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/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
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
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); }
|
|
2
|
-
|
|
3
|
-
import "core-js/modules/es.function.name.js";
|
|
4
|
-
import "core-js/modules/es.regexp.exec.js";
|
|
5
|
-
import "core-js/modules/es.string.replace.js";
|
|
6
|
-
import "core-js/modules/es.object.to-string.js";
|
|
7
|
-
import "core-js/modules/es.regexp.to-string.js";
|
|
8
|
-
import "core-js/modules/es.object.assign.js";
|
|
9
|
-
import "core-js/modules/es.symbol.js";
|
|
10
|
-
import "core-js/modules/es.symbol.description.js";
|
|
11
|
-
import "core-js/modules/es.symbol.iterator.js";
|
|
12
|
-
import "core-js/modules/es.array.iterator.js";
|
|
13
|
-
import "core-js/modules/es.string.iterator.js";
|
|
14
|
-
import "core-js/modules/web.dom-collections.iterator.js";
|
|
15
|
-
import isPlainObject from 'lodash/isPlainObject';
|
|
16
|
-
import isFunction from 'lodash/isFunction';
|
|
17
|
-
import isString from 'lodash/isString'; // @ts-ignore
|
|
18
|
-
|
|
19
|
-
import reactElementToJSXString from 'react-element-to-jsx-string';
|
|
20
|
-
import { createSummaryValue, isTooLongForDefaultValueSummary } from '@storybook/docs-tools';
|
|
21
|
-
import { inspectValue } from '../inspection';
|
|
22
|
-
import { generateObject } from './generateObject';
|
|
23
|
-
import { generateArray } from './generateArray';
|
|
24
|
-
import { getPrettyElementIdentifier, getPrettyFuncIdentifier } from './prettyIdentifier';
|
|
25
|
-
import { OBJECT_CAPTION, FUNCTION_CAPTION, ELEMENT_CAPTION } from '../captions';
|
|
26
|
-
import { isHtmlTag } from '../isHtmlTag';
|
|
27
|
-
|
|
28
|
-
function isReactElement(element) {
|
|
29
|
-
return element.$$typeof != null;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function extractFunctionName(func, propName) {
|
|
33
|
-
var name = func.name; // Comparison with the prop name is to discard inferred function names.
|
|
34
|
-
|
|
35
|
-
if (name !== '' && name !== 'anonymous' && name !== propName) {
|
|
36
|
-
return name;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
var stringResolver = function stringResolver(rawDefaultProp) {
|
|
43
|
-
return createSummaryValue(JSON.stringify(rawDefaultProp));
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
function generateReactObject(rawDefaultProp) {
|
|
47
|
-
var type = rawDefaultProp.type;
|
|
48
|
-
var displayName = type.displayName;
|
|
49
|
-
var jsx = reactElementToJSXString(rawDefaultProp, {});
|
|
50
|
-
|
|
51
|
-
if (displayName != null) {
|
|
52
|
-
var prettyIdentifier = getPrettyElementIdentifier(displayName);
|
|
53
|
-
return createSummaryValue(prettyIdentifier, jsx);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
if (isString(type)) {
|
|
57
|
-
// This is an HTML element.
|
|
58
|
-
if (isHtmlTag(type)) {
|
|
59
|
-
var jsxCompact = reactElementToJSXString(rawDefaultProp, {
|
|
60
|
-
tabStop: 0
|
|
61
|
-
});
|
|
62
|
-
var jsxSummary = jsxCompact.replace(/\r?\n|\r/g, '');
|
|
63
|
-
|
|
64
|
-
if (!isTooLongForDefaultValueSummary(jsxSummary)) {
|
|
65
|
-
return createSummaryValue(jsxSummary);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return createSummaryValue(ELEMENT_CAPTION, jsx);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
var objectResolver = function objectResolver(rawDefaultProp) {
|
|
74
|
-
if (isReactElement(rawDefaultProp) && rawDefaultProp.type != null) {
|
|
75
|
-
return generateReactObject(rawDefaultProp);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (isPlainObject(rawDefaultProp)) {
|
|
79
|
-
var inspectionResult = inspectValue(JSON.stringify(rawDefaultProp));
|
|
80
|
-
return generateObject(inspectionResult);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if (Array.isArray(rawDefaultProp)) {
|
|
84
|
-
var _inspectionResult = inspectValue(JSON.stringify(rawDefaultProp));
|
|
85
|
-
|
|
86
|
-
return generateArray(_inspectionResult);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return createSummaryValue(OBJECT_CAPTION);
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
var functionResolver = function functionResolver(rawDefaultProp, propDef) {
|
|
93
|
-
var isElement = false;
|
|
94
|
-
var inspectionResult; // Try to display the name of the component. The body of the component is omitted since the code has been transpiled.
|
|
95
|
-
|
|
96
|
-
if (isFunction(rawDefaultProp.render)) {
|
|
97
|
-
isElement = true;
|
|
98
|
-
} else if (rawDefaultProp.prototype != null && isFunction(rawDefaultProp.prototype.render)) {
|
|
99
|
-
isElement = true;
|
|
100
|
-
} else {
|
|
101
|
-
var innerElement;
|
|
102
|
-
|
|
103
|
-
try {
|
|
104
|
-
inspectionResult = inspectValue(rawDefaultProp.toString());
|
|
105
|
-
var _ref = inspectionResult.inferredType,
|
|
106
|
-
hasParams = _ref.hasParams,
|
|
107
|
-
params = _ref.params;
|
|
108
|
-
|
|
109
|
-
if (hasParams) {
|
|
110
|
-
// It might be a functional component accepting props.
|
|
111
|
-
if (params.length === 1 && params[0].type === 'ObjectPattern') {
|
|
112
|
-
innerElement = rawDefaultProp({});
|
|
113
|
-
}
|
|
114
|
-
} else {
|
|
115
|
-
innerElement = rawDefaultProp();
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
if (innerElement != null) {
|
|
119
|
-
if (isReactElement(innerElement)) {
|
|
120
|
-
isElement = true;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
} catch (e) {// do nothing.
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
var funcName = extractFunctionName(rawDefaultProp, propDef.name);
|
|
128
|
-
|
|
129
|
-
if (funcName != null) {
|
|
130
|
-
if (isElement) {
|
|
131
|
-
return createSummaryValue(getPrettyElementIdentifier(funcName));
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
if (inspectionResult != null) {
|
|
135
|
-
inspectionResult = inspectValue(rawDefaultProp.toString());
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
var _ref2 = inspectionResult.inferredType,
|
|
139
|
-
_hasParams = _ref2.hasParams;
|
|
140
|
-
return createSummaryValue(getPrettyFuncIdentifier(funcName, _hasParams));
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
return createSummaryValue(isElement ? ELEMENT_CAPTION : FUNCTION_CAPTION);
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
var defaultResolver = function defaultResolver(rawDefaultProp) {
|
|
147
|
-
return createSummaryValue(rawDefaultProp.toString());
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
var DEFAULT_TYPE_RESOLVERS = {
|
|
151
|
-
string: stringResolver,
|
|
152
|
-
object: objectResolver,
|
|
153
|
-
function: functionResolver,
|
|
154
|
-
default: defaultResolver
|
|
155
|
-
};
|
|
156
|
-
export function createTypeResolvers() {
|
|
157
|
-
var customResolvers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
158
|
-
return Object.assign({}, DEFAULT_TYPE_RESOLVERS, customResolvers);
|
|
159
|
-
} // When react-docgen cannot provide a defaultValue we take it from the raw defaultProp.
|
|
160
|
-
// It works fine for types that are not transpiled. For the types that are transpiled, we can only provide partial support.
|
|
161
|
-
// This means that:
|
|
162
|
-
// - The detail might not be available.
|
|
163
|
-
// - Identifiers might not be "prettified" for all the types.
|
|
164
|
-
|
|
165
|
-
export function createDefaultValueFromRawDefaultProp(rawDefaultProp, propDef) {
|
|
166
|
-
var typeResolvers = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_TYPE_RESOLVERS;
|
|
167
|
-
|
|
168
|
-
try {
|
|
169
|
-
// Keep the extra () otherwise it will fail for functions.
|
|
170
|
-
switch (_typeof(rawDefaultProp)) {
|
|
171
|
-
case 'string':
|
|
172
|
-
return typeResolvers.string(rawDefaultProp, propDef);
|
|
173
|
-
|
|
174
|
-
case 'object':
|
|
175
|
-
return typeResolvers.object(rawDefaultProp, propDef);
|
|
176
|
-
|
|
177
|
-
case 'function':
|
|
178
|
-
{
|
|
179
|
-
return typeResolvers.function(rawDefaultProp, propDef);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
default:
|
|
183
|
-
return typeResolvers.default(rawDefaultProp, propDef);
|
|
184
|
-
}
|
|
185
|
-
} catch (e) {
|
|
186
|
-
// eslint-disable-next-line no-console
|
|
187
|
-
console.error(e);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
return null;
|
|
191
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { createSummaryValue, isTooLongForDefaultValueSummary } from '@storybook/docs-tools';
|
|
2
|
-
import { ARRAY_CAPTION } from '../captions';
|
|
3
|
-
import { generateArrayCode } from '../generateCode';
|
|
4
|
-
export function generateArray(_ref) {
|
|
5
|
-
var inferredType = _ref.inferredType,
|
|
6
|
-
ast = _ref.ast;
|
|
7
|
-
var _ref2 = inferredType,
|
|
8
|
-
depth = _ref2.depth;
|
|
9
|
-
|
|
10
|
-
if (depth <= 2) {
|
|
11
|
-
var compactArray = generateArrayCode(ast, true);
|
|
12
|
-
|
|
13
|
-
if (!isTooLongForDefaultValueSummary(compactArray)) {
|
|
14
|
-
return createSummaryValue(compactArray);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return createSummaryValue(ARRAY_CAPTION, generateArrayCode(ast));
|
|
19
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { createSummaryValue, isTooLongForDefaultValueSummary } from '@storybook/docs-tools';
|
|
2
|
-
import { OBJECT_CAPTION } from '../captions';
|
|
3
|
-
import { generateObjectCode } from '../generateCode';
|
|
4
|
-
export function generateObject(_ref) {
|
|
5
|
-
var inferredType = _ref.inferredType,
|
|
6
|
-
ast = _ref.ast;
|
|
7
|
-
var _ref2 = inferredType,
|
|
8
|
-
depth = _ref2.depth;
|
|
9
|
-
|
|
10
|
-
if (depth === 1) {
|
|
11
|
-
var compactObject = generateObjectCode(ast, true);
|
|
12
|
-
|
|
13
|
-
if (!isTooLongForDefaultValueSummary(compactObject)) {
|
|
14
|
-
return createSummaryValue(compactObject);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return createSummaryValue(OBJECT_CAPTION, generateObjectCode(ast));
|
|
19
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { InspectionType } from '../inspection';
|
|
2
|
-
export function getPrettyIdentifier(inferredType) {
|
|
3
|
-
var type = inferredType.type,
|
|
4
|
-
identifier = inferredType.identifier;
|
|
5
|
-
|
|
6
|
-
switch (type) {
|
|
7
|
-
case InspectionType.FUNCTION:
|
|
8
|
-
return getPrettyFuncIdentifier(identifier, inferredType.hasParams);
|
|
9
|
-
|
|
10
|
-
case InspectionType.ELEMENT:
|
|
11
|
-
return getPrettyElementIdentifier(identifier);
|
|
12
|
-
|
|
13
|
-
default:
|
|
14
|
-
return identifier;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
export function getPrettyFuncIdentifier(identifier, hasArguments) {
|
|
18
|
-
return hasArguments ? "".concat(identifier, "( ... )") : "".concat(identifier, "()");
|
|
19
|
-
}
|
|
20
|
-
export function getPrettyElementIdentifier(identifier) {
|
|
21
|
-
return "<".concat(identifier, " />");
|
|
22
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import "core-js/modules/es.object.assign.js";
|
|
2
|
-
import "core-js/modules/es.string.ends-with.js";
|
|
3
|
-
import "core-js/modules/es.array.slice.js";
|
|
4
|
-
import "core-js/modules/es.string.starts-with.js";
|
|
5
|
-
import "core-js/modules/es.regexp.exec.js";
|
|
6
|
-
import "core-js/modules/es.string.replace.js";
|
|
7
|
-
import { generate } from 'escodegen';
|
|
8
|
-
import dedent from 'ts-dedent';
|
|
9
|
-
var BASIC_OPTIONS = {
|
|
10
|
-
format: {
|
|
11
|
-
indent: {
|
|
12
|
-
style: ' '
|
|
13
|
-
},
|
|
14
|
-
semicolons: false
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
var COMPACT_OPTIONS = Object.assign({}, BASIC_OPTIONS, {
|
|
18
|
-
format: {
|
|
19
|
-
newline: ''
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
var PRETTY_OPTIONS = Object.assign({}, BASIC_OPTIONS);
|
|
23
|
-
export function generateCode(ast) {
|
|
24
|
-
var compact = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
25
|
-
return generate(ast, compact ? COMPACT_OPTIONS : PRETTY_OPTIONS);
|
|
26
|
-
}
|
|
27
|
-
export function generateObjectCode(ast) {
|
|
28
|
-
var compact = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
29
|
-
return !compact ? generateCode(ast) : generateCompactObjectCode(ast);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function generateCompactObjectCode(ast) {
|
|
33
|
-
var result = generateCode(ast, true); // Cannot get escodegen to add a space before the last } with the compact mode settings.
|
|
34
|
-
// Fix it until a better solution is found.
|
|
35
|
-
|
|
36
|
-
if (!result.endsWith(' }')) {
|
|
37
|
-
result = "".concat(result.slice(0, -1), " }");
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return result;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export function generateArrayCode(ast) {
|
|
44
|
-
var compact = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
45
|
-
return !compact ? generateMultilineArrayCode(ast) : generateCompactArrayCode(ast);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function generateMultilineArrayCode(ast) {
|
|
49
|
-
var result = generateCode(ast); // escodegen add extra spacing before the closing bracket of a multiple line array with a nested object.
|
|
50
|
-
// Fix it until a better solution is found.
|
|
51
|
-
|
|
52
|
-
if (result.endsWith(' }]')) {
|
|
53
|
-
result = dedent(result);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return result;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function generateCompactArrayCode(ast) {
|
|
60
|
-
var result = generateCode(ast, true); // escodegen add extra an extra before the opening bracket of a compact array that contains primitive values.
|
|
61
|
-
// Fix it until a better solution is found.
|
|
62
|
-
|
|
63
|
-
if (result.startsWith('[ ')) {
|
|
64
|
-
result = result.replace('[ ', '[');
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return result;
|
|
68
|
-
}
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
import "core-js/modules/es.object.assign.js";
|
|
2
|
-
import "core-js/modules/es.function.name.js";
|
|
3
|
-
import "core-js/modules/es.array.filter.js";
|
|
4
|
-
import "core-js/modules/es.object.to-string.js";
|
|
5
|
-
import { Parser } from 'acorn';
|
|
6
|
-
import jsx from 'acorn-jsx';
|
|
7
|
-
import * as acornWalk from 'acorn-walk';
|
|
8
|
-
import { InspectionType } from './types';
|
|
9
|
-
var ACORN_WALK_VISITORS = Object.assign({}, acornWalk.base, {
|
|
10
|
-
JSXElement: function JSXElement() {}
|
|
11
|
-
});
|
|
12
|
-
var acornParser = Parser.extend(jsx()); // Cannot use "estree.Identifier" type because this function also support "JSXIdentifier".
|
|
13
|
-
|
|
14
|
-
function extractIdentifierName(identifierNode) {
|
|
15
|
-
return identifierNode != null ? identifierNode.name : null;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function filterAncestors(ancestors) {
|
|
19
|
-
return ancestors.filter(function (x) {
|
|
20
|
-
return x.type === 'ObjectExpression' || x.type === 'ArrayExpression';
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function calculateNodeDepth(node) {
|
|
25
|
-
var depths = [];
|
|
26
|
-
acornWalk.ancestor( // @ts-ignore
|
|
27
|
-
node, {
|
|
28
|
-
ObjectExpression: function ObjectExpression(_, ancestors) {
|
|
29
|
-
depths.push(filterAncestors(ancestors).length);
|
|
30
|
-
},
|
|
31
|
-
ArrayExpression: function ArrayExpression(_, ancestors) {
|
|
32
|
-
depths.push(filterAncestors(ancestors).length);
|
|
33
|
-
}
|
|
34
|
-
}, ACORN_WALK_VISITORS);
|
|
35
|
-
return Math.max.apply(Math, depths);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function parseIdentifier(identifierNode) {
|
|
39
|
-
return {
|
|
40
|
-
inferredType: {
|
|
41
|
-
type: InspectionType.IDENTIFIER,
|
|
42
|
-
identifier: extractIdentifierName(identifierNode)
|
|
43
|
-
},
|
|
44
|
-
ast: identifierNode
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function parseLiteral(literalNode) {
|
|
49
|
-
return {
|
|
50
|
-
inferredType: {
|
|
51
|
-
type: InspectionType.LITERAL
|
|
52
|
-
},
|
|
53
|
-
ast: literalNode
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function parseFunction(funcNode) {
|
|
58
|
-
var innerJsxElementNode; // If there is at least a JSXElement in the body of the function, then it's a React component.
|
|
59
|
-
|
|
60
|
-
acornWalk.simple( // @ts-ignore
|
|
61
|
-
funcNode.body, {
|
|
62
|
-
JSXElement: function JSXElement(node) {
|
|
63
|
-
innerJsxElementNode = node;
|
|
64
|
-
}
|
|
65
|
-
}, ACORN_WALK_VISITORS);
|
|
66
|
-
var isJsx = innerJsxElementNode != null;
|
|
67
|
-
var inferredType = {
|
|
68
|
-
type: isJsx ? InspectionType.ELEMENT : InspectionType.FUNCTION,
|
|
69
|
-
params: funcNode.params,
|
|
70
|
-
hasParams: funcNode.params.length !== 0
|
|
71
|
-
};
|
|
72
|
-
var identifierName = extractIdentifierName(funcNode.id);
|
|
73
|
-
|
|
74
|
-
if (identifierName != null) {
|
|
75
|
-
inferredType.identifier = identifierName;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return {
|
|
79
|
-
inferredType: inferredType,
|
|
80
|
-
ast: funcNode
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function parseClass(classNode) {
|
|
85
|
-
var innerJsxElementNode; // If there is at least a JSXElement in the body of the class, then it's a React component.
|
|
86
|
-
|
|
87
|
-
acornWalk.simple( // @ts-ignore
|
|
88
|
-
classNode.body, {
|
|
89
|
-
JSXElement: function JSXElement(node) {
|
|
90
|
-
innerJsxElementNode = node;
|
|
91
|
-
}
|
|
92
|
-
}, ACORN_WALK_VISITORS);
|
|
93
|
-
var inferredType = {
|
|
94
|
-
type: innerJsxElementNode != null ? InspectionType.ELEMENT : InspectionType.CLASS,
|
|
95
|
-
identifier: extractIdentifierName(classNode.id)
|
|
96
|
-
};
|
|
97
|
-
return {
|
|
98
|
-
inferredType: inferredType,
|
|
99
|
-
ast: classNode
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function parseJsxElement(jsxElementNode) {
|
|
104
|
-
var inferredType = {
|
|
105
|
-
type: InspectionType.ELEMENT
|
|
106
|
-
};
|
|
107
|
-
var identifierName = extractIdentifierName(jsxElementNode.openingElement.name);
|
|
108
|
-
|
|
109
|
-
if (identifierName != null) {
|
|
110
|
-
inferredType.identifier = identifierName;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
return {
|
|
114
|
-
inferredType: inferredType,
|
|
115
|
-
ast: jsxElementNode
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
function parseCall(callNode) {
|
|
120
|
-
var identifierNode = callNode.callee.type === 'MemberExpression' ? callNode.callee.property : callNode.callee;
|
|
121
|
-
var identifierName = extractIdentifierName(identifierNode);
|
|
122
|
-
|
|
123
|
-
if (identifierName === 'shape') {
|
|
124
|
-
return parseObject(callNode.arguments[0]);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
return null;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
function parseObject(objectNode) {
|
|
131
|
-
return {
|
|
132
|
-
inferredType: {
|
|
133
|
-
type: InspectionType.OBJECT,
|
|
134
|
-
depth: calculateNodeDepth(objectNode)
|
|
135
|
-
},
|
|
136
|
-
ast: objectNode
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
function parseArray(arrayNode) {
|
|
141
|
-
return {
|
|
142
|
-
inferredType: {
|
|
143
|
-
type: InspectionType.ARRAY,
|
|
144
|
-
depth: calculateNodeDepth(arrayNode)
|
|
145
|
-
},
|
|
146
|
-
ast: arrayNode
|
|
147
|
-
};
|
|
148
|
-
} // Cannot set "expression" type to "estree.Expression" because the type doesn't include JSX.
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
function parseExpression(expression) {
|
|
152
|
-
switch (expression.type) {
|
|
153
|
-
case 'Identifier':
|
|
154
|
-
return parseIdentifier(expression);
|
|
155
|
-
|
|
156
|
-
case 'Literal':
|
|
157
|
-
return parseLiteral(expression);
|
|
158
|
-
|
|
159
|
-
case 'FunctionExpression':
|
|
160
|
-
case 'ArrowFunctionExpression':
|
|
161
|
-
return parseFunction(expression);
|
|
162
|
-
|
|
163
|
-
case 'ClassExpression':
|
|
164
|
-
return parseClass(expression);
|
|
165
|
-
|
|
166
|
-
case 'JSXElement':
|
|
167
|
-
return parseJsxElement(expression);
|
|
168
|
-
|
|
169
|
-
case 'CallExpression':
|
|
170
|
-
return parseCall(expression);
|
|
171
|
-
|
|
172
|
-
case 'ObjectExpression':
|
|
173
|
-
return parseObject(expression);
|
|
174
|
-
|
|
175
|
-
case 'ArrayExpression':
|
|
176
|
-
return parseArray(expression);
|
|
177
|
-
|
|
178
|
-
default:
|
|
179
|
-
return null;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
export function parse(value) {
|
|
184
|
-
var ast = acornParser.parse("(".concat(value, ")"));
|
|
185
|
-
var parsingResult = {
|
|
186
|
-
inferredType: {
|
|
187
|
-
type: InspectionType.UNKNOWN
|
|
188
|
-
},
|
|
189
|
-
ast: ast
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
if (ast.body[0] != null) {
|
|
193
|
-
var rootNode = ast.body[0];
|
|
194
|
-
|
|
195
|
-
switch (rootNode.type) {
|
|
196
|
-
case 'ExpressionStatement':
|
|
197
|
-
{
|
|
198
|
-
var expressionResult = parseExpression(rootNode.expression);
|
|
199
|
-
|
|
200
|
-
if (expressionResult != null) {
|
|
201
|
-
parsingResult = expressionResult;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
break;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
default:
|
|
208
|
-
break;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
return parsingResult;
|
|
213
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import "core-js/modules/es.object.assign.js";
|
|
2
|
-
import { parse } from './acornParser';
|
|
3
|
-
import { InspectionType } from './types';
|
|
4
|
-
export function inspectValue(value) {
|
|
5
|
-
try {
|
|
6
|
-
var parsingResult = parse(value);
|
|
7
|
-
return Object.assign({}, parsingResult);
|
|
8
|
-
} catch (e) {// do nothing.
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
return {
|
|
12
|
-
inferredType: {
|
|
13
|
-
type: InspectionType.UNKNOWN
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export var InspectionType;
|
|
2
|
-
|
|
3
|
-
(function (InspectionType) {
|
|
4
|
-
InspectionType["IDENTIFIER"] = "Identifier";
|
|
5
|
-
InspectionType["LITERAL"] = "Literal";
|
|
6
|
-
InspectionType["OBJECT"] = "Object";
|
|
7
|
-
InspectionType["ARRAY"] = "Array";
|
|
8
|
-
InspectionType["FUNCTION"] = "Function";
|
|
9
|
-
InspectionType["CLASS"] = "Class";
|
|
10
|
-
InspectionType["ELEMENT"] = "Element";
|
|
11
|
-
InspectionType["UNKNOWN"] = "Unknown";
|
|
12
|
-
})(InspectionType || (InspectionType = {}));
|