ember-storybook 0.3.0 → 0.3.2

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 (32) hide show
  1. package/declarations/client/docs/config.d.ts.map +1 -1
  2. package/declarations/client/docs/extractArgTypes.d.ts +6 -5
  3. package/declarations/client/docs/extractArgTypes.d.ts.map +1 -1
  4. package/declarations/client/outlet.d.ts +13 -7
  5. package/declarations/client/outlet.d.ts.map +1 -1
  6. package/declarations/client/render-story.d.ts.map +1 -1
  7. package/declarations/client/render.d.ts.map +1 -1
  8. package/declarations/client/types.d.ts +11 -2
  9. package/declarations/client/types.d.ts.map +1 -1
  10. package/declarations/outlet-key.d.ts +11 -0
  11. package/declarations/outlet-key.d.ts.map +1 -0
  12. package/dist/client/config.mjs +2 -2
  13. package/dist/client/config.mjs.map +1 -1
  14. package/dist/client/docs/config.mjs +14 -14
  15. package/dist/client/docs/config.mjs.map +1 -1
  16. package/dist/client/index.mjs +3 -3
  17. package/dist/{client-DMN9EyIc.mjs → client-704tbFeh.mjs} +4 -4
  18. package/dist/{client-DMN9EyIc.mjs.map → client-704tbFeh.mjs.map} +1 -1
  19. package/dist/index.mjs +3 -3
  20. package/dist/manager/index.mjs +1 -1
  21. package/dist/manager/index.mjs.map +1 -1
  22. package/dist/outlet-key-Dhm2WHYN.mjs +15 -0
  23. package/dist/outlet-key-Dhm2WHYN.mjs.map +1 -0
  24. package/dist/{outlet-placeholder-DZpXQLIa.mjs → outlet-placeholder-C1-eUqzj.mjs} +2 -2
  25. package/dist/{outlet-placeholder-DZpXQLIa.mjs.map → outlet-placeholder-C1-eUqzj.mjs.map} +1 -1
  26. package/dist/render-DZQu-NF7.mjs +387 -0
  27. package/dist/render-DZQu-NF7.mjs.map +1 -0
  28. package/package.json +1 -1
  29. package/dist/outlet-Dc5ySBso.mjs +0 -119
  30. package/dist/outlet-Dc5ySBso.mjs.map +0 -1
  31. package/dist/render-jYhDmzLM.mjs +0 -220
  32. package/dist/render-jYhDmzLM.mjs.map +0 -1
@@ -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,EAoCnB,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":"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,9 +1,4 @@
1
1
  import type { ComponentSignature } from 'ember-docgen';
2
- /**
3
- * Returns a new argTypes object with entries sorted alphabetically by name,
4
- * matching Storybook's `alpha` sort order. The input object is not mutated.
5
- */
6
- export declare function sortArgTypes(argTypes: Record<string, unknown>): Record<string, unknown>;
7
2
  export declare function buildArgTypes(sig: ComponentSignature): Record<string, unknown>;
8
3
  /**
9
4
  * Merges signature-derived argTypes with the story-provided argTypes.
@@ -17,6 +12,12 @@ export declare function buildArgTypes(sig: ComponentSignature): Record<string, u
17
12
  * The `type` object is deep-merged: a story-provided partial `type` (e.g.
18
13
  * `type: 'string'`) keeps the signature's `required` flag unless the story
19
14
  * explicitly sets it, while the story's `type.name` still wins.
15
+ *
16
+ * Key order is meaningful: story-provided keys come first in the order the
17
+ * user defined them (user intent wins), followed by the remaining
18
+ * signature-derived keys in declaration order. Alphabetising is a display
19
+ * concern handled by Storybook itself (`parameters.controls.sort` for the
20
+ * panel, `parameters.docs.controls.sort` for the docs Controls block).
20
21
  */
21
22
  export declare function mergeArgTypes(signatureArgTypes: Record<string, unknown>, storyArgTypes: Record<string, unknown>): Record<string, unknown>;
