@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,10 +1,10 @@
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
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
4
 
5
5
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
6
6
 
7
- 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; }
7
+ 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; }
8
8
 
9
9
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
10
10
 
@@ -14,31 +14,31 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
14
14
 
15
15
  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); }
16
16
 
17
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
17
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
18
18
 
19
19
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
20
20
 
21
21
  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
22
 
23
23
  import "regenerator-runtime/runtime.js";
24
- import "core-js/modules/es.promise.js";
25
24
  import "core-js/modules/es.object.to-string.js";
25
+ import "core-js/modules/es.promise.js";
26
26
  import "core-js/modules/es.array.join.js";
27
27
  import "core-js/modules/es.array.filter.js";
28
28
  import "core-js/modules/es.array.map.js";
29
29
  import "core-js/modules/es.array.concat.js";
30
30
  import "core-js/modules/es.object.entries.js";
31
31
  import "core-js/modules/es.array.find-index.js";
32
- import "core-js/modules/es.string.replace.js";
33
32
  import "core-js/modules/es.regexp.exec.js";
33
+ import "core-js/modules/es.string.replace.js";
34
34
  import "core-js/modules/es.string.split.js";
35
35
  import "core-js/modules/es.array.includes.js";
36
36
  import "core-js/modules/es.string.includes.js";
37
37
  import "core-js/modules/es.symbol.js";
38
38
  import "core-js/modules/es.symbol.description.js";
39
39
  import "core-js/modules/es.symbol.iterator.js";
40
- import "core-js/modules/es.string.iterator.js";
41
40
  import "core-js/modules/es.array.iterator.js";
41
+ import "core-js/modules/es.string.iterator.js";
42
42
  import "core-js/modules/web.dom-collections.iterator.js";
43
43
  import "core-js/modules/es.array.from.js";
44
44
  import "core-js/modules/es.array.slice.js";
@@ -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.function.name.js";
3
4
  import "core-js/modules/es.symbol.js";
@@ -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";
@@ -1,10 +1,11 @@
1
+ import "core-js/modules/es.object.to-string.js";
1
2
  import "core-js/modules/es.array.filter.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";
5
6
  import "core-js/modules/es.symbol.description.js";
6
- import "core-js/modules/es.string.replace.js";
7
7
  import "core-js/modules/es.regexp.exec.js";
8
+ import "core-js/modules/es.string.replace.js";
8
9
  import "core-js/modules/es.array.find.js";
9
10
  import "core-js/modules/es.object.assign.js";
10
11
  import { getCustomElements, isValidComponent, isValidMetaData } from '@storybook/web-components';
@@ -1,29 +1,29 @@
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.array.concat.js";
4
4
  import "core-js/modules/es.object.get-prototype-of.js";
5
+ import "core-js/modules/es.object.to-string.js";
5
6
  import "core-js/modules/es.reflect.construct.js";
6
7
  import "core-js/modules/es.symbol.js";
7
8
  import "core-js/modules/es.symbol.description.js";
8
- import "core-js/modules/es.object.to-string.js";
9
9
  import "core-js/modules/es.symbol.iterator.js";
10
- import "core-js/modules/es.string.iterator.js";
11
10
  import "core-js/modules/es.array.iterator.js";
11
+ import "core-js/modules/es.string.iterator.js";
12
12
  import "core-js/modules/web.dom-collections.iterator.js";
13
13
 
14
14
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
15
15
 
16
16
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
17
17
 
18
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
18
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
19
19
 
20
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
20
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
21
21
 
22
22
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
23
23
 
24
24
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
25
25
 
26
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
26
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
27
27
 
28
28
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
29
29
 
@@ -1,5 +1,5 @@
1
- import "core-js/modules/es.string.replace.js";
2
1
  import "core-js/modules/es.regexp.exec.js";
2
+ import "core-js/modules/es.string.replace.js";
3
3
 
4
4
  /* global window */
5
5
  import { render } from 'lit-html';
@@ -1,6 +1,7 @@
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
+ import "core-js/modules/es.object.to-string.js";
4
5
  import "core-js/modules/web.dom-collections.for-each.js";
5
6
  import "core-js/modules/es.object.assign.js";
6
7
  import "core-js/modules/es.array.map.js";
@@ -1,8 +1,8 @@
1
1
  import "core-js/modules/es.function.name.js";
2
2
  import "core-js/modules/es.array.map.js";
3
3
  import "core-js/modules/es.object.assign.js";
4
- import "core-js/modules/es.string.split.js";
5
4
  import "core-js/modules/es.regexp.exec.js";
5
+ import "core-js/modules/es.string.split.js";
6
6
  import "core-js/modules/es.array.concat.js";
7
7
 
8
8
  /* eslint-disable no-case-declarations */
