@storybook/addon-docs 6.5.0-alpha.4 → 6.5.0-alpha.40

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.
Files changed (175) hide show
  1. package/README.md +4 -13
  2. package/angular/README.md +0 -6
  3. package/dist/cjs/blocks/Anchor.js +1 -1
  4. package/dist/cjs/blocks/ArgsTable.js +13 -9
  5. package/dist/cjs/blocks/Canvas.js +13 -11
  6. package/dist/cjs/blocks/Description.js +6 -6
  7. package/dist/cjs/blocks/DocsContainer.js +8 -6
  8. package/dist/cjs/blocks/Heading.js +2 -2
  9. package/dist/cjs/blocks/Meta.js +8 -6
  10. package/dist/cjs/blocks/Primary.js +7 -7
  11. package/dist/cjs/blocks/Source.js +8 -8
  12. package/dist/cjs/blocks/SourceContainer.js +9 -7
  13. package/dist/cjs/blocks/Stories.js +14 -7
  14. package/dist/cjs/blocks/Story.js +10 -8
  15. package/dist/cjs/blocks/Subheading.js +2 -2
  16. package/dist/cjs/blocks/Subtitle.js +5 -5
  17. package/dist/cjs/blocks/Title.js +8 -8
  18. package/dist/cjs/blocks/enhanceSource.js +5 -5
  19. package/dist/cjs/blocks/index.js +6 -4
  20. package/dist/cjs/blocks/mdx.js +17 -9
  21. package/dist/cjs/blocks/useStory.js +8 -6
  22. package/dist/cjs/blocks/utils.js +3 -3
  23. package/dist/cjs/frameworks/angular/compodoc.js +8 -8
  24. package/dist/cjs/frameworks/angular/config.js +1 -1
  25. package/dist/cjs/frameworks/angular/index.js +2 -0
  26. package/dist/cjs/frameworks/angular/prepareForInline.js +2 -2
  27. package/dist/cjs/frameworks/angular/sourceDecorator.js +7 -7
  28. package/dist/cjs/frameworks/common/config.js +8 -8
  29. package/dist/cjs/frameworks/common/preset.js +157 -111
  30. package/dist/cjs/frameworks/ember/jsondoc.js +3 -1
  31. package/dist/cjs/frameworks/html/sourceDecorator.js +2 -2
  32. package/dist/cjs/frameworks/react/config.js +1 -1
  33. package/dist/cjs/frameworks/react/extractArgTypes.js +2 -0
  34. package/dist/cjs/frameworks/react/extractProps.js +2 -2
  35. package/dist/cjs/frameworks/react/jsxDecorator.js +12 -10
  36. package/dist/cjs/frameworks/react/lib/captions.js +1 -1
  37. package/dist/cjs/frameworks/react/lib/componentTypes.js +1 -1
  38. package/dist/cjs/frameworks/react/lib/defaultValues/createFromRawDefaultProp.js +7 -7
  39. package/dist/cjs/frameworks/react/lib/defaultValues/index.js +2 -0
  40. package/dist/cjs/frameworks/react/lib/defaultValues/prettyIdentifier.js +2 -2
  41. package/dist/cjs/frameworks/react/lib/generateCode.js +3 -3
  42. package/dist/cjs/frameworks/react/lib/index.js +2 -0
  43. package/dist/cjs/frameworks/react/lib/inspection/acornParser.js +7 -7
  44. package/dist/cjs/frameworks/react/lib/inspection/index.js +2 -0
  45. package/dist/cjs/frameworks/react/propTypes/createType.js +4 -2
  46. package/dist/cjs/frameworks/react/propTypes/generateFuncSignature.js +2 -2
  47. package/dist/cjs/frameworks/react/propTypes/sortProps.js +2 -0
  48. package/dist/cjs/frameworks/react/react-argtypes.stories.js +10 -8
  49. package/dist/cjs/frameworks/svelte/config.js +1 -1
  50. package/dist/cjs/frameworks/svelte/extractArgTypes.js +4 -1
  51. package/dist/cjs/frameworks/svelte/prepareForInline.js +1 -2
  52. package/dist/cjs/frameworks/svelte/preset.js +2 -2
  53. package/dist/cjs/frameworks/svelte/sourceDecorator.js +7 -5
  54. package/dist/cjs/frameworks/svelte/svelte-docgen-loader.js +7 -7
  55. package/dist/cjs/frameworks/vue/config.js +1 -1
  56. package/dist/cjs/frameworks/vue/extractArgTypes.js +6 -4
  57. package/dist/cjs/frameworks/vue/preset.js +2 -0
  58. package/dist/cjs/frameworks/vue/sourceDecorator.js +12 -12
  59. package/dist/cjs/frameworks/vue3/extractArgTypes.js +2 -0
  60. package/dist/cjs/frameworks/vue3/prepareForInline.js +5 -5
  61. package/dist/cjs/frameworks/vue3/preset.js +2 -0
  62. package/dist/cjs/frameworks/web-components/custom-elements.js +5 -3
  63. package/dist/cjs/frameworks/web-components/prepareForInline.js +8 -8
  64. package/dist/cjs/frameworks/web-components/sourceDecorator.js +2 -2
  65. package/dist/cjs/index.js +2 -0
  66. package/dist/cjs/lib/convert/flow/convert.js +3 -1
  67. package/dist/cjs/lib/convert/flow/index.js +2 -0
  68. package/dist/cjs/lib/convert/proptypes/convert.js +2 -2
  69. package/dist/cjs/lib/convert/proptypes/index.js +2 -0
  70. package/dist/cjs/lib/convert/typescript/convert.js +2 -0
  71. package/dist/cjs/lib/convert/typescript/index.js +2 -0
  72. package/dist/cjs/lib/convert/utils.js +2 -2
  73. package/dist/cjs/lib/docgen/createPropDef.js +3 -1
  74. package/dist/cjs/lib/docgen/extractDocgenProps.js +3 -1
  75. package/dist/cjs/lib/docgen/flow/createType.js +2 -2
  76. package/dist/cjs/lib/docgen/index.js +2 -0
  77. package/dist/cjs/lib/docgen/typeScript/createType.js +2 -2
  78. package/dist/cjs/lib/docgen/utils/defaultValue.js +3 -0
  79. package/dist/cjs/lib/docgen/utils/docgenInfo.js +2 -2
  80. package/dist/cjs/lib/docgen/utils/index.js +2 -0
  81. package/dist/cjs/lib/index.js +2 -0
  82. package/dist/cjs/lib/jsdocParser.js +2 -2
  83. package/dist/cjs/lib/utils.js +6 -5
  84. package/dist/esm/blocks/ArgsTable.js +5 -3
  85. package/dist/esm/blocks/Canvas.js +5 -3
  86. package/dist/esm/blocks/DocsContainer.js +3 -2
  87. package/dist/esm/blocks/Heading.js +1 -1
  88. package/dist/esm/blocks/Meta.js +3 -2
  89. package/dist/esm/blocks/Primary.js +1 -0
  90. package/dist/esm/blocks/Source.js +1 -0
  91. package/dist/esm/blocks/SourceContainer.js +3 -2
  92. package/dist/esm/blocks/Stories.js +7 -0
  93. package/dist/esm/blocks/Story.js +4 -3
  94. package/dist/esm/blocks/Subheading.js +1 -1
  95. package/dist/esm/blocks/Title.js +1 -1
  96. package/dist/esm/blocks/enhanceSource.js +3 -3
  97. package/dist/esm/blocks/mdx.js +15 -8
  98. package/dist/esm/blocks/useStory.js +15 -15
  99. package/dist/esm/blocks/utils.js +1 -1
  100. package/dist/esm/frameworks/angular/compodoc.js +4 -4
  101. package/dist/esm/frameworks/angular/prepareForInline.js +1 -1
  102. package/dist/esm/frameworks/angular/sourceDecorator.js +1 -1
  103. package/dist/esm/frameworks/common/config.js +1 -1
  104. package/dist/esm/frameworks/common/preset.js +153 -109
  105. package/dist/esm/frameworks/ember/jsondoc.js +1 -0
  106. package/dist/esm/frameworks/html/sourceDecorator.js +2 -2
  107. package/dist/esm/frameworks/react/extractArgTypes.js +1 -0
  108. package/dist/esm/frameworks/react/extractProps.js +1 -1
  109. package/dist/esm/frameworks/react/jsxDecorator.js +5 -4
  110. package/dist/esm/frameworks/react/lib/defaultValues/createFromRawDefaultProp.js +3 -3
  111. package/dist/esm/frameworks/react/lib/generateCode.js +1 -1
  112. package/dist/esm/frameworks/react/lib/inspection/acornParser.js +2 -2
  113. package/dist/esm/frameworks/react/propTypes/createType.js +2 -1
  114. package/dist/esm/frameworks/react/propTypes/generateFuncSignature.js +1 -1
  115. package/dist/esm/frameworks/react/propTypes/sortProps.js +1 -0
  116. package/dist/esm/frameworks/react/react-argtypes.stories.js +4 -3
  117. package/dist/esm/frameworks/svelte/extractArgTypes.js +2 -0
  118. package/dist/esm/frameworks/svelte/prepareForInline.js +2 -3
  119. package/dist/esm/frameworks/svelte/preset.js +1 -1
  120. package/dist/esm/frameworks/svelte/sourceDecorator.js +4 -3
  121. package/dist/esm/frameworks/svelte/svelte-docgen-loader.js +1 -1
  122. package/dist/esm/frameworks/vue/extractArgTypes.js +4 -3
  123. package/dist/esm/frameworks/vue/preset.js +1 -0
  124. package/dist/esm/frameworks/vue/sourceDecorator.js +6 -6
  125. package/dist/esm/frameworks/vue3/extractArgTypes.js +1 -0
  126. package/dist/esm/frameworks/vue3/preset.js +1 -0
  127. package/dist/esm/frameworks/web-components/custom-elements.js +2 -1
  128. package/dist/esm/frameworks/web-components/prepareForInline.js +6 -6
  129. package/dist/esm/frameworks/web-components/sourceDecorator.js +1 -1
  130. package/dist/esm/lib/convert/flow/convert.js +2 -1
  131. package/dist/esm/lib/convert/proptypes/convert.js +1 -1
  132. package/dist/esm/lib/convert/typescript/convert.js +1 -0
  133. package/dist/esm/lib/convert/utils.js +1 -1
  134. package/dist/esm/lib/docgen/createPropDef.js +1 -0
  135. package/dist/esm/lib/docgen/extractDocgenProps.js +1 -0
  136. package/dist/esm/lib/docgen/flow/createType.js +1 -1
  137. package/dist/esm/lib/docgen/typeScript/createType.js +1 -1
  138. package/dist/esm/lib/docgen/utils/defaultValue.js +1 -0
  139. package/dist/esm/lib/jsdocParser.js +1 -1
  140. package/dist/esm/lib/utils.js +1 -1
  141. package/dist/modern/blocks/Canvas.js +3 -1
  142. package/dist/modern/blocks/Stories.js +5 -0
  143. package/dist/modern/blocks/mdx.js +12 -7
  144. package/dist/modern/frameworks/common/preset.js +10 -9
  145. package/dist/modern/frameworks/html/sourceDecorator.js +2 -2
  146. package/dist/modern/frameworks/react/jsxDecorator.js +3 -1
  147. package/dist/modern/frameworks/react/lib/inspection/acornParser.js +1 -2
  148. package/dist/modern/frameworks/svelte/extractArgTypes.js +1 -0
  149. package/dist/modern/frameworks/svelte/prepareForInline.js +2 -3
  150. package/dist/modern/frameworks/vue/extractArgTypes.js +1 -1
  151. package/dist/ts3.4/frameworks/angular/config.d.ts +0 -1
  152. package/dist/ts3.4/frameworks/common/config.d.ts +0 -1
  153. package/dist/ts3.4/frameworks/common/preset.d.ts +12 -1
  154. package/dist/ts3.4/frameworks/svelte/config.d.ts +0 -1
  155. package/dist/ts3.4/frameworks/vue/config.d.ts +0 -1
  156. package/dist/ts3.4/frameworks/vue3/config.d.ts +0 -1
  157. package/dist/ts3.4/frameworks/web-components/config.d.ts +0 -1
  158. package/dist/ts3.9/frameworks/angular/config.d.ts +0 -1
  159. package/dist/ts3.9/frameworks/common/config.d.ts +0 -1
  160. package/dist/ts3.9/frameworks/common/preset.d.ts +12 -1
  161. package/dist/ts3.9/frameworks/svelte/config.d.ts +0 -1
  162. package/dist/ts3.9/frameworks/vue/config.d.ts +0 -1
  163. package/dist/ts3.9/frameworks/vue3/config.d.ts +0 -1
  164. package/dist/ts3.9/frameworks/web-components/config.d.ts +0 -1
  165. package/package.json +36 -39
  166. package/register.js +1 -0
  167. package/{dist/cjs/frameworks/svelte → svelte}/HOC.svelte +0 -0
  168. package/dist/cjs/frameworks/svelte/sample/MockButton.svelte +0 -45
  169. package/dist/cjs/typings.d.js +0 -1
  170. package/dist/esm/frameworks/svelte/HOC.svelte +0 -7
  171. package/dist/esm/frameworks/svelte/sample/MockButton.svelte +0 -45
  172. package/dist/esm/typings.d.js +0 -0
  173. package/dist/modern/frameworks/svelte/HOC.svelte +0 -7
  174. package/dist/modern/frameworks/svelte/sample/MockButton.svelte +0 -45
  175. 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.function.name.js";
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 in Object(iter)) return Array.from(iter); }
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
- var webpackConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
65
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
66
- var _webpackConfig$module = webpackConfig.module,
67
- module = _webpackConfig$module === void 0 ? {} : _webpackConfig$module; // it will reuse babel options that are already in use in storybook
68
- // also, these babel options are chained with other presets.
69
-
70
- var babelOptions = options.babelOptions,
71
- mdxBabelOptions = options.mdxBabelOptions,
72
- _options$configureJSX = options.configureJSX,
73
- configureJSX = _options$configureJSX === void 0 ? true : _options$configureJSX,
74
- _options$sourceLoader = options.sourceLoaderOptions,
75
- sourceLoaderOptions = _options$sourceLoader === void 0 ? {
76
- injectStoryParameters: true
77
- } : _options$sourceLoader,
78
- _options$transcludeMa = options.transcludeMarkdown,
79
- transcludeMarkdown = _options$transcludeMa === void 0 ? false : _options$transcludeMa;
80
- var mdxLoaderOptions = {
81
- remarkPlugins: [remarkSlug, remarkExternalLinks]
82
- }; // set `sourceLoaderOptions` to `null` to disable for manual configuration
83
-
84
- var sourceLoader = sourceLoaderOptions ? [{
85
- test: /\.(stories|story)\.[tj]sx?$/,
86
- loader: require.resolve('@storybook/source-loader'),
87
- options: Object.assign({}, sourceLoaderOptions, {
88
- inspectLocalDependencies: true
89
- }),
90
- enforce: 'pre'
91
- }] : [];
92
- var rules = module.rules || [];
93
-
94
- if (transcludeMarkdown) {
95
- rules = [].concat(_toConsumableArray(rules.filter(function (rule) {
96
- var _rule$test;
97
-
98
- return ((_rule$test = rule.test) === null || _rule$test === void 0 ? void 0 : _rule$test.toString()) !== '/\\.md$/';
99
- })), [{
100
- test: /\.md$/,
101
- use: [{
102
- loader: resolvedBabelLoader,
103
- options: createBabelOptions({
104
- babelOptions: babelOptions,
105
- mdxBabelOptions: mdxBabelOptions,
106
- configureJSX: configureJSX
107
- })
108
- }, {
109
- loader: require.resolve('@mdx-js/loader'),
110
- options: mdxLoaderOptions
111
- }]
112
- }]);
113
- }
114
-
115
- var result = Object.assign({}, webpackConfig, {
116
- module: Object.assign({}, module, {
117
- rules: [].concat(_toConsumableArray(rules), [{
118
- test: /\.js$/,
119
- include: new RegExp("node_modules\\".concat(path.sep, "acorn-jsx")),
120
- use: [{
121
- loader: resolvedBabelLoader,
122
- options: {
123
- presets: [[require.resolve('@babel/preset-env'), {
124
- modules: 'commonjs'
125
- }]]
126
- }
127
- }]
128
- }, {
129
- test: /(stories|story)\.mdx$/,
130
- use: [{
131
- loader: resolvedBabelLoader,
132
- options: createBabelOptions({
133
- babelOptions: babelOptions,
134
- mdxBabelOptions: mdxBabelOptions,
135
- configureJSX: configureJSX
136
- })
137
- }, {
138
- loader: require.resolve('@mdx-js/loader'),
139
- options: Object.assign({
140
- compilers: [createCompiler(options)]
141
- }, mdxLoaderOptions)
142
- }]
143
- }, {
144
- test: /\.mdx$/,
145
- exclude: /(stories|story)\.mdx$/,
146
- use: [{
147
- loader: resolvedBabelLoader,
148
- options: createBabelOptions({
149
- babelOptions: babelOptions,
150
- mdxBabelOptions: mdxBabelOptions,
151
- configureJSX: configureJSX
152
- })
153
- }, {
154
- loader: require.resolve('@mdx-js/loader'),
155
- options: mdxLoaderOptions
156
- }]
157
- }], sourceLoader)
158
- })
159
- });
160
- return result;
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
  }
