storybook 10.0.0-beta.1 → 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 (73) hide show
  1. package/dist/_node-chunks/{builder-manager-EXW4ETLN.js → builder-manager-KCNW2J74.js} +13 -13
  2. package/dist/_node-chunks/{camelcase-VZZFWA2L.js → camelcase-FH5EGUIB.js} +7 -7
  3. package/dist/_node-chunks/{chunk-F5J33SXQ.js → chunk-2E5IZBC2.js} +7 -7
  4. package/dist/_node-chunks/{chunk-ZMV3WY6R.js → chunk-2VH25RMB.js} +7 -7
  5. package/dist/_node-chunks/{chunk-FZP2YGG3.js → chunk-2VOEBWNF.js} +7 -7
  6. package/dist/_node-chunks/{chunk-24TGL6EX.js → chunk-63VGATS4.js} +7 -7
  7. package/dist/_node-chunks/{chunk-ICPKUV5G.js → chunk-6A2WP6N7.js} +7 -7
  8. package/dist/_node-chunks/{chunk-5ZX5SJOP.js → chunk-6B3CXS7K.js} +7 -7
  9. package/dist/_node-chunks/{chunk-QJTT4OC2.js → chunk-6FPFMFFH.js} +8 -8
  10. package/dist/_node-chunks/{chunk-VNLBDN2Z.js → chunk-7DWWXKIE.js} +6 -6
  11. package/dist/_node-chunks/{chunk-2QZOLZDJ.js → chunk-B7L5A4BQ.js} +9 -9
  12. package/dist/_node-chunks/{chunk-32JYCD74.js → chunk-CGY2ITTD.js} +8 -8
  13. package/dist/_node-chunks/{chunk-EDBXIJN5.js → chunk-CIIY3F53.js} +7 -7
  14. package/dist/_node-chunks/{chunk-2G5THETV.js → chunk-CMFB2H3U.js} +12 -12
  15. package/dist/_node-chunks/{chunk-6CCUFDHU.js → chunk-DPF2NDLD.js} +7 -7
  16. package/dist/_node-chunks/{chunk-U45F2NP6.js → chunk-FXPYWCQE.js} +7 -7
  17. package/dist/_node-chunks/{chunk-3SGKBLOL.js → chunk-HSI4BG2J.js} +8 -8
  18. package/dist/_node-chunks/{chunk-CM3UGTR5.js → chunk-HSS67Y6T.js} +7 -7
  19. package/dist/_node-chunks/chunk-IAAPNJG4.js +62 -0
  20. package/dist/_node-chunks/{chunk-LAUOYAOX.js → chunk-IBC4BVDB.js} +7 -7
  21. package/dist/_node-chunks/{chunk-QC5FE2D7.js → chunk-JWFNAC5N.js} +7 -7
  22. package/dist/_node-chunks/{chunk-WDKWVNL2.js → chunk-JZ7ZEAK6.js} +7 -7
  23. package/dist/_node-chunks/{chunk-5V6QH7WC.js → chunk-KDKM7KMS.js} +7 -7
  24. package/dist/_node-chunks/{chunk-EO4S3VXL.js → chunk-MX77OTGN.js} +22 -22
  25. package/dist/_node-chunks/chunk-NNJMYLJM.js +18 -0
  26. package/dist/_node-chunks/{chunk-XTSBFCVE.js → chunk-NTXIDMDM.js} +7 -7
  27. package/dist/_node-chunks/{chunk-PMEEE3UE.js → chunk-NUODGCJN.js} +7 -7
  28. package/dist/_node-chunks/{chunk-GVCXNIAA.js → chunk-NWTLWMJN.js} +8 -8
  29. package/dist/_node-chunks/{chunk-SUMFFLGF.js → chunk-PTT3CRNJ.js} +6 -6
  30. package/dist/_node-chunks/{chunk-PL2PKDRO.js → chunk-RSG3AEWL.js} +16 -16
  31. package/dist/_node-chunks/{chunk-V2ZF4DUD.js → chunk-TLM4ECJN.js} +9 -9
  32. package/dist/_node-chunks/{chunk-WP7DV5JT.js → chunk-WBRWBEAS.js} +10 -10
  33. package/dist/_node-chunks/{chunk-3ZKQWDCG.js → chunk-XWJNZVOR.js} +8 -8
  34. package/dist/_node-chunks/{chunk-4WNZYNQY.js → chunk-ZF6AXYHM.js} +7 -7
  35. package/dist/_node-chunks/{default-browser-id-JNATP42X.js → default-browser-id-YRAH7IMC.js} +7 -7
  36. package/dist/_node-chunks/{dist-VZL6D6Y3.js → dist-G5THJIW5.js} +9 -9
  37. package/dist/_node-chunks/{globby-GZXJJ4W6.js → globby-FGF2JG5Z.js} +9 -9
  38. package/dist/_node-chunks/{lib-PHT5GCV2.js → lib-OPOVJQIO.js} +7 -7
  39. package/dist/_node-chunks/{mdx-N42X6CFJ-EPDIV4A2.js → mdx-N42X6CFJ-N5MJA4NM.js} +8 -8
  40. package/dist/_node-chunks/{p-limit-AJIFSZTI.js → p-limit-JNDYEQZX.js} +8 -8
  41. package/dist/_node-chunks/{plugin-AV4OEKYM.js → plugin-6GW4GYGS.js} +10 -10
  42. package/dist/_node-chunks/{plugin-3VI56CEF.js → plugin-ZL4ZLDWE.js} +10 -10
  43. package/dist/_node-chunks/{webpack-inject-mocker-runtime-plugin-E7J5FKLA.js → webpack-inject-mocker-runtime-plugin-F6BXWV4R.js} +10 -10
  44. package/dist/_node-chunks/{webpack-mock-plugin-VTYGW7HO.js → webpack-mock-plugin-5QNP4V3B.js} +9 -9
  45. package/dist/babel/index.js +11 -11
  46. package/dist/bin/core.js +11 -11
  47. package/dist/bin/dispatcher.js +11 -11
  48. package/dist/bin/loader.js +8 -8
  49. package/dist/cli/index.js +20 -20
  50. package/dist/common/index.js +22 -22
  51. package/dist/components/index.d.ts +228 -1
  52. package/dist/core-server/index.d.ts +515 -14
  53. package/dist/core-server/index.js +36 -36
  54. package/dist/core-server/presets/common-override-preset.js +9 -9
  55. package/dist/core-server/presets/common-preset.js +22 -31
  56. package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +9 -9
  57. package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +10 -10
  58. package/dist/csf-tools/index.js +9 -9
  59. package/dist/manager/globals-runtime.js +1 -1
  60. package/dist/manager/runtime.js +1 -12
  61. package/dist/manager-api/index.d.ts +502 -1
  62. package/dist/manager-api/index.js +1 -1
  63. package/dist/manager-errors.d.ts +501 -0
  64. package/dist/node-logger/index.js +14 -14
  65. package/dist/preview-errors.d.ts +501 -0
  66. package/dist/router/index.d.ts +668 -10
  67. package/dist/server-errors.d.ts +501 -0
  68. package/dist/server-errors.js +10 -10
  69. package/dist/telemetry/index.js +25 -25
  70. package/dist/types/index.d.ts +523 -9
  71. package/package.json +1 -3
  72. package/dist/_node-chunks/chunk-GE6I3YYG.js +0 -62
  73. package/dist/_node-chunks/chunk-KXCNXWXI.js +0 -18
