storybook 9.1.0-alpha.4 → 9.1.0-alpha.6

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 (39) hide show
  1. package/dist/bin/index.cjs +62 -69
  2. package/dist/bin/index.js +43 -50
  3. package/dist/cli/bin/index.cjs +604 -604
  4. package/dist/cli/bin/index.js +151 -150
  5. package/dist/cli/index.cjs +13787 -13796
  6. package/dist/cli/index.d.ts +706 -15
  7. package/dist/cli/index.js +12363 -12371
  8. package/dist/common/index.cjs +10988 -10891
  9. package/dist/common/index.d.ts +342 -69
  10. package/dist/common/index.js +24631 -24531
  11. package/dist/components/index.cjs +5 -3
  12. package/dist/components/index.d.ts +2 -1
  13. package/dist/components/index.js +5 -3
  14. package/dist/controls/preview.cjs +14 -14
  15. package/dist/controls/preview.d.ts +1 -1
  16. package/dist/controls/preview.js +2 -2
  17. package/dist/core-server/index.cjs +4838 -4791
  18. package/dist/core-server/index.d.ts +10 -1
  19. package/dist/core-server/index.js +5746 -5699
  20. package/dist/core-server/presets/common-manager.js +46 -32
  21. package/dist/core-server/presets/common-preset.cjs +1047 -1045
  22. package/dist/core-server/presets/common-preset.js +2053 -2048
  23. package/dist/csf/index.d.ts +2 -1
  24. package/dist/csf-tools/index.cjs +226 -224
  25. package/dist/csf-tools/index.js +116 -112
  26. package/dist/manager/globals-runtime.js +6 -4
  27. package/dist/manager-api/index.cjs +73 -73
  28. package/dist/manager-api/index.js +140 -140
  29. package/dist/node-logger/index.cjs +8520 -994
  30. package/dist/node-logger/index.d.ts +395 -2
  31. package/dist/node-logger/index.js +8535 -995
  32. package/dist/server-errors.cjs +201 -242
  33. package/dist/server-errors.d.ts +1 -12
  34. package/dist/server-errors.js +182 -223
  35. package/dist/telemetry/index.cjs +1326 -1325
  36. package/dist/telemetry/index.d.ts +3 -2
  37. package/dist/telemetry/index.js +1217 -1214
  38. package/dist/types/index.d.ts +3 -3
  39. package/package.json +18 -9
