storybook 9.0.6 → 9.0.9

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 (62) hide show
  1. package/dist/bin/index.cjs +54 -61
  2. package/dist/bin/index.js +45 -52
  3. package/dist/cli/bin/index.cjs +572 -572
  4. package/dist/cli/bin/index.js +582 -582
  5. package/dist/common/index.cjs +1267 -1276
  6. package/dist/common/index.d.ts +7 -10
  7. package/dist/common/index.js +1234 -1243
  8. package/dist/components/index.cjs +1899 -1895
  9. package/dist/components/index.js +1343 -1339
  10. package/dist/core-server/presets/common-manager.js +2545 -2507
  11. package/dist/csf/index.d.ts +3 -1
  12. package/dist/instrumenter/index.cjs +958 -934
  13. package/dist/instrumenter/index.d.ts +1 -0
  14. package/dist/instrumenter/index.js +933 -908
  15. package/dist/manager/globals-runtime.js +11039 -11010
  16. package/dist/manager-api/index.cjs +1 -1
  17. package/dist/manager-api/index.js +1 -1
  18. package/dist/preview/runtime.js +7488 -7459
  19. package/dist/preview-api/index.cjs +4438 -2648
  20. package/dist/preview-api/index.js +4231 -2435
  21. package/dist/telemetry/index.cjs +521 -521
  22. package/dist/telemetry/index.js +526 -526
  23. package/package.json +1 -185
  24. package/dist/actions/preview.cjs +0 -159
  25. package/dist/actions/preview.d.ts +0 -555
  26. package/dist/actions/preview.js +0 -149
  27. package/dist/backgrounds/index.cjs +0 -148
  28. package/dist/backgrounds/index.d.ts +0 -592
  29. package/dist/backgrounds/index.js +0 -130
  30. package/dist/backgrounds/preview.cjs +0 -143
  31. package/dist/backgrounds/preview.d.ts +0 -555
  32. package/dist/backgrounds/preview.js +0 -127
  33. package/dist/component-testing/index.cjs +0 -23
  34. package/dist/component-testing/index.d.ts +0 -3
  35. package/dist/component-testing/index.js +0 -5
  36. package/dist/component-testing/preview.cjs +0 -40
  37. package/dist/component-testing/preview.d.ts +0 -5
  38. package/dist/component-testing/preview.js +0 -25
  39. package/dist/controls/preview.cjs +0 -26
  40. package/dist/controls/preview.d.ts +0 -555
  41. package/dist/controls/preview.js +0 -9
  42. package/dist/highlight/preview.cjs +0 -590
  43. package/dist/highlight/preview.d.ts +0 -555
  44. package/dist/highlight/preview.js +0 -574
  45. package/dist/measure/index.cjs +0 -476
  46. package/dist/measure/index.d.ts +0 -567
  47. package/dist/measure/index.js +0 -464
  48. package/dist/measure/preview.cjs +0 -466
  49. package/dist/measure/preview.d.ts +0 -560
  50. package/dist/measure/preview.js +0 -450
  51. package/dist/outline/index.cjs +0 -528
  52. package/dist/outline/index.d.ts +0 -567
  53. package/dist/outline/index.js +0 -500
  54. package/dist/outline/preview.cjs +0 -518
  55. package/dist/outline/preview.d.ts +0 -560
  56. package/dist/outline/preview.js +0 -486
  57. package/dist/test/preview.cjs +0 -73
  58. package/dist/test/preview.d.ts +0 -555
  59. package/dist/test/preview.js +0 -66
  60. package/dist/viewport/preview.cjs +0 -35
  61. package/dist/viewport/preview.d.ts +0 -569
  62. package/dist/viewport/preview.js +0 -19
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "storybook",
3
- "version": "9.0.6",
3
+ "version": "9.0.9",
4
4
  "description": "Storybook framework-agnostic API",
5
5
  "keywords": [
6
6
  "storybook"
@@ -83,66 +83,6 @@
83
83
  "import": "./dist/core-server/presets/common-override-preset.js",
84
84
  "require": "./dist/core-server/presets/common-override-preset.cjs"
85
85
  },
