storybook 9.1.0-alpha.5 → 9.1.0-alpha.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 (90) hide show
  1. package/assets/browser/favicon-wrapper.svg +46 -0
  2. package/assets/browser/favicon.svg +1 -1
  3. package/dist/bin/index.cjs +62 -69
  4. package/dist/bin/index.js +43 -50
  5. package/dist/cli/bin/index.cjs +932 -932
  6. package/dist/cli/bin/index.js +635 -634
  7. package/dist/cli/index.cjs +14965 -14973
  8. package/dist/cli/index.d.ts +713 -15
  9. package/dist/cli/index.js +13488 -13495
  10. package/dist/common/index.cjs +13169 -13067
  11. package/dist/common/index.d.ts +348 -73
  12. package/dist/common/index.js +24024 -23919
  13. package/dist/components/index.cjs +1462 -1448
  14. package/dist/components/index.d.ts +3 -1
  15. package/dist/components/index.js +412 -397
  16. package/dist/core-server/index.cjs +6649 -6588
  17. package/dist/core-server/index.d.ts +14 -2
  18. package/dist/core-server/index.js +6053 -5993
  19. package/dist/core-server/presets/common-manager.js +3438 -3353
  20. package/dist/core-server/presets/common-preset.cjs +2370 -2374
  21. package/dist/core-server/presets/common-preset.js +1881 -1881
  22. package/dist/csf/index.cjs +2536 -736
  23. package/dist/csf/index.d.ts +251 -9
  24. package/dist/csf/index.js +2558 -749
  25. package/dist/csf-tools/index.cjs +226 -224
  26. package/dist/csf-tools/index.js +116 -112
  27. package/dist/instrumenter/index.cjs +1150 -1099
  28. package/dist/instrumenter/index.d.ts +1 -0
  29. package/dist/instrumenter/index.js +1261 -1214
  30. package/dist/manager/globals-runtime.js +21317 -23959
  31. package/dist/manager/runtime.js +3713 -3534
  32. package/dist/manager-api/index.cjs +74 -74
  33. package/dist/manager-api/index.d.ts +8 -531
  34. package/dist/manager-api/index.js +142 -142
  35. package/dist/node-logger/index.cjs +8520 -994
  36. package/dist/node-logger/index.d.ts +395 -2
  37. package/dist/node-logger/index.js +8535 -995
  38. package/dist/preview/runtime.js +13337 -16032
  39. package/dist/preview-api/index.cjs +273 -271
  40. package/dist/preview-api/index.d.ts +4 -1
  41. package/dist/preview-api/index.js +14 -12
  42. package/dist/server-errors.cjs +201 -242
  43. package/dist/server-errors.d.ts +1 -12
  44. package/dist/server-errors.js +182 -223
  45. package/dist/telemetry/index.cjs +1314 -1313
  46. package/dist/telemetry/index.d.ts +3 -2
  47. package/dist/telemetry/index.js +1195 -1192
  48. package/dist/test/index.cjs +9136 -9815
  49. package/dist/test/index.js +8339 -9025
  50. package/dist/types/index.d.ts +15 -15
  51. package/package.json +6 -188
  52. package/dist/actions/preview.cjs +0 -159
  53. package/dist/actions/preview.d.ts +0 -45
  54. package/dist/actions/preview.js +0 -149
  55. package/dist/backgrounds/index.cjs +0 -16
  56. package/dist/backgrounds/index.d.ts +0 -2
  57. package/dist/backgrounds/index.js +0 -0
  58. package/dist/backgrounds/preview.cjs +0 -143
  59. package/dist/backgrounds/preview.d.ts +0 -53
  60. package/dist/backgrounds/preview.js +0 -127
  61. package/dist/component-testing/index.cjs +0 -23
  62. package/dist/component-testing/index.d.ts +0 -3
  63. package/dist/component-testing/index.js +0 -5
  64. package/dist/component-testing/preview.cjs +0 -40
  65. package/dist/component-testing/preview.d.ts +0 -5
  66. package/dist/component-testing/preview.js +0 -25
  67. package/dist/controls/preview.cjs +0 -26
  68. package/dist/controls/preview.d.ts +0 -43
  69. package/dist/controls/preview.js +0 -9
  70. package/dist/highlight/preview.cjs +0 -590
  71. package/dist/highlight/preview.d.ts +0 -20
  72. package/dist/highlight/preview.js +0 -575
  73. package/dist/measure/index.cjs +0 -16
  74. package/dist/measure/index.d.ts +0 -2
  75. package/dist/measure/index.js +0 -0
  76. package/dist/measure/preview.cjs +0 -466
  77. package/dist/measure/preview.d.ts +0 -25
  78. package/dist/measure/preview.js +0 -450
  79. package/dist/outline/index.cjs +0 -16
  80. package/dist/outline/index.d.ts +0 -2
  81. package/dist/outline/index.js +0 -0
  82. package/dist/outline/preview.cjs +0 -518
  83. package/dist/outline/preview.d.ts +0 -25
  84. package/dist/outline/preview.js +0 -486
  85. package/dist/test/preview.cjs +0 -73
  86. package/dist/test/preview.d.ts +0 -17
  87. package/dist/test/preview.js +0 -66
  88. package/dist/viewport/preview.cjs +0 -35
  89. package/dist/viewport/preview.d.ts +0 -62
  90. package/dist/viewport/preview.js +0 -19
@@ -1,106 +1,106 @@
1
1
  "use strict";
2
- var me = Object.create;
2
+ var ue = Object.create;
3
3
  var y = Object.defineProperty;
