@storybook/addon-docs 7.0.0-alpha.1 → 7.0.0-alpha.4

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.
@@ -1,61 +1,11 @@
1
1
  "use strict";
2
2
 
3
- 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); }
4
-
5
- require("core-js/modules/es.symbol.js");
6
-
7
- require("core-js/modules/es.symbol.description.js");
8
-
9
- require("core-js/modules/es.symbol.iterator.js");
10
-
11
- require("core-js/modules/es.array.iterator.js");
12
-
13
- require("core-js/modules/es.string.iterator.js");
14
-
15
- require("core-js/modules/web.dom-collections.iterator.js");
16
-
17
- require("core-js/modules/es.array.from.js");
18
-
19
- require("core-js/modules/es.array.slice.js");
20
-
21
- require("core-js/modules/es.function.name.js");
22
-
23
- require("core-js/modules/es.weak-map.js");
24
-
25
- require("core-js/modules/es.object.get-own-property-descriptor.js");
26
-
27
- require("core-js/modules/es.symbol.async-iterator.js");
28
-
29
- require("core-js/modules/es.symbol.to-string-tag.js");
30
-
31
- require("core-js/modules/es.json.to-string-tag.js");
32
-
33
- require("core-js/modules/es.math.to-string-tag.js");
34
-
35
- require("core-js/modules/es.object.get-prototype-of.js");
36
-
37
- require("core-js/modules/web.dom-collections.for-each.js");
38
-
39
3
  Object.defineProperty(exports, "__esModule", {
40
4
  value: true
41
5
  });
42
6
  exports.storyIndexers = void 0;
43
7
  exports.webpack = webpack;
44
8
 
45
- require("core-js/modules/es.array.concat.js");
46
-
47
- require("core-js/modules/es.object.assign.js");
48
-
49
- require("core-js/modules/es.object.to-string.js");
50
-
51
- require("core-js/modules/es.regexp.to-string.js");
52
-
53
- require("core-js/modules/es.promise.js");
54
-
55
- require("core-js/modules/es.array.filter.js");
56
-
57
- require("core-js/modules/es.regexp.exec.js");
58
-
59
9
  var _fsExtra = _interopRequireDefault(require("fs-extra"));
60
10
 
61
11
  var _remarkSlug = _interopRequireDefault(require("remark-slug"));
@@ -70,261 +20,143 @@ var _csfTools = require("@storybook/csf-tools");
70
20
 
71
21
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
72
22
 
73
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
74
-
75
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
76
-
77
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
78
-
79
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
80
-
81
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
82
-
83
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
84
-
85
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
23
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
86
24
 
87
- 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); }
25
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
88
26
 