@@ -1,7 +1,6 @@
1
- import { StoryId as StoryId$1, StoryName, ComponentTitle, Tag as Tag$1, Parameters, Args, ArgTypes, ComponentId, StoryKind, Globals as Globals$1, GlobalTypes as GlobalTypes$1, InputType, Renderer, StoryContext, PartialStoryFn, LegacyStoryFn, ArgsStoryFn, StoryFn, DecoratorFunction, LoaderFunction, ViewMode as ViewMode$1, StoryIdentifier, ProjectAnnotations as ProjectAnnotations$1, StrictArgTypes, StrictGlobalTypes, StepRunner, BeforeAll, ComponentAnnotations, StoryAnnotations, StoryContextForEnhancers, CleanupCallback, Canvas, StoryAnnotationsOrFn, AnnotatedStoryFn } from 'storybook/internal/csf';
1
+ import { StoryId as StoryId$1, StoryName, ComponentTitle, Tag as Tag$1, Parameters, Args, ArgTypes, ComponentId, StoryKind, Globals as Globals$1, GlobalTypes as GlobalTypes$1, InputType, Renderer, StoryContext, PartialStoryFn, LegacyStoryFn, ArgsStoryFn, StoryFn, DecoratorFunction, LoaderFunction as LoaderFunction$1, ViewMode as ViewMode$1, StoryIdentifier, ProjectAnnotations as ProjectAnnotations$1, StrictArgTypes, StrictGlobalTypes, StepRunner, BeforeAll, ComponentAnnotations, StoryAnnotations, StoryContextForEnhancers, CleanupCallback, Canvas, StoryAnnotationsOrFn, AnnotatedStoryFn } from 'storybook/internal/csf';
2
2
  export { AfterEach, AnnotatedStoryFn, ArgTypes, ArgTypesEnhancer, Args, ArgsEnhancer, ArgsFromMeta, ArgsStoryFn, BaseAnnotations, ProjectAnnotations as BaseProjectAnnotations, BeforeAll, BeforeEach, Canvas, CleanupCallback, ComponentAnnotations, ComponentId, ComponentTitle, Conditional, DecoratorApplicator, DecoratorFunction, GlobalTypes, Globals, IncludeExcludeOptions, InputType, LegacyAnnotatedStoryFn, LegacyStoryAnnotationsOrFn, LegacyStoryFn, LoaderFunction, Parameters, PartialStoryFn, PlayFunction, PlayFunctionContext, Renderer, SBArrayType, SBEnumType, SBIntersectionType, SBObjectType, SBOtherType, SBScalarType, SBType, SBUnionType, SeparatorOptions, StepFunction, StepLabel, StepRunner, StoryAnnotations, StoryAnnotationsOrFn, StoryContext, StoryContextForEnhancers, StoryContextForLoaders, StoryContextUpdate, StoryFn, StoryId, StoryIdentifier, StoryKind, StoryName, StrictArgTypes, StrictArgs, StrictGlobalTypes, StrictInputType, Tag } from 'storybook/internal/csf';
