@storybook/addon-docs 7.0.0-alpha.6 → 7.0.0-alpha.60
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 +14 -77
- package/angular/index.js +1 -1
- package/dist/DocsRenderer-FLOC7YSC.mjs +1 -0
- package/dist/chunk-HXSBEJGO.mjs +1 -0
- package/dist/chunk-MA2MUXQN.mjs +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +1 -0
- package/dist/preset.d.ts +5 -0
- package/dist/preset.js +7 -0
- package/dist/preset.mjs +7 -0
- package/dist/preview.d.ts +3 -0
- package/dist/preview.js +1 -0
- package/dist/preview.mjs +1 -0
- package/dist/shims/mdx-react-shim.d.ts +1 -0
- package/dist/shims/mdx-react-shim.js +1 -0
- package/dist/shims/mdx-react-shim.mjs +1 -0
- package/jest-transform-mdx.js +4 -3
- package/jest.config.js +7 -0
- package/package.json +80 -46
- package/preset.js +1 -1
- package/preview.js +2 -1
- package/web-components/README.md +1 -0
- package/LICENSE +0 -21
- package/blocks.d.ts +0 -2
- package/blocks.js +0 -14
- package/dist/cjs/blocks/Anchor.js +0 -23
- package/dist/cjs/blocks/ArgsTable.js +0 -329
- package/dist/cjs/blocks/Canvas.js +0 -119
- package/dist/cjs/blocks/Description.js +0 -126
- package/dist/cjs/blocks/DocsContainer.js +0 -134
- package/dist/cjs/blocks/DocsContext.js +0 -25
- package/dist/cjs/blocks/DocsPage.js +0 -30
- package/dist/cjs/blocks/DocsRenderer.js +0 -50
- package/dist/cjs/blocks/DocsStory.js +0 -68
- package/dist/cjs/blocks/ExternalDocsContainer.js +0 -64
- package/dist/cjs/blocks/ExternalPreview.js +0 -99
- package/dist/cjs/blocks/Heading.js +0 -31
- package/dist/cjs/blocks/Meta.js +0 -64
- package/dist/cjs/blocks/Preview.js +0 -23
- package/dist/cjs/blocks/Primary.js +0 -39
- package/dist/cjs/blocks/Props.js +0 -29
- package/dist/cjs/blocks/Source.js +0 -185
- package/dist/cjs/blocks/SourceContainer.js +0 -67
- package/dist/cjs/blocks/Stories.js +0 -51
- package/dist/cjs/blocks/Story.js +0 -152
- package/dist/cjs/blocks/Subheading.js +0 -31
- package/dist/cjs/blocks/Subtitle.js +0 -39
- package/dist/cjs/blocks/Title.js +0 -44
- package/dist/cjs/blocks/Wrapper.js +0 -20
- package/dist/cjs/blocks/enhanceSource.js +0 -92
- package/dist/cjs/blocks/index.js +0 -394
- package/dist/cjs/blocks/mdx.js +0 -234
- package/dist/cjs/blocks/types.js +0 -10
- package/dist/cjs/blocks/useStory.js +0 -44
- package/dist/cjs/blocks/utils.js +0 -40
- package/dist/cjs/index.js +0 -18
- package/dist/cjs/manager.js +0 -20
- package/dist/cjs/preset.js +0 -162
- package/dist/cjs/preview.js +0 -22
- package/dist/cjs/shared.js +0 -22
- package/dist/esm/blocks/Anchor.js +0 -8
- package/dist/esm/blocks/ArgsTable.js +0 -292
- package/dist/esm/blocks/Canvas.js +0 -93
- package/dist/esm/blocks/Description.js +0 -107
- package/dist/esm/blocks/DocsContainer.js +0 -105
- package/dist/esm/blocks/DocsContext.js +0 -16
- package/dist/esm/blocks/DocsPage.js +0 -11
- package/dist/esm/blocks/DocsRenderer.js +0 -32
- package/dist/esm/blocks/DocsStory.js +0 -46
- package/dist/esm/blocks/ExternalDocsContainer.js +0 -48
- package/dist/esm/blocks/ExternalPreview.js +0 -89
- package/dist/esm/blocks/Heading.js +0 -17
- package/dist/esm/blocks/Meta.js +0 -45
- package/dist/esm/blocks/Preview.js +0 -9
- package/dist/esm/blocks/Primary.js +0 -23
- package/dist/esm/blocks/Props.js +0 -14
- package/dist/esm/blocks/Source.js +0 -150
- package/dist/esm/blocks/SourceContainer.js +0 -44
- package/dist/esm/blocks/Stories.js +0 -30
- package/dist/esm/blocks/Story.js +0 -123
- package/dist/esm/blocks/Subheading.js +0 -17
- package/dist/esm/blocks/Subtitle.js +0 -23
- package/dist/esm/blocks/Title.js +0 -24
- package/dist/esm/blocks/Wrapper.js +0 -8
- package/dist/esm/blocks/enhanceSource.js +0 -87
- package/dist/esm/blocks/index.js +0 -27
- package/dist/esm/blocks/mdx.js +0 -203
- package/dist/esm/blocks/types.js +0 -2
- package/dist/esm/blocks/useStory.js +0 -34
- package/dist/esm/blocks/utils.js +0 -29
- package/dist/esm/index.js +0 -1
- package/dist/esm/manager.js +0 -16
- package/dist/esm/preset.js +0 -132
- package/dist/esm/preview.js +0 -10
- package/dist/esm/shared.js +0 -11
- package/dist/types/blocks/Anchor.d.ts +0 -6
- package/dist/types/blocks/ArgsTable.d.ts +0 -33
- package/dist/types/blocks/Canvas.d.ts +0 -9
- package/dist/types/blocks/Description.d.ts +0 -20
- package/dist/types/blocks/DocsContainer.d.ts +0 -7
- package/dist/types/blocks/DocsContext.d.ts +0 -5
- package/dist/types/blocks/DocsPage.d.ts +0 -2
- package/dist/types/blocks/DocsRenderer.d.ts +0 -7
- package/dist/types/blocks/DocsStory.d.ts +0 -3
- package/dist/types/blocks/ExternalDocsContainer.d.ts +0 -4
- package/dist/types/blocks/ExternalPreview.d.ts +0 -19
- package/dist/types/blocks/Heading.d.ts +0 -6
- package/dist/types/blocks/Meta.d.ts +0 -12
- package/dist/types/blocks/Preview.d.ts +0 -3
- package/dist/types/blocks/Primary.d.ts +0 -6
- package/dist/types/blocks/Props.d.ts +0 -3
- package/dist/types/blocks/Source.d.ts +0 -38
- package/dist/types/blocks/SourceContainer.d.ts +0 -14
- package/dist/types/blocks/Stories.d.ts +0 -7
- package/dist/types/blocks/Story.d.ts +0 -30
- package/dist/types/blocks/Subheading.d.ts +0 -3
- package/dist/types/blocks/Subtitle.d.ts +0 -6
- package/dist/types/blocks/Title.d.ts +0 -8
- package/dist/types/blocks/Wrapper.d.ts +0 -2
- package/dist/types/blocks/enhanceSource.d.ts +0 -3
- package/dist/types/blocks/index.d.ts +0 -26
- package/dist/types/blocks/mdx.d.ts +0 -20
- package/dist/types/blocks/types.d.ts +0 -13
- package/dist/types/blocks/useStory.d.ts +0 -5
- package/dist/types/blocks/utils.d.ts +0 -3
- package/dist/types/index.d.ts +0 -1
- package/dist/types/manager.d.ts +0 -1
- package/dist/types/preset.d.ts +0 -12
- package/dist/types/preview.d.ts +0 -5
- package/dist/types/shared.d.ts +0 -24
- package/manager.js +0 -1
- package/mdx-compiler-plugin.js +0 -1
- package/register.js +0 -6
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getSourceProps = exports.SourceState = exports.Source = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
|
-
var _components = require("@storybook/components");
|
|
11
|
-
|
|
12
|
-
var _DocsContext = require("./DocsContext");
|
|
13
|
-
|
|
14
|
-
var _SourceContainer = require("./SourceContainer");
|
|
15
|
-
|
|
16
|
-
var _types = require("./types");
|
|
17
|
-
|
|
18
|
-
var _shared = require("../shared");
|
|
19
|
-
|
|
20
|
-
var _enhanceSource = require("./enhanceSource");
|
|
21
|
-
|
|
22
|
-
var _useStory = require("./useStory");
|
|
23
|
-
|
|
24
|
-
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); }
|
|
25
|
-
|
|
26
|
-
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; }
|
|
27
|
-
|
|
28
|
-
let SourceState;
|
|
29
|
-
exports.SourceState = SourceState;
|
|
30
|
-
|
|
31
|
-
(function (SourceState) {
|
|
32
|
-
SourceState["OPEN"] = "open";
|
|
33
|
-
SourceState["CLOSED"] = "closed";
|
|
34
|
-
SourceState["NONE"] = "none";
|
|
35
|
-
})(SourceState || (exports.SourceState = SourceState = {}));
|
|
36
|
-
|
|
37
|
-
const getSourceState = stories => {
|
|
38
|
-
const states = stories.map(story => {
|
|
39
|
-
var _story$parameters$doc, _story$parameters$doc2;
|
|
40
|
-
|
|
41
|
-
return (_story$parameters$doc = story.parameters.docs) === null || _story$parameters$doc === void 0 ? void 0 : (_story$parameters$doc2 = _story$parameters$doc.source) === null || _story$parameters$doc2 === void 0 ? void 0 : _story$parameters$doc2.state;
|
|
42
|
-
}).filter(Boolean);
|
|
43
|
-
if (states.length === 0) return SourceState.CLOSED; // FIXME: handling multiple stories is a pain
|
|
44
|
-
|
|
45
|
-
return states[0];
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const getStorySource = (storyId, sourceContext) => {
|
|
49
|
-
const {
|
|
50
|
-
sources
|
|
51
|
-
} = sourceContext; // source rendering is async so source is unavailable at the start of the render cycle,
|
|
52
|
-
// so we fail gracefully here without warning
|
|
53
|
-
|
|
54
|
-
return (sources === null || sources === void 0 ? void 0 : sources[storyId]) || {
|
|
55
|
-
code: '',
|
|
56
|
-
format: false
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
const getSnippet = (snippet, story) => {
|
|
61
|
-
var _parameters$docs, _parameters$docs$sour, _parameters$docs2, _parameters$docs2$sou, _enhanced$docs, _enhanced$docs$source;
|
|
62
|
-
|
|
63
|
-
if (!story) {
|
|
64
|
-
return snippet;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const {
|
|
68
|
-
parameters
|
|
69
|
-
} = story; // eslint-disable-next-line no-underscore-dangle
|
|
70
|
-
|
|
71
|
-
const isArgsStory = parameters.__isArgsStory;
|
|
72
|
-
const type = ((_parameters$docs = parameters.docs) === null || _parameters$docs === void 0 ? void 0 : (_parameters$docs$sour = _parameters$docs.source) === null || _parameters$docs$sour === void 0 ? void 0 : _parameters$docs$sour.type) || _shared.SourceType.AUTO; // if user has hard-coded the snippet, that takes precedence
|
|
73
|
-
|
|
74
|
-
const userCode = (_parameters$docs2 = parameters.docs) === null || _parameters$docs2 === void 0 ? void 0 : (_parameters$docs2$sou = _parameters$docs2.source) === null || _parameters$docs2$sou === void 0 ? void 0 : _parameters$docs2$sou.code;
|
|
75
|
-
|
|
76
|
-
if (userCode !== undefined) {
|
|
77
|
-
return userCode;
|
|
78
|
-
} // if user has explicitly set this as dynamic, use snippet
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if (type === _shared.SourceType.DYNAMIC) {
|
|
82
|
-
var _parameters$docs3, _parameters$docs3$tra;
|
|
83
|
-
|
|
84
|
-
return ((_parameters$docs3 = parameters.docs) === null || _parameters$docs3 === void 0 ? void 0 : (_parameters$docs3$tra = _parameters$docs3.transformSource) === null || _parameters$docs3$tra === void 0 ? void 0 : _parameters$docs3$tra.call(_parameters$docs3, snippet, story)) || snippet;
|
|
85
|
-
} // if this is an args story and there's a snippet
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if (type === _shared.SourceType.AUTO && snippet && isArgsStory) {
|
|
89
|
-
var _parameters$docs4, _parameters$docs4$tra;
|
|
90
|
-
|
|
91
|
-
return ((_parameters$docs4 = parameters.docs) === null || _parameters$docs4 === void 0 ? void 0 : (_parameters$docs4$tra = _parameters$docs4.transformSource) === null || _parameters$docs4$tra === void 0 ? void 0 : _parameters$docs4$tra.call(_parameters$docs4, snippet, story)) || snippet;
|
|
92
|
-
} // otherwise, use the source code logic
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const enhanced = (0, _enhanceSource.enhanceSource)(story) || parameters;
|
|
96
|
-
return (enhanced === null || enhanced === void 0 ? void 0 : (_enhanced$docs = enhanced.docs) === null || _enhanced$docs === void 0 ? void 0 : (_enhanced$docs$source = _enhanced$docs.source) === null || _enhanced$docs$source === void 0 ? void 0 : _enhanced$docs$source.code) || '';
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
const getSourceProps = (props, docsContext, sourceContext) => {
|
|
100
|
-
const {
|
|
101
|
-
id: currentId,
|
|
102
|
-
storyById
|
|
103
|
-
} = docsContext;
|
|
104
|
-
let parameters = {};
|
|
105
|
-
|
|
106
|
-
try {
|
|
107
|
-
({
|
|
108
|
-
parameters
|
|
109
|
-
} = storyById(currentId));
|
|
110
|
-
} catch (err) {// TODO: in external mode, there is no "current"
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
const codeProps = props;
|
|
114
|
-
const singleProps = props;
|
|
115
|
-
const multiProps = props;
|
|
116
|
-
let source = codeProps.code; // prefer user-specified code
|
|
117
|
-
|
|
118
|
-
let {
|
|
119
|
-
format
|
|
120
|
-
} = codeProps; // prefer user-specified code
|
|
121
|
-
|
|
122
|
-
const targetIds = multiProps.ids || [singleProps.id || currentId];
|
|
123
|
-
const storyIds = targetIds.map(targetId => targetId === _types.CURRENT_SELECTION ? currentId : targetId);
|
|
124
|
-
const stories = (0, _useStory.useStories)(storyIds, docsContext);
|
|
125
|
-
|
|
126
|
-
if (!stories.every(Boolean)) {
|
|
127
|
-
return {
|
|
128
|
-
error: _components.SourceError.SOURCE_UNAVAILABLE,
|
|
129
|
-
state: SourceState.NONE
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
if (!source) {
|
|
134
|
-
// just take the format from the first story, given how they're all concatinated together...
|
|
135
|
-
// TODO: we should consider sending an event with all the sources separately, instead of concatenating them here
|
|
136
|
-
({
|
|
137
|
-
format
|
|
138
|
-
} = getStorySource(storyIds[0], sourceContext));
|
|
139
|
-
source = storyIds.map((storyId, idx) => {
|
|
140
|
-
const {
|
|
141
|
-
code: storySource
|
|
142
|
-
} = getStorySource(storyId, sourceContext);
|
|
143
|
-
const storyObj = stories[idx];
|
|
144
|
-
return getSnippet(storySource, storyObj);
|
|
145
|
-
}).join('\n\n');
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
const state = getSourceState(stories);
|
|
149
|
-
const {
|
|
150
|
-
docs: docsParameters = {}
|
|
151
|
-
} = parameters;
|
|
152
|
-
const {
|
|
153
|
-
source: sourceParameters = {}
|
|
154
|
-
} = docsParameters;
|
|
155
|
-
const {
|
|
156
|
-
language: docsLanguage = null
|
|
157
|
-
} = sourceParameters;
|
|
158
|
-
return source ? {
|
|
159
|
-
code: source,
|
|
160
|
-
state,
|
|
161
|
-
format,
|
|
162
|
-
language: props.language || docsLanguage || 'jsx',
|
|
163
|
-
dark: props.dark || false
|
|
164
|
-
} : {
|
|
165
|
-
error: _components.SourceError.SOURCE_UNAVAILABLE,
|
|
166
|
-
state
|
|
167
|
-
};
|
|
168
|
-
};
|
|
169
|
-
/**
|
|
170
|
-
* Story source doc block renders source code if provided,
|
|
171
|
-
* or the source for a story if `storyId` is provided, or
|
|
172
|
-
* the source for the current story if nothing is provided.
|
|
173
|
-
*/
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
exports.getSourceProps = getSourceProps;
|
|
177
|
-
|
|
178
|
-
const Source = props => {
|
|
179
|
-
const sourceContext = (0, _react.useContext)(_SourceContainer.SourceContext);
|
|
180
|
-
const docsContext = (0, _react.useContext)(_DocsContext.DocsContext);
|
|
181
|
-
const sourceProps = getSourceProps(props, docsContext, sourceContext);
|
|
182
|
-
return /*#__PURE__*/_react.default.createElement(_components.Source, sourceProps);
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
exports.Source = Source;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.SourceContext = exports.SourceContainer = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
|
-
var _fastDeepEqual = _interopRequireDefault(require("fast-deep-equal"));
|
|
11
|
-
|
|
12
|
-
var _addons = require("@storybook/addons");
|
|
13
|
-
|
|
14
|
-
var _shared = require("../shared");
|
|
15
|
-
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
|
-
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); }
|
|
19
|
-
|
|
20
|
-
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; }
|
|
21
|
-
|
|
22
|
-
const SourceContext = /*#__PURE__*/(0, _react.createContext)({
|
|
23
|
-
sources: {}
|
|
24
|
-
});
|
|
25
|
-
exports.SourceContext = SourceContext;
|
|
26
|
-
|
|
27
|
-
const SourceContainer = ({
|
|
28
|
-
children
|
|
29
|
-
}) => {
|
|
30
|
-
const [sources, setSources] = (0, _react.useState)({});
|
|
31
|
-
|
|
32
|
-
const channel = _addons.addons.getChannel();
|
|
33
|
-
|
|
34
|
-
(0, _react.useEffect)(() => {
|
|
35
|
-
const handleSnippetRendered = (id, newSource, format = false) => {
|
|
36
|
-
// optimization: if the source is the same, ignore the incoming event
|
|
37
|
-
if (sources[id] && sources[id].code === newSource) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
setSources(current => {
|
|
42
|
-
const newSources = Object.assign({}, current, {
|
|
43
|
-
[id]: {
|
|
44
|
-
code: newSource,
|
|
45
|
-
format
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
if (!(0, _fastDeepEqual.default)(current, newSources)) {
|
|
50
|
-
return newSources;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return current;
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
channel.on(_shared.SNIPPET_RENDERED, handleSnippetRendered);
|
|
58
|
-
return () => channel.off(_shared.SNIPPET_RENDERED, handleSnippetRendered);
|
|
59
|
-
}, []);
|
|
60
|
-
return /*#__PURE__*/_react.default.createElement(SourceContext.Provider, {
|
|
61
|
-
value: {
|
|
62
|
-
sources
|
|
63
|
-
}
|
|
64
|
-
}, children);
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
exports.SourceContainer = SourceContainer;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Stories = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
|
-
var _DocsContext = require("./DocsContext");
|
|
11
|
-
|
|
12
|
-
var _DocsStory = require("./DocsStory");
|
|
13
|
-
|
|
14
|
-
var _Heading = require("./Heading");
|
|
15
|
-
|
|
16
|
-
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); }
|
|
17
|
-
|
|
18
|
-
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; }
|
|
19
|
-
|
|
20
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
21
|
-
|
|
22
|
-
const Stories = ({
|
|
23
|
-
title,
|
|
24
|
-
includePrimary = false
|
|
25
|
-
}) => {
|
|
26
|
-
const {
|
|
27
|
-
componentStories
|
|
28
|
-
} = (0, _react.useContext)(_DocsContext.DocsContext);
|
|
29
|
-
let stories = componentStories();
|
|
30
|
-
stories = stories.filter(story => {
|
|
31
|
-
var _story$parameters, _story$parameters$doc;
|
|
32
|
-
|
|
33
|
-
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);
|
|
34
|
-
});
|
|
35
|
-
if (!includePrimary) stories = stories.slice(1);
|
|
36
|
-
|
|
37
|
-
if (!stories || stories.length === 0) {
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Heading.Heading, null, title), stories.map(story => story && /*#__PURE__*/_react.default.createElement(_DocsStory.DocsStory, _extends({
|
|
42
|
-
key: story.id
|
|
43
|
-
}, story, {
|
|
44
|
-
expanded: true
|
|
45
|
-
}))));
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
exports.Stories = Stories;
|
|
49
|
-
Stories.defaultProps = {
|
|
50
|
-
title: 'Stories'
|
|
51
|
-
};
|
package/dist/cjs/blocks/Story.js
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.storyBlockIdFromId = exports.lookupStoryId = exports.getStoryProps = exports.getStoryId = exports.Story = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
|
-
var _react2 = require("@mdx-js/react");
|
|
11
|
-
|
|
12
|
-
var _components = require("@storybook/components");
|
|
13
|
-
|
|
14
|
-
var _csf = require("@storybook/csf");
|
|
15
|
-
|
|
16
|
-
var _types = require("./types");
|
|
17
|
-
|
|
18
|
-
var _DocsContext = require("./DocsContext");
|
|
19
|
-
|
|
20
|
-
var _useStory = require("./useStory");
|
|
21
|
-
|
|
22
|
-
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); }
|
|
23
|
-
|
|
24
|
-
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; }
|
|
25
|
-
|
|
26
|
-
const storyBlockIdFromId = storyId => `story--${storyId}`;
|
|
27
|
-
|
|
28
|
-
exports.storyBlockIdFromId = storyBlockIdFromId;
|
|
29
|
-
|
|
30
|
-
const lookupStoryId = (storyName, {
|
|
31
|
-
mdxStoryNameToKey,
|
|
32
|
-
mdxComponentAnnotations
|
|
33
|
-
}) => (0, _csf.toId)(mdxComponentAnnotations.id || mdxComponentAnnotations.title, (0, _csf.storyNameFromExport)(mdxStoryNameToKey[storyName]));
|
|
34
|
-
|
|
35
|
-
exports.lookupStoryId = lookupStoryId;
|
|
36
|
-
|
|
37
|
-
const getStoryId = (props, context) => {
|
|
38
|
-
const {
|
|
39
|
-
id,
|
|
40
|
-
of,
|
|
41
|
-
meta
|
|
42
|
-
} = props;
|
|
43
|
-
|
|
44
|
-
if (of) {
|
|
45
|
-
return context.storyIdByModuleExport(of, meta);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const {
|
|
49
|
-
name
|
|
50
|
-
} = props;
|
|
51
|
-
const inputId = id === _types.CURRENT_SELECTION ? context.id : id;
|
|
52
|
-
return inputId || lookupStoryId(name, context);
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
exports.getStoryId = getStoryId;
|
|
56
|
-
|
|
57
|
-
const getStoryProps = ({
|
|
58
|
-
height,
|
|
59
|
-
inline
|
|
60
|
-
}, story) => {
|
|
61
|
-
const {
|
|
62
|
-
name: storyName,
|
|
63
|
-
parameters = {}
|
|
64
|
-
} = story || {};
|
|
65
|
-
const {
|
|
66
|
-
docs = {}
|
|
67
|
-
} = parameters;
|
|
68
|
-
|
|
69
|
-
if (docs.disable) {
|
|
70
|
-
return null;
|
|
71
|
-
} // prefer block props, then story parameters defined by the framework-specific settings and optionally overridden by users
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const {
|
|
75
|
-
inlineStories = false,
|
|
76
|
-
iframeHeight = 100
|
|
77
|
-
} = docs;
|
|
78
|
-
const storyIsInline = typeof inline === 'boolean' ? inline : inlineStories;
|
|
79
|
-
return Object.assign({
|
|
80
|
-
inline: storyIsInline,
|
|
81
|
-
id: story === null || story === void 0 ? void 0 : story.id,
|
|
82
|
-
height: height || (storyIsInline ? undefined : iframeHeight),
|
|
83
|
-
title: storyName
|
|
84
|
-
}, storyIsInline && {
|
|
85
|
-
parameters
|
|
86
|
-
});
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
exports.getStoryProps = getStoryProps;
|
|
90
|
-
|
|
91
|
-
const Story = props => {
|
|
92
|
-
const context = (0, _react.useContext)(_DocsContext.DocsContext);
|
|
93
|
-
const storyRef = (0, _react.useRef)();
|
|
94
|
-
const storyId = getStoryId(props, context);
|
|
95
|
-
const story = (0, _useStory.useStory)(storyId, context);
|
|
96
|
-
const [showLoader, setShowLoader] = (0, _react.useState)(true);
|
|
97
|
-
(0, _react.useEffect)(() => {
|
|
98
|
-
let cleanup;
|
|
99
|
-
|
|
100
|
-
if (story && storyRef.current) {
|
|
101
|
-
const element = storyRef.current;
|
|
102
|
-
cleanup = context.renderStoryToElement(story, element);
|
|
103
|
-
setShowLoader(false);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
return () => cleanup && cleanup();
|
|
107
|
-
}, [story]);
|
|
108
|
-
|
|
109
|
-
if (!story) {
|
|
110
|
-
return /*#__PURE__*/_react.default.createElement(_components.StorySkeleton, null);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
const storyProps = getStoryProps(props, story);
|
|
114
|
-
|
|
115
|
-
if (!storyProps) {
|
|
116
|
-
return null;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
const inline = context.type === 'external' || storyProps.inline;
|
|
120
|
-
|
|
121
|
-
if (inline) {
|
|
122
|
-
// We do this so React doesn't complain when we replace the span in a secondary render
|
|
123
|
-
const htmlContents = `<span></span>`; // FIXME: height/style/etc. lifted from PureStory
|
|
124
|
-
|
|
125
|
-
const {
|
|
126
|
-
height
|
|
127
|
-
} = storyProps;
|
|
128
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
129
|
-
id: storyBlockIdFromId(story.id)
|
|
130
|
-
}, /*#__PURE__*/_react.default.createElement(_react2.MDXProvider, {
|
|
131
|
-
components: _components.resetComponents
|
|
132
|
-
}, height ? /*#__PURE__*/_react.default.createElement("style", null, `#story--${story.id} { min-height: ${height}px; transform: translateZ(0); overflow: auto }`) : null, showLoader && /*#__PURE__*/_react.default.createElement(_components.StorySkeleton, null), /*#__PURE__*/_react.default.createElement("div", {
|
|
133
|
-
ref: storyRef,
|
|
134
|
-
"data-name": story.name,
|
|
135
|
-
dangerouslySetInnerHTML: {
|
|
136
|
-
__html: htmlContents
|
|
137
|
-
}
|
|
138
|
-
})));
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
142
|
-
id: storyBlockIdFromId(story.id)
|
|
143
|
-
}, /*#__PURE__*/_react.default.createElement(_react2.MDXProvider, {
|
|
144
|
-
components: _components.resetComponents
|
|
145
|
-
}, /*#__PURE__*/_react.default.createElement(_components.Story, storyProps)));
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
exports.Story = Story;
|
|
149
|
-
Story.defaultProps = {
|
|
150
|
-
children: null,
|
|
151
|
-
name: null
|
|
152
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Subheading = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
var _components = require("@storybook/components");
|
|
11
|
-
|
|
12
|
-
var _mdx = require("./mdx");
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
const Subheading = ({
|
|
17
|
-
children,
|
|
18
|
-
disableAnchor
|
|
19
|
-
}) => {
|
|
20
|
-
if (disableAnchor || typeof children !== 'string') {
|
|
21
|
-
return /*#__PURE__*/_react.default.createElement(_components.H3, null, children);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const tagID = children.toLowerCase().replace(/[^a-z0-9]/gi, '-');
|
|
25
|
-
return /*#__PURE__*/_react.default.createElement(_mdx.HeaderMdx, {
|
|
26
|
-
as: "h3",
|
|
27
|
-
id: tagID
|
|
28
|
-
}, children);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
exports.Subheading = Subheading;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Subtitle = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
|
-
var _components = require("@storybook/components");
|
|
11
|
-
|
|
12
|
-
var _DocsContext = require("./DocsContext");
|
|
13
|
-
|
|
14
|
-
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); }
|
|
15
|
-
|
|
16
|
-
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; }
|
|
17
|
-
|
|
18
|
-
const Subtitle = ({
|
|
19
|
-
children
|
|
20
|
-
}) => {
|
|
21
|
-
const {
|
|
22
|
-
id,
|
|
23
|
-
storyById
|
|
24
|
-
} = (0, _react.useContext)(_DocsContext.DocsContext);
|
|
25
|
-
const {
|
|
26
|
-
parameters
|
|
27
|
-
} = storyById(id);
|
|
28
|
-
let text = children;
|
|
29
|
-
|
|
30
|
-
if (!text) {
|
|
31
|
-
text = parameters === null || parameters === void 0 ? void 0 : parameters.componentSubtitle;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return text ? /*#__PURE__*/_react.default.createElement(_components.Subtitle, {
|
|
35
|
-
className: "sbdocs-subtitle"
|
|
36
|
-
}, text) : null;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
exports.Subtitle = Subtitle;
|
package/dist/cjs/blocks/Title.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.extractTitle = exports.Title = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
|
-
var _components = require("@storybook/components");
|
|
11
|
-
|
|
12
|
-
var _DocsContext = require("./DocsContext");
|
|
13
|
-
|
|
14
|
-
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); }
|
|
15
|
-
|
|
16
|
-
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; }
|
|
17
|
-
|
|
18
|
-
const STORY_KIND_PATH_SEPARATOR = /\s*\/\s*/;
|
|
19
|
-
|
|
20
|
-
const extractTitle = ({
|
|
21
|
-
title
|
|
22
|
-
}) => {
|
|
23
|
-
const groups = title.trim().split(STORY_KIND_PATH_SEPARATOR);
|
|
24
|
-
return groups && groups[groups.length - 1] || title;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
exports.extractTitle = extractTitle;
|
|
28
|
-
|
|
29
|
-
const Title = ({
|
|
30
|
-
children
|
|
31
|
-
}) => {
|
|
32
|
-
const context = (0, _react.useContext)(_DocsContext.DocsContext);
|
|
33
|
-
let text = children;
|
|
34
|
-
|
|
35
|
-
if (!text) {
|
|
36
|
-
text = extractTitle(context);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return text ? /*#__PURE__*/_react.default.createElement(_components.Title, {
|
|
40
|
-
className: "sbdocs-title"
|
|
41
|
-
}, text) : null;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
exports.Title = Title;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Wrapper = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
|
-
const Wrapper = ({
|
|
13
|
-
children
|
|
14
|
-
}) => /*#__PURE__*/_react.default.createElement("div", {
|
|
15
|
-
style: {
|
|
16
|
-
fontFamily: 'sans-serif'
|
|
17
|
-
}
|
|
18
|
-
}, children);
|
|
19
|
-
|
|
20
|
-
exports.Wrapper = Wrapper;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.enhanceSource = void 0;
|
|
7
|
-
|
|
8
|
-
var _store = require("@storybook/store");
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* given a location, extract the text from the full source
|
|
12
|
-
*/
|
|
13
|
-
function extractSource(location, lines) {
|
|
14
|
-
const {
|
|
15
|
-
startBody: start,
|
|
16
|
-
endBody: end
|
|
17
|
-
} = location;
|
|
18
|
-
|
|
19
|
-
if (start.line === end.line && lines[start.line - 1] !== undefined) {
|
|
20
|
-
return lines[start.line - 1].substring(start.col, end.col);
|
|
21
|
-
} // NOTE: storysource locations are 1-based not 0-based!
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const startLine = lines[start.line - 1];
|
|
25
|
-
const endLine = lines[end.line - 1];
|
|
26
|
-
|
|
27
|
-
if (startLine === undefined || endLine === undefined) {
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return [startLine.substring(start.col), ...lines.slice(start.line, end.line - 1), endLine.substring(0, end.col)].join('\n');
|
|
32
|
-
} // ============================================================
|
|
33
|
-
// END @storybook/source-loader/extract-source
|
|
34
|
-
// ============================================================
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Replaces full story id name like: story-kind--story-name -> story-name
|
|
39
|
-
* @param id
|
|
40
|
-
*/
|
|
41
|
-
const storyIdToSanitizedStoryName = id => id.replace(/^.*?--/, '');
|
|
42
|
-
|
|
43
|
-
const extract = (targetId, {
|
|
44
|
-
source,
|
|
45
|
-
locationsMap
|
|
46
|
-
}) => {
|
|
47
|
-
if (!locationsMap) {
|
|
48
|
-
return source;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const sanitizedStoryName = storyIdToSanitizedStoryName(targetId);
|
|
52
|
-
const location = locationsMap[sanitizedStoryName];
|
|
53
|
-
|
|
54
|
-
if (!location) {
|
|
55
|
-
return source;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const lines = source.split('\n');
|
|
59
|
-
return extractSource(location, lines);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const enhanceSource = story => {
|
|
63
|
-
var _docs$source;
|
|
64
|
-
|
|
65
|
-
const {
|
|
66
|
-
id,
|
|
67
|
-
parameters
|
|
68
|
-
} = story;
|
|
69
|
-
const {
|
|
70
|
-
storySource,
|
|
71
|
-
docs = {}
|
|
72
|
-
} = parameters;
|
|
73
|
-
const {
|
|
74
|
-
transformSource
|
|
75
|
-
} = docs; // no input or user has manually overridden the output
|
|
76
|
-
|
|
77
|
-
if (!(storySource !== null && storySource !== void 0 && storySource.source) || (_docs$source = docs.source) !== null && _docs$source !== void 0 && _docs$source.code) {
|
|
78
|
-
return null;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const input = extract(id, storySource);
|
|
82
|
-
const code = transformSource ? transformSource(input, story) : input;
|
|
83
|
-
return {
|
|
84
|
-
docs: (0, _store.combineParameters)(docs, {
|
|
85
|
-
source: {
|
|
86
|
-
code
|
|
87
|
-
}
|
|
88
|
-
})
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
exports.enhanceSource = enhanceSource;
|