86
- "./internal/backgrounds": {
87
- "types": "./dist/backgrounds/index.d.ts",
88
- "import": "./dist/backgrounds/index.js",
89
- "require": "./dist/backgrounds/index.cjs"
90
- },
91
- "./backgrounds": {
92
- "types": "./dist/backgrounds/index.d.ts",
93
- "import": "./dist/backgrounds/index.js",
94
- "require": "./dist/backgrounds/index.cjs"
95
- },
96
- "./internal/backgrounds/preview": {
97
- "types": "./dist/backgrounds/preview.d.ts",
98
- "import": "./dist/backgrounds/preview.js",
99
- "require": "./dist/backgrounds/preview.cjs"
100
- },
101
- "./backgrounds/preview": {
102
- "types": "./dist/backgrounds/preview.d.ts",
103
- "import": "./dist/backgrounds/preview.js",
104
- "require": "./dist/backgrounds/preview.cjs"
105
- },
106
- "./internal/measure": {
107
- "types": "./dist/measure/index.d.ts",
108
- "import": "./dist/measure/index.js",
109
- "require": "./dist/measure/index.cjs"
110
- },
111
- "./measure": {
112
- "types": "./dist/measure/index.d.ts",
113
- "import": "./dist/measure/index.js",
114
- "require": "./dist/measure/index.cjs"
115
- },
116
- "./internal/measure/preview": {
117
- "types": "./dist/measure/preview.d.ts",
118
- "import": "./dist/measure/preview.js",
119
- "require": "./dist/measure/preview.cjs"
120
- },
121
- "./measure/preview": {
122
- "types": "./dist/measure/preview.d.ts",
123
- "import": "./dist/measure/preview.js",
124
- "require": "./dist/measure/preview.cjs"
125
- },
126
- "./internal/outline": {
127
- "types": "./dist/outline/index.d.ts",
128
- "import": "./dist/outline/index.js",
129
- "require": "./dist/outline/index.cjs"
130
- },
131
- "./outline": {
132
- "types": "./dist/outline/index.d.ts",
133
- "import": "./dist/outline/index.js",
134
- "require": "./dist/outline/index.cjs"
135
- },
136
- "./internal/outline/preview": {
137
- "types": "./dist/outline/preview.d.ts",
138
- "import": "./dist/outline/preview.js",
139
- "require": "./dist/outline/preview.cjs"
140
- },
141
- "./outline/preview": {
142
- "types": "./dist/outline/preview.d.ts",
143
- "import": "./dist/outline/preview.js",
144
- "require": "./dist/outline/preview.cjs"
145
- },
146
86
  "./internal/highlight": {
147
87
  "types": "./dist/highlight/index.d.ts",
148
88
  "import": "./dist/highlight/index.js",
@@ -153,16 +93,6 @@
153
93
  "import": "./dist/highlight/index.js",
154
94
  "require": "./dist/highlight/index.cjs"
155
95
  },
156
- "./internal/highlight/preview": {
157
- "types": "./dist/highlight/preview.d.ts",
158
- "import": "./dist/highlight/preview.js",
159
- "require": "./dist/highlight/preview.cjs"
160
- },
161
- "./highlight/preview": {
162
- "types": "./dist/highlight/preview.d.ts",
163
- "import": "./dist/highlight/preview.js",
164
- "require": "./dist/highlight/preview.cjs"
165
- },
166
96
  "./internal/actions": {
167
97
  "types": "./dist/actions/index.d.ts",
168
98
  "import": "./dist/actions/index.js",
@@ -173,16 +103,6 @@
173
103
  "import": "./dist/actions/index.js",
174
104
  "require": "./dist/actions/index.cjs"
175
105
  },
176
- "./internal/actions/preview": {
177
- "types": "./dist/actions/preview.d.ts",
178
- "import": "./dist/actions/preview.js",
179
- "require": "./dist/actions/preview.cjs"
180
- },
181
- "./actions/preview": {
182
- "types": "./dist/actions/preview.d.ts",
183
- "import": "./dist/actions/preview.js",
184
- "require": "./dist/actions/preview.cjs"
185
- },
186
106
  "./internal/actions/decorator": {
187
107
  "types": "./dist/actions/decorator.d.ts",
188
108
  "import": "./dist/actions/decorator.js"
@@ -191,16 +111,6 @@
191
111
  "types": "./dist/actions/decorator.d.ts",
192
112
  "import": "./dist/actions/decorator.js"
193
113
  },
