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,5 +1,3 @@
1
- import { NormalizedProjectAnnotations, ProjectAnnotations, ComposedStoryFn } from 'storybook/internal/types';
2
-
3
1
  declare const ADDON_ID = "storybook/viewport";
4
2
  declare const PARAM_KEY = "viewport";
5
3
  declare const PANEL_ID = "storybook/viewport/panel";
@@ -8,7 +6,7 @@ declare const TOOL_ID = "storybook/viewport/tool";
8
6
  interface Viewport {
9
7
  name: string;
10
8
  styles: ViewportStyles;
11
- type: 'desktop' | 'mobile' | 'tablet' | 'other';
9
+ type?: 'desktop' | 'mobile' | 'tablet' | 'other';
12
10
  }
13
11
  interface ViewportStyles {
14
12
  height: string;
@@ -25,7 +23,7 @@ type GlobalState = {
25
23
  * When true the viewport applied will be rotated 90°, e.g. it will rotate from portrait to
26
24
  * landscape orientation.
27
25
  */
28
- isRotated: boolean;
26
+ isRotated?: boolean;
29
27
  };
30
28
  type GlobalStateUpdate = Partial<GlobalState>;
31
29
  interface ViewportParameters {
@@ -34,7 +32,7 @@ interface ViewportParameters {
34
32
  *
35
33
  * @see https://storybook.js.org/docs/essentials/viewport#parameters
36
34
  */
37
- viewport: {
35
+ viewport?: {
38
36
  /**
39
37
  * Remove the addon panel and disable the addon's behavior . If you wish to turn off this addon
40
38
  * for the entire Storybook, you should do so when registering addon-essentials
@@ -55,7 +53,11 @@ interface ViewportGlobals {
55
53
  *
56
54
  * @see https://storybook.js.org/docs/essentials/viewport#globals
57
55
  */
58
- viewport: GlobalState | GlobalState['value'];
56
+ viewport?: GlobalState | GlobalState['value'];
57
+ }
58
+ interface ViewportTypes {
59
+ parameters: ViewportParameters;
60
+ globals: ViewportGlobals;
59
61
  }
60
62
 
61
63
  declare const INITIAL_VIEWPORTS_DATA: {
@@ -289,531 +291,6 @@ declare const INITIAL_VIEWPORTS: ViewportMap;
289
291
  declare const DEFAULT_VIEWPORT = "responsive";
290
292
  declare const MINIMAL_VIEWPORTS: ViewportMap;
291
293
 
292
- /**
293
- * Actions represent the type of change to a location value.
294
- */
295
- declare enum Action {
296
- /**
297
- * A POP indicates a change to an arbitrary index in the history stack, such
298
- * as a back or forward navigation. It does not describe the direction of the
299
- * navigation, only that the current index changed.
300
- *
301
- * Note: This is the default action for newly created history objects.
302
- */
303
- Pop = "POP",
304
- /**
305
- * A PUSH indicates a new entry being added to the history stack, such as when
306
- * a link is clicked and a new page loads. When this happens, all subsequent
307
- * entries in the stack are lost.
308
- */
309
- Push = "PUSH",
310
- /**
311
- * A REPLACE indicates the entry at the current index in the history stack
312
- * being replaced by a new one.
313
- */
314
- Replace = "REPLACE"
315
- }
316
- /**
317
- * The pathname, search, and hash values of a URL.
318
- */
319
- interface Path {
320
- /**
321
- * A URL pathname, beginning with a /.
322
- */
323
- pathname: string;
324
- /**
325
- * A URL search string, beginning with a ?.
326
- */
327
- search: string;
328
- /**
329
- * A URL fragment identifier, beginning with a #.
330
- */
331
- hash: string;
332
- }
333
- /**
334
- * An entry in a history stack. A location contains information about the
335
- * URL path, as well as possibly some arbitrary state and a key.
336
- */
337
- interface Location extends Path {
338
- /**
339
- * A value of arbitrary data associated with this location.
340
- */
341
- state: any;
342
- /**
343
- * A unique string associated with this location. May be used to safely store
344
- * and retrieve data in some other storage API, like `localStorage`.
345
- *
346
- * Note: This value is always "default" on the initial location.
347
- */
348
- key: string;
349
- }
350
-
351
- /**
352
- * Map of routeId -> data returned from a loader/action/error
353
- */
354
- interface RouteData {
355
- [routeId: string]: any;
356
- }
357
- declare enum ResultType {
358
- data = "data",
359
- deferred = "deferred",
360
- redirect = "redirect",
361
- error = "error"
362
- }
363
- /**
364
- * Successful result from a loader or action
365
- */
366
- interface SuccessResult {
367
- type: ResultType.data;
368
- data: any;
369
- statusCode?: number;
370
- headers?: Headers;
371
- }
372
- /**
373
- * Successful defer() result from a loader or action
374
- */
375
- interface DeferredResult {
376
- type: ResultType.deferred;
377
- deferredData: DeferredData;
378
- statusCode?: number;
379
- headers?: Headers;
380
- }
381
- /**
382
- * Redirect result from a loader or action
383
- */
384
- interface RedirectResult {
385
- type: ResultType.redirect;
386
- status: number;
387
- location: string;
388
- revalidate: boolean;
389
- reloadDocument?: boolean;
390
- }
391
- /**
392
- * Unsuccessful result from a loader or action
393
- */
394
- interface ErrorResult {
395
- type: ResultType.error;
396
- error: any;
397
- headers?: Headers;
398
- }
399
- /**
400
- * Result from a loader or action - potentially successful or unsuccessful
401
- */
402
- type DataResult = SuccessResult | DeferredResult | RedirectResult | ErrorResult;
403
- type LowerCaseFormMethod = "get" | "post" | "put" | "patch" | "delete";
404
- type UpperCaseFormMethod = Uppercase<LowerCaseFormMethod>;
405
- /**
406
- * Active navigation/fetcher form methods are exposed in lowercase on the
407
- * RouterState
408
- */
409
- type FormMethod = LowerCaseFormMethod;
410
- /**
411
- * In v7, active navigation/fetcher form methods are exposed in uppercase on the
412
- * RouterState. This is to align with the normalization done via fetch().
413
- */
414
- type V7_FormMethod = UpperCaseFormMethod;
415
- type FormEncType = "application/x-www-form-urlencoded" | "multipart/form-data" | "application/json" | "text/plain";
416
- type JsonObject = {
417
- [Key in string]: JsonValue;
418
- } & {
419
- [Key in string]?: JsonValue | undefined;
420
- };
421
- type JsonArray = JsonValue[] | readonly JsonValue[];
422
- type JsonPrimitive = string | number | boolean | null;
423
- type JsonValue = JsonPrimitive | JsonObject | JsonArray;
424
- /**
425
- * @private
426
- * Internal interface to pass around for action submissions, not intended for
427
- * external consumption
428
- */
429
- type Submission = {
430
- formMethod: FormMethod | V7_FormMethod;
431
- formAction: string;
432
- formEncType: FormEncType;
433
- formData: FormData;
434
- json: undefined;
435
- text: undefined;
436
- } | {
437
- formMethod: FormMethod | V7_FormMethod;
438
- formAction: string;
439
- formEncType: FormEncType;
440
- formData: undefined;
441
- json: JsonValue;
442
- text: undefined;
443
- } | {
444
- formMethod: FormMethod | V7_FormMethod;
445
- formAction: string;
446
- formEncType: FormEncType;
447
- formData: undefined;
448
- json: undefined;
449
- text: string;
450
- };
451
- /**
452
- * @private
453
- * Arguments passed to route loader/action functions. Same for now but we keep
454
- * this as a private implementation detail in case they diverge in the future.
455
- */
456
- interface DataFunctionArgs {
457
- request: Request;
458
- params: Params;
459
- context?: any;
460
- }
461
- /**
462
- * Arguments passed to loader functions
463
- */
464
- interface LoaderFunctionArgs extends DataFunctionArgs {
465
- }
466
- /**
467
- * Arguments passed to action functions
468
- */
469
- interface ActionFunctionArgs extends DataFunctionArgs {
470
- }
471
- /**
472
- * Loaders and actions can return anything except `undefined` (`null` is a
473
- * valid return value if there is no data to return). Responses are preferred
474
- * and will ease any future migration to Remix
475
- */
476
- type DataFunctionValue = Response | NonNullable<unknown> | null;
477
- /**
478
- * Route loader function signature
479
- */
480
- interface LoaderFunction {
481
- (args: LoaderFunctionArgs): Promise<DataFunctionValue> | DataFunctionValue;
482
- }
483
- /**
484
- * Route action function signature
485
- */
486
- interface ActionFunction {
487
- (args: ActionFunctionArgs): Promise<DataFunctionValue> | DataFunctionValue;
488
- }
489
- /**
490
- * Route shouldRevalidate function signature. This runs after any submission
491
- * (navigation or fetcher), so we flatten the navigation/fetcher submission
492
- * onto the arguments. It shouldn't matter whether it came from a navigation
493
- * or a fetcher, what really matters is the URLs and the formData since loaders
494
- * have to re-run based on the data models that were potentially mutated.
495
- */
496
- interface ShouldRevalidateFunction {
497
- (args: {
498
- currentUrl: URL;
499
- currentParams: AgnosticDataRouteMatch["params"];
500
- nextUrl: URL;
501
- nextParams: AgnosticDataRouteMatch["params"];
502
- formMethod?: Submission["formMethod"];
503
- formAction?: Submission["formAction"];
504
- formEncType?: Submission["formEncType"];
505
- text?: Submission["text"];
506
- formData?: Submission["formData"];
507
- json?: Submission["json"];
508
- actionResult?: DataResult;
509
- defaultShouldRevalidate: boolean;
510
- }): boolean;
511
- }
512
- /**
513
- * Keys we cannot change from within a lazy() function. We spread all other keys
514
- * onto the route. Either they're meaningful to the router, or they'll get
515
- * ignored.
516
- */
517
- type ImmutableRouteKey = "lazy" | "caseSensitive" | "path" | "id" | "index" | "children";
518
- type RequireOne<T, Key = keyof T> = Exclude<{
519
- [K in keyof T]: K extends Key ? Omit<T, K> & Required<Pick<T, K>> : never;
520
- }[keyof T], undefined>;
521
- /**
522
- * lazy() function to load a route definition, which can add non-matching
523
- * related properties to a route
524
- */
525
- interface LazyRouteFunction<R extends AgnosticRouteObject> {
526
- (): Promise<RequireOne<Omit<R, ImmutableRouteKey>>>;
527
- }
528
- /**
529
- * Base RouteObject with common props shared by all types of routes
530
- */
531
- type AgnosticBaseRouteObject = {
532
- caseSensitive?: boolean;
533
- path?: string;
534
- id?: string;
535
- loader?: LoaderFunction;
536
- action?: ActionFunction;
537
- hasErrorBoundary?: boolean;
538
- shouldRevalidate?: ShouldRevalidateFunction;
539
- handle?: any;
540
- lazy?: LazyRouteFunction<AgnosticBaseRouteObject>;
541
- };
542
- /**
543
- * Index routes must not have children
544
- */
545
- type AgnosticIndexRouteObject = AgnosticBaseRouteObject & {
546
- children?: undefined;
547
- index: true;
548
- };
549
- /**
550
- * Non-index routes may have children, but cannot have index
551
- */
552
- type AgnosticNonIndexRouteObject = AgnosticBaseRouteObject & {
553
- children?: AgnosticRouteObject[];
554
- index?: false;
555
- };
556
- /**
557
- * A route object represents a logical route, with (optionally) its child
558
- * routes organized in a tree-like structure.
559
- */
560
- type AgnosticRouteObject = AgnosticIndexRouteObject | AgnosticNonIndexRouteObject;
561
- type AgnosticDataIndexRouteObject = AgnosticIndexRouteObject & {
562
- id: string;
563
- };
564
- type AgnosticDataNonIndexRouteObject = AgnosticNonIndexRouteObject & {
565
- children?: AgnosticDataRouteObject[];
566
- id: string;
567
- };
568
- /**
569
- * A data route object, which is just a RouteObject with a required unique ID
570
- */
571
- type AgnosticDataRouteObject = AgnosticDataIndexRouteObject | AgnosticDataNonIndexRouteObject;
572
- /**
573
- * The parameters that were parsed from the URL path.
574
- */
575
- type Params<Key extends string = string> = {
576
- readonly [key in Key]: string | undefined;
577
- };
578
- /**
579
- * A RouteMatch contains info about how a route matched a URL.
580
- */
581
- interface AgnosticRouteMatch<ParamKey extends string = string, RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject> {
582
- /**
583
- * The names and values of dynamic parameters in the URL.
584
- */
585
- params: Params<ParamKey>;
586
- /**
587
- * The portion of the URL pathname that was matched.
588
- */
589
- pathname: string;
590
- /**
591
- * The portion of the URL pathname that was matched before child routes.
592
- */
593
- pathnameBase: string;
594
- /**
595
- * The route object that was used to match.
596
- */
597
- route: RouteObjectType;
598
- }
599
- interface AgnosticDataRouteMatch extends AgnosticRouteMatch<string, AgnosticDataRouteObject> {
600
- }
601
- declare class DeferredData {
602
- private pendingKeysSet;
603
- private controller;
604
- private abortPromise;
605
- private unlistenAbortSignal;
606
- private subscribers;
607
- data: Record<string, unknown>;
608
- init?: ResponseInit;
609
- deferredKeys: string[];
610
- constructor(data: Record<string, unknown>, responseInit?: ResponseInit);
611
- private trackPromise;
612
- private onSettle;
613
- private emit;
614
- subscribe(fn: (aborted: boolean, settledKey?: string) => void): () => boolean;
615
- cancel(): void;
616
- resolveData(signal: AbortSignal): Promise<boolean>;
617
- get done(): boolean;
618
- get unwrappedData(): {};
619
- get pendingKeys(): string[];
620
- }
621
-
622
- /**
623
- * State maintained internally by the router. During a navigation, all states
624
- * reflect the the "old" location unless otherwise noted.
625
- */
626
- interface RouterState {
627
- /**
628
- * The action of the most recent navigation
629
- */
630
- historyAction: Action;
631
- /**
632
- * The current location reflected by the router
633
- */
634
- location: Location;
635
- /**
636
- * The current set of route matches
637
- */
638
- matches: AgnosticDataRouteMatch[];
639
- /**
640
- * Tracks whether we've completed our initial data load
641
- */
642
- initialized: boolean;
643
- /**
644
- * Current scroll position we should start at for a new view
645
- * - number -> scroll position to restore to
646
- * - false -> do not restore scroll at all (used during submissions)
647
- * - null -> don't have a saved position, scroll to hash or top of page
648
- */
649
- restoreScrollPosition: number | false | null;
650
- /**
651
- * Indicate whether this navigation should skip resetting the scroll position
652
- * if we are unable to restore the scroll position
653
- */
654
- preventScrollReset: boolean;
655
- /**
656
- * Tracks the state of the current navigation
657
- */
658
- navigation: Navigation;
659
- /**
660
- * Tracks any in-progress revalidations
661
- */
662
- revalidation: RevalidationState;
663
- /**
664
- * Data from the loaders for the current matches
665
- */
666
- loaderData: RouteData;
667
- /**
668
- * Data from the action for the current matches
669
- */
670
- actionData: RouteData | null;
671
- /**
672
- * Errors caught from loaders for the current matches
673
- */
674
- errors: RouteData | null;
675
- /**
676
- * Map of current fetchers
677
- */
678
- fetchers: Map<string, Fetcher>;
679
- /**
680
- * Map of current blockers
681
- */
682
- blockers: Map<string, Blocker>;
683
- }
684
- /**
685
- * Data that can be passed into hydrate a Router from SSR
686
- */
687
- type HydrationState = Partial<Pick<RouterState, "loaderData" | "actionData" | "errors">>;
688
- /**
689
- * Potential states for state.navigation
690
- */
691
- type NavigationStates = {
692
- Idle: {
693
- state: "idle";
694
- location: undefined;
695
- formMethod: undefined;
696
- formAction: undefined;
697
- formEncType: undefined;
698
- formData: undefined;
699
- json: undefined;
700
- text: undefined;
701
- };
702
- Loading: {
703
- state: "loading";
704
- location: Location;
705
- formMethod: Submission["formMethod"] | undefined;
706
- formAction: Submission["formAction"] | undefined;
707
- formEncType: Submission["formEncType"] | undefined;
708
- formData: Submission["formData"] | undefined;
709
- json: Submission["json"] | undefined;
710
- text: Submission["text"] | undefined;
711
- };
712
- Submitting: {
713
- state: "submitting";
714
- location: Location;
715
- formMethod: Submission["formMethod"];
716
- formAction: Submission["formAction"];
717
- formEncType: Submission["formEncType"];
718
- formData: Submission["formData"];
719
- json: Submission["json"];
720
- text: Submission["text"];
721
- };
722
- };
723
- type Navigation = NavigationStates[keyof NavigationStates];
724
- type RevalidationState = "idle" | "loading";
725
- /**
726
- * Potential states for fetchers
727
- */
728
- type FetcherStates<TData = any> = {
729
- Idle: {
730
- state: "idle";
731
- formMethod: undefined;
732
- formAction: undefined;
733
- formEncType: undefined;
734
- text: undefined;
735
- formData: undefined;
736
- json: undefined;
737
- data: TData | undefined;
738
- " _hasFetcherDoneAnything "?: boolean;
739
- };
740
- Loading: {
741
- state: "loading";
742
- formMethod: Submission["formMethod"] | undefined;
743
- formAction: Submission["formAction"] | undefined;
744
- formEncType: Submission["formEncType"] | undefined;
745
- text: Submission["text"] | undefined;
746
- formData: Submission["formData"] | undefined;
747
- json: Submission["json"] | undefined;
748
- data: TData | undefined;
749
- " _hasFetcherDoneAnything "?: boolean;
750
- };
751
- Submitting: {
752
- state: "submitting";
753
- formMethod: Submission["formMethod"];
754
- formAction: Submission["formAction"];
755
- formEncType: Submission["formEncType"];
756
- text: Submission["text"];
757
- formData: Submission["formData"];
758
- json: Submission["json"];
759
- data: TData | undefined;
760
- " _hasFetcherDoneAnything "?: boolean;
761
- };
762
- };
763
- type Fetcher<TData = any> = FetcherStates<TData>[keyof FetcherStates<TData>];
764
- interface BlockerBlocked {
765
- state: "blocked";
766
- reset(): void;
767
- proceed(): void;
768
- location: Location;
769
- }
770
- interface BlockerUnblocked {
771
- state: "unblocked";
772
- reset: undefined;
773
- proceed: undefined;
774
- location: undefined;
775
- }
776
- interface BlockerProceeding {
777
- state: "proceeding";
778
- reset: undefined;
779
- proceed: undefined;
780
- location: Location;
781
- }
782
- type Blocker = BlockerUnblocked | BlockerBlocked | BlockerProceeding;
783
-
784
- /**
785
- * NOTE: If you refactor this to split up the modules into separate files,
786
- * you'll need to update the rollup config for react-router-dom-v5-compat.
787
- */
788
-
789
- declare global {
790
- var __staticRouterHydrationData: HydrationState | undefined;
791
- }
792
-
793
- declare global {
794
- interface SymbolConstructor {
795
- readonly observable: symbol;
796
- }
797
- }
798
-
799
- declare global {
800
- var globalProjectAnnotations: NormalizedProjectAnnotations<any>;
801
- var defaultProjectAnnotations: ProjectAnnotations<any>;
802
- }
803
- type WrappedStoryRef = {
804
- __pw_type: 'jsx' | 'importRef';
805
- };
806
- type UnwrappedJSXStoryRef = {
807
- __pw_type: 'jsx';
808
- type: UnwrappedImportStoryRef;
809
- };
810
- type UnwrappedImportStoryRef = ComposedStoryFn;
811
- declare global {
812
- function __pwUnwrapObject(storyRef: WrappedStoryRef): Promise<UnwrappedJSXStoryRef | UnwrappedImportStoryRef>;
813
- }
814
-
815
- declare const initialGlobals: Record<string, GlobalState>;
816
-
817
294
  declare const responsiveViewport: Viewport;
818
295
 
819
- export { ADDON_ID, DEFAULT_VIEWPORT, type GlobalState, type GlobalStateUpdate, INITIAL_VIEWPORTS, type InitialViewportKeys, MINIMAL_VIEWPORTS, PANEL_ID, PARAM_KEY, TOOL_ID, type Viewport, type ViewportGlobals, type ViewportMap, type ViewportParameters, type ViewportStyles, initialGlobals, responsiveViewport };
296
+ export { ADDON_ID, DEFAULT_VIEWPORT, type GlobalState, type GlobalStateUpdate, INITIAL_VIEWPORTS, type InitialViewportKeys, MINIMAL_VIEWPORTS, PANEL_ID, PARAM_KEY, TOOL_ID, type Viewport, type ViewportGlobals, type ViewportMap, type ViewportParameters, type ViewportStyles, type ViewportTypes, responsiveViewport };
@@ -1,8 +1,8 @@
1
1
  // src/viewport/constants.ts
2
- var e = "storybook/viewport", t = "viewport", o = `${e}/panel`, h = `${e}/tool`;
2
+ var e = "storybook/viewport", p = "viewport", i = `${e}/panel`, h = `${e}/tool`;
3
3
 
4
4
  // src/viewport/defaults.ts
5
- var p = {
5
+ var t = {
6
6
  iphone5: {
7
7
  name: "iPhone 5",
8
8
  styles: {
@@ -227,7 +227,7 @@ var p = {
227
227
  },
228
228
  type: "mobile"
229
229
  }
230
- }, x = p, n = "responsive", l = {
230
+ }, x = t, s = "responsive", n = {
231
231
  mobile1: {
232
232
  name: "Small mobile",
233
233
  styles: {
@@ -262,14 +262,8 @@ var p = {
262
262
  }
263
263
  };
264
264
 
265
- // src/viewport/preview.ts
266
- import { definePreview as r } from "storybook/preview-api";
267
- var w = {
268
- [t]: { value: void 0, isRotated: !1 }
269
- };
270
-
271
265
  // src/viewport/responsiveViewport.tsx
272
- var g = {
266
+ var y = {
273
267
  name: "Reset viewport",
274
268
  styles: {
275
269
  height: "100%",
@@ -279,12 +273,11 @@ var g = {
279
273
  };
280
274
  export {
281
275
  e as ADDON_ID,
282
- n as DEFAULT_VIEWPORT,
276
+ s as DEFAULT_VIEWPORT,
283
277
  x as INITIAL_VIEWPORTS,
284
- l as MINIMAL_VIEWPORTS,
285
- o as PANEL_ID,
286
- t as PARAM_KEY,
278
+ n as MINIMAL_VIEWPORTS,
279
+ i as PANEL_ID,
280
+ p as PARAM_KEY,
287
281
  h as TOOL_ID,
288
- w as initialGlobals,
289
- g as responsiveViewport
282
+ y as responsiveViewport
290
283
  };
@@ -1,35 +1,35 @@
1
1
  "use strict";
2
- var p = Object.defineProperty;
3
- var c = Object.getOwnPropertyDescriptor;
4
- var d = Object.getOwnPropertyNames;
5
- var m = Object.prototype.hasOwnProperty;
6
- var l = (t, o) => p(t, "name", { value: o, configurable: !0 });
7
- var x = (t, o) => {
8
- for (var r in o)
9
- p(t, r, { get: o[r], enumerable: !0 });
10
- }, A = (t, o, r, i) => {
2
+ var r = Object.defineProperty;
3
+ var f = Object.getOwnPropertyDescriptor;
4
+ var x = Object.getOwnPropertyNames;
5
+ var y = Object.prototype.hasOwnProperty;
6
+ var s = (t, o) => r(t, "name", { value: o, configurable: !0 });
7
+ var A = (t, o) => {
8
+ for (var p in o)
9
+ r(t, p, { get: o[p], enumerable: !0 });
10
+ }, c = (t, o, p, i) => {
11
11
  if (o && typeof o == "object" || typeof o == "function")
12
- for (let e of d(o))
13
- !m.call(t, e) && e !== r && p(t, e, { get: () => o[e], enumerable: !(i = c(o, e)) || i.enumerable });
12
+ for (let e of x(o))
13
+ !y.call(t, e) && e !== p && r(t, e, { get: () => o[e], enumerable: !(i = f(o, e)) || i.enumerable });
14
14
  return t;
15
15
  };
16
- var D = (t) => A(p({}, "__esModule", { value: !0 }), t);
16
+ var m = (t) => c(r({}, "__esModule", { value: !0 }), t);
17
17
 
18
18
  // src/viewport/preview.ts
19
- var b = {};
20
- x(b, {
21
- default: () => _,
22
- initialGlobals: () => f
19
+ var D = {};
20
+ A(D, {
21
+ default: () => w,
22
+ initialGlobals: () => d
23
23
  });
24
- module.exports = D(b);
25
- var s = require("storybook/preview-api");
24
+ module.exports = m(D);
25
+ var a = require("storybook/internal/csf");
26
26
 
27
27
  // src/viewport/constants.ts
28
- var a = "storybook/viewport", n = "viewport", P = `${a}/panel`, R = `${a}/tool`;
28
+ var l = "storybook/viewport", n = "viewport", b = `${l}/panel`, v = `${l}/tool`;
29
29
 
30
30
  // src/viewport/preview.ts
31
- var f = {
31
+ var d = {
32
32
  [n]: { value: void 0, isRotated: !1 }
33
- }, _ = /* @__PURE__ */ l(() => (0, s.definePreview)({
34
- initialGlobals: f
33
+ }, w = /* @__PURE__ */ s(() => (0, a.definePreviewAddon)({
34
+ initialGlobals: d
35
35
  }), "default");