@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.
@@ -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
- convert,
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";