3
3
  import { ReactElement, FC, ReactNode, PropsWithChildren } from 'react';
4
- import * as R from 'react-router-dom';
5
4
  import { RouterData as RouterData$1 } from 'storybook/internal/router';
6
5
  import { Globals, GlobalTypes, API_Layout as API_Layout$1, API_LayoutCustomisations as API_LayoutCustomisations$1, API_UI as API_UI$1, API_Notification as API_Notification$1, API_Refs as API_Refs$1, API_Settings as API_Settings$1, API_LoadedRefData as API_LoadedRefData$1, StoryId, API_PreparedStoryIndex as API_PreparedStoryIndex$1, API_ViewMode as API_ViewMode$1, API_FilterFunction as API_FilterFunction$1, API_Versions as API_Versions$2, API_UnknownEntries as API_UnknownEntries$1, API_OptionsData as API_OptionsData$1, NormalizedProjectAnnotations as NormalizedProjectAnnotations$1, ProjectAnnotations as ProjectAnnotations$2, ComposedStoryFn as ComposedStoryFn$1 } from 'storybook/internal/types';
7
6
  import { ThemeVars as ThemeVars$1 } from 'storybook/theming';
@@ -11,6 +10,521 @@ import { Server, IncomingMessage, ServerResponse } from 'http';
11
10
  import { Server as Server$1 } from 'net';
12
11
  import { Channel as Channel$1 } from 'storybook/internal/channels';
13
12
 
