ember-storybook 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/declarations/client/config.d.ts +13 -1
- package/declarations/client/config.d.ts.map +1 -1
- package/declarations/client/index.d.ts +1 -0
- package/declarations/client/index.d.ts.map +1 -1
- package/declarations/client/outlet-placeholder.d.ts +25 -0
- package/declarations/client/outlet-placeholder.d.ts.map +1 -0
- package/declarations/client/outlet.d.ts +97 -0
- package/declarations/client/outlet.d.ts.map +1 -0
- package/declarations/client/outlet.test.d.ts +2 -0
- package/declarations/client/outlet.test.d.ts.map +1 -0
- package/declarations/client/public-types.d.ts +1 -1
- package/declarations/client/public-types.d.ts.map +1 -1
- package/declarations/client/render-story.d.ts.map +1 -1
- package/declarations/client/render.d.ts.map +1 -1
- package/declarations/client/story-result.d.ts +7 -0
- package/declarations/client/story-result.d.ts.map +1 -1
- package/declarations/client/types.d.ts +49 -0
- package/declarations/client/types.d.ts.map +1 -1
- package/declarations/manager/ember-icon.d.ts +3 -0
- package/declarations/manager/ember-icon.d.ts.map +1 -0
- package/declarations/manager/index.d.ts +2 -0
- package/declarations/manager/index.d.ts.map +1 -0
- package/declarations/node/docgen/docgen.d.ts.map +1 -1
- package/declarations/node/parser.d.ts.map +1 -1
- package/declarations/preset.d.ts +1 -0
- package/declarations/preset.d.ts.map +1 -1
- package/dist/client/config.mjs +18 -2
- package/dist/client/config.mjs.map +1 -1
- package/dist/client/docs/config.mjs +2 -2
- package/dist/client/docs/renderer.mjs +1 -1
- package/dist/client/index.mjs +4 -3
- package/dist/{client-7-bGnBBX.mjs → client-DMN9EyIc.mjs} +9 -6
- package/dist/{client-7-bGnBBX.mjs.map → client-DMN9EyIc.mjs.map} +1 -1
- package/dist/index.mjs +4 -3
- package/dist/manager/index.mjs +82 -0
- package/dist/manager/index.mjs.map +1 -0
- package/dist/outlet-Dc5ySBso.mjs +119 -0
- package/dist/outlet-Dc5ySBso.mjs.map +1 -0
- package/dist/outlet-placeholder-DZpXQLIa.mjs +31 -0
- package/dist/outlet-placeholder-DZpXQLIa.mjs.map +1 -0
- package/dist/preset.mjs +25 -4
- package/dist/preset.mjs.map +1 -1
- package/dist/render-jYhDmzLM.mjs +220 -0
- package/dist/render-jYhDmzLM.mjs.map +1 -0
- package/dist/{story-result-CCx6LMia.mjs → story-result-D9erht0M.mjs} +7 -2
- package/dist/story-result-D9erht0M.mjs.map +1 -0
- package/package.json +5 -1
- package/dist/render-D_vlc6Py.mjs +0 -125
- package/dist/render-D_vlc6Py.mjs.map +0 -1
- package/dist/story-result-CCx6LMia.mjs.map +0 -1
|
@@ -1,5 +1,17 @@
|
|
|
1
|
-
import type { ArgTypesEnhancer, Parameters } from 'storybook/internal/types';
|
|
1
|
+
import type { ArgTypesEnhancer, GlobalTypes, Parameters } from 'storybook/internal/types';
|
|
2
2
|
export { render, renderToCanvas } from './render';
|
|
3
3
|
export declare const parameters: Parameters;
|
|
4
|
+
/**
|
|
5
|
+
* The "Ember" toolbar menu: how a route story should render `{{outlet}}`.
|
|
6
|
+
*
|
|
7
|
+
* `defaultValue` seeds the global (Storybook merges global-type defaults under
|
|
8
|
+
* any project `initialGlobals`), so a project can still change the starting
|
|
9
|
+
* value with `initialGlobals: { outlet: 'placeholder' }`.
|
|
10
|
+
*
|
|
11
|
+
* No `toolbar` here: the menu UI (with the Ember brand icon) is a custom tool
|
|
12
|
+
* in `src/manager`, because Storybook 10 only resolves toolbar icons against
|
|
13
|
+
* its fixed built-in icon map.
|
|
14
|
+
*/
|
|
15
|
+
export declare const globalTypes: GlobalTypes;
|
|
4
16
|
export declare const argTypesEnhancers: ArgTypesEnhancer[];
|
|
5
17
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/client/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/client/config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE1F,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAElD,eAAO,MAAM,UAAU,EAAE,UAKxB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,EAAE,WAKzB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,gBAAgB,EAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,CAAC;AAEnB,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,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"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { TOC } from '@ember/component/template-only';
|
|
2
|
+
interface OutletPlaceholderSignature {
|
|
3
|
+
Element: HTMLDivElement;
|
|
4
|
+
Args: {
|
|
5
|
+
/** Shown inside the box. A route template only receives `@model`. */
|
|
6
|
+
model?: string;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A visible stand-in for `{{outlet}}`, for route stories where an empty hole is
|
|
11
|
+
* hard to see (e.g. on the docs page).
|
|
12
|
+
*
|
|
13
|
+
* It is rendered *as a route template*, so it must be template-only (the outlet
|
|
14
|
+
* only accepts a raw template or an internal-manager component) and the only
|
|
15
|
+
* value it can receive is `@model` — pass a string to label the box:
|
|
16
|
+
*
|
|
17
|
+
* ```js
|
|
18
|
+
* parameters: {
|
|
19
|
+
* ember: { route: { outlet: { template: OutletPlaceholder, model: 'settings' } } }
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare const OutletPlaceholder: TOC<OutletPlaceholderSignature>;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=outlet-placeholder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outlet-placeholder.d.ts","sourceRoot":"","sources":["../../src/client/outlet-placeholder.gts"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAC;AAE1D,UAAU,0BAA0B;IAClC,OAAO,EAAE,cAAc,CAAC;IACxB,IAAI,EAAE;QACJ,qEAAqE;QACrE,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,iBAAiB,EAAE,GAAG,CAAC,0BAA0B,CAe5D,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { OutletMode, OutletStub, RouteParameters } from './types';
|
|
2
|
+
import type ApplicationInstance from '@ember/application/instance';
|
|
3
|
+
/**
|
|
4
|
+
* What Ember's outlet hands a route template. A route template is *not* a
|
|
5
|
+
* component story: it receives exactly `@model` and `@controller`, because that
|
|
6
|
+
* is all `{{outlet}}` passes down (`OUTLET_COMPONENT_TEMPLATE` in ember-source).
|
|
7
|
+
*/
|
|
8
|
+
export interface OutletRenderState {
|
|
9
|
+
owner: object;
|
|
10
|
+
name: string;
|
|
11
|
+
controller: unknown;
|
|
12
|
+
model: unknown;
|
|
13
|
+
template: object;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Mirrors ember-source's internal `OutletState`. The shape is structural, not
|
|
17
|
+
* nominal, so a plain object is accepted by `setOutletState`; the leaf's
|
|
18
|
+
* `outlets.main` is what a nested `{{outlet}}` reads.
|
|
19
|
+
*/
|
|
20
|
+
export interface OutletState {
|
|
21
|
+
render: OutletRenderState;
|
|
22
|
+
outlets: {
|
|
23
|
+
main: OutletState | undefined;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export interface RouteStoryInput {
|
|
27
|
+
/** The route template — the story's `component`. */
|
|
28
|
+
template: object;
|
|
29
|
+
/** `parameters.ember.route`. */
|
|
30
|
+
route: RouteParameters;
|
|
31
|
+
/**
|
|
32
|
+
* The resolved stub for `{{outlet}}` — see {@link resolveOutletStub}.
|
|
33
|
+
* `undefined` leaves the outlet as a hole.
|
|
34
|
+
*/
|
|
35
|
+
outlet?: OutletStub;
|
|
36
|
+
/** Final (decorated) story args; `model`/`controller` feed the route. */
|
|
37
|
+
args: Record<string, unknown>;
|
|
38
|
+
/** Story name, used when `route.name` is not given. */
|
|
39
|
+
storyName: string;
|
|
40
|
+
/** The booted app instance the route renders under. */
|
|
41
|
+
owner: object;
|
|
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
|
+
export interface OutletResolveInput {
|
|
50
|
+
/** `parameters.ember.route` of the story being rendered. */
|
|
51
|
+
route: RouteParameters;
|
|
52
|
+
/** Value of the {@link OUTLET_GLOBAL_KEY} global, if any. */
|
|
53
|
+
mode?: OutletMode;
|
|
54
|
+
/**
|
|
55
|
+
* Produces the stub rendered when the global asks for a visible placeholder.
|
|
56
|
+
* Called lazily (and so may be an async chunk load) and only when needed;
|
|
57
|
+
* injected so this module stays free of Ember-owned template components.
|
|
58
|
+
*/
|
|
59
|
+
placeholder: () => OutletStub | Promise<OutletStub>;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Decides what `{{outlet}}` renders.
|
|
63
|
+
*
|
|
64
|
+
* An explicit `route.outlet` is author intent and always wins, so a story stays
|
|
65
|
+
* deterministic no matter how the toolbar is set. Otherwise the global decides:
|
|
66
|
+
* `placeholder` renders the injected marker, anything else leaves a hole.
|
|
67
|
+
*/
|
|
68
|
+
export declare function resolveOutletStub({ route, mode, placeholder }: OutletResolveInput): Promise<OutletStub | undefined>;
|
|
69
|
+
/**
|
|
70
|
+
* Builds the `OutletState` for a route story.
|
|
71
|
+
*
|
|
72
|
+
* `{{outlet}}` reads its child from Glimmer's *dynamic scope*, which
|
|
73
|
+
* `renderComponent` never populates — so route templates are rendered through
|
|
74
|
+
* Ember's own outlet root instead, and this is the state handed to it. Leaving
|
|
75
|
+
* `outlets.main` undefined is what makes `{{outlet}}` render a hole.
|
|
76
|
+
*/
|
|
77
|
+
export declare function buildRouteOutletState({ template, route, outlet, args, storyName, owner }: RouteStoryInput): OutletState;
|
|
78
|
+
/**
|
|
79
|
+
* Ember's `OutletView` (the router's top-level view), reduced to the surface
|
|
80
|
+
* this module drives. It is only reachable through the container, so the type is
|
|
81
|
+
* declared here rather than imported from `@ember/-internals`.
|
|
82
|
+
*/
|
|
83
|
+
export interface OutletView {
|
|
84
|
+
appendTo(target: HTMLElement): void;
|
|
85
|
+
setOutletState(state: OutletState): void;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Renders `state` into `element` through Ember's outlet root and waits for the
|
|
89
|
+
* render to settle.
|
|
90
|
+
*/
|
|
91
|
+
export declare function mountOutletView(application: ApplicationInstance, state: OutletState, element: HTMLElement): Promise<OutletView>;
|
|
92
|
+
/**
|
|
93
|
+
* Swaps what the outlet renders, in place. This is how the router updates a live
|
|
94
|
+
* route tree, so arg changes do not tear the route's components down.
|
|
95
|
+
*/
|
|
96
|
+
export declare function updateOutletView(view: OutletView, state: OutletState): Promise<void>;
|
|
97
|
+
//# sourceMappingURL=outlet.d.ts.map
|
|
@@ -0,0 +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;AACH,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAE1C,MAAM,WAAW,kBAAkB;IACjC,4DAA4D;IAC5D,KAAK,EAAE,eAAe,CAAC;IACvB,6DAA6D;IAC7D,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;;;OAIG;IACH,WAAW,EAAE,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CACrD;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,EACtC,KAAK,EACL,IAAI,EACJ,WAAW,EACZ,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAMtD;AAsBD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,KAAK,EACL,MAAM,EACN,IAAI,EACJ,SAAS,EACT,KAAK,EACN,EAAE,eAAe,GAAG,WAAW,CAa/B;AAED;;;;GAIG;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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outlet.test.d.ts","sourceRoot":"","sources":["../../src/client/outlet.test.ts"],"names":[],"mappings":""}
|
|
@@ -23,5 +23,5 @@ export type Decorator<TArgs = StrictArgs> = DecoratorFunction<EmberRenderer, TAr
|
|
|
23
23
|
export type Loader<TArgs = StrictArgs> = LoaderFunction<EmberRenderer, TArgs>;
|
|
24
24
|
export type StoryContext<TArgs = StrictArgs> = GenericStoryContext<EmberRenderer, TArgs>;
|
|
25
25
|
export type Preview = ProjectAnnotations<EmberRenderer>;
|
|
26
|
-
export { type EmberRenderer } from './types';
|
|
26
|
+
export { type EmberGlobals, type EmberParameters, type EmberRenderer, type OutletMode, type OutletStub, type RouteParameters } from './types';
|
|
27
27
|
//# sourceMappingURL=public-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-types.d.ts","sourceRoot":"","sources":["../../src/client/public-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EACV,gBAAgB,EAChB,IAAI,EACJ,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,IAAI,mBAAmB,EACnC,UAAU,EACX,MAAM,0BAA0B,CAAC;AAElC,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEvF;;;;GAIG;AACH,MAAM,MAAM,IAAI,CAAC,KAAK,GAAG,IAAI,IAAI,oBAAoB,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;AAE5E;;;;GAIG;AACH,MAAM,MAAM,OAAO,CAAC,KAAK,GAAG,IAAI,IAAI,gBAAgB,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;AAE3E;;;;GAIG;AACH,MAAM,MAAM,QAAQ,CAAC,KAAK,GAAG,IAAI,IAAI,gBAAgB,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;AAE5E,MAAM,MAAM,SAAS,CAAC,KAAK,GAAG,UAAU,IAAI,iBAAiB,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;AACpF,MAAM,MAAM,MAAM,CAAC,KAAK,GAAG,UAAU,IAAI,cAAc,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;AAC9E,MAAM,MAAM,YAAY,CAAC,KAAK,GAAG,UAAU,IAAI,mBAAmB,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;AACzF,MAAM,MAAM,OAAO,GAAG,kBAAkB,CAAC,aAAa,CAAC,CAAC;AAExD,OAAO,
|
|
1
|
+
{"version":3,"file":"public-types.d.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
|
|
|
1
|
-
{"version":3,"file":"render-story.d.ts","sourceRoot":"","sources":["../../src/client/render-story.gts"],"names":[],"mappings":"
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/client/render.ts"],"names":[],"mappings":"
|
|
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,3 +1,4 @@
|
|
|
1
|
+
import type { RouteParameters } from './types';
|
|
1
2
|
type Args = Record<string, unknown>;
|
|
2
3
|
/**
|
|
3
4
|
* Structural shapes of `@ember/application` and `@ember/application/instance`.
|
|
@@ -17,10 +18,15 @@ export type ApplicationInstanceClass = new (...args: never[]) => object;
|
|
|
17
18
|
* args to `render` via `originalStoryFn(args, context)` — but nothing else. To
|
|
18
19
|
* make those args reach `renderToCanvas`, `render` reports them back alongside
|
|
19
20
|
* the component instead of returning a bare component.
|
|
21
|
+
*
|
|
22
|
+
* `route` rides along the same way: it is the only channel by which a story
|
|
23
|
+
* rendered through `<RenderStory>` (which never sees the story context) can learn
|
|
24
|
+
* it is a route story.
|
|
20
25
|
*/
|
|
21
26
|
export interface EmberStoryResult {
|
|
22
27
|
component: object;
|
|
23
28
|
args: Args;
|
|
29
|
+
route?: RouteParameters;
|
|
24
30
|
}
|
|
25
31
|
export declare function isEmberStoryResult(value: unknown): value is EmberStoryResult;
|
|
26
32
|
/**
|
|
@@ -35,6 +41,7 @@ export declare function isEmberStoryResult(value: unknown): value is EmberStoryR
|
|
|
35
41
|
export declare function normalizeStoryResult(result: unknown, fallbackArgs: Args): {
|
|
36
42
|
component: object;
|
|
37
43
|
args: Args;
|
|
44
|
+
route?: RouteParameters;
|
|
38
45
|
};
|
|
39
46
|
export declare function createAppResolver(params: {
|
|
40
47
|
application: ApplicationClass;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"story-result.d.ts","sourceRoot":"","sources":["../../src/client/story-result.ts"],"names":[],"mappings":"AAAA,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEpC;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;QAAE,aAAa,IAAI,MAAM,CAAA;KAAE,CAAC;CACxE;AAED,MAAM,MAAM,wBAAwB,GAAG,KAAK,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,MAAM,CAAC;AAExE
|
|
1
|
+
{"version":3,"file":"story-result.d.ts","sourceRoot":"","sources":["../../src/client/story-result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEpC;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;QAAE,aAAa,IAAI,MAAM,CAAA;KAAE,CAAC;CACxE;AAED,MAAM,MAAM,wBAAwB,GAAG,KAAK,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,MAAM,CAAC;AAExE;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB,CAS5E;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,OAAO,EACf,YAAY,EAAE,IAAI,GACjB;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB,CAMA;AAmBD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE;IACxC,WAAW,EAAE,gBAAgB,CAAC;IAC9B,mBAAmB,EAAE,wBAAwB,CAAC;CAC/C,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE;IAAE,WAAW,EAAE,WAAW,CAAA;CAAE,KAAK,MAAM,CA2CrE"}
|
|
@@ -8,21 +8,70 @@ export interface ShowErrorArgs {
|
|
|
8
8
|
description: string;
|
|
9
9
|
}
|
|
10
10
|
export type AppParamater = typeof Application | ApplicationInstance | ((options?: Record<string, unknown>) => typeof Application | ApplicationInstance);
|
|
11
|
+
/**
|
|
12
|
+
* A single-level stub rendered in place of `{{outlet}}`. Ember has no named
|
|
13
|
+
* outlets anymore, so a route template has exactly one child, and a story stubs
|
|
14
|
+
* precisely that one child — deeper nesting is not modelled.
|
|
15
|
+
*/
|
|
16
|
+
export interface OutletStub {
|
|
17
|
+
/** Route name surfaced in the placeholder label and the debug render tree. */
|
|
18
|
+
name?: string;
|
|
19
|
+
/** Template/component rendered as the child route. Omitted => empty hole. */
|
|
20
|
+
template?: object;
|
|
21
|
+
/** Value passed to the child as `@model`. */
|
|
22
|
+
model?: unknown;
|
|
23
|
+
/** Value passed to the child as `@controller`. */
|
|
24
|
+
controller?: unknown;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Opt-in marker that a story renders a *route* template rather than a component.
|
|
28
|
+
*
|
|
29
|
+
* Route templates receive only `@model` and `@controller` (that is all Ember's
|
|
30
|
+
* outlet hands them), and their `{{outlet}}` is stubbed via {@link OutletStub}.
|
|
31
|
+
*/
|
|
32
|
+
export interface RouteParameters {
|
|
33
|
+
/** Route name for the debug render tree; falls back to the story name. */
|
|
34
|
+
name?: string;
|
|
35
|
+
/** `@model` for the route template; falls back to `args.model`. */
|
|
36
|
+
model?: unknown;
|
|
37
|
+
/** `@controller` for the route template; falls back to `args.controller`. */
|
|
38
|
+
controller?: unknown;
|
|
39
|
+
/** What `{{outlet}}` renders. Omitted => empty hole. */
|
|
40
|
+
outlet?: OutletStub;
|
|
41
|
+
}
|
|
11
42
|
export interface EmberParameters {
|
|
12
43
|
ember?: {
|
|
13
44
|
app?: AppParamater;
|
|
14
45
|
configure?: (app: ApplicationInstance) => void;
|
|
15
46
|
owner?: Record<`${string}:${string}`, object>;
|
|
16
47
|
updateGlobals?: (globals: Record<string, unknown>, owner: Owner) => void;
|
|
48
|
+
/** Present => render through Ember's outlet root so `{{outlet}}` works. */
|
|
49
|
+
route?: RouteParameters;
|
|
17
50
|
};
|
|
18
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* How a route story renders `{{outlet}}`, chosen from the "Ember" toolbar menu.
|
|
54
|
+
*
|
|
55
|
+
* - `hole` (default): nothing renders — like a route with no active child.
|
|
56
|
+
* - `placeholder`: a marker component renders in its place.
|
|
57
|
+
*/
|
|
58
|
+
export type OutletMode = 'hole' | 'placeholder';
|
|
59
|
+
/**
|
|
60
|
+
* Globals the framework contributes. Declared on {@link EmberRenderer} so
|
|
61
|
+
* `initialGlobals` and `context.globals` are typed for consumers.
|
|
62
|
+
*/
|
|
63
|
+
export interface EmberGlobals {
|
|
64
|
+
outlet?: OutletMode;
|
|
65
|
+
}
|
|
19
66
|
export interface EmberRenderer extends WebRenderer {
|
|
20
67
|
component: object;
|
|
21
68
|
storyResult: object;
|
|
22
69
|
csf4: true;
|
|
23
70
|
parameters: EmberParameters;
|
|
71
|
+
globals: EmberGlobals;
|
|
24
72
|
}
|
|
25
73
|
export type StoryContext = DefaultStoryContext<EmberRenderer> & {
|
|
26
74
|
parameters: DefaultStoryContext<EmberRenderer>['parameters'] & EmberParameters;
|
|
75
|
+
globals: DefaultStoryContext<EmberRenderer>['globals'] & EmberGlobals;
|
|
27
76
|
};
|
|
28
77
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -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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;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 @@
|
|
|
1
|
+
{"version":3,"file":"ember-icon.d.ts","sourceRoot":"","sources":["../../src/manager/ember-icon.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAkBtC,wBAAgB,SAAS,CAAC,KAAK,EAAE,QAAQ,CAAC,aAAa,CAAC,mCAYvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/manager/index.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docgen.d.ts","sourceRoot":"","sources":["../../../src/node/docgen/docgen.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAyC1D,wBAAsB,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,
|
|
1
|
+
{"version":3,"file":"docgen.d.ts","sourceRoot":"","sources":["../../../src/node/docgen/docgen.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAyC1D,wBAAsB,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA+BtF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/node/parser.ts"],"names":[],"mappings":"AAKA,OAAO,EAAW,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE1F,OAAO,EAAW,KAAK,YAAY,EAAqB,MA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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,CAwHvE"}
|
package/declarations/preset.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { type StorybookConfigVite } from '@storybook/builder-vite';
|
|
|
2
2
|
import type { StorybookConfig } from './types';
|
|
3
3
|
import type { PresetProperty } from 'storybook/internal/types';
|
|
4
4
|
export declare const previewAnnotations: PresetProperty<'previewAnnotations'>;
|
|
5
|
+
export declare const managerEntries: (entries?: string[]) => string[];
|
|
5
6
|
export declare const viteFinal: StorybookConfigVite['viteFinal'];
|
|
6
7
|
export declare const experimental_indexers: StorybookConfig['experimental_indexers'];
|
|
7
8
|
export declare const core: PresetProperty<'core'>;
|
|
@@ -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;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;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"}
|
package/dist/client/config.mjs
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
|
-
import { n as renderToCanvas, t as render } from "../render-
|
|
1
|
+
import { n as renderToCanvas, t as render } from "../render-jYhDmzLM.mjs";
|
|
2
|
+
import { t as OUTLET_GLOBAL_KEY } from "../outlet-Dc5ySBso.mjs";
|
|
2
3
|
import { enhanceArgTypes } from "storybook/internal/docs-tools";
|
|
3
4
|
//#region src/client/config.ts
|
|
4
5
|
const parameters = {
|
|
5
6
|
renderer: "ember",
|
|
6
7
|
docs: { story: { inline: true } }
|
|
7
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
|
+
} };
|
|
8
24
|
const argTypesEnhancers = [enhanceArgTypes];
|
|
9
25
|
//#endregion
|
|
10
|
-
export { argTypesEnhancers, parameters, render, renderToCanvas };
|
|
26
|
+
export { argTypesEnhancers, globalTypes, parameters, render, renderToCanvas };
|
|
11
27
|
|
|
12
28
|
//# sourceMappingURL=config.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.mjs","names":["enhanceArgTypes","render","renderToCanvas","parameters","renderer","docs","story","inline","argTypesEnhancers"],"sources":["../../src/client/config.ts"],"sourcesContent":["import { enhanceArgTypes } from 'storybook/internal/docs-tools';\n\nimport type { ArgTypesEnhancer, 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\nexport const argTypesEnhancers: ArgTypesEnhancer[] = [enhanceArgTypes];\n"],"mappings":"
|
|
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,10 +1,10 @@
|
|
|
1
|
-
import { n as isEmberStoryResult } from "../../story-result-
|
|
1
|
+
import { n as isEmberStoryResult } from "../../story-result-D9erht0M.mjs";
|
|
2
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
|
+
import { Fragment, createElement, useContext } from "react";
|
|
5
6
|
import emberData from "virtual:ember-storybook";
|
|
6
7
|
import { Controls, Description, DocsContext, Heading, Primary, PureArgsTable, Stories, Subheading, Subtitle, Title, useOf } from "@storybook/addon-docs/blocks";
|
|
7
|
-
import { Fragment, createElement, useContext } from "react";
|
|
8
8
|
import { NAVIGATE_URL } from "storybook/internal/core-events";
|
|
9
9
|
import { styled } from "storybook/theming";
|
|
10
10
|
//#region src/client/docs/extractArgTypes.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnchorMdx, CodeOrSourceMdx, Docs, HeadersMdx } from "@storybook/addon-docs/blocks";
|
|
2
1
|
import { Component, createElement } from "react";
|
|
2
|
+
import { AnchorMdx, CodeOrSourceMdx, Docs, HeadersMdx } from "@storybook/addon-docs/blocks";
|
|
3
3
|
import { renderElement, unmountElement } from "@storybook/react-dom-shim";
|
|
4
4
|
//#region src/client/docs/renderer.ts
|
|
5
5
|
const defaultComponents = {
|
package/dist/client/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { n as renderToCanvas } from "../render-
|
|
2
|
-
import { n as setProjectAnnotations, t as RenderStory } from "../client-
|
|
3
|
-
|
|
1
|
+
import { n as renderToCanvas } from "../render-jYhDmzLM.mjs";
|
|
2
|
+
import { n as setProjectAnnotations, t as RenderStory } from "../client-DMN9EyIc.mjs";
|
|
3
|
+
import { t as OutletPlaceholder } from "../outlet-placeholder-DZpXQLIa.mjs";
|
|
4
|
+
export { OutletPlaceholder, RenderStory, renderToCanvas, setProjectAnnotations };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { r as render_exports } from "./render-
|
|
2
|
-
import
|
|
1
|
+
import { r as render_exports } from "./render-jYhDmzLM.mjs";
|
|
2
|
+
import "./outlet-placeholder-DZpXQLIa.mjs";
|
|
3
|
+
import { r as normalizeStoryResult } from "./story-result-D9erht0M.mjs";
|
|
4
|
+
import { template } from "@ember/template-compiler";
|
|
3
5
|
import { setDefaultProjectAnnotations, setProjectAnnotations } from "storybook/preview-api";
|
|
4
6
|
import { renderComponent } from "@ember/renderer";
|
|
5
|
-
import { template } from "@ember/template-compiler";
|
|
6
7
|
import Component from "@glimmer/component";
|
|
7
8
|
import { getOwner } from "@ember/owner";
|
|
8
9
|
import { modifier } from "ember-modifier";
|
|
@@ -37,11 +38,13 @@ function setProjectAnnotations$1(projectAnnotations) {
|
|
|
37
38
|
//#region src/client/render-story.gts
|
|
38
39
|
var RenderStory = class extends Component {
|
|
39
40
|
render = modifier((element) => {
|
|
40
|
-
const { component, args } = normalizeStoryResult(this.args.story(), this.args.args);
|
|
41
|
+
const { component, args, route } = normalizeStoryResult(this.args.story(), this.args.args);
|
|
42
|
+
const owner = getOwner(this);
|
|
43
|
+
if (route) throw new Error("ember-storybook: this story sets `parameters.ember.route`, but route stories can only be rendered by `renderToCanvas`, not through <RenderStory> (portable stories).");
|
|
41
44
|
const result = renderComponent(component, {
|
|
42
45
|
args,
|
|
43
46
|
into: element,
|
|
44
|
-
owner
|
|
47
|
+
owner
|
|
45
48
|
});
|
|
46
49
|
return () => {
|
|
47
50
|
result.destroy();
|
|
@@ -59,4 +62,4 @@ var RenderStory = class extends Component {
|
|
|
59
62
|
//#endregion
|
|
60
63
|
export { setProjectAnnotations$1 as n, RenderStory as t };
|
|
61
64
|
|
|
62
|
-
//# sourceMappingURL=client-
|
|
65
|
+
//# sourceMappingURL=client-DMN9EyIc.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-
|
|
1
|
+
{"version":3,"file":"client-DMN9EyIc.mjs","names":["globalThis","STORYBOOK_ENV","setDefaultProjectAnnotations","setProjectAnnotations","originalSetProjectAnnotations","INTERNAL_DEFAULT_PROJECT_ANNOTATIONS","projectAnnotations"],"sources":["../src/client/globals.ts","../src/client/portable-stories.ts","../src/client/render-story.gts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\n// eslint-disable-next-line unicorn/no-global-object-property-assignment\nglobalThis.STORYBOOK_ENV = 'ember';\n","import {\n setDefaultProjectAnnotations,\n setProjectAnnotations as originalSetProjectAnnotations\n} from 'storybook/preview-api';\n\nimport * as INTERNAL_DEFAULT_PROJECT_ANNOTATIONS from './render';\n\nimport type { EmberRenderer } from './types';\nimport type {\n NamedOrDefaultProjectAnnotations,\n NormalizedProjectAnnotations\n} from 'storybook/internal/types';\n\n/**\n * Function that sets the globalConfig of your storybook. The global config is the preview module of\n * your .storybook folder.\n *\n * It should be run a single time, so that your global config (e.g. decorators) is applied to your\n * stories when using `composeStories` or `composeStory`.\n *\n * Example:\n *\n * ```jsx\n * // setup-file.js\n * import { setProjectAnnotations } from '@storybook/preact';\n * import projectAnnotations from './.storybook/preview';\n *\n * setProjectAnnotations(projectAnnotations);\n * ```\n *\n * @param projectAnnotations - E.g. (import projectAnnotations from '../.storybook/preview')\n */\nexport function setProjectAnnotations(\n projectAnnotations:\n | NamedOrDefaultProjectAnnotations<EmberRenderer>\n | NamedOrDefaultProjectAnnotations<EmberRenderer>[]\n): NormalizedProjectAnnotations<EmberRenderer> {\n setDefaultProjectAnnotations(INTERNAL_DEFAULT_PROJECT_ANNOTATIONS);\n\n return originalSetProjectAnnotations(projectAnnotations);\n}\n","import Component from '@glimmer/component';\nimport { getOwner } from '@ember/owner';\nimport { renderComponent } from '@ember/renderer';\n\nimport { modifier } from 'ember-modifier';\n\nimport { normalizeStoryResult } from './story-result';\n\ninterface RenderStorySignature {\n Args: {\n story: () => object;\n args: Record<string, unknown>;\n };\n Element: HTMLDivElement;\n}\n\nexport class RenderStory extends Component<RenderStorySignature> {\n render = modifier((element: HTMLDivElement) => {\n const story = this.args.story();\n const { component, args, route } = normalizeStoryResult(story, this.args.args);\n const owner = getOwner(this);\n\n if (route) {\n // `{{outlet}}` is resolved from Glimmer's dynamic scope, which only a root\n // render can seed. Rendering it in here would nest a second outlet root\n // inside an already-rendering tree, so route stories are canvas-only.\n throw new Error(\n 'ember-storybook: this story sets `parameters.ember.route`, but route stories ' +\n 'can only be rendered by `renderToCanvas`, not through <RenderStory> ' +\n '(portable stories).'\n );\n }\n\n const result = renderComponent(component, {\n args,\n into: element,\n owner\n });\n\n return () => {\n result.destroy();\n };\n });\n\n <template>\n <div {{this.render}}></div>\n </template>\n}\n"],"mappings":";;;;;;;;;;AAGAA,WAAWC,gBAAgB;;;;;;;;;;;;;;;;;;;;;;AC6B3B,SAAgBE,wBACdG,oBAG6C;CAC7CJ,6BAA6BG,cAAoC;CAEjE,OAAOD,sBAA8BE,kBAAkB;AACzD;;;ACxBA,IAAa,cAAb,cAAiC,UAAU;CACzC,SAAS,UAAU,YAAS;EAE1B,MAAM,EAAE,WAAW,MAAM,UAAU,qBADrB,KAAK,KAAK,MACgC,GAAO,KAAK,KAAK,IAAI;EAC7E,MAAM,QAAQ,SAAS,IAAI;EAE3B,IAAI,OAIF,MAAM,IAAI,MACR,sKAEE;EAIN,MAAM,SAAS,gBAAgB,WAAW;GACxC;GACA,MAAM;GACN;EACF,CAAA;EAEA,aAAO;GACL,OAAO,QAAO;EAChB;CACF,CAAA;CAEA;EAAA,SAAU,+BAEV;GAAA,WAAA;GAAA,OAAA;IAAA,OAAA,KAAA,UAAA,EAAW;GAAD;EAAA,CAAA;CAAA;AACZ"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { n as renderToCanvas } from "./render-
|
|
2
|
-
import { n as setProjectAnnotations, t as RenderStory } from "./client-
|
|
3
|
-
|
|
1
|
+
import { n as renderToCanvas } from "./render-jYhDmzLM.mjs";
|
|
2
|
+
import { n as setProjectAnnotations, t as RenderStory } from "./client-DMN9EyIc.mjs";
|
|
3
|
+
import { t as OutletPlaceholder } from "./outlet-placeholder-DZpXQLIa.mjs";
|
|
4
|
+
export { OutletPlaceholder, RenderStory, renderToCanvas, setProjectAnnotations };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { t as OUTLET_GLOBAL_KEY } from "../outlet-Dc5ySBso.mjs";
|
|
2
|
+
import { createElement } from "react";
|
|
3
|
+
import { Select } from "storybook/internal/components";
|
|
4
|
+
import { addons, types, useGlobals } from "storybook/manager-api";
|
|
5
|
+
//#region src/manager/ember-icon.ts
|
|
6
|
+
/**
|
|
7
|
+
* The Ember "e-circle" brand icon, embedding the markup from
|
|
8
|
+
* https://github.com/ember-learn/ember-website/blob/main/public/images/brand/Ember%20Logos/Icon/e-circle-icon-4c.svg
|
|
9
|
+
*
|
|
10
|
+
* Storybook 10 resolves toolbar `icon` strings against a fixed manager-side
|
|
11
|
+
* map, so a custom brand icon has to be a React element rendered by our own
|
|
12
|
+
* toolbar tool. The fills are hardcoded brand colors on purpose: unlike
|
|
13
|
+
* Storybook's monochrome icons this one must keep its red/white identity.
|
|
14
|
+
*/
|
|
15
|
+
const EMBER_ICON_MARKUP = `
|
|
16
|
+
<g fill="none" fill-rule="evenodd">
|
|
17
|
+
<path d="M64 0c35.346 0 64 28.654 64 64 0 35.346-28.654 64-64 64-35.346 0-64-28.654-64-64C0 28.654 28.654 0 64 0z" fill="#E05C43" fill-rule="nonzero"/>
|
|
18
|
+
<path d="M65.265 24.128c8.246-.163 14.073 2.073 19.087 9.19 10.934 27.109-28.147 41.1-29.714 41.65l-.049.016s-1.18 7.363 10.028 7.08c13.793 0 28.294-10.691 33.81-15.21a3.293 3.293 0 0 1 4.468.265l4.13 4.29a3.291 3.291 0 0 1 .085 4.491c-3.59 3.997-12.014 12.203-24.696 17.504 0 0-21.16 9.798-35.42.52-8.503-5.53-10.842-12.151-11.793-19.038.005 0-10.324-.524-16.957-3.114-6.635-2.592.049-10.411.049-10.411s2.04-3.233 5.92 0c3.883 3.228 11.13 1.772 11.13 1.772.646-5.099 1.72-11.828 4.884-18.93 6.632-14.885 16.789-19.915 25.038-20.075zm4.853 14.915c-4.369-4.21-16.984 4.202-17.471 23.45 0 0 3.724 1.134 11.97-4.53 8.25-5.661 9.87-14.718 5.501-18.92z" fill="#FFFFFF"/>
|
|
19
|
+
</g>
|
|
20
|
+
`;
|
|
21
|
+
function EmberIcon(props) {
|
|
22
|
+
return createElement("svg", {
|
|
23
|
+
width: 14,
|
|
24
|
+
height: 14,
|
|
25
|
+
viewBox: "0 0 128 128",
|
|
26
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
27
|
+
style: {
|
|
28
|
+
display: "inline-block",
|
|
29
|
+
verticalAlign: "middle"
|
|
30
|
+
},
|
|
31
|
+
"aria-hidden": true,
|
|
32
|
+
...props,
|
|
33
|
+
dangerouslySetInnerHTML: { __html: EMBER_ICON_MARKUP }
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/manager/index.ts
|
|
38
|
+
/**
|
|
39
|
+
* The "Ember" toolbar menu: how a route story should render `{{outlet}}`.
|
|
40
|
+
*
|
|
41
|
+
* Registered as a custom tool (not `globalTypes.toolbar`) because Storybook 10
|
|
42
|
+
* resolves toolbar `icon` strings against a fixed manager-side icon map — the
|
|
43
|
+
* Ember brand icon can only be supplied through a tool's own `render`. The
|
|
44
|
+
* value still lives in globals (see `globalTypes` in `client/config.ts`), so
|
|
45
|
+
* the renderer and `initialGlobals` keep working unchanged.
|
|
46
|
+
*/
|
|
47
|
+
const ADDON_ID = "ember-storybook";
|
|
48
|
+
const TITLE = "Ember";
|
|
49
|
+
const DESCRIPTION = "How a route story renders {{outlet}}";
|
|
50
|
+
const OUTLET_ITEMS = [{
|
|
51
|
+
value: "hole",
|
|
52
|
+
title: "Hole"
|
|
53
|
+
}, {
|
|
54
|
+
value: "placeholder",
|
|
55
|
+
title: "Placeholder"
|
|
56
|
+
}];
|
|
57
|
+
function OutletToolbar() {
|
|
58
|
+
const [globals, updateGlobals, storyGlobals] = useGlobals();
|
|
59
|
+
return createElement(Select, {
|
|
60
|
+
defaultOptions: [globals[OUTLET_GLOBAL_KEY]],
|
|
61
|
+
options: OUTLET_ITEMS,
|
|
62
|
+
disabled: storyGlobals[OUTLET_GLOBAL_KEY] !== void 0,
|
|
63
|
+
ariaLabel: TITLE,
|
|
64
|
+
tooltip: DESCRIPTION,
|
|
65
|
+
onSelect: (selected) => {
|
|
66
|
+
updateGlobals({ [OUTLET_GLOBAL_KEY]: selected });
|
|
67
|
+
},
|
|
68
|
+
icon: createElement(EmberIcon),
|
|
69
|
+
showSelectedOptionTitle: false
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
addons.register(ADDON_ID, () => {
|
|
73
|
+
addons.add(`${ADDON_ID}/outlet-toolbar`, {
|
|
74
|
+
type: types.TOOL,
|
|
75
|
+
title: TITLE,
|
|
76
|
+
render: () => createElement(OutletToolbar)
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
//#endregion
|
|
80
|
+
export {};
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["createElement","EMBER_ICON_MARKUP","EmberIcon","props","width","height","viewBox","xmlns","style","display","verticalAlign","dangerouslySetInnerHTML","__html","createElement","Select","addons","types","useGlobals","OUTLET_GLOBAL_KEY","EmberIcon","ADDON_ID","TITLE","DESCRIPTION","OUTLET_ITEMS","value","title","OutletToolbar","globals","updateGlobals","storyGlobals","defaultOptions","options","disabled","undefined","ariaLabel","tooltip","onSelect","selected","icon","showSelectedOptionTitle","register","add","type","TOOL","render"],"sources":["../../src/manager/ember-icon.ts","../../src/manager/index.ts"],"sourcesContent":["import { createElement } from 'react';\n\nimport type { SVGProps } from 'react';\n\n/**\n * The Ember \"e-circle\" brand icon, embedding the markup from\n * https://github.com/ember-learn/ember-website/blob/main/public/images/brand/Ember%20Logos/Icon/e-circle-icon-4c.svg\n *\n * Storybook 10 resolves toolbar `icon` strings against a fixed manager-side\n * map, so a custom brand icon has to be a React element rendered by our own\n * toolbar tool. The fills are hardcoded brand colors on purpose: unlike\n * Storybook's monochrome icons this one must keep its red/white identity.\n */\nconst EMBER_ICON_MARKUP = `\n <g fill=\"none\" fill-rule=\"evenodd\">\n <path d=\"M64 0c35.346 0 64 28.654 64 64 0 35.346-28.654 64-64 64-35.346 0-64-28.654-64-64C0 28.654 28.654 0 64 0z\" fill=\"#E05C43\" fill-rule=\"nonzero\"/>\n <path d=\"M65.265 24.128c8.246-.163 14.073 2.073 19.087 9.19 10.934 27.109-28.147 41.1-29.714 41.65l-.049.016s-1.18 7.363 10.028 7.08c13.793 0 28.294-10.691 33.81-15.21a3.293 3.293 0 0 1 4.468.265l4.13 4.29a3.291 3.291 0 0 1 .085 4.491c-3.59 3.997-12.014 12.203-24.696 17.504 0 0-21.16 9.798-35.42.52-8.503-5.53-10.842-12.151-11.793-19.038.005 0-10.324-.524-16.957-3.114-6.635-2.592.049-10.411.049-10.411s2.04-3.233 5.92 0c3.883 3.228 11.13 1.772 11.13 1.772.646-5.099 1.72-11.828 4.884-18.93 6.632-14.885 16.789-19.915 25.038-20.075zm4.853 14.915c-4.369-4.21-16.984 4.202-17.471 23.45 0 0 3.724 1.134 11.97-4.53 8.25-5.661 9.87-14.718 5.501-18.92z\" fill=\"#FFFFFF\"/>\n </g>\n`;\n\nexport function EmberIcon(props: SVGProps<SVGSVGElement>) {\n return createElement('svg', {\n width: 14,\n height: 14,\n viewBox: '0 0 128 128',\n xmlns: 'http://www.w3.org/2000/svg',\n style: { display: 'inline-block', verticalAlign: 'middle' },\n 'aria-hidden': true,\n ...props,\n // The markup mirrors the upstream brand asset; static, first-party content.\n dangerouslySetInnerHTML: { __html: EMBER_ICON_MARKUP }\n });\n}\n","import { createElement } from 'react';\nimport { Select } from 'storybook/internal/components';\nimport { addons, types, useGlobals } from 'storybook/manager-api';\n\nimport { OUTLET_GLOBAL_KEY } from '../client/outlet';\nimport { EmberIcon } from './ember-icon';\n\nimport type { OutletMode } from '../client/types';\n\n/**\n * The \"Ember\" toolbar menu: how a route story should render `{{outlet}}`.\n *\n * Registered as a custom tool (not `globalTypes.toolbar`) because Storybook 10\n * resolves toolbar `icon` strings against a fixed manager-side icon map — the\n * Ember brand icon can only be supplied through a tool's own `render`. The\n * value still lives in globals (see `globalTypes` in `client/config.ts`), so\n * the renderer and `initialGlobals` keep working unchanged.\n */\nconst ADDON_ID = 'ember-storybook';\n\nconst TITLE = 'Ember';\nconst DESCRIPTION = 'How a route story renders {{outlet}}';\n\nconst OUTLET_ITEMS: { value: OutletMode; title: string }[] = [\n { value: 'hole', title: 'Hole' },\n { value: 'placeholder', title: 'Placeholder' }\n];\n\nfunction OutletToolbar() {\n const [globals, updateGlobals, storyGlobals] = useGlobals();\n\n return createElement(Select, {\n defaultOptions: [globals[OUTLET_GLOBAL_KEY]],\n options: OUTLET_ITEMS,\n // A story-level global override wins; don't let the toolbar fight it.\n disabled: storyGlobals[OUTLET_GLOBAL_KEY] !== undefined,\n ariaLabel: TITLE,\n tooltip: DESCRIPTION,\n onSelect: (selected: unknown) => {\n updateGlobals({ [OUTLET_GLOBAL_KEY]: selected });\n },\n icon: createElement(EmberIcon),\n // Icon-only trigger, like Storybook's own toolbar items (backgrounds,\n // viewport, …): never swap in the selected item's title (\"Hole\").\n showSelectedOptionTitle: false\n });\n}\n\naddons.register(ADDON_ID, () => {\n addons.add(`${ADDON_ID}/outlet-toolbar`, {\n type: types.TOOL,\n title: TITLE,\n render: () => createElement(OutletToolbar)\n });\n});\n"],"mappings":";;;;;;;;;;;;;;AAaA,MAAMC,oBAAoB;;;;;;AAO1B,SAAgBC,UAAUC,OAAgC;CACxD,OAAOH,cAAc,OAAO;EAC1BI,OAAO;EACPC,QAAQ;EACRC,SAAS;EACTC,OAAO;EACPC,OAAO;GAAEC,SAAS;GAAgBC,eAAe;EAAS;EAC1D,eAAe;EACf,GAAGP;EAEHQ,yBAAyB,EAAEC,QAAQX,kBAAkB;CACvD,CAAC;AACH;;;;;;;;;;;;ACdA,MAAMmB,WAAW;AAEjB,MAAMC,QAAQ;AACd,MAAMC,cAAc;AAEpB,MAAMC,eAAuD,CAC3D;CAAEC,OAAO;CAAQC,OAAO;AAAO,GAC/B;CAAED,OAAO;CAAeC,OAAO;AAAc,CAAC;AAGhD,SAASC,gBAAgB;CACvB,MAAM,CAACC,SAASC,eAAeC,gBAAgBZ,WAAW;CAE1D,OAAOJ,cAAcC,QAAQ;EAC3BgB,gBAAgB,CAACH,QAAQT,kBAAkB;EAC3Ca,SAASR;EAETS,UAAUH,aAAaX,uBAAuBe,KAAAA;EAC9CC,WAAWb;EACXc,SAASb;EACTc,WAAWC,aAAsB;GAC/BT,cAAc,GAAGV,oBAAoBmB,SAAS,CAAC;EACjD;EACAC,MAAMzB,cAAcM,SAAS;EAG7BoB,yBAAyB;CAC3B,CAAC;AACH;AAEAxB,OAAOyB,SAASpB,gBAAgB;CAC9BL,OAAO0B,IAAI,GAAGrB,SAAQ,kBAAmB;EACvCsB,MAAM1B,MAAM2B;EACZlB,OAAOJ;EACPuB,cAAc/B,cAAca,aAAa;CAC3C,CAAC;AACH,CAAC"}
|