@storybook/addon-docs 6.5.0-alpha.21 → 6.5.0-alpha.25

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 (156) hide show
  1. package/dist/cjs/blocks/Anchor.js +1 -1
  2. package/dist/cjs/blocks/ArgsTable.js +13 -9
  3. package/dist/cjs/blocks/Canvas.js +13 -11
  4. package/dist/cjs/blocks/Description.js +6 -6
  5. package/dist/cjs/blocks/DocsContainer.js +8 -6
  6. package/dist/cjs/blocks/Heading.js +2 -2
  7. package/dist/cjs/blocks/Meta.js +8 -6
  8. package/dist/cjs/blocks/Primary.js +7 -7
  9. package/dist/cjs/blocks/Source.js +8 -8
  10. package/dist/cjs/blocks/SourceContainer.js +9 -7
  11. package/dist/cjs/blocks/Stories.js +7 -7
  12. package/dist/cjs/blocks/Story.js +10 -8
  13. package/dist/cjs/blocks/Subheading.js +2 -2
  14. package/dist/cjs/blocks/Subtitle.js +5 -5
  15. package/dist/cjs/blocks/Title.js +8 -8
  16. package/dist/cjs/blocks/enhanceSource.js +5 -5
  17. package/dist/cjs/blocks/index.js +6 -4
  18. package/dist/cjs/blocks/mdx.js +17 -9
  19. package/dist/cjs/blocks/useStory.js +8 -6
  20. package/dist/cjs/blocks/utils.js +3 -3
  21. package/dist/cjs/frameworks/angular/compodoc.js +8 -8
  22. package/dist/cjs/frameworks/angular/config.js +1 -1
  23. package/dist/cjs/frameworks/angular/index.js +2 -0
  24. package/dist/cjs/frameworks/angular/prepareForInline.js +2 -2
  25. package/dist/cjs/frameworks/angular/sourceDecorator.js +7 -7
  26. package/dist/cjs/frameworks/common/config.js +8 -8
  27. package/dist/cjs/frameworks/common/preset.js +10 -8
  28. package/dist/cjs/frameworks/ember/jsondoc.js +3 -1
  29. package/dist/cjs/frameworks/html/sourceDecorator.js +2 -2
  30. package/dist/cjs/frameworks/react/config.js +1 -1
  31. package/dist/cjs/frameworks/react/extractArgTypes.js +2 -0
  32. package/dist/cjs/frameworks/react/extractProps.js +2 -2
  33. package/dist/cjs/frameworks/react/jsxDecorator.js +12 -10
  34. package/dist/cjs/frameworks/react/lib/captions.js +1 -1
  35. package/dist/cjs/frameworks/react/lib/componentTypes.js +1 -1
  36. package/dist/cjs/frameworks/react/lib/defaultValues/createFromRawDefaultProp.js +7 -7
  37. package/dist/cjs/frameworks/react/lib/defaultValues/index.js +2 -0
  38. package/dist/cjs/frameworks/react/lib/defaultValues/prettyIdentifier.js +2 -2
  39. package/dist/cjs/frameworks/react/lib/generateCode.js +3 -3
  40. package/dist/cjs/frameworks/react/lib/index.js +2 -0
  41. package/dist/cjs/frameworks/react/lib/inspection/acornParser.js +7 -7
  42. package/dist/cjs/frameworks/react/lib/inspection/index.js +2 -0
  43. package/dist/cjs/frameworks/react/propTypes/createType.js +4 -2
  44. package/dist/cjs/frameworks/react/propTypes/generateFuncSignature.js +2 -2
  45. package/dist/cjs/frameworks/react/propTypes/sortProps.js +2 -0
  46. package/dist/cjs/frameworks/react/react-argtypes.stories.js +10 -8
  47. package/dist/cjs/frameworks/svelte/config.js +1 -1
  48. package/dist/cjs/frameworks/svelte/extractArgTypes.js +4 -1
  49. package/dist/cjs/frameworks/svelte/prepareForInline.js +2 -2
  50. package/dist/cjs/frameworks/svelte/preset.js +2 -2
  51. package/dist/cjs/frameworks/svelte/sourceDecorator.js +7 -5
  52. package/dist/cjs/frameworks/svelte/svelte-docgen-loader.js +7 -7
  53. package/dist/cjs/frameworks/vue/config.js +1 -1
  54. package/dist/cjs/frameworks/vue/extractArgTypes.js +5 -3
  55. package/dist/cjs/frameworks/vue/preset.js +2 -0
  56. package/dist/cjs/frameworks/vue/sourceDecorator.js +12 -12
  57. package/dist/cjs/frameworks/vue3/extractArgTypes.js +2 -0
  58. package/dist/cjs/frameworks/vue3/prepareForInline.js +5 -5
  59. package/dist/cjs/frameworks/vue3/preset.js +2 -0
  60. package/dist/cjs/frameworks/web-components/custom-elements.js +5 -3
  61. package/dist/cjs/frameworks/web-components/prepareForInline.js +8 -8
  62. package/dist/cjs/frameworks/web-components/sourceDecorator.js +2 -2
  63. package/dist/cjs/index.js +2 -0
  64. package/dist/cjs/lib/convert/flow/convert.js +3 -1
  65. package/dist/cjs/lib/convert/flow/index.js +2 -0
  66. package/dist/cjs/lib/convert/proptypes/convert.js +2 -2
  67. package/dist/cjs/lib/convert/proptypes/index.js +2 -0
  68. package/dist/cjs/lib/convert/typescript/convert.js +2 -0
  69. package/dist/cjs/lib/convert/typescript/index.js +2 -0
  70. package/dist/cjs/lib/convert/utils.js +2 -2
  71. package/dist/cjs/lib/docgen/createPropDef.js +3 -1
  72. package/dist/cjs/lib/docgen/extractDocgenProps.js +3 -1
  73. package/dist/cjs/lib/docgen/flow/createType.js +2 -2
  74. package/dist/cjs/lib/docgen/index.js +2 -0
  75. package/dist/cjs/lib/docgen/typeScript/createType.js +2 -2
  76. package/dist/cjs/lib/docgen/utils/defaultValue.js +3 -0
  77. package/dist/cjs/lib/docgen/utils/docgenInfo.js +2 -2
  78. package/dist/cjs/lib/docgen/utils/index.js +2 -0
  79. package/dist/cjs/lib/index.js +2 -0
  80. package/dist/cjs/lib/jsdocParser.js +2 -2
  81. package/dist/cjs/lib/utils.js +6 -5
  82. package/dist/esm/blocks/ArgsTable.js +5 -3
  83. package/dist/esm/blocks/Canvas.js +5 -3
  84. package/dist/esm/blocks/DocsContainer.js +3 -2
  85. package/dist/esm/blocks/Heading.js +1 -1
  86. package/dist/esm/blocks/Meta.js +3 -2
  87. package/dist/esm/blocks/Primary.js +1 -0
  88. package/dist/esm/blocks/Source.js +1 -0
  89. package/dist/esm/blocks/SourceContainer.js +3 -2
  90. package/dist/esm/blocks/Stories.js +1 -0
  91. package/dist/esm/blocks/Story.js +4 -3
  92. package/dist/esm/blocks/Subheading.js +1 -1
  93. package/dist/esm/blocks/Title.js +1 -1
  94. package/dist/esm/blocks/enhanceSource.js +3 -3
  95. package/dist/esm/blocks/mdx.js +15 -8
  96. package/dist/esm/blocks/useStory.js +15 -15
  97. package/dist/esm/blocks/utils.js +1 -1
  98. package/dist/esm/frameworks/angular/compodoc.js +4 -4
  99. package/dist/esm/frameworks/angular/prepareForInline.js +1 -1
  100. package/dist/esm/frameworks/angular/sourceDecorator.js +1 -1
  101. package/dist/esm/frameworks/common/config.js +1 -1
  102. package/dist/esm/frameworks/common/preset.js +8 -6
  103. package/dist/esm/frameworks/ember/jsondoc.js +1 -0
  104. package/dist/esm/frameworks/html/sourceDecorator.js +2 -2
  105. package/dist/esm/frameworks/react/extractArgTypes.js +1 -0
  106. package/dist/esm/frameworks/react/extractProps.js +1 -1
  107. package/dist/esm/frameworks/react/jsxDecorator.js +5 -4
  108. package/dist/esm/frameworks/react/lib/defaultValues/createFromRawDefaultProp.js +3 -3
  109. package/dist/esm/frameworks/react/lib/generateCode.js +1 -1
  110. package/dist/esm/frameworks/react/lib/inspection/acornParser.js +1 -0
  111. package/dist/esm/frameworks/react/propTypes/createType.js +2 -1
  112. package/dist/esm/frameworks/react/propTypes/generateFuncSignature.js +1 -1
  113. package/dist/esm/frameworks/react/propTypes/sortProps.js +1 -0
  114. package/dist/esm/frameworks/react/react-argtypes.stories.js +4 -3
  115. package/dist/esm/frameworks/svelte/extractArgTypes.js +2 -0
  116. package/dist/esm/frameworks/svelte/prepareForInline.js +2 -2
  117. package/dist/esm/frameworks/svelte/preset.js +1 -1
  118. package/dist/esm/frameworks/svelte/sourceDecorator.js +4 -3
  119. package/dist/esm/frameworks/svelte/svelte-docgen-loader.js +1 -1
  120. package/dist/esm/frameworks/vue/extractArgTypes.js +3 -2
  121. package/dist/esm/frameworks/vue/preset.js +1 -0
  122. package/dist/esm/frameworks/vue/sourceDecorator.js +6 -6
  123. package/dist/esm/frameworks/vue3/extractArgTypes.js +1 -0
  124. package/dist/esm/frameworks/vue3/preset.js +1 -0
  125. package/dist/esm/frameworks/web-components/custom-elements.js +2 -1
  126. package/dist/esm/frameworks/web-components/prepareForInline.js +6 -6
  127. package/dist/esm/frameworks/web-components/sourceDecorator.js +1 -1
  128. package/dist/esm/lib/convert/flow/convert.js +2 -1
  129. package/dist/esm/lib/convert/proptypes/convert.js +1 -1
  130. package/dist/esm/lib/convert/typescript/convert.js +1 -0
  131. package/dist/esm/lib/convert/utils.js +1 -1
  132. package/dist/esm/lib/docgen/createPropDef.js +1 -0
  133. package/dist/esm/lib/docgen/extractDocgenProps.js +1 -0
  134. package/dist/esm/lib/docgen/flow/createType.js +1 -1
  135. package/dist/esm/lib/docgen/typeScript/createType.js +1 -1
  136. package/dist/esm/lib/docgen/utils/defaultValue.js +1 -0
  137. package/dist/esm/lib/jsdocParser.js +1 -1
  138. package/dist/esm/lib/utils.js +1 -1
  139. package/dist/modern/blocks/Canvas.js +3 -1
  140. package/dist/modern/blocks/mdx.js +12 -7
  141. package/dist/modern/frameworks/common/preset.js +2 -1
  142. package/dist/modern/frameworks/html/sourceDecorator.js +2 -2
  143. package/dist/modern/frameworks/react/jsxDecorator.js +3 -1
  144. package/dist/modern/frameworks/svelte/extractArgTypes.js +1 -0
  145. package/dist/modern/frameworks/svelte/prepareForInline.js +2 -2
  146. package/package.json +29 -27
  147. package/register.js +1 -0
  148. package/{dist/cjs/frameworks/svelte → svelte}/HOC.svelte +0 -0
  149. package/dist/cjs/frameworks/svelte/sample/MockButton.svelte +0 -45
  150. package/dist/cjs/typings.d.js +0 -1
  151. package/dist/esm/frameworks/svelte/HOC.svelte +0 -7
  152. package/dist/esm/frameworks/svelte/sample/MockButton.svelte +0 -45
  153. package/dist/esm/typings.d.js +0 -0
  154. package/dist/modern/frameworks/svelte/HOC.svelte +0 -7
  155. package/dist/modern/frameworks/svelte/sample/MockButton.svelte +0 -45
  156. 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,
