storybook 10.0.0-beta.0 → 10.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/_browser-chunks/{WithTooltip-2E62HIBN.js → WithTooltip-ERFLZL6W.js} +1 -1
  2. package/dist/_browser-chunks/{chunk-FWKO3E35.js → chunk-EOILZP2R.js} +3 -1
  3. package/dist/_node-chunks/{builder-manager-OW6YGKXV.js → builder-manager-KCNW2J74.js} +13 -13
  4. package/dist/_node-chunks/{camelcase-2K3EMR6G.js → camelcase-FH5EGUIB.js} +7 -7
  5. package/dist/_node-chunks/{chunk-6JSVPEAU.js → chunk-2E5IZBC2.js} +7 -7
  6. package/dist/_node-chunks/{chunk-JDKH3XYB.js → chunk-2VH25RMB.js} +7 -7
  7. package/dist/_node-chunks/{chunk-FWUE7SRE.js → chunk-2VOEBWNF.js} +7 -7
  8. package/dist/_node-chunks/{chunk-IQAUGVYR.js → chunk-63VGATS4.js} +7 -7
  9. package/dist/_node-chunks/{chunk-5HLANIBM.js → chunk-6A2WP6N7.js} +7 -7
  10. package/dist/_node-chunks/{chunk-YWGNEBRO.js → chunk-6B3CXS7K.js} +7 -7
  11. package/dist/_node-chunks/{chunk-G46DWX7Z.js → chunk-6FPFMFFH.js} +8 -8
  12. package/dist/_node-chunks/{chunk-UHHZPSP7.js → chunk-7DWWXKIE.js} +6 -6
  13. package/dist/_node-chunks/{chunk-MUD3GH3L.js → chunk-B7L5A4BQ.js} +9 -9
  14. package/dist/_node-chunks/{chunk-GZZDIJIB.js → chunk-CGY2ITTD.js} +8 -8
  15. package/dist/_node-chunks/{chunk-GZUNYRFU.js → chunk-CIIY3F53.js} +7 -7
  16. package/dist/_node-chunks/{chunk-CD3IP6HA.js → chunk-CMFB2H3U.js} +12 -12
  17. package/dist/_node-chunks/{chunk-3QB3ZG6H.js → chunk-DPF2NDLD.js} +7 -7
  18. package/dist/_node-chunks/{chunk-2H7LZ2SD.js → chunk-FXPYWCQE.js} +7 -7
  19. package/dist/_node-chunks/{chunk-ANEKBWDX.js → chunk-HSI4BG2J.js} +16 -25
  20. package/dist/_node-chunks/{chunk-UIREEOC7.js → chunk-HSS67Y6T.js} +7 -7
  21. package/dist/_node-chunks/chunk-IAAPNJG4.js +62 -0
  22. package/dist/_node-chunks/{chunk-W6GKFQ7F.js → chunk-IBC4BVDB.js} +7 -7
  23. package/dist/_node-chunks/{chunk-NOQITS3C.js → chunk-JWFNAC5N.js} +7 -7
  24. package/dist/_node-chunks/{chunk-I3YCPGZJ.js → chunk-JZ7ZEAK6.js} +7 -7
  25. package/dist/_node-chunks/{chunk-IBXERYDG.js → chunk-KDKM7KMS.js} +7 -7
  26. package/dist/_node-chunks/{chunk-H5LTFJHQ.js → chunk-MX77OTGN.js} +46 -45
  27. package/dist/_node-chunks/chunk-NNJMYLJM.js +18 -0
  28. package/dist/_node-chunks/{chunk-FBMMEEO4.js → chunk-NTXIDMDM.js} +7 -7
  29. package/dist/_node-chunks/{chunk-7TISOZS6.js → chunk-NUODGCJN.js} +7 -7
  30. package/dist/_node-chunks/{chunk-X5GAZ3EW.js → chunk-NWTLWMJN.js} +8 -8
  31. package/dist/_node-chunks/{chunk-LH3BEEIR.js → chunk-PTT3CRNJ.js} +6 -6
  32. package/dist/_node-chunks/{chunk-NZGJJABJ.js → chunk-RSG3AEWL.js} +16 -16
  33. package/dist/_node-chunks/{chunk-VKKLKNFC.js → chunk-TLM4ECJN.js} +9 -9
  34. package/dist/_node-chunks/{chunk-R7RKO2DC.js → chunk-WBRWBEAS.js} +47029 -18559
  35. package/dist/_node-chunks/{chunk-LKB7KRSV.js → chunk-XWJNZVOR.js} +8 -8
  36. package/dist/_node-chunks/{chunk-BFXER3XW.js → chunk-ZF6AXYHM.js} +7 -7
  37. package/dist/_node-chunks/{default-browser-id-Z6WQ7DZA.js → default-browser-id-YRAH7IMC.js} +7 -7
  38. package/dist/_node-chunks/{dist-465RSKRC.js → dist-G5THJIW5.js} +9 -9
  39. package/dist/_node-chunks/{globby-LJ3MVB6M.js → globby-FGF2JG5Z.js} +9 -9
  40. package/dist/_node-chunks/{lib-OW3DENXB.js → lib-OPOVJQIO.js} +7 -7
  41. package/dist/_node-chunks/{mdx-N42X6CFJ-PYX2IFUO.js → mdx-N42X6CFJ-N5MJA4NM.js} +8 -8
  42. package/dist/_node-chunks/{p-limit-X4OG45RB.js → p-limit-JNDYEQZX.js} +8 -8
  43. package/dist/_node-chunks/{plugin-GE36R32R.js → plugin-6GW4GYGS.js} +10 -12
  44. package/dist/_node-chunks/{plugin-ALTIQMDE.js → plugin-ZL4ZLDWE.js} +10 -10
  45. package/dist/_node-chunks/{webpack-inject-mocker-runtime-plugin-NLCAF7S6.js → webpack-inject-mocker-runtime-plugin-F6BXWV4R.js} +10 -10
  46. package/dist/_node-chunks/{webpack-mock-plugin-BRYODMCC.js → webpack-mock-plugin-5QNP4V3B.js} +9 -11
  47. package/dist/babel/index.js +11 -12
  48. package/dist/bin/core.js +11 -11
  49. package/dist/bin/dispatcher.js +11 -11
  50. package/dist/bin/loader.js +8 -8
  51. package/dist/cli/index.js +20 -21
  52. package/dist/common/index.js +22 -22
  53. package/dist/components/index.d.ts +234 -2
  54. package/dist/components/index.js +3 -6
  55. package/dist/core-server/index.d.ts +540 -39
  56. package/dist/core-server/index.js +36 -36
  57. package/dist/core-server/presets/common-override-preset.js +9 -9
  58. package/dist/core-server/presets/common-preset.js +22 -31
  59. package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +9 -11
  60. package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +10 -12
  61. package/dist/csf-tools/index.js +9 -9
  62. package/dist/manager/globals-runtime.js +4 -5
  63. package/dist/manager/runtime.js +90 -48
  64. package/dist/manager-api/index.d.ts +527 -26
  65. package/dist/manager-api/index.js +1 -1
  66. package/dist/manager-errors.d.ts +527 -0
  67. package/dist/node-logger/index.js +14 -14
  68. package/dist/preview-errors.d.ts +527 -0
  69. package/dist/router/index.d.ts +668 -10
  70. package/dist/server-errors.d.ts +527 -0
  71. package/dist/server-errors.js +10 -10
  72. package/dist/telemetry/index.js +25 -25
  73. package/dist/types/index.d.ts +523 -9
  74. package/package.json +1 -3
  75. package/dist/_node-chunks/chunk-27W2Z6VL.js +0 -28502
  76. package/dist/_node-chunks/chunk-T23YQHYB.js +0 -62
  77. package/dist/_node-chunks/chunk-YUYBO6S7.js +0 -18
