storybook 10.0.0-beta.6 → 10.0.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/_browser-chunks/{chunk-YQV3EGQ5.js → chunk-OQ6NCFPL.js} +38 -15
  2. package/dist/_browser-chunks/{chunk-O5R5CGFA.js → chunk-TMDZCWME.js} +1 -2
  3. package/dist/_node-chunks/{builder-manager-V33CQT2M.js → builder-manager-VFP7HSCF.js} +13 -13
  4. package/dist/_node-chunks/camelcase-ZLZNQMDD.js +18 -0
  5. package/dist/_node-chunks/{chunk-4TOI4VSK.js → chunk-2GCKJYK6.js} +7 -7
  6. package/dist/_node-chunks/{chunk-NKZ4UPPV.js → chunk-3NIQHNDU.js} +7 -7
  7. package/dist/_node-chunks/{chunk-VQH4ZFTS.js → chunk-3QZ7KLON.js} +8 -8
  8. package/dist/_node-chunks/{chunk-HPFXREVG.js → chunk-3XXQRL3A.js} +7 -7
  9. package/dist/_node-chunks/{chunk-IINJT47N.js → chunk-46BWYN3K.js} +7 -7
  10. package/dist/_node-chunks/{chunk-E6TLN2J2.js → chunk-4DIDWIST.js} +7 -7
  11. package/dist/_node-chunks/{chunk-55VWKF63.js → chunk-5YUTWYNI.js} +9 -9
  12. package/dist/_node-chunks/{chunk-7WH7AGOR.js → chunk-A2DKPKBY.js} +7 -7
  13. package/dist/_node-chunks/{chunk-TJIMCNYJ.js → chunk-BC23FKU4.js} +8 -8
  14. package/dist/_node-chunks/{chunk-HEBHWRWL.js → chunk-BID2X7MU.js} +7 -7
  15. package/dist/_node-chunks/{chunk-BNOZ3EKF.js → chunk-C4EOB63P.js} +7 -7
  16. package/dist/_node-chunks/{chunk-EAOPWIKA.js → chunk-DH7BCQMG.js} +8 -8
  17. package/dist/_node-chunks/{chunk-JNHUDBJL.js → chunk-FCNWWJV7.js} +7 -7
  18. package/dist/_node-chunks/{chunk-6PTV7XGR.js → chunk-GBZZSL2K.js} +264 -109
  19. package/dist/_node-chunks/{chunk-DC7OWBHB.js → chunk-GCWAGPDV.js} +12 -12
  20. package/dist/_node-chunks/{chunk-B3AMFGAL.js → chunk-I7SRMFT5.js} +7 -7
  21. package/dist/_node-chunks/{chunk-EY5PTUZL.js → chunk-IEFSRAX2.js} +10 -10
  22. package/dist/_node-chunks/{chunk-A7CUP23N.js → chunk-IGWCAXA2.js} +7 -7
  23. package/dist/_node-chunks/chunk-IYOHZPPC.js +18 -0
  24. package/dist/_node-chunks/{chunk-NUVGSFQI.js → chunk-KVOP6ASA.js} +7 -7
  25. package/dist/_node-chunks/{chunk-F3PO67U3.js → chunk-MHVF6Y35.js} +7 -7
  26. package/dist/_node-chunks/{chunk-NJXBURX7.js → chunk-MRCMZPA2.js} +7 -7
  27. package/dist/_node-chunks/chunk-RNHUADRS.js +62 -0
  28. package/dist/_node-chunks/{chunk-UYKQJMQY.js → chunk-RP3VMQPF.js} +15 -15
  29. package/dist/_node-chunks/{chunk-MLBTKECD.js → chunk-TFIGR2HH.js} +7 -7
  30. package/dist/_node-chunks/{chunk-JOXYGIZK.js → chunk-TXDIOSHI.js} +9 -9
  31. package/dist/_node-chunks/{chunk-2DMFI367.js → chunk-U6MJQ7C6.js} +7 -7
  32. package/dist/_node-chunks/{chunk-RIPA4LFD.js → chunk-XXVKM2ZR.js} +26 -23
  33. package/dist/_node-chunks/{chunk-VSC6LSCQ.js → chunk-YWU65VY4.js} +6 -6
  34. package/dist/_node-chunks/{chunk-5IEY46LQ.js → chunk-Z3PLI7S2.js} +7 -7
  35. package/dist/_node-chunks/{chunk-XZTBG2TG.js → chunk-ZM2HT2RW.js} +6 -6
  36. package/dist/_node-chunks/{chunk-7NJGTQ3W.js → chunk-ZPNXCXIT.js} +8 -8
  37. package/dist/_node-chunks/{dist-CGGAYWME.js → dist-PG4I7ZDU.js} +9 -9
  38. package/dist/_node-chunks/{globby-3IFB7BJC.js → globby-HXB6X43W.js} +9 -9
  39. package/dist/_node-chunks/{lib-IT6OBSID.js → lib-4JJTZC7T.js} +7 -7
  40. package/dist/_node-chunks/{mdx-N42X6CFJ-WM36SSZ6.js → mdx-N42X6CFJ-3JBJ7PQF.js} +8 -8
  41. package/dist/_node-chunks/{p-limit-3V5XIKA7.js → p-limit-WBBNX4KI.js} +7 -7
  42. package/dist/_node-chunks/{plugin-GJUBUKCT.js → plugin-SEQ2OPRK.js} +10 -10
  43. package/dist/_node-chunks/{plugin-3YREMMJJ.js → plugin-SG6I7RFC.js} +10 -10
  44. package/dist/_node-chunks/{webpack-inject-mocker-runtime-plugin-DCJQFJQ5.js → webpack-inject-mocker-runtime-plugin-5O25VYCQ.js} +10 -10
  45. package/dist/_node-chunks/{webpack-mock-plugin-XJNFAHBI.js → webpack-mock-plugin-35I32SAF.js} +9 -9
  46. package/dist/babel/index.js +11 -11
  47. package/dist/bin/core.js +11 -11
  48. package/dist/bin/dispatcher.js +11 -11
  49. package/dist/bin/loader.js +8 -8
  50. package/dist/cli/index.js +20 -20
  51. package/dist/common/index.js +21 -21
  52. package/dist/components/index.js +5 -1
  53. package/dist/core-server/index.js +91 -63
  54. package/dist/core-server/presets/common-manager.js +25 -20
  55. package/dist/core-server/presets/common-override-preset.js +9 -9
  56. package/dist/core-server/presets/common-preset.js +22 -22
  57. package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +9 -9
  58. package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +10 -10
  59. package/dist/csf/index.d.ts +9 -4
  60. package/dist/csf/index.js +37 -8
  61. package/dist/csf-tools/index.d.ts +13 -6
  62. package/dist/csf-tools/index.js +9 -9
  63. package/dist/manager/globals-runtime.js +71 -32
  64. package/dist/manager/runtime.js +459 -242
  65. package/dist/manager-api/index.d.ts +10 -5
  66. package/dist/manager-api/index.js +66 -31
  67. package/dist/node-logger/index.js +14 -14
  68. package/dist/preview/runtime.js +96 -62
  69. package/dist/preview-api/index.d.ts +70 -71
  70. package/dist/preview-api/index.js +1 -1
  71. package/dist/server-errors.js +10 -10
  72. package/dist/telemetry/index.js +24 -24
  73. package/dist/types/index.d.ts +24 -7
  74. package/dist/viewport/index.d.ts +36 -4
  75. package/dist/viewport/index.js +1 -1
  76. package/package.json +1 -1
  77. package/dist/_node-chunks/camelcase-BZ55OCHI.js +0 -18
  78. package/dist/_node-chunks/chunk-FDDJHDCE.js +0 -62
  79. package/dist/_node-chunks/chunk-R5DIBOM6.js +0 -18