@@ -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) {
@@ -28,9 +28,10 @@ export async function webpack(webpackConfig = {}, options) {
28
28
  const {
29
29
  builder = 'webpack4'
30
30
  } = await options.presets.apply('core', {});
31
+ const builderName = typeof builder === 'string' ? builder : builder.name;
31
32
 
32
33
  const resolvedBabelLoader = require.resolve('babel-loader', {
33
- paths: builder.match(/(webpack4|webpack5)/) ? [require.resolve(`@storybook/builder-${builder}`)] : [builder]
34
+ paths: builderName.match(/(webpack4|webpack5)/) ? [require.resolve(`@storybook/builder-${builder}`)] : [builderName]
34
35
  });
35
36
 
36
37
  const {
@@ -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(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/addon-docs",
3
- "version": "6.5.0-alpha.21",
3
+ "version": "6.5.0-alpha.25",
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.21",
67
- "@storybook/api": "6.5.0-alpha.21",
68
- "@storybook/builder-webpack4": "6.5.0-alpha.21",
69
- "@storybook/client-logger": "6.5.0-alpha.21",
70
- "@storybook/components": "6.5.0-alpha.21",
71
- "@storybook/core": "6.5.0-alpha.21",
72
- "@storybook/core-events": "6.5.0-alpha.21",
67
+ "@storybook/addons": "6.5.0-alpha.25",
68
+ "@storybook/api": "6.5.0-alpha.25",
69
+ "@storybook/builder-webpack4": "6.5.0-alpha.25",
70
+ "@storybook/client-logger": "6.5.0-alpha.25",
71
+ "@storybook/components": "6.5.0-alpha.25",
72
+ "@storybook/core": "6.5.0-alpha.25",
73
+ "@storybook/core-events": "6.5.0-alpha.25",
73
74
  "@storybook/csf": "0.0.2--canary.87bc651.0",
74
- "@storybook/csf-tools": "6.5.0-alpha.21",
75
- "@storybook/node-logger": "6.5.0-alpha.21",
76
- "@storybook/postinstall": "6.5.0-alpha.21",
77
- "@storybook/preview-web": "6.5.0-alpha.21",
78
- "@storybook/source-loader": "6.5.0-alpha.21",
79
- "@storybook/store": "6.5.0-alpha.21",
80
- "@storybook/theming": "6.5.0-alpha.21",
75
+ "@storybook/csf-tools": "6.5.0-alpha.25",
76
+ "@storybook/node-logger": "6.5.0-alpha.25",
77
+ "@storybook/postinstall": "6.5.0-alpha.25",
78
+ "@storybook/preview-web": "6.5.0-alpha.25",
79
+ "@storybook/source-loader": "6.5.0-alpha.25",
80
+ "@storybook/store": "6.5.0-alpha.25",
81
+ "@storybook/theming": "6.5.0-alpha.25",
81
82
  "acorn": "^7.4.1",
82
83
  "acorn-jsx": "^5.3.1",
83
84
  "acorn-walk": "^7.2.0",
@@ -106,11 +107,11 @@
106
107
  "@babel/core": "^7.12.10",
107
108
  "@emotion/core": "^10.3.1",
108
109
  "@emotion/styled": "^10.0.27",
109
- "@storybook/angular": "6.5.0-alpha.21",
110
- "@storybook/html": "6.5.0-alpha.21",
111
- "@storybook/react": "6.5.0-alpha.21",
112
- "@storybook/vue": "6.5.0-alpha.21",
113
- "@storybook/web-components": "6.5.0-alpha.21",
110
+ "@storybook/angular": "6.5.0-alpha.25",
111
+ "@storybook/html": "6.5.0-alpha.25",
112
+ "@storybook/react": "6.5.0-alpha.25",
113
+ "@storybook/vue": "6.5.0-alpha.25",
114
+ "@storybook/web-components": "6.5.0-alpha.25",
114
115
  "@types/cross-spawn": "^6.0.2",
115
116
  "@types/doctrine": "^0.0.3",
116
117
  "@types/enzyme": "^3.10.8",
@@ -131,6 +132,7 @@
131
132
  "require-from-string": "^2.0.2",
132
133
  "rxjs": "^6.6.3",
133
134
  "styled-components": "^5.2.1",
135
+ "sveltedoc-parser": "4.1.0",
134
136
  "terser-webpack-plugin": "^5.0.3",
135
137
  "tmp": "^0.2.1",
136
138
  "tslib": "^2.1.0",
@@ -140,12 +142,12 @@
140
142
  "zone.js": "^0.11.3"
141
143
  },
142
144
  "peerDependencies": {
143
- "@storybook/angular": "6.5.0-alpha.21",
144
- "@storybook/html": "6.5.0-alpha.21",
145
- "@storybook/react": "6.5.0-alpha.21",
146
- "@storybook/vue": "6.5.0-alpha.21",
147
- "@storybook/vue3": "6.5.0-alpha.21",
148
- "@storybook/web-components": "6.5.0-alpha.21",
145
+ "@storybook/angular": "6.5.0-alpha.25",
146
+ "@storybook/html": "6.5.0-alpha.25",
147
+ "@storybook/react": "6.5.0-alpha.25",
148
+ "@storybook/vue": "6.5.0-alpha.25",
149
+ "@storybook/vue3": "6.5.0-alpha.25",
150
+ "@storybook/web-components": "6.5.0-alpha.25",
149
151
  "lit": "^2.0.0",
150
152
  "lit-html": "^1.4.1 || ^2.0.0",
151
153
  "react": "^16.8.0 || ^17.0.0",
@@ -202,7 +204,7 @@
202
204
  "publishConfig": {
203
205
  "access": "public"
204
206
  },
205
- "gitHead": "fc1a84084556d61fea8bcaa197f7d85f3a9a107d",
207
+ "gitHead": "25ed23c17e07452af0dbd34665eb9a6dfdac526c",
206
208
  "sbmodern": "dist/modern/index.js",
207
209
  "storybook": {
208
210
  "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}/>
@@ -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>
File without changes
@@ -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}/>
@@ -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>
File without changes