storybook 9.1.0-alpha.8 → 9.1.0-beta.0

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 +66 -66
  2. package/dist/bin/index.js +65 -65
  3. package/dist/cli/bin/index.cjs +69 -69
  4. package/dist/cli/bin/index.js +61 -61
  5. package/dist/common/index.cjs +2097 -2097
  6. package/dist/common/index.js +3192 -3192
  7. package/dist/components/index.cjs +289 -290
  8. package/dist/components/index.js +2 -3
  9. package/dist/core-server/index.cjs +4 -1
  10. package/dist/core-server/index.js +4 -1
  11. package/dist/core-server/presets/common-manager.js +2243 -2228
  12. package/dist/core-server/presets/common-preset.cjs +85033 -5227
  13. package/dist/core-server/presets/common-preset.js +85104 -5288
  14. package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.cjs +28728 -0
  15. package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +28729 -0
  16. package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.cjs +29339 -0
  17. package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +29340 -0
  18. package/dist/csf/index.cjs +40 -41
  19. package/dist/csf/index.js +2 -3
  20. package/dist/instrumenter/index.cjs +370 -352
  21. package/dist/instrumenter/index.d.ts +24 -3
  22. package/dist/instrumenter/index.js +268 -250
  23. package/dist/manager/globals-module-info.cjs +1 -0
  24. package/dist/manager/globals-module-info.js +1 -0
  25. package/dist/manager/globals-runtime.js +836 -815
  26. package/dist/manager-api/index.cjs +1 -1
  27. package/dist/manager-api/index.js +1 -1
  28. package/dist/preview/runtime.js +4295 -4267
  29. package/dist/preview-api/index.cjs +43 -37
  30. package/dist/preview-api/index.d.ts +3 -1
  31. package/dist/preview-api/index.js +234 -227
  32. package/dist/telemetry/index.cjs +1748 -1658
  33. package/dist/telemetry/index.d.ts +2 -1
  34. package/dist/telemetry/index.js +1783 -1694
  35. package/dist/test/index.cjs +284 -280
  36. package/dist/test/index.d.ts +8 -1
  37. package/dist/test/index.js +5 -1
  38. package/package.json +14 -1
  39. package/templates/mocker-runtime.template.js +89 -0
@@ -416,11 +416,11 @@ var nt = O((Pt) => {
416
416
  t.argumentDescription(I)
417
417
  ));
418
418
  y.length > 0 && (h = h.concat(["Arguments:", l(y), ""]));