89
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
90
-
91
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
92
-
93
- 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; }
94
-
95
- function createBabelOptions(_ref) {
96
- var babelOptions = _ref.babelOptions,
97
- mdxBabelOptions = _ref.mdxBabelOptions,
98
- configureJSX = _ref.configureJSX;
99
- var babelPlugins = (mdxBabelOptions === null || mdxBabelOptions === void 0 ? void 0 : mdxBabelOptions.plugins) || (babelOptions === null || babelOptions === void 0 ? void 0 : babelOptions.plugins) || [];
100
- var jsxPlugin = [require.resolve('@babel/plugin-transform-react-jsx'), {
27
+ function createBabelOptions({
28
+ babelOptions,
29
+ mdxBabelOptions,
30
+ configureJSX
31
+ }) {
32
+ const babelPlugins = (mdxBabelOptions === null || mdxBabelOptions === void 0 ? void 0 : mdxBabelOptions.plugins) || (babelOptions === null || babelOptions === void 0 ? void 0 : babelOptions.plugins) || [];
33
+ const jsxPlugin = [require.resolve('@babel/plugin-transform-react-jsx'), {
101
34
  pragma: 'React.createElement',
102
35
  pragmaFrag: 'React.Fragment'
103
36
  }];
104
- var plugins = configureJSX ? [].concat(_toConsumableArray(babelPlugins), [jsxPlugin]) : babelPlugins;
37
+ const plugins = configureJSX ? [...babelPlugins, jsxPlugin] : babelPlugins;
105
38
  return Object.assign({
106
39
  // don't use the root babelrc by default (users can override this in mdxBabelOptions)
107
40
  babelrc: false,
108
41
  configFile: false
109
42
  }, babelOptions, mdxBabelOptions, {
110
- plugins: plugins
43
+ plugins
111
44
  });
112
45
  }
113
46
 
114
- function webpack() {
115
- return _webpack.apply(this, arguments);
116
- }
117
-
118
- function _webpack() {
119
- _webpack = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
120
- var _global$FEATURES2, _global$FEATURES3;
121
-
122
- var webpackConfig,
123
- options,
124
- resolvedBabelLoader,
125
- _webpackConfig$module,
126
- module,
127
- babelOptions,
128
- mdxBabelOptions,
129
- _options$configureJSX,
130
- configureJSX,
131
- _options$sourceLoader,
132
- sourceLoaderOptions,
133
- _options$transcludeMa,
134
- transcludeMarkdown,
135
- mdxLoaderOptions,
136
- mdxVersion,
137
- mdxLoader,
138
- sourceLoader,
139
- rules,
140
- result,
141
- _args3 = arguments;
142
-
143
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
144
- while (1) {
145
- switch (_context3.prev = _context3.next) {
146
- case 0:
147
- webpackConfig = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
148
- options = _args3.length > 1 ? _args3[1] : undefined;
149
- resolvedBabelLoader = require.resolve('babel-loader');
150
- _webpackConfig$module = webpackConfig.module, module = _webpackConfig$module === void 0 ? {} : _webpackConfig$module; // it will reuse babel options that are already in use in storybook
151
- // also, these babel options are chained with other presets.
152
-
153
- babelOptions = options.babelOptions, mdxBabelOptions = options.mdxBabelOptions, _options$configureJSX = options.configureJSX, configureJSX = _options$configureJSX === void 0 ? true : _options$configureJSX, _options$sourceLoader = options.sourceLoaderOptions, sourceLoaderOptions = _options$sourceLoader === void 0 ? {
154
- injectStoryParameters: true
155
- } : _options$sourceLoader, _options$transcludeMa = options.transcludeMarkdown, transcludeMarkdown = _options$transcludeMa === void 0 ? false : _options$transcludeMa;
156
- mdxLoaderOptions = {
157
- skipCsf: true,
158
- remarkPlugins: [_remarkSlug.default, _remarkExternalLinks.default]
159
- };
160
- mdxVersion = (_global$FEATURES2 = _global.default.FEATURES) !== null && _global$FEATURES2 !== void 0 && _global$FEATURES2.previewMdx2 ? 'MDX2' : 'MDX1';
161
-
162
- _nodeLogger.logger.info("Addon-docs: using ".concat(mdxVersion));
163
-
164
- mdxLoader = (_global$FEATURES3 = _global.default.FEATURES) !== null && _global$FEATURES3 !== void 0 && _global$FEATURES3.previewMdx2 ? require.resolve('@storybook/mdx2-csf/loader') : require.resolve('@storybook/mdx1-csf/loader'); // set `sourceLoaderOptions` to `null` to disable for manual configuration
165
-
166
- sourceLoader = sourceLoaderOptions ? [{
167
- test: /\.(stories|story)\.[tj]sx?$/,
168
- loader: require.resolve('@storybook/source-loader'),
169
- options: Object.assign({}, sourceLoaderOptions, {
170
- inspectLocalDependencies: true
171
- }),
172
- enforce: 'pre'
173
- }] : [];
174
- rules = module.rules || [];
175
-
176
- if (transcludeMarkdown) {
177
- rules = [].concat(_toConsumableArray(rules.filter(function (rule) {
178
- var _rule$test;
179
-
180
- return ((_rule$test = rule.test) === null || _rule$test === void 0 ? void 0 : _rule$test.toString()) !== '/\\.md$/';
181
- })), [{
182
- test: /\.md$/,
183
- use: [{
184
- loader: resolvedBabelLoader,
185
- options: createBabelOptions({
186
- babelOptions: babelOptions,
187
- mdxBabelOptions: mdxBabelOptions,
188
- configureJSX: configureJSX
189
- })
190
- }, {
191
- loader: mdxLoader,
192
- options: mdxLoaderOptions
193
- }]
194
- }]);
195
- }
196
-
197
- result = Object.assign({}, webpackConfig, {
198
- module: Object.assign({}, module, {
199
- rules: [].concat(_toConsumableArray(rules), [{
200
- test: /(stories|story)\.mdx$/,
201
- use: [{
202
- loader: resolvedBabelLoader,
203
- options: createBabelOptions({
204
- babelOptions: babelOptions,
205
- mdxBabelOptions: mdxBabelOptions,
206
- configureJSX: configureJSX
207
- })
208
- }, {
209
- loader: mdxLoader
210
- }]
211
- }, {
212
- test: /\.mdx$/,
213
- exclude: /(stories|story)\.mdx$/,
214
- use: [{
215
- loader: resolvedBabelLoader,
216
- options: createBabelOptions({
217
- babelOptions: babelOptions,
218
- mdxBabelOptions: mdxBabelOptions,
219
- configureJSX: configureJSX
220
- })
221
- }, {
222
- loader: mdxLoader,
223
- options: mdxLoaderOptions
224
- }]
225
- }], sourceLoader)
226
- })
227
- });
228
- return _context3.abrupt("return", result);
229
-
230
- case 14:
231
- case "end":
232
- return _context3.stop();
233
- }
234
- }
235
- }, _callee3);
236
- }));
237
- return _webpack.apply(this, arguments);
47
+ async function webpack(webpackConfig = {}, options) {
48
+ var _global$FEATURES, _global$FEATURES2;
49
+
50
+ const resolvedBabelLoader = require.resolve('babel-loader');
51
+
52
+ const {
53
+ module = {}
54
+ } = webpackConfig; // it will reuse babel options that are already in use in storybook
55
+ // also, these babel options are chained with other presets.
56
+
57
+ const {
58
+ babelOptions,
59
+ mdxBabelOptions,
60
+ configureJSX = true,
61
+ sourceLoaderOptions = {
62
+ injectStoryParameters: true
63
+ },
64
+ transcludeMarkdown = false
65
+ } = options;
66
+ const mdxLoaderOptions = {
67
+ skipCsf: true,
68
+ remarkPlugins: [_remarkSlug.default, _remarkExternalLinks.default]
69
+ };
70
+ const mdxVersion = (_global$FEATURES = _global.default.FEATURES) !== null && _global$FEATURES !== void 0 && _global$FEATURES.previewMdx2 ? 'MDX2' : 'MDX1';
71
+
72
+ _nodeLogger.logger.info(`Addon-docs: using ${mdxVersion}`);
73
+
74
+ const mdxLoader = (_global$FEATURES2 = _global.default.FEATURES) !== null && _global$FEATURES2 !== void 0 && _global$FEATURES2.previewMdx2 ? require.resolve('@storybook/mdx2-csf/loader') : require.resolve('@storybook/mdx1-csf/loader'); // set `sourceLoaderOptions` to `null` to disable for manual configuration
75
+
76
+ const sourceLoader = sourceLoaderOptions ? [{
77
+ test: /\.(stories|story)\.[tj]sx?$/,
78
+ loader: require.resolve('@storybook/source-loader'),
79
+ options: Object.assign({}, sourceLoaderOptions, {
80
+ inspectLocalDependencies: true
81
+ }),
82
+ enforce: 'pre'
83
+ }] : [];
84
+ let rules = module.rules || [];
85
+
86
+ if (transcludeMarkdown) {
87
+ rules = [...rules.filter(rule => {
88
+ var _rule$test;
89
+
90
+ return ((_rule$test = rule.test) === null || _rule$test === void 0 ? void 0 : _rule$test.toString()) !== '/\\.md$/';
91
+ }), {
92
+ test: /\.md$/,
93
+ use: [{
94
+ loader: resolvedBabelLoader,
95
+ options: createBabelOptions({
96
+ babelOptions,
97
+ mdxBabelOptions,
98
+ configureJSX
99
+ })
100
+ }, {
101
+ loader: mdxLoader,
102
+ options: mdxLoaderOptions
103
+ }]
104
+ }];
105
+ }
106
+
107
+ const result = Object.assign({}, webpackConfig, {
108
+ module: Object.assign({}, module, {
109
+ rules: [...rules, {
110
+ test: /(stories|story)\.mdx$/,
111
+ use: [{
112
+ loader: resolvedBabelLoader,
113
+ options: createBabelOptions({
114
+ babelOptions,
115
+ mdxBabelOptions,
116
+ configureJSX
117
+ })
118
+ }, {
119
+ loader: mdxLoader
120
+ }]
121
+ }, {
122
+ test: /\.mdx$/,
123
+ exclude: /(stories|story)\.mdx$/,
124
+ use: [{
125
+ loader: resolvedBabelLoader,
126
+ options: createBabelOptions({
127
+ babelOptions,
128
+ mdxBabelOptions,
129
+ configureJSX
130
+ })
131
+ }, {
132
+ loader: mdxLoader,
133
+ options: mdxLoaderOptions
134
+ }]
135
+ }, ...sourceLoader]
136
+ })
137
+ });
138
+ return result;
238
139
  }