4
- var de = Object.getOwnPropertyDescriptor;
5
- var ge = Object.getOwnPropertyNames;
6
- var be = Object.getPrototypeOf, pe = Object.prototype.hasOwnProperty;
7
- var r = (t, o) => y(t, "name", { value: o, configurable: !0 });
8
- var Z = (t, o) => () => (o || t((o = { exports: {} }).exports, o), o.exports), ye = (t, o) => {
9
- for (var e in o)
10
- y(t, e, { get: o[e], enumerable: !0 });
11
- }, ee = (t, o, e, n) => {
12
- if (o && typeof o == "object" || typeof o == "function")
13
- for (let c of ge(o))
14
- !pe.call(t, c) && c !== e && y(t, c, { get: () => o[c], enumerable: !(n = de(o, c)) || n.enumerable });
4
+ var le = Object.getOwnPropertyDescriptor;
5
+ var me = Object.getOwnPropertyNames;
6
+ var be = Object.getPrototypeOf, ge = Object.prototype.hasOwnProperty;
7
+ var r = (t, e) => y(t, "name", { value: e, configurable: !0 });
8
+ var q = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports), de = (t, e) => {
9
+ for (var o in e)
10
+ y(t, o, { get: e[o], enumerable: !0 });
11
+ }, Q = (t, e, o, n) => {
12
+ if (e && typeof e == "object" || typeof e == "function")
13
+ for (let c of me(e))
14
+ !ge.call(t, c) && c !== o && y(t, c, { get: () => e[c], enumerable: !(n = le(e, c)) || n.enumerable });
15
15
  return t;
16
16
  };
17
- var oe = (t, o, e) => (e = t != null ? me(be(t)) : {}, ee(
17
+ var Z = (t, e, o) => (o = t != null ? ue(be(t)) : {}, Q(
18
18
  // If the importer is in node compatibility mode or this is not an ESM
19
19
  // file that has been converted to a CommonJS file using a Babel-
20
20
  // compatible transform (i.e. "__esModule" has not been set), then set
21
21
  // "default" to the CommonJS "module.exports" for node compatibility.
22
- o || !t || !t.__esModule ? y(e, "default", { value: t, enumerable: !0 }) : e,
22
+ e || !t || !t.__esModule ? y(o, "default", { value: t, enumerable: !0 }) : o,
23
23
  t
24
- )), he = (t) => ee(y({}, "__esModule", { value: !0 }), t);
24
+ )), pe = (t) => Q(y({}, "__esModule", { value: !0 }), t);
25
25
 
26
26
  // ../node_modules/picocolors/picocolors.js