@@ -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/es.symbol.js";
4
5
  import "core-js/modules/es.symbol.description.js";
@@ -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
- source = story.outerHTML;
47
- }
46
+ source = story.outerHTML;
47
+ }
48
48
 
49
49
  if (source) source = applyTransformSource(source, context);
50
50
  }
@@ -1,3 +1,4 @@
1
+ import "core-js/modules/es.object.to-string.js";
1
2
  import "core-js/modules/es.function.name.js";
2
3
  import "core-js/modules/es.symbol.js";
3
4
  import "core-js/modules/es.symbol.description.js";
@@ -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 in Object(iter)) return Array.from(iter); }
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, ["mdxType", "originalType", "children"]);
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"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
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,9 +1,9 @@
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
- import jsx from 'acorn-jsx'; // eslint-disable-next-line import/no-extraneous-dependencies
6
-
6
+ import jsx from 'acorn-jsx';
7
7
  import * as acornWalk from 'acorn-walk';
8
8
  import { InspectionType } from './types';
9
9
  var ACORN_WALK_VISITORS = Object.assign({}, acornWalk.base, {
@@ -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,4 +1,5 @@
1
1
  import "core-js/modules/es.array.filter.js";
2
+ import "core-js/modules/es.object.to-string.js";
2
3
  import "core-js/modules/es.array.map.js";
3
4
  import "core-js/modules/es.object.keys.js";
4
5
  import "core-js/modules/es.array.find.js";
@@ -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) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_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
+ 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,5 @@
1
- import React from 'react'; // @ts-ignore
2
-
3
- import HOC from './HOC.svelte';
1
+ import React from 'react';
2
+ import HOC from '@storybook/addon-docs/svelte/HOC.svelte';
4
3
  export var prepareForInline = function prepareForInline(storyFn) {
5
4
  var el = React.useRef(null);
6
5
  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) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_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; }
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) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_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; }
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.
@@ -1,3 +1,4 @@
1
+ import "core-js/modules/es.object.to-string.js";
1
2
  import "core-js/modules/web.dom-collections.for-each.js";
2
3
  import "core-js/modules/es.array.includes.js";
3
4
  import "core-js/modules/es.string.includes.js";