storybook 10.2.0-alpha.11 → 10.2.0-alpha.12

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 (69) hide show
  1. package/dist/_browser-chunks/chunk-AFVOZMXQ.js +23 -0
  2. package/dist/_browser-chunks/{chunk-RBABWY22.js → chunk-BGSDJMFM.js} +6 -4
  3. package/dist/_node-chunks/{builder-manager-MNAUTRWW.js → builder-manager-G3T6FATF.js} +13 -12
  4. package/dist/_node-chunks/{camelcase-6H4Z5R35.js → camelcase-NMVRRV6V.js} +7 -7
  5. package/dist/_node-chunks/chunk-BDTFFW43.js +18 -0
  6. package/dist/_node-chunks/chunk-ENNXNDBF.js +20 -0
  7. package/dist/_node-chunks/{chunk-5L22ATN3.js → chunk-EO2J5FE4.js} +8 -8
  8. package/dist/_node-chunks/{chunk-7FH4U6XC.js → chunk-ERDFVJJE.js} +15 -12
  9. package/dist/_node-chunks/{chunk-UOHDPKIW.js → chunk-FXCJJSMM.js} +7 -7
  10. package/dist/_node-chunks/chunk-G4RT3MO3.js +35 -0
  11. package/dist/_node-chunks/{chunk-GRH5JFTX.js → chunk-HMDODR3W.js} +7 -7
  12. package/dist/_node-chunks/{chunk-O7O53MP7.js → chunk-HSXHYDWU.js} +12 -12
  13. package/dist/_node-chunks/{chunk-2DZGIXSN.js → chunk-HVD2LZT3.js} +6 -6
  14. package/dist/_node-chunks/{chunk-URWJMVZI.js → chunk-IQUZPWN3.js} +7 -7
  15. package/dist/_node-chunks/{chunk-UNUWAUGG.js → chunk-IW5UJQJL.js} +6 -6
  16. package/dist/_node-chunks/{chunk-KU4SWNDM.js → chunk-KK73AHXT.js} +7 -7
  17. package/dist/_node-chunks/{chunk-MAMDH2R3.js → chunk-LF7P2YRI.js} +7 -7
  18. package/dist/_node-chunks/{chunk-WHIAK7AH.js → chunk-LMYWY6ZJ.js} +12 -12
  19. package/dist/_node-chunks/{chunk-HXFHXVEW.js → chunk-MCTOTRJG.js} +20 -20
  20. package/dist/_node-chunks/{chunk-F3OHO2BC.js → chunk-MDDTIMMD.js} +13 -13
  21. package/dist/_node-chunks/{chunk-L22DGLKT.js → chunk-OJ2CMYDH.js} +6 -6
  22. package/dist/_node-chunks/chunk-OQ42LCEX.js +61 -0
  23. package/dist/_node-chunks/{chunk-CMQYFTBQ.js → chunk-QGMW4WKW.js} +6 -6
  24. package/dist/_node-chunks/{chunk-MAQAZSXK.js → chunk-SEUBEMNQ.js} +6 -6
  25. package/dist/_node-chunks/{chunk-RJY225Z5.js → chunk-TFFPC3VZ.js} +7 -7
  26. package/dist/_node-chunks/chunk-TKRINGRM.js +23 -0
  27. package/dist/_node-chunks/{chunk-TFY6QV57.js → chunk-UEL7SAB5.js} +7 -7
  28. package/dist/_node-chunks/{chunk-UYMZAYR4.js → chunk-VBIK2FN2.js} +9 -9
  29. package/dist/_node-chunks/{chunk-TOMGRF4A.js → chunk-VL57YBAT.js} +10 -10
  30. package/dist/_node-chunks/{chunk-FWVZUHZX.js → chunk-WMWMEGTL.js} +6 -6
  31. package/dist/_node-chunks/{chunk-KAIK7772.js → chunk-XE2EF6IL.js} +9 -9
  32. package/dist/_node-chunks/{chunk-WQ4WQYSZ.js → chunk-YPYOZM4G.js} +7 -7
  33. package/dist/_node-chunks/{dist-ZOBQQCBA.js → dist-4VO67SAZ.js} +9 -9
  34. package/dist/_node-chunks/{globby-WNZSV3ZO.js → globby-4KANABX2.js} +9 -9
  35. package/dist/_node-chunks/{lib-YUWKNDR2.js → lib-2MKCQZND.js} +7 -7
  36. package/dist/_node-chunks/{mdx-N42X6CFJ-K5BCUPEA.js → mdx-N42X6CFJ-3ENJ5IE5.js} +8 -8
  37. package/dist/_node-chunks/{p-limit-ROJSQI7F.js → p-limit-TLF7WD5L.js} +7 -7
  38. package/dist/babel/index.js +10 -10
  39. package/dist/bin/core.js +12 -12
  40. package/dist/bin/dispatcher.js +11 -11
  41. package/dist/bin/loader.js +9 -9
  42. package/dist/cli/index.js +18 -18
  43. package/dist/common/index.js +19 -19
  44. package/dist/components/index.d.ts +1 -0
  45. package/dist/components/index.js +4 -0
  46. package/dist/core-server/index.d.ts +27 -2
  47. package/dist/core-server/index.js +45 -43
  48. package/dist/core-server/presets/common-manager.js +2 -2
  49. package/dist/core-server/presets/common-override-preset.js +9 -9
  50. package/dist/core-server/presets/common-preset.js +25 -24
  51. package/dist/csf/index.js +5 -2
  52. package/dist/csf-tools/index.js +10 -9
  53. package/dist/manager/globals-runtime.js +87 -23
  54. package/dist/manager/runtime.js +87 -886
  55. package/dist/manager-api/index.d.ts +86 -20
  56. package/dist/manager-api/index.js +52 -6
  57. package/dist/mocking-utils/index.js +8 -8
  58. package/dist/node-logger/index.js +9 -9
  59. package/dist/preview/runtime.js +24 -4
  60. package/dist/preview-api/index.d.ts +26 -1
  61. package/dist/preview-api/index.js +5 -1
  62. package/dist/server-errors.js +11 -11
  63. package/dist/telemetry/index.js +22 -22
  64. package/dist/types/index.d.ts +1 -0
  65. package/package.json +1 -1
  66. package/dist/_node-chunks/chunk-2CGMTALY.js +0 -61
  67. package/dist/_node-chunks/chunk-KX7OAVXY.js +0 -18
  68. package/dist/_node-chunks/chunk-P663SP7U.js +0 -20
  69. package/dist/_node-chunks/chunk-RI4IBKXZ.js +0 -23
