storybook 10.1.3 → 10.1.5

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-2XZMBGTA.js → chunk-7S2XPX5M.js} +1 -1
  2. package/dist/_browser-chunks/{chunk-SS2NHR7W.js → chunk-GPBRNGY5.js} +1 -1
  3. package/dist/{_node-chunks/chunk-U6IY6QQN.js → _browser-chunks/chunk-JVRDBUUP.js} +20 -13
  4. package/dist/_browser-chunks/{chunk-GFY5R5EY.js → chunk-V5NV5R37.js} +1 -1
  5. package/dist/_node-chunks/{builder-manager-N4D23FLX.js → builder-manager-ZXJBDRXR.js} +12 -12
  6. package/dist/_node-chunks/{camelcase-EXGV75P2.js → camelcase-WRTIKEO6.js} +7 -7
  7. package/dist/_node-chunks/{chunk-A7QREOLM.js → chunk-255LKCUD.js} +6 -6
  8. package/dist/_node-chunks/chunk-3GJDB3VJ.js +18 -0
  9. package/dist/_node-chunks/{chunk-CD52AW7X.js → chunk-3N5PBWO5.js} +9 -9
  10. package/dist/_node-chunks/{chunk-TCNV3SSR.js → chunk-52EAUB7R.js} +7 -7
  11. package/dist/_node-chunks/{chunk-4FES3Z32.js → chunk-56BVIMJO.js} +7 -7
  12. package/dist/_node-chunks/{chunk-IHWETTDK.js → chunk-5H7WLGZC.js} +7 -7
  13. package/dist/_node-chunks/{chunk-RIFAW6Y4.js → chunk-AJ7QOTOZ.js} +43 -27
  14. package/dist/{_browser-chunks/chunk-FQ7SLVLR.js → _node-chunks/chunk-B2EXFXPG.js} +32 -1
  15. package/dist/_node-chunks/{chunk-3PAK6HOZ.js → chunk-C3CWELCD.js} +7 -7
  16. package/dist/_node-chunks/{chunk-EE622TFR.js → chunk-CUUCEXYW.js} +6 -6
  17. package/dist/_node-chunks/chunk-EBMWZDZG.js +23 -0
  18. package/dist/_node-chunks/{chunk-PDCQDYS4.js → chunk-FCQVKOY4.js} +72 -11
  19. package/dist/_node-chunks/{chunk-2S4J6WRI.js → chunk-FD76ZM2X.js} +8 -8
  20. package/dist/_node-chunks/{chunk-J33WT6V7.js → chunk-GJ5FSAL5.js} +6 -6
  21. package/dist/_node-chunks/{chunk-RCCMX64R.js → chunk-GUCJOBT7.js} +6 -6
  22. package/dist/_node-chunks/{chunk-EY7WWLFP.js → chunk-HNDTWAF5.js} +7 -7
  23. package/dist/_node-chunks/{chunk-W77J252D.js → chunk-ITMM32VP.js} +9 -9
  24. package/dist/_node-chunks/{chunk-KQCVPCQD.js → chunk-KYHFIXVV.js} +6 -6
  25. package/dist/_node-chunks/{chunk-O5HLDMLW.js → chunk-PL7KUITS.js} +12 -12
  26. package/dist/_node-chunks/{chunk-TTAIHANB.js → chunk-QCZPELNP.js} +7 -7
  27. package/dist/_node-chunks/{chunk-745ARPQW.js → chunk-RZ3SV46Y.js} +40 -24
  28. package/dist/_node-chunks/{chunk-V6NSKAAJ.js → chunk-SNGQFKE7.js} +7 -7
  29. package/dist/_node-chunks/{chunk-4K33EHJJ.js → chunk-VGBOM5PD.js} +21 -17
  30. package/dist/_node-chunks/chunk-VRODUWUT.js +61 -0
  31. package/dist/_node-chunks/{chunk-NAZXVKZR.js → chunk-WUVM2V22.js} +6 -6
  32. package/dist/_node-chunks/{chunk-YF6BQNR6.js → chunk-WYREEMWZ.js} +6 -6
  33. package/dist/_node-chunks/{chunk-OBA5XT44.js → chunk-XPWMJEXT.js} +7 -7
  34. package/dist/_node-chunks/{chunk-DUT2G4P5.js → chunk-ZIG3SZMN.js} +8 -8
  35. package/dist/_node-chunks/{dist-BV4S5XPY.js → dist-XHCP6OFU.js} +9 -9
  36. package/dist/_node-chunks/{globby-MMDNVX5S.js → globby-YHL6UTMA.js} +9 -9
  37. package/dist/_node-chunks/{lib-ZNCEKZ43.js → lib-RWWG7TOS.js} +7 -7
  38. package/dist/_node-chunks/{mdx-N42X6CFJ-KXIBNMFG.js → mdx-N42X6CFJ-ZALEYAPJ.js} +8 -8
  39. package/dist/_node-chunks/{p-limit-RIAILNZP.js → p-limit-LLBQLQ7I.js} +7 -7
  40. package/dist/babel/index.js +10 -10
  41. package/dist/bin/core.js +12 -12
  42. package/dist/bin/dispatcher.js +11 -11
  43. package/dist/bin/loader.js +9 -9
  44. package/dist/cli/index.js +18 -18
  45. package/dist/common/index.d.ts +25 -18
  46. package/dist/common/index.js +19 -19
  47. package/dist/core-server/index.d.ts +68 -1
  48. package/dist/core-server/index.js +33 -33
  49. package/dist/core-server/presets/common-override-preset.js +9 -9
  50. package/dist/core-server/presets/common-preset.js +25 -25
  51. package/dist/csf/index.js +1 -1
  52. package/dist/csf-tools/index.js +9 -9
  53. package/dist/manager/globals-runtime.js +21 -2
  54. package/dist/manager-api/index.js +4 -4
  55. package/dist/manager-errors.d.ts +24 -0
  56. package/dist/manager-errors.js +2 -2
  57. package/dist/mocking-utils/index.js +8 -8
  58. package/dist/node-logger/index.js +9 -9
  59. package/dist/preview/runtime.js +21 -2
  60. package/dist/preview-api/index.js +1 -1
  61. package/dist/preview-errors.d.ts +24 -0
  62. package/dist/preview-errors.js +2 -2
  63. package/dist/server-errors.d.ts +59 -3
  64. package/dist/server-errors.js +22 -11
  65. package/dist/telemetry/index.js +23 -23
  66. package/package.json +1 -1
  67. package/dist/_node-chunks/chunk-6WT5T7D6.js +0 -23
  68. package/dist/_node-chunks/chunk-ABYOUG2G.js +0 -18
  69. package/dist/_node-chunks/chunk-UQA3ZWVX.js +0 -61
