storybook 9.1.0-alpha.2 → 9.1.0-alpha.4

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/actions/index.cjs +16 -16
  2. package/dist/actions/index.d.ts +1 -38
  3. package/dist/actions/index.js +12 -12
  4. package/dist/actions/preview.cjs +25 -25
  5. package/dist/actions/preview.d.ts +37 -547
  6. package/dist/actions/preview.js +18 -18
  7. package/dist/backgrounds/index.cjs +12 -144
  8. package/dist/backgrounds/index.d.ts +1 -591
  9. package/dist/backgrounds/index.js +0 -130
  10. package/dist/backgrounds/preview.cjs +63 -63
  11. package/dist/backgrounds/preview.d.ts +40 -542
  12. package/dist/backgrounds/preview.js +47 -47
  13. package/dist/bin/index.cjs +50 -50
  14. package/dist/bin/index.js +50 -50
  15. package/dist/builder-manager/index.cjs +379 -378
  16. package/dist/builder-manager/index.d.ts +567 -2
  17. package/dist/builder-manager/index.js +280 -279
  18. package/dist/cli/bin/index.cjs +1 -1
  19. package/dist/cli/bin/index.js +1 -1
  20. package/dist/common/index.cjs +87 -79
  21. package/dist/common/index.d.ts +2 -2
  22. package/dist/common/index.js +725 -716
  23. package/dist/component-testing/preview.cjs +12 -12
  24. package/dist/component-testing/preview.d.ts +2 -2
  25. package/dist/component-testing/preview.js +7 -7
  26. package/dist/components/index.cjs +1899 -1895
  27. package/dist/components/index.js +1343 -1339
  28. package/dist/controls/index.cjs +16 -16
  29. package/dist/controls/index.d.ts +1 -36
  30. package/dist/controls/preview.cjs +17 -17
  31. package/dist/controls/preview.d.ts +34 -546
  32. package/dist/controls/preview.js +3 -3
  33. package/dist/csf/index.cjs +1210 -95
  34. package/dist/csf/index.d.ts +59 -18
  35. package/dist/csf/index.js +1214 -90
  36. package/dist/csf-tools/index.cjs +2 -1
  37. package/dist/csf-tools/index.js +2 -2
  38. package/dist/highlight/index.cjs +15 -15
  39. package/dist/highlight/index.d.ts +1 -12
  40. package/dist/highlight/index.js +4 -4
  41. package/dist/highlight/preview.cjs +63 -63
  42. package/dist/highlight/preview.d.ts +11 -546
  43. package/dist/highlight/preview.js +11 -10
  44. package/dist/manager/globals-runtime.js +31934 -31888
  45. package/dist/manager-api/index.cjs +1 -1
  46. package/dist/manager-api/index.js +1 -1
  47. package/dist/measure/index.cjs +12 -472
  48. package/dist/measure/index.d.ts +1 -566
  49. package/dist/measure/index.js +0 -464
  50. package/dist/measure/preview.cjs +127 -127
  51. package/dist/measure/preview.d.ts +11 -546
  52. package/dist/measure/preview.js +117 -117
  53. package/dist/outline/index.cjs +12 -524
  54. package/dist/outline/index.d.ts +1 -566
  55. package/dist/outline/index.js +0 -500
  56. package/dist/outline/preview.cjs +32 -32
  57. package/dist/outline/preview.d.ts +11 -546
  58. package/dist/outline/preview.js +27 -27
  59. package/dist/preview/runtime.js +9415 -9379
  60. package/dist/preview-api/index.cjs +1228 -1261
  61. package/dist/preview-api/index.d.ts +6 -8
  62. package/dist/preview-api/index.js +927 -963
  63. package/dist/telemetry/index.cjs +1477 -1288
  64. package/dist/telemetry/index.js +1503 -1314
  65. package/dist/test/index.cjs +4437 -4394
  66. package/dist/test/index.js +3776 -3733
  67. package/dist/test/preview.cjs +42 -42
  68. package/dist/test/preview.d.ts +12 -550
  69. package/dist/test/preview.js +36 -36
  70. package/dist/types/index.d.ts +5 -3
  71. package/dist/viewport/index.cjs +17 -24
  72. package/dist/viewport/index.d.ts +9 -532
  73. package/dist/viewport/index.js +9 -16
  74. package/dist/viewport/preview.cjs +22 -22
  75. package/dist/viewport/preview.d.ts +45 -552
  76. package/dist/viewport/preview.js +8 -8
  77. package/package.json +1 -1
