storybook 9.1.0-alpha.9 → 9.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -47120,9 +47120,8 @@ ue();
47120
47120
  function jU() {
47121
47121
  try {
47122
47122
  return (
47123
- // @ts-expect-error this property exists in certain environments
47124
- !!globalThis.__vitest_browser__ || // @ts-expect-error this property exists in certain environments
47125
- !!globalThis.__playwright__binding__
47123
+ // @ts-expect-error This property exists in Vitest browser mode
47124
+ !!globalThis.__vitest_browser__ || !!globalThis.window?.navigator?.userAgent?.match(/StorybookTestRunner/)
47126
47125
  );
47127
47126
  } catch {
47128
47127
  return !1;
@@ -50828,7 +50827,7 @@ prototype.toString.call(e) === "[object Module]", "isModule"), J7e = /* @__PURE_
50828
50827
  return {};
50829
50828
  }
50830
50829
  }, "construct"), B7 = /* @__PURE__ */ a(() => ({
50831
- renderPhase: void 0,
50830
+ renderPhase: "preparing",
50832
50831
  isDebugging: !1,
50833
50832
  isPlaying: !1,
50834
50833
  isLocked: !1,
@@ -50872,18 +50871,20 @@ prototype.toString.call(e) === "[object Module]", "isModule"), J7e = /* @__PURE_
50872
50871
  this.loadParentWindowState();
50873
50872
  let t = /* @__PURE__ */ a(({
50874
50873
  storyId: u,
50875
- isPlaying: c = !0,
50876
- isDebugging: d = !1
50874
+ renderPhase: c,
50875
+ isPlaying: d = !0,
50876
+ isDebugging: f = !1
50877
50877
  }) => {
50878
- let f = this.getState(u);
50878
+ let p = this.getState(u);
50879
50879
  this.setState(u, {
50880
50880
  ...B7(),
50881
- ...lY(f, d),
50882
- shadowCalls: d ? f.shadowCalls : [],
50883
- chainedCallIds: d ? f.chainedCallIds : /* @__PURE__ */ new Set(),
50884
- playUntil: d ? f.playUntil : void 0,
50885
- isPlaying: c,
50886
- isDebugging: d
50881
+ ...lY(p, f),
50882
+ renderPhase: c || p.renderPhase,
50883
+ shadowCalls: f ? p.shadowCalls : [],
50884
+ chainedCallIds: f ? p.chainedCallIds : /* @__PURE__ */ new Set(),
50885
+ playUntil: f ? p.playUntil : void 0,
50886
+ isPlaying: d,
50887
+ isDebugging: f
50887
50888
  }), this.sync(u);
50888
50889
  }, "resetState"), r = /* @__PURE__ */ a((u) => ({ storyId: c, playUntil: d }) => {
50889
50890
  this.getState(c).isDebugging || this.setState(c, ({ calls: p }) => ({
@@ -50921,17 +50922,31 @@ prototype.toString.call(e) === "[object Module]", "isModule"), J7e = /* @__PURE_
50921
50922
  }
50922
50923
  }, "next"), s = /* @__PURE__ */ a(({ storyId: u }) => {
50923
50924
  this.setState(u, { playUntil: void 0, isDebugging: !1 }), Object.values(this.getState(u).resolvers).forEach((c) => c());
50924
- }, "end"), l = /* @__PURE__ */ a(({ storyId: u, newPhase: c }) => {
50925
+ }, "end"), l = /* @__PURE__ */ a(({
50926
+ storyId: u,
50927
+ newPhase: c
50928
+ }) => {
50925
50929
  let { isDebugging: d } = this.getState(u);
50926
- this.setState(u, { renderPhase: c }), c === "preparing" && d && t({ storyId: u }), c === "playing" && t({ storyId: u, isDebugging: d }),
50927
- c === "played" && this.setState(u, {
50930
+ if (c === "preparing" && d)
50931
+ return t({ storyId: u, renderPhase: c });
50932
+ if (c === "playing")
50933
+ return t({ storyId: u, renderPhase: c, isDebugging: d });
50934
+ c === "played" ? this.setState(u, {
50935
+ renderPhase: c,
50928
50936
  isLocked: !1,
50929
50937
  isPlaying: !1,
50930
50938
  isDebugging: !1
50931
- }), c === "errored" && this.setState(u, {
50939
+ }) : c === "errored" ? this.setState(u, {
50940
+ renderPhase: c,
50932
50941
  isLocked: !1,
50933
50942
  isPlaying: !1
50934
- });
50943
+ }) : c === "aborted" ? this.setState(u, {
50944
+ renderPhase: c,
50945
+ isLocked: !0,
50946
+ isPlaying: !1
50947
+ }) : this.setState(u, {
50948
+ renderPhase: c
50949
+ }), this.sync(u);
50935
50950
  }, "renderPhaseChanged");
50936
50951
  Gv && Gv.ready().then(() => {
50937
50952
  this.channel = Gv.getChannel(), this.channel.on(xu, t), this.channel.on(q4, l), this.channel.on(Vs, () => {
@@ -50944,8 +50959,10 @@ prototype.toString.call(e) === "[object Module]", "isModule"), J7e = /* @__PURE_
50944
50959
  return this.state[t] || B7();
50945
50960
  }
50946
50961
  setState(t, r) {
50947
- let n = this.getState(t), o = typeof r == "function" ? r(n) : r;
50948
- this.state = { ...this.state, [t]: { ...n, ...o } }, this.updateParentWindowState();
50962
+ if (t) {
50963
+ let n = this.getState(t), o = typeof r == "function" ? r(n) : r;
50964
+ this.state = { ...this.state, [t]: { ...n, ...o } }, this.updateParentWindowState();
50965
+ }
50949
50966
  }
50950
50967
  cleanup() {
50951
50968
  this.state = Object.entries(this.state).reduce(
@@ -68997,7 +69014,7 @@ Ct();
68997
69014
  var Ome = N(Wa(), 1), Nn = N(Pme(), 1);
68998
69015
 
68999
69016
  // src/manager-api/version.ts
69000
- var Tme = "9.1.0-alpha.9";
69017
+ var Tme = "9.1.0-beta.1";
69001
69018
 
69002
69019
  // src/manager-api/modules/versions.ts
69003
69020
  var { VERSIONCHECK: bst } = Z, Ame = (0, Ome.default)(1)(() => {
@@ -4403,7 +4403,7 @@ U(wr, {
4403
4403
  var kt = require("@storybook/global"), on = L(rr(), 1), $ = L(require("semver"), 1);
4404
4404
 
4405
4405
  // src/manager-api/version.ts
4406
- var tn = "9.1.0-alpha.9";
4406
+ var tn = "9.1.0-beta.1";
4407
4407
 
4408
4408
  // src/manager-api/modules/versions.ts
4409
4409
  var { VERSIONCHECK: Qs } = kt.global, rn = (0, on.default)(1)(() => {
@@ -2,7 +2,7 @@ import React, { FC, ReactNode, ReactElement, Component } from 'react';
2
2
  import { Channel, Listener as Listener$1 } from 'storybook/internal/channels';
3
3
  export { Listener as ChannelListener } from 'storybook/internal/channels';
4
4
  import { RouterData, NavigateOptions } from 'storybook/internal/router';
5
- import { Addon_Types, Addon_TypesEnum, Addon_Collection, Addon_TypesMapping, Addon_BaseType, Addon_TestProviderType, Addon_PageType, Addon_WrapperType, Addon_Config, API_ProviderData, API_StateMerger, API_Provider, Globals, GlobalTypes, API_PanelPositions, API_Layout, API_LayoutCustomisations, API_UI, API_Notification, API_IframeRenderer, API_ComposedRef, API_SetRefData, API_ComposedRefUpdate, API_Refs, StoryId, API_Settings, API_HashEntry, API_ViewMode, API_LeafEntry, API_PreparedStoryIndex, API_StoryEntry, Args, API_IndexHash, API_DocsEntry, API_FilterFunction, API_LoadedRefData, API_Version, API_Versions, API_UnknownEntries, API_OptionsData, Parameters, ArgTypes, NormalizedProjectAnnotations, ProjectAnnotations, ComposedStoryFn } from 'storybook/internal/types';
5
+ import { Addon_Types, Addon_TypesEnum, Addon_Collection, Addon_TypesMapping, Addon_BaseType, Addon_TestProviderType, Addon_PageType, Addon_WrapperType, Addon_Config, API_ProviderData, API_StateMerger, API_Provider, Globals, GlobalTypes, API_PanelPositions, API_Layout, API_LayoutCustomisations, API_UI, API_Notification, API_IframeRenderer, API_ComposedRef, API_SetRefData, API_ComposedRefUpdate, API_Refs, StoryId, API_Settings, API_HashEntry, API_ViewMode, API_LeafEntry, API_PreparedStoryIndex, API_StoryEntry, Args, API_IndexHash, API_DocsEntry, API_FilterFunction, API_LoadedRefData, API_Version, API_Versions, API_UnknownEntries, API_OptionsData, Parameters, ArgTypes } from 'storybook/internal/types';
6
6
  export { Addon_Type as Addon, API_ComponentEntry as ComponentEntry, API_ComposedRef as ComposedRef, API_DocsEntry as DocsEntry, API_GroupEntry as GroupEntry, API_HashEntry as HashEntry, API_IndexHash as IndexHash, API_LeafEntry as LeafEntry, API_Refs as Refs, API_RootEntry as RootEntry, API_IndexHash as StoriesHash, API_StoryEntry as StoryEntry } from 'storybook/internal/types';
7
7
  import { ThemeVars } from 'storybook/theming';
8
8
  import { toId, StoryId as StoryId$1 } from 'storybook/internal/csf';
@@ -388,7 +388,7 @@ interface SubState$5 {
388
388
 
389
389
  declare const isMacLike: () => boolean;
390
390
  declare const controlOrMetaSymbol: () => "⌘" | "ctrl";
391
- declare const controlOrMetaKey: () => "meta" | "control";
391
+ declare const controlOrMetaKey: () => "control" | "meta";
392
392
  declare const optionOrAltSymbol: () => "⌥" | "alt";
393
393
  declare const isShortcutTaken: (arr1: string[], arr2: string[]) => boolean;
394
394
  type KeyboardEventLike = Pick<KeyboardEvent, 'altKey' | 'ctrlKey' | 'metaKey' | 'shiftKey' | 'key' | 'code' | 'keyCode' | 'preventDefault'>;
@@ -1222,531 +1222,13 @@ type StatusStoreByTypeId = StatusStore & {
1222
1222
  };
1223
1223
  type UseStatusStore = <T = StatusesByStoryIdAndTypeId>(selector?: (statuses: StatusesByStoryIdAndTypeId) => T) => T;
1224
1224
 
1225
- /**
1226
- * Actions represent the type of change to a location value.
1227
- */
1228
- declare enum Action {
1229
- /**
1230
- * A POP indicates a change to an arbitrary index in the history stack, such
1231
- * as a back or forward navigation. It does not describe the direction of the
1232
- * navigation, only that the current index changed.
1233
- *
1234
- * Note: This is the default action for newly created history objects.
1235
- */
1236
- Pop = "POP",
1237
- /**
1238
- * A PUSH indicates a new entry being added to the history stack, such as when
1239
- * a link is clicked and a new page loads. When this happens, all subsequent
1240
- * entries in the stack are lost.
1241
- */
1242
- Push = "PUSH",
1243
- /**
1244
- * A REPLACE indicates the entry at the current index in the history stack
1245
- * being replaced by a new one.
1246
- */
1247
- Replace = "REPLACE"
1248
- }
1249
- /**
1250
- * The pathname, search, and hash values of a URL.
1251
- */
1252
- interface Path {
1253
- /**
1254
- * A URL pathname, beginning with a /.
1255
- */
1256
- pathname: string;
1257
- /**
1258
- * A URL search string, beginning with a ?.
1259
- */
1260
- search: string;
1261
- /**
1262
- * A URL fragment identifier, beginning with a #.
1263
- */
1264
- hash: string;
1265
- }
1266
- /**
1267
- * An entry in a history stack. A location contains information about the
1268
- * URL path, as well as possibly some arbitrary state and a key.
1269
- */
1270
- interface Location extends Path {
1271
- /**
1272
- * A value of arbitrary data associated with this location.
1273
- */
1274
- state: any;
1275
- /**
1276
- * A unique string associated with this location. May be used to safely store
1277
- * and retrieve data in some other storage API, like `localStorage`.
1278
- *
1279
- * Note: This value is always "default" on the initial location.
1280
- */
1281
- key: string;
1282
- }
1283
-
1284
- /**
1285
- * Map of routeId -> data returned from a loader/action/error
1286
- */
1287
- interface RouteData {
1288
- [routeId: string]: any;
1289
- }
1290
- declare enum ResultType {
1291
- data = "data",
1292
- deferred = "deferred",
1293
- redirect = "redirect",
1294
- error = "error"
1295
- }
1296
- /**
1297
- * Successful result from a loader or action
1298
- */
1299
- interface SuccessResult {
1300
- type: ResultType.data;
1301
- data: any;
1302
- statusCode?: number;
1303
- headers?: Headers;
1304
- }
1305
- /**
1306
- * Successful defer() result from a loader or action
1307
- */
1308
- interface DeferredResult {
1309
- type: ResultType.deferred;
1310
- deferredData: DeferredData;
1311
- statusCode?: number;
1312
- headers?: Headers;
1313
- }
1314
- /**
1315
- * Redirect result from a loader or action
1316
- */
1317
- interface RedirectResult {
1318
- type: ResultType.redirect;
1319
- status: number;
1320
- location: string;
1321
- revalidate: boolean;
1322
- reloadDocument?: boolean;
1323
- }
1324
- /**
1325
- * Unsuccessful result from a loader or action
1326
- */
1327
- interface ErrorResult {
1328
- type: ResultType.error;
1329
- error: any;
1330
- headers?: Headers;
1331
- }
1332
- /**
1333
- * Result from a loader or action - potentially successful or unsuccessful
1334
- */
1335
- type DataResult = SuccessResult | DeferredResult | RedirectResult | ErrorResult;
1336
- type LowerCaseFormMethod = "get" | "post" | "put" | "patch" | "delete";
1337
- type UpperCaseFormMethod = Uppercase<LowerCaseFormMethod>;
1338
- /**
1339
- * Active navigation/fetcher form methods are exposed in lowercase on the
1340
- * RouterState
1341
- */
1342
- type FormMethod = LowerCaseFormMethod;
1343
- /**
1344
- * In v7, active navigation/fetcher form methods are exposed in uppercase on the
1345
- * RouterState. This is to align with the normalization done via fetch().
1346
- */
1347
- type V7_FormMethod = UpperCaseFormMethod;
1348
- type FormEncType = "application/x-www-form-urlencoded" | "multipart/form-data" | "application/json" | "text/plain";
1349
- type JsonObject = {
1350
- [Key in string]: JsonValue;
1351
- } & {
1352
- [Key in string]?: JsonValue | undefined;
1353
- };
1354
- type JsonArray = JsonValue[] | readonly JsonValue[];
1355
- type JsonPrimitive = string | number | boolean | null;
1356
- type JsonValue = JsonPrimitive | JsonObject | JsonArray;
1357
- /**
1358
- * @private
1359
- * Internal interface to pass around for action submissions, not intended for
1360
- * external consumption
1361
- */
1362
- type Submission = {
1363
- formMethod: FormMethod | V7_FormMethod;
1364
- formAction: string;
1365
- formEncType: FormEncType;
1366
- formData: FormData;
1367
- json: undefined;
1368
- text: undefined;
1369
- } | {
1370
- formMethod: FormMethod | V7_FormMethod;
1371
- formAction: string;
1372
- formEncType: FormEncType;
1373
- formData: undefined;
1374
- json: JsonValue;
1375
- text: undefined;
1376
- } | {
1377
- formMethod: FormMethod | V7_FormMethod;
1378
- formAction: string;
1379
- formEncType: FormEncType;
1380
- formData: undefined;
1381
- json: undefined;
1382
- text: string;
1383
- };
1384
- /**
1385
- * @private
1386
- * Arguments passed to route loader/action functions. Same for now but we keep
1387
- * this as a private implementation detail in case they diverge in the future.
1388
- */
1389
- interface DataFunctionArgs {
1390
- request: Request;
1391
- params: Params;
1392
- context?: any;
1393
- }
1394
- /**
1395
- * Arguments passed to loader functions
1396
- */
1397
- interface LoaderFunctionArgs extends DataFunctionArgs {
1398
- }
1399
- /**
1400
- * Arguments passed to action functions
1401
- */
1402
- interface ActionFunctionArgs extends DataFunctionArgs {
1403
- }
1404
- /**
1405
- * Loaders and actions can return anything except `undefined` (`null` is a
1406
- * valid return value if there is no data to return). Responses are preferred
1407
- * and will ease any future migration to Remix
1408
- */
1409
- type DataFunctionValue = Response | NonNullable<unknown> | null;
1410
- /**
1411
- * Route loader function signature
1412
- */
1413
- interface LoaderFunction {
1414
- (args: LoaderFunctionArgs): Promise<DataFunctionValue> | DataFunctionValue;
1415
- }
1416
- /**
1417
- * Route action function signature
1418
- */
1419
- interface ActionFunction {
1420
- (args: ActionFunctionArgs): Promise<DataFunctionValue> | DataFunctionValue;
1421
- }
1422
- /**
1423
- * Route shouldRevalidate function signature. This runs after any submission
1424
- * (navigation or fetcher), so we flatten the navigation/fetcher submission
1425
- * onto the arguments. It shouldn't matter whether it came from a navigation
1426
- * or a fetcher, what really matters is the URLs and the formData since loaders
1427
- * have to re-run based on the data models that were potentially mutated.
1428
- */
1429
- interface ShouldRevalidateFunction {
1430
- (args: {
1431
- currentUrl: URL;
1432
- currentParams: AgnosticDataRouteMatch["params"];
1433
- nextUrl: URL;
1434
- nextParams: AgnosticDataRouteMatch["params"];
1435
- formMethod?: Submission["formMethod"];
1436
- formAction?: Submission["formAction"];
1437
- formEncType?: Submission["formEncType"];
1438
- text?: Submission["text"];
1439
- formData?: Submission["formData"];
1440
- json?: Submission["json"];
1441
- actionResult?: DataResult;
1442
- defaultShouldRevalidate: boolean;
1443
- }): boolean;
1444
- }
1445
- /**
1446
- * Keys we cannot change from within a lazy() function. We spread all other keys
1447
- * onto the route. Either they're meaningful to the router, or they'll get
1448
- * ignored.
1449
- */
1450
- type ImmutableRouteKey = "lazy" | "caseSensitive" | "path" | "id" | "index" | "children";
1451
- type RequireOne<T, Key = keyof T> = Exclude<{
1452
- [K in keyof T]: K extends Key ? Omit<T, K> & Required<Pick<T, K>> : never;
1453
- }[keyof T], undefined>;
1454
- /**
1455
- * lazy() function to load a route definition, which can add non-matching
1456
- * related properties to a route
1457
- */
1458
- interface LazyRouteFunction<R extends AgnosticRouteObject> {
1459
- (): Promise<RequireOne<Omit<R, ImmutableRouteKey>>>;
1460
- }
1461
- /**
1462
- * Base RouteObject with common props shared by all types of routes
1463
- */
1464
- type AgnosticBaseRouteObject = {
1465
- caseSensitive?: boolean;
1466
- path?: string;
1467
- id?: string;
1468
- loader?: LoaderFunction;
1469
- action?: ActionFunction;
1470
- hasErrorBoundary?: boolean;
1471
- shouldRevalidate?: ShouldRevalidateFunction;
1472
- handle?: any;
1473
- lazy?: LazyRouteFunction<AgnosticBaseRouteObject>;
1474
- };
1475
- /**
1476
- * Index routes must not have children
1477
- */
1478
- type AgnosticIndexRouteObject = AgnosticBaseRouteObject & {
1479
- children?: undefined;
1480
- index: true;
1481
- };
1482
- /**
1483
- * Non-index routes may have children, but cannot have index
1484
- */
1485
- type AgnosticNonIndexRouteObject = AgnosticBaseRouteObject & {
1486
- children?: AgnosticRouteObject[];
1487
- index?: false;
1488
- };
1489
- /**
1490
- * A route object represents a logical route, with (optionally) its child
1491
- * routes organized in a tree-like structure.
1492
- */
1493
- type AgnosticRouteObject = AgnosticIndexRouteObject | AgnosticNonIndexRouteObject;
1494
- type AgnosticDataIndexRouteObject = AgnosticIndexRouteObject & {
1495
- id: string;
1496
- };
1497
- type AgnosticDataNonIndexRouteObject = AgnosticNonIndexRouteObject & {
1498
- children?: AgnosticDataRouteObject[];
1499
- id: string;
1500
- };
1501
- /**
1502
- * A data route object, which is just a RouteObject with a required unique ID
1503
- */
1504
- type AgnosticDataRouteObject = AgnosticDataIndexRouteObject | AgnosticDataNonIndexRouteObject;
1505
- /**
1506
- * The parameters that were parsed from the URL path.
1507
- */
1508
- type Params<Key extends string = string> = {
1509
- readonly [key in Key]: string | undefined;
1510
- };
1511
- /**
1512
- * A RouteMatch contains info about how a route matched a URL.
1513
- */
1514
- interface AgnosticRouteMatch<ParamKey extends string = string, RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject> {
1515
- /**
1516
- * The names and values of dynamic parameters in the URL.
1517
- */
1518
- params: Params<ParamKey>;
1519
- /**
1520
- * The portion of the URL pathname that was matched.
1521
- */
1522
- pathname: string;
1523
- /**
1524
- * The portion of the URL pathname that was matched before child routes.
1525
- */
1526
- pathnameBase: string;
1527
- /**
1528
- * The route object that was used to match.
1529
- */
1530
- route: RouteObjectType;
1531
- }
1532
- interface AgnosticDataRouteMatch extends AgnosticRouteMatch<string, AgnosticDataRouteObject> {
1533
- }
1534
- declare class DeferredData {
1535
- private pendingKeysSet;
1536
- private controller;
1537
- private abortPromise;
1538
- private unlistenAbortSignal;
1539
- private subscribers;
1540
- data: Record<string, unknown>;
1541
- init?: ResponseInit;
1542
- deferredKeys: string[];
1543
- constructor(data: Record<string, unknown>, responseInit?: ResponseInit);
1544
- private trackPromise;
1545
- private onSettle;
1546
- private emit;
1547
- subscribe(fn: (aborted: boolean, settledKey?: string) => void): () => boolean;
1548
- cancel(): void;
1549
- resolveData(signal: AbortSignal): Promise<boolean>;
1550
- get done(): boolean;
1551
- get unwrappedData(): {};
1552
- get pendingKeys(): string[];
1553
- }
1554
-
1555
- /**
1556
- * State maintained internally by the router. During a navigation, all states
1557
- * reflect the the "old" location unless otherwise noted.
1558
- */
1559
- interface RouterState {
1560
- /**
1561
- * The action of the most recent navigation
1562
- */
1563
- historyAction: Action;
1564
- /**
1565
- * The current location reflected by the router
1566
- */
1567
- location: Location;
1568
- /**
1569
- * The current set of route matches
1570
- */
1571
- matches: AgnosticDataRouteMatch[];
1572
- /**
1573
- * Tracks whether we've completed our initial data load
1574
- */
1575
- initialized: boolean;
1576
- /**
1577
- * Current scroll position we should start at for a new view
1578
- * - number -> scroll position to restore to
1579
- * - false -> do not restore scroll at all (used during submissions)
1580
- * - null -> don't have a saved position, scroll to hash or top of page
1581
- */
1582
- restoreScrollPosition: number | false | null;
1583
- /**
1584
- * Indicate whether this navigation should skip resetting the scroll position
1585
- * if we are unable to restore the scroll position
1586
- */
1587
- preventScrollReset: boolean;
1588
- /**
1589
- * Tracks the state of the current navigation
1590
- */
1591
- navigation: Navigation;
1592
- /**
1593
- * Tracks any in-progress revalidations
1594
- */
1595
- revalidation: RevalidationState;
1596
- /**
1597
- * Data from the loaders for the current matches
1598
- */
1599
- loaderData: RouteData;
1600
- /**
1601
- * Data from the action for the current matches
1602
- */
1603
- actionData: RouteData | null;
1604
- /**
1605
- * Errors caught from loaders for the current matches
1606
- */
1607
- errors: RouteData | null;
1608
- /**
1609
- * Map of current fetchers
1610
- */
1611
- fetchers: Map<string, Fetcher>;
1612
- /**
1613
- * Map of current blockers
1614
- */
1615
- blockers: Map<string, Blocker>;
1616
- }
1617
- /**
1618
- * Data that can be passed into hydrate a Router from SSR
1619
- */
1620
- type HydrationState = Partial<Pick<RouterState, "loaderData" | "actionData" | "errors">>;
1621
- /**
1622
- * Potential states for state.navigation
1623
- */
1624
- type NavigationStates = {
1625
- Idle: {
1626
- state: "idle";
1627
- location: undefined;
1628
- formMethod: undefined;
1629
- formAction: undefined;
1630
- formEncType: undefined;
1631
- formData: undefined;
1632
- json: undefined;
1633
- text: undefined;
1634
- };
1635
- Loading: {
1636
- state: "loading";
1637
- location: Location;
1638
- formMethod: Submission["formMethod"] | undefined;
1639
- formAction: Submission["formAction"] | undefined;
1640
- formEncType: Submission["formEncType"] | undefined;
1641
- formData: Submission["formData"] | undefined;
1642
- json: Submission["json"] | undefined;
1643
- text: Submission["text"] | undefined;
1644
- };
1645
- Submitting: {
1646
- state: "submitting";
1647
- location: Location;
1648
- formMethod: Submission["formMethod"];
1649
- formAction: Submission["formAction"];
1650
- formEncType: Submission["formEncType"];
1651
- formData: Submission["formData"];
1652
- json: Submission["json"];
1653
- text: Submission["text"];
1654
- };
1655
- };
1656
- type Navigation = NavigationStates[keyof NavigationStates];
1657
- type RevalidationState = "idle" | "loading";
1658
- /**
1659
- * Potential states for fetchers
1660
- */
1661
- type FetcherStates<TData = any> = {
1662
- Idle: {
1663
- state: "idle";
1664
- formMethod: undefined;
1665
- formAction: undefined;
1666
- formEncType: undefined;
1667
- text: undefined;
1668
- formData: undefined;
1669
- json: undefined;
1670
- data: TData | undefined;
1671
- " _hasFetcherDoneAnything "?: boolean;
1672
- };
1673
- Loading: {
1674
- state: "loading";
1675
- formMethod: Submission["formMethod"] | undefined;
1676
- formAction: Submission["formAction"] | undefined;
1677
- formEncType: Submission["formEncType"] | undefined;
1678
- text: Submission["text"] | undefined;
1679
- formData: Submission["formData"] | undefined;
1680
- json: Submission["json"] | undefined;
1681
- data: TData | undefined;
1682
- " _hasFetcherDoneAnything "?: boolean;
1683
- };
1684
- Submitting: {
1685
- state: "submitting";
1686
- formMethod: Submission["formMethod"];
1687
- formAction: Submission["formAction"];
1688
- formEncType: Submission["formEncType"];
1689
- text: Submission["text"];
1690
- formData: Submission["formData"];
1691
- json: Submission["json"];
1692
- data: TData | undefined;
1693
- " _hasFetcherDoneAnything "?: boolean;
1694
- };
1695
- };
1696
- type Fetcher<TData = any> = FetcherStates<TData>[keyof FetcherStates<TData>];
1697
- interface BlockerBlocked {
1698
- state: "blocked";
1699
- reset(): void;
1700
- proceed(): void;
1701
- location: Location;
1702
- }
1703
- interface BlockerUnblocked {
1704
- state: "unblocked";
1705
- reset: undefined;
1706
- proceed: undefined;
1707
- location: undefined;
1708
- }
1709
- interface BlockerProceeding {
1710
- state: "proceeding";
1711
- reset: undefined;
1712
- proceed: undefined;
1713
- location: Location;
1714
- }
1715
- type Blocker = BlockerUnblocked | BlockerBlocked | BlockerProceeding;
1716
-
1717
- /**
1718
- * NOTE: If you refactor this to split up the modules into separate files,
1719
- * you'll need to update the rollup config for react-router-dom-v5-compat.
1720
- */
1721
-
1722
- declare global {
1723
- var __staticRouterHydrationData: HydrationState | undefined;
1724
- }
1725
-
1726
- declare global {
1727
- interface SymbolConstructor {
1728
- readonly observable: symbol;
1729
- }
1730
- }
1731
-
1732
- declare global {
1733
- var globalProjectAnnotations: NormalizedProjectAnnotations<any>;
1734
- var defaultProjectAnnotations: ProjectAnnotations<any>;
1735
- }
1736
- type WrappedStoryRef = {
1737
- __pw_type: 'jsx';
1738
- props: Record<string, any>;
1739
- } | {
1740
- __pw_type: 'importRef';
1741
- };
1742
- type UnwrappedJSXStoryRef = {
1743
- __pw_type: 'jsx';
1744
- type: UnwrappedImportStoryRef;
1225
+ declare const fullStatusStore: StatusStore & {
1226
+ selectStatuses: (statuses: Status[]) => void;
1227
+ typeId: undefined;
1745
1228
  };
1746
- type UnwrappedImportStoryRef = ComposedStoryFn;
1747
- declare global {
1748
- function __pwUnwrapObject(storyRef: WrappedStoryRef): Promise<UnwrappedJSXStoryRef | UnwrappedImportStoryRef>;
1749
- }
1229
+ declare const getStatusStoreByTypeId: (typeId: StatusTypeId) => StatusStoreByTypeId;
1230
+ declare const useStatusStore: UseStatusStore;
1231
+ declare const universalStatusStore: UniversalStore<StatusesByStoryIdAndTypeId, StatusStoreEvent>;
1750
1232
 
1751
1233
  type TestProviderState = 'test-provider-state:pending' | 'test-provider-state:running' | 'test-provider-state:succeeded' | 'test-provider-state:crashed';
1752
1234
  type TestProviderId = string;
@@ -1996,14 +1478,6 @@ type UseTestProviderStore = <T = TestProviderStateByProviderId>(
1996
1478
  */
1997
1479
  selector?: (state: TestProviderStateByProviderId) => T) => T;
1998
1480
 
1999
- declare const fullStatusStore: StatusStore & {
2000
- selectStatuses: (statuses: Status[]) => void;
2001
- typeId: undefined;
2002
- };
2003
- declare const getStatusStoreByTypeId: (typeId: StatusTypeId) => StatusStoreByTypeId;
2004
- declare const useStatusStore: UseStatusStore;
2005
- declare const universalStatusStore: UniversalStore<StatusesByStoryIdAndTypeId, StatusStoreEvent>;
2006
-
2007
1481
  declare const fullTestProviderStore: {
2008
1482
  settingsChanged: () => void;
2009
1483
  onRunAll: (listener: () => void) => () => void;