@@ -1,26 +1,26 @@
1
- import CJS_COMPAT_NODE_URL_0v1evul49qdo from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_0v1evul49qdo from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_0v1evul49qdo from "node:module";
1
+ import CJS_COMPAT_NODE_URL_srln17sp2zh from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_srln17sp2zh from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_srln17sp2zh from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_0v1evul49qdo.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_0v1evul49qdo.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_0v1evul49qdo.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_srln17sp2zh.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_srln17sp2zh.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_srln17sp2zh.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
11
  // ------------------------------------------------------------
12
12
  import {
13
13
  require_pretty_hrtime
14
- } from "../_node-chunks/chunk-NUVGSFQI.js";
14
+ } from "../_node-chunks/chunk-KVOP6ASA.js";
15
15
  import {
16
16
  boxen,
17
17
  require_string_width
18
- } from "../_node-chunks/chunk-EAOPWIKA.js";
19
- import "../_node-chunks/chunk-A7CUP23N.js";
18
+ } from "../_node-chunks/chunk-DH7BCQMG.js";
19
+ import "../_node-chunks/chunk-IGWCAXA2.js";
20
20
  import {
21
21
  StatusTypeIdMismatchError,
22
22
  StorybookError
23
- } from "../_node-chunks/chunk-JOXYGIZK.js";
23
+ } from "../_node-chunks/chunk-TXDIOSHI.js";
24
24
  import {
25
25
  getErrorLevel,
26
26
  mapStaticDir,
@@ -28,60 +28,60 @@ import {
28
28
  sendTelemetryError,
29
29
  useStatics,
30
30
  withTelemetry
31
- } from "../_node-chunks/chunk-DC7OWBHB.js";
32
- import "../_node-chunks/chunk-4TOI4VSK.js";
31
+ } from "../_node-chunks/chunk-GCWAGPDV.js";
32
+ import "../_node-chunks/chunk-2GCKJYK6.js";
33
33
  import {
34
34
  telemetry
35
- } from "../_node-chunks/chunk-UYKQJMQY.js";
36
- import "../_node-chunks/chunk-R5DIBOM6.js";
35
+ } from "../_node-chunks/chunk-RP3VMQPF.js";
36
+ import "../_node-chunks/chunk-IYOHZPPC.js";
37
37
  import {
38
38
  userOrAutoTitleFromSpecifier
39
- } from "../_node-chunks/chunk-RIPA4LFD.js";
40
- import "../_node-chunks/chunk-IINJT47N.js";
41
- import "../_node-chunks/chunk-2DMFI367.js";
42
- import "../_node-chunks/chunk-FDDJHDCE.js";
43
- import "../_node-chunks/chunk-7NJGTQ3W.js";
39
+ } from "../_node-chunks/chunk-XXVKM2ZR.js";
40
+ import "../_node-chunks/chunk-46BWYN3K.js";
41
+ import "../_node-chunks/chunk-U6MJQ7C6.js";
42
+ import "../_node-chunks/chunk-RNHUADRS.js";
43
+ import "../_node-chunks/chunk-ZPNXCXIT.js";
44
44
  import {
45
45
  optionalEnvToBoolean,
46
46
  require_cross_spawn
47
- } from "../_node-chunks/chunk-55VWKF63.js";
47
+ } from "../_node-chunks/chunk-5YUTWYNI.js";
48
48
  import {
49
49
  up2 as up
50
- } from "../_node-chunks/chunk-F3PO67U3.js";
50
+ } from "../_node-chunks/chunk-MHVF6Y35.js";
51
51
  import {
52
52
  invariant
53
- } from "../_node-chunks/chunk-HPFXREVG.js";
53
+ } from "../_node-chunks/chunk-3XXQRL3A.js";
54
54
  import {
55
55
  importModule,
56
56
  resolvePackageDir
57
- } from "../_node-chunks/chunk-TJIMCNYJ.js";
57
+ } from "../_node-chunks/chunk-BC23FKU4.js";
58
58
  import {
59
59
  resolve
60
- } from "../_node-chunks/chunk-7WH7AGOR.js";
60
+ } from "../_node-chunks/chunk-A2DKPKBY.js";
61
61
  import {
62
62
  require_prompts
63
- } from "../_node-chunks/chunk-E6TLN2J2.js";
64
- import "../_node-chunks/chunk-NJXBURX7.js";
63
+ } from "../_node-chunks/chunk-4DIDWIST.js";
64
+ import "../_node-chunks/chunk-MRCMZPA2.js";
65
65
  import {
66
66
  slash
67
- } from "../_node-chunks/chunk-JNHUDBJL.js";
67
+ } from "../_node-chunks/chunk-FCNWWJV7.js";
68
68
  import {
69
69
  require_dist
70
- } from "../_node-chunks/chunk-MLBTKECD.js";
70
+ } from "../_node-chunks/chunk-TFIGR2HH.js";
71
71
  import {
72
72
  require_lib,
73
73
  require_src
74
- } from "../_node-chunks/chunk-NKZ4UPPV.js";
74
+ } from "../_node-chunks/chunk-3NIQHNDU.js";
75
75
  import {
76
76
  require_picocolors
77
- } from "../_node-chunks/chunk-5IEY46LQ.js";
77
+ } from "../_node-chunks/chunk-Z3PLI7S2.js";
78
78
  import {
79
79
  __commonJS,
80
80
  __export,
81
81
  __name,
82
82
  __require,
83
83
  __toESM
84
- } from "../_node-chunks/chunk-XZTBG2TG.js";
84
+ } from "../_node-chunks/chunk-ZM2HT2RW.js";
85
85
 
