ember-storybook 0.2.0 → 0.2.1

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.
@@ -1,4 +1,16 @@
1
1
  import type { BlockInfo, BlockParam } from 'ember-docgen';
2
- /** Flatten the params union into plain block params, unwrapping yield hashes. */
2
+ /**
3
+ * Unwrap the params union to plain block params at the yield surface: a
4
+ * yield hash expands to its named entries, but unfolded named types
5
+ * (`nested`) are not descended into. Use for anything reflecting what the
6
+ * block actually receives (e.g. slot bindings).
7
+ */
8
+ export declare function unwrapBlockParamsShallow(params: BlockInfo['params']): BlockParam[];
9
+ /**
10
+ * Unwrap every block param: yield hashes expand to their named entries and
11
+ * unfolded named types descend into all members — the whole param tree. Use
12
+ * wherever every referenced component must be found (subcomponent
13
+ * collection, ref rewriting).
14
+ */
3
15
  export declare function unwrapBlockParams(params: BlockInfo['params']): BlockParam[];
4
16
  //# sourceMappingURL=block-params.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"block-params.d.ts","sourceRoot":"","sources":["../../../src/client/docs/block-params.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAC;AAM1E,iFAAiF;AACjF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,GAAG,UAAU,EAAE,CAE3E"}
1
+ {"version":3,"file":"block-params.d.ts","sourceRoot":"","sources":["../../../src/client/docs/block-params.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAC;AAM1E;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,GAAG,UAAU,EAAE,CAElF;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,GAAG,UAAU,EAAE,CAkB3E"}
@@ -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;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
+ {"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;AA+NJ,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"}
@@ -0,0 +1,32 @@
1
+ //#region src/client/docs/block-params.ts
2
+ function isBlockParam(param) {
3
+ return Object.hasOwn(param, "name") && Object.hasOwn(param, "type");
4
+ }
5
+ /**
6
+ * Unwrap the params union to plain block params at the yield surface: a
7
+ * yield hash expands to its named entries, but unfolded named types
8
+ * (`nested`) are not descended into. Use for anything reflecting what the
9
+ * block actually receives (e.g. slot bindings).
10
+ */
11
+ function unwrapBlockParamsShallow(params) {
12
+ return params.flatMap((param) => isBlockParam(param) ? [param] : Object.values(param));
13
+ }
14
+ /**
15
+ * Unwrap every block param: yield hashes expand to their named entries and
16
+ * unfolded named types descend into all members — the whole param tree. Use
17
+ * wherever every referenced component must be found (subcomponent
18
+ * collection, ref rewriting).
19
+ */
20
+ function unwrapBlockParams(params) {
21
+ const result = [];
22
+ for (const param of params) if (isBlockParam(param)) {
23
+ result.push(param);
24
+ const nested = param.nested;
25
+ if (nested && nested.length > 0) result.push(...unwrapBlockParams(nested));
26
+ } else result.push(...unwrapBlockParams(Object.values(param)));
27
+ return result;
28
+ }
29
+ //#endregion
30
+ export { unwrapBlockParamsShallow as n, unwrapBlockParams as t };
31
+
32
+ //# sourceMappingURL=block-params-wjiT2Ht6.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block-params-wjiT2Ht6.mjs","names":["isBlockParam","param","Object","hasOwn","unwrapBlockParamsShallow","params","flatMap","values","unwrapBlockParams","result","push","nested","length"],"sources":["../src/client/docs/block-params.ts"],"sourcesContent":["import type { BlockInfo, BlockParam, HashBlockParam } from 'ember-docgen';\n\nfunction isBlockParam(param: BlockParam | HashBlockParam): param is BlockParam {\n return Object.hasOwn(param, 'name') && Object.hasOwn(param, 'type');\n}\n\n/**\n * Unwrap the params union to plain block params at the yield surface: a\n * yield hash expands to its named entries, but unfolded named types\n * (`nested`) are not descended into. Use for anything reflecting what the\n * block actually receives (e.g. slot bindings).\n */\nexport function unwrapBlockParamsShallow(params: BlockInfo['params']): BlockParam[] {\n return params.flatMap((param) => (isBlockParam(param) ? [param] : Object.values(param)));\n}\n\n/**\n * Unwrap every block param: yield hashes expand to their named entries and\n * unfolded named types descend into all members — the whole param tree. Use\n * wherever every referenced component must be found (subcomponent\n * collection, ref rewriting).\n */\nexport function unwrapBlockParams(params: BlockInfo['params']): BlockParam[] {\n const result: BlockParam[] = [];\n\n for (const param of params) {\n if (isBlockParam(param)) {\n result.push(param);\n\n const nested = param.nested;\n\n if (nested && nested.length > 0) {\n result.push(...unwrapBlockParams(nested));\n }\n } else {\n result.push(...unwrapBlockParams(Object.values(param)));\n }\n }\n\n return result;\n}\n"],"mappings":";AAEA,SAASA,aAAaC,OAAyD;CAC7E,OAAOC,OAAOC,OAAOF,OAAO,MAAM,KAAKC,OAAOC,OAAOF,OAAO,MAAM;AACpE;;;;;;;AAQA,SAAgBG,yBAAyBC,QAA2C;CAClF,OAAOA,OAAOC,SAASL,UAAWD,aAAaC,KAAK,IAAI,CAACA,KAAK,IAAIC,OAAOK,OAAON,KAAK,CAAE;AACzF;;;;;;;AAQA,SAAgBO,kBAAkBH,QAA2C;CAC3E,MAAMI,SAAuB,CAAA;CAE7B,KAAK,MAAMR,SAASI,QAClB,IAAIL,aAAaC,KAAK,GAAG;EACvBQ,OAAOC,KAAKT,KAAK;EAEjB,MAAMU,SAASV,MAAMU;EAErB,IAAIA,UAAUA,OAAOC,SAAS,GAC5BH,OAAOC,KAAK,GAAGF,kBAAkBG,MAAM,CAAC;CAE5C,OACEF,OAAOC,KAAK,GAAGF,kBAAkBN,OAAOK,OAAON,KAAK,CAAC,CAAC;CAI1D,OAAOQ;AACT"}
@@ -1,5 +1,5 @@
1
1
  import { n as isEmberStoryResult } from "../../story-result-CCx6LMia.mjs";
2
- import { t as unwrapBlockParams } from "../../block-params-C68OkWMC.mjs";
2
+ import { n as unwrapBlockParamsShallow, t as unwrapBlockParams } from "../../block-params-wjiT2Ht6.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";
@@ -278,7 +278,10 @@ const SubcomponentLink = styled.a(({ theme }) => ({
278
278
  textDecoration: "none",
279
279
  "&:hover": { textDecoration: "underline" }
280
280
  }));
281
- const Indent = styled.span(() => ({ marginInlineStart: "20px" }));
281
+ const CodeLine = styled.div(({ theme }) => ({
282
+ fontSize: theme.typography.size.s2 - 1,
283
+ lineHeight: "19px"
284
+ }));
282
285
  /**
283
286
  * In-page anchor to a subcomponent section. Mirrors Storybook's own
284
287
  * in-docs navigation (TableOfContents / AnchorInPage): the default anchor
@@ -313,52 +316,92 @@ function displayTypeName(param, data) {
313
316
  if (param.componentRef?.local) return param.name;
314
317
  return (data ? componentDisplayName(param.componentRef, data) : void 0) ?? param.type;
315
318
  }
316
- function renderType(param, subcomponentNames, data) {
319
+ function isBlockParam(param) {
320
+ return Object.hasOwn(param, "name") && Object.hasOwn(param, "type");
321
+ }
322
+ function isNamedParam(name) {
323
+ return Boolean(name) && !name.startsWith("param");
324
+ }
325
+ /**
326
+ * A `BlockParam` whose type was unfolded from a named non-component type is
327
+ * an object just like an inline yield hash — normalize its members to
328
+ * `[name, param]` entries. `undefined` for scalar params.
329
+ */
330
+ function memberEntriesOf(param) {
331
+ const nested = param.nested;
332
+ if (!nested || nested.length === 0) return void 0;
333
+ return nested.flatMap((entry) => isBlockParam(entry) ? [[entry.name, entry]] : Object.entries(entry));
334
+ }
335
+ function renderTypeValue(param, subcomponentNames, data) {
317
336
  const displayType = displayTypeName(param, data);
318
- if (param.componentRef) return subcomponentNames.has(displayType) ? createElement(SubcomponentAnchor, {
337
+ return subcomponentNames.has(displayType) ? createElement(SubcomponentAnchor, {
319
338
  key: "type",
320
339
  name: displayType
321
340
  }, displayType) : createElement(ParamType, { key: "type" }, displayType);
322
- return createElement(ParamType, { key: "type" }, param.type);
323
- }
324
- function renderParam(param, subcomponentNames, data) {
325
- const type = renderType(param, subcomponentNames, data);
326
- return [
327
- createElement(ParamName, { key: "name" }, param.name),
328
- createElement("span", { key: "colon" }, ": "),
329
- type
330
- ];
331
341
  }
332
- function isBlockParam(param) {
333
- return Object.hasOwn(param, "name") && Object.hasOwn(param, "type");
342
+ function descLine(param, key, depth) {
343
+ if (!param.description) return void 0;
344
+ const style = depth === void 0 ? void 0 : {
345
+ marginBottom: 0,
346
+ marginLeft: depth * 20 + 10
347
+ };
348
+ return createElement(ParamDesc, {
349
+ key,
350
+ style
351
+ }, param.description);
334
352
  }
335
- function renderParams(params, subcomponentNames, data) {
336
- return params.map((param, i) => {
337
- if (!isBlockParam(param)) {
338
- const children = [
339
- createElement("span", { key: "open" }, "- {"),
340
- createElement("br", { key: "br-open" }),
341
- ...Object.entries(param).flatMap(([key, p]) => [createElement(Indent, { key: `indent-${key}` }), renderParam(p, subcomponentNames, data)]),
342
- createElement("br", { key: "br-close" }),
343
- createElement("span", { key: "close" }, "}")
344
- ];
345
- return createElement(Fragment, { key: i }, ...children);
353
+ function codeLine(key, depth, children) {
354
+ return createElement(CodeLine, {
355
+ key,
356
+ style: { paddingInlineStart: depth * 20 }
357
+ }, ...children);
358
+ }
359
+ /**
360
+ * Render an object param JSON-style: an opening brace line (optionally
361
+ * prefixed `name: `), member lines one level deeper, and a closing brace —
362
+ * no dashes, no blank lines between the object's lines. Object members
363
+ * recurse; scalar members render as `name: type`.
364
+ */
365
+ function renderParamBlock(name, entries, subcomponentNames, data, depth, key) {
366
+ const head = name ? [createElement(ParamName, { key: `${key}-n` }, name), ": "] : [];
367
+ const lines = [codeLine(`${key}-o`, depth, [...head, "{"])];
368
+ for (const [i, [memberName, memberParam]] of entries.entries()) {
369
+ const memberKey = `${key}-${i}`;
370
+ const memberEntries = memberEntriesOf(memberParam);
371
+ if (memberEntries) lines.push(...renderParamBlock(memberName, memberEntries, subcomponentNames, data, depth + 1, memberKey));
372
+ else lines.push(codeLine(`${memberKey}-l`, depth + 1, [
373
+ createElement(ParamName, { key: `${memberKey}-n` }, memberName),
374
+ ": ",
375
+ renderTypeValue(memberParam, subcomponentNames, data)
376
+ ]));
377
+ const desc = descLine(memberParam, `${memberKey}-d`, depth + 1);
378
+ if (desc) lines.push(desc);
379
+ }
380
+ lines.push(codeLine(`${key}-x`, depth, ["}"]));
381
+ return lines;
382
+ }
383
+ function renderParams(params, subcomponentNames, data, keyPrefix = "p") {
384
+ return params.flatMap((param, i) => {
385
+ const key = `${keyPrefix}-${i}`;
386
+ if (!isBlockParam(param)) return renderParamBlock(void 0, Object.entries(param), subcomponentNames, data, 0, key);
387
+ const entries = memberEntriesOf(param);
388
+ if (entries) {
389
+ const lines = renderParamBlock(isNamedParam(param.name) ? param.name : void 0, entries, subcomponentNames, data, 0, key);
390
+ const desc = descLine(param, `${key}-d`, 0);
391
+ if (desc) lines.push(desc);
392
+ return lines;
346
393
  }
347
- const isNamed = param.name && !param.name.startsWith("param");
348
- const displayType = displayTypeName(param, data);
349
- const isSubcomponent = subcomponentNames.has(displayType);
350
- const children = [];
351
- const typeChildren = [];
352
- if (isSubcomponent) typeChildren.push(createElement(SubcomponentAnchor, {
353
- key: "type",
354
- name: displayType
355
- }, displayType));
356
- else typeChildren.push(createElement(ParamType, { key: "type" }, displayType));
357
- if (isNamed) children.push(createElement("span", { key: "sep" }, "- "), createElement(ParamName, { key: "name" }, param.name), createElement("span", { key: "colon" }, ": "), ...typeChildren);
358
- else children.push(createElement("span", { key: "sep" }, "- "), ...typeChildren);
394
+ const type = renderTypeValue(param, subcomponentNames, data);
395
+ const children = isNamedParam(param.name) ? [
396
+ "- ",
397
+ createElement(ParamName, { key: "name" }, param.name),
398
+ ": ",
399
+ type
400
+ ] : ["- ", type];
359
401
  const rows = [createElement(ParamRow, { key: "row" }, ...children)];
360
- if (param.description) rows.push(createElement(ParamDesc, { key: "desc" }, param.description));
361
- return createElement(Fragment, { key: i }, ...rows);
402
+ const desc = descLine(param, "desc");
403
+ if (desc) rows.push(desc);
404
+ return createElement(Fragment, { key }, ...rows);
362
405
  });
363
406
  }
364
407
  function BlocksTable({ blocks, subcomponentNames, data }) {
@@ -565,7 +608,7 @@ function toArgument(key, value, argTypes) {
565
608
  }
566
609
  function generateBlockContent(blockInfo) {
567
610
  if (blockInfo.params.length === 0) return "...";
568
- return `{{yield ${unwrapBlockParams(blockInfo.params).map((p) => p.name).join(", ")}}}`;
611
+ return `{{yield ${unwrapBlockParamsShallow(blockInfo.params).map((p) => p.name).join(", ")}}}`;
569
612
  }
570
613
  function generateBlockSourceCode(sig, args, indent) {
571
614
  const blockNames = Object.keys(sig.blocks);
@@ -574,7 +617,7 @@ function generateBlockSourceCode(sig, args, indent) {
574
617
  for (const blockName of blockNames) {
575
618
  const blockInfo = sig.blocks[blockName];
576
619
  if (args[blockName] === void 0 && blockInfo.params.length === 0) continue;
577
- const params = unwrapBlockParams(blockInfo.params).map((p) => p.name).join(" ");
620
+ const params = unwrapBlockParamsShallow(blockInfo.params).map((p) => p.name).join(" ");
578
621
  const slotBindings = params ? ` as |${params}|` : "";
579
622
  const content = generateBlockContent(blockInfo);
580
623
  if (blockName === "default" && !slotBindings) blocks.push(content);
@@ -1 +1 @@
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,SAAS;EAE1B,KAAK,WACH,OAAO,EAAEA,MAAM,UAAU;EAE3B,KAAK,YACH,OAAO,EAAEA,MAAM,WAAW;EAE5B,KAAK,QACH,OAAO;GAAEA,MAAM;GAAUE,SAASF,KAAKE,WAAW,CAAA;EAAG;EAGvD,SACE,OAAO,EAAEF,MAAM,SAAS;CAE5B;AACF;;;;;AAMA,SAAgBG,aAAaC,UAA4D;CACvF,OAAOC,OAAOC,YAAYD,OAAOE,QAAQH,QAAQ,CAAC,CAACI,UAAU,CAACC,IAAI,CAACC,OAAOD,EAAEE,cAA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;CAChE,OAAOA,OAAOC,MAAM,GAAG,CAAC,CAACC,IAAI;AAC/B;AAEA,MAAaC,oBAEY,EACtBC,YAAY;CACX,MAAMC,WAAYD,QAAQE,WAAuCC;CAEjE,IAAIF,YAAYG,OAAOC,OAAOpB,MAAMgB,QAAQ,GAAG;EAC7C,MAAMK,MAAMpB,WAAWD,KAAKgB,SAAS;EAErC,IAAIK,KACF,OAAOxB,aAAaD,cAAcD,cAAc0B,GAAG,GAAGN,QAAQO,QAAQ,CAAC;EAGzE,OAAOzB,aAAakB,QAAQO,QAAQ;CACtC;CAIA,MAAMC,OAAOb,UAAUK,QAAQJ,KAAK;CAEpC,IAAIY,MACF,KAAK,MAAMrB,SAASiB,OAAOK,OAAOxB,IAAI,GAAG;EACvC,IAAI,EAAE,UAAUE,QAAQ;EAExB,IAAIQ,UAAUR,MAAMuB,KAAKd,KAAK,MAAMY,MAAM;EAE1C,MAAMF,MAAMpB,WAAWC,KAAK;EAE5B,IAAImB,KACF,OAAOxB,aACLD,cAAcD,cAAc0B,GAAG,GAAGN,QAAQO,QAAQ,CACpD;CAEJ;CAGF,OAAOzB,aAAakB,QAAQO,QAAQ;AACtC,CAAC;AAGH,MAAaL,aAAyB,EACpCS,MAAM;CACJC,QAAQ;EACNC,MAAMnC,WAAWoC;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","CodeLine","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","isBlockParam","Object","hasOwn","isNamedParam","Boolean","startsWith","memberEntriesOf","nested","length","flatMap","entry","entries","renderTypeValue","subcomponentNames","displayType","has","key","descLine","depth","description","style","codeLine","paddingInlineStart","renderParamBlock","head","lines","i","memberName","memberParam","memberKey","memberEntries","push","desc","renderParams","params","keyPrefix","rows","BlocksTable","blocks","toSorted","nameA","_a","nameB","_b","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","unwrapBlockParamsShallow","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 CodeLine = styled.div(({ theme }) => ({\n fontSize: theme.typography.size.s2 - 1,\n lineHeight: '19px'\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 isBlockParam(param: BlockParam | HashBlockParam): param is BlockParam {\n return Object.hasOwn(param, 'name') && Object.hasOwn(param, 'type');\n}\n\ntype MemberEntry = [name: string, param: BlockParam];\n\nfunction isNamedParam(name: string): boolean {\n return Boolean(name) && !name.startsWith('param');\n}\n\n/**\n * A `BlockParam` whose type was unfolded from a named non-component type is\n * an object just like an inline yield hash — normalize its members to\n * `[name, param]` entries. `undefined` for scalar params.\n */\nfunction memberEntriesOf(param: BlockParam): MemberEntry[] | undefined {\n const nested = param.nested;\n\n if (!nested || nested.length === 0) return undefined;\n\n return nested.flatMap((entry): MemberEntry[] =>\n isBlockParam(entry) ? [[entry.name, entry]] : Object.entries(entry)\n );\n}\n\nfunction renderTypeValue(\n param: BlockParam,\n subcomponentNames: Set<string>,\n data?: EmberMeta\n): ReactNode {\n const displayType = displayTypeName(param, data);\n\n return subcomponentNames.has(displayType)\n ? createElement(SubcomponentAnchor, { key: 'type', name: displayType }, displayType)\n : createElement(ParamType, { key: 'type' }, displayType);\n}\n\nfunction descLine(param: BlockParam, key: string, depth?: number): ReactNode | undefined {\n if (!param.description) return undefined;\n\n const style = depth === undefined ? undefined : { marginBottom: 0, marginLeft: depth * 20 + 10 };\n\n return createElement(ParamDesc, { key, style }, param.description);\n}\n\nfunction codeLine(key: string, depth: number, children: ReactNode[]): ReactNode {\n return createElement(CodeLine, { key, style: { paddingInlineStart: depth * 20 } }, ...children);\n}\n\n/**\n * Render an object param JSON-style: an opening brace line (optionally\n * prefixed `name: `), member lines one level deeper, and a closing brace —\n * no dashes, no blank lines between the object's lines. Object members\n * recurse; scalar members render as `name: type`.\n */\nfunction renderParamBlock(\n name: string | undefined,\n entries: MemberEntry[],\n subcomponentNames: Set<string>,\n data: EmberMeta | undefined,\n depth: number,\n key: string\n): ReactNode[] {\n const head: ReactNode[] = name ? [createElement(ParamName, { key: `${key}-n` }, name), ': '] : [];\n\n const lines = [codeLine(`${key}-o`, depth, [...head, '{'])];\n\n for (const [i, [memberName, memberParam]] of entries.entries()) {\n const memberKey = `${key}-${i}`;\n const memberEntries = memberEntriesOf(memberParam);\n\n if (memberEntries) {\n lines.push(\n ...renderParamBlock(\n memberName,\n memberEntries,\n subcomponentNames,\n data,\n depth + 1,\n memberKey\n )\n );\n } else {\n lines.push(\n codeLine(`${memberKey}-l`, depth + 1, [\n createElement(ParamName, { key: `${memberKey}-n` }, memberName),\n ': ',\n renderTypeValue(memberParam, subcomponentNames, data)\n ])\n );\n }\n\n const desc = descLine(memberParam, `${memberKey}-d`, depth + 1);\n\n if (desc) lines.push(desc);\n }\n\n lines.push(codeLine(`${key}-x`, depth, ['}']));\n\n return lines;\n}\n\nfunction renderParams(\n params: BlockInfo['params'],\n subcomponentNames: Set<string>,\n data?: EmberMeta,\n keyPrefix = 'p'\n): ReactNode[] {\n return params.flatMap((param, i) => {\n const key = `${keyPrefix}-${i}`;\n\n if (!isBlockParam(param)) {\n // Inline yield hash — an object, never a dashed list item.\n return renderParamBlock(undefined, Object.entries(param), subcomponentNames, data, 0, key);\n }\n\n const entries = memberEntriesOf(param);\n\n if (entries) {\n // A named non-component type unfolded into its members — an object.\n const name = isNamedParam(param.name) ? param.name : undefined;\n const lines = renderParamBlock(name, entries, subcomponentNames, data, 0, key);\n const desc = descLine(param, `${key}-d`, 0);\n\n if (desc) lines.push(desc);\n\n return lines;\n }\n\n // Positional param — a list item with a dash.\n const type = renderTypeValue(param, subcomponentNames, data);\n const children: ReactNode[] = isNamedParam(param.name)\n ? ['- ', createElement(ParamName, { key: 'name' }, param.name), ': ', type]\n : ['- ', type];\n\n const rows: ReactNode[] = [createElement(ParamRow, { key: 'row' }, ...children)];\n const desc = descLine(param, 'desc');\n\n if (desc) rows.push(desc);\n\n return createElement(Fragment, { key }, ...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 { unwrapBlockParamsShallow } 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 = unwrapBlockParamsShallow(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 = unwrapBlockParamsShallow(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,SAAS;EAE1B,KAAK,WACH,OAAO,EAAEA,MAAM,UAAU;EAE3B,KAAK,YACH,OAAO,EAAEA,MAAM,WAAW;EAE5B,KAAK,QACH,OAAO;GAAEA,MAAM;GAAUE,SAASF,KAAKE,WAAW,CAAA;EAAG;EAGvD,SACE,OAAO,EAAEF,MAAM,SAAS;CAE5B;AACF;;;;;AAMA,SAAgBG,aAAaC,UAA4D;CACvF,OAAOC,OAAOC,YAAYD,OAAOE,QAAQH,QAAQ,CAAC,CAACI,UAAU,CAACC,IAAI,CAACC,OAAOD,EAAEE,cAAcD,CAAC,CAAC,CAAC;AAC/F;AAEA,SAAgBE,cAAcC,KAAkD;CAC9E,MAAMT,WAAoC,CAAC;CAE3C,KAAK,MAAM,CAACU,MAAMC,QAAQV,OAAOE,QAAQM,IAAIG,IAAI,GAC/CZ,SAASU,QAAQ;EACfA;EACAG,aAAaF,IAAIE,eAAeC,KAAAA;EAChClB,MAAM;GACJc,MAAMC,IAAIf,KAAKmB;GACfC,UAAUL,IAAIK;EAChB;EACAC,SAAStB,iBAAiBgB,IAAIf,IAAI;EAClCsB,OAAO;GACL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