27
- var se = Z((Oe, k) => {
28
- var f = process || {}, te = f.argv || [], E = f.env || {}, Ee = !(E.NO_COLOR || te.includes("--no-color")) && (!!E.FORCE_COLOR || te.includes(
29
- "--color") || f.platform === "win32" || (f.stdout || {}).isTTY && E.TERM !== "dumb" || !!E.CI), fe = /* @__PURE__ */ r((t, o, e = t) => (n) => {
30
- let c = "" + n, u = c.indexOf(o, t.length);
31
- return ~u ? t + xe(c, o, e, u) + o : t + c + o;
32
- }, "formatter"), xe = /* @__PURE__ */ r((t, o, e, n) => {
27
+ var te = q((Re, k) => {
28
+ var f = process || {}, ee = f.argv || [], E = f.env || {}, ye = !(E.NO_COLOR || ee.includes("--no-color")) && (!!E.FORCE_COLOR || ee.includes(
29
+ "--color") || f.platform === "win32" || (f.stdout || {}).isTTY && E.TERM !== "dumb" || !!E.CI), he = /* @__PURE__ */ r((t, e, o = t) => (n) => {
30
+ let c = "" + n, u = c.indexOf(e, t.length);
31
+ return ~u ? t + Ee(c, e, o, u) + e : t + c + e;
32
+ }, "formatter"), Ee = /* @__PURE__ */ r((t, e, o, n) => {
33
33
  let c = "", u = 0;
34
34
  do
35
- c += t.substring(u, n) + e, u = n + o.length, n = t.indexOf(o, u);
35
+ c += t.substring(u, n) + o, u = n + e.length, n = t.indexOf(e, u);
36
36
  while (~n);
37
37
  return c + t.substring(u);
38
- }, "replaceClose"), re = /* @__PURE__ */ r((t = Ee) => {
39
- let o = t ? fe : () => String;
38
+ }, "replaceClose"), oe = /* @__PURE__ */ r((t = ye) => {
39
+ let e = t ? he : () => String;
40
40
  return {
41
41
  isColorSupported: t,
42
- reset: o("\x1B[0m", "\x1B[0m"),
43
- bold: o("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
44
- dim: o("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
45
- italic: o("\x1B[3m", "\x1B[23m"),
46
- underline: o("\x1B[4m", "\x1B[24m"),
47
- inverse: o("\x1B[7m", "\x1B[27m"),
48
- hidden: o("\x1B[8m", "\x1B[28m"),
49
- strikethrough: o("\x1B[9m", "\x1B[29m"),
50
- black: o("\x1B[30m", "\x1B[39m"),
51
- red: o("\x1B[31m", "\x1B[39m"),
52
- green: o("\x1B[32m", "\x1B[39m"),
53
- yellow: o("\x1B[33m", "\x1B[39m"),
54
- blue: o("\x1B[34m", "\x1B[39m"),
55
- magenta: o("\x1B[35m", "\x1B[39m"),
56
- cyan: o("\x1B[36m", "\x1B[39m"),
57
- white: o("\x1B[37m", "\x1B[39m"),
58
- gray: o("\x1B[90m", "\x1B[39m"),
59
- bgBlack: o("\x1B[40m", "\x1B[49m"),
60
- bgRed: o("\x1B[41m", "\x1B[49m"),
61
- bgGreen: o("\x1B[42m", "\x1B[49m"),
62
- bgYellow: o("\x1B[43m", "\x1B[49m"),
63
- bgBlue: o("\x1B[44m", "\x1B[49m"),
64
- bgMagenta: o("\x1B[45m", "\x1B[49m"),
65
- bgCyan: o("\x1B[46m", "\x1B[49m"),
66
- bgWhite: o("\x1B[47m", "\x1B[49m"),
67
- blackBright: o("\x1B[90m", "\x1B[39m"),
68
- redBright: o("\x1B[91m", "\x1B[39m"),
69
- greenBright: o("\x1B[92m", "\x1B[39m"),
70
- yellowBright: o("\x1B[93m", "\x1B[39m"),
71
- blueBright: o("\x1B[94m", "\x1B[39m"),
72
- magentaBright: o("\x1B[95m", "\x1B[39m"),
73
- cyanBright: o("\x1B[96m", "\x1B[39m"),
74
- whiteBright: o("\x1B[97m", "\x1B[39m"),
75
- bgBlackBright: o("\x1B[100m", "\x1B[49m"),
76
- bgRedBright: o("\x1B[101m", "\x1B[49m"),
77
- bgGreenBright: o("\x1B[102m", "\x1B[49m"),
78
- bgYellowBright: o("\x1B[103m", "\x1B[49m"),
79
- bgBlueBright: o("\x1B[104m", "\x1B[49m"),
80
- bgMagentaBright: o("\x1B[105m", "\x1B[49m"),
81
- bgCyanBright: o("\x1B[106m", "\x1B[49m"),
82
- bgWhiteBright: o("\x1B[107m", "\x1B[49m")
42
+ reset: e("\x1B[0m", "\x1B[0m"),
43
+ bold: e("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
44
+ dim: e("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
45
+ italic: e("\x1B[3m", "\x1B[23m"),
46
+ underline: e("\x1B[4m", "\x1B[24m"),
47
+ inverse: e("\x1B[7m", "\x1B[27m"),
48
+ hidden: e("\x1B[8m", "\x1B[28m"),
49
+ strikethrough: e("\x1B[9m", "\x1B[29m"),
50
+ black: e("\x1B[30m", "\x1B[39m"),
51
+ red: e("\x1B[31m", "\x1B[39m"),
52
+ green: e("\x1B[32m", "\x1B[39m"),
53
+ yellow: e("\x1B[33m", "\x1B[39m"),
54
+ blue: e("\x1B[34m", "\x1B[39m"),
55
+ magenta: e("\x1B[35m", "\x1B[39m"),
56
+ cyan: e("\x1B[36m", "\x1B[39m"),
57
+ white: e("\x1B[37m", "\x1B[39m"),
58
+ gray: e("\x1B[90m", "\x1B[39m"),
59
+ bgBlack: e("\x1B[40m", "\x1B[49m"),
60
+ bgRed: e("\x1B[41m", "\x1B[49m"),
61
+ bgGreen: e("\x1B[42m", "\x1B[49m"),
62
+ bgYellow: e("\x1B[43m", "\x1B[49m"),
63
+ bgBlue: e("\x1B[44m", "\x1B[49m"),
64
+ bgMagenta: e("\x1B[45m", "\x1B[49m"),
65
+ bgCyan: e("\x1B[46m", "\x1B[49m"),
66
+ bgWhite: e("\x1B[47m", "\x1B[49m"),
67
+ blackBright: e("\x1B[90m", "\x1B[39m"),
68
+ redBright: e("\x1B[91m", "\x1B[39m"),
69
+ greenBright: e("\x1B[92m", "\x1B[39m"),
70
+ yellowBright: e("\x1B[93m", "\x1B[39m"),
71
+ blueBright: e("\x1B[94m", "\x1B[39m"),
72
+ magentaBright: e("\x1B[95m", "\x1B[39m"),
73
+ cyanBright: e("\x1B[96m", "\x1B[39m"),
74
+ whiteBright: e("\x1B[97m", "\x1B[39m"),
75
+ bgBlackBright: e("\x1B[100m", "\x1B[49m"),
76
+ bgRedBright: e("\x1B[101m", "\x1B[49m"),
77
+ bgGreenBright: e("\x1B[102m", "\x1B[49m"),
78
+ bgYellowBright: e("\x1B[103m", "\x1B[49m"),
79
+ bgBlueBright: e("\x1B[104m", "\x1B[49m"),
80
+ bgMagentaBright: e("\x1B[105m", "\x1B[49m"),
81
+ bgCyanBright: e("\x1B[106m", "\x1B[49m"),
82
+ bgWhiteBright: e("\x1B[107m", "\x1B[49m")
83
83
  };
84
84
  }, "createColors");
85
- k.exports = re();
86
- k.exports.createColors = re;
85
+ k.exports = oe();
86
+ k.exports.createColors = oe;
87
87
  });
88
88
 
89
89
  // ../node_modules/ts-dedent/dist/index.js
90
- var ae = Z((h) => {
90
+ var se = q((h) => {
91
91
  "use strict";
92
92
  Object.defineProperty(h, "__esModule", { value: !0 });
93
93
  h.dedent = void 0;
94
- function ne(t) {
95
- for (var o = [], e = 1; e < arguments.length; e++)
96
- o[e - 1] = arguments[e];
94
+ function re(t) {
95
+ for (var e = [], o = 1; o < arguments.length; o++)
96
+ e[o - 1] = arguments[o];
97
97
  var n = Array.from(typeof t == "string" ? [t] : t);
98
98
  n[n.length - 1] = n[n.length - 1].replace(/\r?\n([\t ]*)$/, "");
99
99
  var c = n.reduce(function(m, x) {
100
100
  var p = x.match(/\n([\t ]+|(?!\s).)/g);
101
101
  return p ? m.concat(p.map(function(R) {
102
- var g, b;
103
- return (b = (g = R.match(/[\t ]/g)) === null || g === void 0 ? void 0 : g.length) !== null && b !== void 0 ? b : 0;
102
+ var g, d;
103
+ return (d = (g = R.match(/[\t ]/g)) === null || g === void 0 ? void 0 : g.length) !== null && d !== void 0 ? d : 0;
104
104
  })) : m;
105
105
  }, []);
106
106
  if (c.length) {
@@ -112,72 +112,70 @@ var ae = Z((h) => {
112
112
  });
113
113
  }
114
114
  n[0] = n[0].replace(/^\r?\n/, "");
115
- var d = n[0];
116
- return o.forEach(function(m, x) {
117
- var p = d.match(/(?:^|\n)( *)$/), R = p ? p[1] : "", g = m;
115
+ var b = n[0];
116
+ return e.forEach(function(m, x) {
117
+ var p = b.match(/(?:^|\n)( *)$/), R = p ? p[1] : "", g = m;
118
118
  typeof m == "string" && m.includes(`
119
119
  `) && (g = String(m).split(`
120
- `).map(function(b, le) {
121
- return le === 0 ? b : "" + R + b;
120
+ `).map(function(d, ce) {
121
+ return ce === 0 ? d : "" + R + d;
122
122
  }).join(`
123
- `)), d += g + n[x + 1];
124
- }), d;
123
+ `)), b += g + n[x + 1];
124
+ }), b;
125
125
  }
126
- r(ne, "dedent");
127
- h.dedent = ne;
128
- h.default = ne;
126
+ r(re, "dedent");
127
+ h.dedent = re;
128
+ h.default = re;
129
129
  });
130
130
 
131
131
  // src/server-errors.ts
132
- var Re = {};
133
- ye(Re, {
134
- AngularLegacyBuildOptionsError: () => W,
135
- Category: () => ue,
132
+ var fe = {};
133
+ de(fe, {
134
+ AngularLegacyBuildOptionsError: () => K,
135
+ Category: () => ie,
136
136
  ConflictingStaticDirConfigError: () => C,
137
137
  CouldNotEvaluateFrameworkError: () => w,
138
- CriticalPresetLoadError: () => K,
139
- FindPackageVersionsError: () => z,
138
+ CriticalPresetLoadError: () => v,
139
+ FindPackageVersionsError: () => X,
140
140
  GenerateNewProjectOnInitError: () => U,
141
- GoogleFontsDownloadError: () => B,
141
+ GoogleFontsDownloadError: () => L,
142
142
  GoogleFontsLoadingError: () => N,
143
- IncompatiblePostCssConfigError: () => q,
143
+ IncompatiblePostCssConfigError: () => H,
144
144
  InvalidFrameworkNameError: () => _,
145
- InvalidStoriesEntryError: () => I,
145
+ InvalidStoriesEntryError: () => S,
146
146
  MainFileESMOnlyImportError: () => V,
147
147
  MainFileEvaluationError: () => F,
148
148
  MainFileMissingError: () => $,
149
- MissingAngularJsonError: () => v,
150
- MissingBuilderError: () => L,
149
+ MissingAngularJsonError: () => W,
150
+ MissingBuilderError: () => B,
151
151
  MissingFrameworkFieldError: () => A,
152
152
  NoMatchingExportError: () => j,
153
- NoStatsForViteDevError: () => H,
153
+ NoStatsForViteDevError: () => J,
154
154
  NxProjectDetectedError: () => O,
155
- SavingGlobalSettingsFileError: () => Q,
155
+ SavingGlobalSettingsFileError: () => z,
156
156
  StatusTypeIdMismatchError: () => D,
157
157
  SvelteViteWithSvelteKitError: () => P,
158
- UpgradeStorybookInWrongWorkingDirectory: () => X,
159
158
  UpgradeStorybookToLowerVersionError: () => G,
160
- UpgradeStorybookToSameVersionError: () => Y,
161
- UpgradeStorybookUnknownCurrentVersionError: () => J,
159
+ UpgradeStorybookUnknownCurrentVersionError: () => Y,
162
160
  WebpackCompilationError: () => T,
163
161
  WebpackInvocationError: () => M,
164
- WebpackMissingStatsError: () => S
162
+ WebpackMissingStatsError: () => I
165
163
  });
166
- module.exports = he(Re);
167
- var l = oe(se(), 1), i = oe(ae(), 1);
164
+ module.exports = pe(fe);
165
+ var l = Z(te(), 1), i = Z(se(), 1);
168
166
 
169
167
  // src/storybook-error.ts
170
- function ie({
168
+ function ne({
171
169
  code: t,
172
- category: o
170
+ category: e
173
171
  }) {
174
- let e = String(t).padStart(4, "0");
175
- return `SB_${o}_${e}`;
172
+ let o = String(t).padStart(4, "0");
173
+ return `SB_${e}_${o}`;
176
174
  }
177
- r(ie, "parseErrorCode");
175
+ r(ne, "parseErrorCode");
178
176
  var a = class t extends Error {
179
- constructor(e) {
180
- super(t.getFullMessage(e));
177
+ constructor(o) {
178
+ super(t.getFullMessage(o));
181
179
  /**
182
180
  * Data associated with the error. Used to provide additional information in the error message or
183
181
  * to be passed to telemetry.
@@ -185,39 +183,39 @@ var a = class t extends Error {
185
183
  this.data = {};
186
184
  /** Flag used to easily determine if the error originates from Storybook. */
187
185
  this.fromStorybook = !0;
188
- this.category = e.category, this.documentation = e.documentation ?? !1, this.code = e.code;
186
+ this.category = o.category, this.documentation = o.documentation ?? !1, this.code = o.code;
189
187
  }
190
188
  static {
191
189
  r(this, "StorybookError");
192
190
  }
193
191
  get fullErrorCode() {
194
- return ie({ code: this.code, category: this.category });
192
+ return ne({ code: this.code, category: this.category });
195
193
  }
196
194
  /** Overrides the default `Error.name` property in the format: SB_<CATEGORY>_<CODE>. */
197
195
  get name() {
198
- let e = this.constructor.name;
199
- return `${this.fullErrorCode} (${e})`;
196
+ let o = this.constructor.name;
197
+ return `${this.fullErrorCode} (${o})`;
200
198
  }
201
199
  /** Generates the error message along with additional documentation link (if applicable). */
202
200
  static getFullMessage({
203
- documentation: e,
201
+ documentation: o,
204
202
  code: n,
205
203
  category: c,
206
204
  message: u
207
205
  }) {
208
- let d;
209
- return e === !0 ? d = `https://storybook.js.org/error/${ie({ code: n, category: c })}` : typeof e == "string" ? d = e : Array.isArray(e) &&
210
- (d = `
211
- ${e.map((m) => ` - ${m}`).join(`
212
- `)}`), `${u}${d != null ? `
206
+ let b;
207
+ return o === !0 ? b = `https://storybook.js.org/error/${ne({ code: n, category: c })}` : typeof o == "string" ? b = o : Array.isArray(o) &&
208
+ (b = `
209
+ ${o.map((m) => ` - ${m}`).join(`
210
+ `)}`), `${u}${b != null ? `
213
211
 
214
- More info: ${d}
212
+ More info: ${b}
215
213
  ` : ""}`;
216
214
  }
217
215
  };
218
216
 
219
217
  // src/server-errors.ts
220
- var ue = /* @__PURE__ */ ((s) => (s.CLI = "CLI", s.CLI_INIT = "CLI_INIT", s.CLI_AUTOMIGRATE = "CLI_AUTOMIGRATE", s.CLI_UPGRADE = "CLI_UPGRAD\
218
+ var ie = /* @__PURE__ */ ((s) => (s.CLI = "CLI", s.CLI_INIT = "CLI_INIT", s.CLI_AUTOMIGRATE = "CLI_AUTOMIGRATE", s.CLI_UPGRADE = "CLI_UPGRAD\
221
219
  E", s.CLI_ADD = "CLI_ADD", s.CODEMOD = "CODEMOD", s.CORE_SERVER = "CORE-SERVER", s.CSF_PLUGIN = "CSF-PLUGIN", s.CSF_TOOLS = "CSF-TOOLS", s.CORE_COMMON =
222
220
  "CORE-COMMON", s.NODE_LOGGER = "NODE-LOGGER", s.TELEMETRY = "TELEMETRY", s.BUILDER_MANAGER = "BUILDER-MANAGER", s.BUILDER_VITE = "BUILDER-VI\
223
221
  TE", s.BUILDER_WEBPACK5 = "BUILDER-WEBPACK5", s.SOURCE_LOADER = "SOURCE-LOADER", s.POSTINSTALL = "POSTINSTALL", s.DOCS_TOOLS = "DOCS-TOOLS",
@@ -227,7 +225,7 @@ FRAMEWORK_HTML-VITE", s.FRAMEWORK_HTML_WEBPACK5 = "FRAMEWORK_HTML-WEBPACK5", s.F
227
225
  "FRAMEWORK_REACT-WEBPACK5", s.FRAMEWORK_SERVER_WEBPACK5 = "FRAMEWORK_SERVER-WEBPACK5", s.FRAMEWORK_SVELTE_VITE = "FRAMEWORK_SVELTE-VITE", s.
228
226
  FRAMEWORK_SVELTEKIT = "FRAMEWORK_SVELTEKIT", s.FRAMEWORK_VUE_VITE = "FRAMEWORK_VUE-VITE", s.FRAMEWORK_VUE_WEBPACK5 = "FRAMEWORK_VUE-WEBPACK5",
229
227
  s.FRAMEWORK_VUE3_VITE = "FRAMEWORK_VUE3-VITE", s.FRAMEWORK_VUE3_WEBPACK5 = "FRAMEWORK_VUE3-WEBPACK5", s.FRAMEWORK_WEB_COMPONENTS_VITE = "FRA\
230
- MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WEB-COMPONENTS-WEBPACK5", s))(ue || {}), O = class extends a {
228
+ MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WEB-COMPONENTS-WEBPACK5", s))(ie || {}), O = class extends a {
231
229
  static {
232
230
  r(this, "NxProjectDetectedError");
233
231
  }
@@ -257,34 +255,34 @@ MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WE
257
255
  });
258
256
  }
259
257
  }, _ = class extends a {
260
- constructor(e) {
258
+ constructor(o) {
261
259
  super({
262
260
  category: "CORE-COMMON",
263
261
  code: 2,
264
262
  documentation: "https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#new-framework-api",
265
263
  message: i.dedent`
266
- Invalid value of '${e.frameworkName}' in the 'framework' field of Storybook config.
264
+ Invalid value of '${o.frameworkName}' in the 'framework' field of Storybook config.
267
265
 
268
266
  Please run 'npx storybook automigrate' to automatically fix your config.
269
267
  `
270
268
  });
271
- this.data = e;
269
+ this.data = o;
272
270
  }
273
271
  static {
274
272
  r(this, "InvalidFrameworkNameError");
275
273
  }
276
274
  }, w = class extends a {
277
- constructor(e) {
275
+ constructor(o) {
278
276
  super({
279
277
  category: "CORE-COMMON",
280
278
  code: 3,
281
279
  documentation: "",
282
280
  message: i.dedent`
283
- Could not evaluate the '${e.frameworkName}' package from the 'framework' field of Storybook config.
281
+ Could not evaluate the '${o.frameworkName}' package from the 'framework' field of Storybook config.
284
282
 
285
283
  Are you sure it's a valid package and is installed?`
286
284
  });
287
- this.data = e;
285
+ this.data = o;
288
286
  }
289
287
  static {
290
288
  r(this, "CouldNotEvaluateFrameworkError");
@@ -306,7 +304,7 @@ MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WE
306
304
  Please remove the CLI flag from your storybook script and use only the 'staticDirs' option instead.`
307
305
  });
308
306
  }
309
- }, I = class extends a {
307
+ }, S = class extends a {
310
308
  static {
311
309
  r(this, "InvalidStoriesEntryError");
312
310
  }
@@ -322,7 +320,7 @@ MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WE
322
320
  Please check your main configuration file and make sure it exports a 'stories' field that is not an empty array.`
323
321
  });
324
322
  }
325
- }, S = class extends a {
323
+ }, I = class extends a {
326
324
  static {
327
325
  r(this, "WebpackMissingStatsError");
328
326
  }
@@ -340,28 +338,28 @@ MEWORK_WEB-COMPONENTS-VITE", s.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_WE
340
338
  });
341
339
  }
342
340
  }, M = class extends a {
343
- constructor(e) {
341
+ constructor(o) {
344
342
  super({
345
343
  category: "BUILDER-WEBPACK5",
346
344
  code: 2,
347
- message: e.error.message.trim()
345
+ message: o.error.message.trim()
348
346
  });
349
- this.data = e;
347
+ this.data = o;
350
348
  }
351
349
  static {
352
350
  r(this, "WebpackInvocationError");
353
351
  }
354
352
  };
355
- function ce(t = "") {
353
+ function ae(t = "") {
356
354
  return t.replace(/\u001B\[[0-9;]*m/g, "");
357
355
  }
358
- r(ce, "removeAnsiEscapeCodes");
356
+ r(ae, "removeAnsiEscapeCodes");
359
357
  var T = class extends a {
360
- constructor(e) {
361
- e.errors = e.errors.map((n) => ({
358
+ constructor(o) {
359
+ o.errors = o.errors.map((n) => ({
362
360
  ...n,
363
- message: ce(n.message),
364
- stack: ce(n.stack),
361
+ message: ae(n.message),
362
+ stack: ae(n.stack),
365
363
  name: n.name
366
364
  }));
367
365
  super({
@@ -373,27 +371,27 @@ var T = class extends a {
373
371
  Run Storybook with --debug-webpack for more information.
374
372
  `
375
373
  });
376
- this.data = e;
374
+ this.data = o;
377
375
  }
378
376
  static {
379
377
  r(this, "WebpackCompilationError");
380
378
  }
381
- }, v = class extends a {
382
- constructor(e) {
379
+ }, W = class extends a {
380
+ constructor(o) {
383
381
  super({
384
382
  category: "CLI_INIT",
385
383
  code: 2,
386
384
  documentation: "https://storybook.js.org/docs/faq#error-no-angularjson-file-found",
387
385
  message: i.dedent`
388
- An angular.json file was not found in the current working directory: ${e.path}
386
+ An angular.json file was not found in the current working directory: ${o.path}
389
387
  Storybook needs it to work properly, so please rerun the command at the root of your project, where the angular.json file is located.`
390
388
  });
391
- this.data = e;
389
+ this.data = o;
392
390
  }
393
391
  static {
394
392
  r(this, "MissingAngularJsonError");
395
393
  }
396
- }, W = class extends a {
394
+ }, K = class extends a {
397
395
  static {
398
396
  r(this, "AngularLegacyBuildOptionsError");
399
397
  }
@@ -412,27 +410,27 @@ var T = class extends a {
412
410
  Please run 'npx storybook automigrate' to automatically fix your config.`
413
411
  });
414
412
  }
415
- }, K = class extends a {
416
- constructor(e) {
413
+ }, v = class extends a {
414
+ constructor(o) {
417
415
  super({
418
416
  category: "CORE-SERVER",
419
417
  code: 2,
420
418
  documentation: "",
421
419
  message: i.dedent`
422
- Storybook failed to load the following preset: ${e.presetName}.
420
+ Storybook failed to load the following preset: ${o.presetName}.
423
421
 
424
422
  Please check whether your setup is correct, the Storybook dependencies (and their peer dependencies) are installed correctly and there are no package version clashes.
425
423
 
426
424
  If you believe this is a bug, please open an issue on Github.
427
425
 
428
- ${e.error.stack || e.error.message}`
426
+ ${o.error.stack || o.error.message}`
429
427
  });
430
- this.data = e;
428
+ this.data = o;
431
429
  }
432
430
  static {
433
431
  r(this, "CriticalPresetLoadError");
434
432
  }
435
- }, L = class extends a {
433
+ }, B = class extends a {
436
434
  static {
437
435
  r(this, "MissingBuilderError");
438
436
  }
@@ -453,32 +451,32 @@ var T = class extends a {
453
451
  If you believe this is a bug, please describe your issue in detail on Github.`
454
452
  });
455
453
  }
456
- }, B = class extends a {
457
- constructor(e) {
454
+ }, L = class extends a {
455
+ constructor(o) {
458
456
  super({
459
457
  category: "FRAMEWORK_NEXTJS",
460
458
  code: 1,
461
459
  documentation: "https://github.com/storybookjs/storybook/blob/next/code/frameworks/nextjs/README.md#nextjs-font-optimization",
462
460
  message: i.dedent`
463
- Failed to fetch \`${e.fontFamily}\` from Google Fonts with URL: \`${e.url}\``
461
+ Failed to fetch \`${o.fontFamily}\` from Google Fonts with URL: \`${o.url}\``
464
462
  });
465
- this.data = e;
463
+ this.data = o;
466
464
  }
467
465
  static {
468
466
  r(this, "GoogleFontsDownloadError");
469
467
  }
470
468
  }, N = class extends a {
471
- constructor(e) {
469
+ constructor(o) {
472
470
  super({
473
471
  category: "FRAMEWORK_NEXTJS",
474
472
  code: 2,
475
473
  documentation: "https://github.com/storybookjs/storybook/blob/next/code/frameworks/nextjs/README.md#nextjs-font-optimization",
476
474
  message: i.dedent`
477
- An error occurred when trying to load Google Fonts with URL \`${e.url}\`.
475
+ An error occurred when trying to load Google Fonts with URL \`${o.url}\`.
478
476
 
479
- ${e.error instanceof Error ? e.error.message : ""}`
477
+ ${o.error instanceof Error ? o.error.message : ""}`
480
478
  });
481
- this.data = e;
479
+ this.data = o;
482
480
  }
483
481
  static {
484
482
  r(this, "GoogleFontsLoadingError");
@@ -498,7 +496,7 @@ var T = class extends a {
498
496
  });
499
497
  }
500
498
  }, j = class extends a {
501
- constructor(e) {
499
+ constructor(o) {
502
500
  super({
503
501
  category: "CORE-SERVER",
504
502
  code: 4,
@@ -515,28 +513,28 @@ var T = class extends a {
515
513
 
516
514
  Please run \`npx storybook doctor\` for guidance on how to fix this issue.`
517
515
  });
518
- this.data = e;
516
+ this.data = o;
519
517
  }
520
518
  static {
521
519
  r(this, "NoMatchingExportError");
522
520
  }
523
521
  }, V = class extends a {
524
- constructor(e) {
522
+ constructor(o) {
525
523
  let n = [
526
- `Storybook failed to load ${e.location}`,
524
+ `Storybook failed to load ${o.location}`,
527
525
  "",
528
526
  "It looks like the file tried to load/import an ESM only module.",
529
- `Support for this is currently limited in ${e.location}`,
527
+ `Support for this is currently limited in ${o.location}`,
530
528
  "You can import ESM modules in your main file, but only as dynamic import.",
531
529
  ""
532
530
  ];
533
- e.line && n.push(
531
+ o.line && n.push(
534
532
  l.default.white(
535
- `In your ${l.default.yellow(e.location)} file, line ${l.default.bold(
536
- l.default.cyan(e.num)
533
+ `In your ${l.default.yellow(o.location)} file, line ${l.default.bold(
534
+ l.default.cyan(o.num)
537
535
  )} threw an error:`
538
536
  ),
539
- l.default.gray(e.line)
537
+ l.default.gray(o.line)
540
538
  ), n.push(
541
539
  "",
542
540
  l.default.white(
@@ -552,13 +550,13 @@ var T = class extends a {
552
550
  message: n.join(`
553
551
  `)
554
552
  });
555
- this.data = e;
553
+ this.data = o;
556
554
  }
557
555
  static {
558
556
  r(this, "MainFileESMOnlyImportError");
559
557
  }
560
558
  }, $ = class extends a {
561
- constructor(e) {
559
+ constructor(o) {
562
560
  let n = {
563
561
  storybook: {
564
562
  helperMessage: "You can pass a --config-dir flag to tell Storybook, where your main.js file is located at.",
@@ -569,82 +567,82 @@ var T = class extends a {
569
567
  // TODO: add proper docs once available
570
568
  documentation: "https://storybook.js.org/docs/configure"
571
569
  }
572
- }, { documentation: c, helperMessage: u } = n[e.source || "storybook"];
570
+ }, { documentation: c, helperMessage: u } = n[o.source || "storybook"];
573
571
  super({
574
572
  category: "CORE-SERVER",
575
573
  code: 6,
576
574
  documentation: c,
577
575
  message: i.dedent`
578
- No configuration files have been found in your configDir: ${l.default.yellow(e.location)}.
576
+ No configuration files have been found in your configDir: ${l.default.yellow(o.location)}.
579
577
  Storybook needs a "main.js" file, please add it.
580
578
 
581
579
  ${u}`
582
580
  });
583
- this.data = e;
581
+ this.data = o;
584
582
  }
585
583
  static {
586
584
  r(this, "MainFileMissingError");
587
585
  }
588
586
  }, F = class extends a {
589
- constructor(e) {
587
+ constructor(o) {
590
588
  let n = l.default.white(
591
- (e.error.stack || e.error.message).replaceAll(process.cwd(), "")
589
+ (o.error.stack || o.error.message).replaceAll(process.cwd(), "")
592
590
  );
593
591
  super({
594
592
  category: "CORE-SERVER",
595
593
  code: 7,
596
594
  message: i.dedent`
597
- Storybook couldn't evaluate your ${l.default.yellow(e.location)} file.
595
+ Storybook couldn't evaluate your ${l.default.yellow(o.location)} file.
598
596
 
599
597
  Original error:
600
598
  ${n}`
601
599
  });
602
- this.data = e;
600
+ this.data = o;
603
601
  }
604
602
  static {
605
603
  r(this, "MainFileEvaluationError");
606
604
  }
607
605
  }, D = class extends a {
608
- constructor(e) {
606
+ constructor(o) {
609
607
  super({
610
608
  category: "CORE-SERVER",
611
609
  code: 16,
612
- message: `Status has typeId "${e.status.typeId}" but was added to store with typeId "${e.typeId}". Full status: ${JSON.stringify(
613
- e.status,
610
+ message: `Status has typeId "${o.status.typeId}" but was added to store with typeId "${o.typeId}". Full status: ${JSON.stringify(
611
+ o.status,
614
612
  null,
615
613
  2
616
614
  )}`
617
615
  });
618
- this.data = e;
616
+ this.data = o;
619
617
  }
620
618
  static {
621
619
  r(this, "StatusTypeIdMismatchError");
622
620
  }
623
621
  }, U = class extends a {
624
- constructor(e) {
622
+ constructor(o) {
625
623
  super({
626
624
  category: "CLI_INIT",
627
625
  code: 3,
628
626
  documentation: "",
629
627
  message: i.dedent`
630
- There was an error while using ${e.packageManager} to create a new ${e.projectType} project.
628
+ There was an error while using ${o.packageManager} to create a new ${o.projectType} project.
631
629
 
632
- ${e.error instanceof Error ? e.error.message : ""}`
630
+ ${o.error instanceof Error ? o.error.message : ""}`
633
631
  });
634
- this.data = e;
632
+ this.data = o;
635
633
  }
636
634
  static {
637
635
  r(this, "GenerateNewProjectOnInitError");
638
636
  }
639
637
  }, G = class extends a {
640
- constructor(e) {
638
+ constructor(o) {
641
639
  super({
642
640
  category: "CLI_UPGRADE",
643
641
  code: 3,
644
642
  message: i.dedent`
645
643
  You are trying to upgrade Storybook to a lower version than the version currently installed. This is not supported.
646
644
 
647
- Storybook version ${e.beforeVersion} was detected in your project, but you are trying to "upgrade" to version ${e.currentVersion}.
645
+ Storybook version ${o.beforeVersion} was detected in your project, but you are trying to "upgrade" to version ${o.currentVersion}.
648
646
 
649
647
  This usually happens when running the upgrade command without a version specifier, e.g. "npx storybook upgrade".
650
648
  This will cause npm to run the globally cached storybook binary, which might be an older version.
@@ -653,37 +651,12 @@ var T = class extends a {
653
651
 
654
652
  "npx storybook@latest upgrade"`
655
653
  });
656
- this.data = e;
654
+ this.data = o;
657
655
  }
658
656
  static {
659
657
  r(this, "UpgradeStorybookToLowerVersionError");
660
658
  }
661
659
  }, Y = class extends a {
662
- constructor(e) {
663
- super({
664
- category: "CLI_UPGRADE",
665
- code: 4,
666
- message: i.dedent`
667
- You are upgrading Storybook to the same version that is currently installed in the project, version ${e.beforeVersion}.
668
-
669
- This usually happens when running the upgrade command without a version specifier, e.g. "npx storybook upgrade".
670
- This will cause npm to run the globally cached storybook binary, which might be the same version that you already have.
671
- This also happens if you're running the Storybook CLI that is locally installed in your project.
672
-
673
- If you intended to upgrade to the latest version, you should always run the Storybook CLI with a version specifier to force npm to download the latest version:
674
-
675
- "npx storybook@latest upgrade"
676
-
677
- If you intended to re-run automigrations, you should run the "automigrate" command directly instead:
678
-
679
- "npx storybook automigrate"`
680
- });
681
- this.data = e;
682
- }
683
- static {
684
- r(this, "UpgradeStorybookToSameVersionError");
685
- }
686
- }, J = class extends a {
687
660
  static {
688
661
  r(this, "UpgradeStorybookUnknownCurrentVersionError");
689
662
  }
@@ -698,21 +671,7 @@ var T = class extends a {
698
671
  It might help if you specify your Storybook config directory with the --config-dir flag.`
699
672
  });
700
673
  }
701
- }, X = class extends a {
702
- static {
703
- r(this, "UpgradeStorybookInWrongWorkingDirectory");
704
- }
705
- constructor() {
706
- super({
707
- category: "CLI_UPGRADE",
708
- code: 6,
709
- message: i.dedent`
710
- You are running the upgrade command in a CWD that does not contain Storybook dependencies.
711
-
712
- Did you mean to run it in a different directory? Make sure the directory you run this command in contains a package.json with your Storybook dependencies.`
713
- });
714
- }
715
- }, H = class extends a {
674
+ }, J = class extends a {
716
675
  static {
717
676
  r(this, "NoStatsForViteDevError");
718
677
  }
@@ -726,22 +685,22 @@ var T = class extends a {
726
685
  Please remove the \`--stats-json\` flag when running in dev mode.`
727
686
  });
728
687
  }
729
- }, z = class extends a {
730
- constructor(e) {
688
+ }, X = class extends a {
689
+ constructor(o) {
731
690
  super({
732
691
  category: "CLI",
733
692
  code: 1,
734
693
  message: i.dedent`
735
- Unable to find versions of "${e.packageName}" using ${e.packageManager}
736
- ${e.error && `Reason: ${e.error}`}`
694
+ Unable to find versions of "${o.packageName}" using ${o.packageManager}
695
+ ${o.error && `Reason: ${o.error}`}`
737
696
  });
738
- this.data = e;
697
+ this.data = o;
739
698
  }
740
699
  static {
741
700
  r(this, "FindPackageVersionsError");
742
701
  }
743
- }, q = class extends a {
744
- constructor(e) {
702
+ }, H = class extends a {
703
+ constructor(o) {
745
704
  super({
746
705
  category: "FRAMEWORK_NEXTJS",
747
706
  code: 3,
@@ -764,24 +723,24 @@ var T = class extends a {
764
723
  },
765
724
  };
766
725
 
767
- Original error: ${e.error.message}
726
+ Original error: ${o.error.message}
768
727
  `
769
728
  });
770
- this.data = e;
729
+ this.data = o;
771
730
  }
772
731
  static {
773
732
  r(this, "IncompatiblePostCssConfigError");
774
733
  }
775
- }, Q = class extends a {
776
- constructor(e) {
734
+ }, z = class extends a {
735
+ constructor(o) {
777
736
  super({
778
737
  category: "CORE-SERVER",
779
738
  code: 1,
780
739
  message: i.dedent`
781
- Unable to save global settings file to ${e.filePath}
782
- ${e.error && `Reason: ${e.error}`}`
740
+ Unable to save global settings file to ${o.filePath}
741
+ ${o.error && `Reason: ${o.error}`}`
783
742
  });
784
- this.data = e;
743
+ this.data = o;
785
744
  }
786
745
  static {
787
746
  r(this, "SavingGlobalSettingsFileError");