@storybook/vue3 11.0.0-alpha.1 → 11.0.0-alpha.3
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/dist/_browser-chunks/{chunk-X42PMG4S.js → chunk-SKDBAXQY.js} +7 -12
- package/dist/_browser-chunks/{chunk-RVWTWVC7.js → chunk-T4D6SHGG.js} +1 -1
- package/dist/_node-chunks/chunk-FP5P5ADF.js +1417 -0
- package/dist/_node-chunks/{chunk-ZVM3PFP6.js → chunk-M36PSKU2.js} +7 -7
- package/dist/_node-chunks/chunk-MENGUCG3.js +332 -0
- package/dist/_node-chunks/{chunk-CBUQSMLV.js → chunk-NF33ZESG.js} +9 -9
- package/dist/_node-chunks/{component-meta-BNWGJCPR.js → component-meta-47426U4F.js} +7 -7
- package/dist/_node-chunks/{parsers-IND63D3J.js → parsers-I6IXRULN.js} +6 -6
- package/dist/_node-chunks/vue-docgen-api-6HY6ZXMW.js +17 -0
- package/dist/chunk-Dka2iJUy.d.ts +44 -0
- package/dist/chunk-PVetFykd.d.ts +65 -0
- package/dist/docgen/docgen-worker.js +23 -267
- package/dist/docgen/index.d.ts +58 -0
- package/dist/docgen/index.js +254 -0
- package/dist/entry-preview-docs.js +1 -1
- package/dist/entry-preview.js +1 -1
- package/dist/index.d.ts +22 -88
- package/dist/index.js +2 -2
- package/dist/preset.d.ts +27 -57
- package/dist/preset.js +48 -1421
- package/package.json +9 -3
- package/dist/_node-chunks/vue-docgen-api-2FOKDIT5.js +0 -17
|
@@ -14,13 +14,9 @@ __export(entry_preview_exports, {
|
|
|
14
14
|
});
|
|
15
15
|
import { enhanceArgTypes, extractComponentDescription } from "storybook/internal/docs-tools";
|
|
16
16
|
|
|
17
|
-
// src/extractArgTypes.ts
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
extractComponentProps,
|
|
21
|
-
hasDocgen
|
|
22
|
-
} from "storybook/internal/docs-tools";
|
|
23
|
-
var ARG_TYPE_SECTIONS = ["props", "events", "slots", "exposed", "expose"], extractArgTypes = (component) => {
|
|
17
|
+
// src/docgen/component-docgen/arg-types/extractArgTypes.ts
|
|
18
|
+
import { convert, extractComponentProps, hasDocgen } from "storybook/internal/docs-tools";
|
|
19
|
+
var ARG_TYPE_SECTIONS = ["props", "events", "slots", "exposed", "expose"], extractArgTypes = (component, resolveNamedTypeDetail) => {
|
|
24
20
|
if (!hasDocgen(component))
|
|
25
21
|
return null;
|
|
26
22
|
let usedDocgenPlugin = "exposed" in component.__docgenInfo ? "vue-component-meta" : "vue-docgen-api", argTypes = {};
|
|
@@ -32,7 +28,7 @@ var ARG_TYPE_SECTIONS = ["props", "events", "slots", "exposed", "expose"], extra
|
|
|
32
28
|
argType = extractFromVueDocgenApi(docgenInfo, section, extractedProp);
|
|
33
29
|
} else {
|
|
34
30
|
let docgenInfo = extractedProp.docgenInfo;
|
|
35
|
-
argType = extractFromVueComponentMeta(docgenInfo, section);
|
|
31
|
+
argType = extractFromVueComponentMeta(docgenInfo, section, resolveNamedTypeDetail);
|
|
36
32
|
}
|
|
37
33
|
if (!argType || argTypes[argType.name])
|
|
38
34
|
return;
|
|
@@ -64,23 +60,22 @@ var ARG_TYPE_SECTIONS = ["props", "events", "slots", "exposed", "expose"], extra
|
|
|
64
60
|
category: section
|
|
65
61
|
}
|
|
66
62
|
};
|
|
67
|
-
}, extractFromVueComponentMeta = (docgenInfo, section) => {
|
|
63
|
+
}, extractFromVueComponentMeta = (docgenInfo, section, resolveNamedTypeDetail) => {
|
|
68
64
|
if ("global" in docgenInfo && docgenInfo.global)
|
|
69
65
|
return;
|
|
70
66
|
let tableType = { summary: docgenInfo.type.replace(" | undefined", "") };
|
|
71
67
|
if (section === "props") {
|
|
72
|
-
let propInfo = docgenInfo, defaultValue = propInfo.default ? { summary: propInfo.default } : void 0, type = convertVueComponentMetaProp(propInfo), enumLabels = getEnumMemberLabels(propInfo.schema);
|
|
68
|
+
let propInfo = docgenInfo, defaultValue = propInfo.default ? { summary: propInfo.default } : void 0, type = convertVueComponentMetaProp(propInfo), enumLabels = getEnumMemberLabels(propInfo.schema), detail = resolveNamedTypeDetail?.(tableType.summary);
|
|
73
69
|
return {
|
|
74
70
|
name: propInfo.name,
|
|
75
71
|
description: formatDescriptionWithTags(propInfo.description, propInfo.tags),
|
|
76
|
-
defaultValue,
|
|
77
72
|
type,
|
|
78
73
|
// A TS enum member is selected by its runtime value, so the qualified name it is written
|
|
79
74
|
// as can only be a label. "control.type" is left to inferControls, which picks radio or
|
|
80
75
|
// select by option count just like it does for a plain literal union.
|
|
81
76
|
...enumLabels && type.name === "enum" ? { options: type.value, control: { labels: enumLabels } } : {},
|
|
82
77
|
table: {
|
|
83
|
-
type: tableType,
|
|
78
|
+
type: detail ? { ...tableType, detail } : tableType,
|
|
84
79
|
defaultValue,
|
|
85
80
|
category: section
|
|
86
81
|
}
|
|
@@ -8,7 +8,7 @@ __export(entry_preview_docs_exports, {
|
|
|
8
8
|
decorators: () => decorators
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
// src/docs/sourceDecorator.ts
|
|
11
|
+
// src/docgen/story-docs/source-decorator/sourceDecorator.ts
|
|
12
12
|
import { SourceType } from "storybook/internal/docs-tools";
|
|
13
13
|
import { emitTransformCode, useEffect } from "storybook/preview-api";
|
|
14
14
|
import { isVNode } from "vue";
|