storybook 9.0.0-alpha.12 → 9.0.0-alpha.14

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 (89) hide show
  1. package/assets/docs/addon-backgrounds.gif +0 -0
  2. package/assets/docs/highlight.png +0 -0
  3. package/dist/actions/decorator.js +46 -47
  4. package/dist/actions/index.cjs +28 -29
  5. package/dist/actions/index.d.ts +0 -3
  6. package/dist/actions/index.js +27 -28
  7. package/dist/actions/preview.cjs +22 -23
  8. package/dist/actions/preview.js +18 -19
  9. package/dist/backgrounds/index.cjs +148 -0
  10. package/dist/backgrounds/index.d.ts +91 -0
  11. package/dist/backgrounds/index.js +130 -0
  12. package/dist/backgrounds/preview.cjs +143 -0
  13. package/dist/backgrounds/preview.d.ts +54 -0
  14. package/dist/backgrounds/preview.js +127 -0
  15. package/dist/bin/index.cjs +62 -73
  16. package/dist/bin/index.js +57 -68
  17. package/dist/builder-manager/index.cjs +390 -380
  18. package/dist/builder-manager/index.js +489 -479
  19. package/dist/channels/index.cjs +1018 -948
  20. package/dist/channels/index.js +1194 -1161
  21. package/dist/cli/bin/index.cjs +225 -225
  22. package/dist/cli/bin/index.js +234 -234
  23. package/dist/cli/index.cjs +1860 -1873
  24. package/dist/cli/index.js +308 -321
  25. package/dist/common/index.cjs +2396 -2380
  26. package/dist/common/index.d.ts +0 -11
  27. package/dist/common/index.js +2604 -2588
  28. package/dist/components/index.cjs +6393 -12704
  29. package/dist/components/index.d.ts +1 -2
  30. package/dist/components/index.js +4665 -10778
  31. package/dist/core-events/index.cjs +72 -84
  32. package/dist/core-events/index.d.ts +2 -77
  33. package/dist/core-events/index.js +61 -73
  34. package/dist/core-server/index.cjs +13484 -13318
  35. package/dist/core-server/index.js +13652 -13486
  36. package/dist/core-server/presets/common-manager.js +9815 -12
  37. package/dist/core-server/presets/common-preset.cjs +2809 -3005
  38. package/dist/core-server/presets/common-preset.js +2891 -3087
  39. package/dist/docs-tools/index.cjs +626 -600
  40. package/dist/docs-tools/index.js +613 -587
  41. package/dist/highlight/index.cjs +27 -0
  42. package/dist/highlight/index.d.ts +17 -0
  43. package/dist/highlight/index.js +7 -0
  44. package/dist/highlight/preview.cjs +81 -0
  45. package/dist/highlight/preview.d.ts +54 -0
  46. package/dist/highlight/preview.js +67 -0
  47. package/dist/instrumenter/index.cjs +70 -60
  48. package/dist/instrumenter/index.d.ts +8 -7
  49. package/dist/instrumenter/index.js +98 -88
  50. package/dist/manager/globals-module-info.cjs +12 -22
  51. package/dist/manager/globals-module-info.js +2 -12
  52. package/dist/manager/globals-runtime.js +31295 -33999
  53. package/dist/manager/runtime.js +3419 -3522
  54. package/dist/manager-api/index.cjs +2521 -2445
  55. package/dist/manager-api/index.d.ts +7 -21
  56. package/dist/manager-api/index.js +2431 -2349
  57. package/dist/measure/index.cjs +474 -0
  58. package/dist/measure/index.d.ts +66 -0
  59. package/dist/measure/index.js +462 -0
  60. package/dist/measure/preview.cjs +464 -0
  61. package/dist/measure/preview.d.ts +59 -0
  62. package/dist/measure/preview.js +448 -0
  63. package/dist/outline/index.cjs +528 -0
  64. package/dist/outline/index.d.ts +66 -0
  65. package/dist/outline/index.js +500 -0
  66. package/dist/outline/preview.cjs +518 -0
  67. package/dist/outline/preview.d.ts +59 -0
  68. package/dist/outline/preview.js +486 -0
  69. package/dist/preview/runtime.js +20735 -17220
  70. package/dist/preview-api/index.cjs +1069 -1057
  71. package/dist/preview-api/index.d.ts +384 -157
  72. package/dist/preview-api/index.js +1123 -1109
  73. package/dist/server-errors.cjs +66 -67
  74. package/dist/server-errors.d.ts +0 -1
  75. package/dist/server-errors.js +68 -69
  76. package/dist/test/index.cjs +1547 -1546
  77. package/dist/test/index.js +2308 -2307
  78. package/dist/test/preview.cjs +1906 -1905
  79. package/dist/test/preview.js +1439 -1438
  80. package/dist/test/spy.cjs +65 -64
  81. package/dist/test/spy.js +59 -58
  82. package/dist/types/index.cjs +10 -10
  83. package/dist/types/index.d.ts +203 -243
  84. package/package.json +122 -17
  85. package/dist/actions/manager.js +0 -1195
  86. package/dist/component-testing/manager.js +0 -3126
  87. package/dist/controls/manager.js +0 -5593
  88. package/dist/viewport/manager.js +0 -400
  89. /package/dist/{component-testing/manager.css → core-server/presets/common-manager.css} +0 -0
