storybook 9.0.0-beta.5 → 9.0.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/bin/index.cjs +44 -44
  2. package/dist/bin/index.js +44 -44
  3. package/dist/builder-manager/index.cjs +15 -5
  4. package/dist/builder-manager/index.js +15 -4
  5. package/dist/cli/bin/index.cjs +1 -1
  6. package/dist/cli/bin/index.js +1 -1
  7. package/dist/cli/index.cjs +1 -1
  8. package/dist/cli/index.js +1 -1
  9. package/dist/client-logger/index.d.ts +2 -1
  10. package/dist/common/index.cjs +445 -445
  11. package/dist/common/index.d.ts +1 -1
  12. package/dist/common/index.js +424 -424
  13. package/dist/core-server/index.cjs +15 -11
  14. package/dist/core-server/index.d.ts +22 -22
  15. package/dist/core-server/index.js +15 -10
  16. package/dist/core-server/presets/common-manager.js +8 -8
  17. package/dist/core-server/presets/common-preset.cjs +4 -4
  18. package/dist/core-server/presets/common-preset.js +4 -4
  19. package/dist/manager/globals-runtime.js +9190 -9167
  20. package/dist/manager/runtime.js +1151 -1149
  21. package/dist/manager-api/index.cjs +1046 -1023
  22. package/dist/manager-api/index.d.ts +12 -1
  23. package/dist/manager-api/index.js +649 -626
  24. package/dist/preview/runtime.js +1832 -1832
  25. package/dist/preview-api/index.cjs +8 -8
  26. package/dist/preview-api/index.js +8 -8
  27. package/dist/test/index.d.ts +2 -6
  28. package/dist/test/index.js +2818 -2818
  29. package/dist/test/preview.cjs +648 -648
  30. package/dist/test/preview.js +837 -837
  31. package/dist/test/spy.cjs +112 -112
  32. package/dist/test/spy.d.ts +2 -6
  33. package/dist/test/spy.js +104 -104
  34. package/dist/types/index.cjs +4 -4
  35. package/dist/types/index.d.ts +2687 -2594
  36. package/package.json +7 -6
@@ -35702,7 +35702,8 @@ s(A2, "useStoriesJson");
35702
35702
 
35703
35703
  // src/core-server/utils/summarizeIndex.ts
35704
35704
  var S2 = require("storybook/internal/telemetry");