@@ -26,6 +26,73 @@ declare const buildIndexStandalone: (options: BuildIndexOptions & {
26
26
  outputFile: string;
27
27
  }) => Promise<void>;
28
28
 
29
+ declare abstract class StorybookError extends Error {
30
+ private _name;
31
+ /** Category of the error. Used to classify the type of error, e.g., 'PREVIEW_API'. */
32
+ readonly category: string;
33
+ /** Code representing the error. Used to uniquely identify the error, e.g., 1. */
34
+ readonly code: number;
35
+ /**
36
+ * Data associated with the error. Used to provide additional information in the error message or
37
+ * to be passed to telemetry.
38
+ */
39
+ readonly data: {};
40
+ /**
41
+ * Specifies the documentation for the error.
42
+ *
43
+ * - If `true`, links to a documentation page on the Storybook website (make sure it exists before
44
+ * enabling) – This is not implemented yet.
45
+ * - If a string, uses the provided URL for documentation (external or FAQ links).
46
+ * - If `false` (default), no documentation link is added.
47
+ */
48
+ readonly documentation: boolean | string | string[];
49
+ /** Flag used to easily determine if the error originates from Storybook. */
50
+ readonly fromStorybook: true;
51
+ /**
52
+ * Flag used to determine if the error is handled by us and should therefore not be shown to the
53
+ * user.
54
+ */
55
+ isHandledError: boolean;
56
+ get fullErrorCode(): `SB_${string}_${string}`;
57
+ /** Overrides the default `Error.name` property in the format: SB_<CATEGORY>_<CODE>. */
58
+ get name(): string;
59
+ set name(name: string);
60
+ /**
61
+ * A collection of sub errors which relate to a parent error.
62
+ *
63
+ * Sub-errors are used to represent multiple related errors that occurred together. When a
64
+ * StorybookError with sub-errors is sent to telemetry, both the parent error and each sub-error
65
+ * are sent as separate telemetry events. This allows for better error tracking and debugging.
66
+ *
67
+ * @example
68
+ *
69
+ * ```ts
70
+ * const error1 = new SomeError();
71
+ * const error2 = new AnotherError();
72
+ * const parentError = new ParentError({
73
+ * // ... other props
74
+ * subErrors: [error1, error2],
75
+ * });
76
+ * ```
77
+ */
78
+ subErrors: StorybookError[];
79
+ constructor(props: {
80
+ category: string;
81
+ code: number;
82
+ message: string;
83
+ documentation?: boolean | string | string[];
84
+ isHandledError?: boolean;
85
+ name: string;
86
+ /**
87
+ * Optional array of sub-errors that are related to this error. When this error is sent to
88
+ * telemetry, each sub-error will be sent as a separate event.
89
+ */
90
+ subErrors?: StorybookError[];
91
+ });
92
+ /** Generates the error message along with additional documentation link (if applicable). */
93
+ static getFullMessage({ documentation, code, category, message, }: ConstructorParameters<typeof StorybookError>[0]): string;
94
+ }
95
+
29
96
  type TelemetryOptions = {
30
97
  cliOptions: CLIOptions;
31
98
  presetOptions?: Parameters<typeof loadAllPresets>[0];
@@ -34,7 +101,7 @@ type TelemetryOptions = {
34
101
  };
35
102
  type ErrorLevel = 'none' | 'error' | 'full';
36
103
  declare function getErrorLevel({ cliOptions, presetOptions, skipPrompt, }: TelemetryOptions): Promise<ErrorLevel>;
37
- declare function sendTelemetryError(_error: unknown, eventType: EventType, options: TelemetryOptions, blocking?: boolean): Promise<void>;
104
+ declare function sendTelemetryError(_error: unknown, eventType: EventType, options: TelemetryOptions, blocking?: boolean, parent?: StorybookError): Promise<void>;
38
105
  declare function isTelemetryEnabled(options: TelemetryOptions): boolean;
39
106
  declare function withTelemetry<T>(eventType: EventType, options: TelemetryOptions, run: () => Promise<T>): Promise<T | undefined>;
40
107
 
@@ -1,17 +1,17 @@
1
- import CJS_COMPAT_NODE_URL_f2mg11kr5cs from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_f2mg11kr5cs from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_f2mg11kr5cs from "node:module";
1
+ import CJS_COMPAT_NODE_URL_16w7d0j2rs7 from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_16w7d0j2rs7 from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_16w7d0j2rs7 from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_f2mg11kr5cs.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_f2mg11kr5cs.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_f2mg11kr5cs.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_16w7d0j2rs7.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_16w7d0j2rs7.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_16w7d0j2rs7.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
  StatusTypeIdMismatchError
14
- } from "../_node-chunks/chunk-PDCQDYS4.js";
14
+ } from "../_node-chunks/chunk-FCQVKOY4.js";
15
15
  import {
16
16
  debounce,
17
17
  getErrorLevel,
@@ -21,66 +21,66 @@ import {
21
21
  sendTelemetryError,
22
22
  useStatics,
23
23
  withTelemetry
24
- } from "../_node-chunks/chunk-4K33EHJJ.js";
25
- import "../_node-chunks/chunk-IHWETTDK.js";
24
+ } from "../_node-chunks/chunk-VGBOM5PD.js";
25
+ import "../_node-chunks/chunk-5H7WLGZC.js";
26
26
  import {
27
27
  detectPnp
28
- } from "../_node-chunks/chunk-6WT5T7D6.js";
28
+ } from "../_node-chunks/chunk-EBMWZDZG.js";
29
29
  import {
30
30
  StorybookError
31
- } from "../_node-chunks/chunk-U6IY6QQN.js";
31
+ } from "../_node-chunks/chunk-B2EXFXPG.js";
32
32
  import {
33
33
  telemetry
34
- } from "../_node-chunks/chunk-RIFAW6Y4.js";
35
- import "../_node-chunks/chunk-ABYOUG2G.js";
34
+ } from "../_node-chunks/chunk-AJ7QOTOZ.js";
35
+ import "../_node-chunks/chunk-3GJDB3VJ.js";
36
36
  import {
37
37
  optionalEnvToBoolean,
38
38
  require_cross_spawn,
39
39
  resolveImport,
40
40
  supportedExtensions,
41
41
  userOrAutoTitleFromSpecifier
42
- } from "../_node-chunks/chunk-745ARPQW.js";
43
- import "../_node-chunks/chunk-UQA3ZWVX.js";
44
- import "../_node-chunks/chunk-OBA5XT44.js";
42
+ } from "../_node-chunks/chunk-RZ3SV46Y.js";
43
+ import "../_node-chunks/chunk-VRODUWUT.js";
44
+ import "../_node-chunks/chunk-XPWMJEXT.js";
45
45
  import {
46
46
  require_pretty_hrtime
47
- } from "../_node-chunks/chunk-2S4J6WRI.js";
48
- import "../_node-chunks/chunk-RCCMX64R.js";
49
- import "../_node-chunks/chunk-W77J252D.js";
47
+ } from "../_node-chunks/chunk-FD76ZM2X.js";
48
+ import "../_node-chunks/chunk-GUCJOBT7.js";
49
+ import "../_node-chunks/chunk-ITMM32VP.js";
50
50
  import {
51
51
  invariant,
52
52
  up2 as up
53
- } from "../_node-chunks/chunk-A7QREOLM.js";
53
+ } from "../_node-chunks/chunk-255LKCUD.js";
54
54
  import {
55
55
  importModule,
56
56
  resolvePackageDir
57
- } from "../_node-chunks/chunk-V6NSKAAJ.js";
58
- import "../_node-chunks/chunk-J33WT6V7.js";
57
+ } from "../_node-chunks/chunk-SNGQFKE7.js";
58
+ import "../_node-chunks/chunk-GJ5FSAL5.js";
59
59
  import {
60
60
  dirname,
61
61
  join,
62
62
  relative,
63
63
  resolve
64
- } from "../_node-chunks/chunk-EE622TFR.js";
65
- import "../_node-chunks/chunk-TCNV3SSR.js";
64
+ } from "../_node-chunks/chunk-CUUCEXYW.js";
65
+ import "../_node-chunks/chunk-52EAUB7R.js";
66
66
  import {
67
67
  slash
68
- } from "../_node-chunks/chunk-NAZXVKZR.js";
68
+ } from "../_node-chunks/chunk-WUVM2V22.js";
69
69
  import {
70
70
  require_dist
71
- } from "../_node-chunks/chunk-TTAIHANB.js";
71
+ } from "../_node-chunks/chunk-QCZPELNP.js";
72
72
  import {
73
73
  require_lib,
74
74
  require_src
75
- } from "../_node-chunks/chunk-3PAK6HOZ.js";
75
+ } from "../_node-chunks/chunk-C3CWELCD.js";
76
76
  import {
77
77
  require_picocolors
78
- } from "../_node-chunks/chunk-4FES3Z32.js";
78
+ } from "../_node-chunks/chunk-56BVIMJO.js";
79
79
  import {
80
80
  __commonJS,
81
81
  __require,
82
82
  __toESM
83
- } from "../_node-chunks/chunk-YF6BQNR6.js";
83
+ } from "../_node-chunks/chunk-WYREEMWZ.js";
84
84
 