@@ -1,555 +1,20 @@
1
- import { Renderer as Renderer$1, ProjectAnnotations as ProjectAnnotations$1, StoryIdentifier, StoryContext, PartialStoryFn, LegacyStoryFn } from 'storybook/internal/csf';
2
- import { NormalizedProjectAnnotations, ProjectAnnotations as ProjectAnnotations$2, ComposedStoryFn } from 'storybook/internal/types';
1
+ import * as storybook_internal_csf from 'storybook/internal/csf';
3
2
 
4
- /**
5
- * Actions represent the type of change to a location value.
6
- */
7
- declare enum Action {
8
- /**
9
- * A POP indicates a change to an arbitrary index in the history stack, such
10
- * as a back or forward navigation. It does not describe the direction of the
11
- * navigation, only that the current index changed.
12
- *
13
- * Note: This is the default action for newly created history objects.
14
- */
15
- Pop = "POP",
16
- /**
17
- * A PUSH indicates a new entry being added to the history stack, such as when
18
- * a link is clicked and a new page loads. When this happens, all subsequent
19
- * entries in the stack are lost.
20
- */
21
- Push = "PUSH",
22
- /**
23
- * A REPLACE indicates the entry at the current index in the history stack
24
- * being replaced by a new one.
25
- */
26
- Replace = "REPLACE"
3
+ interface HighlightTypes {
4
+ parameters: HighlightParameters;
27
5
  }
28
- /**
29
- * The pathname, search, and hash values of a URL.
30
- */
31
- interface Path {
32
- /**
33
- * A URL pathname, beginning with a /.
34
- */
35
- pathname: string;
6
+ interface HighlightParameters {
36
7
  /**
37
- * A URL search string, beginning with a ?.
38
- */
39
- search: string;
40
- /**
41
- * A URL fragment identifier, beginning with a #.
42
- */
43
- hash: string;
44
- }
45
- /**
46
- * An entry in a history stack. A location contains information about the
47
- * URL path, as well as possibly some arbitrary state and a key.
48
- */
49
- interface Location extends Path {
50
- /**
51
- * A value of arbitrary data associated with this location.
52
- */
53
- state: any;
54
- /**
55
- * A unique string associated with this location. May be used to safely store
56
- * and retrieve data in some other storage API, like `localStorage`.
8
+ * Highlight configuration
57
9
  *
58
- * Note: This value is always "default" on the initial location.
59
- */
60
- key: string;
61
- }
62
-
63
- /**
64
- * Map of routeId -> data returned from a loader/action/error
65
- */
66
- interface RouteData {
67
- [routeId: string]: any;
68
- }
69
- declare enum ResultType {
70
- data = "data",
71
- deferred = "deferred",
72
- redirect = "redirect",
73
- error = "error"
74
- }
75
- /**
76
- * Successful result from a loader or action
77
- */
78
- interface SuccessResult {
79
- type: ResultType.data;
80
- data: any;
81
- statusCode?: number;
82
- headers?: Headers;
83
- }
84
- /**
85
- * Successful defer() result from a loader or action
86
- */
87
- interface DeferredResult {
88
- type: ResultType.deferred;
89
- deferredData: DeferredData;
90
- statusCode?: number;
91
- headers?: Headers;
92
- }
93
- /**
94
- * Redirect result from a loader or action
95
- */
96
- interface RedirectResult {
97
- type: ResultType.redirect;
98
- status: number;
99
- location: string;
100
- revalidate: boolean;
101
- reloadDocument?: boolean;
102
- }
103
- /**
104
- * Unsuccessful result from a loader or action
105
- */
106
- interface ErrorResult {
107
- type: ResultType.error;
108
- error: any;
109
- headers?: Headers;
110
- }
111
- /**
112
- * Result from a loader or action - potentially successful or unsuccessful
113
- */
114
- type DataResult = SuccessResult | DeferredResult | RedirectResult | ErrorResult;
115
- type LowerCaseFormMethod = "get" | "post" | "put" | "patch" | "delete";
116
- type UpperCaseFormMethod = Uppercase<LowerCaseFormMethod>;
117
- /**
118
- * Active navigation/fetcher form methods are exposed in lowercase on the
119
- * RouterState
120
- */
121
- type FormMethod = LowerCaseFormMethod;
122
- /**
123
- * In v7, active navigation/fetcher form methods are exposed in uppercase on the
124
- * RouterState. This is to align with the normalization done via fetch().
125
- */
126
- type V7_FormMethod = UpperCaseFormMethod;
127
- type FormEncType = "application/x-www-form-urlencoded" | "multipart/form-data" | "application/json" | "text/plain";
128
- type JsonObject = {
129
- [Key in string]: JsonValue;
130
- } & {
131
- [Key in string]?: JsonValue | undefined;
132
- };
133
- type JsonArray = JsonValue[] | readonly JsonValue[];
134
- type JsonPrimitive = string | number | boolean | null;
135
- type JsonValue = JsonPrimitive | JsonObject | JsonArray;
136
- /**
137
- * @private
138
- * Internal interface to pass around for action submissions, not intended for
139
- * external consumption
140
- */
141
- type Submission = {
142
- formMethod: FormMethod | V7_FormMethod;
143
- formAction: string;
144
- formEncType: FormEncType;
145
- formData: FormData;
146
- json: undefined;
147
- text: undefined;
148
- } | {
149
- formMethod: FormMethod | V7_FormMethod;
150
- formAction: string;
151
- formEncType: FormEncType;
152
- formData: undefined;
153
- json: JsonValue;
154
- text: undefined;
155
- } | {
156
- formMethod: FormMethod | V7_FormMethod;
157
- formAction: string;
158
- formEncType: FormEncType;
159
- formData: undefined;
160
- json: undefined;
161
- text: string;
162
- };
163
- /**
164
- * @private
165
- * Arguments passed to route loader/action functions. Same for now but we keep
166
- * this as a private implementation detail in case they diverge in the future.
167
- */
168
- interface DataFunctionArgs {
169
- request: Request;
170
- params: Params;
171
- context?: any;
172
- }
173
- /**
174
- * Arguments passed to loader functions
175
- */
176
- interface LoaderFunctionArgs extends DataFunctionArgs {
177
- }
178
- /**
179
- * Arguments passed to action functions
180
- */
181
- interface ActionFunctionArgs extends DataFunctionArgs {
182
- }
183
- /**
184
- * Loaders and actions can return anything except `undefined` (`null` is a
185
- * valid return value if there is no data to return). Responses are preferred
186
- * and will ease any future migration to Remix
187
- */
188
- type DataFunctionValue = Response | NonNullable<unknown> | null;
189
- /**
190
- * Route loader function signature
191
- */
192
- interface LoaderFunction {
193
- (args: LoaderFunctionArgs): Promise<DataFunctionValue> | DataFunctionValue;
194
- }
195
- /**
196
- * Route action function signature
197
- */
198
- interface ActionFunction {
199
- (args: ActionFunctionArgs): Promise<DataFunctionValue> | DataFunctionValue;
200
- }
201
- /**
202
- * Route shouldRevalidate function signature. This runs after any submission
203
- * (navigation or fetcher), so we flatten the navigation/fetcher submission
204
- * onto the arguments. It shouldn't matter whether it came from a navigation
205
- * or a fetcher, what really matters is the URLs and the formData since loaders
206
- * have to re-run based on the data models that were potentially mutated.
207
- */
208
- interface ShouldRevalidateFunction {
209
- (args: {
210
- currentUrl: URL;
211
- currentParams: AgnosticDataRouteMatch["params"];
212
- nextUrl: URL;
213
- nextParams: AgnosticDataRouteMatch["params"];
214
- formMethod?: Submission["formMethod"];
215
- formAction?: Submission["formAction"];
216
- formEncType?: Submission["formEncType"];
217
- text?: Submission["text"];
218
- formData?: Submission["formData"];
219
- json?: Submission["json"];
220
- actionResult?: DataResult;
221
- defaultShouldRevalidate: boolean;
222
- }): boolean;
223
- }
224
- /**
225
- * Keys we cannot change from within a lazy() function. We spread all other keys
226
- * onto the route. Either they're meaningful to the router, or they'll get
227
- * ignored.
228
- */
229
- type ImmutableRouteKey = "lazy" | "caseSensitive" | "path" | "id" | "index" | "children";
230
- type RequireOne<T, Key = keyof T> = Exclude<{
231
- [K in keyof T]: K extends Key ? Omit<T, K> & Required<Pick<T, K>> : never;
232
- }[keyof T], undefined>;
233
- /**
234
- * lazy() function to load a route definition, which can add non-matching
235
- * related properties to a route
236
- */
237
- interface LazyRouteFunction<R extends AgnosticRouteObject> {
238
- (): Promise<RequireOne<Omit<R, ImmutableRouteKey>>>;
239
- }
240
- /**
241
- * Base RouteObject with common props shared by all types of routes
242
- */
243
- type AgnosticBaseRouteObject = {
244
- caseSensitive?: boolean;
245
- path?: string;
246
- id?: string;
247
- loader?: LoaderFunction;
248
- action?: ActionFunction;
249
- hasErrorBoundary?: boolean;
250
- shouldRevalidate?: ShouldRevalidateFunction;
251
- handle?: any;
252
- lazy?: LazyRouteFunction<AgnosticBaseRouteObject>;
253
- };
254
- /**
255
- * Index routes must not have children
256
- */
257
- type AgnosticIndexRouteObject = AgnosticBaseRouteObject & {
258
- children?: undefined;
259
- index: true;
260
- };
261
- /**
262
- * Non-index routes may have children, but cannot have index
263
- */
264
- type AgnosticNonIndexRouteObject = AgnosticBaseRouteObject & {
265
- children?: AgnosticRouteObject[];
266
- index?: false;
267
- };
268
- /**
269
- * A route object represents a logical route, with (optionally) its child
270
- * routes organized in a tree-like structure.
271
- */
272
- type AgnosticRouteObject = AgnosticIndexRouteObject | AgnosticNonIndexRouteObject;
273
- type AgnosticDataIndexRouteObject = AgnosticIndexRouteObject & {
274
- id: string;
275
- };
276
- type AgnosticDataNonIndexRouteObject = AgnosticNonIndexRouteObject & {
277
- children?: AgnosticDataRouteObject[];
278
- id: string;
279
- };
280
- /**
281
- * A data route object, which is just a RouteObject with a required unique ID
282
- */
283
- type AgnosticDataRouteObject = AgnosticDataIndexRouteObject | AgnosticDataNonIndexRouteObject;
284
- /**
285
- * The parameters that were parsed from the URL path.
286
- */
287
- type Params<Key extends string = string> = {
288
- readonly [key in Key]: string | undefined;
289
- };
290
- /**
291
- * A RouteMatch contains info about how a route matched a URL.
292
- */
293
- interface AgnosticRouteMatch<ParamKey extends string = string, RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject> {
294
- /**
295
- * The names and values of dynamic parameters in the URL.
296
- */
297
- params: Params<ParamKey>;
298
- /**
299
- * The portion of the URL pathname that was matched.
300
- */
301
- pathname: string;
302
- /**
303
- * The portion of the URL pathname that was matched before child routes.
304
- */
305
- pathnameBase: string;
306
- /**
307
- * The route object that was used to match.
308
- */
309
- route: RouteObjectType;
310
- }
311
- interface AgnosticDataRouteMatch extends AgnosticRouteMatch<string, AgnosticDataRouteObject> {
312
- }
313
- declare class DeferredData {
314
- private pendingKeysSet;
315
- private controller;
316
- private abortPromise;
317
- private unlistenAbortSignal;
318
- private subscribers;
319
- data: Record<string, unknown>;
320
- init?: ResponseInit;
321
- deferredKeys: string[];
322
- constructor(data: Record<string, unknown>, responseInit?: ResponseInit);
323
- private trackPromise;
324
- private onSettle;
325
- private emit;
326
- subscribe(fn: (aborted: boolean, settledKey?: string) => void): () => boolean;
327
- cancel(): void;
328
- resolveData(signal: AbortSignal): Promise<boolean>;
329
- get done(): boolean;
330
- get unwrappedData(): {};
331
- get pendingKeys(): string[];
332
- }
333
-
334
- /**
335
- * State maintained internally by the router. During a navigation, all states
336
- * reflect the the "old" location unless otherwise noted.
337
- */
338
- interface RouterState {
339
- /**
340
- * The action of the most recent navigation
10
+ * @see https://storybook.js.org/docs/essentials/highlight#parameters
341
11
  */
342
- historyAction: Action;
343
- /**
344
- * The current location reflected by the router
345
- */
346
- location: Location;
347
- /**
348
- * The current set of route matches
349
- */
350
- matches: AgnosticDataRouteMatch[];
351
- /**
352
- * Tracks whether we've completed our initial data load
353
- */
354
- initialized: boolean;
355
- /**
356
- * Current scroll position we should start at for a new view
357
- * - number -> scroll position to restore to
358
- * - false -> do not restore scroll at all (used during submissions)
359
- * - null -> don't have a saved position, scroll to hash or top of page
360
- */
361
- restoreScrollPosition: number | false | null;
362
- /**
363
- * Indicate whether this navigation should skip resetting the scroll position
364
- * if we are unable to restore the scroll position
365
- */
366
- preventScrollReset: boolean;
367
- /**
368
- * Tracks the state of the current navigation
369
- */
370
- navigation: Navigation;
371
- /**
372
- * Tracks any in-progress revalidations
373
- */
374
- revalidation: RevalidationState;
375
- /**
376
- * Data from the loaders for the current matches
377
- */
378
- loaderData: RouteData;
379
- /**
380
- * Data from the action for the current matches
381
- */
382
- actionData: RouteData | null;
383
- /**
384
- * Errors caught from loaders for the current matches
385
- */
386
- errors: RouteData | null;
387
- /**
388
- * Map of current fetchers
389
- */
390
- fetchers: Map<string, Fetcher>;
391
- /**
392
- * Map of current blockers
393
- */
394
- blockers: Map<string, Blocker>;
395
- }
396
- /**
397
- * Data that can be passed into hydrate a Router from SSR
398
- */
399
- type HydrationState = Partial<Pick<RouterState, "loaderData" | "actionData" | "errors">>;
400
- /**
401
- * Potential states for state.navigation
402
- */
403
- type NavigationStates = {
404
- Idle: {
405
- state: "idle";
406
- location: undefined;
407
- formMethod: undefined;
408
- formAction: undefined;
409
- formEncType: undefined;
410
- formData: undefined;
411
- json: undefined;
412
- text: undefined;
413
- };
414
- Loading: {
415
- state: "loading";
416
- location: Location;
417
- formMethod: Submission["formMethod"] | undefined;
418
- formAction: Submission["formAction"] | undefined;
419
- formEncType: Submission["formEncType"] | undefined;
420
- formData: Submission["formData"] | undefined;
421
- json: Submission["json"] | undefined;
422
- text: Submission["text"] | undefined;
423
- };
424
- Submitting: {
425
- state: "submitting";
426
- location: Location;
427
- formMethod: Submission["formMethod"];
428
- formAction: Submission["formAction"];
429
- formEncType: Submission["formEncType"];
430
- formData: Submission["formData"];
431
- json: Submission["json"];
432
- text: Submission["text"];
433
- };
434
- };
435
- type Navigation = NavigationStates[keyof NavigationStates];
436
- type RevalidationState = "idle" | "loading";
437
- /**
438
- * Potential states for fetchers
439
- */
440
- type FetcherStates<TData = any> = {
441
- Idle: {
442
- state: "idle";
443
- formMethod: undefined;
444
- formAction: undefined;
445
- formEncType: undefined;
446
- text: undefined;
447
- formData: undefined;
448
- json: undefined;
449
- data: TData | undefined;
450
- " _hasFetcherDoneAnything "?: boolean;
451
- };
452
- Loading: {
453
- state: "loading";
454
- formMethod: Submission["formMethod"] | undefined;
455
- formAction: Submission["formAction"] | undefined;
456
- formEncType: Submission["formEncType"] | undefined;
457
- text: Submission["text"] | undefined;
458
- formData: Submission["formData"] | undefined;
459
- json: Submission["json"] | undefined;
460
- data: TData | undefined;
461
- " _hasFetcherDoneAnything "?: boolean;
462
- };
463
- Submitting: {
464
- state: "submitting";
465
- formMethod: Submission["formMethod"];
466
- formAction: Submission["formAction"];
467
- formEncType: Submission["formEncType"];
468
- text: Submission["text"];
469
- formData: Submission["formData"];
470
- json: Submission["json"];
471
- data: TData | undefined;
472
- " _hasFetcherDoneAnything "?: boolean;
473
- };
474
- };
475
- type Fetcher<TData = any> = FetcherStates<TData>[keyof FetcherStates<TData>];
476
- interface BlockerBlocked {
477
- state: "blocked";
478
- reset(): void;
479
- proceed(): void;
480
- location: Location;
481
- }
482
- interface BlockerUnblocked {
483
- state: "unblocked";
484
- reset: undefined;
485
- proceed: undefined;
486
- location: undefined;
487
- }
488
- interface BlockerProceeding {
489
- state: "proceeding";
490
- reset: undefined;
491
- proceed: undefined;
492
- location: Location;
493
- }
494
- type Blocker = BlockerUnblocked | BlockerBlocked | BlockerProceeding;
495
-
496
- /**
497
- * NOTE: If you refactor this to split up the modules into separate files,
498
- * you'll need to update the rollup config for react-router-dom-v5-compat.
499
- */
500
-
501
- declare global {
502
- var __staticRouterHydrationData: HydrationState | undefined;
503
- }
504
-
505
- declare global {
506
- interface SymbolConstructor {
507
- readonly observable: symbol;
508
- }
509
- }
510
-
511
- interface Renderer extends Renderer$1 {
512
- }
513
-
514
- type MaybePromise<T> = Promise<T> | T;
515
- type TeardownRenderToCanvas = () => MaybePromise<void>;
516
- type RenderToCanvas<TRenderer extends Renderer> = (context: RenderContext<TRenderer>, element: TRenderer['canvasElement']) => MaybePromise<void | TeardownRenderToCanvas>;
517
- interface ProjectAnnotations<TRenderer extends Renderer> extends ProjectAnnotations$1<TRenderer> {
518
- addons?: ProjectAnnotations<TRenderer>[];
519
- testingLibraryRender?: (...args: never[]) => {
520
- unmount: () => void;
12
+ highlight?: {
13
+ /** Remove the addon panel and disable the addon's behavior */
14
+ disable?: boolean;
521
15
  };
522
- renderToCanvas?: RenderToCanvas<TRenderer>;
523
- }
524
- declare type RenderContext<TRenderer extends Renderer = Renderer> = StoryIdentifier & {
525
- showMain: () => void;
526
- showError: (error: {
527
- title: string;
528
- description: string;
529
- }) => void;
530
- showException: (err: Error) => void;
531
- forceRemount: boolean;
532
- storyContext: StoryContext<TRenderer>;
533
- storyFn: PartialStoryFn<TRenderer>;
534
- unboundStoryFn: LegacyStoryFn<TRenderer>;
535
- };
536
-
537
- declare global {
538
- var globalProjectAnnotations: NormalizedProjectAnnotations<any>;
539
- var defaultProjectAnnotations: ProjectAnnotations$2<any>;
540
- }
541
- type WrappedStoryRef = {
542
- __pw_type: 'jsx' | 'importRef';
543
- };
544
- type UnwrappedJSXStoryRef = {
545
- __pw_type: 'jsx';
546
- type: UnwrappedImportStoryRef;
547
- };
548
- type UnwrappedImportStoryRef = ComposedStoryFn;
549
- declare global {
550
- function __pwUnwrapObject(storyRef: WrappedStoryRef): Promise<UnwrappedJSXStoryRef | UnwrappedImportStoryRef>;
551
16
  }
552
17
 
553
- declare const _default: () => ProjectAnnotations<Renderer>;
18
+ declare const _default: () => storybook_internal_csf.PreviewAddon<HighlightTypes>;
554
19
 
555
- export { _default as default };
20
+ export { type HighlightTypes, _default as default };
@@ -2,13 +2,14 @@ var pe = Object.defineProperty;
2
2
  var c = (s, e) => pe(s, "name", { value: e, configurable: !0 });
3
3
 
4
4
  // src/highlight/preview.ts
5
- import { addons as le, definePreview as fe } from "storybook/preview-api";
5
+ import { definePreviewAddon as fe } from "storybook/internal/csf";
6
+ import { addons as le } from "storybook/preview-api";
6
7
 
7
8
  // src/highlight/useHighlights.ts
8
9
  import { STORY_RENDER_PHASE_CHANGED as he } from "storybook/internal/core-events";
9
10
 
10
11
  // src/highlight/constants.ts
11
- var _ = "storybook/highlight", U = `${_}/add`, K = `${_}/remove`, J = `${_}/reset`, Q = `${_}/scroll-into-view`, F = 2147483647, L = 28;
12
+ var _ = "storybook/highlight", U = `${_}/add`, K = `${_}/remove`, J = `${_}/reset`, Q = `${_}/scroll-into-view`, F = 2147483647, T = 28;
12
13
 
13
14
  // src/highlight/icons.ts
14
15
  var G = {
@@ -85,7 +86,7 @@ var ue = "svg,path,rect,circle,line,polyline,polygon,ellipse,text".split(","), b
85
86
  menu: Array.isArray(e) ? e.every(Array.isArray) ? e : [e] : void 0
86
87
  };
87
88
  }, "normalizeOptions"), me = /* @__PURE__ */ c((s) => s instanceof Function, "isFunction"), S = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map(),
88
- R = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ c((s) => {
89
+ R = /* @__PURE__ */ new Map(), L = /* @__PURE__ */ c((s) => {
89
90
  let e = Symbol();
90
91
  return C.set(e, []), S.set(e, s), { get: /* @__PURE__ */ c(() => S.get(e), "get"), set: /* @__PURE__ */ c((u) => {
91
92
  let m = S.get(e), f = me(u) ? u(m) : u;
@@ -150,7 +151,7 @@ menu: u }]) => {
150
151
  if (!e || !d)
151
152
  return !1;
152
153
  let { left: l, top: r, width: p, height: u } = s;
153
- u < L && (r = r - Math.round((L - u) / 2), u = L), p < L && (l = l - Math.round((L - p) / 2), p = L), e.style.position === "fixed" && (l +=
154
+ u < T && (r = r - Math.round((T - u) / 2), u = T), p < T && (l = l - Math.round((T - p) / 2), p = T), e.style.position === "fixed" && (l +=
154
155
  window.scrollX, r += window.scrollY);
155
156
  let { x: m, y: f } = d;
156
157
  return m >= l && m <= l + p && f >= r && f <= r + u;
@@ -192,8 +193,8 @@ var g = "storybook-highlights-menu", ie = "storybook-highlights-root", ge = "sto
192
193
  if (globalThis.__STORYBOOK_HIGHLIGHT_INITIALIZED)
193
194
  return;
194
195
  globalThis.__STORYBOOK_HIGHLIGHT_INITIALIZED = !0;
195
- let { document: e } = globalThis, d = T([]), l = T(/* @__PURE__ */ new Map()), r = T([]), p = T(), u = T(), m = T([]), f = T([]), E = T(),
196
- w = T(), v = e.getElementById(ie);
196
+ let { document: e } = globalThis, d = L([]), l = L(/* @__PURE__ */ new Map()), r = L([]), p = L(), u = L(), m = L([]), f = L([]), E = L(),
197
+ w = L(), v = e.getElementById(ie);
197
198
  d.subscribe(() => {
198
199
  v || (v = b("div", { id: ie }), e.body.appendChild(v));
199
200
  }), d.subscribe((n) => {
@@ -325,8 +326,8 @@ var g = "storybook-highlights-menu", ie = "storybook-highlights-root", ge = "sto
325
326
  }), Object.assign(h.children[0].style, {
326
327
  width: "100%",
327
328
  height: "100%",
328
- minHeight: `${L}px`,
329
- minWidth: `${L}px`,
329
+ minHeight: `${T}px`,
330
+ minWidth: `${T}px`,
330
331
  boxSizing: "content-box",
331
332
  padding: h.style.outlineWidth || "0px"
332
333
  }), V(h);
@@ -568,7 +569,7 @@ ue", Helvetica, Arial, sans-serif;
568
569
 
569
570
  // src/highlight/preview.ts
570
571
  globalThis?.FEATURES?.highlight && le?.ready && le.ready().then(re);
571
- var $e = /* @__PURE__ */ c(() => fe({}), "default");
572
+ var Se = /* @__PURE__ */ c(() => fe({}), "default");
572
573
  export {
573
- $e as default
574
+ Se as default
574
575
  };