@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.
- package/README.md +4 -13
- package/angular/README.md +0 -6
- package/dist/cjs/blocks/Anchor.js +1 -1
- package/dist/cjs/blocks/ArgsTable.js +13 -9
- package/dist/cjs/blocks/Canvas.js +13 -11
- package/dist/cjs/blocks/Description.js +6 -6
- package/dist/cjs/blocks/DocsContainer.js +8 -6
- package/dist/cjs/blocks/Heading.js +2 -2
- package/dist/cjs/blocks/Meta.js +8 -6
- package/dist/cjs/blocks/Primary.js +7 -7
- package/dist/cjs/blocks/Source.js +8 -8
- package/dist/cjs/blocks/SourceContainer.js +9 -7
- package/dist/cjs/blocks/Stories.js +14 -7
- package/dist/cjs/blocks/Story.js +10 -8
- package/dist/cjs/blocks/Subheading.js +2 -2
- package/dist/cjs/blocks/Subtitle.js +5 -5
- package/dist/cjs/blocks/Title.js +8 -8
- package/dist/cjs/blocks/enhanceSource.js +5 -5
- package/dist/cjs/blocks/index.js +6 -4
- package/dist/cjs/blocks/mdx.js +17 -9
- package/dist/cjs/blocks/useStory.js +8 -6
- package/dist/cjs/blocks/utils.js +3 -3
- package/dist/cjs/frameworks/angular/compodoc.js +8 -8
- package/dist/cjs/frameworks/angular/config.js +1 -1
- package/dist/cjs/frameworks/angular/index.js +2 -0
- package/dist/cjs/frameworks/angular/prepareForInline.js +2 -2
- package/dist/cjs/frameworks/angular/sourceDecorator.js +7 -7
- package/dist/cjs/frameworks/common/config.js +8 -8
- package/dist/cjs/frameworks/common/preset.js +157 -111
- package/dist/cjs/frameworks/ember/jsondoc.js +3 -1
- package/dist/cjs/frameworks/html/sourceDecorator.js +2 -2
- package/dist/cjs/frameworks/react/config.js +1 -1
- package/dist/cjs/frameworks/react/extractArgTypes.js +2 -0
- package/dist/cjs/frameworks/react/extractProps.js +2 -2
- package/dist/cjs/frameworks/react/jsxDecorator.js +12 -10
- package/dist/cjs/frameworks/react/lib/captions.js +1 -1
- package/dist/cjs/frameworks/react/lib/componentTypes.js +1 -1
- package/dist/cjs/frameworks/react/lib/defaultValues/createFromRawDefaultProp.js +7 -7
- package/dist/cjs/frameworks/react/lib/defaultValues/index.js +2 -0
- package/dist/cjs/frameworks/react/lib/defaultValues/prettyIdentifier.js +2 -2
- package/dist/cjs/frameworks/react/lib/generateCode.js +3 -3
- package/dist/cjs/frameworks/react/lib/index.js +2 -0
- package/dist/cjs/frameworks/react/lib/inspection/acornParser.js +7 -7
- package/dist/cjs/frameworks/react/lib/inspection/index.js +2 -0
- package/dist/cjs/frameworks/react/propTypes/createType.js +4 -2
- package/dist/cjs/frameworks/react/propTypes/generateFuncSignature.js +2 -2
- package/dist/cjs/frameworks/react/propTypes/sortProps.js +2 -0
- package/dist/cjs/frameworks/react/react-argtypes.stories.js +10 -8
- package/dist/cjs/frameworks/svelte/config.js +1 -1
- package/dist/cjs/frameworks/svelte/extractArgTypes.js +4 -1
- package/dist/cjs/frameworks/svelte/prepareForInline.js +1 -2
- package/dist/cjs/frameworks/svelte/preset.js +2 -2
- package/dist/cjs/frameworks/svelte/sourceDecorator.js +7 -5
- package/dist/cjs/frameworks/svelte/svelte-docgen-loader.js +7 -7
- package/dist/cjs/frameworks/vue/config.js +1 -1
- package/dist/cjs/frameworks/vue/extractArgTypes.js +6 -4
- package/dist/cjs/frameworks/vue/preset.js +2 -0
- package/dist/cjs/frameworks/vue/sourceDecorator.js +12 -12
- package/dist/cjs/frameworks/vue3/extractArgTypes.js +2 -0
- package/dist/cjs/frameworks/vue3/prepareForInline.js +5 -5
- package/dist/cjs/frameworks/vue3/preset.js +2 -0
- package/dist/cjs/frameworks/web-components/custom-elements.js +5 -3
- package/dist/cjs/frameworks/web-components/prepareForInline.js +8 -8
- package/dist/cjs/frameworks/web-components/sourceDecorator.js +2 -2
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/lib/convert/flow/convert.js +3 -1
- package/dist/cjs/lib/convert/flow/index.js +2 -0
- package/dist/cjs/lib/convert/proptypes/convert.js +2 -2
- package/dist/cjs/lib/convert/proptypes/index.js +2 -0
- package/dist/cjs/lib/convert/typescript/convert.js +2 -0
- package/dist/cjs/lib/convert/typescript/index.js +2 -0
- package/dist/cjs/lib/convert/utils.js +2 -2
- package/dist/cjs/lib/docgen/createPropDef.js +3 -1
- package/dist/cjs/lib/docgen/extractDocgenProps.js +3 -1
- package/dist/cjs/lib/docgen/flow/createType.js +2 -2
- package/dist/cjs/lib/docgen/index.js +2 -0
- package/dist/cjs/lib/docgen/typeScript/createType.js +2 -2
- package/dist/cjs/lib/docgen/utils/defaultValue.js +3 -0
- package/dist/cjs/lib/docgen/utils/docgenInfo.js +2 -2
- package/dist/cjs/lib/docgen/utils/index.js +2 -0
- package/dist/cjs/lib/index.js +2 -0
- package/dist/cjs/lib/jsdocParser.js +2 -2
- package/dist/cjs/lib/utils.js +6 -5
- package/dist/esm/blocks/ArgsTable.js +5 -3
- package/dist/esm/blocks/Canvas.js +5 -3
- package/dist/esm/blocks/DocsContainer.js +3 -2
- package/dist/esm/blocks/Heading.js +1 -1
- package/dist/esm/blocks/Meta.js +3 -2
- package/dist/esm/blocks/Primary.js +1 -0
- package/dist/esm/blocks/Source.js +1 -0
- package/dist/esm/blocks/SourceContainer.js +3 -2
- package/dist/esm/blocks/Stories.js +7 -0
- package/dist/esm/blocks/Story.js +4 -3
- package/dist/esm/blocks/Subheading.js +1 -1
- package/dist/esm/blocks/Title.js +1 -1
- package/dist/esm/blocks/enhanceSource.js +3 -3
- package/dist/esm/blocks/mdx.js +15 -8
- package/dist/esm/blocks/useStory.js +15 -15
- package/dist/esm/blocks/utils.js +1 -1
- package/dist/esm/frameworks/angular/compodoc.js +4 -4
- package/dist/esm/frameworks/angular/prepareForInline.js +1 -1
- package/dist/esm/frameworks/angular/sourceDecorator.js +1 -1
- package/dist/esm/frameworks/common/config.js +1 -1
- package/dist/esm/frameworks/common/preset.js +153 -109
- package/dist/esm/frameworks/ember/jsondoc.js +1 -0
- package/dist/esm/frameworks/html/sourceDecorator.js +2 -2
- package/dist/esm/frameworks/react/extractArgTypes.js +1 -0
- package/dist/esm/frameworks/react/extractProps.js +1 -1
- package/dist/esm/frameworks/react/jsxDecorator.js +5 -4
- package/dist/esm/frameworks/react/lib/defaultValues/createFromRawDefaultProp.js +3 -3
- package/dist/esm/frameworks/react/lib/generateCode.js +1 -1
- package/dist/esm/frameworks/react/lib/inspection/acornParser.js +2 -2
- package/dist/esm/frameworks/react/propTypes/createType.js +2 -1
- package/dist/esm/frameworks/react/propTypes/generateFuncSignature.js +1 -1
- package/dist/esm/frameworks/react/propTypes/sortProps.js +1 -0
- package/dist/esm/frameworks/react/react-argtypes.stories.js +4 -3
- package/dist/esm/frameworks/svelte/extractArgTypes.js +2 -0
- package/dist/esm/frameworks/svelte/prepareForInline.js +2 -3
- package/dist/esm/frameworks/svelte/preset.js +1 -1
- package/dist/esm/frameworks/svelte/sourceDecorator.js +4 -3
- package/dist/esm/frameworks/svelte/svelte-docgen-loader.js +1 -1
- package/dist/esm/frameworks/vue/extractArgTypes.js +4 -3
- package/dist/esm/frameworks/vue/preset.js +1 -0
- package/dist/esm/frameworks/vue/sourceDecorator.js +6 -6
- package/dist/esm/frameworks/vue3/extractArgTypes.js +1 -0
- package/dist/esm/frameworks/vue3/preset.js +1 -0
- package/dist/esm/frameworks/web-components/custom-elements.js +2 -1
- package/dist/esm/frameworks/web-components/prepareForInline.js +6 -6
- package/dist/esm/frameworks/web-components/sourceDecorator.js +1 -1
- package/dist/esm/lib/convert/flow/convert.js +2 -1
- package/dist/esm/lib/convert/proptypes/convert.js +1 -1
- package/dist/esm/lib/convert/typescript/convert.js +1 -0
- package/dist/esm/lib/convert/utils.js +1 -1
- package/dist/esm/lib/docgen/createPropDef.js +1 -0
- package/dist/esm/lib/docgen/extractDocgenProps.js +1 -0
- package/dist/esm/lib/docgen/flow/createType.js +1 -1
- package/dist/esm/lib/docgen/typeScript/createType.js +1 -1
- package/dist/esm/lib/docgen/utils/defaultValue.js +1 -0
- package/dist/esm/lib/jsdocParser.js +1 -1
- package/dist/esm/lib/utils.js +1 -1
- package/dist/modern/blocks/Canvas.js +3 -1
- package/dist/modern/blocks/Stories.js +5 -0
- package/dist/modern/blocks/mdx.js +12 -7
- package/dist/modern/frameworks/common/preset.js +10 -9
- package/dist/modern/frameworks/html/sourceDecorator.js +2 -2
- package/dist/modern/frameworks/react/jsxDecorator.js +3 -1
- package/dist/modern/frameworks/react/lib/inspection/acornParser.js +1 -2
- package/dist/modern/frameworks/svelte/extractArgTypes.js +1 -0
- package/dist/modern/frameworks/svelte/prepareForInline.js +2 -3
- package/dist/modern/frameworks/vue/extractArgTypes.js +1 -1
- package/dist/ts3.4/frameworks/angular/config.d.ts +0 -1
- package/dist/ts3.4/frameworks/common/config.d.ts +0 -1
- package/dist/ts3.4/frameworks/common/preset.d.ts +12 -1
- package/dist/ts3.4/frameworks/svelte/config.d.ts +0 -1
- package/dist/ts3.4/frameworks/vue/config.d.ts +0 -1
- package/dist/ts3.4/frameworks/vue3/config.d.ts +0 -1
- package/dist/ts3.4/frameworks/web-components/config.d.ts +0 -1
- package/dist/ts3.9/frameworks/angular/config.d.ts +0 -1
- package/dist/ts3.9/frameworks/common/config.d.ts +0 -1
- package/dist/ts3.9/frameworks/common/preset.d.ts +12 -1
- package/dist/ts3.9/frameworks/svelte/config.d.ts +0 -1
- package/dist/ts3.9/frameworks/vue/config.d.ts +0 -1
- package/dist/ts3.9/frameworks/vue3/config.d.ts +0 -1
- package/dist/ts3.9/frameworks/web-components/config.d.ts +0 -1
- package/package.json +36 -39
- package/register.js +1 -0
- package/{dist/cjs/frameworks/svelte → svelte}/HOC.svelte +0 -0
- package/dist/cjs/frameworks/svelte/sample/MockButton.svelte +0 -45
- package/dist/cjs/typings.d.js +0 -1
- package/dist/esm/frameworks/svelte/HOC.svelte +0 -7
- package/dist/esm/frameworks/svelte/sample/MockButton.svelte +0 -45
- package/dist/esm/typings.d.js +0 -0
- package/dist/modern/frameworks/svelte/HOC.svelte +0 -7
- package/dist/modern/frameworks/svelte/sample/MockButton.svelte +0 -45
- package/dist/modern/typings.d.js +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
2
|
|
|
3
3
|
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) {
|
|
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
|
|
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,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";
|
|
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,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 */
|
|
@@ -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) {
|
|
@@ -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";
|
package/dist/esm/lib/utils.js
CHANGED
|
@@ -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,
|
|
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,
|
|
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 =
|
|
42
|
+
export const CodeOrSourceMdx = _ref => {
|
|
38
43
|
let {
|
|
39
44
|
className,
|
|
40
45
|
children
|
|
41
46
|
} = _ref,
|
|
42
|
-
rest = _objectWithoutPropertiesLoose(_ref,
|
|
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,
|
|
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 =
|
|
140
|
+
const HeaderWithOcticonAnchor = _ref2 => {
|
|
136
141
|
let {
|
|
137
142
|
as,
|
|
138
143
|
id,
|
|
139
144
|
children
|
|
140
145
|
} = _ref2,
|
|
141
|
-
rest = _objectWithoutPropertiesLoose(_ref2,
|
|
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,
|
|
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
|
-
|
|
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,
|
|
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';
|
|
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';
|
|
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 +1,12 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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 {};
|