85
85
  // ../node_modules/tsconfig-paths/lib/filesystem.js
86
86
  var require_filesystem = __commonJS({
@@ -5147,7 +5147,7 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
5147
5147
  let cacheKey = this.getFindMatchingFilesCacheKey(specifier, workingDir, ignoreWarnings), cached = this.findMatchingFilesCache.get(cacheKey);
5148
5148
  if (cached)
5149
5149
  return cached;
5150
- let pathToSubIndex = {}, fullGlob = slash(join2(specifier.directory, specifier.files)), { globby } = await import("../_node-chunks/globby-MMDNVX5S.js"), files = await globby(fullGlob, {
5150
+ let pathToSubIndex = {}, fullGlob = slash(join2(specifier.directory, specifier.files)), { globby } = await import("../_node-chunks/globby-YHL6UTMA.js"), files = await globby(fullGlob, {
5151
5151
  absolute: !0,
5152
5152
  cwd: workingDir,
5153
5153
  ...commonGlobOptions(fullGlob)
@@ -5336,7 +5336,7 @@ var makeAbsolute = (otherImport, normalizedPath, workingDir) => otherImport.star
5336
5336
  async extractDocs(specifier, absolutePath, projectTags = []) {
5337
5337
  let relativePath = relative2(this.options.workingDir, absolutePath);
5338
5338
  try {
5339
- let normalizedPath = normalizeStoryPath(relativePath), importPath = slash(normalizedPath), content = await readFile(absolutePath, { encoding: "utf8" }), { analyze } = await import("../_node-chunks/dist-BV4S5XPY.js"), result = await analyze(content);
5339
+ let normalizedPath = normalizeStoryPath(relativePath), importPath = slash(normalizedPath), content = await readFile(absolutePath, { encoding: "utf8" }), { analyze } = await import("../_node-chunks/dist-XHCP6OFU.js"), result = await analyze(content);
5340
5340
  if (result.isTemplate)
5341
5341
  return !1;
5342
5342
  let absoluteImports = result.imports.map(
@@ -5596,7 +5596,7 @@ function print(p) {
5596
5596
  // src/core-server/utils/get-builders.ts
5597
5597
  import { MissingBuilderError } from "storybook/internal/server-errors";
5598
5598
  async function getManagerBuilder() {
5599
- return await import("../_node-chunks/builder-manager-N4D23FLX.js");
5599
+ return await import("../_node-chunks/builder-manager-ZXJBDRXR.js");
5600
5600
  }
5601
5601
  async function getPreviewBuilder(resolvedPreviewBuilder) {
5602
5602
  return await importModule(resolvedPreviewBuilder);
@@ -5696,7 +5696,7 @@ function watchStorySpecifiers(specifiers, options, onInvalidate) {
5696
5696
  // files can be e.g. '**/foo/*/*.js' so we just want the last bit,
5697
5697
  // because the directory could already be within the files part (e.g. './x/foo/bar')
5698
5698
  basename2(specifier.files)
5699
- ), { globby } = await import("../_node-chunks/globby-MMDNVX5S.js");
5699
+ ), { globby } = await import("../_node-chunks/globby-YHL6UTMA.js");
5700
5700
  (await globby(slash(dirGlob), commonGlobOptions2(dirGlob))).forEach((filePath) => {
5701
5701
  let fileImportPath = toImportPath(filePath);
5702
5702
  specifier.importPathMatcher.exec(fileImportPath) && onInvalidate(specifier, fileImportPath, removed);
@@ -1,21 +1,21 @@
1
- import CJS_COMPAT_NODE_URL_f2mg11kr5cs from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_f2mg11kr5cs from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_f2mg11kr5cs from "node:module";
1
+ import CJS_COMPAT_NODE_URL_16w7d0j2rs7 from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_16w7d0j2rs7 from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_16w7d0j2rs7 from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_f2mg11kr5cs.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_f2mg11kr5cs.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_f2mg11kr5cs.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_16w7d0j2rs7.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_16w7d0j2rs7.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_16w7d0j2rs7.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-TCNV3SSR.js";
14
+ } from "../../_node-chunks/chunk-52EAUB7R.js";
15
15
  import {
16
16
  slash
17
- } from "../../_node-chunks/chunk-NAZXVKZR.js";
18
- import "../../_node-chunks/chunk-YF6BQNR6.js";
17
+ } from "../../_node-chunks/chunk-WUVM2V22.js";
18
+ import "../../_node-chunks/chunk-WYREEMWZ.js";
19
19
 
20
20
  // src/core-server/utils/remove-mdx-entries.ts
21
21
  import { isAbsolute, join, relative } from "node:path";
@@ -1,57 +1,57 @@
1
- import CJS_COMPAT_NODE_URL_f2mg11kr5cs from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_f2mg11kr5cs from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_f2mg11kr5cs from "node:module";
1
+ import CJS_COMPAT_NODE_URL_16w7d0j2rs7 from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_16w7d0j2rs7 from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_16w7d0j2rs7 from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_f2mg11kr5cs.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_f2mg11kr5cs.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_f2mg11kr5cs.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_16w7d0j2rs7.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_16w7d0j2rs7.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_16w7d0j2rs7.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
11
  // ------------------------------------------------------------
12
- import "../../_node-chunks/chunk-O5HLDMLW.js";
12
+ import "../../_node-chunks/chunk-PL7KUITS.js";
13
13
  import {
14
14
  parseStaticDir,
15
15
  sendTelemetryError,
16
16
  throttle
17
- } from "../../_node-chunks/chunk-4K33EHJJ.js";
18
- import "../../_node-chunks/chunk-IHWETTDK.js";
19
- import "../../_node-chunks/chunk-6WT5T7D6.js";
20
- import "../../_node-chunks/chunk-U6IY6QQN.js";
17
+ } from "../../_node-chunks/chunk-VGBOM5PD.js";
18
+ import "../../_node-chunks/chunk-5H7WLGZC.js";
19
+ import "../../_node-chunks/chunk-EBMWZDZG.js";
20
+ import "../../_node-chunks/chunk-B2EXFXPG.js";
21
21
  import {
22
22
  getLastEvents,
23
23
  getSessionId
24
- } from "../../_node-chunks/chunk-RCCMX64R.js";
24
+ } from "../../_node-chunks/chunk-GUCJOBT7.js";
25
25
  import {
26
26
  globalSettings
27
- } from "../../_node-chunks/chunk-W77J252D.js";
27
+ } from "../../_node-chunks/chunk-ITMM32VP.js";
28
28
  import {
29
29
  invariant
30
- } from "../../_node-chunks/chunk-A7QREOLM.js";
30
+ } from "../../_node-chunks/chunk-255LKCUD.js";
31
31
  import {
32
32
  resolvePackageDir
33
- } from "../../_node-chunks/chunk-V6NSKAAJ.js";
34
- import "../../_node-chunks/chunk-J33WT6V7.js";
33
+ } from "../../_node-chunks/chunk-SNGQFKE7.js";
34
+ import "../../_node-chunks/chunk-GJ5FSAL5.js";
35
35
  import {
36
36
  isAbsolute,
37
37
  join
38
- } from "../../_node-chunks/chunk-EE622TFR.js";
38
+ } from "../../_node-chunks/chunk-CUUCEXYW.js";
39
39
  import {
40
40
  loadConfig
41
- } from "../../_node-chunks/chunk-DUT2G4P5.js";
41
+ } from "../../_node-chunks/chunk-ZIG3SZMN.js";
42
42
  import {
43
43
  require_dist
44
- } from "../../_node-chunks/chunk-TTAIHANB.js";
45
- import "../../_node-chunks/chunk-CD52AW7X.js";
46
- import "../../_node-chunks/chunk-3PAK6HOZ.js";
44
+ } from "../../_node-chunks/chunk-QCZPELNP.js";
45
+ import "../../_node-chunks/chunk-3N5PBWO5.js";
46
+ import "../../_node-chunks/chunk-C3CWELCD.js";
47
47
  import {
48
48
  require_picocolors
49
- } from "../../_node-chunks/chunk-4FES3Z32.js";
49
+ } from "../../_node-chunks/chunk-56BVIMJO.js";
50
50
  import {
51
51
  __commonJS,
52
52
  __require,
53
53
  __toESM
54
- } from "../../_node-chunks/chunk-YF6BQNR6.js";
54
+ } from "../../_node-chunks/chunk-WYREEMWZ.js";
55
55
 
