@storybook/addon-docs 6.5.0-alpha.3 → 6.5.0-alpha.30
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/README.md +0 -6
- package/dist/cjs/blocks/Anchor.js +1 -1
- package/dist/cjs/blocks/ArgsTable.js +13 -9
- package/dist/cjs/blocks/Canvas.js +13 -11
- package/dist/cjs/blocks/Description.js +6 -6
- package/dist/cjs/blocks/DocsContainer.js +8 -6
- package/dist/cjs/blocks/Heading.js +2 -2
- package/dist/cjs/blocks/Meta.js +8 -6
- package/dist/cjs/blocks/Primary.js +7 -7
- package/dist/cjs/blocks/Source.js +8 -8
- package/dist/cjs/blocks/SourceContainer.js +9 -7
- package/dist/cjs/blocks/Stories.js +14 -7
- package/dist/cjs/blocks/Story.js +10 -8
- package/dist/cjs/blocks/Subheading.js +2 -2
- package/dist/cjs/blocks/Subtitle.js +5 -5
- package/dist/cjs/blocks/Title.js +8 -8
- package/dist/cjs/blocks/enhanceSource.js +5 -5
- package/dist/cjs/blocks/index.js +6 -4
- package/dist/cjs/blocks/mdx.js +17 -9
- package/dist/cjs/blocks/useStory.js +8 -6
- package/dist/cjs/blocks/utils.js +3 -3
- package/dist/cjs/frameworks/angular/compodoc.js +8 -8
- package/dist/cjs/frameworks/angular/config.js +1 -1
- package/dist/cjs/frameworks/angular/index.js +2 -0
- package/dist/cjs/frameworks/angular/prepareForInline.js +2 -2
- package/dist/cjs/frameworks/angular/sourceDecorator.js +7 -7
- package/dist/cjs/frameworks/common/config.js +8 -8
- package/dist/cjs/frameworks/common/preset.js +157 -111
- package/dist/cjs/frameworks/ember/jsondoc.js +3 -1
- package/dist/cjs/frameworks/html/sourceDecorator.js +2 -2
- package/dist/cjs/frameworks/react/config.js +1 -1
- package/dist/cjs/frameworks/react/extractArgTypes.js +2 -0
- package/dist/cjs/frameworks/react/extractProps.js +2 -2
- package/dist/cjs/frameworks/react/jsxDecorator.js +12 -10
- package/dist/cjs/frameworks/react/lib/captions.js +1 -1
- package/dist/cjs/frameworks/react/lib/componentTypes.js +1 -1
- package/dist/cjs/frameworks/react/lib/defaultValues/createFromRawDefaultProp.js +7 -7
- package/dist/cjs/frameworks/react/lib/defaultValues/index.js +2 -0
- package/dist/cjs/frameworks/react/lib/defaultValues/prettyIdentifier.js +2 -2
- package/dist/cjs/frameworks/react/lib/generateCode.js +3 -3
- package/dist/cjs/frameworks/react/lib/index.js +2 -0
- package/dist/cjs/frameworks/react/lib/inspection/acornParser.js +7 -7
- package/dist/cjs/frameworks/react/lib/inspection/index.js +2 -0
- package/dist/cjs/frameworks/react/propTypes/createType.js +4 -2
- package/dist/cjs/frameworks/react/propTypes/generateFuncSignature.js +2 -2
- package/dist/cjs/frameworks/react/propTypes/sortProps.js +2 -0
- package/dist/cjs/frameworks/react/react-argtypes.stories.js +10 -8
- package/dist/cjs/frameworks/svelte/config.js +1 -1
- package/dist/cjs/frameworks/svelte/extractArgTypes.js +4 -1
- package/dist/cjs/frameworks/svelte/prepareForInline.js +2 -2
- package/dist/cjs/frameworks/svelte/preset.js +2 -2
- package/dist/cjs/frameworks/svelte/sourceDecorator.js +7 -5
- package/dist/cjs/frameworks/svelte/svelte-docgen-loader.js +7 -7
- package/dist/cjs/frameworks/vue/config.js +1 -1
- package/dist/cjs/frameworks/vue/extractArgTypes.js +6 -4
- package/dist/cjs/frameworks/vue/preset.js +2 -0
- package/dist/cjs/frameworks/vue/sourceDecorator.js +12 -12
- package/dist/cjs/frameworks/vue3/extractArgTypes.js +2 -0
- package/dist/cjs/frameworks/vue3/prepareForInline.js +5 -5
- package/dist/cjs/frameworks/vue3/preset.js +2 -0
- package/dist/cjs/frameworks/web-components/custom-elements.js +5 -3
- package/dist/cjs/frameworks/web-components/prepareForInline.js +8 -8
- package/dist/cjs/frameworks/web-components/sourceDecorator.js +2 -2
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/lib/convert/flow/convert.js +3 -1
- package/dist/cjs/lib/convert/flow/index.js +2 -0
- package/dist/cjs/lib/convert/proptypes/convert.js +2 -2
- package/dist/cjs/lib/convert/proptypes/index.js +2 -0
- package/dist/cjs/lib/convert/typescript/convert.js +2 -0
- package/dist/cjs/lib/convert/typescript/index.js +2 -0
- package/dist/cjs/lib/convert/utils.js +2 -2
- package/dist/cjs/lib/docgen/createPropDef.js +3 -1
- package/dist/cjs/lib/docgen/extractDocgenProps.js +3 -1
- package/dist/cjs/lib/docgen/flow/createType.js +2 -2
- package/dist/cjs/lib/docgen/index.js +2 -0
- package/dist/cjs/lib/docgen/typeScript/createType.js +2 -2
- package/dist/cjs/lib/docgen/utils/defaultValue.js +3 -0
- package/dist/cjs/lib/docgen/utils/docgenInfo.js +2 -2
- package/dist/cjs/lib/docgen/utils/index.js +2 -0
- package/dist/cjs/lib/index.js +2 -0
- package/dist/cjs/lib/jsdocParser.js +2 -2
- package/dist/cjs/lib/utils.js +6 -5
- package/dist/esm/blocks/ArgsTable.js +5 -3
- package/dist/esm/blocks/Canvas.js +5 -3
- package/dist/esm/blocks/DocsContainer.js +3 -2
- package/dist/esm/blocks/Heading.js +1 -1
- package/dist/esm/blocks/Meta.js +3 -2
- package/dist/esm/blocks/Primary.js +1 -0
- package/dist/esm/blocks/Source.js +1 -0
- package/dist/esm/blocks/SourceContainer.js +3 -2
- package/dist/esm/blocks/Stories.js +7 -0
- package/dist/esm/blocks/Story.js +4 -3
- package/dist/esm/blocks/Subheading.js +1 -1
- package/dist/esm/blocks/Title.js +1 -1
- package/dist/esm/blocks/enhanceSource.js +3 -3
- package/dist/esm/blocks/mdx.js +15 -8
- package/dist/esm/blocks/useStory.js +15 -15
- package/dist/esm/blocks/utils.js +1 -1
- package/dist/esm/frameworks/angular/compodoc.js +4 -4
- package/dist/esm/frameworks/angular/prepareForInline.js +1 -1
- package/dist/esm/frameworks/angular/sourceDecorator.js +1 -1
- package/dist/esm/frameworks/common/config.js +1 -1
- package/dist/esm/frameworks/common/preset.js +153 -109
- package/dist/esm/frameworks/ember/jsondoc.js +1 -0
- package/dist/esm/frameworks/html/sourceDecorator.js +2 -2
- package/dist/esm/frameworks/react/extractArgTypes.js +1 -0
- package/dist/esm/frameworks/react/extractProps.js +1 -1
- package/dist/esm/frameworks/react/jsxDecorator.js +5 -4
- package/dist/esm/frameworks/react/lib/defaultValues/createFromRawDefaultProp.js +3 -3
- package/dist/esm/frameworks/react/lib/generateCode.js +1 -1
- package/dist/esm/frameworks/react/lib/inspection/acornParser.js +1 -0
- package/dist/esm/frameworks/react/propTypes/createType.js +2 -1
- package/dist/esm/frameworks/react/propTypes/generateFuncSignature.js +1 -1
- package/dist/esm/frameworks/react/propTypes/sortProps.js +1 -0
- package/dist/esm/frameworks/react/react-argtypes.stories.js +4 -3
- package/dist/esm/frameworks/svelte/extractArgTypes.js +2 -0
- package/dist/esm/frameworks/svelte/prepareForInline.js +2 -2
- package/dist/esm/frameworks/svelte/preset.js +1 -1
- package/dist/esm/frameworks/svelte/sourceDecorator.js +4 -3
- package/dist/esm/frameworks/svelte/svelte-docgen-loader.js +1 -1
- package/dist/esm/frameworks/vue/extractArgTypes.js +4 -3
- package/dist/esm/frameworks/vue/preset.js +1 -0
- package/dist/esm/frameworks/vue/sourceDecorator.js +6 -6
- package/dist/esm/frameworks/vue3/extractArgTypes.js +1 -0
- package/dist/esm/frameworks/vue3/preset.js +1 -0
- package/dist/esm/frameworks/web-components/custom-elements.js +2 -1
- package/dist/esm/frameworks/web-components/prepareForInline.js +6 -6
- package/dist/esm/frameworks/web-components/sourceDecorator.js +1 -1
- package/dist/esm/lib/convert/flow/convert.js +2 -1
- package/dist/esm/lib/convert/proptypes/convert.js +1 -1
- package/dist/esm/lib/convert/typescript/convert.js +1 -0
- package/dist/esm/lib/convert/utils.js +1 -1
- package/dist/esm/lib/docgen/createPropDef.js +1 -0
- package/dist/esm/lib/docgen/extractDocgenProps.js +1 -0
- package/dist/esm/lib/docgen/flow/createType.js +1 -1
- package/dist/esm/lib/docgen/typeScript/createType.js +1 -1
- package/dist/esm/lib/docgen/utils/defaultValue.js +1 -0
- package/dist/esm/lib/jsdocParser.js +1 -1
- package/dist/esm/lib/utils.js +1 -1
- package/dist/modern/blocks/Canvas.js +3 -1
- package/dist/modern/blocks/Stories.js +5 -0
- package/dist/modern/blocks/mdx.js +12 -7
- package/dist/modern/frameworks/common/preset.js +10 -9
- package/dist/modern/frameworks/html/sourceDecorator.js +2 -2
- package/dist/modern/frameworks/react/jsxDecorator.js +3 -1
- package/dist/modern/frameworks/svelte/extractArgTypes.js +1 -0
- package/dist/modern/frameworks/svelte/prepareForInline.js +2 -2
- package/dist/modern/frameworks/vue/extractArgTypes.js +1 -1
- package/dist/ts3.4/frameworks/common/preset.d.ts +12 -1
- package/dist/ts3.9/frameworks/common/preset.d.ts +12 -1
- package/package.json +31 -30
- package/register.js +1 -0
- package/{dist/cjs/frameworks/svelte → svelte}/HOC.svelte +0 -0
- package/dist/cjs/frameworks/svelte/sample/MockButton.svelte +0 -45
- package/dist/cjs/typings.d.js +0 -1
- package/dist/esm/frameworks/svelte/HOC.svelte +0 -7
- package/dist/esm/frameworks/svelte/sample/MockButton.svelte +0 -45
- package/dist/esm/typings.d.js +0 -0
- package/dist/modern/frameworks/svelte/HOC.svelte +0 -7
- package/dist/modern/frameworks/svelte/sample/MockButton.svelte +0 -45
- package/dist/modern/typings.d.js +0 -0
|
@@ -1,19 +1,27 @@
|
|
|
1
|
+
import "regenerator-runtime/runtime.js";
|
|
2
|
+
|
|
3
|
+
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); } }
|
|
4
|
+
|
|
5
|
+
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); }); }; }
|
|
6
|
+
|
|
1
7
|
import "core-js/modules/es.array.concat.js";
|
|
2
8
|
import "core-js/modules/es.object.assign.js";
|
|
9
|
+
import "core-js/modules/es.function.name.js";
|
|
10
|
+
import "core-js/modules/es.regexp.exec.js";
|
|
11
|
+
import "core-js/modules/es.string.match.js";
|
|
3
12
|
import "core-js/modules/es.array.filter.js";
|
|
4
13
|
import "core-js/modules/es.object.to-string.js";
|
|
5
14
|
import "core-js/modules/es.regexp.to-string.js";
|
|
6
15
|
import "core-js/modules/es.regexp.constructor.js";
|
|
7
|
-
import "core-js/modules/es.regexp.exec.js";
|
|
8
16
|
import "core-js/modules/es.symbol.js";
|
|
9
17
|
import "core-js/modules/es.symbol.description.js";
|
|
10
18
|
import "core-js/modules/es.symbol.iterator.js";
|
|
11
|
-
import "core-js/modules/es.string.iterator.js";
|
|
12
19
|
import "core-js/modules/es.array.iterator.js";
|
|
20
|
+
import "core-js/modules/es.string.iterator.js";
|
|
13
21
|
import "core-js/modules/web.dom-collections.iterator.js";
|
|
14
22
|
import "core-js/modules/es.array.from.js";
|
|
15
23
|
import "core-js/modules/es.array.slice.js";
|
|
16
|
-
import "core-js/modules/es.
|
|
24
|
+
import "core-js/modules/es.promise.js";
|
|
17
25
|
|
|
18
26
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
19
27
|
|
|
@@ -21,7 +29,7 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
|
|
|
21
29
|
|
|
22
30
|
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); }
|
|
23
31
|
|
|
24
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator
|
|
32
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
25
33
|
|
|
26
34
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
27
35
|
|
|
@@ -33,14 +41,6 @@ import remarkExternalLinks from 'remark-external-links'; // @ts-ignore
|
|
|
33
41
|
|
|
34
42
|
import { createCompiler } from '@storybook/csf-tools/mdx';
|
|
35
43
|
|
|
36
|
-
var resolvedBabelLoader = require.resolve('babel-loader', {
|
|
37
|
-
paths: [require.resolve('@storybook/builder-webpack4')] // FIXME!!!
|
|
38
|
-
|
|
39
|
-
}); // for frameworks that are not working with react, we need to configure
|
|
40
|
-
// the jsx to transpile mdx, for now there will be a flag for that
|
|
41
|
-
// for more complex solutions we can find alone that we need to add '@babel/plugin-transform-react-jsx'
|
|
42
|
-
|
|
43
|
-
|
|
44
44
|
function createBabelOptions(_ref) {
|
|
45
45
|
var babelOptions = _ref.babelOptions,
|
|
46
46
|
mdxBabelOptions = _ref.mdxBabelOptions,
|
|
@@ -61,101 +61,145 @@ function createBabelOptions(_ref) {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
export function webpack() {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
64
|
+
return _webpack.apply(this, arguments);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function _webpack() {
|
|
68
|
+
_webpack = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
69
|
+
var webpackConfig,
|
|
70
|
+
options,
|
|
71
|
+
_yield$options$preset,
|
|
72
|
+
_yield$options$preset2,
|
|
73
|
+
builder,
|
|
74
|
+
builderName,
|
|
75
|
+
resolvedBabelLoader,
|
|
76
|
+
_webpackConfig$module,
|
|
77
|
+
module,
|
|
78
|
+
babelOptions,
|
|
79
|
+
mdxBabelOptions,
|
|
80
|
+
_options$configureJSX,
|
|
81
|
+
configureJSX,
|
|
82
|
+
_options$sourceLoader,
|
|
83
|
+
sourceLoaderOptions,
|
|
84
|
+
_options$transcludeMa,
|
|
85
|
+
transcludeMarkdown,
|
|
86
|
+
mdxLoaderOptions,
|
|
87
|
+
sourceLoader,
|
|
88
|
+
rules,
|
|
89
|
+
result,
|
|
90
|
+
_args = arguments;
|
|
91
|
+
|
|
92
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
93
|
+
while (1) {
|
|
94
|
+
switch (_context.prev = _context.next) {
|
|
95
|
+
case 0:
|
|
96
|
+
webpackConfig = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
97
|
+
options = _args.length > 1 ? _args[1] : undefined;
|
|
98
|
+
_context.next = 4;
|
|
99
|
+
return options.presets.apply('core', {});
|
|
100
|
+
|
|
101
|
+
case 4:
|
|
102
|
+
_yield$options$preset = _context.sent;
|
|
103
|
+
_yield$options$preset2 = _yield$options$preset.builder;
|
|
104
|
+
builder = _yield$options$preset2 === void 0 ? 'webpack4' : _yield$options$preset2;
|
|
105
|
+
builderName = typeof builder === 'string' ? builder : builder.name;
|
|
106
|
+
resolvedBabelLoader = require.resolve('babel-loader', {
|
|
107
|
+
paths: builderName.match(/(webpack4|webpack5)/) ? [require.resolve("@storybook/builder-".concat(builder))] : [builderName]
|
|
108
|
+
});
|
|
109
|
+
_webpackConfig$module = webpackConfig.module, module = _webpackConfig$module === void 0 ? {} : _webpackConfig$module; // it will reuse babel options that are already in use in storybook
|
|
110
|
+
// also, these babel options are chained with other presets.
|
|
111
|
+
|
|
112
|
+
babelOptions = options.babelOptions, mdxBabelOptions = options.mdxBabelOptions, _options$configureJSX = options.configureJSX, configureJSX = _options$configureJSX === void 0 ? true : _options$configureJSX, _options$sourceLoader = options.sourceLoaderOptions, sourceLoaderOptions = _options$sourceLoader === void 0 ? {
|
|
113
|
+
injectStoryParameters: true
|
|
114
|
+
} : _options$sourceLoader, _options$transcludeMa = options.transcludeMarkdown, transcludeMarkdown = _options$transcludeMa === void 0 ? false : _options$transcludeMa;
|
|
115
|
+
mdxLoaderOptions = {
|
|
116
|
+
remarkPlugins: [remarkSlug, remarkExternalLinks]
|
|
117
|
+
}; // set `sourceLoaderOptions` to `null` to disable for manual configuration
|
|
118
|
+
|
|
119
|
+
sourceLoader = sourceLoaderOptions ? [{
|
|
120
|
+
test: /\.(stories|story)\.[tj]sx?$/,
|
|
121
|
+
loader: require.resolve('@storybook/source-loader'),
|
|
122
|
+
options: Object.assign({}, sourceLoaderOptions, {
|
|
123
|
+
inspectLocalDependencies: true
|
|
124
|
+
}),
|
|
125
|
+
enforce: 'pre'
|
|
126
|
+
}] : [];
|
|
127
|
+
rules = module.rules || [];
|
|
128
|
+
|
|
129
|
+
if (transcludeMarkdown) {
|
|
130
|
+
rules = [].concat(_toConsumableArray(rules.filter(function (rule) {
|
|
131
|
+
var _rule$test;
|
|
132
|
+
|
|
133
|
+
return ((_rule$test = rule.test) === null || _rule$test === void 0 ? void 0 : _rule$test.toString()) !== '/\\.md$/';
|
|
134
|
+
})), [{
|
|
135
|
+
test: /\.md$/,
|
|
136
|
+
use: [{
|
|
137
|
+
loader: resolvedBabelLoader,
|
|
138
|
+
options: createBabelOptions({
|
|
139
|
+
babelOptions: babelOptions,
|
|
140
|
+
mdxBabelOptions: mdxBabelOptions,
|
|
141
|
+
configureJSX: configureJSX
|
|
142
|
+
})
|
|
143
|
+
}, {
|
|
144
|
+
loader: require.resolve('@mdx-js/loader'),
|
|
145
|
+
options: mdxLoaderOptions
|
|
146
|
+
}]
|
|
147
|
+
}]);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
result = Object.assign({}, webpackConfig, {
|
|
151
|
+
module: Object.assign({}, module, {
|
|
152
|
+
rules: [].concat(_toConsumableArray(rules), [{
|
|
153
|
+
test: /\.js$/,
|
|
154
|
+
include: new RegExp("node_modules\\".concat(path.sep, "acorn-jsx")),
|
|
155
|
+
use: [{
|
|
156
|
+
loader: resolvedBabelLoader,
|
|
157
|
+
options: {
|
|
158
|
+
presets: [[require.resolve('@babel/preset-env'), {
|
|
159
|
+
modules: 'commonjs'
|
|
160
|
+
}]]
|
|
161
|
+
}
|
|
162
|
+
}]
|
|
163
|
+
}, {
|
|
164
|
+
test: /(stories|story)\.mdx$/,
|
|
165
|
+
use: [{
|
|
166
|
+
loader: resolvedBabelLoader,
|
|
167
|
+
options: createBabelOptions({
|
|
168
|
+
babelOptions: babelOptions,
|
|
169
|
+
mdxBabelOptions: mdxBabelOptions,
|
|
170
|
+
configureJSX: configureJSX
|
|
171
|
+
})
|
|
172
|
+
}, {
|
|
173
|
+
loader: require.resolve('@mdx-js/loader'),
|
|
174
|
+
options: Object.assign({
|
|
175
|
+
compilers: [createCompiler(options)]
|
|
176
|
+
}, mdxLoaderOptions)
|
|
177
|
+
}]
|
|
178
|
+
}, {
|
|
179
|
+
test: /\.mdx$/,
|
|
180
|
+
exclude: /(stories|story)\.mdx$/,
|
|
181
|
+
use: [{
|
|
182
|
+
loader: resolvedBabelLoader,
|
|
183
|
+
options: createBabelOptions({
|
|
184
|
+
babelOptions: babelOptions,
|
|
185
|
+
mdxBabelOptions: mdxBabelOptions,
|
|
186
|
+
configureJSX: configureJSX
|
|
187
|
+
})
|
|
188
|
+
}, {
|
|
189
|
+
loader: require.resolve('@mdx-js/loader'),
|
|
190
|
+
options: mdxLoaderOptions
|
|
191
|
+
}]
|
|
192
|
+
}], sourceLoader)
|
|
193
|
+
})
|
|
194
|
+
});
|
|
195
|
+
return _context.abrupt("return", result);
|
|
196
|
+
|
|
197
|
+
case 17:
|
|
198
|
+
case "end":
|
|
199
|
+
return _context.stop();
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}, _callee);
|
|
203
|
+
}));
|
|
204
|
+
return _webpack.apply(this, arguments);
|
|
161
205
|
}
|
|
@@ -43,8 +43,8 @@ export function sourceDecorator(storyFn, context) {
|
|
|
43
43
|
source = story;
|
|
44
44
|
} // eslint-disable-next-line no-undef
|
|
45
45
|
else if (story instanceof Element) {
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
source = story.outerHTML;
|
|
47
|
+
}
|
|
48
48
|
|
|
49
49
|
if (source) source = applyTransformSource(source, context);
|
|
50
50
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import "core-js/modules/es.array.iterator.js";
|
|
1
2
|
import "core-js/modules/es.map.js";
|
|
2
3
|
import "core-js/modules/es.object.to-string.js";
|
|
3
4
|
import "core-js/modules/es.string.iterator.js";
|
|
4
|
-
import "core-js/modules/es.array.iterator.js";
|
|
5
5
|
import "core-js/modules/web.dom-collections.iterator.js";
|
|
6
6
|
import "core-js/modules/web.dom-collections.for-each.js";
|
|
7
7
|
import "core-js/modules/es.object.keys.js";
|
|
@@ -4,10 +4,11 @@ import "core-js/modules/es.object.keys.js";
|
|
|
4
4
|
import "core-js/modules/es.symbol.js";
|
|
5
5
|
import "core-js/modules/es.symbol.description.js";
|
|
6
6
|
import "core-js/modules/es.symbol.iterator.js";
|
|
7
|
-
import "core-js/modules/es.string.iterator.js";
|
|
8
7
|
import "core-js/modules/es.array.iterator.js";
|
|
8
|
+
import "core-js/modules/es.string.iterator.js";
|
|
9
9
|
import "core-js/modules/web.dom-collections.iterator.js";
|
|
10
10
|
import "core-js/modules/es.array.from.js";
|
|
11
|
+
var _excluded = ["mdxType", "originalType", "children"];
|
|
11
12
|
|
|
12
13
|
var _templateObject;
|
|
13
14
|
|
|
@@ -17,7 +18,7 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
|
|
|
17
18
|
|
|
18
19
|
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); }
|
|
19
20
|
|
|
20
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator
|
|
21
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
21
22
|
|
|
22
23
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
23
24
|
|
|
@@ -33,8 +34,8 @@ import "core-js/modules/es.array.join.js";
|
|
|
33
34
|
import "core-js/modules/es.array.map.js";
|
|
34
35
|
import "core-js/modules/es.object.to-string.js";
|
|
35
36
|
import "core-js/modules/es.regexp.to-string.js";
|
|
36
|
-
import "core-js/modules/es.string.match.js";
|
|
37
37
|
import "core-js/modules/es.regexp.exec.js";
|
|
38
|
+
import "core-js/modules/es.string.match.js";
|
|
38
39
|
import "core-js/modules/web.dom-collections.for-each.js";
|
|
39
40
|
import "core-js/modules/es.string.replace.js";
|
|
40
41
|
import "core-js/modules/es.array.concat.js";
|
|
@@ -176,7 +177,7 @@ var mdxToJsx = function mdxToJsx(node) {
|
|
|
176
177
|
mdxType = _node$props2.mdxType,
|
|
177
178
|
originalType = _node$props2.originalType,
|
|
178
179
|
children = _node$props2.children,
|
|
179
|
-
rest = _objectWithoutProperties(_node$props2,
|
|
180
|
+
rest = _objectWithoutProperties(_node$props2, _excluded);
|
|
180
181
|
|
|
181
182
|
var jsxChildren = [];
|
|
182
183
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
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
2
|
|
|
3
3
|
import "core-js/modules/es.function.name.js";
|
|
4
|
-
import "core-js/modules/es.string.replace.js";
|
|
5
4
|
import "core-js/modules/es.regexp.exec.js";
|
|
5
|
+
import "core-js/modules/es.string.replace.js";
|
|
6
6
|
import "core-js/modules/es.object.to-string.js";
|
|
7
7
|
import "core-js/modules/es.regexp.to-string.js";
|
|
8
8
|
import "core-js/modules/es.object.assign.js";
|
|
9
9
|
import "core-js/modules/es.symbol.js";
|
|
10
10
|
import "core-js/modules/es.symbol.description.js";
|
|
11
11
|
import "core-js/modules/es.symbol.iterator.js";
|
|
12
|
-
import "core-js/modules/es.string.iterator.js";
|
|
13
12
|
import "core-js/modules/es.array.iterator.js";
|
|
13
|
+
import "core-js/modules/es.string.iterator.js";
|
|
14
14
|
import "core-js/modules/web.dom-collections.iterator.js";
|
|
15
15
|
import isPlainObject from 'lodash/isPlainObject';
|
|
16
16
|
import isFunction from 'lodash/isFunction';
|
|
@@ -2,8 +2,8 @@ import "core-js/modules/es.object.assign.js";
|
|
|
2
2
|
import "core-js/modules/es.string.ends-with.js";
|
|
3
3
|
import "core-js/modules/es.array.slice.js";
|
|
4
4
|
import "core-js/modules/es.string.starts-with.js";
|
|
5
|
-
import "core-js/modules/es.string.replace.js";
|
|
6
5
|
import "core-js/modules/es.regexp.exec.js";
|
|
6
|
+
import "core-js/modules/es.string.replace.js";
|
|
7
7
|
import { generate } from 'escodegen';
|
|
8
8
|
import dedent from 'ts-dedent';
|
|
9
9
|
var BASIC_OPTIONS = {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "core-js/modules/es.object.assign.js";
|
|
2
2
|
import "core-js/modules/es.function.name.js";
|
|
3
3
|
import "core-js/modules/es.array.filter.js";
|
|
4
|
+
import "core-js/modules/es.object.to-string.js";
|
|
4
5
|
import { Parser } from 'acorn';
|
|
5
6
|
import jsx from 'acorn-jsx'; // eslint-disable-next-line import/no-extraneous-dependencies
|
|
6
7
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import "core-js/modules/es.function.name.js";
|
|
2
|
-
import "core-js/modules/es.string.replace.js";
|
|
3
2
|
import "core-js/modules/es.regexp.exec.js";
|
|
3
|
+
import "core-js/modules/es.string.replace.js";
|
|
4
4
|
import "core-js/modules/es.string.split.js";
|
|
5
5
|
import "core-js/modules/es.array.join.js";
|
|
6
6
|
import "core-js/modules/es.array.map.js";
|
|
7
7
|
import "core-js/modules/es.object.keys.js";
|
|
8
8
|
import "core-js/modules/es.array.concat.js";
|
|
9
|
+
import "core-js/modules/es.object.to-string.js";
|
|
9
10
|
import { createSummaryValue, isTooLongForTypeSummary } from '../../../lib';
|
|
10
11
|
import { generateFuncSignature, generateShortFuncSignature, toMultilineSignature } from './generateFuncSignature';
|
|
11
12
|
import { OBJECT_CAPTION, ARRAY_CAPTION, CLASS_CAPTION, FUNCTION_CAPTION, ELEMENT_CAPTION, CUSTOM_CAPTION, isHtmlTag, generateObjectCode, generateCode } from '../lib';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "core-js/modules/es.array.map.js";
|
|
2
2
|
import "core-js/modules/es.array.concat.js";
|
|
3
3
|
import "core-js/modules/es.array.join.js";
|
|
4
|
-
import "core-js/modules/es.string.replace.js";
|
|
5
4
|
import "core-js/modules/es.regexp.exec.js";
|
|
5
|
+
import "core-js/modules/es.string.replace.js";
|
|
6
6
|
export function generateFuncSignature(params, returns) {
|
|
7
7
|
var hasParams = params != null;
|
|
8
8
|
var hasReturns = returns != null;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import "core-js/modules/es.object.assign.js";
|
|
2
2
|
import "core-js/modules/es.array.map.js";
|
|
3
3
|
import "core-js/modules/es.object.entries.js";
|
|
4
|
+
import "core-js/modules/es.object.to-string.js";
|
|
4
5
|
import "core-js/modules/es.symbol.js";
|
|
5
6
|
import "core-js/modules/es.symbol.description.js";
|
|
6
|
-
import "core-js/modules/es.object.to-string.js";
|
|
7
7
|
import "core-js/modules/es.symbol.iterator.js";
|
|
8
|
-
import "core-js/modules/es.string.iterator.js";
|
|
9
8
|
import "core-js/modules/es.array.iterator.js";
|
|
9
|
+
import "core-js/modules/es.string.iterator.js";
|
|
10
10
|
import "core-js/modules/web.dom-collections.iterator.js";
|
|
11
11
|
import "core-js/modules/es.array.slice.js";
|
|
12
12
|
import "core-js/modules/es.function.name.js";
|
|
13
13
|
import "core-js/modules/es.array.from.js";
|
|
14
|
+
import "core-js/modules/es.regexp.exec.js";
|
|
14
15
|
|
|
15
16
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
17
|
|
|
@@ -20,7 +21,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
20
21
|
|
|
21
22
|
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; }
|
|
22
23
|
|
|
23
|
-
function _iterableToArrayLimit(arr, i) {
|
|
24
|
+
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; }
|
|
24
25
|
|
|
25
26
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
26
27
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "core-js/modules/es.array.find.js";
|
|
2
|
+
import "core-js/modules/es.object.to-string.js";
|
|
2
3
|
import "core-js/modules/es.function.name.js";
|
|
3
4
|
import "core-js/modules/web.dom-collections.for-each.js";
|
|
4
5
|
import "core-js/modules/es.symbol.js";
|
|
@@ -120,6 +121,7 @@ var parseTypeToControl = function parseTypeToControl(type) {
|
|
|
120
121
|
};
|
|
121
122
|
}
|
|
122
123
|
} else if (type.kind === 'union') {
|
|
124
|
+
// @ts-ignore TODO: fix, this seems like a broke in package update
|
|
123
125
|
if (Array.isArray(type.type) && !type.type.find(function (t) {
|
|
124
126
|
return t.type !== 'string';
|
|
125
127
|
})) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react'; //
|
|
1
|
+
import React from 'react'; // eslint-disable-next-line import/no-extraneous-dependencies
|
|
2
2
|
|
|
3
|
-
import HOC from '
|
|
3
|
+
import HOC from '@storybook/addon-docs/svelte/HOC.svelte';
|
|
4
4
|
export var prepareForInline = function prepareForInline(storyFn) {
|
|
5
5
|
var el = React.useRef(null);
|
|
6
6
|
React.useEffect(function () {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "regenerator-runtime/runtime.js";
|
|
2
|
-
import "core-js/modules/es.promise.js";
|
|
3
2
|
import "core-js/modules/es.object.to-string.js";
|
|
3
|
+
import "core-js/modules/es.promise.js";
|
|
4
4
|
|
|
5
5
|
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); } }
|
|
6
6
|
|
|
@@ -6,7 +6,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
6
6
|
|
|
7
7
|
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; }
|
|
8
8
|
|
|
9
|
-
function _iterableToArrayLimit(arr, i) {
|
|
9
|
+
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; }
|
|
10
10
|
|
|
11
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
12
|
|
|
@@ -15,18 +15,19 @@ import "core-js/modules/es.function.name.js";
|
|
|
15
15
|
import "core-js/modules/es.string.ends-with.js";
|
|
16
16
|
import "core-js/modules/es.array.join.js";
|
|
17
17
|
import "core-js/modules/es.array.filter.js";
|
|
18
|
+
import "core-js/modules/es.object.to-string.js";
|
|
18
19
|
import "core-js/modules/es.array.map.js";
|
|
19
20
|
import "core-js/modules/es.object.entries.js";
|
|
20
21
|
import "core-js/modules/es.array.find.js";
|
|
21
22
|
import "core-js/modules/es.symbol.js";
|
|
22
23
|
import "core-js/modules/es.symbol.description.js";
|
|
23
|
-
import "core-js/modules/es.object.to-string.js";
|
|
24
24
|
import "core-js/modules/es.symbol.iterator.js";
|
|
25
|
-
import "core-js/modules/es.string.iterator.js";
|
|
26
25
|
import "core-js/modules/es.array.iterator.js";
|
|
26
|
+
import "core-js/modules/es.string.iterator.js";
|
|
27
27
|
import "core-js/modules/web.dom-collections.iterator.js";
|
|
28
28
|
import "core-js/modules/es.array.slice.js";
|
|
29
29
|
import "core-js/modules/es.array.from.js";
|
|
30
|
+
import "core-js/modules/es.regexp.exec.js";
|
|
30
31
|
import { addons, useEffect } from '@storybook/addons';
|
|
31
32
|
import { SourceType, SNIPPET_RENDERED } from '../../shared';
|
|
32
33
|
/**
|
|
@@ -12,8 +12,8 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
12
12
|
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); }); }; }
|
|
13
13
|
|
|
14
14
|
import "core-js/modules/es.array.map.js";
|
|
15
|
-
import "core-js/modules/es.string.split.js";
|
|
16
15
|
import "core-js/modules/es.regexp.exec.js";
|
|
16
|
+
import "core-js/modules/es.string.split.js";
|
|
17
17
|
import "core-js/modules/es.string.match.js";
|
|
18
18
|
import "core-js/modules/es.string.replace.js";
|
|
19
19
|
import "core-js/modules/es.array.slice.js";
|
|
@@ -6,12 +6,12 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
6
6
|
|
|
7
7
|
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; }
|
|
8
8
|
|
|
9
|
-
function _iterableToArrayLimit(arr, i) {
|
|
9
|
+
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; }
|
|
10
10
|
|
|
11
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
12
|
|
|
13
|
-
import "core-js/modules/es.object.to-string.js";
|
|
14
13
|
import "core-js/modules/es.array.iterator.js";
|
|
14
|
+
import "core-js/modules/es.object.to-string.js";
|
|
15
15
|
import "core-js/modules/web.dom-collections.iterator.js";
|
|
16
16
|
import "core-js/modules/es.function.name.js";
|
|
17
17
|
import "core-js/modules/es.array.join.js";
|
|
@@ -24,9 +24,10 @@ import "core-js/modules/es.symbol.iterator.js";
|
|
|
24
24
|
import "core-js/modules/es.string.iterator.js";
|
|
25
25
|
import "core-js/modules/es.array.slice.js";
|
|
26
26
|
import "core-js/modules/es.array.from.js";
|
|
27
|
+
import "core-js/modules/es.regexp.exec.js";
|
|
27
28
|
import { hasDocgen, extractComponentProps } from '../../lib/docgen';
|
|
28
29
|
import { convert } from '../../lib/convert';
|
|
29
|
-
var SECTIONS = ['props', 'events', 'slots'];
|
|
30
|
+
var SECTIONS = ['props', 'events', 'slots', 'methods'];
|
|
30
31
|
/**
|
|
31
32
|
* Check if "@values" tag is defined within docgenInfo.
|
|
32
33
|
* If true, then propDef is mutated.
|