ember-storybook 0.1.6 → 0.2.0
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/declarations/client/docs/blocks/blocks.d.ts.map +1 -1
- package/declarations/client/docs/blocks/subcomponents.d.ts.map +1 -1
- package/declarations/client/docs/config.d.ts.map +1 -1
- package/declarations/client/docs/extractArgTypes.d.ts +26 -0
- package/declarations/client/docs/extractArgTypes.d.ts.map +1 -1
- package/declarations/client/docs/page.d.ts.map +1 -1
- package/declarations/client/docs/signature.d.ts.map +1 -1
- package/dist/client/docs/config.mjs +79 -20
- package/dist/client/docs/config.mjs.map +1 -1
- package/dist/preset.mjs +108 -17
- package/dist/preset.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../../../src/client/docs/blocks/blocks.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAA8B,MAAM,cAAc,CAAC;AAE1E,eAAO,MAAM,SAAS;;;mGAInB,CAAC;AAOJ,eAAO,MAAM,QAAQ;;;yGAIlB,CAAC;
|
|
1
|
+
{"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../../../src/client/docs/blocks/blocks.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAA8B,MAAM,cAAc,CAAC;AAE1E,eAAO,MAAM,SAAS;;;mGAInB,CAAC;AAOJ,eAAO,MAAM,QAAQ;;;yGAIlB,CAAC;AAyKJ,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,iBAAiB,EACjB,IAAI,EACL,EAAE;IACD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAClC,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;;;2HAiCA;AAED,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,iBAAiB,EACjB,IAAI,EACL,EAAE;IACD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAClC,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;;;sGAOA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subcomponents.d.ts","sourceRoot":"","sources":["../../../../src/client/docs/blocks/subcomponents.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"subcomponents.d.ts","sourceRoot":"","sources":["../../../../src/client/docs/blocks/subcomponents.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAmDpD,wBAAgB,iBAAiB,CAAC,EAChC,UAAU,EACV,IAAI,EACL,EAAE;IACD,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;;;kHAmCA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/client/docs/config.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,KAAK,EACV,iBAAiB,EACjB,UAAU,EACV,wBAAwB,EACxB,cAAc,EACf,MAAM,0BAA0B,CAAC;AAuBlC,eAAO,MAAM,iBAAiB,EAAE,CAAC,CAC/B,OAAO,EAAE,wBAAwB,CAAC,aAAa,CAAC,KAC7C,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/client/docs/config.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,KAAK,EACV,iBAAiB,EACjB,UAAU,EACV,wBAAwB,EACxB,cAAc,EACf,MAAM,0BAA0B,CAAC;AAuBlC,eAAO,MAAM,iBAAiB,EAAE,CAAC,CAC/B,OAAO,EAAE,wBAAwB,CAAC,aAAa,CAAC,KAC7C,cAAc,CAAC,EAoCnB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAQxB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,iBAAiB,CAAC,aAAa,CAAC,EAAsB,CAAC"}
|
|
@@ -1,3 +1,29 @@
|
|
|
1
1
|
import type { ComponentSignature } from 'ember-docgen';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a new argTypes object with entries sorted alphabetically by name,
|
|
4
|
+
* matching Storybook's `alpha` sort order. The input object is not mutated.
|
|
5
|
+
*/
|
|
6
|
+
export declare function sortArgTypes(argTypes: Record<string, unknown>): Record<string, unknown>;
|
|
2
7
|
export declare function buildArgTypes(sig: ComponentSignature): Record<string, unknown>;
|
|
8
|
+
/**
|
|
9
|
+
* Merges signature-derived argTypes with the story-provided argTypes.
|
|
10
|
+
*
|
|
11
|
+
* Signature argTypes are the base; story argTypes enhance them for better
|
|
12
|
+
* rendering (custom `name`, `control`, `options`, ...). For args present in
|
|
13
|
+
* both, story fields win — but only when they carry an actual value, so an
|
|
14
|
+
* explicit `undefined` never masks a signature field. The signature keeps the
|
|
15
|
+
* `table` and `description` the story does not override.
|
|
16
|
+
*
|
|
17
|
+
* The `type` object is deep-merged: a story-provided partial `type` (e.g.
|
|
18
|
+
* `type: 'string'`) keeps the signature's `required` flag unless the story
|
|
19
|
+
* explicitly sets it, while the story's `type.name` still wins.
|
|
20
|
+
*/
|
|
21
|
+
export declare function mergeArgTypes(signatureArgTypes: Record<string, unknown>, storyArgTypes: Record<string, unknown>): Record<string, unknown>;
|
|
22
|
+
/**
|
|
23
|
+
* Whether the docs page should render the Args/controls table: either the
|
|
24
|
+
* component signature exposes args, or the meta carries story-provided
|
|
25
|
+
* argTypes (e.g. for a template-only component with story argTypes but no
|
|
26
|
+
* signature args).
|
|
27
|
+
*/
|
|
28
|
+
export declare function shouldShowArgsSection(sig: ComponentSignature, metaArgTypes?: Record<string, unknown>): boolean;
|
|
3
29
|
//# sourceMappingURL=extractArgTypes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractArgTypes.d.ts","sourceRoot":"","sources":["../../../src/client/docs/extractArgTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAoCpE,wBAAgB,aAAa,CAAC,GAAG,EAAE,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAoB9E"}
|
|
1
|
+
{"version":3,"file":"extractArgTypes.d.ts","sourceRoot":"","sources":["../../../src/client/docs/extractArgTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAoCpE;;;GAGG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEvF;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAoB9E;AAMD;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAC3B,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC1C,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACrC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA8BzB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,kBAAkB,EACvB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACrC,OAAO,CAET"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../src/client/docs/page.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../src/client/docs/page.ts"],"names":[],"mappings":"AAuFA,MAAM,CAAC,OAAO,UAAU,IAAI,4EAiC3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../../src/client/docs/signature.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../../src/client/docs/signature.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,cAAc,gBAAgB,CAAC;AAE5C,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAcD,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,SAAS,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,EAC3D,IAAI,EAAE,SAAS,GACd,MAAM,GAAG,SAAS,CAoBpB;AAED,wBAAgB,cAAc,CAC5B,SAAS,EAAE,kBAAkB,EAC7B,SAAS,CAAC,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,EAAE,GACjD,kBAAkB,CAsBpB;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EACjC,IAAI,EAAE,SAAS,GACd,eAAe,EAAE,CAiDnB"}
|
|
@@ -3,7 +3,7 @@ import { t as unwrapBlockParams } from "../../block-params-C68OkWMC.mjs";
|
|
|
3
3
|
import { emitTransformCode, useEffect, useRef } from "storybook/preview-api";
|
|
4
4
|
import { SourceType } from "storybook/internal/docs-tools";
|
|
5
5
|
import emberData from "virtual:ember-storybook";
|
|
6
|
-
import {
|
|
6
|
+
import { Controls, Description, DocsContext, Heading, Primary, PureArgsTable, Stories, Subheading, Subtitle, Title, useOf } from "@storybook/addon-docs/blocks";
|
|
7
7
|
import { Fragment, createElement, useContext } from "react";
|
|
8
8
|
import { NAVIGATE_URL } from "storybook/internal/core-events";
|
|
9
9
|
import { styled } from "storybook/theming";
|
|
@@ -21,6 +21,13 @@ function mapTypeToControl(type) {
|
|
|
21
21
|
default: return { type: "object" };
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Returns a new argTypes object with entries sorted alphabetically by name,
|
|
26
|
+
* matching Storybook's `alpha` sort order. The input object is not mutated.
|
|
27
|
+
*/
|
|
28
|
+
function sortArgTypes(argTypes) {
|
|
29
|
+
return Object.fromEntries(Object.entries(argTypes).toSorted(([a], [b]) => a.localeCompare(b)));
|
|
30
|
+
}
|
|
24
31
|
function buildArgTypes(sig) {
|
|
25
32
|
const argTypes = {};
|
|
26
33
|
for (const [name, arg] of Object.entries(sig.args)) argTypes[name] = {
|
|
@@ -36,9 +43,64 @@ function buildArgTypes(sig) {
|
|
|
36
43
|
defaultValue: arg.defaultValue ? { summary: arg.defaultValue } : void 0
|
|
37
44
|
}
|
|
38
45
|
};
|
|
39
|
-
return argTypes;
|
|
46
|
+
return sortArgTypes(argTypes);
|
|
47
|
+
}
|
|
48
|
+
function isObject(value) {
|
|
49
|
+
return typeof value === "object" && value !== null;
|
|
40
50
|
}
|
|
41
51
|
/**
|
|
52
|
+
* Merges signature-derived argTypes with the story-provided argTypes.
|
|
53
|
+
*
|
|
54
|
+
* Signature argTypes are the base; story argTypes enhance them for better
|
|
55
|
+
* rendering (custom `name`, `control`, `options`, ...). For args present in
|
|
56
|
+
* both, story fields win — but only when they carry an actual value, so an
|
|
57
|
+
* explicit `undefined` never masks a signature field. The signature keeps the
|
|
58
|
+
* `table` and `description` the story does not override.
|
|
59
|
+
*
|
|
60
|
+
* The `type` object is deep-merged: a story-provided partial `type` (e.g.
|
|
61
|
+
* `type: 'string'`) keeps the signature's `required` flag unless the story
|
|
62
|
+
* explicitly sets it, while the story's `type.name` still wins.
|
|
63
|
+
*/
|
|
64
|
+
function mergeArgTypes(signatureArgTypes, storyArgTypes) {
|
|
65
|
+
const merged = { ...signatureArgTypes };
|
|
66
|
+
for (const [name, storyArg] of Object.entries(storyArgTypes)) {
|
|
67
|
+
if (storyArg === void 0) continue;
|
|
68
|
+
const sigArg = merged[name];
|
|
69
|
+
if (!isObject(sigArg) || !isObject(storyArg)) {
|
|
70
|
+
merged[name] = storyArg;
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
const storyFields = Object.fromEntries(Object.entries(storyArg).filter(([, value]) => value !== void 0));
|
|
74
|
+
const mergedArg = {
|
|
75
|
+
...sigArg,
|
|
76
|
+
...storyFields
|
|
77
|
+
};
|
|
78
|
+
if (isObject(sigArg.type) && isObject(storyFields.type)) mergedArg.type = {
|
|
79
|
+
...sigArg.type,
|
|
80
|
+
...storyFields.type
|
|
81
|
+
};
|
|
82
|
+
merged[name] = mergedArg;
|
|
83
|
+
}
|
|
84
|
+
return merged;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Whether the docs page should render the Args/controls table: either the
|
|
88
|
+
* component signature exposes args, or the meta carries story-provided
|
|
89
|
+
* argTypes (e.g. for a template-only component with story argTypes but no
|
|
90
|
+
* signature args).
|
|
91
|
+
*/
|
|
92
|
+
function shouldShowArgsSection(sig, metaArgTypes) {
|
|
93
|
+
return Object.keys(sig.args).length > 0 || Object.keys(metaArgTypes ?? {}).length > 0;
|
|
94
|
+
}
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/client/docs/signature.ts
|
|
97
|
+
/**
|
|
98
|
+
* Key used for default exports in signature/component maps. Mirrors
|
|
99
|
+
* ember-docgen's `Default` sentinel — duplicated as a literal so client
|
|
100
|
+
* code does not pull ember-docgen's node-only dependencies into the bundle.
|
|
101
|
+
*/
|
|
102
|
+
const DEFAULT_EXPORT = "__DEFAULT__";
|
|
103
|
+
/**
|
|
42
104
|
* Resolve the human-facing name of a referenced component export.
|
|
43
105
|
*
|
|
44
106
|
* Prefers the component's own declaration name over its export alias and
|
|
@@ -54,8 +116,9 @@ function componentDisplayName(ref, data) {
|
|
|
54
116
|
const rawEntry = data[ref.filePath];
|
|
55
117
|
const componentEntry = hasSignatureMap(rawEntry) ? rawEntry : void 0;
|
|
56
118
|
if (!componentEntry) return ref.exportName === "__DEFAULT__" ? void 0 : ref.exportName;
|
|
57
|
-
|
|
58
|
-
|
|
119
|
+
const meta = componentEntry.meta;
|
|
120
|
+
if (ref.exportName === "__DEFAULT__") return meta?.[DEFAULT_EXPORT];
|
|
121
|
+
return meta?.[ref.exportName] ?? ref.exportName;
|
|
59
122
|
}
|
|
60
123
|
function applyModifiers(signature, modifiers) {
|
|
61
124
|
if (!modifiers || modifiers.length === 0) return signature;
|
|
@@ -77,7 +140,7 @@ function collectSubcomponents(blocks, data) {
|
|
|
77
140
|
for (const block of Object.values(blocks)) for (const param of unwrapBlockParams(block.params)) {
|
|
78
141
|
if (!param.componentRef) continue;
|
|
79
142
|
const { filePath, exportName, importPath, modifiers } = param.componentRef;
|
|
80
|
-
const name = componentDisplayName(param.componentRef, data) ?? param.name;
|
|
143
|
+
const name = param.componentRef.local ? param.name : componentDisplayName(param.componentRef, data) ?? param.name;
|
|
81
144
|
if (seen.has(name)) continue;
|
|
82
145
|
seen.add(name);
|
|
83
146
|
if (importPath) result.push({
|
|
@@ -244,8 +307,10 @@ function SubcomponentAnchor({ name, children }) {
|
|
|
244
307
|
}, children);
|
|
245
308
|
}
|
|
246
309
|
/** Display name for a block param's type: the referenced component's own
|
|
247
|
-
* name when available,
|
|
310
|
+
* name when available, the yield key for local components, otherwise the
|
|
311
|
+
* raw type string. */
|
|
248
312
|
function displayTypeName(param, data) {
|
|
313
|
+
if (param.componentRef?.local) return param.name;
|
|
249
314
|
return (data ? componentDisplayName(param.componentRef, data) : void 0) ?? param.type;
|
|
250
315
|
}
|
|
251
316
|
function renderType(param, subcomponentNames, data) {
|
|
@@ -397,7 +462,7 @@ const SectionLabel = styled.div(({ theme }) => ({
|
|
|
397
462
|
function renderSubcomponentSignature(sig, subcomponentNames, data) {
|
|
398
463
|
const children = [];
|
|
399
464
|
if (sig.element) children.push(createElement(ElementBlock, { element: sig.element }));
|
|
400
|
-
if (Object.keys(sig.args).length > 0) children.push(createElement(SectionLabel, void 0, "Args"), createElement(
|
|
465
|
+
if (Object.keys(sig.args).length > 0) children.push(createElement(SectionLabel, void 0, "Args"), createElement(PureArgsTable, { rows: buildArgTypes(sig) }));
|
|
401
466
|
if (Object.keys(sig.blocks).length > 0) children.push(createElement(SectionLabel, {
|
|
402
467
|
key: "blocks-label",
|
|
403
468
|
style: { marginTop: 12 }
|
|
@@ -427,10 +492,10 @@ function SubcomponentsArea({ components, data }) {
|
|
|
427
492
|
}
|
|
428
493
|
//#endregion
|
|
429
494
|
//#region src/client/docs/page.ts
|
|
430
|
-
function addSignature(signature, data) {
|
|
495
|
+
function addSignature(signature, data, metaArgTypes) {
|
|
431
496
|
const children = [];
|
|
432
497
|
if (signature.element) children.push(createElement(ElementBlock, { element: signature.element }));
|
|
433
|
-
if (
|
|
498
|
+
if (shouldShowArgsSection(signature, metaArgTypes)) children.push(createElement(Subheading, void 0, "Args"), createElement(Controls));
|
|
434
499
|
if (Object.keys(signature.blocks).length > 0) {
|
|
435
500
|
const subcomponents = collectSubcomponents(signature.blocks, data);
|
|
436
501
|
const subcomponentNames = new Set(subcomponents.map((s) => s.name));
|
|
@@ -477,7 +542,7 @@ function Page() {
|
|
|
477
542
|
createElement(Description),
|
|
478
543
|
createElement(Primary)
|
|
479
544
|
];
|
|
480
|
-
if (signature) children.push(...addSignature(signature, data));
|
|
545
|
+
if (signature) children.push(...addSignature(signature, data, resolved.preparedMeta?.argTypes));
|
|
481
546
|
children.push(createElement(Stories));
|
|
482
547
|
return createElement(Fragment, void 0, ...children);
|
|
483
548
|
}
|
|
@@ -593,23 +658,17 @@ const argTypesEnhancers = [(context) => {
|
|
|
593
658
|
const filePath = context.parameters.fileName;
|
|
594
659
|
if (filePath && Object.hasOwn(data, filePath)) {
|
|
595
660
|
const sig = resolveSig(data[filePath]);
|
|
596
|
-
if (sig) return
|
|
597
|
-
|
|
598
|
-
...context.argTypes
|
|
599
|
-
};
|
|
600
|
-
return context.argTypes;
|
|
661
|
+
if (sig) return sortArgTypes(mergeArgTypes(buildArgTypes(sig), context.argTypes));
|
|
662
|
+
return sortArgTypes(context.argTypes);
|
|
601
663
|
}
|
|
602
664
|
const leaf = titleLeaf(context.title);
|
|
603
665
|
if (leaf) for (const entry of Object.values(data)) {
|
|
604
666
|
if (!("meta" in entry)) continue;
|
|
605
667
|
if (titleLeaf(entry.meta.title) !== leaf) continue;
|
|
606
668
|
const sig = resolveSig(entry);
|
|
607
|
-
if (sig) return
|
|
608
|
-
...buildArgTypes(sig),
|
|
609
|
-
...context.argTypes
|
|
610
|
-
};
|
|
669
|
+
if (sig) return sortArgTypes(mergeArgTypes(buildArgTypes(sig), context.argTypes));
|
|
611
670
|
}
|
|
612
|
-
return context.argTypes;
|
|
671
|
+
return sortArgTypes(context.argTypes);
|
|
613
672
|
}];
|
|
614
673
|
const parameters = { docs: {
|
|
615
674
|
source: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.mjs","names":["mapTypeToControl","type","category","options","buildArgTypes","sig","argTypes","name","arg","Object","entries","args","description","undefined","raw","required","control","table","summary","defaultValue","unwrapBlockParams","DEFAULT_EXPORT","hasSignatureMap","entry","Object","hasOwn","componentDisplayName","ref","data","filePath","exportName","undefined","rawEntry","componentEntry","meta","applyModifiers","signature","modifiers","length","blockedKeys","Set","pickedKeys","mod","name","key","typeArgs","add","filtered","size","fromEntries","entries","args","filter","k","has","collectSubcomponents","blocks","seen","result","block","values","param","params","componentRef","importPath","push","signatures","sig","Heading","createElement","styled","isHtmlElement","name","test","TableWrapper","table","theme","fontFamily","typography","fonts","base","borderSpacing","color","defaultText","fontSize","size","s2","lineHeight","textAlign","width","marginTop","marginBottom","marginInline","padding","border","verticalAlign","textOverflow","paddingLeft","paddingRight","th","textMutedColor","paddingTop","paddingBottom","td","tbody","filter","background","content","borderTop","appBorderColor","borderBlockStart","borderBlockEnd","borderInlineStart","borderInlineEnd","borderTopLeftRadius","appBorderRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","borderColor","renderHead","columns","className","map","col","renderBody","entries","entry","key","style","fontWeight","description","H2","weight","bold","letterSpacing","textTransform","DocsContext","Subheading","createElement","Fragment","useContext","NAVIGATE_URL","styled","componentDisplayName","TableWrapper","ParamType","code","theme","color","secondary","fontSize","fontWeight","ParamName","span","defaultText","ParamRow","div","typography","size","s2","lineHeight","marginBottom","ParamDesc","textMutedColor","s1","marginLeft","BlocksDiv","marginTop","BlocksNameCell","td","position","weight","bold","background","app","SubcomponentLink","a","primary","cursor","textDecoration","Indent","marginInlineStart","SubcomponentAnchor","name","children","context","hash","href","target","onClick","event","preventDefault","document","querySelector","CSS","escape","slice","scrollIntoView","behavior","block","channel","emit","displayTypeName","param","data","componentRef","undefined","type","renderType","subcomponentNames","displayType","typeIsSubcomponent","has","key","renderParam","isBlockParam","Object","hasOwn","renderParams","params","map","i","entries","flatMap","p","isNamed","startsWith","isSubcomponent","typeChildren","push","rows","description","BlocksTable","blocks","toSorted","nameA","_a","nameB","_b","length","displayName","className","BlocksSection","createElement","styled","isHtmlElement","ElementWrapper","div","theme","fontFamily","typography","fonts","base","color","defaultText","fontSize","size","s2","lineHeight","marginTop","marginBottom","span","fontWeight","marginRight","code","secondary","textDecoration","a","ElementBlock","element","elements","split","map","s","trim","filter","Boolean","length","children","key","i","name","entries","push","inner","href","target","rel","undefined","createElement","renderBody","renderHead","TableWrapper","renderPartsBody","entries","className","map","entry","key","name","style","fontSize","fontWeight","description","PartsTable","CssPropertiesTable","ArgTypes","Subheading","createElement","styled","BlocksTable","ParamRow","ParamType","ElementBlock","H2","SubcomponentsSection","div","marginTop","marginBottom","SubEntry","SectionLabel","theme","fontWeight","color","defaultText","fontSize","typography","size","m1","renderSubcomponentSignature","sig","subcomponentNames","data","children","element","push","Object","keys","args","length","undefined","include","blocks","key","style","SubcomponentsArea","components","Set","map","c","name","entries","comp","importPath","signature","id","Controls","Description","Primary","Stories","Subheading","Subtitle","Title","useOf","createElement","Fragment","emberData","BlocksSection","ElementBlock","CssPropertiesTable","PartsTable","SubcomponentsArea","H2","collectSubcomponents","addSignature","signature","data","children","element","push","Object","keys","args","length","undefined","blocks","subcomponents","subcomponentNames","Set","map","s","name","components","style","customProperties","entries","description","parts","unshift","Page","resolved","storyFile","preparedMeta","parameters","fileName","storyEntry","storyComponent","component","compFile","file","compEntry","signatureName","signatures","SourceType","emitTransformCode","useEffect","useRef","emberData","isEmberStoryResult","unwrapBlockParams","data","skipSourceRender","context","sourceParams","parameters","docs","source","type","DYNAMIC","isArgsStory","__isArgsStory","code","CODE","toArgument","key","value","argTypes","undefined","JSON","stringify","String","Object","hasOwn","generateBlockContent","blockInfo","params","length","paramNames","map","p","name","join","generateBlockSourceCode","sig","args","indent","blockNames","keys","blocks","blockName","arg","slotBindings","content","push","byStoryId","getByStoryId","entry","values","storyId","entries","componentName","signatureName","inlineTemplate","signatureForComponent","comp","component","compEntry","file","signatures","resolveTemplateArgs","template","replaceAll","_match","generateSource","meta","propsArray","filter","k","v","Boolean","blockCode","propsStr","sourceDecorator","storyFn","story","rendered","originalStoryFn","renderedForSource","id","current","SourceType","emberData","buildArgTypes","Page","sourceDecorator","data","resolveSig","entry","undefined","comp","component","signatureName","compEntry","file","signatures","titleLeaf","title","split","pop","argTypesEnhancers","context","filePath","parameters","fileName","Object","hasOwn","sig","argTypes","leaf","values","meta","docs","source","type","DYNAMIC","language","page","decorators"],"sources":["../../../src/client/docs/extractArgTypes.ts","../../../src/client/docs/signature.ts","../../../src/client/docs/blocks/ui.ts","../../../src/client/docs/blocks/blocks.ts","../../../src/client/docs/blocks/element.ts","../../../src/client/docs/blocks/style.ts","../../../src/client/docs/blocks/subcomponents.ts","../../../src/client/docs/page.ts","../../../src/client/docs/source-decorator.ts","../../../src/client/docs/config.ts"],"sourcesContent":["import type { ArgTypeInfo, ComponentSignature } from 'ember-docgen';\n\nfunction mapTypeToControl(\n type: ArgTypeInfo\n):\n | false\n | { type: 'text' }\n | { type: 'number' }\n | { type: 'boolean' }\n | { type: 'select'; options: string[] }\n | { type: 'object' }\n | { type: 'function' }\n | { type: 'date' } {\n switch (type.category) {\n case 'string': {\n return { type: 'text' };\n }\n case 'number': {\n return { type: 'number' };\n }\n case 'boolean': {\n return { type: 'boolean' };\n }\n case 'function': {\n return { type: 'function' };\n }\n case 'enum': {\n return { type: 'select', options: type.options ?? [] };\n }\n\n default: {\n return { type: 'object' };\n }\n }\n}\n\nexport function buildArgTypes(sig: ComponentSignature): Record<string, unknown> {\n const argTypes: Record<string, unknown> = {};\n\n for (const [name, arg] of Object.entries(sig.args)) {\n argTypes[name] = {\n name,\n description: arg.description || undefined,\n type: {\n name: arg.type.raw,\n required: arg.required\n },\n control: mapTypeToControl(arg.type),\n table: {\n type: { summary: arg.type.raw },\n defaultValue: arg.defaultValue ? { summary: arg.defaultValue } : undefined\n }\n };\n }\n\n return argTypes;\n}\n","import { unwrapBlockParams } from './block-params';\n\nimport type { ComponentFile, EmberMeta } from '../../node/types';\nimport type { BlockInfo, ComponentSignature } from 'ember-docgen';\n\n/**\n * Key used for default exports in signature/component maps. Mirrors\n * ember-docgen's `Default` sentinel — duplicated as a literal so client\n * code does not pull ember-docgen's node-only dependencies into the bundle.\n */\nexport const DEFAULT_EXPORT = '__DEFAULT__';\n\nexport interface SubcomponentRef {\n name: string;\n signature?: ComponentSignature;\n importPath?: string;\n}\n\n/**\n * Resolve the human-facing name of a referenced component export.\n *\n * Prefers the component's own declaration name over its export alias and\n * resolves the default-export sentinel to the real class name via the\n * component file's declaration map. Returns `undefined` when no better\n * name is known.\n */\nfunction hasSignatureMap(entry: unknown): entry is ComponentFile {\n return typeof entry === 'object' && entry !== null && Object.hasOwn(entry, 'signatures');\n}\n\nexport function componentDisplayName(\n ref: undefined | { filePath?: string; exportName?: string },\n data: EmberMeta\n): string | undefined {\n if (!ref?.filePath || !ref.exportName) return undefined;\n\n const rawEntry: unknown = data[ref.filePath];\n\n const componentEntry = hasSignatureMap(rawEntry) ? rawEntry : undefined;\n\n if (!componentEntry) {\n return ref.exportName === DEFAULT_EXPORT ? undefined : ref.exportName;\n }\n\n if (ref.exportName === DEFAULT_EXPORT) {\n return componentEntry.meta[DEFAULT_EXPORT] ?? undefined;\n }\n\n return componentEntry.meta[ref.exportName] ?? ref.exportName;\n}\n\nexport function applyModifiers(\n signature: ComponentSignature,\n modifiers?: { name: string; typeArgs: string[] }[]\n): ComponentSignature {\n if (!modifiers || modifiers.length === 0) return signature;\n\n const blockedKeys = new Set<string>();\n const pickedKeys = new Set<string>();\n\n for (const mod of modifiers) {\n if (mod.name === 'WithBoundArgs' || mod.name === 'Omit') {\n for (const key of mod.typeArgs) blockedKeys.add(key);\n }\n\n if (mod.name === 'Pick') {\n for (const key of mod.typeArgs) pickedKeys.add(key);\n }\n }\n\n const filtered =\n pickedKeys.size > 0\n ? Object.fromEntries(Object.entries(signature.args).filter(([k]) => pickedKeys.has(k)))\n : Object.fromEntries(Object.entries(signature.args).filter(([k]) => !blockedKeys.has(k)));\n\n return { ...signature, args: filtered };\n}\n\nexport function collectSubcomponents(\n blocks: Record<string, BlockInfo>,\n data: EmberMeta\n): SubcomponentRef[] {\n const seen = new Set<string>();\n\n const result: SubcomponentRef[] = [];\n\n for (const block of Object.values(blocks)) {\n for (const param of unwrapBlockParams(block.params)) {\n if (!param.componentRef) {\n // eslint-disable-next-line unicorn/no-break-in-nested-loop\n continue;\n }\n\n const { filePath, exportName, importPath, modifiers } = param.componentRef;\n\n // Prefer the referenced component's own name over the yield-hash key\n const name = componentDisplayName(param.componentRef, data) ?? param.name;\n\n if (seen.has(name)) {\n // eslint-disable-next-line unicorn/no-break-in-nested-loop\n continue;\n }\n\n seen.add(name);\n\n if (importPath) {\n result.push({ name, importPath });\n } else if (filePath && Object.hasOwn(data, filePath)) {\n const entry = data[filePath] as ComponentFile;\n\n if (Object.hasOwn(entry.signatures, exportName)) {\n const sig = entry.signatures[exportName];\n\n result.push({\n name,\n signature: applyModifiers(sig, modifiers)\n });\n }\n } else if (filePath) {\n // Project-local file without an extractable signature\n // (e.g. a bare template-only component) — still list it by name.\n result.push({ name });\n }\n }\n }\n\n return result;\n}\n","/* eslint-disable unicorn/no-null */\nimport { Heading } from '@storybook/addon-docs/blocks';\nimport { createElement } from 'react';\nimport { styled, type Theme } from 'storybook/theming';\n\nexport interface Entry {\n name: string;\n description?: string;\n}\n\ntype StyleProps = { theme: Theme };\n\nexport function isHtmlElement(name: string): boolean {\n return /^HTML[A-Z]\\w*Element$/.test(name);\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nexport const TableWrapper = styled.table(({ theme }: StyleProps) => ({\n fontFamily: theme.typography.fonts.base,\n borderSpacing: 0,\n color: theme.color.defaultText,\n fontSize: theme.typography.size.s2 - 1,\n lineHeight: '19px',\n textAlign: 'left',\n width: '100%',\n marginTop: 25,\n marginBottom: 40,\n marginInline: 1,\n 'td, th': {\n padding: 0,\n border: 'none',\n verticalAlign: 'top',\n textOverflow: 'ellipsis'\n },\n 'th:first-of-type, td:first-of-type': {\n paddingLeft: 20\n },\n 'th:last-of-type, td:last-of-type': {\n paddingRight: 20\n },\n th: {\n color: theme.textMutedColor as string,\n paddingTop: 10,\n paddingBottom: 10,\n paddingLeft: 15,\n paddingRight: 15\n },\n td: {\n paddingTop: '10px',\n paddingBottom: '10px',\n '&:not(:first-of-type)': {\n paddingLeft: 15,\n paddingRight: 15\n },\n '&:last-of-type': {\n paddingRight: 20\n }\n },\n tbody: {\n filter:\n theme.base === 'light'\n ? 'drop-shadow(0px 1px 3px rgba(0, 0, 0, 0.10))'\n : 'drop-shadow(0px 1px 3px rgba(0, 0, 0, 0.20))',\n '> tr > *': {\n background: theme.background.content,\n borderTop: `1px solid ${theme.appBorderColor}`\n },\n '> tr:first-of-type > *': {\n borderBlockStart: `1px solid ${theme.appBorderColor}`\n },\n '> tr:last-of-type > *': {\n borderBlockEnd: `1px solid ${theme.appBorderColor}`\n },\n '> tr > *:first-of-type': {\n borderInlineStart: `1px solid ${theme.appBorderColor}`\n },\n '> tr > *:last-of-type': {\n borderInlineEnd: `1px solid ${theme.appBorderColor}`\n },\n '> tr:first-of-type > td:first-of-type': {\n borderTopLeftRadius: theme.appBorderRadius\n },\n '> tr:first-of-type > td:last-of-type': {\n borderTopRightRadius: theme.appBorderRadius\n },\n '> tr:last-of-type > td:first-of-type': {\n borderBottomLeftRadius: theme.appBorderRadius\n },\n '> tr:last-of-type > td:last-of-type': {\n borderBottomRightRadius: theme.appBorderRadius\n }\n },\n '@media (forced-colors: active)': {\n tbody: {\n filter: 'none',\n '> tr > *': {\n borderColor: 'CanvasText'\n }\n }\n }\n}));\n\nexport function renderHead(columns: string[]) {\n return createElement(\n 'thead',\n { className: 'docblock-argstable-head' },\n createElement(\n 'tr',\n null,\n ...columns.map((col) => createElement('th', null, createElement('span', null, col)))\n )\n );\n}\n\nexport function renderBody(entries: Entry[]) {\n return createElement(\n 'tbody',\n { className: 'docblock-argstable-body' },\n ...entries.map((entry) =>\n createElement(\n 'tr',\n { key: entry.name },\n createElement(\n 'td',\n null,\n createElement('span', { style: { fontWeight: 'bold' } }, entry.name)\n ),\n createElement('td', null, entry.description ?? '')\n )\n )\n );\n}\n\nexport const H2 = styled(Heading)(({ theme }) => ({\n fontSize: `${theme.typography.size.s2 - 1}px`,\n fontWeight: theme.typography.weight.bold,\n lineHeight: '16px',\n letterSpacing: '0.35em',\n textTransform: 'uppercase',\n color: theme.textMutedColor as string,\n border: 0,\n marginBottom: '12px',\n '&:first-of-type': { marginTop: '56px' }\n}));\n","import { DocsContext, Subheading } from '@storybook/addon-docs/blocks';\nimport { createElement, Fragment, type MouseEvent, type ReactNode, useContext } from 'react';\nimport { NAVIGATE_URL } from 'storybook/internal/core-events';\nimport { styled } from 'storybook/theming';\n\nimport { componentDisplayName } from '../signature';\nimport { TableWrapper } from './ui';\n\nimport type { EmberMeta } from '../../../node/types';\nimport type { BlockInfo, BlockParam, HashBlockParam } from 'ember-docgen';\n\nexport const ParamType = styled.code(({ theme }) => ({\n color: theme.color.secondary,\n fontSize: 12,\n fontWeight: 'bold'\n}));\n\nconst ParamName = styled.span(({ theme }) => ({\n fontWeight: 'bold',\n color: theme.color.defaultText\n}));\n\nexport const ParamRow = styled.div(({ theme }) => ({\n fontSize: theme.typography.size.s2 - 1,\n lineHeight: '19px',\n marginBottom: 2\n}));\n\nconst ParamDesc = styled.div(({ theme }) => ({\n color: theme.textMutedColor as string,\n fontSize: theme.typography.size.s1,\n lineHeight: '17px',\n marginBottom: 8,\n marginLeft: 20\n}));\n\nconst BlocksDiv = styled.div(() => ({\n marginTop: 25,\n marginBottom: 40\n}));\n\nconst BlocksNameCell = styled.td(({ theme }) => ({\n position: 'relative',\n fontWeight: theme.typography.weight.bold,\n fontSize: theme.typography.size.s1,\n background: `${theme.background.app} !important`,\n '& ~ td': {\n background: `${theme.background.app} !important`\n }\n}));\n\nconst SubcomponentLink = styled.a(({ theme }) => ({\n color: theme.color.primary,\n fontWeight: 'bold',\n cursor: 'pointer',\n textDecoration: 'none',\n '&:hover': { textDecoration: 'underline' }\n}));\n\nconst Indent = styled.span(() => ({\n marginInlineStart: '20px'\n}));\n\n/**\n * In-page anchor to a subcomponent section. Mirrors Storybook's own\n * in-docs navigation (TableOfContents / AnchorInPage): the default anchor\n * behavior is prevented — it would resolve against the preview iframe's\n * `<base>` and navigate away from Storybook — and instead the docs page\n * scrolls to the target while `NAVIGATE_URL` keeps the address-bar hash\n * (deep-linkable) in sync via the manager.\n */\nfunction SubcomponentAnchor({ name, children }: { name: string; children?: ReactNode }) {\n const context = useContext(DocsContext);\n const hash = `#subcomponent-${name}`;\n\n return createElement(\n SubcomponentLink,\n {\n href: hash,\n target: '_self',\n onClick: (event: MouseEvent) => {\n event.preventDefault();\n\n const target = document.querySelector(`#${CSS.escape(hash.slice(1))}`);\n\n if (target) {\n target.scrollIntoView({ behavior: 'smooth', block: 'start' });\n context.channel.emit(NAVIGATE_URL, hash);\n }\n }\n },\n children\n );\n}\n\n/** Display name for a block param's type: the referenced component's own\n * name when available, otherwise the raw type string. */\nfunction displayTypeName(param: BlockParam, data?: EmberMeta): string {\n return (data ? componentDisplayName(param.componentRef, data) : undefined) ?? param.type;\n}\n\nfunction renderType(\n param: BlockParam,\n subcomponentNames: Set<string>,\n data?: EmberMeta\n): ReactNode {\n const displayType = displayTypeName(param, data);\n\n if (param.componentRef) {\n const typeIsSubcomponent = subcomponentNames.has(displayType);\n\n return typeIsSubcomponent\n ? createElement(SubcomponentAnchor, { key: 'type', name: displayType }, displayType)\n : createElement(ParamType, { key: 'type' }, displayType);\n }\n\n return createElement(ParamType, { key: 'type' }, param.type);\n}\n\nfunction renderParam(\n param: BlockParam,\n subcomponentNames: Set<string>,\n data?: EmberMeta\n): ReactNode[] {\n const type = renderType(param, subcomponentNames, data);\n const name = createElement(ParamName, { key: 'name' }, param.name);\n\n return [name, createElement('span', { key: 'colon' }, ': '), type];\n}\n\nfunction isBlockParam(param: BlockParam | HashBlockParam): param is BlockParam {\n return Object.hasOwn(param, 'name') && Object.hasOwn(param, 'type');\n}\n\nfunction renderParams(\n params: BlockInfo['params'],\n subcomponentNames: Set<string>,\n data?: EmberMeta\n): ReactNode[] {\n return params.map((param, i) => {\n if (!isBlockParam(param)) {\n const children: ReactNode[] = [\n createElement('span', { key: 'open' }, '- {'),\n createElement('br', { key: 'br-open' }),\n ...Object.entries(param).flatMap(([key, p]) => [\n createElement(Indent, { key: `indent-${key}` }),\n renderParam(p, subcomponentNames, data)\n ]),\n createElement('br', { key: 'br-close' }),\n createElement('span', { key: 'close' }, '}')\n ];\n\n return createElement(Fragment, { key: i }, ...children);\n }\n\n const isNamed = param.name && !param.name.startsWith('param');\n const displayType = displayTypeName(param, data);\n\n const isSubcomponent = subcomponentNames.has(displayType);\n\n const children: ReactNode[] = [];\n const typeChildren: ReactNode[] = [];\n\n if (isSubcomponent) {\n typeChildren.push(\n createElement(SubcomponentAnchor, { key: 'type', name: displayType }, displayType)\n );\n } else {\n typeChildren.push(createElement(ParamType, { key: 'type' }, displayType));\n }\n\n if (isNamed) {\n children.push(\n createElement('span', { key: 'sep' }, '- '),\n createElement(ParamName, { key: 'name' }, param.name),\n createElement('span', { key: 'colon' }, ': '),\n ...typeChildren\n );\n } else {\n children.push(createElement('span', { key: 'sep' }, '- '), ...typeChildren);\n }\n\n const rows: ReactNode[] = [createElement(ParamRow, { key: 'row' }, ...children)];\n\n if (param.description) {\n rows.push(createElement(ParamDesc, { key: 'desc' }, param.description));\n }\n\n return createElement(Fragment, { key: i }, ...rows);\n });\n}\n\nexport function BlocksTable({\n blocks,\n subcomponentNames,\n data\n}: {\n blocks: Record<string, BlockInfo>;\n subcomponentNames: Set<string>;\n data?: EmberMeta;\n}) {\n const entries = Object.entries(blocks).toSorted(([nameA, _a], [nameB, _b]) => {\n if (nameA === 'default') return -1;\n if (nameB === 'default') return -1;\n\n return 0;\n });\n\n if (entries.length === 0) return;\n\n const rows = [];\n\n for (const [name, block] of entries) {\n const displayName = `<:${name}>`;\n\n rows.push(\n createElement('tr', { key: name }, createElement(BlocksNameCell, undefined, displayName))\n );\n\n if (block.params.length > 0) {\n const params = renderParams(block.params, subcomponentNames, data);\n\n rows.push(\n createElement('tr', { key: `${name}-params` }, createElement('td', undefined, ...params))\n );\n }\n }\n\n return createElement(\n TableWrapper,\n { className: 'docblock-argstable sb-unstyled' },\n createElement('tbody', { className: 'docblock-argstable-body' }, rows)\n );\n}\n\nexport function BlocksSection({\n blocks,\n subcomponentNames,\n data\n}: {\n blocks: Record<string, BlockInfo>;\n subcomponentNames: Set<string>;\n data?: EmberMeta;\n}) {\n return createElement(\n BlocksDiv,\n undefined,\n createElement(Subheading, undefined, 'Blocks'),\n BlocksTable({ blocks, subcomponentNames, data })\n );\n}\n","import { createElement, type ReactNode } from 'react';\nimport { styled } from 'storybook/theming';\n\nimport { isHtmlElement } from './ui';\n\nconst ElementWrapper = styled.div(({ theme }) => ({\n fontFamily: theme.typography.fonts.base,\n color: theme.color.defaultText,\n fontSize: theme.typography.size.s2 - 1,\n lineHeight: '19px',\n marginTop: 25,\n marginBottom: 40,\n span: {\n '&:first-of-type': {\n fontWeight: 'bold',\n marginRight: 8\n }\n },\n code: {\n fontSize: 12,\n fontWeight: 'bold'\n },\n 'a code': {\n color: theme.color.secondary,\n textDecoration: 'none'\n },\n a: {\n color: theme.color.secondary,\n textDecoration: 'none',\n '&:hover': {\n textDecoration: 'underline'\n }\n }\n}));\n\nexport function ElementBlock({ element }: { element: string }) {\n const elements = element\n .split(' | ')\n .map((s) => s.trim())\n .filter(Boolean);\n\n if (elements.length === 0) return;\n\n const children: ReactNode[] = [createElement('span', { key: 'label' }, 'Element:')];\n\n for (const [i, name] of elements.entries()) {\n if (i > 0) {\n children.push(createElement('span', { key: `sep-${i}` }, ' | '));\n }\n\n const inner = isHtmlElement(name)\n ? createElement(\n 'a',\n {\n key: `link-${name}`,\n href: `https://developer.mozilla.org/en-US/docs/Web/API/${name}`,\n target: '_blank',\n rel: 'noopener noreferrer'\n },\n name\n )\n : name;\n\n children.push(createElement('code', { key: name }, inner));\n }\n\n return createElement(ElementWrapper, undefined, ...children);\n}\n","/* eslint-disable unicorn/no-null */\nimport { createElement } from 'react';\n\nimport { type Entry, renderBody, renderHead, TableWrapper } from './ui';\n\nfunction renderPartsBody(entries: Entry[]) {\n return createElement(\n 'tbody',\n { className: 'docblock-argstable-body' },\n ...entries.map((entry) =>\n createElement(\n 'tr',\n { key: entry.name },\n createElement(\n 'td',\n null,\n createElement(\n 'code',\n { style: { fontSize: 12, fontWeight: 'bold' } },\n `[part=\"${entry.name}\"]`\n )\n ),\n createElement('td', null, entry.description ?? '')\n )\n )\n );\n}\n\nexport function PartsTable({ entries }: { entries: Entry[] }) {\n return createElement(\n TableWrapper,\n { className: 'docblock-argstable sb-unstyled' },\n renderHead(['Part', 'Description']),\n renderPartsBody(entries)\n );\n}\n\nexport function CssPropertiesTable({ entries }: { entries: Entry[] }) {\n return createElement(\n TableWrapper,\n { className: 'docblock-argstable sb-unstyled' },\n renderHead(['Property', 'Value']),\n renderBody(entries)\n );\n}\n","import { ArgTypes, Subheading } from '@storybook/addon-docs/blocks';\nimport { createElement, type ReactNode } from 'react';\nimport { styled } from 'storybook/theming';\n\nimport { BlocksTable, ParamRow, ParamType } from './blocks';\nimport { ElementBlock } from './element';\nimport { H2 } from './ui';\n\nimport type { EmberMeta } from '../../../node/types';\nimport type { SubcomponentRef } from '../signature';\nimport type { ComponentSignature } from 'ember-docgen';\n\nconst SubcomponentsSection = styled.div(() => ({\n marginTop: 25,\n marginBottom: 40\n}));\n\nconst SubEntry = styled.div(() => ({\n marginBottom: 24,\n '&:last-child': { marginBottom: 0 }\n}));\n\nconst SectionLabel = styled.div(({ theme }) => ({\n fontWeight: 'bold',\n color: theme.color.defaultText,\n fontSize: theme.typography.size.m1 - 2,\n marginBottom: 8\n}));\n\nfunction renderSubcomponentSignature(\n sig: ComponentSignature,\n subcomponentNames: Set<string>,\n data?: EmberMeta\n): ReactNode[] {\n const children: ReactNode[] = [];\n\n if (sig.element) {\n children.push(createElement(ElementBlock, { element: sig.element }));\n }\n\n if (Object.keys(sig.args).length > 0) {\n children.push(\n createElement(SectionLabel, undefined, 'Args'),\n createElement(ArgTypes, { include: Object.keys(sig.args) })\n );\n }\n\n if (Object.keys(sig.blocks).length > 0) {\n children.push(\n createElement(SectionLabel, { key: 'blocks-label', style: { marginTop: 12 } }, 'Blocks'),\n createElement(BlocksTable, { blocks: sig.blocks, subcomponentNames, data })\n );\n }\n\n return children;\n}\n\nexport function SubcomponentsArea({\n components,\n data\n}: {\n components: SubcomponentRef[];\n data?: EmberMeta;\n}) {\n if (components.length === 0) return;\n\n const subcomponentNames = new Set(components.map((c) => c.name));\n\n const entries = components.map((comp) => {\n const children: ReactNode[] = [createElement(Subheading, undefined, comp.name)];\n\n if (comp.importPath) {\n children.push(\n createElement(\n ParamRow,\n { key: 'import', style: { marginBottom: 12 } },\n createElement('span', undefined, \"from '\"),\n createElement(ParamType, undefined, comp.importPath),\n createElement('span', undefined, \"'\")\n )\n );\n } else if (comp.signature) {\n children.push(...renderSubcomponentSignature(comp.signature, subcomponentNames, data));\n }\n\n return createElement(\n SubEntry,\n { id: `subcomponent-${comp.name}`, key: comp.name },\n ...children\n );\n });\n\n return createElement(\n SubcomponentsSection,\n undefined,\n createElement(H2, undefined, 'Subcomponents'),\n ...entries\n );\n}\n","import {\n Controls,\n Description,\n Primary,\n Stories,\n Subheading,\n Subtitle,\n Title,\n useOf\n} from '@storybook/addon-docs/blocks';\nimport { createElement, Fragment, type ReactNode } from 'react';\nimport emberData from 'virtual:ember-storybook';\n\nimport { BlocksSection } from './blocks/blocks';\nimport { ElementBlock } from './blocks/element';\nimport { CssPropertiesTable, PartsTable } from './blocks/style';\nimport { SubcomponentsArea } from './blocks/subcomponents';\nimport { H2 } from './blocks/ui';\nimport { collectSubcomponents } from './signature';\n\nimport type { EmberMeta } from '../../node/types';\nimport type { ComponentSignature } from 'ember-docgen';\n\nfunction addSignature(signature: ComponentSignature, data: EmberMeta) {\n const children: ReactNode[] = [];\n\n if (signature.element) {\n children.push(createElement(ElementBlock, { element: signature.element }));\n }\n\n // Render unfiltered — the argTypes enhancer already merges\n // buildArgTypes(signature) into the store, so this mirrors\n // the Controls panel exactly.\n if (Object.keys(signature.args).length > 0) {\n children.push(createElement(Subheading, undefined, 'Args'), createElement(Controls));\n }\n\n if (Object.keys(signature.blocks).length > 0) {\n const subcomponents = collectSubcomponents(signature.blocks, data);\n const subcomponentNames = new Set(subcomponents.map((s) => s.name));\n\n children.push(\n createElement(BlocksSection, { blocks: signature.blocks, subcomponentNames, data })\n );\n\n if (subcomponents.length > 0) {\n children.push(createElement(SubcomponentsArea, { components: subcomponents, data }));\n }\n }\n\n if (Object.keys(signature.style.customProperties).length > 0) {\n const entries = Object.entries(signature.style.customProperties).map(([name, description]) => ({\n name,\n description\n }));\n\n children.push(\n createElement(Subheading, undefined, 'CSS Custom Properties'),\n createElement(CssPropertiesTable, { entries })\n );\n }\n\n if (Object.keys(signature.style.parts).length > 0) {\n const entries = Object.entries(signature.style.parts).map(([name, description]) => ({\n name,\n description\n }));\n\n children.push(\n createElement(Subheading, undefined, 'Parts'),\n createElement(PartsTable, { entries })\n );\n }\n\n if (children.length > 0) {\n children.unshift(createElement(H2, undefined, 'Signature'));\n }\n\n return children;\n}\n\nexport default function Page() {\n const resolved: {\n preparedMeta?: {\n argTypes?: Record<string, unknown>;\n title?: string;\n parameters?: Record<string, unknown>;\n };\n } = useOf('meta', ['meta']);\n\n const data = emberData as EmberMeta;\n const storyFile = resolved.preparedMeta?.parameters?.fileName as string | undefined;\n const storyEntry = storyFile ? data[storyFile] : undefined;\n const storyComponent = storyEntry && 'component' in storyEntry ? storyEntry.component : undefined;\n const compFile = storyComponent?.file;\n const compEntry = compFile ? data[compFile] : undefined;\n const signatureName = storyComponent?.signatureName ?? '';\n const signature =\n compEntry && 'signatures' in compEntry ? compEntry.signatures[signatureName] : undefined;\n\n const children: ReactNode[] = [\n createElement(Title),\n createElement(Subtitle),\n createElement(Description),\n createElement(Primary)\n ];\n\n if (signature) {\n children.push(...addSignature(signature, data));\n }\n\n children.push(createElement(Stories));\n\n return createElement(Fragment, undefined, ...children);\n}\n","import { SourceType } from 'storybook/internal/docs-tools';\nimport { emitTransformCode, useEffect, useRef } from 'storybook/preview-api';\nimport emberData from 'virtual:ember-storybook';\n\nimport { isEmberStoryResult } from '../story-result';\nimport { unwrapBlockParams } from './block-params';\n\nimport type { StorySource } from '../../node/types';\nimport type { StoryFn } from '../public-types';\nimport type { EmberRenderer } from '../types';\nimport type { BlockInfo, ComponentSignature } from 'ember-docgen';\nimport type { Args, ArgTypes, DecoratorFunction } from 'storybook/internal/types';\n\nconst data = emberData as Record<\n string,\n {\n component?: { file?: string; signatureName?: string };\n source?: Record<string, StorySource>;\n signatures?: Record<string, ComponentSignature>;\n }\n>;\n\nfunction skipSourceRender(context: Parameters<DecoratorFunction<EmberRenderer>>[1]) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access\n const sourceParams = context.parameters.docs?.source;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (sourceParams?.type === SourceType.DYNAMIC) {\n return false;\n }\n\n const isArgsStory = context.parameters.__isArgsStory as boolean;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access\n return (!isArgsStory || sourceParams?.code) ?? sourceParams?.type === SourceType.CODE;\n}\n\nexport function toArgument(key: string, value: unknown, argTypes: ArgTypes): string | undefined {\n if (value !== undefined && value !== null) {\n if (typeof value === 'string') {\n return `@${key}=${JSON.stringify(value)}`;\n }\n\n if (typeof value === 'number' || typeof value === 'boolean') {\n return `@${key}={{${String(value)}}}`;\n }\n\n if (Object.hasOwn(argTypes, key)) {\n return `@${key}={{@${key}}}`;\n }\n\n return undefined;\n }\n\n if (value === undefined && Object.hasOwn(argTypes, key)) {\n return `@${key}={{@${key}}}`;\n }\n\n return undefined;\n}\n\nfunction generateBlockContent(blockInfo: BlockInfo): string {\n if (blockInfo.params.length === 0) {\n return '...';\n }\n\n const paramNames = unwrapBlockParams(blockInfo.params)\n .map((p) => p.name)\n .join(', ');\n\n return `{{yield ${paramNames}}}`;\n}\n\nexport function generateBlockSourceCode(\n sig: ComponentSignature,\n args: Args,\n indent: string\n): string {\n const blockNames = Object.keys(sig.blocks);\n\n if (blockNames.length === 0) return '';\n\n const blocks: string[] = [];\n\n for (const blockName of blockNames) {\n const blockInfo = sig.blocks[blockName];\n const arg = (args as Record<string, unknown>)[blockName];\n\n if (arg === undefined && blockInfo.params.length === 0) {\n continue;\n }\n\n const params = unwrapBlockParams(blockInfo.params)\n .map((p) => p.name)\n .join(' ');\n const slotBindings = params ? ` as |${params}|` : '';\n\n const content = generateBlockContent(blockInfo);\n\n if (blockName === 'default' && !slotBindings) {\n blocks.push(content);\n } else {\n blocks.push(`${indent} <:${blockName}${slotBindings}>${content}</:${blockName}>`);\n }\n }\n\n return blocks.join('\\n');\n}\n\nlet byStoryId: Record<string, StorySource> | undefined;\n\nfunction getByStoryId(): Record<string, StorySource> {\n if (byStoryId) return byStoryId;\n\n byStoryId = {};\n\n for (const entry of Object.values(data)) {\n for (const [storyId, source] of Object.entries(entry.source ?? {})) {\n byStoryId[storyId] = {\n componentName: source.componentName,\n signatureName: source.signatureName,\n inlineTemplate: source.inlineTemplate\n };\n }\n }\n\n return byStoryId;\n}\n\nfunction signatureForComponent(name: string): ComponentSignature | undefined {\n for (const entry of Object.values(data)) {\n const comp = entry.component;\n\n if (comp?.signatureName !== name) continue;\n\n const compEntry = comp.file ? data[comp.file] : undefined;\n\n return compEntry?.signatures?.[comp.signatureName];\n }\n\n return undefined;\n}\n\nexport function resolveTemplateArgs(template: string, args: Args): string {\n return template.replaceAll(/\\{\\{args\\.(\\w+)\\}\\}/g, (_match, key) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const value = (args as Record<string, unknown>)[key];\n\n if (typeof value === 'string') {\n return JSON.stringify(value);\n }\n\n if (typeof value === 'number' || typeof value === 'boolean') {\n return `{{${String(value)}}}`;\n }\n\n return `{{@${key}}}`;\n });\n}\n\nexport function generateSource(\n component: { name?: string },\n args: Args,\n argTypes: ArgTypes,\n storyId?: string\n): string | undefined {\n const meta = storyId ? getByStoryId()[storyId] : undefined;\n\n if (meta?.inlineTemplate) {\n return resolveTemplateArgs(meta.inlineTemplate, args);\n }\n\n const name = meta?.componentName ?? component.name;\n\n if (!name || name === '(unknown template-only component)') {\n return undefined;\n }\n\n // Default-exported components are keyed by the `__DEFAULT__` sentinel in the\n // signatures map, while `name` is the real component name. Look the signature\n // up by the sentinel so blocks/args still resolve.\n const sig = signatureForComponent(meta?.signatureName ?? name);\n\n const propsArray = Object.entries(args)\n .filter(([k]) => !sig || !Object.hasOwn(sig.blocks, k))\n .map(([k, v]) => toArgument(k, v, argTypes))\n .filter(Boolean);\n\n const blockCode = sig ? generateBlockSourceCode(sig, args, '') : '';\n\n const propsStr = propsArray.join(' ');\n\n if (!blockCode) {\n if (propsArray.length === 0) {\n return `<${name} />`;\n }\n\n if (propsArray.length > 3) {\n return `<${name}\\n ${propsArray.join('\\n ')}\\n/>`;\n }\n\n return `<${name} ${propsStr} />`;\n }\n\n if (propsArray.length === 0) {\n return `<${name}>\\n${blockCode}\\n</${name}>`;\n }\n\n return `<${name} ${propsStr}>\\n${blockCode}\\n</${name}>`;\n}\n\nexport const sourceDecorator: DecoratorFunction<EmberRenderer> = (storyFn, context) => {\n const source = useRef<string | undefined>(undefined);\n const story = storyFn();\n\n useEffect(() => {\n // Always generate the source from the ORIGINAL story, not the decorator-wrapped\n // `storyFn()` result. A decorator wraps the story in another component, so its\n // `.name` (e.g. `IntlDecorator`) would leak into the generated source block.\n const rendered = (context.originalStoryFn as StoryFn)(context.args, context);\n const renderedForSource = isEmberStoryResult(rendered) ? rendered.component : rendered;\n\n if (!skipSourceRender(context)) {\n const code =\n generateSource(renderedForSource, context.args, context.argTypes, context.id) ?? undefined;\n\n void emitTransformCode(code, context);\n source.current = code;\n }\n });\n\n return story;\n};\n","import { SourceType } from 'storybook/internal/docs-tools';\nimport emberData from 'virtual:ember-storybook';\n\nimport { buildArgTypes } from './extractArgTypes';\nimport Page from './page';\nimport { sourceDecorator } from './source-decorator';\n\nimport type { ComponentFile, EmberMeta, StoryFile } from '../../node/types';\nimport type { EmberRenderer } from '../types';\nimport type { ComponentSignature } from 'ember-docgen';\nimport type {\n DecoratorFunction,\n Parameters,\n StoryContextForEnhancers,\n StrictArgTypes\n} from 'storybook/internal/types';\n\nconst data = emberData as EmberMeta;\n\nfunction resolveSig(entry: StoryFile | ComponentFile): ComponentSignature | undefined {\n if (!('component' in entry)) return undefined;\n\n const comp = entry.component;\n\n if (!comp.signatureName) return undefined;\n\n const compEntry = comp.file ? data[comp.file] : undefined;\n\n if (!compEntry || !('signatures' in compEntry)) return undefined;\n\n return compEntry.signatures[comp.signatureName];\n}\n\n/** Last path segment of a CSF title — used to match stories without `fileName`. */\nfunction titleLeaf(title: string | undefined): string | undefined {\n return title?.split('/').pop();\n}\n\nexport const argTypesEnhancers: ((\n context: StoryContextForEnhancers<EmberRenderer>\n) => StrictArgTypes)[] = [\n (context) => {\n const filePath = (context.parameters as Record<string, unknown>).fileName as string | undefined;\n\n if (filePath && Object.hasOwn(data, filePath)) {\n const sig = resolveSig(data[filePath]);\n\n if (sig) {\n return { ...buildArgTypes(sig), ...context.argTypes } as StrictArgTypes;\n }\n\n return context.argTypes;\n }\n\n // No `parameters.fileName` — fall back to matching the CSF title leaf\n // against indexed story files instead of picking an arbitrary signature.\n const leaf = titleLeaf(context.title);\n\n if (leaf) {\n for (const entry of Object.values(data)) {\n if (!('meta' in entry)) continue;\n\n if (titleLeaf(entry.meta.title) !== leaf) continue;\n\n const sig = resolveSig(entry);\n\n if (sig) {\n return { ...buildArgTypes(sig), ...context.argTypes } as StrictArgTypes;\n }\n }\n }\n\n return context.argTypes;\n }\n];\n\nexport const parameters: Parameters = {\n docs: {\n source: {\n type: SourceType.DYNAMIC,\n language: 'html'\n },\n page: Page\n }\n};\n\nexport const decorators: DecoratorFunction<EmberRenderer>[] = [sourceDecorator];\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;EACNC,MAAMjC,WAAWkC;EACjBC,UAAU;CACZ;CACAC,MAAMjC;AACR,EACF;AAEA,MAAakC,aAAiD,CAACjC,eAAe"}
|
|
1
|
+
{"version":3,"file":"config.mjs","names":["mapTypeToControl","type","category","options","sortArgTypes","argTypes","Object","fromEntries","entries","toSorted","a","b","localeCompare","buildArgTypes","sig","name","arg","args","description","undefined","raw","required","control","table","summary","defaultValue","isObject","value","mergeArgTypes","signatureArgTypes","storyArgTypes","merged","storyArg","sigArg","storyFields","filter","mergedArg","shouldShowArgsSection","metaArgTypes","keys","length","unwrapBlockParams","DEFAULT_EXPORT","hasSignatureMap","entry","Object","hasOwn","componentDisplayName","ref","data","filePath","exportName","undefined","rawEntry","componentEntry","meta","applyModifiers","signature","modifiers","length","blockedKeys","Set","pickedKeys","mod","name","key","typeArgs","add","filtered","size","fromEntries","entries","args","filter","k","has","collectSubcomponents","blocks","seen","result","block","values","param","params","componentRef","importPath","local","push","signatures","sig","Heading","createElement","styled","isHtmlElement","name","test","TableWrapper","table","theme","fontFamily","typography","fonts","base","borderSpacing","color","defaultText","fontSize","size","s2","lineHeight","textAlign","width","marginTop","marginBottom","marginInline","padding","border","verticalAlign","textOverflow","paddingLeft","paddingRight","th","textMutedColor","paddingTop","paddingBottom","td","tbody","filter","background","content","borderTop","appBorderColor","borderBlockStart","borderBlockEnd","borderInlineStart","borderInlineEnd","borderTopLeftRadius","appBorderRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","borderColor","renderHead","columns","className","map","col","renderBody","entries","entry","key","style","fontWeight","description","H2","weight","bold","letterSpacing","textTransform","DocsContext","Subheading","createElement","Fragment","useContext","NAVIGATE_URL","styled","componentDisplayName","TableWrapper","ParamType","code","theme","color","secondary","fontSize","fontWeight","ParamName","span","defaultText","ParamRow","div","typography","size","s2","lineHeight","marginBottom","ParamDesc","textMutedColor","s1","marginLeft","BlocksDiv","marginTop","BlocksNameCell","td","position","weight","bold","background","app","SubcomponentLink","a","primary","cursor","textDecoration","Indent","marginInlineStart","SubcomponentAnchor","name","children","context","hash","href","target","onClick","event","preventDefault","document","querySelector","CSS","escape","slice","scrollIntoView","behavior","block","channel","emit","displayTypeName","param","data","componentRef","local","undefined","type","renderType","subcomponentNames","displayType","typeIsSubcomponent","has","key","renderParam","isBlockParam","Object","hasOwn","renderParams","params","map","i","entries","flatMap","p","isNamed","startsWith","isSubcomponent","typeChildren","push","rows","description","BlocksTable","blocks","toSorted","nameA","_a","nameB","_b","length","displayName","className","BlocksSection","createElement","styled","isHtmlElement","ElementWrapper","div","theme","fontFamily","typography","fonts","base","color","defaultText","fontSize","size","s2","lineHeight","marginTop","marginBottom","span","fontWeight","marginRight","code","secondary","textDecoration","a","ElementBlock","element","elements","split","map","s","trim","filter","Boolean","length","children","key","i","name","entries","push","inner","href","target","rel","undefined","createElement","renderBody","renderHead","TableWrapper","renderPartsBody","entries","className","map","entry","key","name","style","fontSize","fontWeight","description","PartsTable","CssPropertiesTable","PureArgsTable","Subheading","createElement","styled","buildArgTypes","BlocksTable","ParamRow","ParamType","ElementBlock","H2","SubcomponentsSection","div","marginTop","marginBottom","SubEntry","SectionLabel","theme","fontWeight","color","defaultText","fontSize","typography","size","m1","renderSubcomponentSignature","sig","subcomponentNames","data","children","element","push","Object","keys","args","length","undefined","rows","blocks","key","style","SubcomponentsArea","components","Set","map","c","name","entries","comp","importPath","signature","id","Controls","Description","Primary","Stories","Subheading","Subtitle","Title","useOf","createElement","Fragment","emberData","BlocksSection","ElementBlock","CssPropertiesTable","PartsTable","SubcomponentsArea","H2","shouldShowArgsSection","collectSubcomponents","addSignature","signature","data","metaArgTypes","children","element","push","undefined","Object","keys","blocks","length","subcomponents","subcomponentNames","Set","map","s","name","components","style","customProperties","entries","description","parts","unshift","Page","resolved","storyFile","preparedMeta","parameters","fileName","storyEntry","storyComponent","component","compFile","file","compEntry","signatureName","signatures","argTypes","SourceType","emitTransformCode","useEffect","useRef","emberData","isEmberStoryResult","unwrapBlockParams","data","skipSourceRender","context","sourceParams","parameters","docs","source","type","DYNAMIC","isArgsStory","__isArgsStory","code","CODE","toArgument","key","value","argTypes","undefined","JSON","stringify","String","Object","hasOwn","generateBlockContent","blockInfo","params","length","paramNames","map","p","name","join","generateBlockSourceCode","sig","args","indent","blockNames","keys","blocks","blockName","arg","slotBindings","content","push","byStoryId","getByStoryId","entry","values","storyId","entries","componentName","signatureName","inlineTemplate","signatureForComponent","comp","component","compEntry","file","signatures","resolveTemplateArgs","template","replaceAll","_match","generateSource","meta","propsArray","filter","k","v","Boolean","blockCode","propsStr","sourceDecorator","storyFn","story","rendered","originalStoryFn","renderedForSource","id","current","SourceType","emberData","buildArgTypes","mergeArgTypes","sortArgTypes","Page","sourceDecorator","data","resolveSig","entry","undefined","comp","component","signatureName","compEntry","file","signatures","titleLeaf","title","split","pop","argTypesEnhancers","context","filePath","parameters","fileName","Object","hasOwn","sig","argTypes","leaf","values","meta","docs","source","type","DYNAMIC","language","page","decorators"],"sources":["../../../src/client/docs/extractArgTypes.ts","../../../src/client/docs/signature.ts","../../../src/client/docs/blocks/ui.ts","../../../src/client/docs/blocks/blocks.ts","../../../src/client/docs/blocks/element.ts","../../../src/client/docs/blocks/style.ts","../../../src/client/docs/blocks/subcomponents.ts","../../../src/client/docs/page.ts","../../../src/client/docs/source-decorator.ts","../../../src/client/docs/config.ts"],"sourcesContent":["import type { ArgTypeInfo, ComponentSignature } from 'ember-docgen';\n\nfunction mapTypeToControl(\n type: ArgTypeInfo\n):\n | false\n | { type: 'text' }\n | { type: 'number' }\n | { type: 'boolean' }\n | { type: 'select'; options: string[] }\n | { type: 'object' }\n | { type: 'function' }\n | { type: 'date' } {\n switch (type.category) {\n case 'string': {\n return { type: 'text' };\n }\n case 'number': {\n return { type: 'number' };\n }\n case 'boolean': {\n return { type: 'boolean' };\n }\n case 'function': {\n return { type: 'function' };\n }\n case 'enum': {\n return { type: 'select', options: type.options ?? [] };\n }\n\n default: {\n return { type: 'object' };\n }\n }\n}\n\n/**\n * Returns a new argTypes object with entries sorted alphabetically by name,\n * matching Storybook's `alpha` sort order. The input object is not mutated.\n */\nexport function sortArgTypes(argTypes: Record<string, unknown>): Record<string, unknown> {\n return Object.fromEntries(Object.entries(argTypes).toSorted(([a], [b]) => a.localeCompare(b)));\n}\n\nexport function buildArgTypes(sig: ComponentSignature): Record<string, unknown> {\n const argTypes: Record<string, unknown> = {};\n\n for (const [name, arg] of Object.entries(sig.args)) {\n argTypes[name] = {\n name,\n description: arg.description || undefined,\n type: {\n name: arg.type.raw,\n required: arg.required\n },\n control: mapTypeToControl(arg.type),\n table: {\n type: { summary: arg.type.raw },\n defaultValue: arg.defaultValue ? { summary: arg.defaultValue } : undefined\n }\n };\n }\n\n return sortArgTypes(argTypes);\n}\n\nfunction isObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null;\n}\n\n/**\n * Merges signature-derived argTypes with the story-provided argTypes.\n *\n * Signature argTypes are the base; story argTypes enhance them for better\n * rendering (custom `name`, `control`, `options`, ...). For args present in\n * both, story fields win — but only when they carry an actual value, so an\n * explicit `undefined` never masks a signature field. The signature keeps the\n * `table` and `description` the story does not override.\n *\n * The `type` object is deep-merged: a story-provided partial `type` (e.g.\n * `type: 'string'`) keeps the signature's `required` flag unless the story\n * explicitly sets it, while the story's `type.name` still wins.\n */\nexport function mergeArgTypes(\n signatureArgTypes: Record<string, unknown>,\n storyArgTypes: Record<string, unknown>\n): Record<string, unknown> {\n const merged: Record<string, unknown> = { ...signatureArgTypes };\n\n for (const [name, storyArg] of Object.entries(storyArgTypes)) {\n if (storyArg === undefined) continue;\n\n const sigArg = merged[name];\n\n if (!isObject(sigArg) || !isObject(storyArg)) {\n merged[name] = storyArg;\n continue;\n }\n\n const storyFields = Object.fromEntries(\n Object.entries(storyArg).filter(([, value]) => value !== undefined)\n );\n\n const mergedArg = { ...sigArg, ...storyFields };\n\n // Deep-merge `type` so a story-provided partial `type` does not drop the\n // signature's `required` flag (issue #48). The story's `type.name` still\n // wins; `required` survives unless the story explicitly sets it.\n if (isObject(sigArg.type) && isObject(storyFields.type)) {\n mergedArg.type = { ...sigArg.type, ...storyFields.type };\n }\n\n merged[name] = mergedArg;\n }\n\n return merged;\n}\n\n/**\n * Whether the docs page should render the Args/controls table: either the\n * component signature exposes args, or the meta carries story-provided\n * argTypes (e.g. for a template-only component with story argTypes but no\n * signature args).\n */\nexport function shouldShowArgsSection(\n sig: ComponentSignature,\n metaArgTypes?: Record<string, unknown>\n): boolean {\n return Object.keys(sig.args).length > 0 || Object.keys(metaArgTypes ?? {}).length > 0;\n}\n","import { unwrapBlockParams } from './block-params';\n\nimport type { ComponentMap } from '../../node/parser';\nimport type { ComponentFile, EmberMeta } from '../../node/types';\nimport type { BlockInfo, ComponentSignature } from 'ember-docgen';\n\n/**\n * Key used for default exports in signature/component maps. Mirrors\n * ember-docgen's `Default` sentinel — duplicated as a literal so client\n * code does not pull ember-docgen's node-only dependencies into the bundle.\n */\nexport const DEFAULT_EXPORT = '__DEFAULT__';\n\nexport interface SubcomponentRef {\n name: string;\n signature?: ComponentSignature;\n importPath?: string;\n}\n\n/**\n * Resolve the human-facing name of a referenced component export.\n *\n * Prefers the component's own declaration name over its export alias and\n * resolves the default-export sentinel to the real class name via the\n * component file's declaration map. Returns `undefined` when no better\n * name is known.\n */\nfunction hasSignatureMap(entry: unknown): entry is ComponentFile {\n return typeof entry === 'object' && entry !== null && Object.hasOwn(entry, 'signatures');\n}\n\nexport function componentDisplayName(\n ref: undefined | { filePath?: string; exportName?: string },\n data: EmberMeta\n): string | undefined {\n if (!ref?.filePath || !ref.exportName) return undefined;\n\n const rawEntry: unknown = data[ref.filePath];\n\n const componentEntry = hasSignatureMap(rawEntry) ? rawEntry : undefined;\n\n if (!componentEntry) {\n return ref.exportName === DEFAULT_EXPORT ? undefined : ref.exportName;\n }\n\n // Transitive component files contribute only `signatures` (no declaration\n // map) — fall back to the export name instead of the unresolved meta.\n const meta = (componentEntry as { meta?: ComponentMap }).meta;\n\n if (ref.exportName === DEFAULT_EXPORT) {\n return meta?.[DEFAULT_EXPORT];\n }\n\n return meta?.[ref.exportName] ?? ref.exportName;\n}\n\nexport function applyModifiers(\n signature: ComponentSignature,\n modifiers?: { name: string; typeArgs: string[] }[]\n): ComponentSignature {\n if (!modifiers || modifiers.length === 0) return signature;\n\n const blockedKeys = new Set<string>();\n const pickedKeys = new Set<string>();\n\n for (const mod of modifiers) {\n if (mod.name === 'WithBoundArgs' || mod.name === 'Omit') {\n for (const key of mod.typeArgs) blockedKeys.add(key);\n }\n\n if (mod.name === 'Pick') {\n for (const key of mod.typeArgs) pickedKeys.add(key);\n }\n }\n\n const filtered =\n pickedKeys.size > 0\n ? Object.fromEntries(Object.entries(signature.args).filter(([k]) => pickedKeys.has(k)))\n : Object.fromEntries(Object.entries(signature.args).filter(([k]) => !blockedKeys.has(k)));\n\n return { ...signature, args: filtered };\n}\n\nexport function collectSubcomponents(\n blocks: Record<string, BlockInfo>,\n data: EmberMeta\n): SubcomponentRef[] {\n const seen = new Set<string>();\n\n const result: SubcomponentRef[] = [];\n\n for (const block of Object.values(blocks)) {\n for (const param of unwrapBlockParams(block.params)) {\n if (!param.componentRef) {\n // eslint-disable-next-line unicorn/no-break-in-nested-loop\n continue;\n }\n\n const { filePath, exportName, importPath, modifiers } = param.componentRef;\n\n // Local components (non-exported) are named by the yield key — the\n // declaration name is an implementation detail.\n const name = param.componentRef.local\n ? param.name\n : (componentDisplayName(param.componentRef, data) ?? param.name);\n\n if (seen.has(name)) {\n // eslint-disable-next-line unicorn/no-break-in-nested-loop\n continue;\n }\n\n seen.add(name);\n\n if (importPath) {\n result.push({ name, importPath });\n } else if (filePath && Object.hasOwn(data, filePath)) {\n const entry = data[filePath] as ComponentFile;\n\n if (Object.hasOwn(entry.signatures, exportName)) {\n const sig = entry.signatures[exportName];\n\n result.push({\n name,\n signature: applyModifiers(sig, modifiers)\n });\n }\n } else if (filePath) {\n // Project-local file without an extractable signature\n // (e.g. a bare template-only component) — still list it by name.\n result.push({ name });\n }\n }\n }\n\n return result;\n}\n","/* eslint-disable unicorn/no-null */\nimport { Heading } from '@storybook/addon-docs/blocks';\nimport { createElement } from 'react';\nimport { styled, type Theme } from 'storybook/theming';\n\nexport interface Entry {\n name: string;\n description?: string;\n}\n\ntype StyleProps = { theme: Theme };\n\nexport function isHtmlElement(name: string): boolean {\n return /^HTML[A-Z]\\w*Element$/.test(name);\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nexport const TableWrapper = styled.table(({ theme }: StyleProps) => ({\n fontFamily: theme.typography.fonts.base,\n borderSpacing: 0,\n color: theme.color.defaultText,\n fontSize: theme.typography.size.s2 - 1,\n lineHeight: '19px',\n textAlign: 'left',\n width: '100%',\n marginTop: 25,\n marginBottom: 40,\n marginInline: 1,\n 'td, th': {\n padding: 0,\n border: 'none',\n verticalAlign: 'top',\n textOverflow: 'ellipsis'\n },\n 'th:first-of-type, td:first-of-type': {\n paddingLeft: 20\n },\n 'th:last-of-type, td:last-of-type': {\n paddingRight: 20\n },\n th: {\n color: theme.textMutedColor as string,\n paddingTop: 10,\n paddingBottom: 10,\n paddingLeft: 15,\n paddingRight: 15\n },\n td: {\n paddingTop: '10px',\n paddingBottom: '10px',\n '&:not(:first-of-type)': {\n paddingLeft: 15,\n paddingRight: 15\n },\n '&:last-of-type': {\n paddingRight: 20\n }\n },\n tbody: {\n filter:\n theme.base === 'light'\n ? 'drop-shadow(0px 1px 3px rgba(0, 0, 0, 0.10))'\n : 'drop-shadow(0px 1px 3px rgba(0, 0, 0, 0.20))',\n '> tr > *': {\n background: theme.background.content,\n borderTop: `1px solid ${theme.appBorderColor}`\n },\n '> tr:first-of-type > *': {\n borderBlockStart: `1px solid ${theme.appBorderColor}`\n },\n '> tr:last-of-type > *': {\n borderBlockEnd: `1px solid ${theme.appBorderColor}`\n },\n '> tr > *:first-of-type': {\n borderInlineStart: `1px solid ${theme.appBorderColor}`\n },\n '> tr > *:last-of-type': {\n borderInlineEnd: `1px solid ${theme.appBorderColor}`\n },\n '> tr:first-of-type > td:first-of-type': {\n borderTopLeftRadius: theme.appBorderRadius\n },\n '> tr:first-of-type > td:last-of-type': {\n borderTopRightRadius: theme.appBorderRadius\n },\n '> tr:last-of-type > td:first-of-type': {\n borderBottomLeftRadius: theme.appBorderRadius\n },\n '> tr:last-of-type > td:last-of-type': {\n borderBottomRightRadius: theme.appBorderRadius\n }\n },\n '@media (forced-colors: active)': {\n tbody: {\n filter: 'none',\n '> tr > *': {\n borderColor: 'CanvasText'\n }\n }\n }\n}));\n\nexport function renderHead(columns: string[]) {\n return createElement(\n 'thead',\n { className: 'docblock-argstable-head' },\n createElement(\n 'tr',\n null,\n ...columns.map((col) => createElement('th', null, createElement('span', null, col)))\n )\n );\n}\n\nexport function renderBody(entries: Entry[]) {\n return createElement(\n 'tbody',\n { className: 'docblock-argstable-body' },\n ...entries.map((entry) =>\n createElement(\n 'tr',\n { key: entry.name },\n createElement(\n 'td',\n null,\n createElement('span', { style: { fontWeight: 'bold' } }, entry.name)\n ),\n createElement('td', null, entry.description ?? '')\n )\n )\n );\n}\n\nexport const H2 = styled(Heading)(({ theme }) => ({\n fontSize: `${theme.typography.size.s2 - 1}px`,\n fontWeight: theme.typography.weight.bold,\n lineHeight: '16px',\n letterSpacing: '0.35em',\n textTransform: 'uppercase',\n color: theme.textMutedColor as string,\n border: 0,\n marginBottom: '12px',\n '&:first-of-type': { marginTop: '56px' }\n}));\n","import { DocsContext, Subheading } from '@storybook/addon-docs/blocks';\nimport { createElement, Fragment, type MouseEvent, type ReactNode, useContext } from 'react';\nimport { NAVIGATE_URL } from 'storybook/internal/core-events';\nimport { styled } from 'storybook/theming';\n\nimport { componentDisplayName } from '../signature';\nimport { TableWrapper } from './ui';\n\nimport type { EmberMeta } from '../../../node/types';\nimport type { BlockInfo, BlockParam, HashBlockParam } from 'ember-docgen';\n\nexport const ParamType = styled.code(({ theme }) => ({\n color: theme.color.secondary,\n fontSize: 12,\n fontWeight: 'bold'\n}));\n\nconst ParamName = styled.span(({ theme }) => ({\n fontWeight: 'bold',\n color: theme.color.defaultText\n}));\n\nexport const ParamRow = styled.div(({ theme }) => ({\n fontSize: theme.typography.size.s2 - 1,\n lineHeight: '19px',\n marginBottom: 2\n}));\n\nconst ParamDesc = styled.div(({ theme }) => ({\n color: theme.textMutedColor as string,\n fontSize: theme.typography.size.s1,\n lineHeight: '17px',\n marginBottom: 8,\n marginLeft: 20\n}));\n\nconst BlocksDiv = styled.div(() => ({\n marginTop: 25,\n marginBottom: 40\n}));\n\nconst BlocksNameCell = styled.td(({ theme }) => ({\n position: 'relative',\n fontWeight: theme.typography.weight.bold,\n fontSize: theme.typography.size.s1,\n background: `${theme.background.app} !important`,\n '& ~ td': {\n background: `${theme.background.app} !important`\n }\n}));\n\nconst SubcomponentLink = styled.a(({ theme }) => ({\n color: theme.color.primary,\n fontWeight: 'bold',\n cursor: 'pointer',\n textDecoration: 'none',\n '&:hover': { textDecoration: 'underline' }\n}));\n\nconst Indent = styled.span(() => ({\n marginInlineStart: '20px'\n}));\n\n/**\n * In-page anchor to a subcomponent section. Mirrors Storybook's own\n * in-docs navigation (TableOfContents / AnchorInPage): the default anchor\n * behavior is prevented — it would resolve against the preview iframe's\n * `<base>` and navigate away from Storybook — and instead the docs page\n * scrolls to the target while `NAVIGATE_URL` keeps the address-bar hash\n * (deep-linkable) in sync via the manager.\n */\nfunction SubcomponentAnchor({ name, children }: { name: string; children?: ReactNode }) {\n const context = useContext(DocsContext);\n const hash = `#subcomponent-${name}`;\n\n return createElement(\n SubcomponentLink,\n {\n href: hash,\n target: '_self',\n onClick: (event: MouseEvent) => {\n event.preventDefault();\n\n const target = document.querySelector(`#${CSS.escape(hash.slice(1))}`);\n\n if (target) {\n target.scrollIntoView({ behavior: 'smooth', block: 'start' });\n context.channel.emit(NAVIGATE_URL, hash);\n }\n }\n },\n children\n );\n}\n\n/** Display name for a block param's type: the referenced component's own\n * name when available, the yield key for local components, otherwise the\n * raw type string. */\nfunction displayTypeName(param: BlockParam, data?: EmberMeta): string {\n if (param.componentRef?.local) return param.name;\n\n return (data ? componentDisplayName(param.componentRef, data) : undefined) ?? param.type;\n}\n\nfunction renderType(\n param: BlockParam,\n subcomponentNames: Set<string>,\n data?: EmberMeta\n): ReactNode {\n const displayType = displayTypeName(param, data);\n\n if (param.componentRef) {\n const typeIsSubcomponent = subcomponentNames.has(displayType);\n\n return typeIsSubcomponent\n ? createElement(SubcomponentAnchor, { key: 'type', name: displayType }, displayType)\n : createElement(ParamType, { key: 'type' }, displayType);\n }\n\n return createElement(ParamType, { key: 'type' }, param.type);\n}\n\nfunction renderParam(\n param: BlockParam,\n subcomponentNames: Set<string>,\n data?: EmberMeta\n): ReactNode[] {\n const type = renderType(param, subcomponentNames, data);\n const name = createElement(ParamName, { key: 'name' }, param.name);\n\n return [name, createElement('span', { key: 'colon' }, ': '), type];\n}\n\nfunction isBlockParam(param: BlockParam | HashBlockParam): param is BlockParam {\n return Object.hasOwn(param, 'name') && Object.hasOwn(param, 'type');\n}\n\nfunction renderParams(\n params: BlockInfo['params'],\n subcomponentNames: Set<string>,\n data?: EmberMeta\n): ReactNode[] {\n return params.map((param, i) => {\n if (!isBlockParam(param)) {\n const children: ReactNode[] = [\n createElement('span', { key: 'open' }, '- {'),\n createElement('br', { key: 'br-open' }),\n ...Object.entries(param).flatMap(([key, p]) => [\n createElement(Indent, { key: `indent-${key}` }),\n renderParam(p, subcomponentNames, data)\n ]),\n createElement('br', { key: 'br-close' }),\n createElement('span', { key: 'close' }, '}')\n ];\n\n return createElement(Fragment, { key: i }, ...children);\n }\n\n const isNamed = param.name && !param.name.startsWith('param');\n const displayType = displayTypeName(param, data);\n\n const isSubcomponent = subcomponentNames.has(displayType);\n\n const children: ReactNode[] = [];\n const typeChildren: ReactNode[] = [];\n\n if (isSubcomponent) {\n typeChildren.push(\n createElement(SubcomponentAnchor, { key: 'type', name: displayType }, displayType)\n );\n } else {\n typeChildren.push(createElement(ParamType, { key: 'type' }, displayType));\n }\n\n if (isNamed) {\n children.push(\n createElement('span', { key: 'sep' }, '- '),\n createElement(ParamName, { key: 'name' }, param.name),\n createElement('span', { key: 'colon' }, ': '),\n ...typeChildren\n );\n } else {\n children.push(createElement('span', { key: 'sep' }, '- '), ...typeChildren);\n }\n\n const rows: ReactNode[] = [createElement(ParamRow, { key: 'row' }, ...children)];\n\n if (param.description) {\n rows.push(createElement(ParamDesc, { key: 'desc' }, param.description));\n }\n\n return createElement(Fragment, { key: i }, ...rows);\n });\n}\n\nexport function BlocksTable({\n blocks,\n subcomponentNames,\n data\n}: {\n blocks: Record<string, BlockInfo>;\n subcomponentNames: Set<string>;\n data?: EmberMeta;\n}) {\n const entries = Object.entries(blocks).toSorted(([nameA, _a], [nameB, _b]) => {\n if (nameA === 'default') return -1;\n if (nameB === 'default') return -1;\n\n return 0;\n });\n\n if (entries.length === 0) return;\n\n const rows = [];\n\n for (const [name, block] of entries) {\n const displayName = `<:${name}>`;\n\n rows.push(\n createElement('tr', { key: name }, createElement(BlocksNameCell, undefined, displayName))\n );\n\n if (block.params.length > 0) {\n const params = renderParams(block.params, subcomponentNames, data);\n\n rows.push(\n createElement('tr', { key: `${name}-params` }, createElement('td', undefined, ...params))\n );\n }\n }\n\n return createElement(\n TableWrapper,\n { className: 'docblock-argstable sb-unstyled' },\n createElement('tbody', { className: 'docblock-argstable-body' }, rows)\n );\n}\n\nexport function BlocksSection({\n blocks,\n subcomponentNames,\n data\n}: {\n blocks: Record<string, BlockInfo>;\n subcomponentNames: Set<string>;\n data?: EmberMeta;\n}) {\n return createElement(\n BlocksDiv,\n undefined,\n createElement(Subheading, undefined, 'Blocks'),\n BlocksTable({ blocks, subcomponentNames, data })\n );\n}\n","import { createElement, type ReactNode } from 'react';\nimport { styled } from 'storybook/theming';\n\nimport { isHtmlElement } from './ui';\n\nconst ElementWrapper = styled.div(({ theme }) => ({\n fontFamily: theme.typography.fonts.base,\n color: theme.color.defaultText,\n fontSize: theme.typography.size.s2 - 1,\n lineHeight: '19px',\n marginTop: 25,\n marginBottom: 40,\n span: {\n '&:first-of-type': {\n fontWeight: 'bold',\n marginRight: 8\n }\n },\n code: {\n fontSize: 12,\n fontWeight: 'bold'\n },\n 'a code': {\n color: theme.color.secondary,\n textDecoration: 'none'\n },\n a: {\n color: theme.color.secondary,\n textDecoration: 'none',\n '&:hover': {\n textDecoration: 'underline'\n }\n }\n}));\n\nexport function ElementBlock({ element }: { element: string }) {\n const elements = element\n .split(' | ')\n .map((s) => s.trim())\n .filter(Boolean);\n\n if (elements.length === 0) return;\n\n const children: ReactNode[] = [createElement('span', { key: 'label' }, 'Element:')];\n\n for (const [i, name] of elements.entries()) {\n if (i > 0) {\n children.push(createElement('span', { key: `sep-${i}` }, ' | '));\n }\n\n const inner = isHtmlElement(name)\n ? createElement(\n 'a',\n {\n key: `link-${name}`,\n href: `https://developer.mozilla.org/en-US/docs/Web/API/${name}`,\n target: '_blank',\n rel: 'noopener noreferrer'\n },\n name\n )\n : name;\n\n children.push(createElement('code', { key: name }, inner));\n }\n\n return createElement(ElementWrapper, undefined, ...children);\n}\n","/* eslint-disable unicorn/no-null */\nimport { createElement } from 'react';\n\nimport { type Entry, renderBody, renderHead, TableWrapper } from './ui';\n\nfunction renderPartsBody(entries: Entry[]) {\n return createElement(\n 'tbody',\n { className: 'docblock-argstable-body' },\n ...entries.map((entry) =>\n createElement(\n 'tr',\n { key: entry.name },\n createElement(\n 'td',\n null,\n createElement(\n 'code',\n { style: { fontSize: 12, fontWeight: 'bold' } },\n `[part=\"${entry.name}\"]`\n )\n ),\n createElement('td', null, entry.description ?? '')\n )\n )\n );\n}\n\nexport function PartsTable({ entries }: { entries: Entry[] }) {\n return createElement(\n TableWrapper,\n { className: 'docblock-argstable sb-unstyled' },\n renderHead(['Part', 'Description']),\n renderPartsBody(entries)\n );\n}\n\nexport function CssPropertiesTable({ entries }: { entries: Entry[] }) {\n return createElement(\n TableWrapper,\n { className: 'docblock-argstable sb-unstyled' },\n renderHead(['Property', 'Value']),\n renderBody(entries)\n );\n}\n","import { PureArgsTable, Subheading } from '@storybook/addon-docs/blocks';\nimport { createElement, type ReactNode } from 'react';\nimport { styled } from 'storybook/theming';\n\nimport { buildArgTypes } from '../extractArgTypes';\nimport { BlocksTable, ParamRow, ParamType } from './blocks';\nimport { ElementBlock } from './element';\nimport { H2 } from './ui';\n\nimport type { EmberMeta } from '../../../node/types';\nimport type { SubcomponentRef } from '../signature';\nimport type { ComponentSignature } from 'ember-docgen';\nimport type { ArgTypes } from 'storybook/internal/types';\n\nconst SubcomponentsSection = styled.div(() => ({\n marginTop: 25,\n marginBottom: 40\n}));\n\nconst SubEntry = styled.div(() => ({\n marginBottom: 24,\n '&:last-child': { marginBottom: 0 }\n}));\n\nconst SectionLabel = styled.div(({ theme }) => ({\n fontWeight: 'bold',\n color: theme.color.defaultText,\n fontSize: theme.typography.size.m1 - 2,\n marginBottom: 8\n}));\n\nfunction renderSubcomponentSignature(\n sig: ComponentSignature,\n subcomponentNames: Set<string>,\n data?: EmberMeta\n): ReactNode[] {\n const children: ReactNode[] = [];\n\n if (sig.element) {\n children.push(createElement(ElementBlock, { element: sig.element }));\n }\n\n if (Object.keys(sig.args).length > 0) {\n // Render from the subcomponent's own signature — the global argTypes\n // store only carries the main component's args.\n children.push(\n createElement(SectionLabel, undefined, 'Args'),\n createElement(PureArgsTable, { rows: buildArgTypes(sig) as ArgTypes })\n );\n }\n\n if (Object.keys(sig.blocks).length > 0) {\n children.push(\n createElement(SectionLabel, { key: 'blocks-label', style: { marginTop: 12 } }, 'Blocks'),\n createElement(BlocksTable, { blocks: sig.blocks, subcomponentNames, data })\n );\n }\n\n return children;\n}\n\nexport function SubcomponentsArea({\n components,\n data\n}: {\n components: SubcomponentRef[];\n data?: EmberMeta;\n}) {\n if (components.length === 0) return;\n\n const subcomponentNames = new Set(components.map((c) => c.name));\n\n const entries = components.map((comp) => {\n const children: ReactNode[] = [createElement(Subheading, undefined, comp.name)];\n\n if (comp.importPath) {\n children.push(\n createElement(\n ParamRow,\n { key: 'import', style: { marginBottom: 12 } },\n createElement('span', undefined, \"from '\"),\n createElement(ParamType, undefined, comp.importPath),\n createElement('span', undefined, \"'\")\n )\n );\n } else if (comp.signature) {\n children.push(...renderSubcomponentSignature(comp.signature, subcomponentNames, data));\n }\n\n return createElement(\n SubEntry,\n { id: `subcomponent-${comp.name}`, key: comp.name },\n ...children\n );\n });\n\n return createElement(\n SubcomponentsSection,\n undefined,\n createElement(H2, undefined, 'Subcomponents'),\n ...entries\n );\n}\n","import {\n Controls,\n Description,\n Primary,\n Stories,\n Subheading,\n Subtitle,\n Title,\n useOf\n} from '@storybook/addon-docs/blocks';\nimport { createElement, Fragment, type ReactNode } from 'react';\nimport emberData from 'virtual:ember-storybook';\n\nimport { BlocksSection } from './blocks/blocks';\nimport { ElementBlock } from './blocks/element';\nimport { CssPropertiesTable, PartsTable } from './blocks/style';\nimport { SubcomponentsArea } from './blocks/subcomponents';\nimport { H2 } from './blocks/ui';\nimport { shouldShowArgsSection } from './extractArgTypes';\nimport { collectSubcomponents } from './signature';\n\nimport type { EmberMeta } from '../../node/types';\nimport type { ComponentSignature } from 'ember-docgen';\n\nfunction addSignature(\n signature: ComponentSignature,\n data: EmberMeta,\n metaArgTypes?: Record<string, unknown>\n) {\n const children: ReactNode[] = [];\n\n if (signature.element) {\n children.push(createElement(ElementBlock, { element: signature.element }));\n }\n\n // Render unfiltered — the argTypes enhancer already merges\n // buildArgTypes(signature) into the store, so this mirrors\n // the Controls panel exactly. Also render story-provided argTypes\n // when the signature has no args (e.g. template-only components).\n if (shouldShowArgsSection(signature, metaArgTypes)) {\n children.push(createElement(Subheading, undefined, 'Args'), createElement(Controls));\n }\n\n if (Object.keys(signature.blocks).length > 0) {\n const subcomponents = collectSubcomponents(signature.blocks, data);\n const subcomponentNames = new Set(subcomponents.map((s) => s.name));\n\n children.push(\n createElement(BlocksSection, { blocks: signature.blocks, subcomponentNames, data })\n );\n\n if (subcomponents.length > 0) {\n children.push(createElement(SubcomponentsArea, { components: subcomponents, data }));\n }\n }\n\n if (Object.keys(signature.style.customProperties).length > 0) {\n const entries = Object.entries(signature.style.customProperties).map(([name, description]) => ({\n name,\n description\n }));\n\n children.push(\n createElement(Subheading, undefined, 'CSS Custom Properties'),\n createElement(CssPropertiesTable, { entries })\n );\n }\n\n if (Object.keys(signature.style.parts).length > 0) {\n const entries = Object.entries(signature.style.parts).map(([name, description]) => ({\n name,\n description\n }));\n\n children.push(\n createElement(Subheading, undefined, 'Parts'),\n createElement(PartsTable, { entries })\n );\n }\n\n if (children.length > 0) {\n children.unshift(createElement(H2, undefined, 'Signature'));\n }\n\n return children;\n}\n\nexport default function Page() {\n const resolved: {\n preparedMeta?: {\n argTypes?: Record<string, unknown>;\n title?: string;\n parameters?: Record<string, unknown>;\n };\n } = useOf('meta', ['meta']);\n\n const data = emberData as EmberMeta;\n const storyFile = resolved.preparedMeta?.parameters?.fileName as string | undefined;\n const storyEntry = storyFile ? data[storyFile] : undefined;\n const storyComponent = storyEntry && 'component' in storyEntry ? storyEntry.component : undefined;\n const compFile = storyComponent?.file;\n const compEntry = compFile ? data[compFile] : undefined;\n const signatureName = storyComponent?.signatureName ?? '';\n const signature =\n compEntry && 'signatures' in compEntry ? compEntry.signatures[signatureName] : undefined;\n\n const children: ReactNode[] = [\n createElement(Title),\n createElement(Subtitle),\n createElement(Description),\n createElement(Primary)\n ];\n\n if (signature) {\n children.push(...addSignature(signature, data, resolved.preparedMeta?.argTypes));\n }\n\n children.push(createElement(Stories));\n\n return createElement(Fragment, undefined, ...children);\n}\n","import { SourceType } from 'storybook/internal/docs-tools';\nimport { emitTransformCode, useEffect, useRef } from 'storybook/preview-api';\nimport emberData from 'virtual:ember-storybook';\n\nimport { isEmberStoryResult } from '../story-result';\nimport { unwrapBlockParams } from './block-params';\n\nimport type { StorySource } from '../../node/types';\nimport type { StoryFn } from '../public-types';\nimport type { EmberRenderer } from '../types';\nimport type { BlockInfo, ComponentSignature } from 'ember-docgen';\nimport type { Args, ArgTypes, DecoratorFunction } from 'storybook/internal/types';\n\nconst data = emberData as Record<\n string,\n {\n component?: { file?: string; signatureName?: string };\n source?: Record<string, StorySource>;\n signatures?: Record<string, ComponentSignature>;\n }\n>;\n\nfunction skipSourceRender(context: Parameters<DecoratorFunction<EmberRenderer>>[1]) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access\n const sourceParams = context.parameters.docs?.source;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (sourceParams?.type === SourceType.DYNAMIC) {\n return false;\n }\n\n const isArgsStory = context.parameters.__isArgsStory as boolean;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access\n return (!isArgsStory || sourceParams?.code) ?? sourceParams?.type === SourceType.CODE;\n}\n\nexport function toArgument(key: string, value: unknown, argTypes: ArgTypes): string | undefined {\n if (value !== undefined && value !== null) {\n if (typeof value === 'string') {\n return `@${key}=${JSON.stringify(value)}`;\n }\n\n if (typeof value === 'number' || typeof value === 'boolean') {\n return `@${key}={{${String(value)}}}`;\n }\n\n if (Object.hasOwn(argTypes, key)) {\n return `@${key}={{@${key}}}`;\n }\n\n return undefined;\n }\n\n if (value === undefined && Object.hasOwn(argTypes, key)) {\n return `@${key}={{@${key}}}`;\n }\n\n return undefined;\n}\n\nfunction generateBlockContent(blockInfo: BlockInfo): string {\n if (blockInfo.params.length === 0) {\n return '...';\n }\n\n const paramNames = unwrapBlockParams(blockInfo.params)\n .map((p) => p.name)\n .join(', ');\n\n return `{{yield ${paramNames}}}`;\n}\n\nexport function generateBlockSourceCode(\n sig: ComponentSignature,\n args: Args,\n indent: string\n): string {\n const blockNames = Object.keys(sig.blocks);\n\n if (blockNames.length === 0) return '';\n\n const blocks: string[] = [];\n\n for (const blockName of blockNames) {\n const blockInfo = sig.blocks[blockName];\n const arg = (args as Record<string, unknown>)[blockName];\n\n if (arg === undefined && blockInfo.params.length === 0) {\n continue;\n }\n\n const params = unwrapBlockParams(blockInfo.params)\n .map((p) => p.name)\n .join(' ');\n const slotBindings = params ? ` as |${params}|` : '';\n\n const content = generateBlockContent(blockInfo);\n\n if (blockName === 'default' && !slotBindings) {\n blocks.push(content);\n } else {\n blocks.push(`${indent} <:${blockName}${slotBindings}>${content}</:${blockName}>`);\n }\n }\n\n return blocks.join('\\n');\n}\n\nlet byStoryId: Record<string, StorySource> | undefined;\n\nfunction getByStoryId(): Record<string, StorySource> {\n if (byStoryId) return byStoryId;\n\n byStoryId = {};\n\n for (const entry of Object.values(data)) {\n for (const [storyId, source] of Object.entries(entry.source ?? {})) {\n byStoryId[storyId] = {\n componentName: source.componentName,\n signatureName: source.signatureName,\n inlineTemplate: source.inlineTemplate\n };\n }\n }\n\n return byStoryId;\n}\n\nfunction signatureForComponent(name: string): ComponentSignature | undefined {\n for (const entry of Object.values(data)) {\n const comp = entry.component;\n\n if (comp?.signatureName !== name) continue;\n\n const compEntry = comp.file ? data[comp.file] : undefined;\n\n return compEntry?.signatures?.[comp.signatureName];\n }\n\n return undefined;\n}\n\nexport function resolveTemplateArgs(template: string, args: Args): string {\n return template.replaceAll(/\\{\\{args\\.(\\w+)\\}\\}/g, (_match, key) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const value = (args as Record<string, unknown>)[key];\n\n if (typeof value === 'string') {\n return JSON.stringify(value);\n }\n\n if (typeof value === 'number' || typeof value === 'boolean') {\n return `{{${String(value)}}}`;\n }\n\n return `{{@${key}}}`;\n });\n}\n\nexport function generateSource(\n component: { name?: string },\n args: Args,\n argTypes: ArgTypes,\n storyId?: string\n): string | undefined {\n const meta = storyId ? getByStoryId()[storyId] : undefined;\n\n if (meta?.inlineTemplate) {\n return resolveTemplateArgs(meta.inlineTemplate, args);\n }\n\n const name = meta?.componentName ?? component.name;\n\n if (!name || name === '(unknown template-only component)') {\n return undefined;\n }\n\n // Default-exported components are keyed by the `__DEFAULT__` sentinel in the\n // signatures map, while `name` is the real component name. Look the signature\n // up by the sentinel so blocks/args still resolve.\n const sig = signatureForComponent(meta?.signatureName ?? name);\n\n const propsArray = Object.entries(args)\n .filter(([k]) => !sig || !Object.hasOwn(sig.blocks, k))\n .map(([k, v]) => toArgument(k, v, argTypes))\n .filter(Boolean);\n\n const blockCode = sig ? generateBlockSourceCode(sig, args, '') : '';\n\n const propsStr = propsArray.join(' ');\n\n if (!blockCode) {\n if (propsArray.length === 0) {\n return `<${name} />`;\n }\n\n if (propsArray.length > 3) {\n return `<${name}\\n ${propsArray.join('\\n ')}\\n/>`;\n }\n\n return `<${name} ${propsStr} />`;\n }\n\n if (propsArray.length === 0) {\n return `<${name}>\\n${blockCode}\\n</${name}>`;\n }\n\n return `<${name} ${propsStr}>\\n${blockCode}\\n</${name}>`;\n}\n\nexport const sourceDecorator: DecoratorFunction<EmberRenderer> = (storyFn, context) => {\n const source = useRef<string | undefined>(undefined);\n const story = storyFn();\n\n useEffect(() => {\n // Always generate the source from the ORIGINAL story, not the decorator-wrapped\n // `storyFn()` result. A decorator wraps the story in another component, so its\n // `.name` (e.g. `IntlDecorator`) would leak into the generated source block.\n const rendered = (context.originalStoryFn as StoryFn)(context.args, context);\n const renderedForSource = isEmberStoryResult(rendered) ? rendered.component : rendered;\n\n if (!skipSourceRender(context)) {\n const code =\n generateSource(renderedForSource, context.args, context.argTypes, context.id) ?? undefined;\n\n void emitTransformCode(code, context);\n source.current = code;\n }\n });\n\n return story;\n};\n","import { SourceType } from 'storybook/internal/docs-tools';\nimport emberData from 'virtual:ember-storybook';\n\nimport { buildArgTypes, mergeArgTypes, sortArgTypes } from './extractArgTypes';\nimport Page from './page';\nimport { sourceDecorator } from './source-decorator';\n\nimport type { ComponentFile, EmberMeta, StoryFile } from '../../node/types';\nimport type { EmberRenderer } from '../types';\nimport type { ComponentSignature } from 'ember-docgen';\nimport type {\n DecoratorFunction,\n Parameters,\n StoryContextForEnhancers,\n StrictArgTypes\n} from 'storybook/internal/types';\n\nconst data = emberData as EmberMeta;\n\nfunction resolveSig(entry: StoryFile | ComponentFile): ComponentSignature | undefined {\n if (!('component' in entry)) return undefined;\n\n const comp = entry.component;\n\n if (!comp.signatureName) return undefined;\n\n const compEntry = comp.file ? data[comp.file] : undefined;\n\n if (!compEntry || !('signatures' in compEntry)) return undefined;\n\n return compEntry.signatures[comp.signatureName];\n}\n\n/** Last path segment of a CSF title — used to match stories without `fileName`. */\nfunction titleLeaf(title: string | undefined): string | undefined {\n return title?.split('/').pop();\n}\n\nexport const argTypesEnhancers: ((\n context: StoryContextForEnhancers<EmberRenderer>\n) => StrictArgTypes)[] = [\n (context) => {\n const filePath = (context.parameters as Record<string, unknown>).fileName as string | undefined;\n\n if (filePath && Object.hasOwn(data, filePath)) {\n const sig = resolveSig(data[filePath]);\n\n if (sig) {\n return sortArgTypes(mergeArgTypes(buildArgTypes(sig), context.argTypes)) as StrictArgTypes;\n }\n\n return sortArgTypes(context.argTypes) as StrictArgTypes;\n }\n\n // No `parameters.fileName` — fall back to matching the CSF title leaf\n // against indexed story files instead of picking an arbitrary signature.\n const leaf = titleLeaf(context.title);\n\n if (leaf) {\n for (const entry of Object.values(data)) {\n if (!('meta' in entry)) continue;\n\n if (titleLeaf(entry.meta.title) !== leaf) continue;\n\n const sig = resolveSig(entry);\n\n if (sig) {\n return sortArgTypes(\n mergeArgTypes(buildArgTypes(sig), context.argTypes)\n ) as StrictArgTypes;\n }\n }\n }\n\n return sortArgTypes(context.argTypes) as StrictArgTypes;\n }\n];\n\nexport const parameters: Parameters = {\n docs: {\n source: {\n type: SourceType.DYNAMIC,\n language: 'html'\n },\n page: Page\n }\n};\n\nexport const decorators: DecoratorFunction<EmberRenderer>[] = [sourceDecorator];\n"],"mappings":";;;;;;;;;;AAEA,SAASA,iBACPC,MASmB;CACnB,QAAQA,KAAKC,UAAb;EACE,KAAK,UACH,OAAO,EAAED,MAAM,OAAO;EAExB,KAAK,UACH,OAAO,EAAEA,MAAM,S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