@@ -5,8 +5,8 @@ import { RouterData, NavigateOptions } from 'storybook/internal/router';
5
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, API_TestEntry, 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
+ import { OpenInEditorResponsePayload, WhatsNewData } from 'storybook/internal/core-events';
8
9
  import { toId, StoryId as StoryId$1 } from 'storybook/internal/csf';
9
- import { WhatsNewData } from 'storybook/internal/core-events';
10
10
 
11
11
  declare function mockChannel(): Channel;
12
12
 
@@ -81,7 +81,7 @@ type ModuleArgs = RouterData & API_ProviderData<API> & {
81
81
  store: Store;
82
82
  };
83
83
 
84
- interface SubAPI$c {
84
+ interface SubAPI$d {
85
85
  /**
86
86
  * Returns a collection of elements of a specific type.
87
87
  *
@@ -128,7 +128,7 @@ interface SubAPI$c {
128
128
  getAddonState<S>(addonId: string): S;
129
129
  }
130
130
 
131
- interface SubAPI$b {
131
+ interface SubAPI$c {
132
132
  /**
133
133
  * Returns the channel object.
134
134
  *
@@ -177,7 +177,7 @@ interface SubState$9 {
177
177
  storyGlobals?: Globals;
178
178
  globalTypes?: GlobalTypes;
179
179
  }
180
- interface SubAPI$a {
180
+ interface SubAPI$b {
181
181
  /**
182
182
  * Returns the current globals, which is the user globals overlaid with the story globals
183
183
  *
@@ -216,7 +216,7 @@ interface SubState$8 {
216
216
  selectedPanel: string | undefined;
217
217
  theme: ThemeVars;
218
218
  }
219
- interface SubAPI$9 {
219
+ interface SubAPI$a {
220
220
  /**
221
221
  * Toggles the fullscreen mode of the Storybook UI.
222
222
  *
@@ -287,7 +287,7 @@ interface SubState$7 {
287
287
  notifications: API_Notification[];
288
288
  }
289
289
  /** The API for managing notifications. */
290
- interface SubAPI$8 {
290
+ interface SubAPI$9 {
291
291
  /**
292
292
  * Adds a new notification to the list of notifications. If a notification with the same ID
293
293
  * already exists, it will be replaced.
@@ -303,6 +303,19 @@ interface SubAPI$8 {
303
303
  clearNotification: (id: string) => void;
304
304
  }
305
305
 
306
+ /** The API for opening files in the editor. */
307
+ interface SubAPI$8 {
308
+ /**
309
+ * Opens the file in the editor. You can optionally provide a line and column number to open at a
310
+ * more specific location.
311
+ */
312
+ openInEditor: (payload: {
313
+ file: string;
314
+ line?: number;
315
+ column?: number;
316
+ }) => Promise<OpenInEditorResponsePayload>;
317
+ }
318
+
306
319
  interface SubAPI$7 {
307
320
  renderPreview?: API_IframeRenderer;
308
321
  }
@@ -495,6 +508,7 @@ interface API_Shortcuts {
495
508
  expandAll: API_KeyCollection;
496
509
  remount: API_KeyCollection;
497
510
  openInEditor: API_KeyCollection;
511
+ openInIsolation: API_KeyCollection;
498
512
  copyStoryLink: API_KeyCollection;
499
513
  }
500
514
  type API_Action = keyof API_Shortcuts;
@@ -745,6 +759,33 @@ interface SubAPI$2 {
745
759
  * @returns {void}
746
760
  */
747
761
  navigateUrl: (url: string, options: NavigateOptions) => void;
762
+ /**
763
+ * Get the manager and preview hrefs for a story.
764
+ *
765
+ * @param {string} storyId - The ID of the story to get the URL for.
766
+ * @param {Object} options - Options for the URL.
767
+ * @param {string} [options.base] - Return an absolute href based on the current origin or network
768
+ * address.
769
+ * @param {boolean} [options.inheritArgs] - Inherit args from the current URL. If storyId matches
770
+ * current story, inheritArgs defaults to true.
771
+ * @param {boolean} [options.inheritGlobals] - Inherit globals from the current URL. Defaults to
772
+ * true.
773
+ * @param {QueryParams} [options.queryParams] - Query params to add to the URL.
774
+ * @param {string} [options.refId] - ID of the ref to get the URL for (for composed Storybooks)
775
+ * @param {string} [options.viewMode] - The view mode to use, defaults to 'story'.
776
+ * @returns {Object} Manager and preview hrefs for the story.
777
+ */
778
+ getStoryHrefs(storyId: string, options?: {
779
+ base?: 'origin' | 'network';
780
+ inheritArgs?: boolean;
781
+ inheritGlobals?: boolean;
782
+ queryParams?: QueryParams;
783
+ refId?: string;
784
+ viewMode?: API_ViewMode;
785
+ }): {
786
+ managerHref: string;
787
+ previewHref: string;
788
+ };
748
789
  /**
749
790
  * Get the value of a query parameter from the current URL.
750
791
  *
@@ -864,7 +905,7 @@ declare const ManagerContext: React.Context<{
864
905
  state: State;
865
906
  }>;
866
907
  type State = SubState$8 & SubState$3 & SubState$6 & SubState$7 & SubState$1 & SubState$2 & SubState$4 & SubState$5 & SubState$9 & SubState & RouterData & API_OptionsData & Other;
867
- type API = SubAPI$c & SubAPI$b & SubAPI$7 & SubAPI$3 & SubAPI$6 & SubAPI$a & SubAPI$9 & SubAPI$8 & SubAPI$4 & SubAPI$5 & SubAPI$1 & SubAPI$2 & SubAPI & Other;
908
+ type API = SubAPI$d & SubAPI$c & SubAPI$7 & SubAPI$3 & SubAPI$6 & SubAPI$b & SubAPI$a & SubAPI$9 & SubAPI$4 & SubAPI$5 & SubAPI$1 & SubAPI$2 & SubAPI & SubAPI$8 & Other;
868
909
  interface Other {
869
910
  [key: string]: any;
870
911
  }
@@ -1746,6 +1787,31 @@ declare global {
1746
1787
  function __pwUnwrapObject(storyRef: WrappedStoryRef): Promise<UnwrappedJSXStoryRef | UnwrappedImportStoryRef>;
1747
1788
  }
1748
1789
 
1790
+ /** System tags used throughout Storybook for categorizing and filtering stories and docs entries. */
1791
+ declare const Tag: {
1792
+ /** Indicates that autodocs should be generated for this component */
1793
+ readonly AUTODOCS: "autodocs";
1794
+ /** MDX documentation attached to a component's stories file */
1795
+ readonly ATTACHED_MDX: "attached-mdx";
1796
+ /** Standalone MDX documentation not attached to stories */
1797
+ readonly UNATTACHED_MDX: "unattached-mdx";
1798
+ /** Story has a play function */
1799
+ readonly PLAY_FN: "play-fn";
1800
+ /** Story has a test function */
1801
+ readonly TEST_FN: "test-fn";
1802
+ /** Development environment tag */
1803
+ readonly DEV: "dev";
1804
+ /** Test environment tag */
1805
+ readonly TEST: "test";
1806
+ /** Manifest generation tag */
1807
+ readonly MANIFEST: "manifest";
1808
+ };
1809
+ /**
1810
+ * Tags can be any string, including custom user-defined tags. The Tag constant above defines the
1811
+ * system tags used by Storybook.
1812
+ */
1813
+ type Tag = string;
1814
+
1749
1815
  type TestProviderState = 'test-provider-state:pending' | 'test-provider-state:running' | 'test-provider-state:succeeded' | 'test-provider-state:crashed';
1750
1816
  type TestProviderId = string;
1751
1817
  type TestProviderStateByProviderId = Record<TestProviderId, TestProviderState>;
@@ -3199,11 +3265,11 @@ declare const userSettingSchema: ZodObject<{
3199
3265
  mutedAt?: number | undefined;
3200
3266
  }>>;
3201
3267
  }, "strip", ZodTypeAny, {
3202
- controls?: {
3268
+ autodocs?: {
3203
3269
  status?: "done" | "open" | "accepted" | "skipped" | undefined;
3204
3270
  mutedAt?: number | undefined;
3205
3271
  } | undefined;
3206
- autodocs?: {
3272
+ controls?: {
3207
3273
  status?: "done" | "open" | "accepted" | "skipped" | undefined;
3208
3274
  mutedAt?: number | undefined;
3209
3275
  } | undefined;
@@ -3288,11 +3354,11 @@ declare const userSettingSchema: ZodObject<{
3288
3354
  mutedAt?: number | undefined;
3289
3355
  } | undefined;
3290
3356
  }, {
3291
- controls?: {
3357
+ autodocs?: {
3292
3358
  status?: "done" | "open" | "accepted" | "skipped" | undefined;
3293
3359
  mutedAt?: number | undefined;
3294
3360
  } | undefined;
3295
- autodocs?: {
3361
+ controls?: {
3296
3362
  status?: "done" | "open" | "accepted" | "skipped" | undefined;
3297
3363
  mutedAt?: number | undefined;
3298
3364
  } | undefined;
@@ -3386,11 +3452,11 @@ declare const userSettingSchema: ZodObject<{
3386
3452
  }>>;
3387
3453
  }, "strip", ZodTypeAny, {
3388
3454
  items?: {
3389
- controls?: {
3455
+ autodocs?: {
3390
3456
  status?: "done" | "open" | "accepted" | "skipped" | undefined;
3391
3457
  mutedAt?: number | undefined;
3392
3458
  } | undefined;
3393
- autodocs?: {
3459
+ controls?: {
3394
3460
  status?: "done" | "open" | "accepted" | "skipped" | undefined;
3395
3461
  mutedAt?: number | undefined;
3396
3462
  } | undefined;
@@ -3480,11 +3546,11 @@ declare const userSettingSchema: ZodObject<{
3480
3546
  } | undefined;
3481
3547
  }, {
3482
3548
  items?: {
3483
- controls?: {
3549
+ autodocs?: {
3484
3550
  status?: "done" | "open" | "accepted" | "skipped" | undefined;
3485
3551
  mutedAt?: number | undefined;
3486
3552
  } | undefined;
3487
- autodocs?: {
3553
+ controls?: {
3488
3554
  status?: "done" | "open" | "accepted" | "skipped" | undefined;
3489
3555
  mutedAt?: number | undefined;
3490
3556
  } | undefined;
@@ -3581,11 +3647,11 @@ declare const userSettingSchema: ZodObject<{
3581
3647
  userSince?: number | undefined;
3582
3648
  checklist?: {
3583
3649
  items?: {
3584
- controls?: {
3650
+ autodocs?: {
3585
3651
  status?: "done" | "open" | "accepted" | "skipped" | undefined;
3586
3652
  mutedAt?: number | undefined;
3587
3653
  } | undefined;
3588
- autodocs?: {
3654
+ controls?: {
3589
3655
  status?: "done" | "open" | "accepted" | "skipped" | undefined;
3590
3656
  mutedAt?: number | undefined;
3591
3657
  } | undefined;
@@ -3682,11 +3748,11 @@ declare const userSettingSchema: ZodObject<{
3682
3748
  userSince?: number | undefined;
3683
3749
  checklist?: {
3684
3750
  items?: {
3685
- controls?: {
3751
+ autodocs?: {
3686
3752
  status?: "done" | "open" | "accepted" | "skipped" | undefined;
3687
3753
  mutedAt?: number | undefined;
3688
3754
  } | undefined;
3689
- autodocs?: {
3755
+ controls?: {
3690
3756
  status?: "done" | "open" | "accepted" | "skipped" | undefined;
3691
3757
  mutedAt?: number | undefined;
3692
3758
  } | undefined;
@@ -3837,4 +3903,4 @@ declare const checklistStore: {
3837
3903
  disable: (value: boolean) => void;
3838
3904
  };
3839
3905
 
3840
- export { type API, type API_EventMap, type API_KeyCollection, ActiveTabs, AddonStore, type Combo, ManagerConsumer as Consumer, type KeyboardEventLike, ManagerContext, type ManagerProviderProps, ManagerProvider as Provider, RequestResponseError, type State, type Options as StoreOptions, addons, combineParameters, controlOrMetaKey, controlOrMetaSymbol, eventMatchesShortcut, eventToShortcut, MockUniversalStore as experimental_MockUniversalStore, UniversalStore as experimental_UniversalStore, getStatusStoreByTypeId as experimental_getStatusStore, getTestProviderStoreById as experimental_getTestProviderStore, experimental_requestResponse, useStatusStore as experimental_useStatusStore, useTestProviderStore as experimental_useTestProviderStore, useUniversalStore as experimental_useUniversalStore, checklistStore as internal_checklistStore, fullStatusStore as internal_fullStatusStore, fullTestProviderStore as internal_fullTestProviderStore, universalChecklistStore as internal_universalChecklistStore, universalStatusStore as internal_universalStatusStore, universalTestProviderStore as internal_universalTestProviderStore, isMacLike, isShortcutTaken, keyToSymbol, _default as merge, mockChannel, optionOrAltSymbol, shortcutMatchesShortcut, shortcutToAriaKeyshortcuts, shortcutToHumanString, typesX as types, useAddonState, useArgTypes, useArgs, useChannel, useGlobalTypes, useGlobals, useParameter, useSharedState, useStoryPrepared, useStorybookApi, useStorybookState };
3906
+ export { type API, type API_EventMap, type API_KeyCollection, ActiveTabs, AddonStore, type Combo, ManagerConsumer as Consumer, type KeyboardEventLike, ManagerContext, type ManagerProviderProps, ManagerProvider as Provider, RequestResponseError, type State, type Options as StoreOptions, Tag, addons, combineParameters, controlOrMetaKey, controlOrMetaSymbol, eventMatchesShortcut, eventToShortcut, MockUniversalStore as experimental_MockUniversalStore, UniversalStore as experimental_UniversalStore, getStatusStoreByTypeId as experimental_getStatusStore, getTestProviderStoreById as experimental_getTestProviderStore, experimental_requestResponse, useStatusStore as experimental_useStatusStore, useTestProviderStore as experimental_useTestProviderStore, useUniversalStore as experimental_useUniversalStore, checklistStore as internal_checklistStore, fullStatusStore as internal_fullStatusStore, fullTestProviderStore as internal_fullTestProviderStore, universalChecklistStore as internal_universalChecklistStore, universalStatusStore as internal_universalStatusStore, universalTestProviderStore as internal_universalTestProviderStore, isMacLike, isShortcutTaken, keyToSymbol, _default as merge, mockChannel, optionOrAltSymbol, shortcutMatchesShortcut, shortcutToAriaKeyshortcuts, shortcutToHumanString, typesX as types, useAddonState, useArgTypes, useArgs, useChannel, useGlobalTypes, useGlobals, useParameter, useSharedState, useStoryPrepared, useStorybookApi, useStorybookState };
@@ -17,6 +17,12 @@ import {
17
17
  dequal,
18
18
  partition
19
19
  } from "../_browser-chunks/chunk-NQJGOFZV.js";
20
+ import {
21
+ Tag
22
+ } from "../_browser-chunks/chunk-AFVOZMXQ.js";
23
+ import {
24
+ require_main
25
+ } from "../_browser-chunks/chunk-XLJZ7AOP.js";
20
26
  import {
21
27
  isEqual
22
28
  } from "../_browser-chunks/chunk-IYCKG66Y.js";
@@ -654,7 +660,7 @@ var TITLE_PATH_SEPARATOR = /\s*\/\s*/, denormalizeStoryParameters = ({
654
660
  entries: Object.values(index.entries).reduce(
655
661
  (acc, entry) => (acc[entry.id] = {
656
662
  ...entry,
657
- tags: entry.tags ? ["dev", "test", ...entry.tags] : ["dev"]
663
+ tags: entry.tags ? [Tag.DEV, Tag.TEST, ...entry.tags] : [Tag.DEV]
658
664
  }, acc),
659
665
  {}
660
666
  )
@@ -1460,6 +1466,7 @@ var defaultShortcuts = Object.freeze({
1460
1466
  expandAll: [controlOrMetaKey2(), "shift", "ArrowDown"],
1461
1467
  remount: ["alt", "R"],
1462
1468
  openInEditor: ["alt", "shift", "E"],
1469
+ openInIsolation: ["alt", "shift", "I"],
1463
1470
  copyStoryLink: ["alt", "shift", "L"]
1464
1471
  // TODO: bring this back once we want to add shortcuts for this
1465
1472
  // copyStoryName: ['alt', 'shift', 'C'],
@@ -1527,7 +1534,9 @@ var init10 = ({ store: store2, fullAPI, provider }) => {
1527
1534
  handleShortcutFeature(feature, event) {
1528
1535
  let {
1529
1536
  ui: { enableShortcuts },
1530
- storyId
1537
+ storyId,
1538
+ refId,
1539
+ viewMode
1531
1540
  } = store2.getState();
1532
1541
  if (enableShortcuts)
1533
1542
  switch (event?.preventDefault && event.preventDefault(), feature) {
@@ -1620,6 +1629,13 @@ var init10 = ({ store: store2, fullAPI, provider }) => {
1620
1629
  });
1621
1630
  break;
1622
1631
  }
1632
+ case "openInIsolation": {
1633
+ if (storyId && viewMode === "story") {
1634
+ let { previewHref } = fullAPI.getStoryHrefs(storyId, { refId });
1635
+ window.open(previewHref, "_blank", "noopener,noreferrer");
1636
+ }
1637
+ break;
1638
+ }
1623
1639
  // TODO: bring this back once we want to add shortcuts for this
1624
1640
  // case 'copyStoryName': {
1625
1641
  // const storyData = fullAPI.getCurrentStoryData();
@@ -1629,7 +1645,10 @@ var init10 = ({ store: store2, fullAPI, provider }) => {
1629
1645
  // break;
1630
1646
  // }
1631
1647
  case "copyStoryLink": {
1632
- (0, import_copy_to_clipboard.default)(window.location.href);
1648
+ if (storyId) {
1649
+ let { managerHref } = fullAPI.getStoryHrefs(storyId, { refId });
1650
+ (0, import_copy_to_clipboard.default)(managerHref);
1651
+ }
1633
1652
  break;
1634
1653
  }
1635
1654
  default:
@@ -2237,11 +2256,17 @@ import {
2237
2256
  } from "storybook/internal/core-events";
2238
2257
  import { buildArgsParam, queryFromLocation } from "storybook/internal/router";
2239
2258
  import { global as global7 } from "@storybook/global";
2240
- var { window: globalWindow } = global7, parseBoolean = (value) => {
2259
+ var import_picoquery = __toESM(require_main(), 1);
2260
+ var parseBoolean = (value) => {
2241
2261
  if (value === "true" || value === "1")
2242
2262
  return !0;
2243
2263
  if (value === "false" || value === "0")
2244
2264
  return !1;
2265
+ }, parseSerializedParam = (param) => Object.fromEntries(
2266
+ param.split(";").map((pair) => pair.split(":")).map(([key, value]) => [key, encodeURIComponent(value)]).filter(([key, value]) => key && value)
2267
+ ), mergeSerializedParams = (params, extraParams) => {
2268
+ let pairs = parseSerializedParam(params), extra = parseSerializedParam(extraParams);
2269
+ return Object.entries({ ...pairs, ...extra }).map(([key, value]) => `${key}:${value}`).join(";");
2245
2270
  }, prevParams, initialUrlSupport = ({
2246
2271
  state: { location: location2, path, viewMode, storyId: storyIdFromUrl },
2247
2272
  singleStory
@@ -2273,6 +2298,26 @@ var { window: globalWindow } = global7, parseBoolean = (value) => {
2273
2298
  let params = Object.entries(queryParams).filter(([, v]) => v).sort(([a], [b]) => a < b ? -1 : 1).map(([k, v]) => `${k}=${v}`), to = [path, ...params].join("&");
2274
2299
  return navigate(to, options);
2275
2300
  }, api = {
2301
+ getStoryHrefs(storyId, options = {}) {
2302
+ let { id: currentStoryId, refId: currentRefId } = fullAPI.getCurrentStoryData() ?? {}, isCurrentStory = storyId === currentStoryId && options.refId === currentRefId, { customQueryParams, location: location2, refs } = store2.getState(), {
2303
+ base,
2304
+ inheritArgs = isCurrentStory,
2305
+ inheritGlobals = !0,
2306
+ queryParams = {},
2307
+ refId,
2308
+ viewMode = "story"
2309
+ } = options;
2310
+ if (refId && !refs[refId])
2311
+ throw new Error(`Invalid refId: ${refId}`);
2312
+ let originAddress = global7.window.location.origin + location2.pathname, networkAddress = global7.STORYBOOK_NETWORK_ADDRESS ?? originAddress, managerBase = base === "origin" ? originAddress : base === "network" ? networkAddress : location2.pathname, previewBase = refId ? refs[refId].url + "/iframe.html" : global7.PREVIEW_URL || `${managerBase}iframe.html`, refParam = refId ? `&refId=${encodeURIComponent(refId)}` : "", { args = "", globals = "", ...otherParams } = queryParams, argsParam = inheritArgs ? mergeSerializedParams(customQueryParams?.args ?? "", args) : args, globalsParam = inheritGlobals ? mergeSerializedParams(customQueryParams?.globals ?? "", globals) : globals, customParams = (0, import_picoquery.stringify)(otherParams, {
2313
+ nesting: !0,
2314
+ nestingSyntax: "js"
2315
+ });
2316
+ return argsParam = argsParam && `&args=${argsParam}`, globalsParam = globalsParam && `&globals=${globalsParam}`, customParams = customParams && `&${customParams}`, {
2317
+ managerHref: `${managerBase}?path=/${viewMode}/${refId ? `${refId}_` : ""}${storyId}${argsParam}${globalsParam}${customParams}`,
2318
+ previewHref: `${previewBase}?id=${storyId}&viewMode=${viewMode}${refParam}${argsParam}${refId ? "" : globalsParam}${customParams}`
2319
+ };
2320
+ },
2276
2321
  getQueryParam(key) {
2277
2322
  let { customQueryParams } = store2.getState();
2278
2323
  return customQueryParams ? customQueryParams[key] : void 0;
@@ -2315,7 +2360,7 @@ var { window: globalWindow } = global7, parseBoolean = (value) => {
2315
2360
  provider.channel?.on(SET_CURRENT_STORY2, () => updateArgsParam());
2316
2361
  let handleOrId;
2317
2362
  return provider.channel?.on(STORY_ARGS_UPDATED2, () => {
2318
- "requestIdleCallback" in globalWindow ? (handleOrId && globalWindow.cancelIdleCallback(handleOrId), handleOrId = globalWindow.requestIdleCallback(updateArgsParam, { timeout: 1e3 })) : (handleOrId && clearTimeout(handleOrId), setTimeout(updateArgsParam, 100));
2363
+ "requestIdleCallback" in global7.window ? (handleOrId && global7.window.cancelIdleCallback(handleOrId), handleOrId = global7.window.requestIdleCallback(updateArgsParam, { timeout: 1e3 })) : (handleOrId && clearTimeout(handleOrId), setTimeout(updateArgsParam, 100));
2319
2364
  }), provider.channel?.on(GLOBALS_UPDATED2, ({ userGlobals, initialGlobals }) => {
2320
2365
  let { path, hash = "", queryParams } = api.getUrlState(), globalsString = buildArgsParam(initialGlobals, userGlobals);
2321
2366
  navigateTo(`${path}${hash}`, { ...queryParams, globals: globalsString }, { replace: !0 }), api.setQueryParams({ globals: globalsString });
@@ -2337,7 +2382,7 @@ import { global as global8 } from "@storybook/global";
2337
2382
  import semver from "semver";
2338
2383
 
2339
2384
  // src/manager-api/version.ts
2340
- var version = "10.2.0-alpha.11";
2385
+ var version = "10.2.0-alpha.12";
2341
2386
 
2342
2387
  // src/manager-api/modules/versions.ts
2343
2388
  var { VERSIONCHECK } = global8, getVersionCheckData = (0, import_memoizerific2.default)(1)(() => {
@@ -2971,6 +3016,7 @@ export {
2971
3016
  ManagerContext,
2972
3017
  ManagerProvider as Provider,
2973
3018
  RequestResponseError,
3019
+ Tag,
2974
3020
  addons,
2975
3021
  combineParameters,
2976
3022
  controlOrMetaKey,
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_aucdos01fk5 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_aucdos01fk5 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_aucdos01fk5 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_0j7q77gppets from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_0j7q77gppets from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_0j7q77gppets from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_aucdos01fk5.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_aucdos01fk5.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_aucdos01fk5.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_0j7q77gppets.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_0j7q77gppets.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_0j7q77gppets.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -16,8 +16,8 @@ import {
16
16
  join,
17
17
  normalize,
18
18
  resolve
19
- } from "../_node-chunks/chunk-MAQAZSXK.js";
20
- import "../_node-chunks/chunk-FWVZUHZX.js";
19
+ } from "../_node-chunks/chunk-SEUBEMNQ.js";
20
+ import "../_node-chunks/chunk-WMWMEGTL.js";
21
21
 
22
22
  // ../../node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
23
23
  var comma = 44, semicolon = 59, chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", intToChar = new Uint8Array(64), charToInt = new Uint8Array(128);
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_aucdos01fk5 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_aucdos01fk5 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_aucdos01fk5 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_0j7q77gppets from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_0j7q77gppets from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_0j7q77gppets from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_aucdos01fk5.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_aucdos01fk5.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_aucdos01fk5.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_0j7q77gppets.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_0j7q77gppets.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_0j7q77gppets.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -22,9 +22,9 @@ import {
22
22
  once,
23
23
  prompt,
24
24
  protectUrls
25
- } from "../_node-chunks/chunk-5L22ATN3.js";
26
- import "../_node-chunks/chunk-WQ4WQYSZ.js";
27
- import "../_node-chunks/chunk-FWVZUHZX.js";
25
+ } from "../_node-chunks/chunk-EO2J5FE4.js";
26
+ import "../_node-chunks/chunk-YPYOZM4G.js";
27
+ import "../_node-chunks/chunk-WMWMEGTL.js";
28
28
  var export_instance = import_npmlog.default;
29
29
  export {
30
30
  CLI_COLORS,
@@ -16101,6 +16101,7 @@ __export(preview_api_exports, {
16101
16101
  PreviewWithSelection: () => PreviewWithSelection,
16102
16102
  ReporterAPI: () => ReporterAPI,
16103
16103
  StoryStore: () => StoryStore,
16104
+ Tag: () => Tag,
16104
16105
  UrlStore: () => UrlStore,
16105
16106
  WebView: () => WebView,
16106
16107
  addons: () => addons,
@@ -16466,6 +16467,26 @@ function splitByComma(s3) {
16466
16467
  return lastToken && result.push(lastToken), result;
16467
16468
  }
16468
16469
 
16470
+ // src/shared/constants/tags.ts
16471
+ var Tag = {
16472
+ /** Indicates that autodocs should be generated for this component */
16473
+ AUTODOCS: "autodocs",
16474
+ /** MDX documentation attached to a component's stories file */
16475
+ ATTACHED_MDX: "attached-mdx",
16476
+ /** Standalone MDX documentation not attached to stories */
16477
+ UNATTACHED_MDX: "unattached-mdx",
16478
+ /** Story has a play function */
16479
+ PLAY_FN: "play-fn",
16480
+ /** Story has a test function */
16481
+ TEST_FN: "test-fn",
16482
+ /** Development environment tag */
16483
+ DEV: "dev",
16484
+ /** Test environment tag */
16485
+ TEST: "test",
16486
+ /** Manifest generation tag */
16487
+ MANIFEST: "manifest"
16488
+ };
16489
+
16469
16490
  // src/actions/addArgs.ts
16470
16491
  var addArgs_exports = {};
16471
16492
  __export(addArgs_exports, {
@@ -34971,7 +34992,7 @@ function prepareMeta(componentAnnotations, projectAnnotations, moduleExport) {
34971
34992
  };
34972
34993
  }
34973
34994
  function preparePartialAnnotations(storyAnnotations, componentAnnotations, projectAnnotations) {
34974
- let defaultTags = ["dev", "test"], extraTags = scope.DOCS_OPTIONS?.autodocs === !0 ? ["autodocs"] : [], overrideTags = storyAnnotations?.tags?.includes("test-fn") ? ["!autodocs"] : [], tags = combineTags(
34995
+ let defaultTags = [Tag.DEV, Tag.TEST], extraTags = scope.DOCS_OPTIONS?.autodocs === !0 ? [Tag.AUTODOCS] : [], overrideTags = storyAnnotations?.tags?.includes(Tag.TEST_FN) ? [`!${Tag.AUTODOCS}`] : [], tags = combineTags(
34975
34996
  ...defaultTags,
34976
34997
  ...extraTags,
34977
34998
  ...projectAnnotations.tags ?? [],
@@ -36560,9 +36581,8 @@ function focusInInput(event) {
36560
36581
  let target = event.composedPath && event.composedPath()[0] || event.target;
36561
36582
  return /input|textarea/i.test(target.tagName) || target.getAttribute("contenteditable") !== null;
36562
36583
  }
36563
- var ATTACHED_MDX_TAG = "attached-mdx", UNATTACHED_MDX_TAG = "unattached-mdx";
36564
36584
  function isMdxEntry({ tags }) {
36565
- return tags?.includes(UNATTACHED_MDX_TAG) || tags?.includes(ATTACHED_MDX_TAG);
36585
+ return tags?.includes(Tag.UNATTACHED_MDX) || tags?.includes(Tag.ATTACHED_MDX);
36566
36586
  }
36567
36587
  function isStoryRender(r) {
36568
36588
  return r.type === "story";
@@ -36740,7 +36760,7 @@ var PreviewWithSelection = class extends Preview {
36740
36760
  initialGlobals: initialGlobals5,
36741
36761
  storyGlobals: {},
36742
36762
  userGlobals: globals
36743
- }), isCsfDocsRender(render) || render.entry.tags?.includes(ATTACHED_MDX_TAG)) {
36763
+ }), isCsfDocsRender(render) || render.entry.tags?.includes(Tag.ATTACHED_MDX)) {
36744
36764
  if (!render.csfFiles)
36745
36765
  throw new MdxFileWithNoCsfReferencesError({ storyId });
36746
36766
  ({ parameters: parameters2 } = this.storyStoreValue.preparedMetaFromCSFFile({
@@ -1049,4 +1049,29 @@ declare function emitTransformCode(source: string | undefined, context: ReducedS
1049
1049
  declare function pauseAnimations(atEnd?: boolean): CleanupCallback;
1050
1050
  declare function waitForAnimations(signal?: AbortSignal): Promise<void>;
1051
1051
 
1052
- export { DocsContext, HooksContext, Preview, PreviewWeb, PreviewWithSelection, type PropDescriptor, type Report, ReporterAPI, type SelectionStore, StoryStore, UrlStore, type View, WebView, addons, applyHooks, combineArgs, combineParameters, composeConfigs, composeStepRunners, composeStories, composeStory, createPlaywrightTest, decorateStory, defaultDecorateStory, emitTransformCode, filterArgTypes, getCsfFactoryAnnotations, inferControls, makeDecorator, mockChannel, normalizeArrays, normalizeProjectAnnotations, normalizeStory, pauseAnimations, prepareMeta, prepareStory, sanitizeStoryContextUpdate, setDefaultProjectAnnotations, setProjectAnnotations, simulateDOMContentLoaded, simulatePageLoad, sortStoriesV7, useArgs, useCallback, useChannel, useEffect, useGlobals, useMemo, useParameter, useReducer, useRef, useState, useStoryContext, userOrAutoTitle, userOrAutoTitleFromSpecifier, waitForAnimations };
1052
+ /** System tags used throughout Storybook for categorizing and filtering stories and docs entries. */
1053
+ declare const Tag: {
1054
+ /** Indicates that autodocs should be generated for this component */
1055
+ readonly AUTODOCS: "autodocs";
1056
+ /** MDX documentation attached to a component's stories file */
1057
+ readonly ATTACHED_MDX: "attached-mdx";
1058
+ /** Standalone MDX documentation not attached to stories */
1059
+ readonly UNATTACHED_MDX: "unattached-mdx";
1060
+ /** Story has a play function */
1061
+ readonly PLAY_FN: "play-fn";
1062
+ /** Story has a test function */
1063
+ readonly TEST_FN: "test-fn";
1064
+ /** Development environment tag */
1065
+ readonly DEV: "dev";
1066
+ /** Test environment tag */
1067
+ readonly TEST: "test";
1068
+ /** Manifest generation tag */
1069
+ readonly MANIFEST: "manifest";
1070
+ };
1071
+ /**
1072
+ * Tags can be any string, including custom user-defined tags. The Tag constant above defines the
1073
+ * system tags used by Storybook.
1074
+ */
1075
+ type Tag = string;
1076
+
1077
+ export { DocsContext, HooksContext, Preview, PreviewWeb, PreviewWithSelection, type PropDescriptor, type Report, ReporterAPI, type SelectionStore, StoryStore, Tag, UrlStore, type View, WebView, addons, applyHooks, combineArgs, combineParameters, composeConfigs, composeStepRunners, composeStories, composeStory, createPlaywrightTest, decorateStory, defaultDecorateStory, emitTransformCode, filterArgTypes, getCsfFactoryAnnotations, inferControls, makeDecorator, mockChannel, normalizeArrays, normalizeProjectAnnotations, normalizeStory, pauseAnimations, prepareMeta, prepareStory, sanitizeStoryContextUpdate, setDefaultProjectAnnotations, setProjectAnnotations, simulateDOMContentLoaded, simulatePageLoad, sortStoriesV7, useArgs, useCallback, useChannel, useEffect, useGlobals, useMemo, useParameter, useReducer, useRef, useState, useStoryContext, userOrAutoTitle, userOrAutoTitleFromSpecifier, waitForAnimations };
@@ -48,11 +48,14 @@ import {
48
48
  useStoryContext,
49
49
  userOrAutoTitle,
50
50
  userOrAutoTitleFromSpecifier
51
- } from "../_browser-chunks/chunk-RBABWY22.js";
51
+ } from "../_browser-chunks/chunk-BGSDJMFM.js";
52
52
  import {
53
53
  pauseAnimations,
54
54
  waitForAnimations
55
55
  } from "../_browser-chunks/chunk-MEXTPDJG.js";
56
+ import {
57
+ Tag
58
+ } from "../_browser-chunks/chunk-AFVOZMXQ.js";
56
59
  import "../_browser-chunks/chunk-XLJZ7AOP.js";
57
60
  import {
58
61
  combineParameters
@@ -74,6 +77,7 @@ export {
74
77
  PreviewWithSelection,
75
78
  ReporterAPI,
76
79
  StoryStore,
80
+ Tag,
77
81
  UrlStore,
78
82
  WebView,
79
83
  addons,
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_aucdos01fk5 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_aucdos01fk5 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_aucdos01fk5 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_0j7q77gppets from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_0j7q77gppets from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_0j7q77gppets from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_aucdos01fk5.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_aucdos01fk5.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_aucdos01fk5.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_0j7q77gppets.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_0j7q77gppets.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_0j7q77gppets.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -46,13 +46,13 @@ import {
46
46
  WebpackCompilationError,
47
47
  WebpackInvocationError,
48
48
  WebpackMissingStatsError
49
- } from "./_node-chunks/chunk-TOMGRF4A.js";
49
+ } from "./_node-chunks/chunk-VL57YBAT.js";
50
50
  import {
51
51
  StorybookError
52
- } from "./_node-chunks/chunk-2DZGIXSN.js";
53
- import "./_node-chunks/chunk-URWJMVZI.js";
54
- import "./_node-chunks/chunk-WQ4WQYSZ.js";
55
- import "./_node-chunks/chunk-FWVZUHZX.js";
52
+ } from "./_node-chunks/chunk-HVD2LZT3.js";
53
+ import "./_node-chunks/chunk-IQUZPWN3.js";
54
+ import "./_node-chunks/chunk-YPYOZM4G.js";
55
+ import "./_node-chunks/chunk-WMWMEGTL.js";
56
56
  export {
57
57
  AddonVitestPostinstallConfigUpdateError,
58
58
  AddonVitestPostinstallError,