419
- let k = t.visibleOptions(e).map((I) => a(
419
+ let w = t.visibleOptions(e).map((I) => a(
420
420
  t.optionTerm(I),
421
421
  t.optionDescription(I)
422
422
  ));
423
- if (k.length > 0 && (h = h.concat(["Options:", l(k), ""])), this.showGlobalOptions) {
423
+ if (w.length > 0 && (h = h.concat(["Options:", l(w), ""])), this.showGlobalOptions) {
424
424
  let I = t.visibleGlobalOptions(e).map((W) => a(
425
425
  t.optionTerm(W),
426
426
  t.optionDescription(W)
@@ -471,9 +471,9 @@ var nt = O((Pt) => {
471
471
  if (a < i) return e;
472
472
  let l = e.slice(0, r), h = e.slice(r).replace(`\r
473
473
  `, `
474
- `), p = " ".repeat(r), k = "\\s\u200B", S = new RegExp(
474
+ `), p = " ".repeat(r), w = "\\s\u200B", S = new RegExp(
475
475
  `
476
- |.{1,${a - 1}}([${k}]|$)|[^${k}]+?([${k}]|$)`,
476
+ |.{1,${a - 1}}([${w}]|$)|[^${w}]+?([${w}]|$)`,
477
477
  "g"
478
478
  ), I = h.match(S) || [];
479
479
  return l + I.map((W, Xe) => W === `
@@ -1478,13 +1478,13 @@ Expecting one of '${r.join("', '")}'`);
1478
1478
  t = t.slice();
1479
1479
  let r = !1, i = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
1480
1480
  function n(p, y) {
1481
- let k = L.resolve(p, y);
1482
- if (lt.existsSync(k)) return k;
1481
+ let w = L.resolve(p, y);
1482
+ if (lt.existsSync(w)) return w;
1483
1483
  if (i.includes(L.extname(y))) return;
1484
1484
  let S = i.find(
1485
- (I) => lt.existsSync(`${k}${I}`)
1485
+ (I) => lt.existsSync(`${w}${I}`)
1486
1486
  );
1487
- if (S) return `${k}${S}`;
1487
+ if (S) return `${w}${S}`;
1488
1488
  }
1489
1489
  d(n, "findFile"), this._checkForMissingMandatoryOptions(), this._checkForConflictingOptions();
1490
1490
  let o = e._executableFile || `${this._name}-${e._name}`, a = this._executableDir || "";
@@ -1535,12 +1535,12 @@ Expecting one of '${r.join("', '")}'`);
1535
1535
  }), l.on("error", (p) => {
1536
1536
  if (p.code === "ENOENT") {
1537
1537
  let y = a ? `searched for local subcommand relative to directory '${a}'` : "no directory for search for local subcommand, use .exe\
1538
- cutableDir() to supply a custom directory", k = `'${o}' does not exist
1538
+ cutableDir() to supply a custom directory", w = `'${o}' does not exist
1539
1539
  - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\
1540
1540
 
1541
1541
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
1542
1542
  - ${y}`;
1543
- throw new Error(k);
1543
+ throw new Error(w);
1544
1544
  } else if (p.code === "EACCES")
1545
1545
  throw new Error(`'${o}' not executable`);
1546
1546
  if (!h)
@@ -2415,8 +2415,8 @@ var vt = O((Ee) => {
2415
2415
  var i = r.reduce(function(a, l) {
2416
2416
  var h = l.match(/\n([\t ]+|(?!\s).)/g);
2417
2417
  return h ? a.concat(h.map(function(p) {
2418
- var y, k;
2419
- return (k = (y = p.match(/[\t ]/g)) === null || y === void 0 ? void 0 : y.length) !== null && k !== void 0 ? k : 0;
2418
+ var y, w;
2419
+ return (w = (y = p.match(/[\t ]/g)) === null || y === void 0 ? void 0 : y.length) !== null && w !== void 0 ? w : 0;
2420
2420
  })) : a;
2421
2421
  }, []);
2422
2422
  if (i.length) {
@@ -2433,8 +2433,8 @@ var vt = O((Ee) => {
2433
2433
  var h = o.match(/(?:^|\n)( *)$/), p = h ? h[1] : "", y = a;
2434
2434
  typeof a == "string" && a.includes(`
2435
2435
  `) && (y = String(a).split(`
2436
- `).map(function(k, S) {
2437
- return S === 0 ? k : "" + p + k;
2436
+ `).map(function(w, S) {
2437
+ return S === 0 ? w : "" + p + w;
2438
2438
  }).join(`
2439
2439
  `)), o += y + r[l + 1];
2440
2440
  }), o;
@@ -2445,11 +2445,11 @@ var vt = O((Ee) => {
2445
2445
  });
2446
2446
 
2447
2447
  // ../node_modules/zod/lib/helpers/util.js
2448
- var Ae = O((w) => {
2448
+ var Ae = O((k) => {
2449
2449
  "use strict";
2450
- Object.defineProperty(w, "__esModule", { value: !0 });
2451
- w.getParsedType = w.ZodParsedType = w.objectUtil = w.util = void 0;
2452
- var wt;
2450
+ Object.defineProperty(k, "__esModule", { value: !0 });
2451
+ k.getParsedType = k.ZodParsedType = k.objectUtil = k.util = void 0;
2452
+ var kt;
2453
2453
  (function(s) {
2454
2454
  s.assertEqual = (i) => i;
2455
2455
  function e(i) {
@@ -2485,7 +2485,7 @@ var Ae = O((w) => {
2485
2485
  return i.map((o) => typeof o == "string" ? `'${o}'` : o).join(n);
2486
2486
  }
2487
2487
  d(r, "joinValues"), s.joinValues = r, s.jsonStringifyReplacer = (i, n) => typeof n == "bigint" ? n.toString() : n;
2488
- })(wt || (w.util = wt = {}));
2488
+ })(kt || (k.util = kt = {}));
2489
2489
  var sr;
2490
2490
  (function(s) {
2491
2491
  s.mergeShapes = (e, t) => ({
@@ -2493,8 +2493,8 @@ var Ae = O((w) => {
2493
2493
  ...t
2494
2494
  // second overwrites first
2495
2495
  });
2496
- })(sr || (w.objectUtil = sr = {}));
2497
- w.ZodParsedType = wt.arrayToEnum([
2496
+ })(sr || (k.objectUtil = sr = {}));
2497
+ k.ZodParsedType = kt.arrayToEnum([
2498
2498
  "string",
2499
2499
  "nan",
2500
2500
  "number",
@@ -2519,28 +2519,28 @@ var Ae = O((w) => {
2519
2519
  var vs = /* @__PURE__ */ d((s) => {
2520
2520
  switch (typeof s) {
2521
2521
  case "undefined":
2522
- return w.ZodParsedType.undefined;
2522
+ return k.ZodParsedType.undefined;
2523
2523
  case "string":
2524
- return w.ZodParsedType.string;
2524
+ return k.ZodParsedType.string;
2525
2525
  case "number":
2526
- return isNaN(s) ? w.ZodParsedType.nan : w.ZodParsedType.number;
2526
+ return isNaN(s) ? k.ZodParsedType.nan : k.ZodParsedType.number;
2527
2527
  case "boolean":
2528
- return w.ZodParsedType.boolean;
2528
+ return k.ZodParsedType.boolean;
2529
2529
  case "function":
2530
- return w.ZodParsedType.function;
2530
+ return k.ZodParsedType.function;
2531
2531
  case "bigint":
2532
- return w.ZodParsedType.bigint;
2532
+ return k.ZodParsedType.bigint;
2533
2533
  case "symbol":
2534
- return w.ZodParsedType.symbol;
2534
+ return k.ZodParsedType.symbol;
2535
2535
  case "object":
2536
- return Array.isArray(s) ? w.ZodParsedType.array : s === null ? w.ZodParsedType.null : s.then && typeof s.then == "function" && s.catch &&
2537
- typeof s.catch == "function" ? w.ZodParsedType.promise : typeof Map < "u" && s instanceof Map ? w.ZodParsedType.map : typeof Set < "\
2538
- u" && s instanceof Set ? w.ZodParsedType.set : typeof Date < "u" && s instanceof Date ? w.ZodParsedType.date : w.ZodParsedType.object;
2536
+ return Array.isArray(s) ? k.ZodParsedType.array : s === null ? k.ZodParsedType.null : s.then && typeof s.then == "function" && s.catch &&
2537
+ typeof s.catch == "function" ? k.ZodParsedType.promise : typeof Map < "u" && s instanceof Map ? k.ZodParsedType.map : typeof Set < "\
2538
+ u" && s instanceof Set ? k.ZodParsedType.set : typeof Date < "u" && s instanceof Date ? k.ZodParsedType.date : k.ZodParsedType.object;
2539
2539
  default:
2540
- return w.ZodParsedType.unknown;
2540
+ return k.ZodParsedType.unknown;
2541
2541
  }
2542
2542
  }, "getParsedType");
2543
- w.getParsedType = vs;
2543
+ k.getParsedType = vs;
2544
2544
  });
2545
2545
 
2546
2546
  // ../node_modules/zod/lib/ZodError.js
@@ -2637,10 +2637,10 @@ var Ue = O((K) => {
2637
2637
  });
2638
2638
 
2639
2639
  // ../node_modules/zod/lib/locales/en.js
2640
- var Ct = O((kt) => {
2640
+ var Ct = O((wt) => {
2641
2641
  "use strict";
2642
- Object.defineProperty(kt, "__esModule", { value: !0 });
2643
- var X = Ae(), T = Ue(), ws = /* @__PURE__ */ d((s, e) => {
2642
+ Object.defineProperty(wt, "__esModule", { value: !0 });
2643
+ var X = Ae(), T = Ue(), ks = /* @__PURE__ */ d((s, e) => {
2644
2644
  let t;
2645
2645
  switch (s.code) {
2646
2646
  case T.ZodIssueCode.invalid_type:
@@ -2709,18 +2709,18 @@ ater than "}${new Date(Number(s.minimum))}` : t = "Invalid input";
2709
2709
  }
2710
2710
  return { message: t };
2711
2711
  }, "errorMap");
2712
- kt.default = ws;
2712
+ wt.default = ks;
2713
2713
  });
2714
2714
 
2715
2715
  // ../node_modules/zod/lib/errors.js
2716
2716
  var Fe = O((D) => {
2717
2717
  "use strict";
2718
- var ks = D && D.__importDefault || function(s) {
2718
+ var ws = D && D.__importDefault || function(s) {
2719
2719
  return s && s.__esModule ? s : { default: s };
2720
2720
  };
2721
2721
  Object.defineProperty(D, "__esModule", { value: !0 });
2722
2722
  D.getErrorMap = D.setErrorMap = D.defaultErrorMap = void 0;
2723
- var nr = ks(Ct());
2723
+ var nr = ws(Ct());
2724
2724
  D.defaultErrorMap = nr.default;
2725
2725
  var or = nr.default;
2726
2726
  function Cs(s) {
@@ -4329,10 +4329,10 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
4329
4329
  return i.common.async ? Promise.resolve().then(async () => {
4330
4330
  let h = [];
4331
4331
  for (let p of l) {
4332
- let y = await p.key, k = await p.value;
4332
+ let y = await p.key, w = await p.value;
4333
4333
  h.push({
4334
4334
  key: y,
4335
- value: k,
4335
+ value: w,
4336
4336
  alwaysSet: p.alwaysSet
4337
4337
  });
4338
4338
  }
@@ -4921,7 +4921,7 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
4921
4921
  typeName: _.ZodMap,
4922
4922
  ...b(t)
4923
4923
  });
4924
- var we = class s extends v {
4924
+ var ke = class s extends v {
4925
4925
  static {
4926
4926
  d(this, "ZodSet");
4927
4927
  }
@@ -4982,8 +4982,8 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
4982
4982
  return this.min(1, e);
4983
4983
  }
4984
4984
  };
4985
- c.ZodSet = we;
4986
- we.create = (s, e) => new we({
4985
+ c.ZodSet = ke;
4986
+ ke.create = (s, e) => new ke({
4987
4987
  valueType: s,
4988
4988
  minSize: null,
4989
4989
  maxSize: null,
@@ -5477,7 +5477,7 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
5477
5477
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
5478
5478
  ...b(e)
5479
5479
  });
5480
- var ke = class extends v {
5480
+ var we = class extends v {
5481
5481
  static {
5482
5482
  d(this, "ZodNaN");
5483
5483
  }
@@ -5493,8 +5493,8 @@ onent})+$", Tt, Bs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.
5493
5493
  return { status: "valid", value: e.data };
5494
5494
  }
5495
5495
  };
5496
- c.ZodNaN = ke;
5497
- ke.create = (s) => new ke({
5496
+ c.ZodNaN = we;
5497
+ we.create = (s) => new we({
5498
5498
  typeName: _.ZodNaN,
5499
5499
  ...b(s)
5500
5500
  });
@@ -5593,8 +5593,8 @@ eze");
5593
5593
  return a.then((l) => {
5594
5594
  var h, p;
5595
5595
  if (!l) {
5596
- let y = pr(e, r), k = (p = (h = y.fatal) !== null && h !== void 0 ? h : t) !== null && p !== void 0 ? p : !0;
5597
- i.addIssue({ code: "custom", ...y, fatal: k });
5596
+ let y = pr(e, r), w = (p = (h = y.fatal) !== null && h !== void 0 ? h : t) !== null && p !== void 0 ? p : !0;
5597
+ i.addIssue({ code: "custom", ...y, fatal: w });
5598
5598
  }
5599
5599
  });
5600
5600
  if (!a) {
@@ -5627,12 +5627,12 @@ adonly";
5627
5627
  c.string = vr;
5628
5628
  var xr = Q.create;
5629
5629
  c.number = xr;
5630
- var ii = ke.create;
5630
+ var ii = we.create;
5631
5631
  c.nan = ii;
5632
5632
  var ni = ee.create;
5633
5633
  c.bigint = ni;
5634
- var wr = te.create;
5635
- c.boolean = wr;
5634
+ var kr = te.create;
5635
+ c.boolean = kr;
5636
5636
  var oi = re.create;
5637
5637
  c.date = oi;
5638
5638
  var ai = be.create;
@@ -5665,10 +5665,10 @@ adonly";
5665
5665
  c.tuple = vi;
5666
5666
  var xi = Ke.create;
5667
5667
  c.record = xi;
5668
- var wi = xe.create;
5669
- c.map = wi;
5670
- var ki = we.create;
5671
- c.set = ki;
5668
+ var ki = xe.create;
5669
+ c.map = ki;
5670
+ var wi = ke.create;
5671
+ c.set = wi;
5672
5672
  var Ci = ze.create;
5673
5673
  c.function = Ci;
5674
5674
  var Ii = ae.create;
@@ -5681,9 +5681,9 @@ adonly";
5681
5681
  c.nativeEnum = Ei;
5682
5682
  var Ai = J.create;
5683
5683
  c.promise = Ai;
5684
- var kr = j.create;
5685
- c.effect = kr;
5686
- c.transformer = kr;
5684
+ var wr = j.create;
5685
+ c.effect = wr;
5686
+ c.transformer = wr;
5687
5687
  var Si = Z.create;
5688
5688
  c.optional = Si;
5689
5689
  var ji = M.create;
@@ -5696,7 +5696,7 @@ adonly";
5696
5696
  c.ostring = Pi;
5697
5697
  var Ni = /* @__PURE__ */ d(() => xr().optional(), "onumber");
5698
5698
  c.onumber = Ni;
5699
- var Vi = /* @__PURE__ */ d(() => wr().optional(), "oboolean");
5699
+ var Vi = /* @__PURE__ */ d(() => kr().optional(), "oboolean");
5700
5700
  c.oboolean = Vi;
5701
5701
  c.coerce = {
5702
5702
  string: /* @__PURE__ */ d((s) => z.create({ ...s, coerce: !0 }), "string"),
@@ -5847,7 +5847,7 @@ function H(s, e) {
5847
5847
  d(H, "invariant");
5848
5848
 
5849
5849
  // package.json
5850
- var bt = "9.1.0-alpha.8";
5850
+ var bt = "9.1.0-beta.0";
5851
5851
 
5852
5852
  // src/cli/build.ts
5853
5853
  import { cache as cs } from "storybook/internal/common";