storybook 9.1.5 → 9.1.7
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 +43 -43
- package/dist/bin/index.js +43 -43
- package/dist/cli/bin/index.cjs +1 -1
- package/dist/cli/bin/index.js +1 -1
- package/dist/common/index.cjs +43 -43
- package/dist/common/index.js +43 -43
- package/dist/core-server/index.cjs +1 -1
- package/dist/core-server/index.js +1 -1
- package/dist/csf/index.cjs +4 -1
- package/dist/csf/index.js +4 -1
- package/dist/manager/globals-runtime.js +10802 -10787
- package/dist/manager-api/index.cjs +1 -1
- package/dist/manager-api/index.d.ts +534 -8
- package/dist/manager-api/index.js +1 -1
- package/dist/preview/runtime.js +6 -2
- package/dist/telemetry/index.cjs +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/test/index.cjs +2 -1
- package/dist/test/index.js +149 -148
- package/package.json +1 -1
|
@@ -4414,7 +4414,7 @@ U(wr, {
|
|
|
4414
4414
|
var kt = require("@storybook/global"), nn = L(rr(), 1), $ = L(require("semver"), 1);
|
|
4415
4415
|
|
|
4416
4416
|
// src/manager-api/version.ts
|
|
4417
|
-
var rn = "9.1.
|
|
4417
|
+
var rn = "9.1.7";
|
|
4418
4418
|
|
|
4419
4419
|
// src/manager-api/modules/versions.ts
|
|
4420
4420
|
var { VERSIONCHECK: Zs } = kt.global, on = (0, nn.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 } 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, NormalizedProjectAnnotations, ProjectAnnotations, ComposedStoryFn } 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: () => "
|
|
391
|
+
declare const controlOrMetaKey: () => "meta" | "control";
|
|
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,13 +1222,531 @@ type StatusStoreByTypeId = StatusStore & {
|
|
|
1222
1222
|
};
|
|
1223
1223
|
type UseStatusStore = <T = StatusesByStoryIdAndTypeId>(selector?: (statuses: StatusesByStoryIdAndTypeId) => T) => T;
|
|
1224
1224
|
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
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;
|
|
1228
1353
|
};
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
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;
|
|
1745
|
+
};
|
|
1746
|
+
type UnwrappedImportStoryRef = ComposedStoryFn;
|
|
1747
|
+
declare global {
|
|
1748
|
+
function __pwUnwrapObject(storyRef: WrappedStoryRef): Promise<UnwrappedJSXStoryRef | UnwrappedImportStoryRef>;
|
|
1749
|
+
}
|
|
1232
1750
|
|
|
1233
1751
|
type TestProviderState = 'test-provider-state:pending' | 'test-provider-state:running' | 'test-provider-state:succeeded' | 'test-provider-state:crashed';
|
|
1234
1752
|
type TestProviderId = string;
|
|
@@ -1478,6 +1996,14 @@ type UseTestProviderStore = <T = TestProviderStateByProviderId>(
|
|
|
1478
1996
|
*/
|
|
1479
1997
|
selector?: (state: TestProviderStateByProviderId) => T) => T;
|
|
1480
1998
|
|
|
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
|
+
|
|
1481
2007
|
declare const fullTestProviderStore: {
|
|
1482
2008
|
settingsChanged: () => void;
|
|
1483
2009
|
onRunAll: (listener: () => void) => () => void;
|
|
@@ -3228,7 +3228,7 @@ import { global as Sr } from "@storybook/global";
|
|
|
3228
3228
|
import $ from "semver";
|
|
3229
3229
|
|
|
3230
3230
|
// src/manager-api/version.ts
|
|
3231
|
-
var jo = "9.1.
|
|
3231
|
+
var jo = "9.1.7";
|
|
3232
3232
|
|
|
3233
3233
|
// src/manager-api/modules/versions.ts
|
|
3234
3234
|
var { VERSIONCHECK: ua } = Sr, ko = (0, Do.default)(1)(() => {
|
package/dist/preview/runtime.js
CHANGED
|
@@ -38335,6 +38335,7 @@ var ha = {
|
|
|
38335
38335
|
var BT = rr(
|
|
38336
38336
|
{ ...cT },
|
|
38337
38337
|
{
|
|
38338
|
+
getKeys: /* @__PURE__ */ o((e) => Object.keys(e).filter((t) => t !== "eventWrapper"), "getKeys"),
|
|
38338
38339
|
intercept: /* @__PURE__ */ o((e, t) => t[0] === "fireEvent" || e.startsWith("find") || e.startsWith("waitFor"), "intercept")
|
|
38339
38340
|
}
|
|
38340
38341
|
);
|
|
@@ -38421,7 +38422,7 @@ var {
|
|
|
38421
38422
|
prettyFormat: Gve
|
|
38422
38423
|
} = BT, UT = ha, { userEvent: Wve } = rr(
|
|
38423
38424
|
{ userEvent: ha },
|
|
38424
|
-
{ intercept: !0 }
|
|
38425
|
+
{ intercept: !0, getKeys: /* @__PURE__ */ o((e) => Object.keys(e).filter((t) => t !== "eventWrapper"), "getKeys") }
|
|
38425
38426
|
);
|
|
38426
38427
|
|
|
38427
38428
|
// src/test/index.ts
|
|
@@ -40055,7 +40056,10 @@ var AEe = /* @__PURE__ */ o(({ parameters: e }) => {
|
|
|
40055
40056
|
if (t) {
|
|
40056
40057
|
e.userEvent = rr(
|
|
40057
40058
|
{ userEvent: UT.setup() },
|
|
40058
|
-
{
|
|
40059
|
+
{
|
|
40060
|
+
intercept: !0,
|
|
40061
|
+
getKeys: /* @__PURE__ */ o((n) => Object.keys(n).filter((i) => i !== "eventWrapper"), "getKeys")
|
|
40062
|
+
}
|
|
40059
40063
|
).userEvent, Object.defineProperty(globalThis.window.navigator, "clipboard", {
|
|
40060
40064
|
get: /* @__PURE__ */ o(() => t, "get"),
|
|
40061
40065
|
configurable: !0
|
package/dist/telemetry/index.cjs
CHANGED
|
@@ -4128,7 +4128,7 @@ async function qn(t) {
|
|
|
4128
4128
|
o(qn, "findPackage");
|
|
4129
4129
|
|
|
4130
4130
|
// package.json
|
|
4131
|
-
var wt = "9.1.
|
|
4131
|
+
var wt = "9.1.7";
|
|
4132
4132
|
|
|
4133
4133
|
// src/cli/globalSettings.ts
|
|
4134
4134
|
var At = T(require("node:fs/promises"), 1), xs = require("node:os"), Zt = require("node:path"), vs = T(Gn(), 1), Ne = T(gs(), 1);
|
package/dist/telemetry/index.js
CHANGED
package/dist/test/index.cjs
CHANGED
|
@@ -34941,6 +34941,7 @@ var yme = Li(Ft(), 1), PE = Li(oB(), 1), sB = require("storybook/internal/client
|
|
|
34941
34941
|
var qE = (0, xE.instrument)(
|
|
34942
34942
|
{ ...yme },
|
|
34943
34943
|
{
|
|
34944
|
+
getKeys: /* @__PURE__ */ o((e) => Object.keys(e).filter((t) => t !== "eventWrapper"), "getKeys"),
|
|
34944
34945
|
intercept: /* @__PURE__ */ o((e, t) => t[0] === "fireEvent" || e.startsWith("find") || e.startsWith("waitFor"), "intercept")
|
|
34945
34946
|
}
|
|
34946
34947
|
);
|
|
@@ -35027,7 +35028,7 @@ var {
|
|
|
35027
35028
|
prettyFormat: jhe
|
|
35028
35029
|
} = qE, $he = PE.userEvent, { userEvent: Lhe } = (0, xE.instrument)(
|
|
35029
35030
|
{ userEvent: PE.userEvent },
|
|
35030
|
-
{ intercept: !0 }
|
|
35031
|
+
{ intercept: !0, getKeys: /* @__PURE__ */ o((e) => Object.keys(e).filter((t) => t !== "eventWrapper"), "getKeys") }
|
|
35031
35032
|
);
|
|
35032
35033
|
|
|
35033
35034
|
// src/test/index.ts
|