@storybook/addon-docs 6.5.0-beta.1 → 6.5.0-beta.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.
|
@@ -57,6 +57,8 @@ var _Source = require("./Source");
|
|
|
57
57
|
|
|
58
58
|
var _useStory = require("./useStory");
|
|
59
59
|
|
|
60
|
+
var _types = require("./types");
|
|
61
|
+
|
|
60
62
|
var _excluded = ["withSource", "mdxSource", "children"];
|
|
61
63
|
|
|
62
64
|
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); }
|
|
@@ -107,7 +109,10 @@ var getPreviewProps = function getPreviewProps(_ref, docsContext, sourceContext)
|
|
|
107
109
|
ids: targetIds
|
|
108
110
|
}, docsContext, sourceContext);
|
|
109
111
|
if (!sourceState) sourceState = sourceProps.state;
|
|
110
|
-
var
|
|
112
|
+
var storyIds = targetIds.map(function (targetId) {
|
|
113
|
+
return targetId === _types.CURRENT_SELECTION ? docsContext.id : targetId;
|
|
114
|
+
});
|
|
115
|
+
var stories = (0, _useStory.useStories)(storyIds, docsContext);
|
|
111
116
|
isLoading = stories.some(function (s) {
|
|
112
117
|
return !s;
|
|
113
118
|
});
|
|
@@ -19,6 +19,7 @@ import { DocsContext } from './DocsContext';
|
|
|
19
19
|
import { SourceContext } from './SourceContainer';
|
|
20
20
|
import { getSourceProps, SourceState } from './Source';
|
|
21
21
|
import { useStories } from './useStory';
|
|
22
|
+
import { CURRENT_SELECTION } from './types';
|
|
22
23
|
export { SourceState };
|
|
23
24
|
|
|
24
25
|
var getPreviewProps = function getPreviewProps(_ref, docsContext, sourceContext) {
|
|
@@ -61,7 +62,10 @@ var getPreviewProps = function getPreviewProps(_ref, docsContext, sourceContext)
|
|
|
61
62
|
ids: targetIds
|
|
62
63
|
}, docsContext, sourceContext);
|
|
63
64
|
if (!sourceState) sourceState = sourceProps.state;
|
|
64
|
-
var
|
|
65
|
+
var storyIds = targetIds.map(function (targetId) {
|
|
66
|
+
return targetId === CURRENT_SELECTION ? docsContext.id : targetId;
|
|
67
|
+
});
|
|
68
|
+
var stories = useStories(storyIds, docsContext);
|
|
65
69
|
isLoading = stories.some(function (s) {
|
|
66
70
|
return !s;
|
|
67
71
|
});
|
|
@@ -10,6 +10,7 @@ import { DocsContext } from './DocsContext';
|
|
|
10
10
|
import { SourceContext } from './SourceContainer';
|
|
11
11
|
import { getSourceProps, SourceState } from './Source';
|
|
12
12
|
import { useStories } from './useStory';
|
|
13
|
+
import { CURRENT_SELECTION } from './types';
|
|
13
14
|
export { SourceState };
|
|
14
15
|
|
|
15
16
|
const getPreviewProps = (_ref, docsContext, sourceContext) => {
|
|
@@ -52,7 +53,8 @@ const getPreviewProps = (_ref, docsContext, sourceContext) => {
|
|
|
52
53
|
ids: targetIds
|
|
53
54
|
}, docsContext, sourceContext);
|
|
54
55
|
if (!sourceState) sourceState = sourceProps.state;
|
|
55
|
-
const
|
|
56
|
+
const storyIds = targetIds.map(targetId => targetId === CURRENT_SELECTION ? docsContext.id : targetId);
|
|
57
|
+
const stories = useStories(storyIds, docsContext);
|
|
56
58
|
isLoading = stories.some(s => !s);
|
|
57
59
|
return {
|
|
58
60
|
isLoading,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/addon-docs",
|
|
3
|
-
"version": "6.5.0-beta.
|
|
3
|
+
"version": "6.5.0-beta.4",
|
|
4
4
|
"description": "Document component usage and properties in Markdown",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"addon",
|
|
@@ -59,20 +59,20 @@
|
|
|
59
59
|
"@babel/preset-env": "^7.12.11",
|
|
60
60
|
"@jest/transform": "^26.6.2",
|
|
61
61
|
"@mdx-js/react": "^1.6.22",
|
|
62
|
-
"@storybook/addons": "6.5.0-beta.
|
|
63
|
-
"@storybook/api": "6.5.0-beta.
|
|
64
|
-
"@storybook/components": "6.5.0-beta.
|
|
65
|
-
"@storybook/core-common": "6.5.0-beta.
|
|
66
|
-
"@storybook/core-events": "6.5.0-beta.
|
|
62
|
+
"@storybook/addons": "6.5.0-beta.4",
|
|
63
|
+
"@storybook/api": "6.5.0-beta.4",
|
|
64
|
+
"@storybook/components": "6.5.0-beta.4",
|
|
65
|
+
"@storybook/core-common": "6.5.0-beta.4",
|
|
66
|
+
"@storybook/core-events": "6.5.0-beta.4",
|
|
67
67
|
"@storybook/csf": "0.0.2--canary.4566f4d.1",
|
|
68
|
-
"@storybook/docs-tools": "6.5.0-beta.
|
|
68
|
+
"@storybook/docs-tools": "6.5.0-beta.4",
|
|
69
69
|
"@storybook/mdx1-csf": "canary",
|
|
70
|
-
"@storybook/node-logger": "6.5.0-beta.
|
|
71
|
-
"@storybook/postinstall": "6.5.0-beta.
|
|
72
|
-
"@storybook/preview-web": "6.5.0-beta.
|
|
73
|
-
"@storybook/source-loader": "6.5.0-beta.
|
|
74
|
-
"@storybook/store": "6.5.0-beta.
|
|
75
|
-
"@storybook/theming": "6.5.0-beta.
|
|
70
|
+
"@storybook/node-logger": "6.5.0-beta.4",
|
|
71
|
+
"@storybook/postinstall": "6.5.0-beta.4",
|
|
72
|
+
"@storybook/preview-web": "6.5.0-beta.4",
|
|
73
|
+
"@storybook/source-loader": "6.5.0-beta.4",
|
|
74
|
+
"@storybook/store": "6.5.0-beta.4",
|
|
75
|
+
"@storybook/theming": "6.5.0-beta.4",
|
|
76
76
|
"babel-loader": "^8.0.0",
|
|
77
77
|
"core-js": "^3.8.2",
|
|
78
78
|
"fast-deep-equal": "^3.1.3",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"publishConfig": {
|
|
109
109
|
"access": "public"
|
|
110
110
|
},
|
|
111
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "55247a8e36da7061bfced80c588a539d3fda3f04",
|
|
112
112
|
"sbmodern": "dist/modern/index.js",
|
|
113
113
|
"storybook": {
|
|
114
114
|
"displayName": "Docs",
|