@@ -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.function.name.js";
3
4
  import "core-js/modules/es.object.assign.js";
@@ -1,5 +1,5 @@
1
- import "core-js/modules/es.string.replace.js";
2
1
  import "core-js/modules/es.regexp.exec.js";
2
+ import "core-js/modules/es.string.replace.js";
3
3
  var QUOTE_REGEX = /^['"]|['"]$/g;
4
4
  export var trimQuotes = function trimQuotes(str) {
5
5
  return str.replace(QUOTE_REGEX, '');
@@ -1,4 +1,5 @@
1
1
  import "core-js/modules/es.function.name.js";
2
+ import "core-js/modules/es.object.to-string.js";
2
3
  import "core-js/modules/es.symbol.js";
3
4
  import "core-js/modules/es.symbol.description.js";
4
5
  import "core-js/modules/es.array.map.js";
@@ -3,6 +3,7 @@ import "core-js/modules/es.object.assign.js";
3
3
  import "core-js/modules/es.function.name.js";
4
4
  import "core-js/modules/es.object.keys.js";
5
5
  import "core-js/modules/es.array.filter.js";
6
+ import "core-js/modules/es.object.to-string.js";
6
7
  import "core-js/modules/es.symbol.js";
7
8
  import "core-js/modules/es.symbol.description.js";
8
9
  import { parseJsDoc } from '../jsdocParser';
@@ -1,8 +1,8 @@
1
1
  import "core-js/modules/es.function.name.js";
2
2
  import "core-js/modules/es.array.join.js";
3
3
  import "core-js/modules/es.array.map.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 { createSummaryValue, isTooLongForTypeSummary } from '../../utils';
7
7
  var FlowTypesType;
8
8
 
@@ -1,5 +1,5 @@
1
- import "core-js/modules/es.string.replace.js";
2
1
  import "core-js/modules/es.regexp.exec.js";
2
+ import "core-js/modules/es.string.replace.js";
3
3
  import "core-js/modules/es.function.name.js";
4
4
  import { createSummaryValue } from '../../utils';
5
5
  export function createType(_ref) {
@@ -1,3 +1,4 @@
1
+ import "core-js/modules/es.object.to-string.js";
1
2
  var BLACKLIST = ['null', 'undefined'];
2
3
  export function isDefaultValueBlacklisted(value) {
3
4
  return BLACKLIST.some(function (x) {
@@ -3,8 +3,8 @@ import "core-js/modules/es.string.includes.js";
3
3
  import "core-js/modules/es.symbol.js";
4
4
  import "core-js/modules/es.symbol.description.js";
5
5
  import "core-js/modules/es.function.name.js";
6
- import "core-js/modules/es.string.replace.js";
7
6
  import "core-js/modules/es.regexp.exec.js";
7
+ import "core-js/modules/es.string.replace.js";
8
8
  import "core-js/modules/es.array.map.js";
9
9
  import "core-js/modules/es.array.concat.js";
10
10
  import "core-js/modules/es.array.join.js";
@@ -1,5 +1,5 @@
1
- import "core-js/modules/es.string.replace.js";
2
1
  import "core-js/modules/es.regexp.exec.js";
2
+ import "core-js/modules/es.string.replace.js";
3
3
  export var MAX_TYPE_SUMMARY_LENGTH = 90;
4
4
  export var MAX_DEFAULT_VALUE_SUMMARY_LENGTH = 50;
5
5
  export function isTooLongForTypeSummary(value) {
@@ -1,3 +1,5 @@
1
+ const _excluded = ["withSource", "mdxSource", "children"];
2
+
1
3
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
2
4
 
3
5
  import React, { useContext } from 'react';
@@ -16,7 +18,7 @@ const getPreviewProps = (_ref, docsContext, sourceContext) => {
16
18
  mdxSource,
17
19
  children
18
20
  } = _ref,
19
- props = _objectWithoutPropertiesLoose(_ref, ["withSource", "mdxSource", "children"]);
21
+ props = _objectWithoutPropertiesLoose(_ref, _excluded);
20
22
 
21
23
  const {
22
24
  mdxComponentAnnotations,
@@ -12,6 +12,11 @@ export const Stories = ({
12
12
  componentStories
13
13
  } = useContext(DocsContext);
14
14
  let stories = componentStories();
15
+ stories = stories.filter(story => {
16
+ var _story$parameters, _story$parameters$doc;
17
+
18
+ return !((_story$parameters = story.parameters) !== null && _story$parameters !== void 0 && (_story$parameters$doc = _story$parameters.docs) !== null && _story$parameters$doc !== void 0 && _story$parameters$doc.disable);
19
+ });
15
20
  if (!includePrimary) stories = stories.slice(1);
16
21
 
17
22
  if (!stories || stories.length === 0) {
@@ -1,3 +1,8 @@
1
+ const _excluded = ["children"],
2
+ _excluded2 = ["className", "children"],
3
+ _excluded3 = ["href", "target", "children"],
4
+ _excluded4 = ["as", "id", "children"],
5
+ _excluded5 = ["as", "id", "children"];
1
6
  import "core-js/modules/es.array.reduce.js";
2
7
 
3
8
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
@@ -27,19 +32,19 @@ export const AddContext = props => {
27
32
  const {
28
33
  children
29
34
  } = props,
30
- rest = _objectWithoutPropertiesLoose(props, ["children"]);
35
+ rest = _objectWithoutPropertiesLoose(props, _excluded);
31
36
 
32
37
  const parentContext = React.useContext(DocsContext);
33
38
  return /*#__PURE__*/React.createElement(DocsContext.Provider, {
34
39
  value: Object.assign({}, parentContext, rest)
35
40
  }, children);
36
41
  };
37
- export const CodeOrSourceMdx = (_ref) => {
42
+ export const CodeOrSourceMdx = _ref => {
38
43
  let {
39
44
  className,
40
45
  children
41
46
  } = _ref,
42
- rest = _objectWithoutPropertiesLoose(_ref, ["className", "children"]);
47
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded2);
43
48
 
44
49
  // markdown-to-jsx does not add className to inline code
45
50
  if (typeof className !== 'string' && (typeof children !== 'string' || !children.match(/[\n\r]/g))) {
@@ -84,7 +89,7 @@ export const AnchorMdx = props => {
84
89
  target,
85
90
  children
86
91
  } = props,
87
- rest = _objectWithoutPropertiesLoose(props, ["href", "target", "children"]);
92
+ rest = _objectWithoutPropertiesLoose(props, _excluded3);
88
93
 
89
94
  if (href) {
90
95
  // Enable scrolling for in-page anchors.
@@ -132,13 +137,13 @@ const OcticonAnchor = styled.a(() => ({
132
137
  color: 'inherit'
133
138
  }));
134
139
 
135
- const HeaderWithOcticonAnchor = (_ref2) => {
140
+ const HeaderWithOcticonAnchor = _ref2 => {
136
141
  let {
137
142
  as,
138
143
  id,
139
144
  children
140
145
  } = _ref2,
141
- rest = _objectWithoutPropertiesLoose(_ref2, ["as", "id", "children"]);
146
+ rest = _objectWithoutPropertiesLoose(_ref2, _excluded4);
142
147
 
143
148
  // @ts-ignore
144
149
  const OcticonHeader = OcticonHeaders[as];
@@ -176,7 +181,7 @@ export const HeaderMdx = props => {
176
181
  id,
177
182
  children
178
183
  } = props,
179
- rest = _objectWithoutPropertiesLoose(props, ["as", "id", "children"]); // An id should have been added on every header by the "remark-slug" plugin.
184
+ rest = _objectWithoutPropertiesLoose(props, _excluded5); // An id should have been added on every header by the "remark-slug" plugin.
180
185
 
181
186
 
182
187
  if (id) {
@@ -4,14 +4,6 @@ import remarkExternalLinks from 'remark-external-links'; // @ts-ignore
4
4
 
5
5
  import { createCompiler } from '@storybook/csf-tools/mdx';
6
6
 
7
- const resolvedBabelLoader = require.resolve('babel-loader', {
8
- paths: [require.resolve('@storybook/builder-webpack4')] // FIXME!!!
9
-
10
- }); // for frameworks that are not working with react, we need to configure
11
- // the jsx to transpile mdx, for now there will be a flag for that
12
- // for more complex solutions we can find alone that we need to add '@babel/plugin-transform-react-jsx'
13
-
14
-
15
7
  function createBabelOptions({
16
8
  babelOptions,
17
9
  mdxBabelOptions,
@@ -32,7 +24,16 @@ function createBabelOptions({
32
24
  });
33
25
  }
34
26
 
35
- export function webpack(webpackConfig = {}, options = {}) {
27
+ export async function webpack(webpackConfig = {}, options) {
28
+ const {
29
+ builder = 'webpack4'
30
+ } = await options.presets.apply('core', {});
31
+ const builderName = typeof builder === 'string' ? builder : builder.name;
32
+
33
+ const resolvedBabelLoader = require.resolve('babel-loader', {
34
+ paths: builderName.match(/(webpack4|webpack5)/) ? [require.resolve(`@storybook/builder-${builder}`)] : [builderName]
35
+ });
36
+
36
37
  const {
37
38
  module = {}
38
39
  } = webpackConfig; // it will reuse babel options that are already in use in storybook
@@ -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,5 @@
1
+ const _excluded = ["mdxType", "originalType", "children"];
2
+
1
3
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
2
4
 
3
5
  import React, { createElement } from 'react';
@@ -134,7 +136,7 @@ const mdxToJsx = node => {
134
136
  originalType,
135
137
  children
136
138
  } = _node$props2,
137
- rest = _objectWithoutPropertiesLoose(_node$props2, ["mdxType", "originalType", "children"]);
139
+ rest = _objectWithoutPropertiesLoose(_node$props2, _excluded);
138
140
 
139
141
  let jsxChildren = [];
140
142
 
@@ -1,6 +1,5 @@
1
1
  import { Parser } from 'acorn';
2
- import jsx from 'acorn-jsx'; // eslint-disable-next-line import/no-extraneous-dependencies
3
-
2
+ import jsx from 'acorn-jsx';
4
3
  import * as acornWalk from 'acorn-walk';
5
4
  import { InspectionType } from './types';
6
5
  const ACORN_WALK_VISITORS = Object.assign({}, acornWalk.base, {
@@ -106,6 +106,7 @@ const parseTypeToControl = type => {
106
106
  };
107
107
  }
108
108
  } else if (type.kind === 'union') {
109
+ // @ts-ignore TODO: fix, this seems like a broke in package update
109
110
  if (Array.isArray(type.type) && !type.type.find(t => t.type !== 'string')) {
110
111
  return {
111
112
  type: 'radio',
@@ -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 const prepareForInline = storyFn => {
5
4
  const el = React.useRef(null);
6
5
  React.useEffect(() => {
@@ -1,6 +1,6 @@
1
1
  import { hasDocgen, extractComponentProps } from '../../lib/docgen';
2
2
  import { convert } from '../../lib/convert';
3
- const SECTIONS = ['props', 'events', 'slots'];
3
+ const SECTIONS = ['props', 'events', 'slots', 'methods'];
4
4
  /**
5
5
  * Check if "@values" tag is defined within docgenInfo.
6
6
  * If true, then propDef is mutated.
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SourceType } from '../../shared';
3
2
  export declare const parameters: {
4
3
  docs: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const parameters: {
3
2
  docs: {
4
3
  inlineStories: boolean;
@@ -1 +1,12 @@
1
- export declare function webpack(webpackConfig?: any, options?: any): any;
1
+ import { createCompiler } from '@storybook/csf-tools/mdx';
2
+ import { Options } from '@storybook/core-common';
3
+ declare type BabelParams = {
4
+ babelOptions?: any;
5
+ mdxBabelOptions?: any;
6
+ configureJSX?: boolean;
7
+ };
8
+ export declare function webpack(webpackConfig: any, options: Options & BabelParams & {
9
+ sourceLoaderOptions: any;
10
+ transcludeMarkdown: boolean;
11
+ } & Parameters<typeof createCompiler>[0]): Promise<any>;
12
+ export {};
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { extractComponentDescription } from './extractComponentDescription';
3
2
  export declare const parameters: {
4
3
  docs: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { extractComponentDescription } from '../../lib/docgen';
3
2
  export declare const parameters: {
4
3
  docs: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { extractComponentDescription } from '../../lib/docgen';
3
2
  export declare const parameters: {
4
3
  docs: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { sourceDecorator } from './sourceDecorator';
3
2
  import { SourceType } from '../../shared';
4
3
  export declare const decorators: (typeof sourceDecorator)[];
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SourceType } from '../../shared';
3
2
  export declare const parameters: {
4
3
  docs: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const parameters: {
3
2
  docs: {
4
3
  inlineStories: boolean;
@@ -1 +1,12 @@
1
- export declare function webpack(webpackConfig?: any, options?: any): any;
1
+ import { createCompiler } from '@storybook/csf-tools/mdx';
2
+ import type { Options } from '@storybook/core-common';
3
+ declare type BabelParams = {
4
+ babelOptions?: any;
5
+ mdxBabelOptions?: any;
6
+ configureJSX?: boolean;
7
+ };
8
+ export declare function webpack(webpackConfig: any, options: Options & BabelParams & {
9
+ sourceLoaderOptions: any;
10
+ transcludeMarkdown: boolean;
11
+ } & Parameters<typeof createCompiler>[0]): Promise<any>;
12
+ export {};
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { extractComponentDescription } from './extractComponentDescription';
3
2
  export declare const parameters: {
4
3
  docs: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { extractComponentDescription } from '../../lib/docgen';
3
2
  export declare const parameters: {
4
3
  docs: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { extractComponentDescription } from '../../lib/docgen';
3
2
  export declare const parameters: {
4
3
  docs: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { sourceDecorator } from './sourceDecorator';
3
2
  import { SourceType } from '../../shared';
4
3
  export declare const decorators: (typeof sourceDecorator)[];