@@ -38,9 +38,9 @@ var V = Le((k) => {
38
38
  t[t.length - 1] = t[t.length - 1].replace(/\r?\n([\t ]*)$/, "");
39
39
  var i = t.reduce(function(l, p) {
40
40
  var d = p.match(/\n([\t ]+|(?!\s).)/g);
41
- return d ? l.concat(d.map(function(m) {
41
+ return d ? l.concat(d.map(function(u) {
42
42
  var x, b;
43
- return (b = (x = m.match(/[\t ]/g)) === null || x === void 0 ? void 0 : x.length) !== null && b !== void 0 ? b : 0;
43
+ return (b = (x = u.match(/[\t ]/g)) === null || x === void 0 ? void 0 : x.length) !== null && b !== void 0 ? b : 0;
44
44
  })) : l;
45
45
  }, []);
46
46
  if (i.length) {
@@ -54,11 +54,11 @@ var V = Le((k) => {
54
54
  t[0] = t[0].replace(/^\r?\n/, "");
55
55
  var a = t[0];
56
56
  return e.forEach(function(l, p) {
57
- var d = a.match(/(?:^|\n)( *)$/), m = d ? d[1] : "", x = l;
57
+ var d = a.match(/(?:^|\n)( *)$/), u = d ? d[1] : "", x = l;
58
58
  typeof l == "string" && l.includes(`
59
59
  `) && (x = String(l).split(`
60
60
  `).map(function(b, y) {
61
- return y === 0 ? b : "" + m + b;
61
+ return y === 0 ? b : "" + u + b;
62
62
  }).join(`
63
63
  `)), a += x + t[p + 1];
64
64
  }), a;
@@ -80,6 +80,7 @@ import {
80
80
  traverse as Ge
81
81
  } from "storybook/internal/babel";
82
82
  import { isExportStory as ne, storyNameFromExport as oe, toId as ze } from "storybook/internal/csf";
83
+ import { logger as ae } from "storybook/internal/node-logger";
83
84
 
84
85
  // src/csf-tools/findVarInitialization.ts
85
86
  import { types as A } from "storybook/internal/babel";
@@ -91,7 +92,7 @@ var P = /* @__PURE__ */ f((s, e) => {
91
92
  }, "findVarInitialization");
92
93
 
93
94
  // src/csf-tools/CsfFile.ts
94
- var ae = console, Xe = /\/preview(.(js|jsx|mjs|ts|tsx))?$/, Ke = /* @__PURE__ */ f((s) => Xe.test(s), "isValidPreviewPath");
95
+ var Xe = /\/preview(.(js|jsx|mjs|ts|tsx))?$/, Ke = /* @__PURE__ */ f((s) => Xe.test(s), "isValidPreviewPath");
95
96
  function Je(s) {
96
97
  if (c.isArrayExpression(s))
97
98
  return s.elements.map((e) => {
@@ -166,9 +167,9 @@ var v = /* @__PURE__ */ f((s, e) => {
166
167
  f(this, "NoMetaError");
167
168
  }
168
169
  constructor(e, r, t) {
169
- let i = "".trim();
170
+ let i = e.trim();
170
171
  super(O.dedent`
171
- CSF: ${e} ${v(r, t)}
172
+ CSF: ${i} ${v(r, t)}
172
173
 
173
174
  More info: https://storybook.js.org/docs/writing-stories#default-export
174
175
  `), this.name = this.constructor.name;
@@ -250,7 +251,7 @@ var v = /* @__PURE__ */ f((s, e) => {
250
251
  let o = i.value;
251
252
  if (c.isIdentifier(o)) {
252
253
  let l = o.name, p = r.body.find(
253
- (d) => c.isImportDeclaration(d) && d.specifiers.find((m) => m.local.name === l)
254
+ (d) => c.isImportDeclaration(d) && d.specifiers.find((u) => u.local.name === l)
254
255
  );
255
256
  if (p) {
256
257
  let { source: d } = p;
@@ -291,22 +292,22 @@ var v = /* @__PURE__ */ f((s, e) => {
291
292
  if (e._options.transformInlineMeta && !a && c.isExpression(i.declaration)) {
292
293
  let d = t.scope.generateUidIdentifier("meta");
293
294
  e._metaVariableName = d.name;
294
- let m = [
295
+ let u = [
295
296
  c.variableDeclaration("const", [c.variableDeclarator(d, i.declaration)]),
296
297
  c.exportDefaultDeclaration(d)
297
298
  ];
298
- m.forEach((x) => x.loc = t.node.loc), t.replaceWithMultiple(m);
299
+ u.forEach((x) => x.loc = t.node.loc), t.replaceWithMultiple(u);
299
300
  return;
300
301
  }
301
302
  let l, p;
302
303
  if (a) {
303
304
  let d = i.declaration.name;
304
305
  e._metaVariableName = d;
305
- let m = /* @__PURE__ */ f((x) => c.isIdentifier(x.id) && x.id.name === d, "isVariableDeclarator");
306
+ let u = /* @__PURE__ */ f((x) => c.isIdentifier(x.id) && x.id.name === d, "isVariableDeclarator");
306
307
  e._metaStatement = e._ast.program.body.find(
307
- (x) => c.isVariableDeclaration(x) && x.declarations.find(m)
308
+ (x) => c.isVariableDeclaration(x) && x.declarations.find(u)
308
309
  ), p = (e?._metaStatement?.declarations || []).find(
309
- m
310
+ u
310
311
  )?.init;
311
312
  } else
312
313
  e._metaStatement = i, p = i.declaration;
@@ -334,7 +335,7 @@ var v = /* @__PURE__ */ f((s, e) => {
334
335
  return;
335
336
  }
336
337
  e._storyExports[d] = l, e._storyPaths[d] = t, e._storyStatements[d] = i;
337
- let m = oe(d);
338
+ let u = oe(d);
338
339
  e._storyAnnotations[d] ? ae.warn(
339
340
  `Unexpected annotations for "${d}" before story declaration`
340
341
  ) : e._storyAnnotations[d] = {};
@@ -367,7 +368,7 @@ var v = /* @__PURE__ */ f((s, e) => {
367
368
  e
368
369
  );
369
370
  else if (y.key.name === "name" && c.isStringLiteral(y.value))
370
- m = y.value.value;
371
+ u = y.value.value;
371
372
  else if (y.key.name === "storyName" && c.isStringLiteral(y.value))
372
373
  ae.warn(
373
374
  `Unexpected usage of "storyName" in "${d}". Please use "name" instead.`
@@ -382,7 +383,7 @@ var v = /* @__PURE__ */ f((s, e) => {
382
383
  }
383
384
  })) : b.__isArgsStory = ce(x, o, e), e._stories[d] = {
384
385
  id: "FIXME",
385
- name: m,
386
+ name: u,
386
387
  parameters: b,
387
388
  __stats: {
388
389
  factory: p
@@ -391,18 +392,18 @@ var v = /* @__PURE__ */ f((s, e) => {
391
392
  }
392
393
  }) : i.specifiers.length > 0 && i.specifiers.forEach((l) => {
393
394
  if (c.isExportSpecifier(l) && c.isIdentifier(l.exported)) {
394
- let { name: p } = l.exported, { name: d } = l.local, m = c.isProgram(o) ? P(d, o) : l.local;
395
+ let { name: p } = l.exported, { name: d } = l.local, u = c.isProgram(o) ? P(d, o) : l.local;
395
396
  if (p === "default") {
396
397
  let x;
397
- c.isObjectExpression(m) ? x = m : (
398
+ c.isObjectExpression(u) ? x = u : (
398
399
  // export default { ... } as Meta<...>
399
- c.isTSAsExpression(m) && c.isObjectExpression(m.expression) && (x = m.expression)
400
+ c.isTSAsExpression(u) && c.isObjectExpression(u.expression) && (x = u.expression)
400
401
  ), x && c.isProgram(o) && e._parseMeta(x, o);
401
402
  } else {
402
- let x = {}, b = m;
403
+ let x = {}, b = u;
403
404
  c.isObjectExpression(b) && b.properties.forEach((y) => {
404
405
  c.isIdentifier(y.key) && (x[y.key.name] = y.value);
405
- }), e._storyAnnotations[p] = x, e._storyStatements[p] = m, e._storyPaths[p] = t, e._stories[p] = {
406
+ }), e._storyAnnotations[p] = x, e._storyStatements[p] = u, e._storyPaths[p] = t, e._stories[p] = {
406
407
  id: "FIXME",
407
408
  name: p,
408
409
  localName: d,
@@ -423,10 +424,10 @@ var v = /* @__PURE__ */ f((s, e) => {
423
424
  if (e._storyAnnotations[a] && (l === "story" && c.isObjectExpression(p) ? p.properties.forEach((d) => {
424
425
  c.isIdentifier(d.key) && (e._storyAnnotations[a][d.key.name] = d.value);
425
426
  }) : e._storyAnnotations[a][l] = p), l === "storyName" && c.isStringLiteral(p)) {
426
- let d = p.value, m = e._stories[a];
427
- if (!m)
427
+ let d = p.value, u = e._stories[a];
428
+ if (!u)
428
429
  return;
429
- m.name = d;
430
+ u.name = d;
430
431
  }
431
432
  }
432
433
  }
@@ -476,9 +477,9 @@ var v = /* @__PURE__ */ f((s, e) => {
476
477
  let a = o.parameters?.__id ?? ze(e._meta?.id || e._meta?.title, oe(i)), l = { ...o.parameters, __id: a }, { includeStories: p } = e.
477
478
  _meta || {};
478
479
  i === "__page" && (r.length === 1 || Array.isArray(p) && p.length === 1) && (l.docsOnly = !0), t[i] = { ...o, id: a, parameters: l };
479
- let d = e._storyAnnotations[i], { tags: m, play: x } = d;
480
- if (m) {
481
- let E = c.isIdentifier(m) ? P(m.name, this._ast.program) : m;
480
+ let d = e._storyAnnotations[i], { tags: u, play: x } = d;
481
+ if (u) {
482
+ let E = c.isIdentifier(u) ? P(u.name, this._ast.program) : u;
482
483
  t[i].tags = le(E);
483
484
  }
484
485
  x && (t[i].tags = [...t[i].tags || [], "play-fn"]);
@@ -542,13 +543,13 @@ var v = /* @__PURE__ */ f((s, e) => {
542
543
  }) => new Be({ filename: e }, { code: s, ast: r ?? fe(s) }), "babelParseFile"), Q = /* @__PURE__ */ f((s, e) => {
543
544
  let r = fe(s), t = et({ code: s, filename: e.fileName, ast: r });
544
545
  return new J(r, e, t);
545
- }, "loadCsf"), ue = /* @__PURE__ */ f((s, e = { sourceMaps: !1 }, r) => {
546
+ }, "loadCsf"), me = /* @__PURE__ */ f((s, e = { sourceMaps: !1 }, r) => {
546
547
  let t = We(s._ast, e, r);
547
548
  return e.sourceMaps ? t : t.code;
548
- }, "formatCsf"), tt = /* @__PURE__ */ f((s, e = {}) => de.print(s._ast, e), "printCsf"), Ft = /* @__PURE__ */ f(async (s, e) => {
549
+ }, "formatCsf"), tt = /* @__PURE__ */ f((s, e = {}) => de.print(s._ast, e), "printCsf"), Ct = /* @__PURE__ */ f(async (s, e) => {
549
550
  let r = (await Ue(s, "utf-8")).toString();
550
551
  return Q(r, { ...e, fileName: s });
551
- }, "readCsf"), Ct = /* @__PURE__ */ f(async (s, e) => {
552
+ }, "readCsf"), Tt = /* @__PURE__ */ f(async (s, e) => {
552
553
  if (!(e || s._options.fileName))
553
554
  throw new Error("Please specify a fileName for writeCsf");
554
555
  await qe(e, tt(s).code);
@@ -559,12 +560,13 @@ var ye = U(V(), 1);
559
560
  import { readFile as rt, writeFile as it } from "node:fs/promises";
560
561
  import {
561
562
  babelParse as xe,
562
- generate as me,
563
+ generate as ue,
563
564
  recast as st,
564
565
  types as n,
565
566
  traverse as ge
566
567
  } from "storybook/internal/babel";
567
- var H = console, Y = /* @__PURE__ */ f(({
568
+ import { logger as H } from "storybook/internal/node-logger";
569
+ var Y = /* @__PURE__ */ f(({
568
570
  expectedType: s,
569
571
  foundType: e,
570
572
  node: r
@@ -724,7 +726,7 @@ null, "propKey"), G = /* @__PURE__ */ f((s) => n.isTSAsExpression(s) || n.isTSSa
724
726
  getFieldValue(e) {
725
727
  let r = this.getFieldNode(e);
726
728
  if (r) {
727
- let { code: t } = me(r, {});
729
+ let { code: t } = ue(r, {});
728
730
  return (0, eval)(`(() => (${t}))()`);
729
731
  }
730
732
  }
@@ -916,7 +918,7 @@ null, "propKey"), G = /* @__PURE__ */ f((s) => n.isTSAsExpression(s) || n.isTSSa
916
918
  valueToNode(e) {
917
919
  let r = this._inferQuotes(), t;
918
920
  if (r === "single") {
919
- let { code: i } = me(n.valueToNode(e), { jsescOption: { quotes: r } }), o = xe(`const __x = ${i}`);
921
+ let { code: i } = ue(n.valueToNode(e), { jsescOption: { quotes: r } }), o = xe(`const __x = ${i}`);
920
922
  ge(o, {
921
923
  VariableDeclaration: {
922
924
  enter({ node: a }) {
@@ -1029,13 +1031,13 @@ null, "propKey"), G = /* @__PURE__ */ f((s) => n.isTSAsExpression(s) || n.isTSSa
1029
1031
  return d && (r = p.source.value), d;
1030
1032
  }), i = /* @__PURE__ */ f((p) => n.importSpecifier(n.identifier(p), n.identifier(p)), "getNewImportSpecifier"), o = /* @__PURE__ */ f((p, d) => p.
1031
1033
  specifiers.find(
1032
- (m) => n.isImportSpecifier(m) && n.isIdentifier(m.imported) && m.imported.name === d
1034
+ (u) => n.isImportSpecifier(u) && n.isIdentifier(u.imported) && u.imported.name === d
1033
1035
  ), "hasImportSpecifier"), a = /* @__PURE__ */ f((p, d) => p.specifiers.find(
1034
- (m) => n.isImportNamespaceSpecifier(m) && n.isIdentifier(m.local) && m.local.name === d
1036
+ (u) => n.isImportNamespaceSpecifier(u) && n.isIdentifier(u.local) && u.local.name === d
1035
1037
  ), "hasNamespaceImportSpecifier");
1036
1038
  e === null ? t || this._ast.program.body.unshift(n.importDeclaration([], n.stringLiteral(r))) : typeof e == "string" ? t ? (/* @__PURE__ */ f(
1037
1039
  (p, d) => p.specifiers.find(
1038
- (m) => n.isImportDefaultSpecifier(m) && n.isIdentifier(m.local) && m.local.name === d
1040
+ (u) => n.isImportDefaultSpecifier(u) && n.isIdentifier(u.local) && u.local.name === d
1039
1041
  ), "hasDefaultImportSpecifier"))(t, e) || t.specifiers.push(
1040
1042
  n.importDefaultSpecifier(n.identifier(e))
1041
1043
  ) : this._ast.program.body.unshift(
@@ -1063,22 +1065,23 @@ null, "propKey"), G = /* @__PURE__ */ f((s) => n.isTSAsExpression(s) || n.isTSSa
1063
1065
  let r = xe(s);
1064
1066
  return new Z(r, s, e);
1065
1067
  }, "loadConfig"), ot = /* @__PURE__ */ f((s) => at(s).code, "formatConfig"), at = /* @__PURE__ */ f((s, e = {}) => st.print(s._ast, e), "pri\
1066
- ntConfig"), $t = /* @__PURE__ */ f(async (s) => {
1068
+ ntConfig"), Lt = /* @__PURE__ */ f(async (s) => {
1067
1069
  let e = (await rt(s, "utf-8")).toString();
1068
1070
  return nt(e, s).parse();
1069
- }, "readConfig"), Rt = /* @__PURE__ */ f(async (s, e) => {
1071
+ }, "readConfig"), Mt = /* @__PURE__ */ f(async (s, e) => {
1070
1072
  let r = e || s.fileName;
1071
1073
  if (!r)
1072
1074
  throw new Error("Please specify a fileName for writeConfig");
1073
1075
  await it(r, ot(s));
1074
- }, "writeConfig"), Lt = /* @__PURE__ */ f((s) => !!s._ast.program.body.find((r) => n.isImportDeclaration(r) && r.source.value.includes("@sto\
1076
+ }, "writeConfig"), Ut = /* @__PURE__ */ f((s) => !!s._ast.program.body.find((r) => n.isImportDeclaration(r) && r.source.value.includes("@sto\
1075
1077
  rybook") && r.specifiers.some((t) => n.isImportSpecifier(t) && n.isIdentifier(t.imported) && t.imported.name === "definePreview")), "isCsfFa\
1076
1078
  ctoryPreview");
1077
1079
 
1078
1080
  // src/csf-tools/getStorySortParameter.ts
1079
1081
  var je = U(V(), 1);
1080
1082
  import { babelParse as lt, generate as Ee, types as h, traverse as ct } from "storybook/internal/babel";
1081
- var pt = console, ee = /* @__PURE__ */ f((s, e) => {
1083
+ import { logger as pt } from "storybook/internal/node-logger";
1084
+ var ee = /* @__PURE__ */ f((s, e) => {
1082
1085
  let r;
1083
1086
  return s.properties.forEach((t) => {
1084
1087
  h.isIdentifier(t.key) && t.key.name === e && (r = t.value);
@@ -1108,7 +1111,7 @@ var pt = console, ee = /* @__PURE__ */ f((s, e) => {
1108
1111
  `;
1109
1112
  if (e)
1110
1113
  throw new Error(r);
1111
- pt.info(r);
1114
+ pt.log(r);
1112
1115
  }, "unsupported"), L = /* @__PURE__ */ f((s) => h.isTSAsExpression(s) || h.isTSSatisfiesExpression(s) ? s.expression : s, "stripTSModifiers"),
1113
1116
  Se = /* @__PURE__ */ f((s) => {
1114
1117
  let e = L(s);
@@ -1128,7 +1131,7 @@ Se = /* @__PURE__ */ f((s) => {
1128
1131
  return Se(t);
1129
1132
  } else
1130
1133
  F("default", !0);
1131
- }, "parseDefault"), Wt = /* @__PURE__ */ f((s) => {
1134
+ }, "parseDefault"), Xt = /* @__PURE__ */ f((s) => {
1132
1135
  if (!s.includes("storySort"))
1133
1136
  return;
1134
1137
  let e, r = lt(s);
@@ -1175,11 +1178,11 @@ Se = /* @__PURE__ */ f((s) => {
1175
1178
  import { generate as ft, types as g } from "storybook/internal/babel";
1176
1179
  var dt = /* @__PURE__ */ f((s, e, r, t) => {
1177
1180
  let i = e.getStoryExport(r), o = g.isCallExpression(i) && g.isMemberExpression(i.callee) && g.isIdentifier(i.callee.object) && i.callee.object.
1178
- name === "meta", a = !t?.disableSource && mt(i), l = !t?.disableDescription && Oe(e._storyStatements[r]), p = [], d = o ? g.memberExpression(
1179
- g.identifier(r), g.identifier("input")) : g.identifier(r), m = g.memberExpression(d, g.identifier("parameters"));
1180
- p.push(g.spreadElement(m));
1181
+ name === "meta", a = !t?.disableSource && ut(i), l = !t?.disableDescription && Oe(e._storyStatements[r]), p = [], d = o ? g.memberExpression(
1182
+ g.identifier(r), g.identifier("input")) : g.identifier(r), u = g.memberExpression(d, g.identifier("parameters"));
1183
+ p.push(g.spreadElement(u));
1181
1184
  let x = g.optionalMemberExpression(
1182
- m,
1185
+ u,
1183
1186
  g.identifier("docs"),
1184
1187
  !1,
1185
1188
  !0
@@ -1226,7 +1229,7 @@ var dt = /* @__PURE__ */ f((s, e, r, t) => {
1226
1229
  )
1227
1230
  );
1228
1231
  let y = g.expressionStatement(
1229
- g.assignmentExpression("=", m, g.objectExpression(p))
1232
+ g.assignmentExpression("=", u, g.objectExpression(p))
1230
1233
  );
1231
1234
  s._ast.program.body.push(y);
1232
1235
  }
@@ -1241,7 +1244,7 @@ var dt = /* @__PURE__ */ f((s, e, r, t) => {
1241
1244
  (l) => g.isObjectProperty(l) && g.isIdentifier(l.key) && l.key.name === t && g.isObjectExpression(l.value)
1242
1245
  ), a;
1243
1246
  o ? a = o.value : (a = g.objectExpression([]), s.properties.push(g.objectProperty(g.identifier(t), a))), Pe(a, i, r);
1244
- }, "addComponentDescription"), ut = /* @__PURE__ */ f((s, e, r) => {
1247
+ }, "addComponentDescription"), mt = /* @__PURE__ */ f((s, e, r) => {
1245
1248
  let t = !r?.disableDescription && Oe(e._metaStatement);
1246
1249
  if (t) {
1247
1250
  let i = s._metaNode;
@@ -1251,11 +1254,11 @@ var dt = /* @__PURE__ */ f((s, e, r, t) => {
1251
1254
  g.objectProperty(g.identifier("component"), g.stringLiteral(t))
1252
1255
  );
1253
1256
  }
1254
- }, "enrichCsfMeta"), Kt = /* @__PURE__ */ f((s, e, r) => {
1255
- ut(s, e, r), Object.keys(s._storyExports).forEach((t) => {
1257
+ }, "enrichCsfMeta"), Ht = /* @__PURE__ */ f((s, e, r) => {
1258
+ mt(s, e, r), Object.keys(s._storyExports).forEach((t) => {
1256
1259
  dt(s, e, t, r);
1257
1260
  });
1258
- }, "enrichCsf"), mt = /* @__PURE__ */ f((s) => {
1261
+ }, "enrichCsf"), ut = /* @__PURE__ */ f((s) => {
1259
1262
  let e = g.isVariableDeclarator(s) ? s.init : s, { code: r } = ft(e, {});
1260
1263
  return r;
1261
1264
  }, "extractSource"), Oe = /* @__PURE__ */ f((s) => s?.leadingComments ? s.leadingComments.map((r) => r.type === "CommentLine" || !r.value.startsWith(
@@ -1265,15 +1268,16 @@ var dt = /* @__PURE__ */ f((s, e, r, t) => {
1265
1268
  `) : "", "extractDescription");
1266
1269
 
1267
1270
  // src/csf-tools/index.ts
1268
- import { babelParse as cr } from "storybook/internal/babel";
1271
+ import { babelParse as mr } from "storybook/internal/babel";
1269
1272
 
1270
1273
  // src/csf-tools/vitest-plugin/transformer.ts
1271
1274
  var re = U(V(), 1);
1272
- import { types as u } from "storybook/internal/babel";
1275
+ import { types as m } from "storybook/internal/babel";
1273
1276
  import { getStoryTitle as gt } from "storybook/internal/common";
1274
1277
  import { combineTags as xt } from "storybook/internal/csf";
1275
- var ve = console, yt = /* @__PURE__ */ f((s, e) => !(e.include.length && !e.include.some((r) => s?.includes(r)) || e.exclude.some((r) => s?.
1276
- includes(r))), "isValidTest");
1278
+ import { logger as ve } from "storybook/internal/node-logger";
1279
+ var yt = /* @__PURE__ */ f((s, e) => !(e.include.length && !e.include.some((r) => s?.includes(r)) || e.exclude.some((r) => s?.includes(r))),
1280
+ "isValidTest");
1277
1281
  async function bt({
1278
1282
  code: s,
1279
1283
  fileName: e,
@@ -1301,10 +1305,10 @@ async function bt({
1301
1305
  `
1302
1306
  ), S;
1303
1307
  }, "makeTitle")
1304
- }).parse(), p = l._ast, d = l._metaVariableName, m = l._metaNode, x = m.properties.find(
1305
- (_) => u.isObjectProperty(_) && u.isIdentifier(_.key) && _.key.name === "title"
1306
- ), b = u.stringLiteral(l._meta?.title || "unknown");
1307
- if (x ? u.isObjectProperty(x) && (x.value = b) : m.properties.push(u.objectProperty(u.identifier("title"), b)), !m || !l._meta)
1308
+ }).parse(), p = l._ast, d = l._metaVariableName, u = l._metaNode, x = u.properties.find(
1309
+ (_) => m.isObjectProperty(_) && m.isIdentifier(_.key) && _.key.name === "title"
1310
+ ), b = m.stringLiteral(l._meta?.title || "unknown");
1311
+ if (x ? m.isObjectProperty(x) && (x.value = b) : u.properties.push(m.objectProperty(m.identifier("title"), b)), !u || !l._meta)
1308
1312
  throw new Error(
1309
1313
  `The Storybook vitest plugin could not detect the meta (default export) object in the story file.
1310
1314
 
@@ -1324,55 +1328,55 @@ le an issue with details about your use case.`
1324
1328
  });
1325
1329
  let E = l._file.path.scope.generateUidIdentifier("test"), D = l._file.path.scope.generateUidIdentifier("describe");
1326
1330
  if (Object.keys(y).length === 0) {
1327
- let _ = u.expressionStatement(
1328
- u.callExpression(u.memberExpression(D, u.identifier("skip")), [
1329
- u.stringLiteral("No valid tests found")
1331
+ let _ = m.expressionStatement(
1332
+ m.callExpression(m.memberExpression(D, m.identifier("skip")), [
1333
+ m.stringLiteral("No valid tests found")
1330
1334
  ])
1331
1335
  );
1332
1336
  p.program.body.push(_);
1333
1337
  let S = [
1334
- u.importDeclaration(
1338
+ m.importDeclaration(
1335
1339
  [
1336
- u.importSpecifier(E, u.identifier("test")),
1337
- u.importSpecifier(D, u.identifier("describe"))
1340
+ m.importSpecifier(E, m.identifier("test")),
1341
+ m.importSpecifier(D, m.identifier("describe"))
1338
1342
  ],
1339
- u.stringLiteral("vitest")
1343
+ m.stringLiteral("vitest")
1340
1344
  )
1341
1345
  ];
1342
1346
  p.program.body.unshift(...S);
1343
1347
  } else {
1344
1348
  let ie = function() {
1345
- let j = l._file.path.scope.generateUidIdentifier("isRunningFromThisFile"), I = u.memberExpression(
1346
- u.callExpression(u.memberExpression(_, u.identifier("getState")), []),
1347
- u.identifier("testPath")
1348
- ), C = u.memberExpression(
1349
- u.memberExpression(u.identifier("globalThis"), u.identifier("__vitest_worker__")),
1350
- u.identifier("filepath")
1351
- ), T = u.logicalExpression(
1349
+ let j = l._file.path.scope.generateUidIdentifier("isRunningFromThisFile"), I = m.memberExpression(
1350
+ m.callExpression(m.memberExpression(_, m.identifier("getState")), []),
1351
+ m.identifier("testPath")
1352
+ ), C = m.memberExpression(
1353
+ m.memberExpression(m.identifier("globalThis"), m.identifier("__vitest_worker__")),
1354
+ m.identifier("filepath")
1355
+ ), T = m.logicalExpression(
1352
1356
  "??",
1353
1357
  // TODO: switch order of testPathProperty and filePathProperty when the bug is fixed
1354
1358
  // https://github.com/vitest-dev/vitest/issues/6367 (or probably just use testPathProperty)
1355
1359
  C,
1356
1360
  I
1357
- ), M = u.callExpression(
1358
- u.memberExpression(
1359
- u.callExpression(u.identifier("convertToFilePath"), [
1360
- u.memberExpression(
1361
- u.memberExpression(u.identifier("import"), u.identifier("meta")),
1362
- u.identifier("url")
1361
+ ), M = m.callExpression(
1362
+ m.memberExpression(
1363
+ m.callExpression(m.identifier("convertToFilePath"), [
1364
+ m.memberExpression(
1365
+ m.memberExpression(m.identifier("import"), m.identifier("meta")),
1366
+ m.identifier("url")
1363
1367
  )
1364
1368
  ]),
1365
- u.identifier("includes")
1369
+ m.identifier("includes")
1366
1370
  ),
1367
1371
  [T]
1368
1372
  );
1369
- return { isRunningFromThisFileDeclaration: u.variableDeclaration("const", [
1370
- u.variableDeclarator(j, M)
1373
+ return { isRunningFromThisFileDeclaration: m.variableDeclaration("const", [
1374
+ m.variableDeclarator(j, M)
1371
1375
  ]), isRunningFromThisFileId: j };
1372
1376
  };
1373
1377
  var ht = ie;
1374
1378
  f(ie, "getTestGuardDeclaration");
1375
- let _ = l._file.path.scope.generateUidIdentifier("expect"), S = l._file.path.scope.generateUidIdentifier("testStory"), De = u.identifier(
1379
+ let _ = l._file.path.scope.generateUidIdentifier("expect"), S = l._file.path.scope.generateUidIdentifier("testStory"), De = m.identifier(
1376
1380
  JSON.stringify(i.skip)), { isRunningFromThisFileDeclaration: Ie, isRunningFromThisFileId: Ne } = ie();
1377
1381
  p.program.body.push(Ie);
1378
1382
  let we = /* @__PURE__ */ f(({
@@ -1381,13 +1385,13 @@ le an issue with details about your use case.`
1381
1385
  testTitle: C,
1382
1386
  node: T
1383
1387
  }) => {
1384
- let M = u.expressionStatement(
1385
- u.callExpression(E, [
1386
- u.stringLiteral(C),
1387
- u.callExpression(S, [
1388
- u.stringLiteral(I),
1389
- u.identifier(j),
1390
- u.identifier(d),
1388
+ let M = m.expressionStatement(
1389
+ m.callExpression(E, [
1390
+ m.stringLiteral(C),
1391
+ m.callExpression(S, [
1392
+ m.stringLiteral(I),
1393
+ m.identifier(j),
1394
+ m.identifier(d),
1391
1395
  De
1392
1396
  ])
1393
1397
  ])
@@ -1405,27 +1409,27 @@ le an issue with details about your use case.`
1405
1409
  }
1406
1410
  let C = l._stories[j].localName ?? j, T = l._stories[j].name ?? j;
1407
1411
  return we({ testTitle: T, localName: C, exportName: j, node: I });
1408
- }).filter((j) => !!j), Ce = u.ifStatement(Ne, u.blockStatement(Fe));
1412
+ }).filter((j) => !!j), Ce = m.ifStatement(Ne, m.blockStatement(Fe));
1409
1413
  p.program.body.push(Ce);
1410
1414
  let Te = [
1411
- u.importDeclaration(
1415
+ m.importDeclaration(
1412
1416
  [
1413
- u.importSpecifier(E, u.identifier("test")),
1414
- u.importSpecifier(_, u.identifier("expect"))
1417
+ m.importSpecifier(E, m.identifier("test")),
1418
+ m.importSpecifier(_, m.identifier("expect"))
1415
1419
  ],
1416
- u.stringLiteral("vitest")
1420
+ m.stringLiteral("vitest")
1417
1421
  ),
1418
- u.importDeclaration(
1422
+ m.importDeclaration(
1419
1423
  [
1420
- u.importSpecifier(S, u.identifier("testStory")),
1421
- u.importSpecifier(u.identifier("convertToFilePath"), u.identifier("convertToFilePath"))
1424
+ m.importSpecifier(S, m.identifier("testStory")),
1425
+ m.importSpecifier(m.identifier("convertToFilePath"), m.identifier("convertToFilePath"))
1422
1426
  ],
1423
- u.stringLiteral("@storybook/addon-vitest/internal/test-utils")
1427
+ m.stringLiteral("@storybook/addon-vitest/internal/test-utils")
1424
1428
  )
1425
1429
  ];
1426
1430
  p.program.body.unshift(...Te);
1427
1431
  }
1428
- return ue(l, { sourceMaps: !0, sourceFileName: e }, s);
1432
+ return me(l, { sourceMaps: !0, sourceFileName: e }, s);
1429
1433
  }
1430
1434
  f(bt, "vitestTransform");
1431
1435
  export {
@@ -1435,26 +1439,26 @@ export {
1435
1439
  B as MixedFactoryError,
1436
1440
  K as MultipleMetaError,
1437
1441
  q as NoMetaError,
1438
- cr as babelParse,
1442
+ mr as babelParse,
1439
1443
  et as babelParseFile,
1440
- Kt as enrichCsf,
1441
- ut as enrichCsfMeta,
1444
+ Ht as enrichCsf,
1445
+ mt as enrichCsfMeta,
1442
1446
  dt as enrichCsfStory,
1443
1447
  Oe as extractDescription,
1444
- mt as extractSource,
1448
+ ut as extractSource,
1445
1449
  ot as formatConfig,
1446
- ue as formatCsf,
1447
- Wt as getStorySortParameter,
1448
- Lt as isCsfFactoryPreview,
1450
+ me as formatCsf,
1451
+ Xt as getStorySortParameter,
1452
+ Ut as isCsfFactoryPreview,
1449
1453
  Qe as isModuleMock,
1450
1454
  Ke as isValidPreviewPath,
1451
1455
  nt as loadConfig,
1452
1456
  Q as loadCsf,
1453
1457
  at as printConfig,
1454
1458
  tt as printCsf,
1455
- $t as readConfig,
1456
- Ft as readCsf,
1459
+ Lt as readConfig,
1460
+ Ct as readCsf,
1457
1461
  bt as vitestTransform,
1458
- Rt as writeConfig,
1459
- Ct as writeCsf
1462
+ Mt as writeConfig,
1463
+ Tt as writeCsf
1460
1464
  };
@@ -46569,12 +46569,14 @@ function fAe({
46569
46569
  width: t,
46570
46570
  height: r,
46571
46571
  onEscapeKeyDown: n,
46572
- onInteractOutside: o = /* @__PURE__ */ a((u) => u.preventDefault(), "onInteractOutside"),
46572
+ onInteractOutside: o = /* @__PURE__ */ a((c) => c.preventDefault(), "onInteractOutside"),
46573
46573
  className: i,
46574
46574
  container: s,
46575
- ...l
46575
+ portalSelector: l,
46576
+ ...u
46576
46577
  }) {
46577
- return /* @__PURE__ */ ql.default.createElement(S3, { ...l }, /* @__PURE__ */ ql.default.createElement(x3, { container: s }, /* @__PURE__ */ ql.default.
46578
+ let c = s ?? (l ? document.querySelector(l) : null) ?? document.body;
46579
+ return /* @__PURE__ */ ql.default.createElement(S3, { ...u }, /* @__PURE__ */ ql.default.createElement(x3, { container: c }, /* @__PURE__ */ ql.default.
46578
46580
  createElement(C3, { asChild: !0 }, /* @__PURE__ */ ql.default.createElement(O3, null)), /* @__PURE__ */ ql.default.createElement(
46579
46581
  _3,
46580
46582
  {
@@ -71469,7 +71471,7 @@ At();
71469
71471
  var j0e = k(Za(), 1), $n = k(q0e(), 1);
71470
71472
 
71471
71473
  // src/manager-api/version.ts
71472
- var D0e = "9.1.0-alpha.4";
71474
+ var D0e = "9.1.0-alpha.6";
71473
71475
 
71474
71476
  // src/manager-api/modules/versions.ts
71475
71477
  var { VERSIONCHECK: wdt } = te, F0e = (0, j0e.default)(1)(() => {