239
140
 
240
- var storyIndexers = /*#__PURE__*/function () {
241
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(indexers) {
242
- var mdxIndexer;
243
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
244
- while (1) {
245
- switch (_context2.prev = _context2.next) {
246
- case 0:
247
- mdxIndexer = /*#__PURE__*/function () {
248
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(fileName, opts) {
249
- var _global$FEATURES;
250
-
251
- var code, _ref4, compile;
252
-
253
- return _regeneratorRuntime().wrap(function _callee$(_context) {
254
- while (1) {
255
- switch (_context.prev = _context.next) {
256
- case 0:
257
- _context.next = 2;
258
- return _fsExtra.default.readFile(fileName, 'utf-8');
259
-
260
- case 2:
261
- code = _context.sent.toString();
262
-
263
- if (!((_global$FEATURES = _global.default.FEATURES) !== null && _global$FEATURES !== void 0 && _global$FEATURES.previewMdx2)) {
264
- _context.next = 9;
265
- break;
266
- }
267
-
268
- _context.next = 6;
269
- return Promise.resolve().then(function () {
270
- return _interopRequireWildcard(require('@storybook/mdx2-csf'));
271
- });
272
-
273
- case 6:
274
- _context.t0 = _context.sent;
275
- _context.next = 12;
276
- break;
277
-
278
- case 9:
279
- _context.next = 11;
280
- return Promise.resolve().then(function () {
281
- return _interopRequireWildcard(require('@storybook/mdx1-csf'));
282
- });
141
+ const storyIndexers = async indexers => {
142
+ const mdxIndexer = async (fileName, opts) => {
143
+ var _global$FEATURES3;
283
144
 
284
- case 11:
285
- _context.t0 = _context.sent;
145
+ let code = (await _fsExtra.default.readFile(fileName, 'utf-8')).toString(); // @ts-ignore
286
146
 
287
- case 12:
288
- _ref4 = _context.t0;
289
- compile = _ref4.compile;
290
- _context.next = 16;
291
- return compile(code, {});
292
-
293
- case 16:
294
- code = _context.sent;
295
- return _context.abrupt("return", (0, _csfTools.loadCsf)(code, Object.assign({}, opts, {
296
- fileName: fileName
297
- })).parse());
298
-
299
- case 18:
300
- case "end":
301
- return _context.stop();
302
- }
303
- }
304
- }, _callee);
305
- }));
306
-
307
- return function mdxIndexer(_x2, _x3) {
308
- return _ref3.apply(this, arguments);
309
- };
310
- }();
311
-
312
- return _context2.abrupt("return", [{
313
- test: /(stories|story)\.mdx$/,
314
- indexer: mdxIndexer
315
- }].concat(_toConsumableArray(indexers || [])));
316
-
317
- case 2:
318
- case "end":
319
- return _context2.stop();
320
- }
321
- }
322
- }, _callee2);
323
- }));
324
-
325
- return function storyIndexers(_x) {
326
- return _ref2.apply(this, arguments);
147
+ const {
148
+ compile
149
+ } = (_global$FEATURES3 = _global.default.FEATURES) !== null && _global$FEATURES3 !== void 0 && _global$FEATURES3.previewMdx2 ? await Promise.resolve().then(() => _interopRequireWildcard(require('@storybook/mdx2-csf'))) : await Promise.resolve().then(() => _interopRequireWildcard(require('@storybook/mdx1-csf')));
150
+ code = await compile(code, {});
151
+ return (0, _csfTools.loadCsf)(code, Object.assign({}, opts, {
152
+ fileName
153
+ })).parse();
327
154
  };