35705
- var Rj = /(page|screen)/i, Nj = /* @__PURE__ */ s((e) => Rj.test(e), "isPageStory"), Lj = /* @__PURE__ */ s((e) => [
35705
+ var Rj = /(page|screen)/i;
35706
+ var Nj = /* @__PURE__ */ s((e) => Rj.test(e), "isPageStory"), Lj = /* @__PURE__ */ s((e) => [
35706
35707
  "example-introduction--docs",
35707
35708
  "configure-your-project--docs",
35708
35709
  "example-button--docs",
@@ -35717,16 +35718,17 @@ var Rj = /(page|screen)/i, Nj = /* @__PURE__ */ s((e) => Rj.test(e), "isPageStor
35717
35718
  "example-page--logged-out"
35718
35719
  ].includes(e.id), "isCLIExampleEntry");
35719
35720
  function Tu(e) {
35720
- let t = 0, r = /* @__PURE__ */ new Set(), i = 0, n = 0, o = 0, a = 0, u = 0, l = 0, c = 0, p = 0;
35721
- Object.values(e.entries).forEach((f) => {
35722
- Lj(f) ? (f.type === "story" && (i += 1), f.type === "docs" && (a += 1)) : (0, S2.isExampleStoryId)(f.id) ? (f.type === "story" && (n += 1),
35723
- f.type === "docs" && (o += 1)) : f.type === "story" ? (t += 1, r.add(f.title), Nj(f.title) && (u += 1), f.tags?.includes(Iv) && (l += 1)) :
35724
- f.type === "docs" && (en(f) ? p += 1 : f.tags?.includes(Gn) && (c += 1));
35721
+ let t = 0, r = /* @__PURE__ */ new Set(), i = 0, n = 0, o = 0, a = 0, u = 0, l = 0, c = 0, p = 0, h = 0, f = 0;
35722
+ Object.values(e.entries).forEach((m) => {
35723
+ Lj(m) ? (m.type === "story" && (i += 1), m.type === "docs" && (a += 1)) : (0, S2.isExampleStoryId)(m.id) ? (m.type === "story" && (n += 1),
35724
+ m.type === "docs" && (o += 1)) : m.type === "story" ? (t += 1, r.add(m.title), Nj(m.title) && (u += 1), m.tags?.includes(Iv) && (l += 1),
35725
+ m.tags?.includes("svelte-csf-v4") ? h += 1 : m.tags?.includes("svelte-csf-v5") && (f += 1)) : m.type === "docs" && (en(m) ? p += 1 : m.tags?.
35726
+ includes(Gn) && (c += 1));
35725
35727
  });
35726
- let h = r.size;
35728
+ let d = r.size;
35727
35729
  return {
35728
35730
  storyCount: t,
35729
- componentCount: h,
35731
+ componentCount: d,
35730
35732
  pageStoryCount: u,
35731
35733
  playStoryCount: l,
35732
35734
  autodocsCount: c,
@@ -35735,6 +35737,8 @@ function Tu(e) {
35735
35737
  exampleDocsCount: a,
35736
35738
  onboardingStoryCount: n,
35737
35739
  onboardingDocsCount: o,
35740
+ svelteCsfV4Count: h,
35741
+ svelteCsfV5Count: f,
35738
35742
  version: e.v
35739
35743
  };
35740
35744
  }
@@ -35799,7 +35803,7 @@ js`), oi.logger.info("=> Loading presets");
35799
35803
  eC(d, e.outputDir, e.configDir)
35800
35804
  );
35801
35805
  let S = (0, or.join)(
35802
- (0, or.dirname)(require.resolve("storybook/package.json")),
35806
+ (0, or.dirname)(require.resolve("storybook/internal/package.json")),
35803
35807
  "assets/browser"
35804
35808
  );
35805
35809
  v.push((0, Bu.cp)(S, e.outputDir, { recursive: !0 }));
@@ -38045,8 +38049,8 @@ var PT = /* @__PURE__ */ s(async (e) => {
38045
38049
  // src/core-server/standalone.ts
38046
38050
  var OT = require("node:path");
38047
38051
  async function NG(e = {}, t = {}) {
38048
- let { mode: r = "dev" } = e, i = (0, OT.dirname)(require.resolve("storybook/package.json")), n = JSON.parse(require("fs").readFileSync(`${i}\
38049
- /package.json`)), o = {
38052
+ let { mode: r = "dev" } = e, i = (0, OT.dirname)(require.resolve("storybook/internal/package.json")), n = JSON.parse(require("fs").readFileSync(
38053
+ `${i}/package.json`)), o = {
38050
38054
  ...e,
38051
38055
  ...t,
38052
38056
  frameworkPresets: [
@@ -491,28 +491,6 @@ type StatusStoreByTypeId = StatusStore & {
491
491
  typeId: StatusTypeId;
492
492
  };
493
493
 
494
- declare global {
495
- interface SymbolConstructor {
496
- readonly observable: symbol;
497
- }
498
- }
499
-
500
- declare global {
501
- var globalProjectAnnotations: NormalizedProjectAnnotations<any>;
502
- var defaultProjectAnnotations: ProjectAnnotations<any>;
503
- }
504
- type WrappedStoryRef = {
505
- __pw_type: 'jsx' | 'importRef';
506
- };
507
- type UnwrappedJSXStoryRef = {
508
- __pw_type: 'jsx';
509
- type: UnwrappedImportStoryRef;
510
- };
511
- type UnwrappedImportStoryRef = ComposedStoryFn;
512
- declare global {
513
- function __pwUnwrapObject(storyRef: WrappedStoryRef): Promise<UnwrappedJSXStoryRef | UnwrappedImportStoryRef>;
514
- }
515
-
516
494
  type TestProviderState = 'test-provider-state:pending' | 'test-provider-state:running' | 'test-provider-state:succeeded' | 'test-provider-state:crashed';
517
495
  type TestProviderId = string;
518
496
  type TestProviderStateByProviderId = Record<TestProviderId, TestProviderState>;
@@ -705,6 +683,28 @@ type TestProviderStoreById = BaseTestProviderStore & {
705
683
  testProviderId: TestProviderId;
706
684
  };
707
685
 
686
+ declare global {
687
+ interface SymbolConstructor {
688
+ readonly observable: symbol;
689
+ }
690
+ }
691
+
692
+ declare global {
693
+ var globalProjectAnnotations: NormalizedProjectAnnotations<any>;
694
+ var defaultProjectAnnotations: ProjectAnnotations<any>;
695
+ }
696
+ type WrappedStoryRef = {
697
+ __pw_type: 'jsx' | 'importRef';
698
+ };
699
+ type UnwrappedJSXStoryRef = {
700
+ __pw_type: 'jsx';
701
+ type: UnwrappedImportStoryRef;
702
+ };
703
+ type UnwrappedImportStoryRef = ComposedStoryFn;
704
+ declare global {
705
+ function __pwUnwrapObject(storyRef: WrappedStoryRef): Promise<UnwrappedJSXStoryRef | UnwrappedImportStoryRef>;
706
+ }
707
+
708
708
  declare const fullStatusStore: StatusStore & {
709
709
  selectStatuses: (statuses: Status[]) => void;
710
710
  typeId: undefined;
@@ -35723,7 +35723,8 @@ s(_C, "useStoriesJson");
35723
35723
 
35724
35724
  // src/core-server/utils/summarizeIndex.ts
35725
35725
  import { isExampleStoryId as cj } from "storybook/internal/telemetry";
35726
- var pj = /(page|screen)/i, hj = /* @__PURE__ */ s((e) => pj.test(e), "isPageStory"), fj = /* @__PURE__ */ s((e) => [
35726
+ var pj = /(page|screen)/i;
35727
+ var hj = /* @__PURE__ */ s((e) => pj.test(e), "isPageStory"), fj = /* @__PURE__ */ s((e) => [
35727
35728
  "example-introduction--docs",
35728
35729
  "configure-your-project--docs",
35729
35730
  "example-button--docs",
@@ -35738,16 +35739,17 @@ var pj = /(page|screen)/i, hj = /* @__PURE__ */ s((e) => pj.test(e), "isPageStor
35738
35739
  "example-page--logged-out"
35739
35740
  ].includes(e.id), "isCLIExampleEntry");
35740
35741
  function uu(e) {
35741
- let t = 0, r = /* @__PURE__ */ new Set(), i = 0, n = 0, o = 0, a = 0, u = 0, l = 0, c = 0, p = 0;
35742
- Object.values(e.entries).forEach((f) => {
35743
- fj(f) ? (f.type === "story" && (i += 1), f.type === "docs" && (a += 1)) : cj(f.id) ? (f.type === "story" && (n += 1), f.type === "docs" &&
35744
- (o += 1)) : f.type === "story" ? (t += 1, r.add(f.title), hj(f.title) && (u += 1), f.tags?.includes($b) && (l += 1)) : f.type === "docs" &&
35745
- (Ui(f) ? p += 1 : f.tags?.includes(Nn) && (c += 1));
35742
+ let t = 0, r = /* @__PURE__ */ new Set(), i = 0, n = 0, o = 0, a = 0, u = 0, l = 0, c = 0, p = 0, h = 0, f = 0;
35743
+ Object.values(e.entries).forEach((m) => {
35744
+ fj(m) ? (m.type === "story" && (i += 1), m.type === "docs" && (a += 1)) : cj(m.id) ? (m.type === "story" && (n += 1), m.type === "docs" &&
35745
+ (o += 1)) : m.type === "story" ? (t += 1, r.add(m.title), hj(m.title) && (u += 1), m.tags?.includes($b) && (l += 1), m.tags?.includes("s\
35746
+ velte-csf-v4") ? h += 1 : m.tags?.includes("svelte-csf-v5") && (f += 1)) : m.type === "docs" && (Ui(m) ? p += 1 : m.tags?.includes(Nn) && (c +=
35747
+ 1));
35746
35748
  });
35747
- let h = r.size;
35749
+ let d = r.size;
35748
35750
  return {
35749
35751
  storyCount: t,
35750
- componentCount: h,
35752
+ componentCount: d,
35751
35753
  pageStoryCount: u,
35752
35754
  playStoryCount: l,
35753
35755
  autodocsCount: c,
@@ -35756,6 +35758,8 @@ function uu(e) {
35756
35758
  exampleDocsCount: a,
35757
35759
  onboardingStoryCount: n,
35758
35760
  onboardingDocsCount: o,
35761
+ svelteCsfV4Count: h,
35762
+ svelteCsfV5Count: f,
35759
35763
  version: e.v
35760
35764
  };
35761
35765
  }
@@ -35820,7 +35824,7 @@ async function IC(e) {
35820
35824
  cv(d, e.outputDir, e.configDir)
35821
35825
  );
35822
35826
  let S = lu(
35823
- Dj(H.resolve("storybook/package.json")),
35827
+ Dj(H.resolve("storybook/internal/package.json")),
35824
35828
  "assets/browser"
35825
35829
  );
35826
35830
  v.push(dj(S, e.outputDir, { recursive: !0 }));
@@ -38115,7 +38119,8 @@ var _X = /* @__PURE__ */ s(async (e) => {
38115
38119
  // src/core-server/standalone.ts
38116
38120
  import { dirname as kX } from "node:path";
38117
38121
  async function TX(e = {}, t = {}) {
38118
- let { mode: r = "dev" } = e, i = kX(H.resolve("storybook/package.json")), n = JSON.parse(H("fs").readFileSync(`${i}/package.json`)), o = {
38122
+ let { mode: r = "dev" } = e, i = kX(H.resolve("storybook/internal/package.json")), n = JSON.parse(H("fs").readFileSync(`${i}/package.json`)),
38123
+ o = {
38119
38124
  ...e,
38120
38125
  ...t,
38121
38126
  frameworkPresets: [
@@ -1694,7 +1694,7 @@ var wu = Z((Du, qa) => {
1694
1694
  });
1695
1695
  });
1696
1696
 
1697
- // ../node_modules/ansi-to-html/node_modules/entities/lib/maps/entities.json
1697
+ // ../node_modules/entities/lib/maps/entities.json
1698
1698
  var ws = Z((s4, xS) => {
1699
1699
  xS.exports = { Aacute: "\xC1", aacute: "\xE1", Abreve: "\u0102", abreve: "\u0103", ac: "\u223E", acd: "\u223F", acE: "\u223E\u0333", Acirc: "\
1700
1700
  \xC2", acirc: "\xE2", acute: "\xB4", Acy: "\u0410", acy: "\u0430", AElig: "\xC6", aelig: "\xE6", af: "\u2061", Afr: "\u{1D504}", afr: "\u{1D51E}",
@@ -1976,7 +1976,7 @@ var ws = Z((s4, xS) => {
1976
1976
  zwnj: "\u200C" };
1977
1977
  });
1978
1978
 
1979
- // ../node_modules/ansi-to-html/node_modules/entities/lib/maps/legacy.json
1979
+ // ../node_modules/entities/lib/maps/legacy.json
1980
1980
  var Zp = Z((i4, ES) => {
1981
1981
  ES.exports = { Aacute: "\xC1", aacute: "\xE1", Acirc: "\xC2", acirc: "\xE2", acute: "\xB4", AElig: "\xC6", aelig: "\xE6", Agrave: "\xC0", agrave: "\
1982
1982
  \xE0", amp: "&", AMP: "&", Aring: "\xC5", aring: "\xE5", Atilde: "\xC3", atilde: "\xE3", Auml: "\xC4", auml: "\xE4", brvbar: "\xA6", Ccedil: "\
@@ -1991,19 +1991,19 @@ var Zp = Z((i4, ES) => {
1991
1991
  Ugrave: "\xD9", ugrave: "\xF9", uml: "\xA8", Uuml: "\xDC", uuml: "\xFC", Yacute: "\xDD", yacute: "\xFD", yen: "\xA5", yuml: "\xFF" };
1992
1992
  });
1993
1993
 
1994
- // ../node_modules/ansi-to-html/node_modules/entities/lib/maps/xml.json
1994
+ // ../node_modules/entities/lib/maps/xml.json
1995
1995
  var Ts = Z((l4, CS) => {
1996
1996
  CS.exports = { amp: "&", apos: "'", gt: ">", lt: "<", quot: '"' };
1997
1997
  });
1998
1998
 
1999
- // ../node_modules/ansi-to-html/node_modules/entities/lib/maps/decode.json
1999
+ // ../node_modules/entities/lib/maps/decode.json
2000
2000
  var Qp = Z((c4, vS) => {
2001
2001
  vS.exports = { "0": 65533, "128": 8364, "130": 8218, "131": 402, "132": 8222, "133": 8230, "134": 8224, "135": 8225, "136": 710, "137": 8240,
2002
2002
  "138": 352, "139": 8249, "140": 338, "142": 381, "145": 8216, "146": 8217, "147": 8220, "148": 8221, "149": 8226, "150": 8211, "151": 8212,
2003
2003
  "152": 732, "153": 8482, "154": 353, "155": 8250, "156": 339, "158": 382, "159": 376 };
2004
2004
  });
2005
2005
 
2006
- // ../node_modules/ansi-to-html/node_modules/entities/lib/decode_codepoint.js
2006
+ // ../node_modules/entities/lib/decode_codepoint.js
2007
2007
  var td = Z((Kr) => {
2008
2008
  "use strict";
2009
2009
  var SS = Kr && Kr.__importDefault || function(e) {
@@ -2025,7 +2025,7 @@ var td = Z((Kr) => {
2025
2025
  Kr.default = DS;
2026
2026
  });
2027
2027
 
2028
- // ../node_modules/ansi-to-html/node_modules/entities/lib/decode.js
2028
+ // ../node_modules/entities/lib/decode.js
2029
2029
  var Os = Z((tt) => {
2030
2030
  "use strict";
2031
2031
  var vn = tt && tt.__importDefault || function(e) {
@@ -2069,7 +2069,7 @@ var Os = Z((tt) => {
2069
2069
  a(ad, "getReplacer");
2070
2070
  });
2071
2071
 
2072
- // ../node_modules/ansi-to-html/node_modules/entities/lib/encode.js
2072
+ // ../node_modules/entities/lib/encode.js
2073
2073
  var ks = Z((Ie) => {
2074
2074
  "use strict";
2075
2075
  var sd = Ie && Ie.__importDefault || function(e) {
@@ -2151,7 +2151,7 @@ var ks = Z((Ie) => {
2151
2151
  a(fd, "getASCIIEncoder");
2152
2152
  });
2153
2153
 
2154
- // ../node_modules/ansi-to-html/node_modules/entities/lib/index.js
2154
+ // ../node_modules/entities/lib/index.js
2155
2155
  var gd = Z(($) => {
2156
2156
  "use strict";
2157
2157
  Object.defineProperty($, "__esModule", { value: !0 });
@@ -9588,7 +9588,7 @@ n(Dh, "initFileSearchChannel");
9588
9588
  var ui = require("node:path");
9589
9589
  var Ih = [
9590
9590
  {
9591
- from: (0, ui.join)((0, ui.dirname)(require.resolve("storybook/package.json")), "assets", "browser"),
9591
+ from: (0, ui.join)((0, ui.dirname)(require.resolve("storybook/internal/package.json")), "assets", "browser"),
9592
9592
  to: "/sb-common-assets"
9593
9593
  }
9594
9594
  ];
@@ -9997,7 +9997,7 @@ n(jm, "initializeWhatsNew");
9997
9997
  // src/core-server/presets/common-preset.ts
9998
9998
  var $E = /* @__PURE__ */ n((t, e = {}) => Object.entries(e).reduce((r, [i, s]) => r.replace(new RegExp(`%${i}%`, "g"), s), t), "interpolate"),
9999
9999
  Lm = (0, pe.join)(
10000
- (0, pe.dirname)(require.resolve("storybook/package.json")),
10000
+ (0, pe.dirname)(require.resolve("storybook/internal/package.json")),
10001
10001
  "/assets/browser/favicon.svg"
10002
10002
  ), NE = /* @__PURE__ */ n(async (t = []) => [
10003
10003
  ...Ih,
@@ -10139,9 +10139,9 @@ presets: r }) => {
10139
10139
  "dev-only": { excludeFromDocsStories: !0 },
10140
10140
  "docs-only": { excludeFromSidebar: !0 },
10141
10141
  "test-only": { excludeFromSidebar: !0, excludeFromDocsStories: !0 }
10142
- }), "tags"), tP = /* @__PURE__ */ n(async (t, e) => [
10142
+ }), "tags"), tP = /* @__PURE__ */ n(async (t) => [
10143
10143
  (0, pe.join)(
10144
- (0, pe.dirname)(require.resolve("storybook/package.json")),
10144
+ (0, pe.dirname)(require.resolve("storybook/internal/package.json")),
10145
10145
  "dist/core-server/presets/common-manager.js"
10146
10146
  ),
10147
10147
  ...t || []
@@ -9624,7 +9624,7 @@ n(sh, "initFileSearchChannel");
9624
9624
  import { dirname as tv, join as rv } from "node:path";
9625
9625
  var nh = [
9626
9626
  {
9627
- from: rv(tv(k.resolve("storybook/package.json")), "assets", "browser"),
9627
+ from: rv(tv(k.resolve("storybook/internal/package.json")), "assets", "browser"),
9628
9628
  to: "/sb-common-assets"
9629
9629
  }
9630
9630
  ];
@@ -10056,7 +10056,7 @@ n(dm, "initializeWhatsNew");
10056
10056
  // src/core-server/presets/common-preset.ts
10057
10057
  var SP = /* @__PURE__ */ n((t, e = {}) => Object.entries(e).reduce((r, [i, s]) => r.replace(new RegExp(`%${i}%`, "g"), s), t), "interpolate"),
10058
10058
  mm = ir(
10059
- hi(k.resolve("storybook/package.json")),
10059
+ hi(k.resolve("storybook/internal/package.json")),
10060
10060
  "/assets/browser/favicon.svg"
10061
10061
  ), LD = /* @__PURE__ */ n(async (t = []) => [
10062
10062
  ...nh,
@@ -10197,9 +10197,9 @@ don")), { ...t, removeAddon: r };
10197
10197
  "dev-only": { excludeFromDocsStories: !0 },
10198
10198
  "docs-only": { excludeFromSidebar: !0 },
10199
10199
  "test-only": { excludeFromSidebar: !0, excludeFromDocsStories: !0 }
10200
- }), "tags"), sI = /* @__PURE__ */ n(async (t, e) => [
10200
+ }), "tags"), sI = /* @__PURE__ */ n(async (t) => [
10201
10201
  ir(
10202
- hi(k.resolve("storybook/package.json")),
10202
+ hi(k.resolve("storybook/internal/package.json")),
10203
10203
  "dist/core-server/presets/common-manager.js"
10204
10204
  ),
10205
10205
  ...t || []