194
- "./internal/component-testing": {
195
- "types": "./dist/component-testing/index.d.ts",
196
- "import": "./dist/component-testing/index.js",
197
- "require": "./dist/component-testing/index.cjs"
198
- },
199
- "./internal/component-testing/preview": {
200
- "types": "./dist/component-testing/preview.d.ts",
201
- "import": "./dist/component-testing/preview.js",
202
- "require": "./dist/component-testing/preview.cjs"
203
- },
204
114
  "./internal/viewport": {
205
115
  "types": "./dist/viewport/index.d.ts",
206
116
  "import": "./dist/viewport/index.js",
@@ -211,26 +121,11 @@
211
121
  "import": "./dist/viewport/index.js",
212
122
  "require": "./dist/viewport/index.cjs"
213
123
  },
214
- "./internal/viewport/preview": {
215
- "types": "./dist/viewport/preview.d.ts",
216
- "import": "./dist/viewport/preview.js",
217
- "require": "./dist/viewport/preview.cjs"
218
- },
219
- "./viewport/preview": {
220
- "types": "./dist/viewport/preview.d.ts",
221
- "import": "./dist/viewport/preview.js",
222
- "require": "./dist/viewport/preview.cjs"
223
- },
224
124
  "./internal/controls": {
225
125
  "types": "./dist/controls/index.d.ts",
226
126
  "import": "./dist/controls/index.js",
227
127
  "require": "./dist/controls/index.cjs"
228
128
  },
229
- "./internal/controls/preview": {
230
- "types": "./dist/controls/preview.d.ts",
231
- "import": "./dist/controls/preview.js",
232
- "require": "./dist/controls/preview.cjs"
233
- },
234
129
  "./internal/controls/decorator": {
235
130
  "types": "./dist/controls/decorator.d.ts",
236
131
  "import": "./dist/controls/decorator.js"
@@ -363,16 +258,6 @@
363
258
  "import": "./dist/instrumenter/index.js",
364
259
  "require": "./dist/instrumenter/index.cjs"
365
260
  },