328
- }();
155
+
156
+ return [{
157
+ test: /(stories|story)\.mdx$/,
158
+ indexer: mdxIndexer
159
+ }, ...(indexers || [])];
160
+ };
329
161
 
330
162
  exports.storyIndexers = storyIndexers;
@@ -1,116 +1,18 @@
1
1
  "use strict";
2
2
 
3
- 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); }
4
-
5
- require("core-js/modules/es.array.iterator.js");
6
-
7
- require("core-js/modules/es.string.iterator.js");
8
-
9
- require("core-js/modules/es.weak-map.js");
10
-
11
- require("core-js/modules/web.dom-collections.iterator.js");
12
-
13
- require("core-js/modules/es.object.get-own-property-descriptor.js");
14
-
15
- require("core-js/modules/es.symbol.js");
16
-
17
- require("core-js/modules/es.symbol.description.js");
18
-
19
- require("core-js/modules/es.symbol.iterator.js");
20
-
21
- require("core-js/modules/es.symbol.async-iterator.js");
22
-
23
- require("core-js/modules/es.symbol.to-string-tag.js");
24
-
25
- require("core-js/modules/es.json.to-string-tag.js");
26
-
27
- require("core-js/modules/es.math.to-string-tag.js");
28
-
29
- require("core-js/modules/es.object.get-prototype-of.js");
30
-
31
- require("core-js/modules/web.dom-collections.for-each.js");
32
-
33
- require("core-js/modules/es.function.name.js");
34
-
35
- require("core-js/modules/es.array.slice.js");
36
-
37
3
  Object.defineProperty(exports, "__esModule", {
38
4
  value: true
39
5
  });
