1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.withMarkdownNotes = exports.withNotes = void 0;
|
7 |
|
8 | var _addons = require("@storybook/addons");
|
9 |
|
10 | var _utilDeprecate = _interopRequireDefault(require("util-deprecate"));
|
11 |
|
12 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
13 |
|
14 |
|
15 | var withNotes = (0, _addons.makeDecorator)({
|
16 | name: 'withNotes',
|
17 | parameterName: 'notes',
|
18 | skipIfNoParametersOrOptions: true,
|
19 | allowDeprecatedUsage: true,
|
20 | wrapper: (0, _utilDeprecate["default"])(function (getStory, context, _ref) {
|
21 | var options = _ref.options,
|
22 | parameters = _ref.parameters;
|
23 | var storyOptions = parameters || options;
|
24 |
|
25 | var _ref2 = typeof storyOptions === 'string' ? {
|
26 | text: storyOptions,
|
27 | markdown: undefined
|
28 | } : storyOptions,
|
29 | text = _ref2.text,
|
30 | markdown = _ref2.markdown;
|
31 |
|
32 | if (!text && !markdown) {
|
33 | throw new Error("Parameter 'notes' must must be a string or an object with 'text' or 'markdown' properties");
|
34 | }
|
35 |
|
36 | return getStory(context);
|
37 | }, 'withNotes is deprecated')
|
38 | });
|
39 | exports.withNotes = withNotes;
|
40 | var withMarkdownNotes = (0, _utilDeprecate["default"])(function (text, options) {}, 'withMarkdownNotes is deprecated');
|
41 | exports.withMarkdownNotes = withMarkdownNotes;
|
42 |
|
43 | if (module && module.hot && module.hot.decline) {
|
44 | module.hot.decline();
|
45 | } |
\ | No newline at end of file |