86
86
  // ../node_modules/tsconfig-paths/lib/filesystem.js
87
87
  var require_filesystem = __commonJS({
@@ -8588,7 +8588,7 @@ var sortStoriesV7 = /* @__PURE__ */ __name((stories, storySortParameter, fileNam
8588
8588
  Error sorting stories with sort parameter ${storySortParameter}:
8589
8589
 
8590
8590
  > ${err.message}
8591
-
8591
+
8592
8592
  Are you using a V6-style sort function in V7 mode?
8593
8593
 
8594
8594
  More info: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#v7-style-story-sort
@@ -8676,6 +8676,7 @@ var AUTODOCS_TAG = "autodocs";
8676
8676
  var ATTACHED_MDX_TAG = "attached-mdx";
8677
8677
  var UNATTACHED_MDX_TAG = "unattached-mdx";
8678
8678
  var PLAY_FN_TAG = "play-fn";
8679
+ var TEST_FN_TAG = "test-fn";
8679
8680
  function isMdxEntry({ tags }) {
8680
8681
  return tags?.includes(UNATTACHED_MDX_TAG) || tags?.includes(ATTACHED_MDX_TAG);
8681
8682
  }
@@ -8715,7 +8716,7 @@ var StoryIndexGenerator = class _StoryIndexGenerator {
8715
8716
  }
8716
8717
  const pathToSubIndex = {};
8717
8718
  const fullGlob = slash(join(specifier.directory, specifier.files));
8718
- const { globby } = await import("../_node-chunks/globby-3IFB7BJC.js");
8719
+ const { globby } = await import("../_node-chunks/globby-HXB6X43W.js");
8719
8720
  const files = await globby(fullGlob, {
8720
8721
  absolute: true,
8721
8722
  cwd: workingDir,
@@ -8903,37 +8904,41 @@ var StoryIndexGenerator = class _StoryIndexGenerator {
8903
8904
  "main"
8904
8905
  ]);
8905
8906
  }
8906
- const entries = indexInputs.map((input) => {
8907
- const name = input.name ?? storyNameFromExport(input.exportName);
8908
- const componentPath = input.rawComponentPath && this.resolveComponentPath(input.rawComponentPath, absolutePath, matchPath);
8909
- const title = input.title ?? defaultMakeTitle();
8910
- const id = input.__id ?? toId(input.metaId ?? title, storyNameFromExport(input.exportName));
8911
- const tags = combineTags(...projectTags, ...input.tags ?? []);
8912
- return {
8913
- type: "story",
8914
- id,
8915
- extra: {
8916
- metaId: input.metaId,
8917
- stats: input.__stats ?? {}
8918
- },
8919
- name,
8920
- title,
8921
- importPath,
8922
- componentPath,
8923
- tags,
8924
- ...input.exportName ? { exportName: input.exportName } : {}
8925
- };
8926
- });
8927
- const hasAutodocsTag = entries.some((entry) => entry.tags.includes(AUTODOCS_TAG));
8907
+ const storyEntries = indexInputs.map(
8908
+ (input) => {
8909
+ const name = input.name ?? storyNameFromExport(input.exportName);
8910
+ const componentPath = input.rawComponentPath && this.resolveComponentPath(input.rawComponentPath, absolutePath, matchPath);
8911
+ const title = input.title ?? defaultMakeTitle();
8912
+ const id = input.__id ?? toId(input.metaId ?? title, storyNameFromExport(input.exportName));
8913
+ const tags = combineTags(...projectTags, ...input.tags ?? []);
8914
+ return {
8915
+ type: "story",
8916
+ subtype: input.type === "story" ? input.subtype : "story",
8917
+ id,
8918
+ extra: {
8919
+ metaId: input.metaId,
8920
+ stats: input.__stats ?? {}
8921
+ },
8922
+ name,
8923
+ title,
8924
+ importPath,
8925
+ componentPath,
8926
+ tags,
8927
+ ...input.type === "story" && input.subtype === "test" ? { parent: input.parent, parentName: input.parentName } : {},
8928
+ ...input.exportName ? { exportName: input.exportName } : {}
8929
+ };
8930
+ }
8931
+ );
8932
+ const hasAutodocsTag = storyEntries.some((entry) => entry.tags.includes(AUTODOCS_TAG));
8928
8933
  const createDocEntry = hasAutodocsTag && !!this.options.docs;
8929
8934
  if (createDocEntry && this.options.build?.test?.disableAutoDocs !== true) {
8930
8935
  const docsName = this.options.docs?.defaultName ?? "Docs";
8931
8936
  const name = docsName;
8932
8937
  const { metaId } = indexInputs[0];
8933
- const { title } = entries[0];
8938
+ const { title } = storyEntries[0];
8934
8939
  const id = toId(metaId ?? title, name);
8935
8940
  const tags = combineTags(...projectTags, ...indexInputs[0].tags ?? []);
8936
- entries.unshift({
8941
+ const docsEntry = {
8937
8942
  id,
8938
8943
  title,
8939
8944
  name,
@@ -8941,10 +8946,15 @@ var StoryIndexGenerator = class _StoryIndexGenerator {
8941
8946
  type: "docs",
8942
8947
  tags,
8943
8948
  storiesImports: []
8944
- });
8949
+ };
8950
+ return {
8951
+ entries: [docsEntry, ...storyEntries],
8952
+ dependents: [],
8953
+ type: "stories"
8954
+ };
8945
8955
  }
8946
8956
  return {
8947
- entries,
8957
+ entries: storyEntries,
8948
8958
  dependents: [],
8949
8959
  type: "stories"
8950
8960
  };
@@ -8955,7 +8965,7 @@ var StoryIndexGenerator = class _StoryIndexGenerator {
8955
8965
  const normalizedPath = normalizeStoryPath(relativePath);
8956
8966
  const importPath = slash(normalizedPath);
8957
8967
  const content = await readFile(absolutePath, { encoding: "utf8" });
8958
- const { analyze } = await import("../_node-chunks/dist-CGGAYWME.js");
8968
+ const { analyze } = await import("../_node-chunks/dist-PG4I7ZDU.js");
8959
8969
  const result2 = await analyze(content);
8960
8970
  if (result2.isTemplate) {
8961
8971
  return false;
@@ -9298,7 +9308,7 @@ __name(print, "print");
9298
9308
  // src/core-server/utils/get-builders.ts
9299
9309
  import { MissingBuilderError } from "storybook/internal/server-errors";
9300
9310
  async function getManagerBuilder() {
9301
- return await import("../_node-chunks/builder-manager-V33CQT2M.js");
9311
+ return await import("../_node-chunks/builder-manager-VFP7HSCF.js");
9302
9312
  }
9303
9313
  __name(getManagerBuilder, "getManagerBuilder");
9304
9314
  async function getPreviewBuilder(resolvedPreviewBuilder) {
@@ -16542,7 +16552,7 @@ function watchStorySpecifiers(specifiers, options, onInvalidate) {
16542
16552
  // because the directory could already be within the files part (e.g. './x/foo/bar')
16543
16553
  basename2(specifier.files)
16544
16554
  );
16545
- const { globby } = await import("../_node-chunks/globby-3IFB7BJC.js");
16555
+ const { globby } = await import("../_node-chunks/globby-HXB6X43W.js");
16546
16556
  const addedFiles = await globby(slash(dirGlob), commonGlobOptions2(dirGlob));
16547
16557
  addedFiles.forEach((filePath) => {
16548
16558
  const fileImportPath = toImportPath(filePath);
@@ -16661,10 +16671,12 @@ function summarizeIndex(storyIndex) {
16661
16671
  let exampleDocsCount = 0;
16662
16672
  let pageStoryCount = 0;
16663
16673
  let playStoryCount = 0;
16674
+ let testStoryCount = 0;
16664
16675
  let autodocsCount = 0;
16665
16676
  let mdxCount = 0;
16666
16677
  let svelteCsfV4Count = 0;
16667
16678
  let svelteCsfV5Count = 0;
16679
+ const testsPerParentStory = /* @__PURE__ */ new Map();
16668
16680
  Object.values(storyIndex.entries).forEach((entry) => {
16669
16681
  if (isCLIExampleEntry(entry)) {
16670
16682
  if (entry.type === "story") {
@@ -16689,6 +16701,10 @@ function summarizeIndex(storyIndex) {
16689
16701
  if (entry.tags?.includes(PLAY_FN_TAG)) {
16690
16702
  playStoryCount += 1;
16691
16703
  }
16704
+ if (entry.tags?.includes(TEST_FN_TAG) && entry.parent) {
16705
+ testStoryCount += 1;
16706
+ testsPerParentStory.set(entry.parent, (testsPerParentStory.get(entry.parent) ?? 0) + 1);
16707
+ }
16692
16708
  if (entry.tags?.includes("svelte-csf-v4")) {
16693
16709
  svelteCsfV4Count += 1;
16694
16710
  } else if (entry.tags?.includes("svelte-csf-v5")) {
@@ -16703,11 +16719,24 @@ function summarizeIndex(storyIndex) {
16703
16719
  }
16704
16720
  });
16705
16721
  const componentCount = componentTitles.size;
16722
+ let maxTestsPerStory = 0;
16723
+ let singleTestStoryCount = 0;
16724
+ testsPerParentStory.forEach((count) => {
16725
+ if (count > maxTestsPerStory) {
16726
+ maxTestsPerStory = count;
16727
+ }
16728
+ if (count === 1) {
16729
+ singleTestStoryCount += 1;
16730
+ }
16731
+ });
16706
16732
  return {
16707
16733
  storyCount,
16708
16734
  componentCount,
16709
16735
  pageStoryCount,
16710
16736
  playStoryCount,
16737
+ testStoryCount,
16738
+ maxTestsPerStory,
16739
+ singleTestStoryCount,
16711
16740
  autodocsCount,
16712
16741
  mdxCount,
16713
16742
  exampleStoryCount,
@@ -18467,7 +18496,6 @@ function startBrowserProcess(browser, url, args) {
18467
18496
  "Google Chrome",
18468
18497
  "Microsoft Edge",
18469
18498
  "Brave Browser",
18470
- "Arc",
18471
18499
  "Vivaldi",
18472
18500
  "Chromium"
18473
18501
  ];
@@ -55,7 +55,7 @@ import {
55
55
  import {
56
56
  MINIMAL_VIEWPORTS,
57
57
  responsiveViewport
58
- } from "../../_browser-chunks/chunk-O5R5CGFA.js";
58
+ } from "../../_browser-chunks/chunk-TMDZCWME.js";
59
59
  import {
60
60
  ADDON_ID as ADDON_ID2,
61
61
  PARAM_KEY as PARAM_KEY2,
@@ -86,6 +86,7 @@ import {
86
86
  useArgs,
87
87
  useGlobals,
88
88
  useParameter,
89
+ useStorybookApi,
89
90
  useStorybookState
90
91
  } from "storybook/manager-api";
91
92
  import { styled as styled30 } from "storybook/theming";
@@ -5325,6 +5326,7 @@ var AddonWrapper = styled30.div({
5325
5326
  overflowY: "auto"
5326
5327
  });
5327
5328
  var ControlsPanel = /* @__PURE__ */ __name(({ saveStory, createStory }) => {
5329
+ const api = useStorybookApi();
5328
5330
  const [isLoading, setIsLoading] = useState13(true);
5329
5331
  const [args, updateArgs, resetArgs, initialArgs] = useArgs();
5330
5332
  const [globals] = useGlobals();
@@ -5336,6 +5338,7 @@ var ControlsPanel = /* @__PURE__ */ __name(({ saveStory, createStory }) => {
5336
5338
  disableSaveFromUI = false
5337
5339
  } = useParameter(PARAM_KEY5, {});
5338
5340
  const { path, previewInitialized } = useStorybookState();
5341
+ const storyData = api.getCurrentStoryData();
5339
5342
  useEffect10(() => {
5340
5343
  if (previewInitialized) {
5341
5344
  setIsLoading(false);
@@ -5369,15 +5372,15 @@ var ControlsPanel = /* @__PURE__ */ __name(({ saveStory, createStory }) => {
5369
5372
  sort,
5370
5373
  isLoading
5371
5374
  }
5372
- ), hasControls && hasUpdatedArgs && global.CONFIG_TYPE === "DEVELOPMENT" && disableSaveFromUI !== true && React37.createElement(SaveStory, { ...{ resetArgs, saveStory, createStory } }));
5375
+ ), hasControls && storyData.type === "story" && storyData.subtype !== "test" && hasUpdatedArgs && global.CONFIG_TYPE === "DEVELOPMENT" && disableSaveFromUI !== true && React37.createElement(SaveStory, { ...{ resetArgs, saveStory, createStory } }));
5373
5376
  }, "ControlsPanel");
5374
5377
 
5375
5378
  // src/controls/components/Title.tsx
5376
5379
  import React38 from "react";
5377
5380
  import { Badge } from "storybook/internal/components";
5378
- import { useArgTypes as useArgTypes2, useStorybookApi } from "storybook/manager-api";
5381
+ import { useArgTypes as useArgTypes2, useStorybookApi as useStorybookApi2 } from "storybook/manager-api";
5379
5382
  function Title2() {
5380
- const api = useStorybookApi();
5383
+ const api = useStorybookApi2();
5381
5384
  const selectedPanel = api.getSelectedPanel();
5382
5385
  const rows = useArgTypes2();
5383
5386
  const controlsCount = Object.values(rows).filter(
@@ -5501,9 +5504,9 @@ import { addons as addons2, types as types2 } from "storybook/manager-api";
5501
5504
  import React40 from "react";
5502
5505
  import { Badge as Badge2 } from "storybook/internal/components";
5503
5506
  import { STORY_CHANGED } from "storybook/internal/core-events";
5504
- import { useAddonState, useChannel, useStorybookApi as useStorybookApi2 } from "storybook/manager-api";
5507
+ import { useAddonState, useChannel, useStorybookApi as useStorybookApi3 } from "storybook/manager-api";
5505
5508
  function Title3() {
5506
- const api = useStorybookApi2();
5509
+ const api = useStorybookApi3();
5507
5510
  const selectedPanel = api.getSelectedPanel();
5508
5511
  const [{ count }, setCount] = useAddonState(ADDON_ID, { count: 0 });
5509
5512
  useChannel({
@@ -6894,7 +6897,7 @@ import {
6894
6897
  useAddonState as useAddonState2,
6895
6898
  useChannel as useChannel2,
6896
6899
  useParameter as useParameter2,
6897
- useStorybookApi as useStorybookApi5,
6900
+ useStorybookApi as useStorybookApi6,
6898
6901
  useStorybookState as useStorybookState2
6899
6902
  } from "storybook/manager-api";
6900
6903
 
@@ -7051,7 +7054,7 @@ var DetachedDebuggerMessage = /* @__PURE__ */ __name(({ storyUrl }) => {
7051
7054
  import React47, { useEffect as useEffect12, useState as useState15 } from "react";
7052
7055
  import { EmptyTabContent as EmptyTabContent2, Link as Link5 } from "storybook/internal/components";
7053
7056
  import { DocumentIcon as DocumentIcon3 } from "@storybook/icons";
7054
- import { useStorybookApi as useStorybookApi3 } from "storybook/manager-api";
7057
+ import { useStorybookApi as useStorybookApi4 } from "storybook/manager-api";
7055
7058
  import { styled as styled34 } from "storybook/theming";
7056
7059
  var Links2 = styled34.div(({ theme: theme3 }) => ({
7057
7060
  display: "flex",
@@ -7060,7 +7063,7 @@ var Links2 = styled34.div(({ theme: theme3 }) => ({
7060
7063
  }));
7061
7064
  var Empty2 = /* @__PURE__ */ __name(() => {
7062
7065
  const [isLoading, setIsLoading] = useState15(true);
7063
- const api = useStorybookApi3();
7066
+ const api = useStorybookApi4();
7064
7067
  const docsUrl = api.getDocsUrl({
7065
7068
  subpath: DOCUMENTATION_PLAY_FUNCTION_LINK,
7066
7069
  versioned: true,
@@ -8725,7 +8728,7 @@ var Subnav = /* @__PURE__ */ __name(({
8725
8728
  // src/component-testing/components/TestDiscrepancyMessage.tsx
8726
8729
  import React64 from "react";
8727
8730
  import { Link as Link6 } from "storybook/internal/components";
8728
- import { useStorybookApi as useStorybookApi4 } from "storybook/manager-api";
8731
+ import { useStorybookApi as useStorybookApi5 } from "storybook/manager-api";
8729
8732
  import { styled as styled40 } from "storybook/theming";
8730
8733
  var Wrapper12 = styled40.div(({ theme: { color: color2, typography: typography4, background } }) => ({
8731
8734
  textAlign: "start",
@@ -8749,7 +8752,7 @@ var Wrapper12 = styled40.div(({ theme: { color: color2, typography: typography4,
8749
8752
  }
8750
8753
  }));
8751
8754
  var TestDiscrepancyMessage = /* @__PURE__ */ __name(({ browserTestStatus }) => {
8752
- const api = useStorybookApi4();
8755
+ const api = useStorybookApi5();
8753
8756
  const docsUrl = api.getDocsUrl({
8754
8757
  subpath: DOCUMENTATION_DISCREPANCY_LINK,
8755
8758
  versioned: true,
@@ -8973,7 +8976,7 @@ var Panel = memo4(
8973
8976
  };
8974
8977
  });
8975
8978
  const state = useStorybookState2();
8976
- const api = useStorybookApi5();
8979
+ const api = useStorybookApi6();
8977
8980
  const data = api.getData(state.storyId, state.refId);
8978
8981
  const importPath = data?.importPath;
8979
8982
  const canOpenInEditor = global2.CONFIG_TYPE === "DEVELOPMENT" && !state.refId;
@@ -9017,6 +9020,7 @@ var Panel = memo4(
9017
9020
  }
9018
9021
  return () => observer?.disconnect();
9019
9022
  }, []);
9023
+ const lastStoryId = useRef7(void 0);
9020
9024
  const lastRenderId = useRef7(0);
9021
9025
  const emit = useChannel2(
9022
9026
  {
@@ -9031,9 +9035,10 @@ var Panel = memo4(
9031
9035
  );
9032
9036
  },
9033
9037
  [STORY_RENDER_PHASE_CHANGED]: (event) => {
9034
- if (event.newPhase === "preparing" || event.newPhase === "loading") {
9038
+ if (lastStoryId.current === event.storyId && ["preparing", "loading"].includes(event.newPhase)) {
9035
9039
  return;
9036
9040
  }
9041
+ lastStoryId.current = event.storyId;
9037
9042
  lastRenderId.current = Math.max(lastRenderId.current, event.renderId || 0);
9038
9043
  if (lastRenderId.current !== event.renderId) {
9039
9044
  return;
@@ -9171,9 +9176,9 @@ var Panel = memo4(
9171
9176
  // src/component-testing/components/PanelTitle.tsx
9172
9177
  import React67 from "react";
9173
9178
  import { Badge as Badge3 } from "storybook/internal/components";
9174
- import { useAddonState as useAddonState3, useStorybookApi as useStorybookApi6 } from "storybook/manager-api";
9179
+ import { useAddonState as useAddonState3, useStorybookApi as useStorybookApi7 } from "storybook/manager-api";
9175
9180
  function PanelTitle() {
9176
- const api = useStorybookApi6();
9181
+ const api = useStorybookApi7();
9177
9182
  const selectedPanel = api.getSelectedPanel();
9178
9183
  const [addonState = {}] = useAddonState3(ADDON_ID7);
9179
9184
  const { status, hasException, interactionsCount } = addonState;
@@ -9346,11 +9351,11 @@ import { addons as addons5, types as types5 } from "storybook/manager-api";
9346
9351
  import React71, { useCallback as useCallback9, useEffect as useEffect18 } from "react";
9347
9352
  import { IconButton as IconButton8 } from "storybook/internal/components";
9348
9353
  import { RulerIcon } from "@storybook/icons";
9349
- import { useGlobals as useGlobals3, useStorybookApi as useStorybookApi7 } from "storybook/manager-api";
9354
+ import { useGlobals as useGlobals3, useStorybookApi as useStorybookApi8 } from "storybook/manager-api";
9350
9355
  var Tool = /* @__PURE__ */ __name(() => {
9351
9356
  const [globals, updateGlobals] = useGlobals3();
9352
9357
  const { measureEnabled } = globals || {};
9353
- const api = useStorybookApi7();
9358
+ const api = useStorybookApi8();
9354
9359
  const toggleMeasure = useCallback9(
9355
9360
  () => updateGlobals({
9356
9361
  measureEnabled: !measureEnabled
@@ -9398,10 +9403,10 @@ import { addons as addons6, types as types6 } from "storybook/manager-api";
9398
9403
  import React74, { memo as memo6, useCallback as useCallback10, useEffect as useEffect19 } from "react";
9399
9404
  import { IconButton as IconButton9 } from "storybook/internal/components";
9400
9405
  import { OutlineIcon } from "@storybook/icons";
9401
- import { useGlobals as useGlobals4, useStorybookApi as useStorybookApi8 } from "storybook/manager-api";
9406
+ import { useGlobals as useGlobals4, useStorybookApi as useStorybookApi9 } from "storybook/manager-api";
9402
9407
  var OutlineSelector = memo6(/* @__PURE__ */ __name(function OutlineSelector2() {
9403
9408
  const [globals, updateGlobals] = useGlobals4();
9404
- const api = useStorybookApi8();
9409
+ const api = useStorybookApi9();
9405
9410
  const isActive = [true, "true"].includes(globals[PARAM_KEY4]);
9406
9411
  const toggleOutline = useCallback10(
9407
9412
  () => updateGlobals({
@@ -9541,7 +9546,7 @@ var ViewportTool = /* @__PURE__ */ __name(({ api }) => {
9541
9546
  const { options = MINIMAL_VIEWPORTS, disable } = config || {};
9542
9547
  const data = globals?.[PARAM_KEY2] || {};
9543
9548
  const viewportName = typeof data === "string" ? data : data.value;
9544
- const isRotated = typeof data === "string" ? false : data.isRotated;
9549
+ const isRotated = typeof data === "string" ? false : !!data.isRotated;
9545
9550
  const item = options[viewportName] || responsiveViewport;
9546
9551
  const isActive = isTooltipVisible || item !== responsiveViewport;
9547
9552
  const isLocked = PARAM_KEY2 in storyGlobals;
@@ -1,23 +1,23 @@
1
- import CJS_COMPAT_NODE_URL_0v1evul49qdo from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_0v1evul49qdo from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_0v1evul49qdo from "node:module";
1
+ import CJS_COMPAT_NODE_URL_srln17sp2zh from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_srln17sp2zh from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_srln17sp2zh from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_0v1evul49qdo.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_0v1evul49qdo.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_0v1evul49qdo.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_srln17sp2zh.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_srln17sp2zh.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_srln17sp2zh.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
11
  // ------------------------------------------------------------
12
12
  import {
13
13
  glob
14
- } from "../../_node-chunks/chunk-NJXBURX7.js";
14
+ } from "../../_node-chunks/chunk-MRCMZPA2.js";
15
15
  import {
16
16
  slash
17
- } from "../../_node-chunks/chunk-JNHUDBJL.js";
17
+ } from "../../_node-chunks/chunk-FCNWWJV7.js";
18
18
  import {
19
19
  __name
20
- } from "../../_node-chunks/chunk-XZTBG2TG.js";
20
+ } from "../../_node-chunks/chunk-ZM2HT2RW.js";
21
21
 
22
22
  // src/core-server/utils/remove-mdx-entries.ts
23
23
  import { isAbsolute, join, relative } from "node:path";
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_0v1evul49qdo from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_0v1evul49qdo from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_0v1evul49qdo from "node:module";
1
+ import CJS_COMPAT_NODE_URL_srln17sp2zh from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_srln17sp2zh from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_srln17sp2zh from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_0v1evul49qdo.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_0v1evul49qdo.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_0v1evul49qdo.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_srln17sp2zh.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_srln17sp2zh.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_srln17sp2zh.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -12,33 +12,33 @@ var require = CJS_COMPAT_NODE_MODULE_0v1evul49qdo.createRequire(import.meta.url)
12
12
  import {
13
13
  parseStaticDir,
14
14
  sendTelemetryError
15
- } from "../../_node-chunks/chunk-DC7OWBHB.js";
16
- import "../../_node-chunks/chunk-4TOI4VSK.js";
15
+ } from "../../_node-chunks/chunk-GCWAGPDV.js";
16
+ import "../../_node-chunks/chunk-2GCKJYK6.js";
17
17
  import {
18
18
  invariant
19
- } from "../../_node-chunks/chunk-HPFXREVG.js";
19
+ } from "../../_node-chunks/chunk-3XXQRL3A.js";
20
20
  import {
21
21
  resolvePackageDir
22
- } from "../../_node-chunks/chunk-TJIMCNYJ.js";
22
+ } from "../../_node-chunks/chunk-BC23FKU4.js";
23
23
  import {
24
24
  join
25
- } from "../../_node-chunks/chunk-7WH7AGOR.js";
26
- import "../../_node-chunks/chunk-E6TLN2J2.js";
25
+ } from "../../_node-chunks/chunk-A2DKPKBY.js";
26
+ import "../../_node-chunks/chunk-4DIDWIST.js";
27
27
  import {
28
28
  loadConfig
29
- } from "../../_node-chunks/chunk-6PTV7XGR.js";
29
+ } from "../../_node-chunks/chunk-GBZZSL2K.js";
30
30
  import {
31
31
  require_dist
32
- } from "../../_node-chunks/chunk-MLBTKECD.js";
32
+ } from "../../_node-chunks/chunk-TFIGR2HH.js";
33
33
  import {
34
34
  require_picocolors
35
- } from "../../_node-chunks/chunk-5IEY46LQ.js";
35
+ } from "../../_node-chunks/chunk-Z3PLI7S2.js";
36
36
  import {
37
37
  __commonJS,
38
38
  __name,
39
39
  __require,
40
40
  __toESM
41
- } from "../../_node-chunks/chunk-XZTBG2TG.js";
41
+ } from "../../_node-chunks/chunk-ZM2HT2RW.js";
42
42
 
43
43
  // ../node_modules/shell-quote/quote.js
44
44
  var require_quote = __commonJS({
@@ -699,7 +699,7 @@ var import_ts_dedent = __toESM(require_dist(), 1);
699
699
 
700
700
  // src/core-server/utils/get-component-variable-name.ts
701
701
  var getComponentVariableName = /* @__PURE__ */ __name(async (name) => {
702
- const camelCase = await import("../../_node-chunks/camelcase-BZ55OCHI.js");
702
+ const camelCase = await import("../../_node-chunks/camelcase-ZLZNQMDD.js");
703
703
  const camelCased = camelCase.default(name.replace(/^[^a-zA-Z_$]*/, ""), { pascalCase: true });
704
704
  const sanitized = camelCased.replace(/[^a-zA-Z_$]+/, "");
705
705
  return sanitized;
@@ -1046,7 +1046,7 @@ async function searchFiles({
1046
1046
  ignoredFiles = IGNORED_FILES,
1047
1047
  fileExtensions = FILE_EXTENSIONS
1048
1048
  }) {
1049
- const { globby, isDynamicPattern } = await import("../../_node-chunks/globby-3IFB7BJC.js");
1049
+ const { globby, isDynamicPattern } = await import("../../_node-chunks/globby-HXB6X43W.js");
1050
1050
  const hasSearchSpecialGlobChars = isDynamicPattern(searchQuery, { cwd });
1051
1051
  const hasFileExtensionRegex = /(\.[a-z]+)$/i;
1052
1052
  const searchQueryHasExtension = hasFileExtensionRegex.test(searchQuery);
@@ -1793,8 +1793,8 @@ var viteFinal = /* @__PURE__ */ __name(async (existing, options) => {
1793
1793
  if (!previewConfigPath) {
1794
1794
  return existing;
1795
1795
  }
1796
- const { viteInjectMockerRuntime } = await import("../../_node-chunks/plugin-GJUBUKCT.js");
1797
- const { viteMockPlugin } = await import("../../_node-chunks/plugin-3YREMMJJ.js");
1796
+ const { viteInjectMockerRuntime } = await import("../../_node-chunks/plugin-SEQ2OPRK.js");
1797
+ const { viteMockPlugin } = await import("../../_node-chunks/plugin-SG6I7RFC.js");
1798
1798
  const coreOptions = await options.presets.apply("core");
1799
1799
  return {
1800
1800
  ...existing,
@@ -1812,8 +1812,8 @@ var webpackFinal = /* @__PURE__ */ __name(async (config, options) => {
1812
1812
  if (!previewConfigPath) {
1813
1813
  return config;
1814
1814
  }
1815
- const { WebpackMockPlugin } = await import("../../_node-chunks/webpack-mock-plugin-XJNFAHBI.js");
1816
- const { WebpackInjectMockerRuntimePlugin } = await import("../../_node-chunks/webpack-inject-mocker-runtime-plugin-DCJQFJQ5.js");
1815
+ const { WebpackMockPlugin } = await import("../../_node-chunks/webpack-mock-plugin-35I32SAF.js");
1816
+ const { WebpackInjectMockerRuntimePlugin } = await import("../../_node-chunks/webpack-inject-mocker-runtime-plugin-5O25VYCQ.js");
1817
1817
  config.plugins = config.plugins || [];
1818
1818
  config.module.rules.push({
1819
1819
  test: /preview\.(t|j)sx?$/,
@@ -1,21 +1,21 @@
1
- import CJS_COMPAT_NODE_URL_0v1evul49qdo from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_0v1evul49qdo from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_0v1evul49qdo from "node:module";
1
+ import CJS_COMPAT_NODE_URL_srln17sp2zh from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_srln17sp2zh from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_srln17sp2zh from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_0v1evul49qdo.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_0v1evul49qdo.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_0v1evul49qdo.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_srln17sp2zh.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_srln17sp2zh.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_srln17sp2zh.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
11
  // ------------------------------------------------------------
12
12
  import {
13
13
  rewriteSbMockImportCalls
14
- } from "../../../../_node-chunks/chunk-VQH4ZFTS.js";
15
- import "../../../../_node-chunks/chunk-7WH7AGOR.js";
14
+ } from "../../../../_node-chunks/chunk-3QZ7KLON.js";
15
+ import "../../../../_node-chunks/chunk-A2DKPKBY.js";
16
16
  import {
17
17
  __name
18
- } from "../../../../_node-chunks/chunk-XZTBG2TG.js";
18
+ } from "../../../../_node-chunks/chunk-ZM2HT2RW.js";
19
19
 
20
20
  // src/core-server/presets/webpack/loaders/storybook-mock-transform-loader.ts
21
21
  import { logger } from "storybook/internal/node-logger";