@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.
Files changed (161) hide show
  1. package/angular/README.md +0 -6
  2. package/dist/cjs/blocks/Anchor.js +1 -1
  3. package/dist/cjs/blocks/ArgsTable.js +13 -9
  4. package/dist/cjs/blocks/Canvas.js +13 -11
  5. package/dist/cjs/blocks/Description.js +6 -6
  6. package/dist/cjs/blocks/DocsContainer.js +8 -6
  7. package/dist/cjs/blocks/Heading.js +2 -2
  8. package/dist/cjs/blocks/Meta.js +8 -6
  9. package/dist/cjs/blocks/Primary.js +7 -7
  10. package/dist/cjs/blocks/Source.js +8 -8
  11. package/dist/cjs/blocks/SourceContainer.js +9 -7
  12. package/dist/cjs/blocks/Stories.js +14 -7
  13. package/dist/cjs/blocks/Story.js +10 -8
  14. package/dist/cjs/blocks/Subheading.js +2 -2
  15. package/dist/cjs/blocks/Subtitle.js +5 -5
  16. package/dist/cjs/blocks/Title.js +8 -8
  17. package/dist/cjs/blocks/enhanceSource.js +5 -5
  18. package/dist/cjs/blocks/index.js +6 -4
  19. package/dist/cjs/blocks/mdx.js +17 -9
  20. package/dist/cjs/blocks/useStory.js +8 -6
  21. package/dist/cjs/blocks/utils.js +3 -3
  22. package/dist/cjs/frameworks/angular/compodoc.js +8 -8
  23. package/dist/cjs/frameworks/angular/config.js +1 -1
  24. package/dist/cjs/frameworks/angular/index.js +2 -0
  25. package/dist/cjs/frameworks/angular/prepareForInline.js +2 -2
  26. package/dist/cjs/frameworks/angular/sourceDecorator.js +7 -7
  27. package/dist/cjs/frameworks/common/config.js +8 -8
  28. package/dist/cjs/frameworks/common/preset.js +157 -111
  29. package/dist/cjs/frameworks/ember/jsondoc.js +3 -1
  30. package/dist/cjs/frameworks/html/sourceDecorator.js +2 -2
  31. package/dist/cjs/frameworks/react/config.js +1 -1
  32. package/dist/cjs/frameworks/react/extractArgTypes.js +2 -0
  33. package/dist/cjs/frameworks/react/extractProps.js +2 -2
  34. package/dist/cjs/frameworks/react/jsxDecorator.js +12 -10
  35. package/dist/cjs/frameworks/react/lib/captions.js +1 -1
  36. package/dist/cjs/frameworks/react/lib/componentTypes.js +1 -1
  37. package/dist/cjs/frameworks/react/lib/defaultValues/createFromRawDefaultProp.js +7 -7
  38. package/dist/cjs/frameworks/react/lib/defaultValues/index.js +2 -0
  39. package/dist/cjs/frameworks/react/lib/defaultValues/prettyIdentifier.js +2 -2
  40. package/dist/cjs/frameworks/react/lib/generateCode.js +3 -3
  41. package/dist/cjs/frameworks/react/lib/index.js +2 -0
  42. package/dist/cjs/frameworks/react/lib/inspection/acornParser.js +7 -7
  43. package/dist/cjs/frameworks/react/lib/inspection/index.js +2 -0
  44. package/dist/cjs/frameworks/react/propTypes/createType.js +4 -2
  45. package/dist/cjs/frameworks/react/propTypes/generateFuncSignature.js +2 -2
  46. package/dist/cjs/frameworks/react/propTypes/sortProps.js +2 -0
  47. package/dist/cjs/frameworks/react/react-argtypes.stories.js +10 -8
  48. package/dist/cjs/frameworks/svelte/config.js +1 -1
  49. package/dist/cjs/frameworks/svelte/extractArgTypes.js +4 -1
  50. package/dist/cjs/frameworks/svelte/prepareForInline.js +2 -2
  51. package/dist/cjs/frameworks/svelte/preset.js +2 -2
  52. package/dist/cjs/frameworks/svelte/sourceDecorator.js +7 -5
  53. package/dist/cjs/frameworks/svelte/svelte-docgen-loader.js +7 -7
  54. package/dist/cjs/frameworks/vue/config.js +1 -1
  55. package/dist/cjs/frameworks/vue/extractArgTypes.js +6 -4
  56. package/dist/cjs/frameworks/vue/preset.js +2 -0
  57. package/dist/cjs/frameworks/vue/sourceDecorator.js +12 -12
  58. package/dist/cjs/frameworks/vue3/extractArgTypes.js +2 -0
  59. package/dist/cjs/frameworks/vue3/prepareForInline.js +5 -5
  60. package/dist/cjs/frameworks/vue3/preset.js +2 -0
  61. package/dist/cjs/frameworks/web-components/custom-elements.js +5 -3
  62. package/dist/cjs/frameworks/web-components/prepareForInline.js +8 -8
  63. package/dist/cjs/frameworks/web-components/sourceDecorator.js +2 -2
  64. package/dist/cjs/index.js +2 -0
  65. package/dist/cjs/lib/convert/flow/convert.js +3 -1
  66. package/dist/cjs/lib/convert/flow/index.js +2 -0
  67. package/dist/cjs/lib/convert/proptypes/convert.js +2 -2
  68. package/dist/cjs/lib/convert/proptypes/index.js +2 -0
  69. package/dist/cjs/lib/convert/typescript/convert.js +2 -0
  70. package/dist/cjs/lib/convert/typescript/index.js +2 -0
  71. package/dist/cjs/lib/convert/utils.js +2 -2
  72. package/dist/cjs/lib/docgen/createPropDef.js +3 -1
  73. package/dist/cjs/lib/docgen/extractDocgenProps.js +3 -1
  74. package/dist/cjs/lib/docgen/flow/createType.js +2 -2
  75. package/dist/cjs/lib/docgen/index.js +2 -0
  76. package/dist/cjs/lib/docgen/typeScript/createType.js +2 -2
  77. package/dist/cjs/lib/docgen/utils/defaultValue.js +3 -0
  78. package/dist/cjs/lib/docgen/utils/docgenInfo.js +2 -2
  79. package/dist/cjs/lib/docgen/utils/index.js +2 -0
  80. package/dist/cjs/lib/index.js +2 -0
  81. package/dist/cjs/lib/jsdocParser.js +2 -2
  82. package/dist/cjs/lib/utils.js +6 -5
  83. package/dist/esm/blocks/ArgsTable.js +5 -3
  84. package/dist/esm/blocks/Canvas.js +5 -3
  85. package/dist/esm/blocks/DocsContainer.js +3 -2
  86. package/dist/esm/blocks/Heading.js +1 -1
  87. package/dist/esm/blocks/Meta.js +3 -2
  88. package/dist/esm/blocks/Primary.js +1 -0
  89. package/dist/esm/blocks/Source.js +1 -0
  90. package/dist/esm/blocks/SourceContainer.js +3 -2
  91. package/dist/esm/blocks/Stories.js +7 -0
  92. package/dist/esm/blocks/Story.js +4 -3
  93. package/dist/esm/blocks/Subheading.js +1 -1
  94. package/dist/esm/blocks/Title.js +1 -1
  95. package/dist/esm/blocks/enhanceSource.js +3 -3
  96. package/dist/esm/blocks/mdx.js +15 -8
  97. package/dist/esm/blocks/useStory.js +15 -15
  98. package/dist/esm/blocks/utils.js +1 -1
  99. package/dist/esm/frameworks/angular/compodoc.js +4 -4
  100. package/dist/esm/frameworks/angular/prepareForInline.js +1 -1
  101. package/dist/esm/frameworks/angular/sourceDecorator.js +1 -1
  102. package/dist/esm/frameworks/common/config.js +1 -1
  103. package/dist/esm/frameworks/common/preset.js +153 -109
  104. package/dist/esm/frameworks/ember/jsondoc.js +1 -0
  105. package/dist/esm/frameworks/html/sourceDecorator.js +2 -2
  106. package/dist/esm/frameworks/react/extractArgTypes.js +1 -0
  107. package/dist/esm/frameworks/react/extractProps.js +1 -1
  108. package/dist/esm/frameworks/react/jsxDecorator.js +5 -4
  109. package/dist/esm/frameworks/react/lib/defaultValues/createFromRawDefaultProp.js +3 -3
  110. package/dist/esm/frameworks/react/lib/generateCode.js +1 -1
  111. package/dist/esm/frameworks/react/lib/inspection/acornParser.js +1 -0
  112. package/dist/esm/frameworks/react/propTypes/createType.js +2 -1
  113. package/dist/esm/frameworks/react/propTypes/generateFuncSignature.js +1 -1
  114. package/dist/esm/frameworks/react/propTypes/sortProps.js +1 -0
  115. package/dist/esm/frameworks/react/react-argtypes.stories.js +4 -3
  116. package/dist/esm/frameworks/svelte/extractArgTypes.js +2 -0
  117. package/dist/esm/frameworks/svelte/prepareForInline.js +2 -2
  118. package/dist/esm/frameworks/svelte/preset.js +1 -1
  119. package/dist/esm/frameworks/svelte/sourceDecorator.js +4 -3
  120. package/dist/esm/frameworks/svelte/svelte-docgen-loader.js +1 -1
  121. package/dist/esm/frameworks/vue/extractArgTypes.js +4 -3
  122. package/dist/esm/frameworks/vue/preset.js +1 -0
  123. package/dist/esm/frameworks/vue/sourceDecorator.js +6 -6
  124. package/dist/esm/frameworks/vue3/extractArgTypes.js +1 -0
  125. package/dist/esm/frameworks/vue3/preset.js +1 -0
  126. package/dist/esm/frameworks/web-components/custom-elements.js +2 -1
  127. package/dist/esm/frameworks/web-components/prepareForInline.js +6 -6
  128. package/dist/esm/frameworks/web-components/sourceDecorator.js +1 -1
  129. package/dist/esm/lib/convert/flow/convert.js +2 -1
  130. package/dist/esm/lib/convert/proptypes/convert.js +1 -1
  131. package/dist/esm/lib/convert/typescript/convert.js +1 -0
  132. package/dist/esm/lib/convert/utils.js +1 -1
  133. package/dist/esm/lib/docgen/createPropDef.js +1 -0
  134. package/dist/esm/lib/docgen/extractDocgenProps.js +1 -0
  135. package/dist/esm/lib/docgen/flow/createType.js +1 -1
  136. package/dist/esm/lib/docgen/typeScript/createType.js +1 -1
  137. package/dist/esm/lib/docgen/utils/defaultValue.js +1 -0
  138. package/dist/esm/lib/jsdocParser.js +1 -1
  139. package/dist/esm/lib/utils.js +1 -1
  140. package/dist/modern/blocks/Canvas.js +3 -1
  141. package/dist/modern/blocks/Stories.js +5 -0
  142. package/dist/modern/blocks/mdx.js +12 -7
  143. package/dist/modern/frameworks/common/preset.js +10 -9
  144. package/dist/modern/frameworks/html/sourceDecorator.js +2 -2
  145. package/dist/modern/frameworks/react/jsxDecorator.js +3 -1
  146. package/dist/modern/frameworks/svelte/extractArgTypes.js +1 -0
  147. package/dist/modern/frameworks/svelte/prepareForInline.js +2 -2
  148. package/dist/modern/frameworks/vue/extractArgTypes.js +1 -1
  149. package/dist/ts3.4/frameworks/common/preset.d.ts +12 -1
  150. package/dist/ts3.9/frameworks/common/preset.d.ts +12 -1
  151. package/package.json +31 -30
  152. package/register.js +1 -0
  153. package/{dist/cjs/frameworks/svelte → svelte}/HOC.svelte +0 -0
  154. package/dist/cjs/frameworks/svelte/sample/MockButton.svelte +0 -45
  155. package/dist/cjs/typings.d.js +0 -1
  156. package/dist/esm/frameworks/svelte/HOC.svelte +0 -7
  157. package/dist/esm/frameworks/svelte/sample/MockButton.svelte +0 -45
  158. package/dist/esm/typings.d.js +0 -0
  159. package/dist/modern/frameworks/svelte/HOC.svelte +0 -7
  160. package/dist/modern/frameworks/svelte/sample/MockButton.svelte +0 -45
  161. 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
 