@@ -1190,37 +1190,506 @@ declare class MockUniversalStore<State, CustomEvent extends {
1190
1190
  unsubscribeAll(): void;
1191
1191
  }
1192
1192
 
1193
- type StatusValue = 'status-value:pending' | 'status-value:success' | 'status-value:error' | 'status-value:warning' | 'status-value:unknown';
1194
- type StatusTypeId = string;
1195
- type StatusByTypeId = Record<StatusTypeId, Status>;
1196
- type StatusesByStoryIdAndTypeId = Record<StoryId$1, StatusByTypeId>;
1197
- interface Status {
1198
- value: StatusValue;
1199
- typeId: StatusTypeId;
1200
- storyId: StoryId$1;
1201
- title: string;
1202
- description: string;
1203
- data?: any;
1204
- sidebarContextMenu?: boolean;
1193
+ /**
1194
+ * Actions represent the type of change to a location value.
1195
+ */
1196
+ declare enum Action {
1197
+ /**
1198
+ * A POP indicates a change to an arbitrary index in the history stack, such
1199
+ * as a back or forward navigation. It does not describe the direction of the
1200
+ * navigation, only that the current index changed.
1201
+ *
1202
+ * Note: This is the default action for newly created history objects.
1203
+ */
1204
+ Pop = "POP",
1205
+ /**
1206
+ * A PUSH indicates a new entry being added to the history stack, such as when
1207
+ * a link is clicked and a new page loads. When this happens, all subsequent
1208
+ * entries in the stack are lost.
1209
+ */
1210
+ Push = "PUSH",
1211
+ /**
1212
+ * A REPLACE indicates the entry at the current index in the history stack
1213
+ * being replaced by a new one.
1214
+ */
1215
+ Replace = "REPLACE"
1205
1216
  }
1206
- declare const StatusStoreEventType: {
1207
- readonly SELECT: "select";
1217
+ /**
1218
+ * The pathname, search, and hash values of a URL.
1219
+ */
1220
+ interface Path {
1221
+ /**
1222
+ * A URL pathname, beginning with a /.
1223
+ */
1224
+ pathname: string;
1225
+ /**
1226
+ * A URL search string, beginning with a ?.
1227
+ */
1228
+ search: string;
1229
+ /**
1230
+ * A URL fragment identifier, beginning with a #.
1231
+ */
1232
+ hash: string;
1233
+ }
1234
+ /**
1235
+ * An entry in a history stack. A location contains information about the
1236
+ * URL path, as well as possibly some arbitrary state and a key.
1237
+ */
1238
+ interface Location extends Path {
1239
+ /**
1240
+ * A value of arbitrary data associated with this location.
1241
+ */
1242
+ state: any;
1243
+ /**
1244
+ * A unique string associated with this location. May be used to safely store
1245
+ * and retrieve data in some other storage API, like `localStorage`.
1246
+ *
1247
+ * Note: This value is always "default" on the initial location.
1248
+ */
1249
+ key: string;
1250
+ }
1251
+
1252
+ /**
1253
+ * Map of routeId -> data returned from a loader/action/error
1254
+ */
1255
+ interface RouteData {
1256
+ [routeId: string]: any;
1257
+ }
1258
+ declare enum ResultType {
1259
+ data = "data",
1260
+ deferred = "deferred",
1261
+ redirect = "redirect",
1262
+ error = "error"
1263
+ }
1264
+ /**
1265
+ * Successful result from a loader or action
1266
+ */
1267
+ interface SuccessResult {
1268
+ type: ResultType.data;
1269
+ data: any;
1270
+ statusCode?: number;
1271
+ headers?: Headers;
1272
+ }
1273
+ /**
1274
+ * Successful defer() result from a loader or action
1275
+ */
1276
+ interface DeferredResult {
1277
+ type: ResultType.deferred;
1278
+ deferredData: DeferredData;
1279
+ statusCode?: number;
1280
+ headers?: Headers;
1281
+ }
1282
+ /**
1283
+ * Redirect result from a loader or action
1284
+ */
1285
+ interface RedirectResult {
1286
+ type: ResultType.redirect;
1287
+ status: number;
1288
+ location: string;
1289
+ revalidate: boolean;
1290
+ reloadDocument?: boolean;
1291
+ }
1292
+ /**
1293
+ * Unsuccessful result from a loader or action
1294
+ */
1295
+ interface ErrorResult {
1296
+ type: ResultType.error;
1297
+ error: any;
1298
+ headers?: Headers;
1299
+ }
1300
+ /**
1301
+ * Result from a loader or action - potentially successful or unsuccessful
1302
+ */
1303
+ type DataResult = SuccessResult | DeferredResult | RedirectResult | ErrorResult;
1304
+ type LowerCaseFormMethod = "get" | "post" | "put" | "patch" | "delete";
1305
+ type UpperCaseFormMethod = Uppercase<LowerCaseFormMethod>;
1306
+ /**
1307
+ * Active navigation/fetcher form methods are exposed in lowercase on the
1308
+ * RouterState
1309
+ */
1310
+ type FormMethod = LowerCaseFormMethod;
1311
+ /**
1312
+ * In v7, active navigation/fetcher form methods are exposed in uppercase on the
1313
+ * RouterState. This is to align with the normalization done via fetch().
1314
+ */
1315
+ type V7_FormMethod = UpperCaseFormMethod;
1316
+ type FormEncType = "application/x-www-form-urlencoded" | "multipart/form-data" | "application/json" | "text/plain";
1317
+ type JsonObject = {
1318
+ [Key in string]: JsonValue;
1319
+ } & {
1320
+ [Key in string]?: JsonValue | undefined;
1208
1321
  };
1209
- type StatusStoreEvent = {
1210
- type: typeof StatusStoreEventType.SELECT;
1211
- payload: Status[];
1322
+ type JsonArray = JsonValue[] | readonly JsonValue[];
1323
+ type JsonPrimitive = string | number | boolean | null;
1324
+ type JsonValue = JsonPrimitive | JsonObject | JsonArray;
1325
+ /**
1326
+ * @private
1327
+ * Internal interface to pass around for action submissions, not intended for
1328
+ * external consumption
1329
+ */
1330
+ type Submission = {
1331
+ formMethod: FormMethod | V7_FormMethod;
1332
+ formAction: string;
1333
+ formEncType: FormEncType;
1334
+ formData: FormData;
1335
+ json: undefined;
1336
+ text: undefined;
1337
+ } | {
1338
+ formMethod: FormMethod | V7_FormMethod;
1339
+ formAction: string;
1340
+ formEncType: FormEncType;
1341
+ formData: undefined;
1342
+ json: JsonValue;
1343
+ text: undefined;
1344
+ } | {
1345
+ formMethod: FormMethod | V7_FormMethod;
1346
+ formAction: string;
1347
+ formEncType: FormEncType;
1348
+ formData: undefined;
1349
+ json: undefined;
1350
+ text: string;
1212
1351
  };
1213
- type StatusStore = {
1214
- getAll: () => StatusesByStoryIdAndTypeId;
1215
- set: (statuses: Status[]) => void;
1216
- onAllStatusChange: (listener: (statuses: StatusesByStoryIdAndTypeId, previousStatuses: StatusesByStoryIdAndTypeId) => void) => () => void;
1217
- onSelect: (listener: (selectedStatuses: Status[]) => void) => () => void;
1218
- unset: (storyIds?: StoryId$1[]) => void;
1352
+ /**
1353
+ * @private
1354
+ * Arguments passed to route loader/action functions. Same for now but we keep
1355
+ * this as a private implementation detail in case they diverge in the future.
1356
+ */
1357
+ interface DataFunctionArgs {
1358
+ request: Request;
1359
+ params: Params;
1360
+ context?: any;
1361
+ }
1362
+ /**
1363
+ * Arguments passed to loader functions
1364
+ */
1365
+ interface LoaderFunctionArgs extends DataFunctionArgs {
1366
+ }
1367
+ /**
1368
+ * Arguments passed to action functions
1369
+ */
1370
+ interface ActionFunctionArgs extends DataFunctionArgs {
1371
+ }
1372
+ /**
1373
+ * Loaders and actions can return anything except `undefined` (`null` is a
1374
+ * valid return value if there is no data to return). Responses are preferred
1375
+ * and will ease any future migration to Remix
1376
+ */
1377
+ type DataFunctionValue = Response | NonNullable<unknown> | null;
1378
+ /**
1379
+ * Route loader function signature
1380
+ */
1381
+ interface LoaderFunction {
1382
+ (args: LoaderFunctionArgs): Promise<DataFunctionValue> | DataFunctionValue;
1383
+ }
1384
+ /**
1385
+ * Route action function signature
1386
+ */
1387
+ interface ActionFunction {
1388
+ (args: ActionFunctionArgs): Promise<DataFunctionValue> | DataFunctionValue;
1389
+ }
1390
+ /**
1391
+ * Route shouldRevalidate function signature. This runs after any submission
1392
+ * (navigation or fetcher), so we flatten the navigation/fetcher submission
1393
+ * onto the arguments. It shouldn't matter whether it came from a navigation
1394
+ * or a fetcher, what really matters is the URLs and the formData since loaders
1395
+ * have to re-run based on the data models that were potentially mutated.
1396
+ */
1397
+ interface ShouldRevalidateFunction {
1398
+ (args: {
1399
+ currentUrl: URL;
1400
+ currentParams: AgnosticDataRouteMatch["params"];
1401
+ nextUrl: URL;
1402
+ nextParams: AgnosticDataRouteMatch["params"];
1403
+ formMethod?: Submission["formMethod"];
1404
+ formAction?: Submission["formAction"];
1405
+ formEncType?: Submission["formEncType"];
1406
+ text?: Submission["text"];
1407
+ formData?: Submission["formData"];
1408
+ json?: Submission["json"];
1409
+ actionResult?: DataResult;
1410
+ defaultShouldRevalidate: boolean;
1411
+ }): boolean;
1412
+ }
1413
+ /**
1414
+ * Keys we cannot change from within a lazy() function. We spread all other keys
1415
+ * onto the route. Either they're meaningful to the router, or they'll get
1416
+ * ignored.
1417
+ */
1418
+ type ImmutableRouteKey = "lazy" | "caseSensitive" | "path" | "id" | "index" | "children";
1419
+ type RequireOne<T, Key = keyof T> = Exclude<{
1420
+ [K in keyof T]: K extends Key ? Omit<T, K> & Required<Pick<T, K>> : never;
1421
+ }[keyof T], undefined>;
1422
+ /**
1423
+ * lazy() function to load a route definition, which can add non-matching
1424
+ * related properties to a route
1425
+ */
1426
+ interface LazyRouteFunction<R extends AgnosticRouteObject> {
1427
+ (): Promise<RequireOne<Omit<R, ImmutableRouteKey>>>;
1428
+ }
1429
+ /**
1430
+ * Base RouteObject with common props shared by all types of routes
1431
+ */
1432
+ type AgnosticBaseRouteObject = {
1433
+ caseSensitive?: boolean;
1434
+ path?: string;
1435
+ id?: string;
1436
+ loader?: LoaderFunction;
1437
+ action?: ActionFunction;
1438
+ hasErrorBoundary?: boolean;
1439
+ shouldRevalidate?: ShouldRevalidateFunction;
1440
+ handle?: any;
1441
+ lazy?: LazyRouteFunction<AgnosticBaseRouteObject>;
1219
1442
  };
1220
- type StatusStoreByTypeId = StatusStore & {
1221
- typeId: StatusTypeId;
1443
+ /**
1444
+ * Index routes must not have children
1445
+ */
1446
+ type AgnosticIndexRouteObject = AgnosticBaseRouteObject & {
1447
+ children?: undefined;
1448
+ index: true;
1222
1449
  };
1223
- type UseStatusStore = <T = StatusesByStoryIdAndTypeId>(selector?: (statuses: StatusesByStoryIdAndTypeId) => T) => T;
1450
+ /**
1451
+ * Non-index routes may have children, but cannot have index
1452
+ */
1453
+ type AgnosticNonIndexRouteObject = AgnosticBaseRouteObject & {
1454
+ children?: AgnosticRouteObject[];
1455
+ index?: false;
1456
+ };
1457
+ /**
1458
+ * A route object represents a logical route, with (optionally) its child
1459
+ * routes organized in a tree-like structure.
1460
+ */
1461
+ type AgnosticRouteObject = AgnosticIndexRouteObject | AgnosticNonIndexRouteObject;
1462
+ type AgnosticDataIndexRouteObject = AgnosticIndexRouteObject & {
1463
+ id: string;
1464
+ };
1465
+ type AgnosticDataNonIndexRouteObject = AgnosticNonIndexRouteObject & {
1466
+ children?: AgnosticDataRouteObject[];
1467
+ id: string;
1468
+ };
1469
+ /**
1470
+ * A data route object, which is just a RouteObject with a required unique ID
1471
+ */
1472
+ type AgnosticDataRouteObject = AgnosticDataIndexRouteObject | AgnosticDataNonIndexRouteObject;
1473
+ /**
1474
+ * The parameters that were parsed from the URL path.
1475
+ */
1476
+ type Params<Key extends string = string> = {
1477
+ readonly [key in Key]: string | undefined;
1478
+ };
1479
+ /**
1480
+ * A RouteMatch contains info about how a route matched a URL.
1481
+ */
1482
+ interface AgnosticRouteMatch<ParamKey extends string = string, RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject> {
1483
+ /**
1484
+ * The names and values of dynamic parameters in the URL.
1485
+ */
1486
+ params: Params<ParamKey>;
1487
+ /**
1488
+ * The portion of the URL pathname that was matched.
1489
+ */
1490
+ pathname: string;
1491
+ /**
1492
+ * The portion of the URL pathname that was matched before child routes.
1493
+ */
1494
+ pathnameBase: string;
1495
+ /**
1496
+ * The route object that was used to match.
1497
+ */
1498
+ route: RouteObjectType;
1499
+ }
1500
+ interface AgnosticDataRouteMatch extends AgnosticRouteMatch<string, AgnosticDataRouteObject> {
1501
+ }
1502
+ declare class DeferredData {
1503
+ private pendingKeysSet;
1504
+ private controller;
1505
+ private abortPromise;
1506
+ private unlistenAbortSignal;
1507
+ private subscribers;
1508
+ data: Record<string, unknown>;
1509
+ init?: ResponseInit;
1510
+ deferredKeys: string[];
1511
+ constructor(data: Record<string, unknown>, responseInit?: ResponseInit);
1512
+ private trackPromise;
1513
+ private onSettle;
1514
+ private emit;
1515
+ subscribe(fn: (aborted: boolean, settledKey?: string) => void): () => boolean;
1516
+ cancel(): void;
1517
+ resolveData(signal: AbortSignal): Promise<boolean>;
1518
+ get done(): boolean;
1519
+ get unwrappedData(): {};
1520
+ get pendingKeys(): string[];
1521
+ }
1522
+
1523
+ /**
1524
+ * State maintained internally by the router. During a navigation, all states
1525
+ * reflect the the "old" location unless otherwise noted.
1526
+ */
1527
+ interface RouterState {
1528
+ /**
1529
+ * The action of the most recent navigation
1530
+ */
1531
+ historyAction: Action;
1532
+ /**
1533
+ * The current location reflected by the router
1534
+ */
1535
+ location: Location;
1536
+ /**
1537
+ * The current set of route matches
1538
+ */
1539
+ matches: AgnosticDataRouteMatch[];
1540
+ /**
1541
+ * Tracks whether we've completed our initial data load
1542
+ */
1543
+ initialized: boolean;
1544
+ /**
1545
+ * Current scroll position we should start at for a new view
1546
+ * - number -> scroll position to restore to
1547
+ * - false -> do not restore scroll at all (used during submissions)
1548
+ * - null -> don't have a saved position, scroll to hash or top of page
1549
+ */
1550
+ restoreScrollPosition: number | false | null;
1551
+ /**
1552
+ * Indicate whether this navigation should skip resetting the scroll position
1553
+ * if we are unable to restore the scroll position
1554
+ */
1555
+ preventScrollReset: boolean;
1556
+ /**
1557
+ * Tracks the state of the current navigation
1558
+ */
1559
+ navigation: Navigation;
1560
+ /**
1561
+ * Tracks any in-progress revalidations
1562
+ */
1563
+ revalidation: RevalidationState;
1564
+ /**
1565
+ * Data from the loaders for the current matches
1566
+ */
1567
+ loaderData: RouteData;
1568
+ /**
1569
+ * Data from the action for the current matches
1570
+ */
1571
+ actionData: RouteData | null;
1572
+ /**
1573
+ * Errors caught from loaders for the current matches
1574
+ */
1575
+ errors: RouteData | null;
1576
+ /**
1577
+ * Map of current fetchers
1578
+ */
1579
+ fetchers: Map<string, Fetcher>;
1580
+ /**
1581
+ * Map of current blockers
1582
+ */
1583
+ blockers: Map<string, Blocker>;
1584
+ }
1585
+ /**
1586
+ * Data that can be passed into hydrate a Router from SSR
1587
+ */
1588
+ type HydrationState = Partial<Pick<RouterState, "loaderData" | "actionData" | "errors">>;
1589
+ /**
1590
+ * Potential states for state.navigation
1591
+ */
1592
+ type NavigationStates = {
1593
+ Idle: {
1594
+ state: "idle";
1595
+ location: undefined;
1596
+ formMethod: undefined;
1597
+ formAction: undefined;
1598
+ formEncType: undefined;
1599
+ formData: undefined;
1600
+ json: undefined;
1601
+ text: undefined;
1602
+ };
1603
+ Loading: {
1604
+ state: "loading";
1605
+ location: Location;
1606
+ formMethod: Submission["formMethod"] | undefined;
1607
+ formAction: Submission["formAction"] | undefined;
1608
+ formEncType: Submission["formEncType"] | undefined;
1609
+ formData: Submission["formData"] | undefined;
1610
+ json: Submission["json"] | undefined;
1611
+ text: Submission["text"] | undefined;
1612
+ };
1613
+ Submitting: {
1614
+ state: "submitting";
1615
+ location: Location;
1616
+ formMethod: Submission["formMethod"];
1617
+ formAction: Submission["formAction"];
1618
+ formEncType: Submission["formEncType"];
1619
+ formData: Submission["formData"];
1620
+ json: Submission["json"];
1621
+ text: Submission["text"];
1622
+ };
1623
+ };
1624
+ type Navigation = NavigationStates[keyof NavigationStates];
1625
+ type RevalidationState = "idle" | "loading";
1626
+ /**
1627
+ * Potential states for fetchers
1628
+ */
1629
+ type FetcherStates<TData = any> = {
1630
+ Idle: {
1631
+ state: "idle";
1632
+ formMethod: undefined;
1633
+ formAction: undefined;
1634
+ formEncType: undefined;
1635
+ text: undefined;
1636
+ formData: undefined;
1637
+ json: undefined;
1638
+ data: TData | undefined;
1639
+ " _hasFetcherDoneAnything "?: boolean;
1640
+ };
1641
+ Loading: {
1642
+ state: "loading";
1643
+ formMethod: Submission["formMethod"] | undefined;
1644
+ formAction: Submission["formAction"] | undefined;
1645
+ formEncType: Submission["formEncType"] | undefined;
1646
+ text: Submission["text"] | undefined;
1647
+ formData: Submission["formData"] | undefined;
1648
+ json: Submission["json"] | undefined;
1649
+ data: TData | undefined;
1650
+ " _hasFetcherDoneAnything "?: boolean;
1651
+ };
1652
+ Submitting: {
1653
+ state: "submitting";
1654
+ formMethod: Submission["formMethod"];
1655
+ formAction: Submission["formAction"];
1656
+ formEncType: Submission["formEncType"];
1657
+ text: Submission["text"];
1658
+ formData: Submission["formData"];
1659
+ json: Submission["json"];
1660
+ data: TData | undefined;
1661
+ " _hasFetcherDoneAnything "?: boolean;
1662
+ };
1663
+ };
1664
+ type Fetcher<TData = any> = FetcherStates<TData>[keyof FetcherStates<TData>];
1665
+ interface BlockerBlocked {
1666
+ state: "blocked";
1667
+ reset(): void;
1668
+ proceed(): void;
1669
+ location: Location;
1670
+ }
1671
+ interface BlockerUnblocked {
1672
+ state: "unblocked";
1673
+ reset: undefined;
1674
+ proceed: undefined;
1675
+ location: undefined;
1676
+ }
1677
+ interface BlockerProceeding {
1678
+ state: "proceeding";
1679
+ reset: undefined;
1680
+ proceed: undefined;
1681
+ location: Location;
1682
+ }
1683
+ type Blocker = BlockerUnblocked | BlockerBlocked | BlockerProceeding;
1684
+
1685
+ /**
1686
+ * NOTE: If you refactor this to split up the modules into separate files,
1687
+ * you'll need to update the rollup config for react-router-dom-v5-compat.
1688
+ */
1689
+
1690
+ declare global {
1691
+ var __staticRouterHydrationData: HydrationState | undefined;
1692
+ }
1224
1693
 
1225
1694
  declare global {
1226
1695
  interface SymbolConstructor {
@@ -1495,6 +1964,38 @@ type UseTestProviderStore = <T = TestProviderStateByProviderId>(
1495
1964
  */
1496
1965
  selector?: (state: TestProviderStateByProviderId) => T) => T;
1497
1966
 
1967
+ type StatusValue = 'status-value:pending' | 'status-value:success' | 'status-value:error' | 'status-value:warning' | 'status-value:unknown';
1968
+ type StatusTypeId = string;
1969
+ type StatusByTypeId = Record<StatusTypeId, Status>;
1970
+ type StatusesByStoryIdAndTypeId = Record<StoryId$1, StatusByTypeId>;
1971
+ interface Status {
1972
+ value: StatusValue;
1973
+ typeId: StatusTypeId;
1974
+ storyId: StoryId$1;
1975
+ title: string;
1976
+ description: string;
1977
+ data?: any;
1978
+ sidebarContextMenu?: boolean;
1979
+ }
1980
+ declare const StatusStoreEventType: {
1981
+ readonly SELECT: "select";
1982
+ };
1983
+ type StatusStoreEvent = {
1984
+ type: typeof StatusStoreEventType.SELECT;
1985
+ payload: Status[];
1986
+ };
1987
+ type StatusStore = {
1988
+ getAll: () => StatusesByStoryIdAndTypeId;
1989
+ set: (statuses: Status[]) => void;
1990
+ onAllStatusChange: (listener: (statuses: StatusesByStoryIdAndTypeId, previousStatuses: StatusesByStoryIdAndTypeId) => void) => () => void;
1991
+ onSelect: (listener: (selectedStatuses: Status[]) => void) => () => void;
1992
+ unset: (storyIds?: StoryId$1[]) => void;
1993
+ };
1994
+ type StatusStoreByTypeId = StatusStore & {
1995
+ typeId: StatusTypeId;
1996
+ };
1997
+ type UseStatusStore = <T = StatusesByStoryIdAndTypeId>(selector?: (statuses: StatusesByStoryIdAndTypeId) => T) => T;
1998
+
1498
1999
  declare const fullStatusStore: StatusStore & {
1499
2000
  selectStatuses: (statuses: Status[]) => void;
1500
2001
  typeId: undefined;
@@ -3016,7 +3016,7 @@ import { global as global8 } from "@storybook/global";
3016
3016
  import semver from "semver";
3017
3017
 
3018
3018
  // src/manager-api/version.ts
3019
- var version = "10.0.0-beta.0";
3019
+ var version = "10.0.0-beta.2";
3020
3020
 
3021
3021
  // src/manager-api/modules/versions.ts
3022
3022
  var { VERSIONCHECK } = global8;