13
+ /**
14
+ * Actions represent the type of change to a location value.
15
+ */
16
+ declare enum Action {
17
+ /**
18
+ * A POP indicates a change to an arbitrary index in the history stack, such
19
+ * as a back or forward navigation. It does not describe the direction of the
20
+ * navigation, only that the current index changed.
21
+ *
22
+ * Note: This is the default action for newly created history objects.
23
+ */
24
+ Pop = "POP",
25
+ /**
26
+ * A PUSH indicates a new entry being added to the history stack, such as when
27
+ * a link is clicked and a new page loads. When this happens, all subsequent
28
+ * entries in the stack are lost.
29
+ */
30
+ Push = "PUSH",
31
+ /**
32
+ * A REPLACE indicates the entry at the current index in the history stack
33
+ * being replaced by a new one.
34
+ */
35
+ Replace = "REPLACE"
36
+ }
37
+ /**
38
+ * The pathname, search, and hash values of a URL.
39
+ */
40
+ interface Path$1 {
41
+ /**
42
+ * A URL pathname, beginning with a /.
43
+ */
44
+ pathname: string;
45
+ /**
46
+ * A URL search string, beginning with a ?.
47
+ */
48
+ search: string;
49
+ /**
50
+ * A URL fragment identifier, beginning with a #.
51
+ */
52
+ hash: string;
53
+ }
54
+ /**
55
+ * An entry in a history stack. A location contains information about the
56
+ * URL path, as well as possibly some arbitrary state and a key.
57
+ */
58
+ interface Location extends Path$1 {
59
+ /**
60
+ * A value of arbitrary data associated with this location.
61
+ */
62
+ state: any;
63
+ /**
64
+ * A unique string associated with this location. May be used to safely store
65
+ * and retrieve data in some other storage API, like `localStorage`.
66
+ *
67
+ * Note: This value is always "default" on the initial location.
68
+ */
69
+ key: string;
70
+ }
71
+ /**
72
+ * Describes a location that is the destination of some navigation, either via
73
+ * `history.push` or `history.replace`. May be either a URL or the pieces of a
74
+ * URL path.
75
+ */
76
+ type To = string | Partial<Path$1>;
77
+
78
+ /**
79
+ * Map of routeId -> data returned from a loader/action/error
80
+ */
81
+ interface RouteData {
82
+ [routeId: string]: any;
83
+ }
84
+ declare enum ResultType {
85
+ data = "data",
86
+ deferred = "deferred",
87
+ redirect = "redirect",
88
+ error = "error"
89
+ }
90
+ /**
91
+ * Successful result from a loader or action
92
+ */
93
+ interface SuccessResult {
94
+ type: ResultType.data;
95
+ data: any;
96
+ statusCode?: number;
97
+ headers?: Headers;
98
+ }
99
+ /**
100
+ * Successful defer() result from a loader or action
101
+ */
102
+ interface DeferredResult {
103
+ type: ResultType.deferred;
104
+ deferredData: DeferredData;
105
+ statusCode?: number;
106
+ headers?: Headers;
107
+ }
108
+ /**
109
+ * Redirect result from a loader or action
110
+ */
111
+ interface RedirectResult {
112
+ type: ResultType.redirect;
113
+ status: number;
114
+ location: string;
115
+ revalidate: boolean;
116
+ reloadDocument?: boolean;
117
+ }
118
+ /**
119
+ * Unsuccessful result from a loader or action
120
+ */
121
+ interface ErrorResult {
122
+ type: ResultType.error;
123
+ error: any;
124
+ headers?: Headers;
125
+ }
126
+ /**
127
+ * Result from a loader or action - potentially successful or unsuccessful
128
+ */
129
+ type DataResult = SuccessResult | DeferredResult | RedirectResult | ErrorResult;
130
+ type LowerCaseFormMethod = "get" | "post" | "put" | "patch" | "delete";
131
+ type UpperCaseFormMethod = Uppercase<LowerCaseFormMethod>;
132
+ /**
133
+ * Active navigation/fetcher form methods are exposed in lowercase on the
134
+ * RouterState
135
+ */
136
+ type FormMethod = LowerCaseFormMethod;
137
+ /**
138
+ * In v7, active navigation/fetcher form methods are exposed in uppercase on the
139
+ * RouterState. This is to align with the normalization done via fetch().
140
+ */
141
+ type V7_FormMethod = UpperCaseFormMethod;
142
+ type FormEncType = "application/x-www-form-urlencoded" | "multipart/form-data" | "application/json" | "text/plain";
143
+ type JsonObject = {
144
+ [Key in string]: JsonValue;
145
+ } & {
146
+ [Key in string]?: JsonValue | undefined;
147
+ };
148
+ type JsonArray = JsonValue[] | readonly JsonValue[];
149
+ type JsonPrimitive = string | number | boolean | null;
150
+ type JsonValue = JsonPrimitive | JsonObject | JsonArray;
151
+ /**
152
+ * @private
153
+ * Internal interface to pass around for action submissions, not intended for
154
+ * external consumption
155
+ */
156
+ type Submission = {
157
+ formMethod: FormMethod | V7_FormMethod;
158
+ formAction: string;
159
+ formEncType: FormEncType;
160
+ formData: FormData;
161
+ json: undefined;
162
+ text: undefined;
163
+ } | {
164
+ formMethod: FormMethod | V7_FormMethod;
165
+ formAction: string;
166
+ formEncType: FormEncType;
167
+ formData: undefined;
168
+ json: JsonValue;
169
+ text: undefined;
170
+ } | {
171
+ formMethod: FormMethod | V7_FormMethod;
172
+ formAction: string;
173
+ formEncType: FormEncType;
174
+ formData: undefined;
175
+ json: undefined;
176
+ text: string;
177
+ };
178
+ /**
179
+ * @private
180
+ * Arguments passed to route loader/action functions. Same for now but we keep
181
+ * this as a private implementation detail in case they diverge in the future.
182
+ */
183
+ interface DataFunctionArgs {
184
+ request: Request;
185
+ params: Params;
186
+ context?: any;
187
+ }
188
+ /**
189
+ * Arguments passed to loader functions
190
+ */
191
+ interface LoaderFunctionArgs extends DataFunctionArgs {
192
+ }
193
+ /**
194
+ * Arguments passed to action functions
195
+ */
196
+ interface ActionFunctionArgs extends DataFunctionArgs {
197
+ }
198
+ /**
199
+ * Loaders and actions can return anything except `undefined` (`null` is a
200
+ * valid return value if there is no data to return). Responses are preferred
201
+ * and will ease any future migration to Remix
202
+ */
203
+ type DataFunctionValue = Response | NonNullable<unknown> | null;
204
+ /**
205
+ * Route loader function signature
206
+ */
207
+ interface LoaderFunction {
208
+ (args: LoaderFunctionArgs): Promise<DataFunctionValue> | DataFunctionValue;
209
+ }
210
+ /**
211
+ * Route action function signature
212
+ */
213
+ interface ActionFunction {
214
+ (args: ActionFunctionArgs): Promise<DataFunctionValue> | DataFunctionValue;
215
+ }
216
+ /**
217
+ * Route shouldRevalidate function signature. This runs after any submission
218
+ * (navigation or fetcher), so we flatten the navigation/fetcher submission
219
+ * onto the arguments. It shouldn't matter whether it came from a navigation
220
+ * or a fetcher, what really matters is the URLs and the formData since loaders
221
+ * have to re-run based on the data models that were potentially mutated.
222
+ */
223
+ interface ShouldRevalidateFunction {
224
+ (args: {
225
+ currentUrl: URL;
226
+ currentParams: AgnosticDataRouteMatch["params"];
227
+ nextUrl: URL;
228
+ nextParams: AgnosticDataRouteMatch["params"];
229
+ formMethod?: Submission["formMethod"];
230
+ formAction?: Submission["formAction"];
231
+ formEncType?: Submission["formEncType"];
232
+ text?: Submission["text"];
233
+ formData?: Submission["formData"];
234
+ json?: Submission["json"];
235
+ actionResult?: DataResult;
236
+ defaultShouldRevalidate: boolean;
237
+ }): boolean;
238
+ }
239
+ /**
240
+ * Keys we cannot change from within a lazy() function. We spread all other keys
241
+ * onto the route. Either they're meaningful to the router, or they'll get
242
+ * ignored.
243
+ */
244
+ type ImmutableRouteKey = "lazy" | "caseSensitive" | "path" | "id" | "index" | "children";
245
+ type RequireOne<T, Key = keyof T> = Exclude<{
246
+ [K in keyof T]: K extends Key ? Omit<T, K> & Required<Pick<T, K>> : never;
247
+ }[keyof T], undefined>;
248
+ /**
249
+ * lazy() function to load a route definition, which can add non-matching
250
+ * related properties to a route
251
+ */
252
+ interface LazyRouteFunction<R extends AgnosticRouteObject> {
253
+ (): Promise<RequireOne<Omit<R, ImmutableRouteKey>>>;
254
+ }
255
+ /**
256
+ * Base RouteObject with common props shared by all types of routes
257
+ */
258
+ type AgnosticBaseRouteObject = {
259
+ caseSensitive?: boolean;
260
+ path?: string;
261
+ id?: string;
262
+ loader?: LoaderFunction;
263
+ action?: ActionFunction;
264
+ hasErrorBoundary?: boolean;
265
+ shouldRevalidate?: ShouldRevalidateFunction;
266
+ handle?: any;
267
+ lazy?: LazyRouteFunction<AgnosticBaseRouteObject>;
268
+ };
269
+ /**
270
+ * Index routes must not have children
271
+ */
272
+ type AgnosticIndexRouteObject = AgnosticBaseRouteObject & {
273
+ children?: undefined;
274
+ index: true;
275
+ };
276
+ /**
277
+ * Non-index routes may have children, but cannot have index
278
+ */
279
+ type AgnosticNonIndexRouteObject = AgnosticBaseRouteObject & {
280
+ children?: AgnosticRouteObject[];
281
+ index?: false;
282
+ };
283
+ /**
284
+ * A route object represents a logical route, with (optionally) its child
285
+ * routes organized in a tree-like structure.
286
+ */
287
+ type AgnosticRouteObject = AgnosticIndexRouteObject | AgnosticNonIndexRouteObject;
288
+ type AgnosticDataIndexRouteObject = AgnosticIndexRouteObject & {
289
+ id: string;
290
+ };
291
+ type AgnosticDataNonIndexRouteObject = AgnosticNonIndexRouteObject & {
292
+ children?: AgnosticDataRouteObject[];
293
+ id: string;
294
+ };
295
+ /**
296
+ * A data route object, which is just a RouteObject with a required unique ID
297
+ */
298
+ type AgnosticDataRouteObject = AgnosticDataIndexRouteObject | AgnosticDataNonIndexRouteObject;
299
+ /**
300
+ * The parameters that were parsed from the URL path.
301
+ */
302
+ type Params<Key extends string = string> = {
303
+ readonly [key in Key]: string | undefined;
304
+ };
305
+ /**
306
+ * A RouteMatch contains info about how a route matched a URL.
307
+ */
308
+ interface AgnosticRouteMatch<ParamKey extends string = string, RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject> {
309
+ /**
310
+ * The names and values of dynamic parameters in the URL.
311
+ */
312
+ params: Params<ParamKey>;
313
+ /**
314
+ * The portion of the URL pathname that was matched.
315
+ */
316
+ pathname: string;
317
+ /**
318
+ * The portion of the URL pathname that was matched before child routes.
319
+ */
320
+ pathnameBase: string;
321
+ /**
322
+ * The route object that was used to match.
323
+ */
324
+ route: RouteObjectType;
325
+ }
326
+ interface AgnosticDataRouteMatch extends AgnosticRouteMatch<string, AgnosticDataRouteObject> {
327
+ }
328
+ declare class DeferredData {
329
+ private pendingKeysSet;
330
+ private controller;
331
+ private abortPromise;
332
+ private unlistenAbortSignal;
333
+ private subscribers;
334
+ data: Record<string, unknown>;
335
+ init?: ResponseInit;
336
+ deferredKeys: string[];
337
+ constructor(data: Record<string, unknown>, responseInit?: ResponseInit);
338
+ private trackPromise;
339
+ private onSettle;
340
+ private emit;
341
+ subscribe(fn: (aborted: boolean, settledKey?: string) => void): () => boolean;
342
+ cancel(): void;
343
+ resolveData(signal: AbortSignal): Promise<boolean>;
344
+ get done(): boolean;
345
+ get unwrappedData(): {};
346
+ get pendingKeys(): string[];
347
+ }
348
+
349
+ /**
350
+ * State maintained internally by the router. During a navigation, all states
351
+ * reflect the the "old" location unless otherwise noted.
352
+ */
353
+ interface RouterState {
354
+ /**
355
+ * The action of the most recent navigation
356
+ */
357
+ historyAction: Action;
358
+ /**
359
+ * The current location reflected by the router
360
+ */
361
+ location: Location;
362
+ /**
363
+ * The current set of route matches
364
+ */
365
+ matches: AgnosticDataRouteMatch[];
366
+ /**
367
+ * Tracks whether we've completed our initial data load
368
+ */
369
+ initialized: boolean;
370
+ /**
371
+ * Current scroll position we should start at for a new view
372
+ * - number -> scroll position to restore to
373
+ * - false -> do not restore scroll at all (used during submissions)
374
+ * - null -> don't have a saved position, scroll to hash or top of page
375
+ */
376
+ restoreScrollPosition: number | false | null;
377
+ /**
378
+ * Indicate whether this navigation should skip resetting the scroll position
379
+ * if we are unable to restore the scroll position
380
+ */
381
+ preventScrollReset: boolean;
382
+ /**
383
+ * Tracks the state of the current navigation
384
+ */
385
+ navigation: Navigation;
386
+ /**
387
+ * Tracks any in-progress revalidations
388
+ */
389
+ revalidation: RevalidationState;
390
+ /**
391
+ * Data from the loaders for the current matches
392
+ */
393
+ loaderData: RouteData;
394
+ /**
395
+ * Data from the action for the current matches
396
+ */
397
+ actionData: RouteData | null;
398
+ /**
399
+ * Errors caught from loaders for the current matches
400
+ */
401
+ errors: RouteData | null;
402
+ /**
403
+ * Map of current fetchers
404
+ */
405
+ fetchers: Map<string, Fetcher>;
406
+ /**
407
+ * Map of current blockers
408
+ */
409
+ blockers: Map<string, Blocker>;
410
+ }
411
+ /**
412
+ * Data that can be passed into hydrate a Router from SSR
413
+ */
414
+ type HydrationState = Partial<Pick<RouterState, "loaderData" | "actionData" | "errors">>;
415
+ type RelativeRoutingType = "route" | "path";
416
+ /**
417
+ * Potential states for state.navigation
418
+ */
419
+ type NavigationStates = {
420
+ Idle: {
421
+ state: "idle";
422
+ location: undefined;
423
+ formMethod: undefined;
424
+ formAction: undefined;
425
+ formEncType: undefined;
426
+ formData: undefined;
427
+ json: undefined;
428
+ text: undefined;
429
+ };
430
+ Loading: {
431
+ state: "loading";
432
+ location: Location;
433
+ formMethod: Submission["formMethod"] | undefined;
434
+ formAction: Submission["formAction"] | undefined;
435
+ formEncType: Submission["formEncType"] | undefined;
436
+ formData: Submission["formData"] | undefined;
437
+ json: Submission["json"] | undefined;
438
+ text: Submission["text"] | undefined;
439
+ };
440
+ Submitting: {
441
+ state: "submitting";
442
+ location: Location;
443
+ formMethod: Submission["formMethod"];
444
+ formAction: Submission["formAction"];
445
+ formEncType: Submission["formEncType"];
446
+ formData: Submission["formData"];
447
+ json: Submission["json"];
448
+ text: Submission["text"];
449
+ };
450
+ };
451
+ type Navigation = NavigationStates[keyof NavigationStates];
452
+ type RevalidationState = "idle" | "loading";
453
+ /**
454
+ * Potential states for fetchers
455
+ */
456
+ type FetcherStates<TData = any> = {
457
+ Idle: {
458
+ state: "idle";
459
+ formMethod: undefined;
460
+ formAction: undefined;
461
+ formEncType: undefined;
462
+ text: undefined;
463
+ formData: undefined;
464
+ json: undefined;
465
+ data: TData | undefined;
466
+ " _hasFetcherDoneAnything "?: boolean;
467
+ };
468
+ Loading: {
469
+ state: "loading";
470
+ formMethod: Submission["formMethod"] | undefined;
471
+ formAction: Submission["formAction"] | undefined;
472
+ formEncType: Submission["formEncType"] | undefined;
473
+ text: Submission["text"] | undefined;
474
+ formData: Submission["formData"] | undefined;
475
+ json: Submission["json"] | undefined;
476
+ data: TData | undefined;
477
+ " _hasFetcherDoneAnything "?: boolean;
478
+ };
479
+ Submitting: {
480
+ state: "submitting";
481
+ formMethod: Submission["formMethod"];
482
+ formAction: Submission["formAction"];
483
+ formEncType: Submission["formEncType"];
484
+ text: Submission["text"];
485
+ formData: Submission["formData"];
486
+ json: Submission["json"];
487
+ data: TData | undefined;
488
+ " _hasFetcherDoneAnything "?: boolean;
489
+ };
490
+ };
491
+ type Fetcher<TData = any> = FetcherStates<TData>[keyof FetcherStates<TData>];
492
+ interface BlockerBlocked {
493
+ state: "blocked";
494
+ reset(): void;
495
+ proceed(): void;
496
+ location: Location;
497
+ }
498
+ interface BlockerUnblocked {
499
+ state: "unblocked";
500
+ reset: undefined;
501
+ proceed: undefined;
502
+ location: undefined;
503
+ }
504
+ interface BlockerProceeding {
505
+ state: "proceeding";
506
+ reset: undefined;
507
+ proceed: undefined;
508
+ location: Location;
509
+ }
510
+ type Blocker = BlockerUnblocked | BlockerBlocked | BlockerProceeding;
511
+
512
+ interface NavigateOptions$1 {
513
+ replace?: boolean;
514
+ state?: any;
515
+ preventScrollReset?: boolean;
516
+ relative?: RelativeRoutingType;
517
+ }
518
+
519
+ /**
520
+ * NOTE: If you refactor this to split up the modules into separate files,
521
+ * you'll need to update the rollup config for react-router-dom-v5-compat.
522
+ */
523
+
524
+ declare global {
525
+ var __staticRouterHydrationData: HydrationState | undefined;
526
+ }
527
+
14
528
  interface StoryData {
15
529
  viewMode?: string;
16
530
  storyId?: string;
@@ -21,12 +535,12 @@ interface Other$1 extends StoryData {
21
535
  path: string;
22
536
  singleStory?: boolean;
23
537
  }
24
- type NavigateOptions = R.NavigateOptions & {
538
+ type NavigateOptions = NavigateOptions$1 & {
25
539
  plain?: boolean;
26
540
  };
27
- type NavigateFunction = (to: R.To | number, options?: NavigateOptions) => void;
541
+ type NavigateFunction = (to: To | number, options?: NavigateOptions) => void;
28
542
  type RouterData = {
29
- location: Partial<R.Location>;
543
+ location: Partial<Location>;
30
544
  navigate: NavigateFunction;
31
545
  } & Other$1;
32
546
  type RenderData = Pick<RouterData, 'location'> & Other$1;
@@ -2480,7 +2994,7 @@ type Addon_LegacyStoryFn<ReturnType = unknown> = LegacyStoryFn<Addon_ReturnTypeF
2480
2994
  type Addon_ArgsStoryFn<ReturnType = unknown> = ArgsStoryFn<Addon_ReturnTypeFramework<ReturnType>>;
2481
2995
  type Addon_StoryFn<ReturnType = unknown> = StoryFn<Addon_ReturnTypeFramework<ReturnType>>;
2482
2996
  type Addon_DecoratorFunction<StoryFnReturnType = unknown> = DecoratorFunction<Addon_ReturnTypeFramework<StoryFnReturnType>>;
2483
- type Addon_LoaderFunction = LoaderFunction<Addon_ReturnTypeFramework<unknown>>;
2997
+ type Addon_LoaderFunction = LoaderFunction$1<Addon_ReturnTypeFramework<unknown>>;
2484
2998
  interface Addon_WrapperSettings {
2485
2999
  options: object;
2486
3000
  parameters: {
@@ -2863,7 +3377,7 @@ type NormalizedProjectAnnotations<TRenderer extends Renderer = Renderer> = Omit<
2863
3377
  argTypes?: StrictArgTypes;
2864
3378
  globalTypes?: StrictGlobalTypes;
2865
3379
  decorators?: DecoratorFunction<TRenderer>[];
2866
- loaders?: LoaderFunction<TRenderer>[];
3380
+ loaders?: LoaderFunction$1<TRenderer>[];
2867
3381
  runStep: StepRunner<TRenderer>;
2868
3382
  beforeAll: BeforeAll;
2869
3383
  };
@@ -2872,7 +3386,7 @@ type NormalizedComponentAnnotations<TRenderer extends Renderer = Renderer> = Omi
2872
3386
  title: ComponentTitle;
2873
3387
  argTypes?: StrictArgTypes;
2874
3388
  decorators?: DecoratorFunction<TRenderer>[];
2875
- loaders?: LoaderFunction<TRenderer>[];
3389
+ loaders?: LoaderFunction$1<TRenderer>[];
2876
3390
  };
2877
3391
  type NormalizedStoryAnnotations<TRenderer extends Renderer = Renderer> = Omit<StoryAnnotations<TRenderer>, 'storyName' | 'story' | 'decorators' | 'loaders'> & {
2878
3392
  moduleExport: ModuleExport;
@@ -2881,7 +3395,7 @@ type NormalizedStoryAnnotations<TRenderer extends Renderer = Renderer> = Omit<St
2881
3395
  name: StoryName;
2882
3396
  userStoryFn?: ArgsStoryFn<TRenderer>;
2883
3397
  decorators?: DecoratorFunction<TRenderer>[];
2884
- loaders?: LoaderFunction<TRenderer>[];
3398
+ loaders?: LoaderFunction$1<TRenderer>[];
2885
3399
  };
2886
3400
  type CSFFile<TRenderer extends Renderer = Renderer> = {
2887
3401
  meta: NormalizedComponentAnnotations<TRenderer>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "storybook",
3
- "version": "10.0.0-beta.1",
3
+ "version": "10.0.0-beta.2",
4
4
  "description": "Storybook: Develop, document, and test UI components in isolation",
5
5
  "keywords": [
6
6
  "storybook",
@@ -273,7 +273,6 @@
273
273
  "@types/ejs": "^3.1.1",
274
274
  "@types/find-cache-dir": "^5.0.0",
275
275
  "@types/js-yaml": "^4.0.5",
276
- "@types/lodash": "^4.17.13",
277
276
  "@types/node": "^22.0.0",
278
277
  "@types/npmlog": "^7.0.0",
279
278
  "@types/picomatch": "^2.3.0",
@@ -323,7 +322,6 @@
323
322
  "jsdoc-type-pratt-parser": "^4.0.0",
324
323
  "lazy-universal-dotenv": "^4.0.0",
325
324
  "leven": "^4.0.0",
326
- "lodash": "^4.17.21",
327
325
  "memfs": "^4.11.1",
328
326
  "memoizerific": "^1.11.3",
329
327
  "mlly": "^1.7.4",
@@ -1,62 +0,0 @@
1
- import CJS_COMPAT_NODE_URL_nodb7gfupnb from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_nodb7gfupnb from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_nodb7gfupnb from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_nodb7gfupnb.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_nodb7gfupnb.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_nodb7gfupnb.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
-
13
- // src/common/versions.ts
14
- var versions_default = {
15
- "@storybook/addon-a11y": "10.0.0-beta.1",
16
- "@storybook/addon-docs": "10.0.0-beta.1",
17
- "@storybook/addon-jest": "10.0.0-beta.1",
18
- "@storybook/addon-links": "10.0.0-beta.1",
19
- "@storybook/addon-onboarding": "10.0.0-beta.1",
20
- "storybook-addon-pseudo-states": "10.0.0-beta.1",
21
- "@storybook/addon-themes": "10.0.0-beta.1",
22
- "@storybook/addon-vitest": "10.0.0-beta.1",
23
- "@storybook/builder-vite": "10.0.0-beta.1",
24
- "@storybook/builder-webpack5": "10.0.0-beta.1",
25
- storybook: "10.0.0-beta.1",
26
- "@storybook/angular": "10.0.0-beta.1",
27
- "@storybook/ember": "10.0.0-beta.1",
28
- "@storybook/html-vite": "10.0.0-beta.1",
29
- "@storybook/nextjs": "10.0.0-beta.1",
30
- "@storybook/nextjs-vite": "10.0.0-beta.1",
31
- "@storybook/preact-vite": "10.0.0-beta.1",
32
- "@storybook/react-native-web-vite": "10.0.0-beta.1",
33
- "@storybook/react-vite": "10.0.0-beta.1",
34
- "@storybook/react-webpack5": "10.0.0-beta.1",
35
- "@storybook/server-webpack5": "10.0.0-beta.1",
36
- "@storybook/svelte-vite": "10.0.0-beta.1",
37
- "@storybook/sveltekit": "10.0.0-beta.1",
38
- "@storybook/vue3-vite": "10.0.0-beta.1",
39
- "@storybook/web-components-vite": "10.0.0-beta.1",
40
- sb: "10.0.0-beta.1",
41
- "@storybook/cli": "10.0.0-beta.1",
42
- "@storybook/codemod": "10.0.0-beta.1",
43
- "@storybook/core-webpack": "10.0.0-beta.1",
44
- "create-storybook": "10.0.0-beta.1",
45
- "@storybook/csf-plugin": "10.0.0-beta.1",
46
- "eslint-plugin-storybook": "10.0.0-beta.1",
47
- "@storybook/react-dom-shim": "10.0.0-beta.1",
48
- "@storybook/preset-create-react-app": "10.0.0-beta.1",
49
- "@storybook/preset-react-webpack": "10.0.0-beta.1",
50
- "@storybook/preset-server-webpack": "10.0.0-beta.1",
51
- "@storybook/html": "10.0.0-beta.1",
52
- "@storybook/preact": "10.0.0-beta.1",
53
- "@storybook/react": "10.0.0-beta.1",
54
- "@storybook/server": "10.0.0-beta.1",
55
- "@storybook/svelte": "10.0.0-beta.1",
56
- "@storybook/vue3": "10.0.0-beta.1",
57
- "@storybook/web-components": "10.0.0-beta.1"
58
- };
59
-
60
- export {
61
- versions_default
62
- };
@@ -1,18 +0,0 @@
1
- import CJS_COMPAT_NODE_URL_nodb7gfupnb from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_nodb7gfupnb from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_nodb7gfupnb from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_nodb7gfupnb.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_nodb7gfupnb.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_nodb7gfupnb.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
-
13
- // package.json
14
- var version = "10.0.0-beta.1";
15
-
16
- export {
17
- version
18
- };