@@ -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,6 @@
1
- import React from 'react'; // @ts-ignore
1
+ import React from 'react'; // eslint-disable-next-line import/no-extraneous-dependencies
2
2
 
3
- import HOC from './HOC.svelte';
3
+ import HOC from '@storybook/addon-docs/svelte/HOC.svelte';
4
4
  export const prepareForInline = storyFn => {
5
5
  const el = React.useRef(null);
6
6
  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 +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 +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 {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/addon-docs",
3
- "version": "6.5.0-alpha.3",
3
+ "version": "6.5.0-alpha.30",
4
4
  "description": "Document component usage and properties in Markdown",
5
5
  "keywords": [
6
6
  "addon",
@@ -40,6 +40,7 @@
40
40
  "common/**/*",
41
41
  "ember/**/*",
42
42
  "html/**/*",
43
+ "svelte/**/*",
43
44
  "postinstall/**/*",
44
45
  "react/**/*",
45
46
  "vue/**/*",
@@ -63,21 +64,21 @@
63
64
  "@mdx-js/loader": "^1.6.22",
64
65
  "@mdx-js/mdx": "^1.6.22",
65
66
  "@mdx-js/react": "^1.6.22",
66
- "@storybook/addons": "6.5.0-alpha.3",
67
- "@storybook/api": "6.5.0-alpha.3",
68
- "@storybook/builder-webpack4": "6.5.0-alpha.3",
69
- "@storybook/client-logger": "6.5.0-alpha.3",
70
- "@storybook/components": "6.5.0-alpha.3",
71
- "@storybook/core": "6.5.0-alpha.3",
72
- "@storybook/core-events": "6.5.0-alpha.3",
67
+ "@storybook/addons": "6.5.0-alpha.30",
68
+ "@storybook/api": "6.5.0-alpha.30",
69
+ "@storybook/builder-webpack4": "6.5.0-alpha.30",
70
+ "@storybook/client-logger": "6.5.0-alpha.30",
71
+ "@storybook/components": "6.5.0-alpha.30",
72
+ "@storybook/core": "6.5.0-alpha.30",
73
+ "@storybook/core-events": "6.5.0-alpha.30",
73
74
  "@storybook/csf": "0.0.2--canary.87bc651.0",
74
- "@storybook/csf-tools": "6.5.0-alpha.3",
75
- "@storybook/node-logger": "6.5.0-alpha.3",
76
- "@storybook/postinstall": "6.5.0-alpha.3",
77
- "@storybook/preview-web": "6.5.0-alpha.3",
78
- "@storybook/source-loader": "6.5.0-alpha.3",
79
- "@storybook/store": "6.5.0-alpha.3",
80
- "@storybook/theming": "6.5.0-alpha.3",
75
+ "@storybook/csf-tools": "6.5.0-alpha.30",
76
+ "@storybook/node-logger": "6.5.0-alpha.30",
77
+ "@storybook/postinstall": "6.5.0-alpha.30",
78
+ "@storybook/preview-web": "6.5.0-alpha.30",
79
+ "@storybook/source-loader": "6.5.0-alpha.30",
80
+ "@storybook/store": "6.5.0-alpha.30",
81
+ "@storybook/theming": "6.5.0-alpha.30",
81
82
  "acorn": "^7.4.1",
82
83
  "acorn-jsx": "^5.3.1",
83
84
  "acorn-walk": "^7.2.0",
@@ -92,7 +93,7 @@
92
93
  "lodash": "^4.17.21",
93
94
  "nanoid": "^3.1.23",
94
95
  "p-limit": "^3.1.0",
95
- "prettier": "^2.2.1",
96
+ "prettier": ">=2.2.1 <=2.3.0",
96
97
  "prop-types": "^15.7.2",
97
98
  "react-element-to-jsx-string": "^14.3.4",
98
99
  "regenerator-runtime": "^0.13.7",
@@ -104,13 +105,13 @@
104
105
  "devDependencies": {
105
106
  "@angular/core": "^11.2.14",
106
107
  "@babel/core": "^7.12.10",
107
- "@emotion/core": "^10.1.1",
108
+ "@emotion/core": "^10.3.1",
108
109
  "@emotion/styled": "^10.0.27",
109
- "@storybook/angular": "6.5.0-alpha.3",
110
- "@storybook/html": "6.5.0-alpha.3",
111
- "@storybook/react": "6.5.0-alpha.3",
112
- "@storybook/vue": "6.5.0-alpha.3",
113
- "@storybook/web-components": "6.5.0-alpha.3",
110
+ "@storybook/angular": "6.5.0-alpha.30",
111
+ "@storybook/html": "6.5.0-alpha.30",
112
+ "@storybook/react": "6.5.0-alpha.30",
113
+ "@storybook/vue": "6.5.0-alpha.30",
114
+ "@storybook/web-components": "6.5.0-alpha.30",
114
115
  "@types/cross-spawn": "^6.0.2",
115
116
  "@types/doctrine": "^0.0.3",
116
117
  "@types/enzyme": "^3.10.8",
@@ -131,7 +132,7 @@
131
132
  "require-from-string": "^2.0.2",
132
133
  "rxjs": "^6.6.3",
133
134
  "styled-components": "^5.2.1",
134
- "terser-webpack-plugin": "^5.0.3",
135
+ "sveltedoc-parser": "4.1.0",
135
136
  "tmp": "^0.2.1",
136
137
  "tslib": "^2.1.0",
137
138
  "vue": "^2.6.10",
@@ -140,12 +141,12 @@
140
141
  "zone.js": "^0.11.3"
141
142
  },
142
143
  "peerDependencies": {
143
- "@storybook/angular": "6.5.0-alpha.3",
144
- "@storybook/html": "6.5.0-alpha.3",
145
- "@storybook/react": "6.5.0-alpha.3",
146
- "@storybook/vue": "6.5.0-alpha.3",
147
- "@storybook/vue3": "6.5.0-alpha.3",
148
- "@storybook/web-components": "6.5.0-alpha.3",
144
+ "@storybook/angular": "6.5.0-alpha.30",
145
+ "@storybook/html": "6.5.0-alpha.30",
146
+ "@storybook/react": "6.5.0-alpha.30",
147
+ "@storybook/vue": "6.5.0-alpha.30",
148
+ "@storybook/vue3": "6.5.0-alpha.30",
149
+ "@storybook/web-components": "6.5.0-alpha.30",
149
150
  "lit": "^2.0.0",
150
151
  "lit-html": "^1.4.1 || ^2.0.0",
151
152
  "react": "^16.8.0 || ^17.0.0",
@@ -202,7 +203,7 @@
202
203
  "publishConfig": {
203
204
  "access": "public"
204
205
  },
205
- "gitHead": "4d971f7d493ecb388017a150a9943e87c7770d98",
206
+ "gitHead": "4dc5ec5956f3a8cfb07e3c4b3442fb3f6ac95662",
206
207
  "sbmodern": "dist/modern/index.js",
207
208
  "storybook": {
208
209
  "displayName": "Docs",
package/register.js CHANGED
@@ -1 +1,2 @@
1
+ /* eslint-disable import/extensions */
1
2
  require('./dist/esm/register.js');
@@ -1,45 +0,0 @@
1
- <script>
2
- import { createEventDispatcher, afterUpdate } from 'svelte';
3
- export let text = '';
4
- export let rounded = true;
5
-
6
- const dispatch = createEventDispatcher();
7
-
8
- function onClick(event) {
9
- rounded = !rounded;
10
-
11
- /**
12
- * Click Event
13
- */
14
- dispatch('click', event);
15
- }
16
-
17
- afterUpdate(() => {
18
- /**
19
- * After Update
20
- */
21
- dispatch('afterUpdate');
22
- });
23
- </script>
24
-
25
- <style>
26
- .rounded {
27
- border-radius: 35px;
28
- }
29
-
30
- .button {
31
- border: 3px solid;
32
- padding: 10px 20px;
33
- background-color: white;
34
- outline: none;
35
- }
36
- </style>
37
-
38
- <svelte:options accessors={true} />
39
- <button class="button" class:rounded on:click={onClick}>
40
- <strong>{rounded ? 'Round' : 'Square'} corners</strong>
41
- <br />
42
- {text}
43
- <!-- Default Slot -->
44
- <slot {rounded}/>
45
- </button>
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,7 +0,0 @@
1
- <script>
2
- export let storyFn;
3
-
4
- let { Component: component, props } = storyFn();
5
- </script>
6
-
7
- <svelte:component this={component} {...props}/>