40
6
  exports.parameters = void 0;
41
7
 
42
- require("core-js/modules/es.object.to-string.js");
43
-
44
- require("core-js/modules/es.promise.js");
45
-
46
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
8
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
47
9
 
48
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
10
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
49
11
 
50
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
51
-
52
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
53
-
54
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
55
-
56
- var parameters = {
12
+ const parameters = {
57
13
  docs: {
58
- getContainer: function () {
59
- var _getContainer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
60
- return _regeneratorRuntime().wrap(function _callee$(_context) {
61
- while (1) {
62
- switch (_context.prev = _context.next) {
63
- case 0:
64
- _context.next = 2;
65
- return Promise.resolve().then(function () {
66
- return _interopRequireWildcard(require('./blocks'));
67
- });
68
-
69
- case 2:
70
- return _context.abrupt("return", _context.sent.DocsContainer);
71
-
72
- case 3:
73
- case "end":
74
- return _context.stop();
75
- }
76
- }
77
- }, _callee);
78
- }));
79
-
80
- function getContainer() {
81
- return _getContainer.apply(this, arguments);
82
- }
83
-
84
- return getContainer;
85
- }(),
86
- getPage: function () {
87
- var _getPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
88
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
89
- while (1) {
90
- switch (_context2.prev = _context2.next) {
91
- case 0:
92
- _context2.next = 2;
93
- return Promise.resolve().then(function () {
94
- return _interopRequireWildcard(require('./blocks'));
95
- });
96
-
97
- case 2:
98
- return _context2.abrupt("return", _context2.sent.DocsPage);
99
-
100
- case 3:
101
- case "end":
102
- return _context2.stop();
103
- }
104
- }
105
- }, _callee2);
106
- }));
107
-
108
- function getPage() {
109
- return _getPage.apply(this, arguments);
110
- }
111
-
112
- return getPage;
113
- }()
14
+ getContainer: async () => (await Promise.resolve().then(() => _interopRequireWildcard(require('./blocks')))).DocsContainer,
15
+ getPage: async () => (await Promise.resolve().then(() => _interopRequireWildcard(require('./blocks')))).DocsPage
114
16
  }
115
17
  };
116
18
  exports.parameters = parameters;