ember-storybook 0.3.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +41 -0
  2. package/declarations/client/define-preview.d.ts +88 -0
  3. package/declarations/client/define-preview.d.ts.map +1 -0
  4. package/declarations/client/define-preview.test.d.ts +2 -0
  5. package/declarations/client/define-preview.test.d.ts.map +1 -0
  6. package/declarations/client/docs/addon-preview.d.ts +2 -0
  7. package/declarations/client/docs/addon-preview.d.ts.map +1 -0
  8. package/declarations/client/docs/annotations.d.ts +6 -0
  9. package/declarations/client/docs/annotations.d.ts.map +1 -0
  10. package/declarations/client/docs/config.d.ts +2 -4
  11. package/declarations/client/docs/config.d.ts.map +1 -1
  12. package/declarations/client/index.d.ts +1 -0
  13. package/declarations/client/index.d.ts.map +1 -1
  14. package/declarations/node/parser.d.ts.map +1 -1
  15. package/declarations/preset.d.ts.map +1 -1
  16. package/dist/annotations-DRGjlECb.mjs +143 -0
  17. package/dist/annotations-DRGjlECb.mjs.map +1 -0
  18. package/dist/client/config.mjs +1 -27
  19. package/dist/client/docs/addon-preview.mjs +17 -0
  20. package/dist/client/docs/addon-preview.mjs.map +1 -0
  21. package/dist/client/docs/config.mjs +9 -721
  22. package/dist/client/docs/config.mjs.map +1 -1
  23. package/dist/client/index.mjs +4 -4
  24. package/dist/client-DMDzc8eL.mjs +128 -0
  25. package/dist/client-DMDzc8eL.mjs.map +1 -0
  26. package/dist/{render-DZQu-NF7.mjs → config-DBYXYt5d.mjs} +34 -17
  27. package/dist/config-DBYXYt5d.mjs.map +1 -0
  28. package/dist/extractArgTypes-DNDT7G5O.mjs +89 -0
  29. package/dist/extractArgTypes-DNDT7G5O.mjs.map +1 -0
  30. package/dist/index.mjs +4 -4
  31. package/dist/{outlet-placeholder-C1-eUqzj.mjs → outlet-placeholder-CgO7fIDo.mjs} +2 -2
  32. package/dist/{outlet-placeholder-C1-eUqzj.mjs.map → outlet-placeholder-CgO7fIDo.mjs.map} +1 -1
  33. package/dist/page-BACn1xH0.mjs +507 -0
  34. package/dist/page-BACn1xH0.mjs.map +1 -0
  35. package/dist/preset.mjs +10 -4
  36. package/dist/preset.mjs.map +1 -1
  37. package/dist/{story-result-D9erht0M.mjs → story-result-Ds8Z5TZx.mjs} +15 -2
  38. package/dist/{story-result-D9erht0M.mjs.map → story-result-Ds8Z5TZx.mjs.map} +1 -1
  39. package/package.json +9 -5
  40. package/dist/client/config.mjs.map +0 -1
  41. package/dist/client-704tbFeh.mjs +0 -65
  42. package/dist/client-704tbFeh.mjs.map +0 -1
  43. package/dist/render-DZQu-NF7.mjs.map +0 -1