22
23
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"extractArgTypes.d.ts","sourceRoot":"","sources":["../../../src/client/docs/extractArgTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAoCpE;;;GAGG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEvF;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAoB9E;AAMD;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAC3B,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC1C,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACrC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA8BzB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,kBAAkB,EACvB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACrC,OAAO,CAET"}
1
+ {"version":3,"file":"extractArgTypes.d.ts","sourceRoot":"","sources":["../../../src/client/docs/extractArgTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAoCpE,wBAAgB,aAAa,CAAC,GAAG,EAAE,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAoB9E;AAMD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,aAAa,CAC3B,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC1C,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACrC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAsCzB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,kBAAkB,EACvB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACrC,OAAO,CAET"}
@@ -40,16 +40,10 @@ export interface RouteStoryInput {
40
40
  /** The booted app instance the route renders under. */
41
41
  owner: object;
42
42
  }
43
- /**
44
- * Name of the Storybook global that decides how `{{outlet}}` is rendered
45
- * (`hole` | `placeholder`). Declared here so the toolbar item and the renderer
46
- * read and write the same key.
47
- */
48
- export declare const OUTLET_GLOBAL_KEY = "outlet";
49
43
  export interface OutletResolveInput {
50
44
  /** `parameters.ember.route` of the story being rendered. */
51
45
  route: RouteParameters;
52
- /** Value of the {@link OUTLET_GLOBAL_KEY} global, if any. */
46
+ /** Value of the `outlet` global (see `src/outlet-key.ts`), if any. */
53
47
  mode?: OutletMode;
54
48
  /**
55
49
  * Produces the stub rendered when the global asks for a visible placeholder.
@@ -66,6 +60,18 @@ export interface OutletResolveInput {
66
60
  * `placeholder` renders the injected marker, anything else leaves a hole.
67
61
  */
68
62
  export declare function resolveOutletStub({ route, mode, placeholder }: OutletResolveInput): Promise<OutletStub | undefined>;
63
+ /**
64
+ * Whether the component's *own* template references `{{outlet}}` — i.e. it is a
65
+ * route template, which is how an unannotated route-story is recognized (#62).
66
+ *
67
+ * A template factory caches a per-owner (plus ownerless) `TemplateImpl`; its
68
+ * `parsedLayout.block` is the parsed wire-format tuple
69
+ * `[statements, locals, upvars]`. Free names — every helper/keyword the
70
+ * template resolves, from the whole template including nested blocks — live
71
+ * exactly once in `upvars`, so checking that slot cannot mistake a string
72
+ * literal `"-outlet"` used as an argument for a real outlet.
73
+ */
74
+ export declare function templateUsesOutlet(component: object): boolean;
69
75
  /**
70
76
  * Builds the `OutletState` for a route story.
71
77
  *
@@ -1 +1 @@
1
- {"version":3,"file":"outlet.d.ts","sourceRoot":"","sources":["../../src/client/outlet.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AACvE,OAAO,KAAK,mBAAmB,MAAM,6BAA6B,CAAC;AAEnE;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,OAAO,CAAC;IACpB,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE;QAAE,IAAI,EAAE,WAAW,GAAG,SAAS,CAAA;KAAE,CAAC;CAC5C;AAED,MAAM,WAAW,eAAe;IAC9B,oDAAoD;IACpD,QAAQ,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,KAAK,EAAE,eAAe,CAAC;IACvB;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,uDAAuD;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;CACf;AAID;;;;GAIG;AAC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G;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IACpC,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;CAC1C;AAyDD;;;GAGG;AACH,wBAAsB,eAAe,CACnC,WAAW,EAAE,mBAAmB,EAChC,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,UAAU,CAAC,CAMrB;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAG1F"}
@@ -1 +1 @@
1
- {"version":3,"file":"render-story.d.ts","sourceRoot":"","sources":["../../src/client/render-story.gts"],"names":[],"mappings":"AAgDA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAQ3C,UAAU,oBAAoB;IAC5B,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,MAAM,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC/B,CAAC;IACF,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,qBAAa,WAAY,SAAQ,SAAS,CAAC,oBAAoB,CAAC;IAC9D,MAAM;;;;;;OAyBH;CASJ"}
1
+ {"version":3,"file":"render-story.d.ts","sourceRoot":"","sources":["../../src/client/render-story.gts"],"names":[],"mappings":"AAiDA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAS3C,UAAU,oBAAoB;IAC5B,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,MAAM,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC/B,CAAC;IACF,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,qBAAa,WAAY,SAAQ,SAAS,CAAC,oBAAoB,CAAC;IAC9D,MAAM;;;;;;OAyBH;CASJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/client/render.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAGV,aAAa,EAGb,YAAY,EACb,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAiB3E,eAAO,MAAM,MAAM,EAAE,WAAW,CAAC,aAAa,CAgB7C,CAAC;AA8LF,wBAAsB,cAAc,CAClC,EACE,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,YAAY,EACb,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG;IAAE,YAAY,EAAE,YAAY,CAAA;CAAE,EAChE,aAAa,EAAE,aAAa,CAAC,eAAe,CAAC,uBAwI9C"}
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/client/render.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAGV,aAAa,EAGb,YAAY,EACb,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAiB3E,eAAO,MAAM,MAAM,EAAE,WAAW,CAAC,aAAa,CAgB7C,CAAC;AA8MF,wBAAsB,cAAc,CAClC,EACE,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,YAAY,EACb,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG;IAAE,YAAY,EAAE,YAAY,CAAA;CAAE,EAChE,aAAa,EAAE,aAAa,CAAC,eAAe,CAAC,uBAmK9C"}
@@ -24,7 +24,12 @@ export interface OutletStub {
24
24
  controller?: unknown;
25
25
  }
26
26
  /**
27
- * Opt-in marker that a story renders a *route* template rather than a component.
27
+ * Route options for a story that renders a *route* template rather than a
28
+ * component.
29
+ *
30
+ * A story is rendered as a route story when this parameter is present, or when
31
+ * the story's template references `{{outlet}}` (#62) — the latter implicitly,
32
+ * with empty route parameters.
28
33
  *
29
34
  * Route templates receive only `@model` and `@controller` (that is all Ember's
30
35
  * outlet hands them), and their `{{outlet}}` is stubbed via {@link OutletStub}.
@@ -45,7 +50,11 @@ export interface EmberParameters {
45
50
  configure?: (app: ApplicationInstance) => void;
46
51
  owner?: Record<`${string}:${string}`, object>;
47
52
  updateGlobals?: (globals: Record<string, unknown>, owner: Owner) => void;
48
- /** Present => render through Ember's outlet root so `{{outlet}}` works. */
53
+ /**
54
+ * Present => render through Ember's outlet root so `{{outlet}}` works.
55
+ * A template that uses `{{outlet}}` is rendered that way even without
56
+ * this parameter — then with empty route parameters (#62).
57
+ */
49
58
  route?: RouteParameters;
50
59
  };
51
60
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/client/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,mBAAmB,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEjG,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,YAAY,GACpB,OAAO,WAAW,GAClB,mBAAmB,GACnB,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,WAAW,GAAG,mBAAmB,CAAC,CAAC;AAEtF;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,8EAA8E;IAC9E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kDAAkD;IAClD,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;GAKG;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CAAC,GAAG,EAAE,mBAAmB,KAAK,IAAI,CAAC;QAC/C,KAAK,CAAC,EAAE,MAAM,CAAC,GAAG,MAAM,IAAI,MAAM,EAAE,EAAE,MAAM,CAAC,CAAC;QAC9C,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;QACzE;;;;WAIG;QACH,KAAK,CAAC,EAAE,eAAe,CAAC;KACzB,CAAC;CACH;AAED;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,aAAa,CAAC;AAEhD;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,WAAW,aAAc,SAAQ,WAAW;IAGhD,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC;IACX,UAAU,EAAE,eAAe,CAAC;IAC5B,OAAO,EAAE,YAAY,CAAC;CACvB;AAED,MAAM,MAAM,YAAY,GAAG,mBAAmB,CAAC,aAAa,CAAC,GAAG;IAC9D,UAAU,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC,YAAY,CAAC,GAAG,eAAe,CAAC;IAC/E,OAAO,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC,GAAG,YAAY,CAAC;CACvE,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Name of the Storybook global that decides how `{{outlet}}` is rendered
3
+ * (`hole` | `placeholder`).
4
+ *
5
+ * Lives in its own dependency-free module: the manager toolbar and the client
6
+ * renderer must read and write the same key, but importing it from the client
7
+ * outlet module would pull Ember-only imports (`@ember/*`) into the manager
8
+ * bundle, which Storybook builds with esbuild and cannot resolve them.
9
+ */
10
+ export declare const OUTLET_GLOBAL_KEY = "outlet";
11
+ //# sourceMappingURL=outlet-key.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outlet-key.d.ts","sourceRoot":"","sources":["../src/outlet-key.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,WAAW,CAAC"}
@@ -1,5 +1,5 @@
1
- import { n as renderToCanvas, t as render } from "../render-jYhDmzLM.mjs";
2
- import { t as OUTLET_GLOBAL_KEY } from "../outlet-Dc5ySBso.mjs";
1
+ import { n as renderToCanvas, t as render } from "../render-DZQu-NF7.mjs";
2
+ import { t as OUTLET_GLOBAL_KEY } from "../outlet-key-Dhm2WHYN.mjs";
3
3
  import { enhanceArgTypes } from "storybook/internal/docs-tools";
4
4
  //#region src/client/config.ts
5
5
  const parameters = {
@@ -1 +1 @@
1
- {"version":3,"file":"config.mjs","names":["enhanceArgTypes","OUTLET_GLOBAL_KEY","render","renderToCanvas","parameters","renderer","docs","story","inline","globalTypes","description","defaultValue","argTypesEnhancers"],"sources":["../../src/client/config.ts"],"sourcesContent":["import { enhanceArgTypes } from 'storybook/internal/docs-tools';\n\nimport { OUTLET_GLOBAL_KEY } from './outlet';\n\nimport type { ArgTypesEnhancer, GlobalTypes, Parameters } from 'storybook/internal/types';\n\nexport { render, renderToCanvas } from './render';\n\nexport const parameters: Parameters = {\n renderer: 'ember',\n docs: {\n story: { inline: true }\n }\n};\n\n/**\n * The \"Ember\" toolbar menu: how a route story should render `{{outlet}}`.\n *\n * `defaultValue` seeds the global (Storybook merges global-type defaults under\n * any project `initialGlobals`), so a project can still change the starting\n * value with `initialGlobals: { outlet: 'placeholder' }`.\n *\n * No `toolbar` here: the menu UI (with the Ember brand icon) is a custom tool\n * in `src/manager`, because Storybook 10 only resolves toolbar icons against\n * its fixed built-in icon map.\n */\nexport const globalTypes: GlobalTypes = {\n [OUTLET_GLOBAL_KEY]: {\n description: 'How a route story renders {{outlet}}',\n defaultValue: 'hole'\n }\n};\n\nexport const argTypesEnhancers: ArgTypesEnhancer[] = [enhanceArgTypes];\n"],"mappings":";;;;AAQA,MAAaI,aAAyB;CACpCC,UAAU;CACVC,MAAM,EACJC,OAAO,EAAEC,QAAQ,KAAK,EACxB;AACF;;;;;;;;;;;;AAaA,MAAaC,cAA2B,GACrCR,oBAAoB;CACnBS,aAAa;CACbC,cAAc;AAChB,EACF;AAEA,MAAaC,oBAAwC,CAACZ,eAAe"}
1
+ {"version":3,"file":"config.mjs","names":["enhanceArgTypes","OUTLET_GLOBAL_KEY","render","renderToCanvas","parameters","renderer","docs","story","inline","globalTypes","description","defaultValue","argTypesEnhancers"],"sources":["../../src/client/config.ts"],"sourcesContent":["import { enhanceArgTypes } from 'storybook/internal/docs-tools';\n\nimport { OUTLET_GLOBAL_KEY } from '../outlet-key';\n\nimport type { ArgTypesEnhancer, GlobalTypes, Parameters } from 'storybook/internal/types';\n\nexport { render, renderToCanvas } from './render';\n\nexport const parameters: Parameters = {\n renderer: 'ember',\n docs: {\n story: { inline: true }\n }\n};\n\n/**\n * The \"Ember\" toolbar menu: how a route story should render `{{outlet}}`.\n *\n * `defaultValue` seeds the global (Storybook merges global-type defaults under\n * any project `initialGlobals`), so a project can still change the starting\n * value with `initialGlobals: { outlet: 'placeholder' }`.\n *\n * No `toolbar` here: the menu UI (with the Ember brand icon) is a custom tool\n * in `src/manager`, because Storybook 10 only resolves toolbar icons against\n * its fixed built-in icon map.\n */\nexport const globalTypes: GlobalTypes = {\n [OUTLET_GLOBAL_KEY]: {\n description: 'How a route story renders {{outlet}}',\n defaultValue: 'hole'\n }\n};\n\nexport const argTypesEnhancers: ArgTypesEnhancer[] = [enhanceArgTypes];\n"],"mappings":";;;;AAQA,MAAaI,aAAyB;CACpCC,UAAU;CACVC,MAAM,EACJC,OAAO,EAAEC,QAAQ,KAAK,EACxB;AACF;;;;;;;;;;;;AAaA,MAAaC,cAA2B,GACrCR,oBAAoB;CACnBS,aAAa;CACbC,cAAc;AAChB,EACF;AAEA,MAAaC,oBAAwC,CAACZ,eAAe"}
@@ -21,13 +21,6 @@ function mapTypeToControl(type) {
21
21
  default: return { type: "object" };
22
22
  }
23
23
  }
24
- /**
25
- * Returns a new argTypes object with entries sorted alphabetically by name,
26
- * matching Storybook's `alpha` sort order. The input object is not mutated.
27
- */
28
- function sortArgTypes(argTypes) {
29
- return Object.fromEntries(Object.entries(argTypes).toSorted(([a], [b]) => a.localeCompare(b)));
30
- }
31
24
  function buildArgTypes(sig) {
32
25
  const argTypes = {};
33
26
  for (const [name, arg] of Object.entries(sig.args)) argTypes[name] = {
@@ -43,7 +36,7 @@ function buildArgTypes(sig) {
43
36
  defaultValue: arg.defaultValue ? { summary: arg.defaultValue } : void 0
44
37
  }
45
38
  };
46
- return sortArgTypes(argTypes);
39
+ return argTypes;
47
40
  }
48
41
  function isObject(value) {
49
42
  return typeof value === "object" && value !== null;
@@ -60,12 +53,18 @@ function isObject(value) {
60
53
  * The `type` object is deep-merged: a story-provided partial `type` (e.g.
61
54
  * `type: 'string'`) keeps the signature's `required` flag unless the story
62
55
  * explicitly sets it, while the story's `type.name` still wins.
56
+ *
57
+ * Key order is meaningful: story-provided keys come first in the order the
58
+ * user defined them (user intent wins), followed by the remaining
59
+ * signature-derived keys in declaration order. Alphabetising is a display
60
+ * concern handled by Storybook itself (`parameters.controls.sort` for the
61
+ * panel, `parameters.docs.controls.sort` for the docs Controls block).
63
62
  */
64
63
  function mergeArgTypes(signatureArgTypes, storyArgTypes) {
65
- const merged = { ...signatureArgTypes };
64
+ const merged = {};
66
65
  for (const [name, storyArg] of Object.entries(storyArgTypes)) {
67
66
  if (storyArg === void 0) continue;
68
- const sigArg = merged[name];
67
+ const sigArg = signatureArgTypes[name];
69
68
  if (!isObject(sigArg) || !isObject(storyArg)) {
70
69
  merged[name] = storyArg;
71
70
  continue;
@@ -81,6 +80,7 @@ function mergeArgTypes(signatureArgTypes, storyArgTypes) {
81
80
  };
82
81
  merged[name] = mergedArg;
83
82
  }
83
+ for (const [name, sigArg] of Object.entries(signatureArgTypes)) if (!Object.hasOwn(merged, name)) merged[name] = sigArg;
84
84
  return merged;
85
85
  }
86
86
  /**
@@ -701,17 +701,17 @@ const argTypesEnhancers = [(context) => {
701
701
  const filePath = context.parameters.fileName;
702
702
  if (filePath && Object.hasOwn(data, filePath)) {
703
703
  const sig = resolveSig(data[filePath]);
704
- if (sig) return sortArgTypes(mergeArgTypes(buildArgTypes(sig), context.argTypes));
705
- return sortArgTypes(context.argTypes);
704
+ if (sig) return mergeArgTypes(buildArgTypes(sig), context.argTypes);
705
+ return context.argTypes;
706
706
  }
707
707
  const leaf = titleLeaf(context.title);
708
708
  if (leaf) for (const entry of Object.values(data)) {
709
709
  if (!("meta" in entry)) continue;
710
710
  if (titleLeaf(entry.meta.title) !== leaf) continue;
711
711
  const sig = resolveSig(entry);
712
- if (sig) return sortArgTypes(mergeArgTypes(buildArgTypes(sig), context.argTypes));
712
+ if (sig) return mergeArgTypes(buildArgTypes(sig), context.argTypes);
713
713
  }
714
- return sortArgTypes(context.argTypes);
714
+ return context.argTypes;
715
715
  }];
716
716
  const parameters = { docs: {
717
717
  source: {