56
56
  // ../node_modules/shell-quote/quote.js
57
57
  var require_quote = __commonJS({
@@ -518,7 +518,7 @@ import { isCsfFactoryPreview } from "storybook/internal/csf-tools";
518
518
  var import_ts_dedent = __toESM(require_dist(), 1);
519
519
 
520
520
  // src/core-server/utils/get-component-variable-name.ts
521
- var getComponentVariableName = async (name) => (await import("../../_node-chunks/camelcase-EXGV75P2.js")).default(name.replace(/^[^a-zA-Z_$]*/, ""), { pascalCase: !0 }).replace(/[^a-zA-Z_$]+/, "");
521
+ var getComponentVariableName = async (name) => (await import("../../_node-chunks/camelcase-WRTIKEO6.js")).default(name.replace(/^[^a-zA-Z_$]*/, ""), { pascalCase: !0 }).replace(/[^a-zA-Z_$]+/, "");
522
522
 
523
523
  // src/core-server/utils/new-story-templates/csf-factory-template.ts
524
524
  async function getCsfFactoryTemplateForNewStoryFile(data) {
@@ -783,7 +783,7 @@ async function searchFiles({
783
783
  ignoredFiles = IGNORED_FILES,
784
784
  fileExtensions = FILE_EXTENSIONS
785
785
  }) {
786
- let { globby, isDynamicPattern } = await import("../../_node-chunks/globby-MMDNVX5S.js"), hasSearchSpecialGlobChars = isDynamicPattern(searchQuery, { cwd }), searchQueryHasExtension = /(\.[a-z]+)$/i.test(searchQuery), fileExtensionsPattern = `{${fileExtensions.join(",")}}`, globbedSearchQuery = hasSearchSpecialGlobChars ? searchQuery : searchQueryHasExtension ? [`**/*${searchQuery}*`, `**/*${searchQuery}*/**`] : [
786
+ let { globby, isDynamicPattern } = await import("../../_node-chunks/globby-YHL6UTMA.js"), hasSearchSpecialGlobChars = isDynamicPattern(searchQuery, { cwd }), searchQueryHasExtension = /(\.[a-z]+)$/i.test(searchQuery), fileExtensionsPattern = `{${fileExtensions.join(",")}}`, globbedSearchQuery = hasSearchSpecialGlobChars ? searchQuery : searchQueryHasExtension ? [`**/*${searchQuery}*`, `**/*${searchQuery}*/**`] : [
787
787
  `**/*${searchQuery}*.${fileExtensionsPattern}`,
788
788
  `**/*${searchQuery}*/**/*.${fileExtensionsPattern}`
789
789
  ];
package/dist/csf/index.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  mountDestructured,
11
11
  normalizeArrays,
12
12
  normalizeProjectAnnotations
13
- } from "../_browser-chunks/chunk-SS2NHR7W.js";
13
+ } from "../_browser-chunks/chunk-GPBRNGY5.js";
14
14
  import "../_browser-chunks/chunk-IPA5A322.js";
15
15
  import "../_browser-chunks/chunk-3OXGAGBE.js";
16
16
  import {
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_f2mg11kr5cs from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_f2mg11kr5cs from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_f2mg11kr5cs from "node:module";
1
+ import CJS_COMPAT_NODE_URL_16w7d0j2rs7 from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_16w7d0j2rs7 from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_16w7d0j2rs7 from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_f2mg11kr5cs.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_f2mg11kr5cs.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_f2mg11kr5cs.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_16w7d0j2rs7.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_16w7d0j2rs7.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_16w7d0j2rs7.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -38,9 +38,9 @@ import {
38
38
  vitestTransform,
39
39
  writeConfig,
40
40
  writeCsf
41
- } from "../_node-chunks/chunk-DUT2G4P5.js";
42
- import "../_node-chunks/chunk-TTAIHANB.js";
43
- import "../_node-chunks/chunk-YF6BQNR6.js";
41
+ } from "../_node-chunks/chunk-ZIG3SZMN.js";
42
+ import "../_node-chunks/chunk-QCZPELNP.js";
43
+ import "../_node-chunks/chunk-WYREEMWZ.js";
44
44
  export {
45
45
  BadMetaError,
46
46
  ConfigFile,
@@ -39224,7 +39224,26 @@ var StorybookError = class _StorybookError extends Error {
39224
39224
  * user.
39225
39225
  */
39226
39226
  this.isHandledError = !1;
39227
- this.category = props.category, this.documentation = props.documentation ?? !1, this.code = props.code, this.isHandledError = props.isHandledError ?? !1, this.name = props.name;
39227
+ /**
39228
+ * A collection of sub errors which relate to a parent error.
39229
+ *
39230
+ * Sub-errors are used to represent multiple related errors that occurred together. When a
39231
+ * StorybookError with sub-errors is sent to telemetry, both the parent error and each sub-error
39232
+ * are sent as separate telemetry events. This allows for better error tracking and debugging.
39233
+ *
39234
+ * @example
39235
+ *
39236
+ * ```ts
39237
+ * const error1 = new SomeError();
39238
+ * const error2 = new AnotherError();
39239
+ * const parentError = new ParentError({
39240
+ * // ... other props
39241
+ * subErrors: [error1, error2],
39242
+ * });
39243
+ * ```
39244
+ */
39245
+ this.subErrors = [];
39246
+ this.category = props.category, this.documentation = props.documentation ?? !1, this.code = props.code, this.isHandledError = props.isHandledError ?? !1, this.name = props.name, this.subErrors = props.subErrors ?? [];
39228
39247
  }
39229
39248
  get fullErrorCode() {
39230
39249
  return parseErrorCode({ code: this.code, category: this.category });
@@ -59891,7 +59910,7 @@ init_dist();
59891
59910
  var import_memoizerific8 = __toESM(require_memoizerific(), 1), import_semver = __toESM(require_semver2(), 1);
59892
59911
 
59893
59912
  // src/manager-api/version.ts
59894
- var version = "10.1.3";
59913
+ var version = "10.1.5";
59895
59914
 
59896
59915
  // src/manager-api/modules/versions.ts
59897
59916
  var { VERSIONCHECK } = scope, getVersionCheckData = (0, import_memoizerific8.default)(1)(() => {
@@ -5,13 +5,13 @@ import {
5
5
  } from "../_browser-chunks/chunk-UD6FQLAF.js";
6
6
  import {
7
7
  StatusTypeIdMismatchError
8
- } from "../_browser-chunks/chunk-GFY5R5EY.js";
8
+ } from "../_browser-chunks/chunk-V5NV5R37.js";
9
9
  import {
10
10
  StatusTypeIdMismatchError as StatusTypeIdMismatchError2
11
- } from "../_browser-chunks/chunk-2XZMBGTA.js";
11
+ } from "../_browser-chunks/chunk-7S2XPX5M.js";
12
12
  import {
13
13
  StorybookError
14
- } from "../_browser-chunks/chunk-FQ7SLVLR.js";
14
+ } from "../_browser-chunks/chunk-JVRDBUUP.js";
15
15
  import {
16
16
  countBy,
17
17
  dequal,
@@ -2329,7 +2329,7 @@ import { global as global8 } from "@storybook/global";
2329
2329
  import semver from "semver";
2330
2330
 
2331
2331
  // src/manager-api/version.ts
2332
- var version = "10.1.3";
2332
+ var version = "10.1.5";
2333
2333
 
2334
2334
  // src/manager-api/modules/versions.ts
2335
2335
  var { VERSIONCHECK } = global8, getVersionCheckData = (0, import_memoizerific2.default)(1)(() => {
@@ -570,6 +570,25 @@ declare abstract class StorybookError extends Error {
570
570
  /** Overrides the default `Error.name` property in the format: SB_<CATEGORY>_<CODE>. */
571
571
  get name(): string;
572
572
  set name(name: string);
573
+ /**
574
+ * A collection of sub errors which relate to a parent error.
575
+ *
576
+ * Sub-errors are used to represent multiple related errors that occurred together. When a
577
+ * StorybookError with sub-errors is sent to telemetry, both the parent error and each sub-error
578
+ * are sent as separate telemetry events. This allows for better error tracking and debugging.
579
+ *
580
+ * @example
581
+ *
582
+ * ```ts
583
+ * const error1 = new SomeError();
584
+ * const error2 = new AnotherError();
585
+ * const parentError = new ParentError({
586
+ * // ... other props
587
+ * subErrors: [error1, error2],
588
+ * });
589
+ * ```
590
+ */
591
+ subErrors: StorybookError[];
573
592
  constructor(props: {
574
593
  category: string;
575
594
  code: number;
@@ -577,6 +596,11 @@ declare abstract class StorybookError extends Error {
577
596
  documentation?: boolean | string | string[];
578
597
  isHandledError?: boolean;
579
598
  name: string;
599
+ /**
600
+ * Optional array of sub-errors that are related to this error. When this error is sent to
601
+ * telemetry, each sub-error will be sent as a separate event.
602
+ */
603
+ subErrors?: StorybookError[];
580
604
  });
581
605
  /** Generates the error message along with additional documentation link (if applicable). */
582
606
  static getFullMessage({ documentation, code, category, message, }: ConstructorParameters<typeof StorybookError>[0]): string;
@@ -3,8 +3,8 @@ import {
3
3
  ProviderDoesNotExtendBaseProviderError,
4
4
  StatusTypeIdMismatchError,
5
5
  UncaughtManagerError
6
- } from "./_browser-chunks/chunk-GFY5R5EY.js";
7
- import "./_browser-chunks/chunk-FQ7SLVLR.js";
6
+ } from "./_browser-chunks/chunk-V5NV5R37.js";
7
+ import "./_browser-chunks/chunk-JVRDBUUP.js";
8
8
  import "./_browser-chunks/chunk-A242L54C.js";
9
9
  export {
10
10
  Category,
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_f2mg11kr5cs from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_f2mg11kr5cs from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_f2mg11kr5cs from "node:module";
1
+ import CJS_COMPAT_NODE_URL_16w7d0j2rs7 from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_16w7d0j2rs7 from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_16w7d0j2rs7 from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_f2mg11kr5cs.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_f2mg11kr5cs.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_f2mg11kr5cs.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_16w7d0j2rs7.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_16w7d0j2rs7.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_16w7d0j2rs7.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-EE622TFR.js";
20
- import "../_node-chunks/chunk-YF6BQNR6.js";
19
+ } from "../_node-chunks/chunk-CUUCEXYW.js";
20
+ import "../_node-chunks/chunk-WYREEMWZ.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_f2mg11kr5cs from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_f2mg11kr5cs from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_f2mg11kr5cs from "node:module";
1
+ import CJS_COMPAT_NODE_URL_16w7d0j2rs7 from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_16w7d0j2rs7 from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_16w7d0j2rs7 from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_f2mg11kr5cs.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_f2mg11kr5cs.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_f2mg11kr5cs.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_16w7d0j2rs7.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_16w7d0j2rs7.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_16w7d0j2rs7.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-2S4J6WRI.js";
26
- import "../_node-chunks/chunk-4FES3Z32.js";
27
- import "../_node-chunks/chunk-YF6BQNR6.js";
25
+ } from "../_node-chunks/chunk-FD76ZM2X.js";
26
+ import "../_node-chunks/chunk-56BVIMJO.js";
27
+ import "../_node-chunks/chunk-WYREEMWZ.js";
28
28
  var export_instance = import_npmlog.default;
29
29
  export {
30
30
  CLI_COLORS,
@@ -13566,7 +13566,26 @@ var StorybookError = class _StorybookError extends Error {
13566
13566
  * user.
13567
13567
  */
13568
13568
  this.isHandledError = !1;
13569
- this.category = props.category, this.documentation = props.documentation ?? !1, this.code = props.code, this.isHandledError = props.isHandledError ?? !1, this.name = props.name;
13569
+ /**
13570
+ * A collection of sub errors which relate to a parent error.
13571
+ *
13572
+ * Sub-errors are used to represent multiple related errors that occurred together. When a
13573
+ * StorybookError with sub-errors is sent to telemetry, both the parent error and each sub-error
13574
+ * are sent as separate telemetry events. This allows for better error tracking and debugging.
13575
+ *
13576
+ * @example
13577
+ *
13578
+ * ```ts
13579
+ * const error1 = new SomeError();
13580
+ * const error2 = new AnotherError();
13581
+ * const parentError = new ParentError({
13582
+ * // ... other props
13583
+ * subErrors: [error1, error2],
13584
+ * });
13585
+ * ```
13586
+ */
13587
+ this.subErrors = [];
13588
+ this.category = props.category, this.documentation = props.documentation ?? !1, this.code = props.code, this.isHandledError = props.isHandledError ?? !1, this.name = props.name, this.subErrors = props.subErrors ?? [];
13570
13589
  }
13571
13590
  get fullErrorCode() {
13572
13591
  return parseErrorCode({ code: this.code, category: this.category });
@@ -34217,7 +34236,7 @@ var DocsContext = class {
34217
34236
  }
34218
34237
  resolveModuleExport(moduleExportOrType) {
34219
34238
  let csfFile = this.exportsToCSFFile.get(moduleExportOrType);
34220
- if (csfFile)
34239
+ if (!csfFile && moduleExportOrType && typeof moduleExportOrType == "object" && "default" in moduleExportOrType && (csfFile = this.exportsToCSFFile.get(moduleExportOrType.default)), csfFile)
34221
34240
  return { type: "meta", csfFile };
34222
34241
  let story = this.exportToStory.get(
34223
34242
  isStory(moduleExportOrType) ? moduleExportOrType.input : moduleExportOrType
@@ -48,7 +48,7 @@ import {
48
48
  useStoryContext,
49
49
  userOrAutoTitle,
50
50
  userOrAutoTitleFromSpecifier
51
- } from "../_browser-chunks/chunk-SS2NHR7W.js";
51
+ } from "../_browser-chunks/chunk-GPBRNGY5.js";
52
52
  import {
53
53
  pauseAnimations,
54
54
  waitForAnimations