storybook 9.0.0-alpha.8 → 9.0.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 (140) hide show
  1. package/assets/docs/addon-backgrounds.gif +0 -0
  2. package/assets/docs/addon-controls-args-annotated.png +0 -0
  3. package/assets/docs/addon-controls-args-background-color.png +0 -0
  4. package/assets/docs/addon-controls-args-background-string.png +0 -0
  5. package/assets/docs/addon-controls-args-docs.png +0 -0
  6. package/assets/docs/addon-controls-args-logging.png +0 -0
  7. package/assets/docs/addon-controls-args-no-annotation.png +0 -0
  8. package/assets/docs/addon-controls-args-reflow-slider.png +0 -0
  9. package/assets/docs/addon-controls-args-reflow.png +0 -0
  10. package/assets/docs/addon-controls-args-template.png +0 -0
  11. package/assets/docs/addon-controls-expanded.png +0 -0
  12. package/assets/docs/addon-controls-hero.gif +0 -0
  13. package/assets/docs/addon-controls-install.png +0 -0
  14. package/assets/docs/hero.gif +0 -0
  15. package/assets/docs/highlight.png +0 -0
  16. package/assets/docs/viewport.png +0 -0
  17. package/assets/server/base-preview-head.html +1 -3
  18. package/bin/index.cjs +2 -2
  19. package/dist/actions/decorator.js +67 -72
  20. package/dist/actions/index.cjs +27 -31
  21. package/dist/actions/index.d.ts +0 -3
  22. package/dist/actions/index.js +27 -31
  23. package/dist/actions/preview.cjs +23 -27
  24. package/dist/actions/preview.d.ts +0 -1
  25. package/dist/actions/preview.js +19 -23
  26. package/dist/babel/index.cjs +822 -816
  27. package/dist/babel/index.js +822 -816
  28. package/dist/backgrounds/index.cjs +148 -0
  29. package/dist/backgrounds/index.d.ts +91 -0
  30. package/dist/backgrounds/index.js +130 -0
  31. package/dist/backgrounds/preview.cjs +143 -0
  32. package/dist/backgrounds/preview.d.ts +54 -0
  33. package/dist/backgrounds/preview.js +127 -0
  34. package/dist/bin/index.cjs +73 -92
  35. package/dist/bin/index.js +66 -85
  36. package/dist/builder-manager/index.cjs +316 -296
  37. package/dist/builder-manager/index.js +567 -547
  38. package/dist/channels/index.cjs +1020 -950
  39. package/dist/channels/index.js +1256 -1201
  40. package/dist/cli/bin/index.cjs +198 -198
  41. package/dist/cli/bin/index.js +204 -204
  42. package/dist/cli/index.cjs +61734 -7589
  43. package/dist/cli/index.d.ts +24 -20
  44. package/dist/cli/index.js +61775 -7630
  45. package/dist/common/index.cjs +16175 -9123
  46. package/dist/common/index.d.ts +34 -25
  47. package/dist/common/index.js +16270 -9212
  48. package/dist/component-testing/index.cjs +23 -0
  49. package/dist/component-testing/index.d.ts +3 -0
  50. package/dist/component-testing/index.js +5 -0
  51. package/dist/component-testing/preview.cjs +40 -0
  52. package/dist/component-testing/preview.d.ts +5 -0
  53. package/dist/component-testing/preview.js +25 -0
  54. package/dist/components/index.cjs +6479 -13005
  55. package/dist/components/index.d.ts +8 -257
  56. package/dist/components/index.js +6160 -18689
  57. package/dist/controls/decorator.d.ts +5 -0
  58. package/dist/controls/decorator.js +8 -0
  59. package/dist/controls/index.cjs +26 -0
  60. package/dist/controls/index.d.ts +39 -0
  61. package/dist/controls/index.js +6 -0
  62. package/dist/controls/preview.cjs +26 -0
  63. package/dist/controls/preview.d.ts +54 -0
  64. package/dist/controls/preview.js +9 -0
  65. package/dist/core-events/index.cjs +91 -106
  66. package/dist/core-events/index.d.ts +2 -80
  67. package/dist/core-events/index.js +79 -94
  68. package/dist/core-server/index.cjs +12314 -12114
  69. package/dist/core-server/index.d.ts +32 -23
  70. package/dist/core-server/index.js +12495 -12296
  71. package/dist/core-server/presets/common-manager.css +170 -0
  72. package/dist/core-server/presets/common-manager.js +12153 -12
  73. package/dist/core-server/presets/common-preset.cjs +3004 -3151
  74. package/dist/core-server/presets/common-preset.js +2833 -2981
  75. package/dist/csf/index.d.ts +1 -3
  76. package/dist/csf-tools/index.cjs +412 -403
  77. package/dist/csf-tools/index.d.ts +0 -4
  78. package/dist/csf-tools/index.js +410 -401
  79. package/dist/docs-tools/index.cjs +2569 -575
  80. package/dist/docs-tools/index.js +2565 -564
  81. package/dist/highlight/index.cjs +27 -0
  82. package/dist/highlight/index.d.ts +61 -0
  83. package/dist/highlight/index.js +7 -0
  84. package/dist/highlight/preview.cjs +535 -0
  85. package/dist/highlight/preview.d.ts +54 -0
  86. package/dist/highlight/preview.js +519 -0
  87. package/dist/instrumenter/index.cjs +1417 -1761
  88. package/dist/instrumenter/index.d.ts +8 -7
  89. package/dist/instrumenter/index.js +1332 -1667
  90. package/dist/manager/globals-module-info.cjs +22 -33
  91. package/dist/manager/globals-module-info.js +7 -18
  92. package/dist/manager/globals-runtime.js +45449 -49535
  93. package/dist/manager/runtime.js +4392 -3774
  94. package/dist/manager-api/index.cjs +2622 -2529
  95. package/dist/manager-api/index.d.ts +109 -114
  96. package/dist/manager-api/index.js +2603 -2475
  97. package/dist/manager-errors.js +41 -37
  98. package/dist/measure/index.cjs +476 -0
  99. package/dist/measure/index.d.ts +66 -0
  100. package/dist/measure/index.js +464 -0
  101. package/dist/measure/preview.cjs +466 -0
  102. package/dist/measure/preview.d.ts +59 -0
  103. package/dist/measure/preview.js +450 -0
  104. package/dist/outline/index.cjs +528 -0
  105. package/dist/outline/index.d.ts +66 -0
  106. package/dist/outline/index.js +500 -0
  107. package/dist/outline/preview.cjs +518 -0
  108. package/dist/outline/preview.d.ts +59 -0
  109. package/dist/outline/preview.js +486 -0
  110. package/dist/preview/runtime.js +42328 -38511
  111. package/dist/preview-api/index.cjs +1204 -1293
  112. package/dist/preview-api/index.d.ts +126 -178
  113. package/dist/preview-api/index.js +1614 -1685
  114. package/dist/preview-errors.cjs +65 -51
  115. package/dist/preview-errors.d.ts +6 -2
  116. package/dist/preview-errors.js +176 -142
  117. package/dist/server-errors.cjs +160 -113
  118. package/dist/server-errors.d.ts +12 -2
  119. package/dist/server-errors.js +157 -110
  120. package/dist/telemetry/index.cjs +407 -403
  121. package/dist/telemetry/index.d.ts +1 -1
  122. package/dist/telemetry/index.js +493 -489
  123. package/dist/test/index.cjs +1553 -1552
  124. package/dist/test/index.js +9603 -9514
  125. package/dist/test/preview.cjs +1906 -1905
  126. package/dist/test/preview.d.ts +0 -6
  127. package/dist/test/preview.js +3664 -3603
  128. package/dist/test/spy.cjs +65 -64
  129. package/dist/test/spy.js +59 -58
  130. package/dist/types/index.cjs +11 -12
  131. package/dist/types/index.d.ts +601 -338
  132. package/dist/types/index.js +1 -2
  133. package/dist/viewport/index.cjs +310 -0
  134. package/dist/viewport/index.d.ts +320 -0
  135. package/dist/viewport/index.js +290 -0
  136. package/dist/viewport/preview.cjs +35 -0
  137. package/dist/viewport/preview.d.ts +68 -0
  138. package/dist/viewport/preview.js +19 -0
  139. package/package.json +207 -12
  140. package/dist/actions/manager.js +0 -1196
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,
@@ -2,26 +2,25 @@
2
2
  var d = Object.defineProperty;