366
- "./internal/test/preview": {
367
- "types": "./dist/test/preview.d.ts",
368
- "import": "./dist/test/preview.js",
369
- "require": "./dist/test/preview.cjs"
370
- },
371
- "./test/preview": {
372
- "types": "./dist/test/preview.d.ts",
373
- "import": "./dist/test/preview.js",
374
- "require": "./dist/test/preview.cjs"
375
- },
376
261
  "./internal/test": {
377
262
  "types": "./dist/test/index.d.ts",
378
263
  "import": "./dist/test/index.js",
@@ -421,96 +306,33 @@
421
306
  "internal/core-server": [
422
307
  "./dist/core-server/index.d.ts"
423
308
  ],
424
- "internal/backgrounds": [
425
- "./dist/backgrounds/index.d.ts"
426
- ],
427
- "backgrounds": [
428
- "./dist/backgrounds/index.d.ts"
429
- ],
430
- "internal/backgrounds/preview": [
431
- "./dist/backgrounds/preview.d.ts"
432
- ],
433
- "backgrounds/preview": [
434
- "./dist/backgrounds/preview.d.ts"
435
- ],
436
- "internal/measure": [
437
- "./dist/measure/index.d.ts"
438
- ],
439
- "measure": [
440
- "./dist/measure/index.d.ts"
441
- ],
442
- "internal/measure/preview": [
443
- "./dist/measure/preview.d.ts"
444
- ],
445
- "measure/preview": [
446
- "./dist/measure/preview.d.ts"
447
- ],
448
- "internal/outline": [
449
- "./dist/outline/index.d.ts"
450
- ],
451
- "outline": [
452
- "./dist/outline/index.d.ts"
453
- ],
454
- "internal/outline/preview": [
455
- "./dist/outline/preview.d.ts"
456
- ],
457
- "outline/preview": [
458
- "./dist/outline/preview.d.ts"
459
- ],
460
309
  "internal/highlight": [
461
310
  "./dist/highlight/index.d.ts"
462
311
  ],
463
312
  "highlight": [
464
313
  "./dist/highlight/index.d.ts"
465
314
  ],
466
- "internal/highlight/preview": [
467
- "./dist/highlight/preview.d.ts"
468
- ],
469
- "highlight/preview": [
470
- "./dist/highlight/preview.d.ts"
471
- ],
472
315
  "internal/actions": [
473
316
  "./dist/actions/index.d.ts"
474
317
  ],
475
318
  "actions": [
476
319
  "./dist/actions/index.d.ts"
477
320
  ],
478
- "internal/actions/preview": [
479
- "./dist/actions/preview.d.ts"
480
- ],
481
- "actions/preview": [
482
- "./dist/actions/preview.d.ts"
483
- ],
484
321
  "internal/actions/decorator": [
485
322
  "./dist/actions/decorator.d.ts"
486
323
  ],
487
324
  "actions/decorator": [
488
325
  "./dist/actions/decorator.d.ts"
489
326
  ],
490
- "internal/component-testing": [
491
- "./dist/component-testing/index.d.ts"
492
- ],
493
- "internal/component-testing/preview": [
494
- "./dist/component-testing/preview.d.ts"
495
- ],
496
327
  "internal/viewport": [
497
328
  "./dist/viewport/index.d.ts"
498
329
  ],
499
330
  "viewport": [
500
331
  "./dist/viewport/index.d.ts"
501
332
  ],
502
- "internal/viewport/preview": [
503
- "./dist/viewport/preview.d.ts"
504
- ],
505
- "viewport/preview": [
506
- "./dist/viewport/preview.d.ts"
507
- ],
508
333
  "internal/controls": [
509
334
  "./dist/controls/index.d.ts"
510
335
  ],
511
- "internal/controls/preview": [
512
- "./dist/controls/preview.d.ts"
513
- ],
514
336
  "internal/controls/decorator": [
515
337
  "./dist/controls/decorator.d.ts"
516
338
  ],
@@ -589,12 +411,6 @@
589
411
  "internal/instrumenter": [
590
412
  "./dist/instrumenter/index.d.ts"
591
413
  ],
592
- "internal/test/preview": [
593
- "./dist/test/preview.d.ts"
594
- ],
595
- "test/preview": [
596
- "./dist/test/preview.d.ts"
597
- ],
598
414
  "internal/test": [
599
415
  "./dist/test/index.d.ts"
600
416
  ],
@@ -1,159 +0,0 @@
1
- "use strict";
2
- var l = Object.defineProperty;
3
- var F = Object.getOwnPropertyDescriptor;
4
- var C = Object.getOwnPropertyNames;
5
- var W = Object.prototype.hasOwnProperty;
6
- var i = (e, t) => l(e, "name", { value: t, configurable: !0 });
7
- var y = (e, t) => {
8
- for (var o in t)
9
- l(e, o, { get: t[o], enumerable: !0 });
10
- }, M = (e, t, o, r) => {
11
- if (t && typeof t == "object" || typeof t == "function")
12
- for (let n of C(t))
13
- !W.call(e, n) && n !== o && l(e, n, { get: () => t[n], enumerable: !(r = F(t, n)) || r.enumerable });
14
- return e;
15
- };
16
- var L = (e) => M(l({}, "__esModule", { value: !0 }), e);
17
-
18
- // src/actions/preview.ts
19
- var z = {};
20
- y(z, {
21
- default: () => K
22
- });
23
- module.exports = L(z);
24
- var j = require("storybook/preview-api");
25
-
26
- // src/actions/addArgs.ts
27
- var A = {};
28
- y(A, {
29
- argsEnhancers: () => Y
30
- });
31
-
32
- // src/actions/runtime/action.ts
33
- var O = require("storybook/internal/preview-errors"), u = require("@storybook/global"), w = require("storybook/preview-api");
34
-
35
- // src/actions/constants.ts
36
- var f = "storybook/actions", q = `${f}/panel`, E = `${f}/action-event`, G = `${f}/action-clear`;
37
-
38
- // src/actions/runtime/configureActions.ts
39
- var R = {
40
- depth: 10,
41
- clearOnStoryChange: !0,
42
- limit: 50
43
- };
44
-
45
- // src/actions/runtime/action.ts
46
- var v = /* @__PURE__ */ i((e, t) => {
47
- let o = Object.getPrototypeOf(e);
48
- return !o || t(o) ? o : v(o, t);
49
- }, "findProto"), N = /* @__PURE__ */ i((e) => !!(typeof e == "object" && e && v(e, (t) => /^Synthetic(?:Base)?Event$/.test(t.constructor.name)) &&
50
- typeof e.persist == "function"), "isReactSyntheticEvent"), V = /* @__PURE__ */ i((e) => {
51
- if (N(e)) {
52
- let t = Object.create(
53
- e.constructor.prototype,
54
- Object.getOwnPropertyDescriptors(e)
55
- );
56
- t.persist();
57
- let o = Object.getOwnPropertyDescriptor(t, "view"), r = o?.value;
58
- return typeof r == "object" && r?.constructor.name === "Window" && Object.defineProperty(t, "view", {
59
- ...o,
60
- value: Object.create(r.constructor.prototype)
61
- }), t;
62
- }
63
- return e;
64
- }, "serializeArg");
65
- function g(e, t = {}) {
66
- let o = {
67
- ...R,
68
- ...t
69
- }, r = /* @__PURE__ */ i(function(...s) {
70
- if (t.implicit) {
71
- let x = ("__STORYBOOK_PREVIEW__" in u.global ? u.global.__STORYBOOK_PREVIEW__ : void 0)?.storyRenders.find(
72
- (d) => d.phase === "playing" || d.phase === "rendering"
73
- );
74
- if (x) {
75
- let d = !globalThis?.FEATURES?.disallowImplicitActionsInRenderV8, b = new O.ImplicitActionsDuringRendering({
76
- phase: x.phase,
77
- name: e,
78
- deprecated: d
79
- });
80
- if (d)
81
- console.warn(b);
82
- else
83
- throw b;
84
- }
85
- }
86
- let a = w.addons.getChannel(), c = Date.now().toString(36) + Math.random().toString(36).substring(2), p = 5, m = s.map(V), P = s.length >
87
- 1 ? m : m[0], S = {
88
- id: c,
89
- count: 0,
90
- data: { name: e, args: P },
91
- options: {
92
- ...o,
93
- maxDepth: p + (o.depth || 3)
94
- }
95
- };
96
- a.emit(E, S);
97
- }, "actionHandler");
98
- return r.isAction = !0, r.implicit = t.implicit, r;
99
- }
100
- i(g, "action");
101
-
102
- // src/actions/addArgsHelpers.ts
103
- var T = /* @__PURE__ */ i((e, t) => typeof t[e] > "u" && !(e in t), "isInInitialArgs"), _ = /* @__PURE__ */ i((e) => {
104
- let {
105
- initialArgs: t,
106
- argTypes: o,
107
- id: r,
108
- parameters: { actions: n }
109
- } = e;
110
- if (!n || n.disable || !n.argTypesRegex || !o)
111
- return {};
112
- let s = new RegExp(n.argTypesRegex);
113
- return Object.entries(o).filter(
114
- ([c]) => !!s.test(c)
115
- ).reduce((c, [p, m]) => (T(p, t) && (c[p] = g(p, { implicit: !0, id: r })), c), {});
116
- }, "inferActionsFromArgTypesRegex"), D = /* @__PURE__ */ i((e) => {
117
- let {
118
- initialArgs: t,
119
- argTypes: o,
120
- parameters: { actions: r }
121
- } = e;
122
- return r?.disable || !o ? {} : Object.entries(o).filter(([s, a]) => !!a.action).reduce((s, [a, c]) => (T(a, t) && (s[a] = g(typeof c.action ==
123
- "string" ? c.action : a)), s), {});
124
- }, "addActionsFromArgTypes");
125
-
126
- // src/actions/addArgs.ts
127
- var Y = [
128
- D,
129
- _
130
- ];
131
-
132
- // src/actions/loaders.ts
133
- var h = {};
134
- y(h, {
135
- loaders: () => B
136
- });
137
- var I = require("storybook/test");
138
- var k = !1, $ = /* @__PURE__ */ i((e) => {
139
- let { parameters: t } = e;
140
- t?.actions?.disable || k || ((0, I.onMockCall)((o, r) => {
141
- let n = o.getMockName();
142
- n !== "spy" && (!/^next\/.*::/.test(n) || [
143
- "next/router::useRouter()",
144
- "next/navigation::useRouter()",
145
- "next/navigation::redirect",
146
- "next/cache::",
147
- "next/headers::cookies().set",
148
- "next/headers::cookies().delete",
149
- "next/headers::headers().set",
150
- "next/headers::headers().delete"
151
- ].some((s) => n.startsWith(s))) && g(n)(r);
152
- }), k = !0);
153
- }, "logActionsWhenMockCalled"), B = [$];
154
-
155
- // src/actions/preview.ts
156
- var K = /* @__PURE__ */ i(() => (0, j.definePreview)({
157
- ...A,
158
- ...h
159
- }), "default");