package/README.md CHANGED
@@ -23,4 +23,45 @@ You can also build a [static version](https://storybook.js.org/docs/sharing/publ
23
23
  - [Configurations](https://storybook.js.org/docs/configure?renderer=ember&ref=readme)
24
24
  - [Addons](https://storybook.js.org/docs/configure/user-interface/storybook-addons?renderer=ember&ref=readme)
25
25
 
26
+ ## CSF Next
27
+
28
+ This framework supports the [CSF Next factory syntax](https://storybook.js.org/docs/api/csf/csf-next)
29
+ alongside classic CSF. Wire up `defineMain` and `definePreview`, then build
30
+ stories from `preview.meta()` — story `args` are inferred from the component's
31
+ Ember signature:
32
+
33
+ ```ts
34
+ // .storybook/main.ts
35
+ import { defineMain } from 'ember-storybook/node';
36
+
37
+ export default defineMain({
38
+ stories: ['../**/*.stories.g(j|t)s'],
39
+ addons: ['@storybook/addon-docs']
40
+ });
41
+ ```
42
+
43
+ ```ts
44
+ // .storybook/preview.ts
45
+ import { definePreview } from 'ember-storybook';
46
+ import addonDocs from '@storybook/addon-docs';
47
+
48
+ export default definePreview({
49
+ addons: [addonDocs()],
50
+ parameters: {
51
+ ember: { app: createApp }
52
+ }
53
+ });
54
+ ```
55
+
56
+ ```gts
57
+ // button.stories.gts
58
+ import preview from '../.storybook/preview';
59
+ import { Button } from './button.gts';
60
+
61
+ const meta = preview.meta({ component: Button });
62
+
63
+ export const Primary = meta.story({ args: { label: 'Click me' } });
64
+ export const Small = Primary.extend({ args: { size: 'small' } });
65
+ ```
66
+
26
67
  Learn more about Storybook at [storybook.js.org](https://storybook.js.org/?ref=readme).
@@ -0,0 +1,88 @@
1
+ import type { EmberRenderer } from './types';
2
+ import type { TOC } from '@ember/component/template-only';
3
+ import type { AddonTypes, InferTypes, Meta, Preview, PreviewAddon } from 'storybook/internal/csf';
4
+ import type { Args, ArgsStoryFn, ComponentAnnotations, ProjectAnnotations } from 'storybook/internal/types';
5
+ /**
6
+ * The component shapes whose args `preview.meta()` infers from:
7
+ *
8
+ * - template-only components (`TOC<S>` / `TemplateOnlyComponent<S>`)
9
+ * - class components (`Component<S>` — matched through the instance `args`)
10
+ *
11
+ * Anything else (untyped components, plain templates) falls back to loose
12
+ * args; `preview.type<{ args: … }>()` overrides the inference explicitly.
13
+ */
14
+ type EmberComponent<TArgs extends Args> = TOC<{
15
+ Args: TArgs;
16
+ }> | (abstract new (...args: never[]) => {
17
+ args: Readonly<TArgs>;
18
+ });
19
+ type Simplify<T> = {
20
+ [K in keyof T]: T[K];
21
+ };
22
+ /**
23
+ * The renderer type parameter all `definePreview` factories carry: the Ember
24
+ * renderer merged with whatever types the registered addons contribute.
25
+ *
26
+ * `InferTypes` collapses to `never` when no addons are registered (the empty
27
+ * array case poisons the whole intersection), so it is neutralized here.
28
+ */
29
+ export type EmberTypes<Addons extends AddonTypes = AddonTypes> = EmberRenderer & Addons;
30
+ type InferAddonTypes<Addons extends PreviewAddon<never>[]> = [InferTypes<Addons>] extends [never] ? AddonTypes : InferTypes<Addons>;
31
+ /**
32
+ * Type-safe preview configuration for Ember (the CSF Next entry point).
33
+ *
34
+ * ```ts
35
+ * // .storybook/preview.ts
36
+ * import { definePreview } from 'ember-storybook';
37
+ * import addonDocs from '@storybook/addon-docs';
38
+ *
39
+ * export default definePreview({
40
+ * addons: [addonDocs()],
41
+ * parameters: {
42
+ * ember: { app: createApp },
43
+ * },
44
+ * });
45
+ * ```
46
+ */
47
+ export declare function definePreview<Addons extends PreviewAddon<never>[]>(input: ProjectAnnotations<EmberTypes<InferAddonTypes<Addons>>> & {
48
+ addons?: Addons;
49
+ }): EmberPreview<EmberTypes<InferAddonTypes<Addons>>>;
50
+ /**
51
+ * The CSF Next `Preview` specialized for Ember: `preview.meta()` infers story
52
+ * args from the component's signature.
53
+ */
54
+ export interface EmberPreview<TRenderer extends EmberRenderer> extends Omit<Preview<TRenderer>, 'meta' | 'type'> {
55
+ /**
56
+ * Narrows or extends the inferred annotation types, e.g. to add args that
57
+ * the component signature cannot provide:
58
+ *
59
+ * ```ts
60
+ * const meta = preview.type<{ args: { theme: 'light' | 'dark' } }>().meta({
61
+ * component: Button,
62
+ * });
63
+ * ```
64
+ */
65
+ type<R>(): EmberPreview<TRenderer & R>;
66
+ /**
67
+ * Creates the component meta for a story file; `meta.story()` then requires
68
+ * exactly the component's args.
69
+ *
70
+ * ```ts
71
+ * const meta = preview.meta({ component: Button });
72
+ * export const Primary = meta.story({ args: { label: 'Click me' } });
73
+ * ```
74
+ */
75
+ meta<TArgs extends Args, TInput extends ComponentAnnotations<TRenderer & {
76
+ args: TArgs;
77
+ }, TArgs>>(input: TInput & {
78
+ component?: EmberComponent<TArgs>;
79
+ render?: ArgsStoryFn<TRenderer & {
80
+ args: TArgs;
81
+ }, TArgs>;
82
+ }): Meta<TRenderer & {
83
+ args: Simplify<TArgs & NonNullable<TInput['args']>>;
84
+ }, TInput>;
85
+ meta<TInput extends ComponentAnnotations<TRenderer, TRenderer['args']>>(input: TInput): Meta<TRenderer, TInput>;
86
+ }
87
+ export {};
88
+ //# sourceMappingURL=define-preview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define-preview.d.ts","sourceRoot":"","sources":["../../src/client/define-preview.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAC;A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E,OAAO,CAAC,SAAS,CAAC,EAClB,MAAM,GAAG,MAAM,CAChB;IACC;;;;;;;;;OASG;IACH,IAAI,CAAC,CAAC,KAAK,YAAY,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;IAEvC;;;;;;;;OAQG;IACH,IAAI,CAAC,KAAK,SAAS,IAAI,EAAE,MAAM,SAAS,oBAAoB,CAAC,SAAS,GAAG;QAAE,IAAI,EAAE,KAAK,CAAA;KAAE,EAAE,KAAK,CAAC,EAC9F,KAAK,EAAE,MAAM,GAAG;QACd,SAAS,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC;QAClC,MAAM,CAAC,EAAE,WAAW,CAAC,SAAS,GAAG;YAAE,IAAI,EAAE,KAAK,CAAA;SAAE,EAAE,KAAK,CAAC,CAAC;KAC1D,GACA,IAAI,CAAC,SAAS,GAAG;QAAE,IAAI,EAAE,QAAQ,CAAC,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;KAAE,EAAE,MAAM,CAAC,CAAC;IAErF,IAAI,CAAC,MAAM,SAAS,oBAAoB,CAAC,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,EACpE,KAAK,EAAE,MAAM,GACZ,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;CAC5B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=define-preview.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define-preview.test.d.ts","sourceRoot":"","sources":["../../src/client/define-preview.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export default function emberStorybookDocsAddon(): import("storybook/internal/csf").PreviewAddon<import("storybook/internal/csf").AddonTypes>;
2
+ //# sourceMappingURL=addon-preview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addon-preview.d.ts","sourceRoot":"","sources":["../../../src/client/docs/addon-preview.ts"],"names":[],"mappings":"AAyBA,MAAM,CAAC,OAAO,UAAU,uBAAuB,+FAE9C"}
@@ -0,0 +1,6 @@
1
+ import type { EmberRenderer } from '../types';
2
+ import type { DecoratorFunction, Parameters, StoryContextForEnhancers, StrictArgTypes } from 'storybook/internal/types';
3
+ export declare const argTypesEnhancers: ((context: StoryContextForEnhancers<EmberRenderer>) => StrictArgTypes)[];
4
+ export declare const parameters: Parameters;
5
+ export declare const decorators: DecoratorFunction<EmberRenderer>[];
6
+ //# sourceMappingURL=annotations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../../../src/client/docs/annotations.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,KAAK,EACV,iBAAiB,EACjB,UAAU,EACV,wBAAwB,EACxB,cAAc,EACf,MAAM,0BAA0B,CAAC;AAuBlC,eAAO,MAAM,iBAAiB,EAAE,CAAC,CAC/B,OAAO,EAAE,wBAAwB,CAAC,aAAa,CAAC,KAC7C,cAAc,CAAC,EAkCnB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAOxB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,iBAAiB,CAAC,aAAa,CAAC,EAAsB,CAAC"}
@@ -1,6 +1,4 @@
1
- import type { EmberRenderer } from '../types';
2
- import type { DecoratorFunction, Parameters, StoryContextForEnhancers, StrictArgTypes } from 'storybook/internal/types';
3
- export declare const argTypesEnhancers: ((context: StoryContextForEnhancers<EmberRenderer>) => StrictArgTypes)[];
1
+ import type { Parameters } from 'storybook/internal/types';
2
+ export { argTypesEnhancers, decorators } from './annotations';
4
3
  export declare const parameters: Parameters;
5
- export declare const decorators: DecoratorFunction<EmberRenderer>[];
6
4
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/client/docs/config.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,KAAK,EACV,iBAAiB,EACjB,UAAU,EACV,wBAAwB,EACxB,cAAc,EACf,MAAM,0BAA0B,CAAC;AAuBlC,eAAO,MAAM,iBAAiB,EAAE,CAAC,CAC/B,OAAO,EAAE,wBAAwB,CAAC,aAAa,CAAC,KAC7C,cAAc,CAAC,EAkCnB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAQxB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,iBAAiB,CAAC,aAAa,CAAC,EAAsB,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/client/docs/config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAM3D,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI9D,eAAO,MAAM,UAAU,EAAE,UAMxB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import './globals';
2
+ export * from './define-preview';
2
3
  export { OutletPlaceholder } from './outlet-placeholder';
3
4
  export * from './portable-stories';
4
5
  export * from './public-types';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,CAAC;AAEnB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,CAAC;AAEnB,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,cAAc,oBAAoB,CAAC;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AS,GAAG,SAAS,CAwHvE"}
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/node/parser.ts"],"names":[],"mappings":"AAMA,OAAO,EAAW,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE1F,OAAO,EAAW,KAAK,YAAY,EAAqB,MAAM,UAAU,CAAC;AAEzE,OAAO,KAAK,EAAmB,OAAO,EAAsB,MAAM,YAAY,CAAC;AAE/E;;;;;;;;GAQG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;AAExD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAW9F;AAED,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAKnF;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,UAAU,CAAC;IACjB,SAAS,EAAE;QACT;;;WAGG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd;;;;;;;WAOG;QACH,aAAa,CAAC,EAAE,MAAM,CAAC;QAEvB;;;;;WAKG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IAEF,OAAO,EAAE,CAAC,WAAW,GAAG;QAAE,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;CACxD;AAkDD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAkF7E;AAqBD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAyHvE"}
@@ -1 +1 @@
1
- {"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../src/preset.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,mBAAmB,EAAsB,MAAM,yBAAyB,CAAC;AAKvF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAoB/D,eAAO,MAAM,kBAAkB,EAAE,cAAc,CAAC,oBAAoB,CAkBnE,CAAC;AAIF,eAAO,MAAM,cAAc,GAAI,UAAS,MAAM,EAAO,KAAG,MAAM,EAG7D,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,mBAAmB,CAAC,WAAW,CAkBtD,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,eAAe,CAAC,uBAAuB,CAE1E,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,cAAc,CAAC,MAAM,CAcvC,CAAC"}
1
+ {"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../src/preset.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,mBAAmB,EAAsB,MAAM,yBAAyB,CAAC;AAKvF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAuC/D,eAAO,MAAM,kBAAkB,EAAE,cAAc,CAAC,oBAAoB,CAkBnE,CAAC;AAIF,eAAO,MAAM,cAAc,GAAI,UAAS,MAAM,EAAO,KAAG,MAAM,EAG7D,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,mBAAmB,CAAC,WAAW,CAqBtD,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,eAAe,CAAC,uBAAuB,CAE1E,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,cAAc,CAAC,MAAM,CAcvC,CAAC"}
@@ -0,0 +1,143 @@
1
+ import { i as __exportAll, n as isEmberStoryResult } from "./story-result-Ds8Z5TZx.mjs";
2
+ import { n as mergeArgTypes, t as buildArgTypes } from "./extractArgTypes-DNDT7G5O.mjs";
3
+ import { n as unwrapBlockParamsShallow } from "./block-params-wjiT2Ht6.mjs";
4
+ import { SourceType } from "storybook/internal/docs-tools";
5
+ import emberData from "virtual:ember-storybook";
6
+ import { emitTransformCode, useEffect, useRef } from "storybook/preview-api";
7
+ //#region src/client/docs/source-decorator.ts
8
+ const data$1 = emberData;
9
+ function skipSourceRender(context) {
10
+ const sourceParams = context.parameters.docs?.source;
11
+ if (sourceParams?.type === SourceType.DYNAMIC) return false;
12
+ return (!context.parameters.__isArgsStory || sourceParams?.code) ?? sourceParams?.type === SourceType.CODE;
13
+ }
14
+ function toArgument(key, value, argTypes) {
15
+ if (value !== void 0 && value !== null) {
16
+ if (typeof value === "string") return `@${key}=${JSON.stringify(value)}`;
17
+ if (typeof value === "number" || typeof value === "boolean") return `@${key}={{${String(value)}}}`;
18
+ if (Object.hasOwn(argTypes, key)) return `@${key}={{@${key}}}`;
19
+ return;
20
+ }
21
+ if (value === void 0 && Object.hasOwn(argTypes, key)) return `@${key}={{@${key}}}`;
22
+ }
23
+ function generateBlockContent(blockInfo) {
24
+ if (blockInfo.params.length === 0) return "...";
25
+ return `{{yield ${unwrapBlockParamsShallow(blockInfo.params).map((p) => p.name).join(", ")}}}`;
26
+ }
27
+ function generateBlockSourceCode(sig, args, indent) {
28
+ const blockNames = Object.keys(sig.blocks);
29
+ if (blockNames.length === 0) return "";
30
+ const blocks = [];
31
+ for (const blockName of blockNames) {
32
+ const blockInfo = sig.blocks[blockName];
33
+ if (args[blockName] === void 0 && blockInfo.params.length === 0) continue;
34
+ const params = unwrapBlockParamsShallow(blockInfo.params).map((p) => p.name).join(" ");
35
+ const slotBindings = params ? ` as |${params}|` : "";
36
+ const content = generateBlockContent(blockInfo);
37
+ if (blockName === "default" && !slotBindings) blocks.push(content);
38
+ else blocks.push(`${indent} <:${blockName}${slotBindings}>${content}</:${blockName}>`);
39
+ }
40
+ return blocks.join("\n");
41
+ }
42
+ let byStoryId;
43
+ function getByStoryId() {
44
+ if (byStoryId) return byStoryId;
45
+ byStoryId = {};
46
+ for (const entry of Object.values(data$1)) for (const [storyId, source] of Object.entries(entry.source ?? {})) byStoryId[storyId] = {
47
+ componentName: source.componentName,
48
+ signatureName: source.signatureName,
49
+ inlineTemplate: source.inlineTemplate
50
+ };
51
+ return byStoryId;
52
+ }
53
+ function signatureForComponent(name) {
54
+ for (const entry of Object.values(data$1)) {
55
+ const comp = entry.component;
56
+ if (comp?.signatureName !== name) continue;
57
+ return (comp.file ? data$1[comp.file] : void 0)?.signatures?.[comp.signatureName];
58
+ }
59
+ }
60
+ function resolveTemplateArgs(template, args) {
61
+ return template.replaceAll(/\{\{args\.(\w+)\}\}/g, (_match, key) => {
62
+ const value = args[key];
63
+ if (typeof value === "string") return JSON.stringify(value);
64
+ if (typeof value === "number" || typeof value === "boolean") return `{{${String(value)}}}`;
65
+ return `{{@${key}}}`;
66
+ });
67
+ }
68
+ function generateSource(component, args, argTypes, storyId) {
69
+ const meta = storyId ? getByStoryId()[storyId] : void 0;
70
+ if (meta?.inlineTemplate) return resolveTemplateArgs(meta.inlineTemplate, args);
71
+ const name = meta?.componentName ?? component.name;
72
+ if (!name || name === "(unknown template-only component)") return;
73
+ const sig = signatureForComponent(meta?.signatureName ?? name);
74
+ const propsArray = Object.entries(args).filter(([k]) => !sig || !Object.hasOwn(sig.blocks, k)).map(([k, v]) => toArgument(k, v, argTypes)).filter(Boolean);
75
+ const blockCode = sig ? generateBlockSourceCode(sig, args, "") : "";
76
+ const propsStr = propsArray.join(" ");
77
+ if (!blockCode) {
78
+ if (propsArray.length === 0) return `<${name} />`;
79
+ if (propsArray.length > 3) return `<${name}\n ${propsArray.join("\n ")}\n/>`;
80
+ return `<${name} ${propsStr} />`;
81
+ }
82
+ if (propsArray.length === 0) return `<${name}>\n${blockCode}\n</${name}>`;
83
+ return `<${name} ${propsStr}>\n${blockCode}\n</${name}>`;
84
+ }
85
+ const sourceDecorator = (storyFn, context) => {
86
+ const source = useRef(void 0);
87
+ const story = storyFn();
88
+ useEffect(() => {
89
+ const rendered = context.originalStoryFn(context.args, context);
90
+ const renderedForSource = isEmberStoryResult(rendered) ? rendered.component : rendered;
91
+ if (!skipSourceRender(context)) {
92
+ const code = generateSource(renderedForSource, context.args, context.argTypes, context.id) ?? void 0;
93
+ emitTransformCode(code, context);
94
+ source.current = code;
95
+ }
96
+ });
97
+ return story;
98
+ };
99
+ //#endregion
100
+ //#region src/client/docs/annotations.ts
101
+ var annotations_exports = /* @__PURE__ */ __exportAll({
102
+ argTypesEnhancers: () => argTypesEnhancers,
103
+ decorators: () => decorators,
104
+ parameters: () => parameters
105
+ });
106
+ const data = emberData;
107
+ function resolveSig(entry) {
108
+ if (!("component" in entry)) return void 0;
109
+ const comp = entry.component;
110
+ if (!comp.signatureName) return void 0;
111
+ const compEntry = comp.file ? data[comp.file] : void 0;
112
+ if (!compEntry || !("signatures" in compEntry)) return void 0;
113
+ return compEntry.signatures[comp.signatureName];
114
+ }
115
+ /** Last path segment of a CSF title — used to match stories without `fileName`. */
116
+ function titleLeaf(title) {
117
+ return title?.split("/").pop();
118
+ }
119
+ const argTypesEnhancers = [(context) => {
120
+ const filePath = context.parameters.fileName;
121
+ if (filePath && Object.hasOwn(data, filePath)) {
122
+ const sig = resolveSig(data[filePath]);
123
+ if (sig) return mergeArgTypes(buildArgTypes(sig), context.argTypes);
124
+ return context.argTypes;
125
+ }
126
+ const leaf = titleLeaf(context.title);
127
+ if (leaf) for (const entry of Object.values(data)) {
128
+ if (!("meta" in entry)) continue;
129
+ if (titleLeaf(entry.meta.title) !== leaf) continue;
130
+ const sig = resolveSig(entry);
131
+ if (sig) return mergeArgTypes(buildArgTypes(sig), context.argTypes);
132
+ }
133
+ return context.argTypes;
134
+ }];
135
+ const parameters = { docs: { source: {
136
+ type: SourceType.DYNAMIC,
137
+ language: "html"
138
+ } } };
139
+ const decorators = [sourceDecorator];
140
+ //#endregion
141
+ export { parameters as i, argTypesEnhancers as n, decorators as r, annotations_exports as t };
142
+
143
+ //# sourceMappingURL=annotations-DRGjlECb.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotations-DRGjlECb.mjs","names":["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","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","decorators"],"sources":["../src/client/docs/source-decorator.ts","../src/client/docs/annotations.ts"],"sourcesContent":["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 } from './extractArgTypes';\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 mergeArgTypes(buildArgTypes(sig), context.argTypes) as StrictArgTypes;\n }\n\n return context.argTypes;\n }\n\n // No `parameters.fileName` — fall back to matching the CSF title leaf\n // against indexed story files instead of picking an arbitrary signature.\n const leaf = titleLeaf(context.title);\n\n if (leaf) {\n for (const entry of Object.values(data)) {\n if (!('meta' in entry)) continue;\n\n if (titleLeaf(entry.meta.title) !== leaf) continue;\n\n const sig = resolveSig(entry);\n\n if (sig) {\n return mergeArgTypes(buildArgTypes(sig), context.argTypes) as StrictArgTypes;\n }\n }\n }\n\n return context.argTypes;\n }\n];\n\nexport const parameters: Parameters = {\n docs: {\n source: {\n type: SourceType.DYNAMIC,\n language: 'html'\n }\n }\n};\n\nexport const decorators: DecoratorFunction<EmberRenderer>[] = [sourceDecorator];\n"],"mappings":";;;;;;;AAaA,MAAMO,SAAOH;AASb,SAASI,iBAAiBC,SAA0D;CAElF,MAAMC,eAAeD,QAAQE,WAAWC,MAAMC;CAG9C,IAAIH,cAAcI,SAASd,WAAWe,SACpC,OAAO;CAMT,QAAQ,CAHYN,QAAQE,WAAWM,iBAGfP,cAAcQ,SAASR,cAAcI,SAASd,WAAWmB;AACnF;AAEA,SAAgBC,WAAWC,KAAaC,OAAgBC,UAAwC;CAC9F,IAAID,UAAUE,KAAAA,KAAaF,UAAU,MAAM;EACzC,IAAI,OAAOA,UAAU,UACnB,OAAO,IAAID,IAAG,GAAII,KAAKC,UAAUJ,KAAK;EAGxC,IAAI,OAAOA,UAAU,YAAY,OAAOA,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Types } from "storybook/internal/docs-tools";
4
- //#region src/client/config.ts
5
- const parameters = {
6
- renderer: "ember",
7
- docs: { story: { inline: true } }
8
- };
9
- /**
10
- * The "Ember" toolbar menu: how a route story should render `{{outlet}}`.
11
- *
12
- * `defaultValue` seeds the global (Storybook merges global-type defaults under
13
- * any project `initialGlobals`), so a project can still change the starting
14
- * value with `initialGlobals: { outlet: 'placeholder' }`.
15
- *
16
- * No `toolbar` here: the menu UI (with the Ember brand icon) is a custom tool
17
- * in `src/manager`, because Storybook 10 only resolves toolbar icons against
18
- * its fixed built-in icon map.
19
- */
20
- const globalTypes = { [OUTLET_GLOBAL_KEY]: {
21
- description: "How a route story renders {{outlet}}",
22
- defaultValue: "hole"
23
- } };
24
- const argTypesEnhancers = [enhanceArgTypes];
25
- //#endregion
1
+ import { a as render, i as parameters, o as renderToCanvas, r as globalTypes, t as argTypesEnhancers } from "../config-DBYXYt5d.mjs";
26
2
  export { argTypesEnhancers, globalTypes, parameters, render, renderToCanvas };
27
-
28
- //# sourceMappingURL=config.mjs.map
@@ -0,0 +1,17 @@
1
+ import { t as Page } from "../../page-BACn1xH0.mjs";
2
+ import { parameters as parameters$2 } from "./preview-patch.mjs";
3
+ import { definePreviewAddon } from "storybook/internal/csf";
4
+ import { parameters } from "@storybook/addon-docs/preview";
5
+ //#region src/client/docs/addon-preview.ts
6
+ const parameters$1 = { docs: {
7
+ ...parameters.docs,
8
+ ...parameters$2.docs,
9
+ page: Page
10
+ } };
11
+ function emberStorybookDocsAddon() {
12
+ return definePreviewAddon({ parameters: parameters$1 });
13
+ }
14
+ //#endregion
15
+ export { emberStorybookDocsAddon as default };
16
+
17
+ //# sourceMappingURL=addon-preview.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addon-preview.mjs","names":["parameters","docsParameters","definePreviewAddon","Page","emberDocsParameters","docs","page","emberStorybookDocsAddon"],"sources":["../../../src/client/docs/addon-preview.ts"],"sourcesContent":["import { parameters as docsParameters } from '@storybook/addon-docs/preview';\nimport { definePreviewAddon } from 'storybook/internal/csf';\n\nimport Page from './page';\nimport { parameters as emberDocsParameters } from './preview-patch';\n\n// The CSF Next counterpart of the `docsRendererPlugin` redirect in the preset.\n// A csf-next project registers addon-docs through its preview file\n// (`import addonDocs from '@storybook/addon-docs'` + `addons: [addonDocs()]`);\n// the preset redirects that root import to this module, which wraps the real\n// addon-docs preview annotations with the framework's docs configuration: the\n// stable-key DocsRenderer fork (see `./preview-patch`) and the Ember autodocs\n// page. Keeping the addon-docs import behind the user's own registration means\n// `ember-storybook`'s root module graph never statically imports\n// `@storybook/addon-docs`.\ntype DocsParameters = { docs?: Record<string, unknown> };\n\nconst parameters = {\n docs: {\n ...(docsParameters as DocsParameters).docs,\n ...(emberDocsParameters as DocsParameters).docs,\n page: Page\n }\n};\n\nexport default function emberStorybookDocsAddon() {\n return definePreviewAddon({ parameters });\n}\n"],"mappings":";;;;;AAiBA,MAAMA,eAAa,EACjBK,MAAM;CACJ,GAAIJ,WAAkCI;CACtC,GAAID,aAAuCC;CAC3CC,MAAMH;AACR,EACF;AAEA,SAAwBI,0BAA0B;CAChD,OAAOL,mBAAmB,EAAEF,YAAAA,aAAW,CAAC;AAC1C"}