3
3
  var y = Object.getOwnPropertyDescriptor;
4
4
  var i = Object.getOwnPropertyNames;
5
- var s = Object.prototype.hasOwnProperty;
6
- var A = (t, e) => {
5
+ var A = Object.prototype.hasOwnProperty;
6
+ var s = (r, e) => {
7
7
  for (var n in e)
8
- d(t, n, { get: e[n], enumerable: !0 });
9
- }, T = (t, e, n, a) => {
8
+ d(r, n, { get: e[n], enumerable: !0 });
9
+ }, _ = (r, e, n, a) => {
10
10
  if (e && typeof e == "object" || typeof e == "function")
11
11
  for (let o of i(e))
12
- !s.call(t, o) && o !== n && d(t, o, { get: () => e[o], enumerable: !(a = y(e, o)) || a.enumerable });
13
- return t;
12
+ !A.call(r, o) && o !== n && d(r, o, { get: () => e[o], enumerable: !(a = y(e, o)) || a.enumerable });
13
+ return r;
14
14
  };
15
- var _ = (t) => T(d({}, "__esModule", { value: !0 }), t);
15
+ var T = (r) => _(d({}, "__esModule", { value: !0 }), r);
16
16
 
17
17
  // src/types/index.ts
18
18
  var m = {};
19
- A(m, {
19
+ s(m, {
20
20
  Addon_TypesEnum: () => p
21
21
  });
22
- module.exports = _(m);
22
+ module.exports = T(m);
23
23
 
24
24
  // src/types/modules/addons.ts
25
- var p = /* @__PURE__ */ ((r) => (r.TAB = "tab", r.PANEL = "panel", r.TOOL = "tool", r.TOOLEXTRA = "toolextra", r.PREVIEW = "preview", r.experimental_PAGE =
26
- "page", r.experimental_SIDEBAR_BOTTOM = "sidebar-bottom", r.experimental_SIDEBAR_TOP = "sidebar-top", r.experimental_TEST_PROVIDER = "test-p\
27
- rovider", r))(p || {});
25
+ var p = /* @__PURE__ */ ((t) => (t.TAB = "tab", t.PANEL = "panel", t.TOOL = "tool", t.TOOLEXTRA = "toolextra", t.PREVIEW = "preview", t.experimental_PAGE =
26
+ "page", t.experimental_TEST_PROVIDER = "test-provider", t))(p || {});