storybook 9.0.0-alpha.5 → 9.0.0-alpha.6
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/dist/bin/index.cjs +63 -63
- package/dist/bin/index.js +63 -63
- package/dist/builder-manager/index.cjs +253 -280
- package/dist/builder-manager/index.js +305 -332
- package/dist/cli/bin/index.cjs +1 -1
- package/dist/cli/bin/index.js +1 -1
- package/dist/common/index.cjs +63 -63
- package/dist/common/index.js +63 -63
- package/dist/components/index.cjs +2102 -2069
- package/dist/components/index.js +2311 -2278
- package/dist/core-server/index.cjs +10687 -10447
- package/dist/core-server/index.d.ts +55 -2
- package/dist/core-server/index.js +10824 -10590
- package/dist/core-server/presets/common-preset.cjs +59 -59
- package/dist/core-server/presets/common-preset.js +57 -57
- package/dist/csf/index.d.ts +1 -1
- package/dist/instrumenter/index.cjs +2 -2
- package/dist/instrumenter/index.js +2 -2
- package/dist/manager/globals-module-info.cjs +12 -4
- package/dist/manager/globals-module-info.js +10 -2
- package/dist/manager/globals-runtime.js +19573 -19104
- package/dist/manager/runtime.js +3254 -3190
- package/dist/manager-api/index.cjs +3627 -3368
- package/dist/manager-api/index.d.ts +57 -18
- package/dist/manager-api/index.js +3182 -2962
- package/dist/manager-errors.d.ts +25 -1
- package/dist/manager-errors.js +42 -26
- package/dist/preview/runtime.js +8055 -7823
- package/dist/preview-api/index.cjs +1234 -1683
- package/dist/preview-api/index.d.ts +69 -376
- package/dist/preview-api/index.js +1360 -1785
- package/dist/preview-errors.cjs +98 -81
- package/dist/preview-errors.d.ts +25 -1
- package/dist/preview-errors.js +109 -93
- package/dist/server-errors.cjs +92 -75
- package/dist/server-errors.d.ts +25 -1
- package/dist/server-errors.js +83 -66
- package/dist/test/index.cjs +6697 -6432
- package/dist/test/index.js +6069 -5804
- package/dist/types/index.d.ts +27 -13
- package/package.json +6 -6
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Channel } from 'storybook/internal/channels';
|
|
2
2
|
import * as storybook_internal_types from 'storybook/internal/types';
|
|
3
3
|
import { ProjectAnnotations as ProjectAnnotations$1, Renderer as Renderer$1, Args, StoryContext, DecoratorApplicator, StoryId, Addon_StoryWrapper, PreparedStory, Globals, GlobalTypes, StoryIndex, StoryName, ComponentTitle, IndexEntry, Path, LegacyStoryAnnotationsOrFn, NormalizedComponentAnnotations, NormalizedStoryAnnotations, ModuleExports, CSFFile, NormalizedProjectAnnotations as NormalizedProjectAnnotations$1, ModuleExport, PreparedMeta, StepRunner, ComposedStoryFn, Store_CSFExports, ComposeStoryFn, ComponentAnnotations, NamedOrDefaultProjectAnnotations, ModuleImportFn, Parameters, StoryContextForEnhancers, StoryIndexV3, BoundStory, StrictArgTypes, ArgTypesEnhancer, LegacyStoryFn, DecoratorFunction, PartialStoryFn, StoryContextUpdate, NormalizedStoriesSpecifier, Addon_StorySortParameterV7, DocsContextProps, ResolvedModuleExportType, ResolvedModuleExportFromType, StoryRenderOptions, RenderContextCallbacks, RenderToCanvas as RenderToCanvas$1, ViewMode } from 'storybook/internal/types';
|
|
4
|
-
import * as storybook_internal_csf from 'storybook/internal/csf';
|
|
5
4
|
import { CleanupCallback, Canvas, Renderer as Renderer$2, ProjectAnnotations as ProjectAnnotations$2, StoryIdentifier, StoryContext as StoryContext$1, PartialStoryFn as PartialStoryFn$1, LegacyStoryFn as LegacyStoryFn$1, StrictArgTypes as StrictArgTypes$1, StrictGlobalTypes, DecoratorFunction as DecoratorFunction$1, LoaderFunction, StepRunner as StepRunner$1, BeforeAll } from 'storybook/internal/csf';
|
|
6
5
|
import { RequestData, ArgTypesRequestPayload } from 'storybook/internal/core-events';
|
|
7
6
|
|
|
@@ -178,11 +177,11 @@ declare function useReducer<S, I, A>(reducer: (state: S, action: A) => S, initia
|
|
|
178
177
|
* @returns {void}
|
|
179
178
|
*/
|
|
180
179
|
declare function useEffect(create: () => (() => void) | void, deps?: any[]): void;
|
|
181
|
-
interface Listener
|
|
180
|
+
interface Listener {
|
|
182
181
|
(...args: any[]): void;
|
|
183
182
|
}
|
|
184
183
|
interface EventMap {
|
|
185
|
-
[eventId: string]: Listener
|
|
184
|
+
[eventId: string]: Listener;
|
|
186
185
|
}
|
|
187
186
|
/**
|
|
188
187
|
* Subscribes to events emitted by the Storybook channel and returns a function to emit events.
|
|
@@ -312,312 +311,6 @@ declare const makeDecorator: ({ name, parameterName, wrapper, skipIfNoParameters
|
|
|
312
311
|
|
|
313
312
|
declare function mockChannel(): Channel;
|
|
314
313
|
|
|
315
|
-
type EnvironmentType = (typeof UniversalStore.Environment)[keyof typeof UniversalStore.Environment];
|
|
316
|
-
type StatusType = (typeof UniversalStore.Status)[keyof typeof UniversalStore.Status];
|
|
317
|
-
type StateUpdater<TState> = (prevState: TState) => TState;
|
|
318
|
-
type Actor = {
|
|
319
|
-
id: string;
|
|
320
|
-
type: (typeof UniversalStore.ActorType)[keyof typeof UniversalStore.ActorType];
|
|
321
|
-
environment: EnvironmentType;
|
|
322
|
-
};
|
|
323
|
-
type EventInfo = {
|
|
324
|
-
actor: Actor;
|
|
325
|
-
forwardingActor?: Actor;
|
|
326
|
-
};
|
|
327
|
-
type Listener<TEvent> = (event: TEvent, eventInfo: EventInfo) => void;
|
|
328
|
-
type BaseEvent = {
|
|
329
|
-
type: string;
|
|
330
|
-
payload?: any;
|
|
331
|
-
};
|
|
332
|
-
interface SetStateEvent<TState> extends BaseEvent {
|
|
333
|
-
type: typeof UniversalStore.InternalEventType.SET_STATE;
|
|
334
|
-
payload: {
|
|
335
|
-
state: TState;
|
|
336
|
-
previousState: TState;
|
|
337
|
-
};
|
|
338
|
-
}
|
|
339
|
-
interface ExistingStateRequestEvent extends BaseEvent {
|
|
340
|
-
type: typeof UniversalStore.InternalEventType.EXISTING_STATE_REQUEST;
|
|
341
|
-
payload: never;
|
|
342
|
-
}
|
|
343
|
-
interface ExistingStateResponseEvent<TState> extends BaseEvent {
|
|
344
|
-
type: typeof UniversalStore.InternalEventType.EXISTING_STATE_RESPONSE;
|
|
345
|
-
payload: TState;
|
|
346
|
-
}
|
|
347
|
-
interface LeaderCreatedEvent extends BaseEvent {
|
|
348
|
-
type: typeof UniversalStore.InternalEventType.LEADER_CREATED;
|
|
349
|
-
payload: never;
|
|
350
|
-
}
|
|
351
|
-
interface FollowerCreatedEvent extends BaseEvent {
|
|
352
|
-
type: typeof UniversalStore.InternalEventType.FOLLOWER_CREATED;
|
|
353
|
-
payload: never;
|
|
354
|
-
}
|
|
355
|
-
type InternalEvent<TState> = SetStateEvent<TState> | ExistingStateRequestEvent | ExistingStateResponseEvent<TState> | FollowerCreatedEvent | LeaderCreatedEvent;
|
|
356
|
-
type Event<TState, TEvent extends BaseEvent> = TEvent | InternalEvent<TState>;
|
|
357
|
-
type ChannelLike = Pick<Channel, 'on' | 'off' | 'emit'>;
|
|
358
|
-
type StoreOptions<TState> = {
|
|
359
|
-
id: string;
|
|
360
|
-
leader?: boolean;
|
|
361
|
-
initialState?: TState;
|
|
362
|
-
debug?: boolean;
|
|
363
|
-
};
|
|
364
|
-
type EnvironmentOverrides = {
|
|
365
|
-
channel: ChannelLike;
|
|
366
|
-
environment: EnvironmentType;
|
|
367
|
-
};
|
|
368
|
-
|
|
369
|
-
/**
|
|
370
|
-
* A universal store implementation that synchronizes state across different environments using a
|
|
371
|
-
* channel-based communication.
|
|
372
|
-
*
|
|
373
|
-
* The store follows a leader-follower pattern where:
|
|
374
|
-
*
|
|
375
|
-
* - Leader: The main store instance that owns and manages the state
|
|
376
|
-
* - Follower: Store instances that mirror the leader's state
|
|
377
|
-
*
|
|
378
|
-
* Features:
|
|
379
|
-
*
|
|
380
|
-
* - State synchronization across environments
|
|
381
|
-
* - Event-based communication
|
|
382
|
-
* - Type-safe state and custom events
|
|
383
|
-
* - Subscription system for state changes and custom events
|
|
384
|
-
*
|
|
385
|
-
* @remarks
|
|
386
|
-
* - The store must be created using the static `create()` method, not the constructor
|
|
387
|
-
* - Follower stores will automatically sync with their leader's state. If they have initial state, it
|
|
388
|
-
* will be replaced immediately when it has synced with the leader.
|
|
389
|
-
*
|
|
390
|
-
* @example
|
|
391
|
-
*
|
|
392
|
-
* ```typescript
|
|
393
|
-
* interface MyState {
|
|
394
|
-
* count: number;
|
|
395
|
-
* }
|
|
396
|
-
* interface MyCustomEvent {
|
|
397
|
-
* type: 'INCREMENT';
|
|
398
|
-
* payload: number;
|
|
399
|
-
* }
|
|
400
|
-
*
|
|
401
|
-
* // Create a leader store
|
|
402
|
-
* const leaderStore = UniversalStore.create<MyState, MyCustomEvent>({
|
|
403
|
-
* id: 'my-store',
|
|
404
|
-
* leader: true,
|
|
405
|
-
* initialState: { count: 0 },
|
|
406
|
-
* });
|
|
407
|
-
*
|
|
408
|
-
* // Create a follower store
|
|
409
|
-
* const followerStore = UniversalStore.create<MyState, MyCustomEvent>({
|
|
410
|
-
* id: 'my-store',
|
|
411
|
-
* leader: false,
|
|
412
|
-
* });
|
|
413
|
-
* ```
|
|
414
|
-
*
|
|
415
|
-
* @template State - The type of state managed by the store
|
|
416
|
-
* @template CustomEvent - Custom events that can be sent through the store. Must have a `type`
|
|
417
|
-
* string and optional `payload`
|
|
418
|
-
* @throws {Error} If constructed directly instead of using `create()`
|
|
419
|
-
* @throws {Error} If created without setting a channel first
|
|
420
|
-
* @throws {Error} If a follower is created with initial state
|
|
421
|
-
* @throws {Error} If a follower cannot find its leader within 1 second
|
|
422
|
-
*/
|
|
423
|
-
declare class UniversalStore<State, CustomEvent extends {
|
|
424
|
-
type: string;
|
|
425
|
-
payload?: any;
|
|
426
|
-
} = {
|
|
427
|
-
type: string;
|
|
428
|
-
payload?: any;
|
|
429
|
-
}> {
|
|
430
|
-
/**
|
|
431
|
-
* Defines the possible actor types in the store system
|
|
432
|
-
*
|
|
433
|
-
* @readonly
|
|
434
|
-
*/
|
|
435
|
-
static readonly ActorType: {
|
|
436
|
-
readonly LEADER: "LEADER";
|
|
437
|
-
readonly FOLLOWER: "FOLLOWER";
|
|
438
|
-
};
|
|
439
|
-
/**
|
|
440
|
-
* Defines the possible environments the store can run in
|
|
441
|
-
*
|
|
442
|
-
* @readonly
|
|
443
|
-
*/
|
|
444
|
-
static readonly Environment: {
|
|
445
|
-
readonly SERVER: "SERVER";
|
|
446
|
-
readonly MANAGER: "MANAGER";
|
|
447
|
-
readonly PREVIEW: "PREVIEW";
|
|
448
|
-
readonly UNKNOWN: "UNKNOWN";
|
|
449
|
-
readonly MOCK: "MOCK";
|
|
450
|
-
};
|
|
451
|
-
/**
|
|
452
|
-
* Internal event types used for store synchronization
|
|
453
|
-
*
|
|
454
|
-
* @readonly
|
|
455
|
-
*/
|
|
456
|
-
static readonly InternalEventType: {
|
|
457
|
-
readonly EXISTING_STATE_REQUEST: "__EXISTING_STATE_REQUEST";
|
|
458
|
-
readonly EXISTING_STATE_RESPONSE: "__EXISTING_STATE_RESPONSE";
|
|
459
|
-
readonly SET_STATE: "__SET_STATE";
|
|
460
|
-
readonly LEADER_CREATED: "__LEADER_CREATED";
|
|
461
|
-
readonly FOLLOWER_CREATED: "__FOLLOWER_CREATED";
|
|
462
|
-
};
|
|
463
|
-
static readonly Status: {
|
|
464
|
-
readonly UNPREPARED: "UNPREPARED";
|
|
465
|
-
readonly SYNCING: "SYNCING";
|
|
466
|
-
readonly READY: "READY";
|
|
467
|
-
readonly ERROR: "ERROR";
|
|
468
|
-
};
|
|
469
|
-
protected static isInternalConstructing: boolean;
|
|
470
|
-
/**
|
|
471
|
-
* The preparation construct is used to keep track of all store's preparation state the promise is
|
|
472
|
-
* resolved when the store is prepared with the static __prepare() method which will also change
|
|
473
|
-
* the state from PENDING to RESOLVED
|
|
474
|
-
*/
|
|
475
|
-
private static preparation;
|
|
476
|
-
private static setupPreparationPromise;
|
|
477
|
-
/** Enable debug logs for this store */
|
|
478
|
-
debugging: boolean;
|
|
479
|
-
/** The actor object representing the store instance with a unique ID and a type */
|
|
480
|
-
get actor(): Actor;
|
|
481
|
-
/**
|
|
482
|
-
* The current state of the store, that signals both if the store is prepared by Storybook and
|
|
483
|
-
* also - in the case of a follower - if the state has been synced with the leader's state.
|
|
484
|
-
*/
|
|
485
|
-
get status(): StatusType;
|
|
486
|
-
/**
|
|
487
|
-
* A promise that resolves when the store is fully ready. A leader will be ready when the store
|
|
488
|
-
* has been prepared by Storybook, which is almost instantly.
|
|
489
|
-
*
|
|
490
|
-
* A follower will be ready when the state has been synced with the leader's state, within a few
|
|
491
|
-
* hundred milliseconds.
|
|
492
|
-
*/
|
|
493
|
-
untilReady(): Promise<[{
|
|
494
|
-
channel: ChannelLike;
|
|
495
|
-
environment: EnvironmentType;
|
|
496
|
-
}, void | undefined]>;
|
|
497
|
-
/**
|
|
498
|
-
* The syncing construct is used to keep track of if the instance's state has been synced with the
|
|
499
|
-
* other instances. A leader will immediately have the promise resolved. A follower will initially
|
|
500
|
-
* be in a PENDING state, and resolve the the leader has sent the existing state, or reject if no
|
|
501
|
-
* leader has responded before the timeout.
|
|
502
|
-
*/
|
|
503
|
-
private syncing?;
|
|
504
|
-
private channelEventName;
|
|
505
|
-
private state;
|
|
506
|
-
private channel?;
|
|
507
|
-
private environment?;
|
|
508
|
-
private listeners;
|
|
509
|
-
private id;
|
|
510
|
-
private actorId;
|
|
511
|
-
private actorType;
|
|
512
|
-
protected constructor(options: StoreOptions<State>, environmentOverrides?: EnvironmentOverrides);
|
|
513
|
-
/** Creates a new instance of UniversalStore */
|
|
514
|
-
static create<State = any, CustomEvent extends {
|
|
515
|
-
type: string;
|
|
516
|
-
payload?: any;
|
|
517
|
-
} = {
|
|
518
|
-
type: string;
|
|
519
|
-
payload?: any;
|
|
520
|
-
}>(options: StoreOptions<State>): UniversalStore<State, CustomEvent>;
|
|
521
|
-
/** Gets the current state */
|
|
522
|
-
getState: () => State;
|
|
523
|
-
/**
|
|
524
|
-
* Updates the store's state
|
|
525
|
-
*
|
|
526
|
-
* Either a new state or a state updater function can be passed to the method.
|
|
527
|
-
*/
|
|
528
|
-
setState(updater: State | StateUpdater<State>): void;
|
|
529
|
-
/**
|
|
530
|
-
* Subscribes to store events
|
|
531
|
-
*
|
|
532
|
-
* @returns A function to unsubscribe
|
|
533
|
-
*/
|
|
534
|
-
subscribe: {
|
|
535
|
-
(listener: Listener<Event<State, CustomEvent>>): () => void;
|
|
536
|
-
<EventType extends Event<State, CustomEvent>['type']>(eventType: EventType, listener: Listener<Extract<Event<State, CustomEvent>, {
|
|
537
|
-
type: EventType;
|
|
538
|
-
}>>): () => void;
|
|
539
|
-
};
|
|
540
|
-
/**
|
|
541
|
-
* Subscribes to state changes
|
|
542
|
-
*
|
|
543
|
-
* @returns Unsubscribe function
|
|
544
|
-
*/
|
|
545
|
-
onStateChange(listener: (state: State, previousState: State, eventInfo: EventInfo) => void): () => void;
|
|
546
|
-
/** Sends a custom event to the other stores */
|
|
547
|
-
send: (event: CustomEvent) => void;
|
|
548
|
-
private emitToChannel;
|
|
549
|
-
private prepareThis;
|
|
550
|
-
private emitToListeners;
|
|
551
|
-
private handleChannelEvents;
|
|
552
|
-
private debug;
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
/**
|
|
556
|
-
* A hook to use a UniversalStore in a rendered preview. This hook will react to changes in the
|
|
557
|
-
* store state and re-render when the store changes.
|
|
558
|
-
*
|
|
559
|
-
* @param universalStore The UniversalStore instance to use.
|
|
560
|
-
* @param selector An optional selector function to select a subset of the store state.
|
|
561
|
-
* @remark This hook is intended for use in the preview. For use in the manager UI, import from
|
|
562
|
-
* `storybook/manager-api` instead.
|
|
563
|
-
*/
|
|
564
|
-
declare const useUniversalStore: {
|
|
565
|
-
<TUniversalStore extends UniversalStore<TState, any>, TState = TUniversalStore extends UniversalStore<infer S, any> ? S : never>(universalStore: TUniversalStore): [TState, TUniversalStore['setState']];
|
|
566
|
-
<TUniversalStore extends UniversalStore<any, any>, TSelectedState, TState = TUniversalStore extends UniversalStore<infer S, any> ? S : never>(universalStore: TUniversalStore, selector: (state: TState) => TSelectedState): [TSelectedState, TUniversalStore['setState']];
|
|
567
|
-
};
|
|
568
|
-
|
|
569
|
-
/**
|
|
570
|
-
* A mock universal store that can be used when testing code that relies on a universal store. It
|
|
571
|
-
* functions exactly like a normal universal store, with a few exceptions:
|
|
572
|
-
*
|
|
573
|
-
* - It is fully isolated, meaning that it doesn't interact with any channel, and it is always a
|
|
574
|
-
* leader.
|
|
575
|
-
*
|
|
576
|
-
* If the second testUtils argument is provided, all the public methods are spied on, so they can be
|
|
577
|
-
* asserted.
|
|
578
|
-
*
|
|
579
|
-
* When a mock store is re-used across tests (eg. in stories), you manually need to reset the state
|
|
580
|
-
* after each test.
|
|
581
|
-
*
|
|
582
|
-
* @example
|
|
583
|
-
*
|
|
584
|
-
* ```ts
|
|
585
|
-
* import * as testUtils from 'storybook/test'; // in stories
|
|
586
|
-
* import { vi as testUtils } from 'vitest'; // ... or in Vitest tests
|
|
587
|
-
*
|
|
588
|
-
* const initialState = { ... };
|
|
589
|
-
* const store = new MockUniversalStore({ initialState }, testUtils);
|
|
590
|
-
*
|
|
591
|
-
* export default {
|
|
592
|
-
* title: 'My story',
|
|
593
|
-
* beforeEach: () => {
|
|
594
|
-
* return () => {
|
|
595
|
-
* store.setState(initialState);
|
|
596
|
-
* };
|
|
597
|
-
* }
|
|
598
|
-
* }
|
|
599
|
-
* ```
|
|
600
|
-
*/
|
|
601
|
-
declare class MockUniversalStore<State, CustomEvent extends {
|
|
602
|
-
type: string;
|
|
603
|
-
payload?: any;
|
|
604
|
-
} = {
|
|
605
|
-
type: string;
|
|
606
|
-
payload?: any;
|
|
607
|
-
}> extends UniversalStore<State, CustomEvent> {
|
|
608
|
-
private testUtils;
|
|
609
|
-
constructor(options: StoreOptions<State>, testUtils?: any);
|
|
610
|
-
/** Create a mock universal store. This is just an alias for the constructor */
|
|
611
|
-
static create<State = any, CustomEvent extends {
|
|
612
|
-
type: string;
|
|
613
|
-
payload?: any;
|
|
614
|
-
} = {
|
|
615
|
-
type: string;
|
|
616
|
-
payload?: any;
|
|
617
|
-
}>(options: StoreOptions<State>, testUtils?: any): MockUniversalStore<State, CustomEvent>;
|
|
618
|
-
unsubscribeAll(): void;
|
|
619
|
-
}
|
|
620
|
-
|
|
621
314
|
declare class ArgsStore {
|
|
622
315
|
initialArgsByStoryId: Record<StoryId, Args>;
|
|
623
316
|
argsByStoryId: Record<StoryId, Args>;
|
|
@@ -719,7 +412,7 @@ declare function createPlaywrightTest<TFixture extends {
|
|
|
719
412
|
}>(baseTest: TFixture): TFixture;
|
|
720
413
|
|
|
721
414
|
declare function getCsfFactoryAnnotations<TRenderer extends Renderer$1 = Renderer$1, TArgs extends Args = Args>(story: LegacyStoryAnnotationsOrFn<TRenderer>, meta?: ComponentAnnotations<TRenderer, TArgs>, projectAnnotations?: ProjectAnnotations$1<TRenderer>): {
|
|
722
|
-
story:
|
|
415
|
+
story: storybook_internal_types.StoryAnnotations<Renderer$1, Args>;
|
|
723
416
|
meta: ComponentAnnotations<Renderer$1, Args>;
|
|
724
417
|
preview: storybook_internal_types.NormalizedProjectAnnotations<Renderer$1>;
|
|
725
418
|
} | {
|
|
@@ -781,10 +474,10 @@ declare class StoryStore<TRenderer extends Renderer$1> {
|
|
|
781
474
|
getStoryContext(story: PreparedStory<TRenderer>, { forceInitialArgs }?: {
|
|
782
475
|
forceInitialArgs?: boolean | undefined;
|
|
783
476
|
}): {
|
|
784
|
-
args:
|
|
785
|
-
initialGlobals:
|
|
786
|
-
globalTypes: (
|
|
787
|
-
userGlobals:
|
|
477
|
+
args: storybook_internal_types.Args;
|
|
478
|
+
initialGlobals: storybook_internal_types.Globals;
|
|
479
|
+
globalTypes: (storybook_internal_types.GlobalTypes & storybook_internal_types.StrictGlobalTypes) | undefined;
|
|
480
|
+
userGlobals: storybook_internal_types.Globals;
|
|
788
481
|
reporting: ReporterAPI;
|
|
789
482
|
globals: {
|
|
790
483
|
[x: string]: any;
|
|
@@ -797,30 +490,30 @@ declare class StoryStore<TRenderer extends Renderer$1> {
|
|
|
797
490
|
T: any;
|
|
798
491
|
})["component"]> | undefined;
|
|
799
492
|
parameters: Parameters;
|
|
800
|
-
initialArgs:
|
|
801
|
-
argTypes:
|
|
802
|
-
componentId:
|
|
493
|
+
initialArgs: storybook_internal_types.Args;
|
|
494
|
+
argTypes: storybook_internal_types.StrictArgTypes<storybook_internal_types.Args>;
|
|
495
|
+
componentId: storybook_internal_types.ComponentId;
|
|
803
496
|
title: ComponentTitle;
|
|
804
497
|
kind: ComponentTitle;
|
|
805
498
|
id: StoryId;
|
|
806
|
-
name:
|
|
807
|
-
story:
|
|
808
|
-
tags:
|
|
499
|
+
name: storybook_internal_types.StoryName;
|
|
500
|
+
story: storybook_internal_types.StoryName;
|
|
501
|
+
tags: storybook_internal_types.Tag[];
|
|
809
502
|
moduleExport: storybook_internal_types.ModuleExport;
|
|
810
|
-
originalStoryFn:
|
|
811
|
-
undecoratedStoryFn:
|
|
812
|
-
unboundStoryFn:
|
|
813
|
-
applyLoaders: (context: StoryContext<TRenderer,
|
|
814
|
-
applyBeforeEach: (context: StoryContext<TRenderer,
|
|
815
|
-
applyAfterEach: (context: StoryContext<TRenderer,
|
|
816
|
-
playFunction?: ((context: StoryContext<TRenderer,
|
|
817
|
-
runStep:
|
|
818
|
-
mount: (context: StoryContext<TRenderer,
|
|
503
|
+
originalStoryFn: storybook_internal_types.StoryFn<TRenderer>;
|
|
504
|
+
undecoratedStoryFn: storybook_internal_types.LegacyStoryFn<TRenderer>;
|
|
505
|
+
unboundStoryFn: storybook_internal_types.LegacyStoryFn<TRenderer>;
|
|
506
|
+
applyLoaders: (context: StoryContext<TRenderer, storybook_internal_types.Args>) => Promise<Record<string, any>>;
|
|
507
|
+
applyBeforeEach: (context: StoryContext<TRenderer, storybook_internal_types.Args>) => Promise<CleanupCallback[]>;
|
|
508
|
+
applyAfterEach: (context: StoryContext<TRenderer, storybook_internal_types.Args>) => Promise<void>;
|
|
509
|
+
playFunction?: ((context: StoryContext<TRenderer, storybook_internal_types.Args>) => Promise<void> | void) | undefined;
|
|
510
|
+
runStep: storybook_internal_types.StepRunner<TRenderer>;
|
|
511
|
+
mount: (context: StoryContext<TRenderer, storybook_internal_types.Args>) => () => Promise<Canvas>;
|
|
819
512
|
testingLibraryRender?: (...args: never[]) => unknown;
|
|
820
513
|
renderToCanvas?: storybook_internal_types.RenderToCanvas<TRenderer> | undefined;
|
|
821
514
|
usesMount: boolean;
|
|
822
|
-
storyGlobals:
|
|
823
|
-
} & Pick<
|
|
515
|
+
storyGlobals: storybook_internal_types.Globals;
|
|
516
|
+
} & Pick<storybook_internal_types.StoryContextForLoaders<Renderer$1, storybook_internal_types.Args>, "allArgs" | "argsByTarget" | "unmappedArgs">;
|
|
824
517
|
addCleanupCallbacks(story: PreparedStory<TRenderer>, callbacks: CleanupCallback[]): void;
|
|
825
518
|
cleanupStory(story: PreparedStory<TRenderer>): Promise<void>;
|
|
826
519
|
extract(options?: {
|
|
@@ -828,10 +521,10 @@ declare class StoryStore<TRenderer extends Renderer$1> {
|
|
|
828
521
|
}): Record<StoryId, StoryContextForEnhancers<TRenderer>>;
|
|
829
522
|
getSetStoriesPayload(): {
|
|
830
523
|
v: number;
|
|
831
|
-
globals:
|
|
524
|
+
globals: storybook_internal_types.Globals;
|
|
832
525
|
globalParameters: {};
|
|
833
526
|
kindParameters: Parameters;
|
|
834
|
-
stories: Record<string, StoryContextForEnhancers<TRenderer,
|
|
527
|
+
stories: Record<string, StoryContextForEnhancers<TRenderer, storybook_internal_types.Args>>;
|
|
835
528
|
};
|
|
836
529
|
getStoriesJsonData: () => StoryIndexV3;
|
|
837
530
|
raw(): BoundStory<TRenderer>[];
|
|
@@ -846,7 +539,7 @@ declare class StoryStore<TRenderer extends Renderer$1> {
|
|
|
846
539
|
declare const combineParameters: (...parameterSets: (Parameters | undefined)[]) => Parameters;
|
|
847
540
|
|
|
848
541
|
type PropDescriptor = string[] | RegExp;
|
|
849
|
-
declare const filterArgTypes: (argTypes: StrictArgTypes, include?: PropDescriptor, exclude?: PropDescriptor) => Partial<StrictArgTypes<
|
|
542
|
+
declare const filterArgTypes: (argTypes: StrictArgTypes, include?: PropDescriptor, exclude?: PropDescriptor) => Partial<StrictArgTypes<storybook_internal_types.Args>>;
|
|
850
543
|
|
|
851
544
|
declare const inferControls: ArgTypesEnhancer<Renderer$1>;
|
|
852
545
|
|
|
@@ -896,10 +589,10 @@ declare class DocsContext<TRenderer extends Renderer$1> implements DocsContextPr
|
|
|
896
589
|
getStoryContext: (story: PreparedStory<TRenderer>) => {
|
|
897
590
|
loaded: {};
|
|
898
591
|
viewMode: string;
|
|
899
|
-
args:
|
|
900
|
-
initialGlobals:
|
|
901
|
-
globalTypes: (
|
|
902
|
-
userGlobals:
|
|
592
|
+
args: storybook_internal_types.Args;
|
|
593
|
+
initialGlobals: storybook_internal_types.Globals;
|
|
594
|
+
globalTypes: (storybook_internal_types.GlobalTypes & storybook_internal_types.StrictGlobalTypes) | undefined;
|
|
595
|
+
userGlobals: storybook_internal_types.Globals;
|
|
903
596
|
reporting: ReporterAPI;
|
|
904
597
|
globals: {
|
|
905
598
|
[x: string]: any;
|
|
@@ -911,30 +604,30 @@ declare class DocsContext<TRenderer extends Renderer$1> implements DocsContextPr
|
|
|
911
604
|
subcomponents?: Record<string, (TRenderer & {
|
|
912
605
|
T: any;
|
|
913
606
|
})["component"]> | undefined;
|
|
914
|
-
parameters:
|
|
915
|
-
initialArgs:
|
|
916
|
-
argTypes:
|
|
917
|
-
componentId:
|
|
918
|
-
title:
|
|
919
|
-
kind:
|
|
607
|
+
parameters: storybook_internal_types.Parameters;
|
|
608
|
+
initialArgs: storybook_internal_types.Args;
|
|
609
|
+
argTypes: storybook_internal_types.StrictArgTypes<storybook_internal_types.Args>;
|
|
610
|
+
componentId: storybook_internal_types.ComponentId;
|
|
611
|
+
title: storybook_internal_types.ComponentTitle;
|
|
612
|
+
kind: storybook_internal_types.ComponentTitle;
|
|
920
613
|
id: StoryId;
|
|
921
614
|
name: StoryName;
|
|
922
615
|
story: StoryName;
|
|
923
|
-
tags:
|
|
616
|
+
tags: storybook_internal_types.Tag[];
|
|
924
617
|
moduleExport: ModuleExport;
|
|
925
|
-
originalStoryFn:
|
|
926
|
-
undecoratedStoryFn:
|
|
927
|
-
unboundStoryFn:
|
|
928
|
-
applyLoaders: (context:
|
|
929
|
-
applyBeforeEach: (context:
|
|
930
|
-
applyAfterEach: (context:
|
|
931
|
-
playFunction?: ((context:
|
|
932
|
-
runStep:
|
|
933
|
-
mount: (context:
|
|
618
|
+
originalStoryFn: storybook_internal_types.StoryFn<TRenderer>;
|
|
619
|
+
undecoratedStoryFn: storybook_internal_types.LegacyStoryFn<TRenderer>;
|
|
620
|
+
unboundStoryFn: storybook_internal_types.LegacyStoryFn<TRenderer>;
|
|
621
|
+
applyLoaders: (context: storybook_internal_types.StoryContext<TRenderer, storybook_internal_types.Args>) => Promise<Record<string, any>>;
|
|
622
|
+
applyBeforeEach: (context: storybook_internal_types.StoryContext<TRenderer, storybook_internal_types.Args>) => Promise<storybook_internal_types.CleanupCallback[]>;
|
|
623
|
+
applyAfterEach: (context: storybook_internal_types.StoryContext<TRenderer, storybook_internal_types.Args>) => Promise<void>;
|
|
624
|
+
playFunction?: ((context: storybook_internal_types.StoryContext<TRenderer, storybook_internal_types.Args>) => Promise<void> | void) | undefined;
|
|
625
|
+
runStep: storybook_internal_types.StepRunner<TRenderer>;
|
|
626
|
+
mount: (context: storybook_internal_types.StoryContext<TRenderer, storybook_internal_types.Args>) => () => Promise<storybook_internal_types.Canvas>;
|
|
934
627
|
testingLibraryRender?: (...args: never[]) => unknown;
|
|
935
628
|
renderToCanvas?: storybook_internal_types.RenderToCanvas<TRenderer> | undefined;
|
|
936
629
|
usesMount: boolean;
|
|
937
|
-
storyGlobals:
|
|
630
|
+
storyGlobals: storybook_internal_types.Globals;
|
|
938
631
|
allArgs: any;
|
|
939
632
|
argsByTarget: any;
|
|
940
633
|
unmappedArgs: any;
|
|
@@ -1152,7 +845,7 @@ declare class Preview<TRenderer extends Renderer$1> {
|
|
|
1152
845
|
}): {
|
|
1153
846
|
args: Args;
|
|
1154
847
|
initialGlobals: Globals;
|
|
1155
|
-
globalTypes: (
|
|
848
|
+
globalTypes: (storybook_internal_types.GlobalTypes & storybook_internal_types.StrictGlobalTypes) | undefined;
|
|
1156
849
|
userGlobals: Globals;
|
|
1157
850
|
reporting: ReporterAPI;
|
|
1158
851
|
globals: {
|
|
@@ -1165,34 +858,34 @@ declare class Preview<TRenderer extends Renderer$1> {
|
|
|
1165
858
|
subcomponents?: Record<string, (TRenderer & {
|
|
1166
859
|
T: any;
|
|
1167
860
|
})["component"]> | undefined;
|
|
1168
|
-
parameters:
|
|
861
|
+
parameters: storybook_internal_types.Parameters;
|
|
1169
862
|
initialArgs: Args;
|
|
1170
|
-
argTypes:
|
|
1171
|
-
componentId:
|
|
1172
|
-
title:
|
|
1173
|
-
kind:
|
|
863
|
+
argTypes: storybook_internal_types.StrictArgTypes<Args>;
|
|
864
|
+
componentId: storybook_internal_types.ComponentId;
|
|
865
|
+
title: storybook_internal_types.ComponentTitle;
|
|
866
|
+
kind: storybook_internal_types.ComponentTitle;
|
|
1174
867
|
id: StoryId;
|
|
1175
|
-
name:
|
|
1176
|
-
story:
|
|
1177
|
-
tags:
|
|
868
|
+
name: storybook_internal_types.StoryName;
|
|
869
|
+
story: storybook_internal_types.StoryName;
|
|
870
|
+
tags: storybook_internal_types.Tag[];
|
|
1178
871
|
moduleExport: storybook_internal_types.ModuleExport;
|
|
1179
|
-
originalStoryFn:
|
|
1180
|
-
undecoratedStoryFn:
|
|
1181
|
-
unboundStoryFn:
|
|
1182
|
-
applyLoaders: (context:
|
|
1183
|
-
applyBeforeEach: (context:
|
|
1184
|
-
applyAfterEach: (context:
|
|
1185
|
-
playFunction?: ((context:
|
|
1186
|
-
runStep:
|
|
1187
|
-
mount: (context:
|
|
872
|
+
originalStoryFn: storybook_internal_types.StoryFn<TRenderer>;
|
|
873
|
+
undecoratedStoryFn: storybook_internal_types.LegacyStoryFn<TRenderer>;
|
|
874
|
+
unboundStoryFn: storybook_internal_types.LegacyStoryFn<TRenderer>;
|
|
875
|
+
applyLoaders: (context: storybook_internal_types.StoryContext<TRenderer, Args>) => Promise<Record<string, any>>;
|
|
876
|
+
applyBeforeEach: (context: storybook_internal_types.StoryContext<TRenderer, Args>) => Promise<CleanupCallback[]>;
|
|
877
|
+
applyAfterEach: (context: storybook_internal_types.StoryContext<TRenderer, Args>) => Promise<void>;
|
|
878
|
+
playFunction?: ((context: storybook_internal_types.StoryContext<TRenderer, Args>) => Promise<void> | void) | undefined;
|
|
879
|
+
runStep: storybook_internal_types.StepRunner<TRenderer>;
|
|
880
|
+
mount: (context: storybook_internal_types.StoryContext<TRenderer, Args>) => () => Promise<storybook_internal_types.Canvas>;
|
|
1188
881
|
testingLibraryRender?: (...args: never[]) => unknown;
|
|
1189
882
|
renderToCanvas?: RenderToCanvas$1<TRenderer> | undefined;
|
|
1190
883
|
usesMount: boolean;
|
|
1191
884
|
storyGlobals: Globals;
|
|
1192
|
-
} & Pick<
|
|
885
|
+
} & Pick<storybook_internal_types.StoryContextForLoaders<Renderer$1, Args>, "allArgs" | "argsByTarget" | "unmappedArgs">;
|
|
1193
886
|
extract(options?: {
|
|
1194
887
|
includeDocsOnly: boolean;
|
|
1195
|
-
}): Promise<Record<string,
|
|
888
|
+
}): Promise<Record<string, storybook_internal_types.StoryContextForEnhancers<TRenderer, Args>>>;
|
|
1196
889
|
renderPreviewEntryError(reason: string, err: Error): void;
|
|
1197
890
|
}
|
|
1198
891
|
|
|
@@ -1397,4 +1090,4 @@ declare type RenderContext<TRenderer extends Renderer = Renderer> = StoryIdentif
|
|
|
1397
1090
|
declare function getCoreAnnotations(): any[];
|
|
1398
1091
|
declare function getComposedCoreAnnotations<TRenderer extends Renderer$1>(): NormalizedProjectAnnotations<TRenderer>;
|
|
1399
1092
|
|
|
1400
|
-
export { DocsContext, HooksContext, Preview, PreviewWeb, PreviewWithSelection, type PropDescriptor, type Report, ReporterAPI, type SelectionStore, StoryStore, UrlStore, type View, WebView, addons, applyHooks, combineArgs, combineParameters, composeConfigs, composeStepRunners, composeStories, composeStory, createPlaywrightTest, decorateStory, defaultDecorateStory, definePreview,
|
|
1093
|
+
export { DocsContext, HooksContext, Preview, PreviewWeb, PreviewWithSelection, type PropDescriptor, type Report, ReporterAPI, type SelectionStore, StoryStore, UrlStore, type View, WebView, addons, applyHooks, combineArgs, combineParameters, composeConfigs, composeStepRunners, composeStories, composeStory, createPlaywrightTest, decorateStory, defaultDecorateStory, definePreview, filterArgTypes, getComposedCoreAnnotations, getCoreAnnotations, getCsfFactoryAnnotations, inferControls, makeDecorator, mockChannel, normalizeProjectAnnotations, normalizeStory, prepareMeta, prepareStory, sanitizeStoryContextUpdate, setDefaultProjectAnnotations, setProjectAnnotations, simulateDOMContentLoaded, simulatePageLoad, sortStoriesV7, useArgs, useCallback, useChannel, useEffect, useGlobals, useMemo, useParameter, useReducer, useRef, useState, useStoryContext, userOrAutoTitle, userOrAutoTitleFromSpecifier };
|