package/dist/test/spy.cjs CHANGED
@@ -1,34 +1,34 @@
1
1
  "use strict";
2
2
  var v = Object.defineProperty;
3
- var _ = Object.getOwnPropertyDescriptor;
4
- var N = Object.getOwnPropertyNames;
5
- var K = Object.prototype.hasOwnProperty;
3
+ var L = Object.getOwnPropertyDescriptor;
4
+ var Y = Object.getOwnPropertyNames;
5
+ var N = Object.prototype.hasOwnProperty;
6
6
  var n = (t, e) => v(t, "name", { value: e, configurable: !0 });
7
- var U = (t, e) => {
7
+ var K = (t, e) => {
8
8
  for (var r in e)
9
9
  v(t, r, { get: e[r], enumerable: !0 });
10
- }, W = (t, e, r, l) => {
10
+ }, B = (t, e, r, l) => {
11
11
  if (e && typeof e == "object" || typeof e == "function")
12
- for (let o of N(e))
13
- !K.call(t, o) && o !== r && v(t, o, { get: () => e[o], enumerable: !(l = _(e, o)) || l.enumerable });
12
+ for (let o of Y(e))
13
+ !N.call(t, o) && o !== r && v(t, o, { get: () => e[o], enumerable: !(l = L(e, o)) || l.enumerable });
14
14
  return t;
15
15
  };
16
- var Y = (t) => W(v({}, "__esModule", { value: !0 }), t);
16
+ var U = (t) => B(v({}, "__esModule", { value: !0 }), t);
17
17
 
18
18
  // src/test/spy.ts
19
19
  var oe = {};
20
- U(oe, {
20
+ K(oe, {
21
21
  clearAllMocks: () => Z,
22
22
  fn: () => X,
23
- isMockFunction: () => E,
23
+ isMockFunction: () => j,
24
24
  mocked: () => ne,
25
- mocks: () => T,
25
+ mocks: () => h,
26
26
  onMockCall: () => J,
27
27
  resetAllMocks: () => ee,
28
28
  restoreAllMocks: () => te,
29
29
  spyOn: () => Q
30
30
  });
31
- module.exports = Y(oe);
31
+ module.exports = U(oe);
32
32
 
33
33
  // ../node_modules/tinyspy/dist/index.js
34
34
  function O(t, e) {
@@ -40,29 +40,29 @@ function g(t, e) {
40
40
  return typeof e === t;
41
41
  }
42
42
  n(g, "y");
43
- function $(t) {
43
+ function W(t) {
44
44
  return t instanceof Promise;
45
45
  }
46
- n($, "w");
47
- function w(t, e, r) {
46
+ n(W, "w");
47
+ function S(t, e, r) {
48
48
  Object.defineProperty(t, e, r);
49
49
  }
50
- n(w, "f");
50
+ n(S, "f");
51
51
  function M(t, e, r) {
52
52
  Object.defineProperty(t, e, { value: r });
53
53
  }
54
54
  n(M, "l");
55
- var x = Symbol.for("tinyspy:spy"), q = /* @__PURE__ */ new Set(), z = /* @__PURE__ */ n((t) => {
55
+ var x = Symbol.for("tinyspy:spy"), $ = /* @__PURE__ */ new Set(), q = /* @__PURE__ */ n((t) => {
56
56
  t.called = !1, t.callCount = 0, t.calls = [], t.results = [], t.resolves = [], t.next = [];
57
- }, "P"), B = /* @__PURE__ */ n((t) => (w(t, x, { value: { reset: /* @__PURE__ */ n(() => z(t[x]), "reset") } }), t[x]), "K"), h = /* @__PURE__ */ n(
58
- (t) => t[x] || B(t), "T");
57
+ }, "P"), z = /* @__PURE__ */ n((t) => (S(t, x, { value: { reset: /* @__PURE__ */ n(() => q(t[x]), "reset") } }), t[x]), "K"), T = /* @__PURE__ */ n(
58
+ (t) => t[x] || z(t), "T");
59
59
  function G(t) {
60
60
  O(
61
61
  g("function", t) || g("undefined", t),
62
62
  "cannot spy on a non-function value"
63
63
  );
64
64
  let e = /* @__PURE__ */ n(function(...l) {
65
- let o = h(e);
65
+ let o = T(e);
66
66
  o.called = !0, o.callCount++, o.calls.push(l);
67
67
  let p = o.next.shift();
68
68
  if (p) {
@@ -80,20 +80,20 @@ function G(t) {
80
80
  throw c = i, y = "error", o.results.push([y, i]), i;
81
81
  }
82
82
  let m = [y, c];
83
- return $(c) && c.then(
83
+ return W(c) && c.then(
84
84
  (i) => o.resolves[a] = ["ok", i],
85
85
  (i) => o.resolves[a] = ["error", i]
86
86
  ), o.results.push(m), c;
87
87
  }, "t");
88
88
  M(e, "_isMockFunction", !0), M(e, "length", t ? t.length : 0), M(e, "name", t && t.name || "spy");
89
- let r = h(e);
89
+ let r = T(e);
90
90
  return r.reset(), r.impl = t, e;
91
91
  }
92
92
  n(G, "m");
93
- var C = /* @__PURE__ */ n((t, e) => Object.getOwnPropertyDescriptor(t, e), "k"), j = /* @__PURE__ */ n((t, e) => {
93
+ var C = /* @__PURE__ */ n((t, e) => Object.getOwnPropertyDescriptor(t, e), "k"), _ = /* @__PURE__ */ n((t, e) => {
94
94
  e != null && typeof e == "function" && e.prototype != null && Object.setPrototypeOf(t.prototype, e.prototype);
95
95
  }, "O");
96
- function R(t, e, r) {
96
+ function w(t, e, r) {
97
97
  O(
98
98
  !g("undefined", t),
99
99
  "spyOn could not find an object to spy upon"
@@ -121,39 +121,39 @@ function R(t, e, r) {
121
121
  let i;
122
122
  a ? i = a[o] : o !== "value" ? i = /* @__PURE__ */ n(() => t[l], "o") : i = t[l];
123
123
  let f = /* @__PURE__ */ n((k) => {
124
- let { value: b, ...d } = a || {
124
+ let { value: R, ...d } = a || {
125
125
  configurable: !0,
126
126
  writable: !0
127
127
  };
128
- o !== "value" && delete d.writable, d[o] = k, w(t, l, d);
129
- }, "g"), I = /* @__PURE__ */ n(() => a ? w(t, l, a) : f(i), "b");
128
+ o !== "value" && delete d.writable, d[o] = k, S(t, l, d);
129
+ }, "g"), b = /* @__PURE__ */ n(() => a ? S(t, l, a) : f(i), "b");
130
130
  r || (r = i);
131
131
  let s = G(r);
132
- o === "value" && j(s, i);
132
+ o === "value" && _(s, i);
133
133
  let u = s[x];
134
- return M(u, "restore", I), M(u, "getOriginal", () => m ? i() : i), M(u, "willCall", (k) => (u.impl = k, s)), f(
135
- m ? () => (j(s, r), s) : s
136
- ), q.add(s), s;
134
+ return M(u, "restore", b), M(u, "getOriginal", () => m ? i() : i), M(u, "willCall", (k) => (u.impl = k, s)), f(
135
+ m ? () => (_(s, r), s) : s
136
+ ), $.add(s), s;
137
137
  }
138
- n(R, "C");
138
+ n(w, "C");
139
139
 
140
140
  // ../node_modules/@vitest/spy/dist/index.js
141
- var T = /* @__PURE__ */ new Set();
142
- function E(t) {
141
+ var h = /* @__PURE__ */ new Set();
142
+ function j(t) {
143
143
  return typeof t == "function" && "_isMockFunction" in t && t._isMockFunction;
144
144
  }
145
- n(E, "isMockFunction");
146
- function V(t, e, r) {
145
+ n(j, "isMockFunction");
146
+ function A(t, e, r) {
147
147
  let o = r ? { [{
148
148
  get: "getter",
149
149
  set: "setter"
150
- }[r]]: e } : e, p = R(t, o);
151
- return D(p);
150
+ }[r]]: e } : e, p = w(t, o);
151
+ return V(p);
152
152
  }
153
- n(V, "spyOn");
153
+ n(A, "spyOn");
154
154
  var H = 0;
155
- function D(t) {
156
- let e = t, r, l = [], o = [], p = [], c = h(t), y = {
155
+ function V(t) {
156
+ let e = t, r, l = [], o = [], p = [], c = T(t), y = {
157
157
  get calls() {
158
158
  return c.calls;
159
159
  },
@@ -185,26 +185,26 @@ function D(t) {
185
185
  e.getMockName = () => f || "vi.fn()", e.mockName = (s) => (f = s, e), e.mockClear = () => (c.reset(), l = [], o = [], p = [], e), e.mockReset =
186
186
  () => (e.mockClear(), r = void 0, a = [], e), e.mockRestore = () => (e.mockReset(), c.restore(), e), e.getMockImplementation = () => m ? r :
187
187
  a.at(0) || r, e.mockImplementation = (s) => (r = s, c.willCall(i), e), e.mockImplementationOnce = (s) => (a.push(s), e);
188
- function I(s, u) {
188
+ function b(s, u) {
189
189
  let k = r;
190
190
  r = s, c.willCall(i), m = !0;
191
- let b = /* @__PURE__ */ n(() => {
191
+ let R = /* @__PURE__ */ n(() => {
192
192
  r = k, m = !1;
193
193
  }, "reset"), d = u();
194
- return d instanceof Promise ? d.then(() => (b(), e)) : (b(), e);
194
+ return d instanceof Promise ? d.then(() => (R(), e)) : (R(), e);
195
195
  }
196
- return n(I, "withImplementation"), e.withImplementation = I, e.mockReturnThis = () => e.mockImplementation(function() {
196
+ return n(b, "withImplementation"), e.withImplementation = b, e.mockReturnThis = () => e.mockImplementation(function() {
197
197
  return this;
198
198
  }), e.mockReturnValue = (s) => e.mockImplementation(() => s), e.mockReturnValueOnce = (s) => e.mockImplementationOnce(() => s), e.mockResolvedValue =
199
199
  (s) => e.mockImplementation(() => Promise.resolve(s)), e.mockResolvedValueOnce = (s) => e.mockImplementationOnce(() => Promise.resolve(s)),
200
200
  e.mockRejectedValue = (s) => e.mockImplementation(() => Promise.reject(s)), e.mockRejectedValueOnce = (s) => e.mockImplementationOnce(() => Promise.
201
201
  reject(s)), Object.defineProperty(e, "mock", {
202
202
  get: /* @__PURE__ */ n(() => y, "get")
203
- }), c.willCall(i), T.add(e), e;
203
+ }), c.willCall(i), h.add(e), e;
204
204
  }
205
- n(D, "enhanceSpy");
205
+ n(V, "enhanceSpy");
206
206
  function P(t) {
207
- let e = D(R({
207
+ let e = V(w({
208
208
  spy: t || function() {
209
209
  }
210
210
  }, "spy"));
@@ -213,42 +213,43 @@ function P(t) {
213
213
  n(P, "fn");
214
214
 
215
215
  // src/test/spy.ts
216
- var S = /* @__PURE__ */ new Set();
216
+ var I = globalThis.__STORYBOOK_TEST_SPY_LISTENERS__ || /* @__PURE__ */ new Set();
217
+ globalThis.__STORYBOOK_TEST_SPY_LISTENERS__ = I;
217
218
  function J(t) {
218
- return S.add(t), () => void S.delete(t);
219
+ return I.add(t), () => void I.delete(t);
219
220
  }
220
221
  n(J, "onMockCall");
221
222
  var Q = /* @__PURE__ */ n((...t) => {
222
- let e = V(...t);
223
- return L(e);
223
+ let e = A(...t);
224
+ return F(e);
224
225
  }, "spyOn");
225
226
  function X(t) {
226
227
  let e = t ? P(t) : P();
227
- return L(e);
228
+ return F(e);
228
229
  }
229
230
  n(X, "fn");
230
- function L(t) {
231
- let e = F(t), r = e.mockImplementation.bind(null);
232
- return e.mockImplementation = (l) => F(r(l)), e;
233
- }
234
- n(L, "reactiveMock");
235
231
  function F(t) {
236
- let e = h(t), r = e.impl;
232
+ let e = D(t), r = e.mockImplementation.bind(null);
233
+ return e.mockImplementation = (l) => D(r(l)), e;
234
+ }
235
+ n(F, "reactiveMock");
236
+ function D(t) {
237
+ let e = T(t), r = e.impl;
237
238
  return e.willCall(function(...l) {
238
- return S.forEach((o) => o(t, l)), r?.apply(this, l);
239
+ return I.forEach((o) => o(t, l)), r?.apply(this, l);
239
240
  }), t;
240
241
  }
241
- n(F, "listenWhenCalled");
242
+ n(D, "listenWhenCalled");
242
243
  function Z() {
243
- T.forEach((t) => t.mockClear());
244
+ h.forEach((t) => t.mockClear());
244
245
  }
245
246
  n(Z, "clearAllMocks");
246
247
  function ee() {
247
- T.forEach((t) => t.mockReset());
248
+ h.forEach((t) => t.mockReset());
248
249
  }
249
250
  n(ee, "resetAllMocks");
250
251
  function te() {
251
- T.forEach((t) => t.mockRestore());
252
+ h.forEach((t) => t.mockRestore());
252
253
  }
253
254
  n(te, "restoreAllMocks");
254
255
  function ne(t, e = {}) {
package/dist/test/spy.js CHANGED
@@ -1,5 +1,5 @@
1
- var F = Object.defineProperty;
2
- var n = (t, e) => F(t, "name", { value: e, configurable: !0 });
1
+ var D = Object.defineProperty;
2
+ var n = (t, e) => D(t, "name", { value: e, configurable: !0 });
3
3
 
4
4
  // ../node_modules/tinyspy/dist/index.js
5
5
  function v(t, e) {
@@ -11,29 +11,29 @@ function g(t, e) {
11
11
  return typeof e === t;
12
12
  }
13
13
  n(g, "y");
14
- function L(t) {
14
+ function F(t) {
15
15
  return t instanceof Promise;
16
16
  }
17
- n(L, "w");
18
- function b(t, e, r) {
17
+ n(F, "w");
18
+ function R(t, e, r) {
19
19
  Object.defineProperty(t, e, r);
20
20
  }
21
- n(b, "f");
21
+ n(R, "f");
22
22
  function M(t, e, r) {
23
23
  Object.defineProperty(t, e, { value: r });
24
24
  }
25
25
  n(M, "l");
26
- var T = Symbol.for("tinyspy:spy"), _ = /* @__PURE__ */ new Set(), N = /* @__PURE__ */ n((t) => {
26
+ var h = Symbol.for("tinyspy:spy"), L = /* @__PURE__ */ new Set(), Y = /* @__PURE__ */ n((t) => {
27
27
  t.called = !1, t.callCount = 0, t.calls = [], t.results = [], t.resolves = [], t.next = [];
28
- }, "P"), K = /* @__PURE__ */ n((t) => (b(t, T, { value: { reset: /* @__PURE__ */ n(() => N(t[T]), "reset") } }), t[T]), "K"), h = /* @__PURE__ */ n(
29
- (t) => t[T] || K(t), "T");
30
- function U(t) {
28
+ }, "P"), N = /* @__PURE__ */ n((t) => (R(t, h, { value: { reset: /* @__PURE__ */ n(() => Y(t[h]), "reset") } }), t[h]), "K"), T = /* @__PURE__ */ n(
29
+ (t) => t[h] || N(t), "T");
30
+ function K(t) {
31
31
  v(
32
32
  g("function", t) || g("undefined", t),
33
33
  "cannot spy on a non-function value"
34
34
  );
35
35
  let e = /* @__PURE__ */ n(function(...l) {
36
- let s = h(e);
36
+ let s = T(e);
37
37
  s.called = !0, s.callCount++, s.calls.push(l);
38
38
  let p = s.next.shift();
39
39
  if (p) {
@@ -51,20 +51,20 @@ function U(t) {
51
51
  throw c = i, y = "error", s.results.push([y, i]), i;
52
52
  }
53
53
  let m = [y, c];
54
- return L(c) && c.then(
54
+ return F(c) && c.then(
55
55
  (i) => s.resolves[a] = ["ok", i],
56
56
  (i) => s.resolves[a] = ["error", i]
57
57
  ), s.results.push(m), c;
58
58
  }, "t");
59
59
  M(e, "_isMockFunction", !0), M(e, "length", t ? t.length : 0), M(e, "name", t && t.name || "spy");
60
- let r = h(e);
60
+ let r = T(e);
61
61
  return r.reset(), r.impl = t, e;
62
62
  }
63
- n(U, "m");
64
- var S = /* @__PURE__ */ n((t, e) => Object.getOwnPropertyDescriptor(t, e), "k"), C = /* @__PURE__ */ n((t, e) => {
63
+ n(K, "m");
64
+ var P = /* @__PURE__ */ n((t, e) => Object.getOwnPropertyDescriptor(t, e), "k"), C = /* @__PURE__ */ n((t, e) => {
65
65
  e != null && typeof e == "function" && e.prototype != null && Object.setPrototypeOf(t.prototype, e.prototype);
66
66
  }, "O");
67
- function w(t, e, r) {
67
+ function S(t, e, r) {
68
68
  v(
69
69
  !g("undefined", t),
70
70
  "spyOn could not find an object to spy upon"
@@ -82,7 +82,7 @@ function w(t, e, r) {
82
82
  if ("setter" in e)
83
83
  return [e.setter, "set"];
84
84
  throw new Error("specify getter or setter to spy on");
85
- })(), p = S(t, l), c = Object.getPrototypeOf(t), y = c && S(c, l), a = p || y;
85
+ })(), p = P(t, l), c = Object.getPrototypeOf(t), y = c && P(c, l), a = p || y;
86
86
  v(
87
87
  a || l in t,
88
88
  `${String(l)} does not exist`
@@ -92,39 +92,39 @@ function w(t, e, r) {
92
92
  let i;
93
93
  a ? i = a[s] : s !== "value" ? i = /* @__PURE__ */ n(() => t[l], "o") : i = t[l];
94
94
  let f = /* @__PURE__ */ n((k) => {
95
- let { value: I, ...d } = a || {
95
+ let { value: b, ...d } = a || {
96
96
  configurable: !0,
97
97
  writable: !0
98
98
  };
99
- s !== "value" && delete d.writable, d[s] = k, b(t, l, d);
100
- }, "g"), O = /* @__PURE__ */ n(() => a ? b(t, l, a) : f(i), "b");
99
+ s !== "value" && delete d.writable, d[s] = k, R(t, l, d);
100
+ }, "g"), I = /* @__PURE__ */ n(() => a ? R(t, l, a) : f(i), "b");
101
101
  r || (r = i);
102
- let o = U(r);
102
+ let o = K(r);
103
103
  s === "value" && C(o, i);
104
- let u = o[T];
105
- return M(u, "restore", O), M(u, "getOriginal", () => m ? i() : i), M(u, "willCall", (k) => (u.impl = k, o)), f(
104
+ let u = o[h];
105
+ return M(u, "restore", I), M(u, "getOriginal", () => m ? i() : i), M(u, "willCall", (k) => (u.impl = k, o)), f(
106
106
  m ? () => (C(o, r), o) : o
107
- ), _.add(o), o;
107
+ ), L.add(o), o;
108
108
  }
109
- n(w, "C");
109
+ n(S, "C");
110
110
 
111
111
  // ../node_modules/@vitest/spy/dist/index.js
112
112
  var x = /* @__PURE__ */ new Set();
113
- function W(t) {
113
+ function B(t) {
114
114
  return typeof t == "function" && "_isMockFunction" in t && t._isMockFunction;
115
115
  }
116
- n(W, "isMockFunction");
117
- function A(t, e, r) {
116
+ n(B, "isMockFunction");
117
+ function E(t, e, r) {
118
118
  let s = r ? { [{
119
119
  get: "getter",
120
120
  set: "setter"
121
- }[r]]: e } : e, p = w(t, s);
122
- return E(p);
121
+ }[r]]: e } : e, p = S(t, s);
122
+ return j(p);
123
123
  }
124
- n(A, "spyOn");
125
- var Y = 0;
126
- function E(t) {
127
- let e = t, r, l = [], s = [], p = [], c = h(t), y = {
124
+ n(E, "spyOn");
125
+ var U = 0;
126
+ function j(t) {
127
+ let e = t, r, l = [], s = [], p = [], c = T(t), y = {
128
128
  get calls() {
129
129
  return c.calls;
130
130
  },
@@ -148,7 +148,7 @@ function E(t) {
148
148
  }
149
149
  }, a = [], m = !1;
150
150
  function i(...o) {
151
- return l.push(this), s.push(this), p.push(++Y), (m ? r : a.shift() || r || c.getOriginal() || (() => {
151
+ return l.push(this), s.push(this), p.push(++U), (m ? r : a.shift() || r || c.getOriginal() || (() => {
152
152
  })).apply(this, o);
153
153
  }
154
154
  n(i, "mockCall");
@@ -156,15 +156,15 @@ function E(t) {
156
156
  e.getMockName = () => f || "vi.fn()", e.mockName = (o) => (f = o, e), e.mockClear = () => (c.reset(), l = [], s = [], p = [], e), e.mockReset =
157
157
  () => (e.mockClear(), r = void 0, a = [], e), e.mockRestore = () => (e.mockReset(), c.restore(), e), e.getMockImplementation = () => m ? r :
158
158
  a.at(0) || r, e.mockImplementation = (o) => (r = o, c.willCall(i), e), e.mockImplementationOnce = (o) => (a.push(o), e);
159
- function O(o, u) {
159
+ function I(o, u) {
160
160
  let k = r;
161
161
  r = o, c.willCall(i), m = !0;
162
- let I = /* @__PURE__ */ n(() => {
162
+ let b = /* @__PURE__ */ n(() => {
163
163
  r = k, m = !1;
164
164
  }, "reset"), d = u();
165
- return d instanceof Promise ? d.then(() => (I(), e)) : (I(), e);
165
+ return d instanceof Promise ? d.then(() => (b(), e)) : (b(), e);
166
166
  }
167
- return n(O, "withImplementation"), e.withImplementation = O, e.mockReturnThis = () => e.mockImplementation(function() {
167
+ return n(I, "withImplementation"), e.withImplementation = I, e.mockReturnThis = () => e.mockImplementation(function() {
168
168
  return this;
169
169
  }), e.mockReturnValue = (o) => e.mockImplementation(() => o), e.mockReturnValueOnce = (o) => e.mockImplementationOnce(() => o), e.mockResolvedValue =
170
170
  (o) => e.mockImplementation(() => Promise.resolve(o)), e.mockResolvedValueOnce = (o) => e.mockImplementationOnce(() => Promise.resolve(o)),
@@ -173,43 +173,44 @@ function E(t) {
173
173
  get: /* @__PURE__ */ n(() => y, "get")
174
174
  }), c.willCall(i), x.add(e), e;
175
175
  }
176
- n(E, "enhanceSpy");
177
- function R(t) {
178
- let e = E(w({
176
+ n(j, "enhanceSpy");
177
+ function w(t) {
178
+ let e = j(S({
179
179
  spy: t || function() {
180
180
  }
181
181
  }, "spy"));
182
182
  return t && e.mockImplementation(t), e;
183
183
  }
184
- n(R, "fn");
184
+ n(w, "fn");
185
185
 
186
186
  // src/test/spy.ts
187
- var P = /* @__PURE__ */ new Set();
187
+ var O = globalThis.__STORYBOOK_TEST_SPY_LISTENERS__ || /* @__PURE__ */ new Set();
188
+ globalThis.__STORYBOOK_TEST_SPY_LISTENERS__ = O;
188
189
  function H(t) {
189
- return P.add(t), () => void P.delete(t);
190
+ return O.add(t), () => void O.delete(t);
190
191
  }
191
192
  n(H, "onMockCall");
192
193
  var J = /* @__PURE__ */ n((...t) => {
193
- let e = A(...t);
194
- return D(e);
194
+ let e = E(...t);
195
+ return V(e);
195
196
  }, "spyOn");
196
197
  function Q(t) {
197
- let e = t ? R(t) : R();
198
- return D(e);
198
+ let e = t ? w(t) : w();
199
+ return V(e);
199
200
  }
200
201
  n(Q, "fn");
201
- function D(t) {
202
- let e = V(t), r = e.mockImplementation.bind(null);
203
- return e.mockImplementation = (l) => V(r(l)), e;
204
- }
205
- n(D, "reactiveMock");
206
202
  function V(t) {
207
- let e = h(t), r = e.impl;
203
+ let e = A(t), r = e.mockImplementation.bind(null);
204
+ return e.mockImplementation = (l) => A(r(l)), e;
205
+ }
206
+ n(V, "reactiveMock");
207
+ function A(t) {
208
+ let e = T(t), r = e.impl;
208
209
  return e.willCall(function(...l) {
209
- return P.forEach((s) => s(t, l)), r?.apply(this, l);
210
+ return O.forEach((s) => s(t, l)), r?.apply(this, l);
210
211
  }), t;
211
212
  }
212
- n(V, "listenWhenCalled");
213
+ n(A, "listenWhenCalled");
213
214
  function X() {
214
215
  x.forEach((t) => t.mockClear());
215
216
  }
@@ -229,7 +230,7 @@ n(te, "mocked");
229
230
  export {
230
231
  X as clearAllMocks,
231
232
  Q as fn,
232
- W as isMockFunction,
233
+ B as isMockFunction,
233
234
  te as mocked,
234
235
  x as mocks,
235
236
  H as onMockCall,
@@ -1,25 +1,25 @@
1
1
  "use strict";
2
2
  var d = Object.defineProperty;
3
3
  var y = Object.getOwnPropertyDescriptor;
4
- var s = Object.getOwnPropertyNames;
5
- var i = Object.prototype.hasOwnProperty;
6
- var A = (r, e) => {
4
+ var i = Object.getOwnPropertyNames;
5
+ var A = Object.prototype.hasOwnProperty;
6
+ var s = (r, e) => {
7
7
  for (var n in e)
8
8
  d(r, n, { get: e[n], enumerable: !0 });
9
- }, T = (r, e, n, a) => {
9
+ }, _ = (r, e, n, a) => {
10
10
  if (e && typeof e == "object" || typeof e == "function")
11
- for (let o of s(e))
12
- !i.call(r, o) && o !== n && d(r, o, { get: () => e[o], enumerable: !(a = y(e, o)) || a.enumerable });
11
+ for (let o of i(e))
12
+ !A.call(r, o) && o !== n && d(r, o, { get: () => e[o], enumerable: !(a = y(e, o)) || a.enumerable });
13
13
  return r;
14
14
  };
15
- var _ = (r) => T(d({}, "__esModule", { value: !0 }), r);
15
+ var T = (r) => _(d({}, "__esModule", { value: !0 }), r);
16
16
 
17
17
  // src/types/index.ts
18
- var S = {};
19
- A(S, {
18
+ var m = {};
19
+ s(m, {
20
20
  Addon_TypesEnum: () => p
21
21
  });
22
- module.exports = _(S);
22
+ module.exports = T(m);
23
23
 
24
24
  // src/types/modules/addons.ts
25
25
  var p = /* @__PURE__ */ ((t) => (t.TAB = "tab", t.PANEL = "panel", t.TOOL = "tool", t.TOOLEXTRA = "toolextra", t.PREVIEW = "preview", t.experimental_PAGE =