storybook 9.0.0-beta.1 → 9.0.0-beta.11

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 (94) hide show
  1. package/assets/server/base-preview-head.html +2 -1
  2. package/dist/actions/decorator.js +49 -52
  3. package/dist/actions/index.cjs +42 -44
  4. package/dist/actions/index.js +37 -40
  5. package/dist/actions/preview.cjs +44 -46
  6. package/dist/actions/preview.d.ts +501 -0
  7. package/dist/actions/preview.js +24 -27
  8. package/dist/babel/index.cjs +15060 -14974
  9. package/dist/babel/index.d.ts +37 -18
  10. package/dist/babel/index.js +15097 -15011
  11. package/dist/backgrounds/index.d.ts +501 -0
  12. package/dist/backgrounds/preview.d.ts +501 -0
  13. package/dist/bin/index.cjs +44 -44
  14. package/dist/bin/index.js +44 -44
  15. package/dist/builder-manager/index.cjs +303 -283
  16. package/dist/builder-manager/index.js +545 -524
  17. package/dist/channels/index.js +919 -941
  18. package/dist/cli/bin/index.cjs +4184 -736
  19. package/dist/cli/bin/index.js +4198 -748
  20. package/dist/cli/index.cjs +36838 -28392
  21. package/dist/cli/index.d.ts +974 -1
  22. package/dist/cli/index.js +41620 -33168
  23. package/dist/client-logger/index.d.ts +2 -1
  24. package/dist/common/index.cjs +4783 -4691
  25. package/dist/common/index.d.ts +8 -2
  26. package/dist/common/index.js +5165 -5069
  27. package/dist/components/index.cjs +7905 -5600
  28. package/dist/components/index.d.ts +12 -12
  29. package/dist/components/index.js +4713 -3786
  30. package/dist/controls/preview.d.ts +501 -0
  31. package/dist/core-server/index.cjs +6799 -6708
  32. package/dist/core-server/index.d.ts +526 -25
  33. package/dist/core-server/index.js +6948 -6851
  34. package/dist/core-server/presets/common-manager.js +4528 -3377
  35. package/dist/core-server/presets/common-override-preset.cjs +10 -12
  36. package/dist/core-server/presets/common-override-preset.js +3 -5
  37. package/dist/core-server/presets/common-preset.cjs +2301 -2238
  38. package/dist/core-server/presets/common-preset.js +2389 -2322
  39. package/dist/docs-tools/index.cjs +484 -464
  40. package/dist/docs-tools/index.js +781 -768
  41. package/dist/highlight/index.cjs +19 -18
  42. package/dist/highlight/index.d.ts +4 -5
  43. package/dist/highlight/index.js +3 -2
  44. package/dist/highlight/preview.cjs +314 -310
  45. package/dist/highlight/preview.d.ts +501 -0
  46. package/dist/highlight/preview.js +296 -292
  47. package/dist/instrumenter/index.cjs +561 -559
  48. package/dist/instrumenter/index.js +1564 -1516
  49. package/dist/manager/globals-module-info.cjs +2 -0
  50. package/dist/manager/globals-module-info.js +2 -0
  51. package/dist/manager/globals-runtime.js +23602 -23339
  52. package/dist/manager/runtime.js +4891 -4650
  53. package/dist/manager-api/index.cjs +2400 -2321
  54. package/dist/manager-api/index.d.ts +513 -1
  55. package/dist/manager-api/index.js +1951 -1903
  56. package/dist/manager-errors.js +37 -41
  57. package/dist/measure/index.d.ts +501 -0
  58. package/dist/measure/preview.d.ts +501 -0
  59. package/dist/node-logger/index.cjs +25 -25
  60. package/dist/node-logger/index.js +25 -25
  61. package/dist/outline/index.d.ts +501 -0
  62. package/dist/outline/preview.d.ts +501 -0
  63. package/dist/preview/runtime.js +35803 -35785
  64. package/dist/preview-api/index.cjs +1287 -1265
  65. package/dist/preview-api/index.d.ts +1 -1
  66. package/dist/preview-api/index.js +1367 -1361
  67. package/dist/preview-errors.js +152 -173
  68. package/dist/router/index.cjs +5674 -2282
  69. package/dist/router/index.d.ts +622 -243
  70. package/dist/router/index.js +1318 -872
  71. package/dist/server-errors.cjs +192 -177
  72. package/dist/server-errors.d.ts +11 -1
  73. package/dist/server-errors.js +173 -158
  74. package/dist/telemetry/index.cjs +4934 -1445
  75. package/dist/telemetry/index.d.ts +2 -1
  76. package/dist/telemetry/index.js +4966 -1475
  77. package/dist/test/index.cjs +1876 -1878
  78. package/dist/test/index.d.ts +1269 -83
  79. package/dist/test/index.js +9157 -9248
  80. package/dist/test/preview.cjs +49 -15862
  81. package/dist/test/preview.d.ts +520 -13
  82. package/dist/test/preview.js +42 -14493
  83. package/dist/theming/create.cjs +2244 -79
  84. package/dist/theming/create.js +951 -67
  85. package/dist/theming/index.cjs +3209 -1067
  86. package/dist/theming/index.js +1816 -947
  87. package/dist/types/index.cjs +4 -4
  88. package/dist/types/index.d.ts +3124 -2596
  89. package/dist/viewport/index.d.ts +502 -3
  90. package/dist/viewport/preview.d.ts +501 -0
  91. package/package.json +14 -38
  92. package/dist/test/spy.cjs +0 -258
  93. package/dist/test/spy.d.ts +0 -66
  94. package/dist/test/spy.js +0 -240
@@ -6,22 +6,21 @@ var x = (t, e) => {
6
6
  };
7
7
 
8
8
  // src/actions/preview.ts
9
- import { definePreview as N } from "storybook/preview-api";
9
+ import { definePreview as L } from "storybook/preview-api";
10
10
 
11
11
  // src/actions/addArgs.ts
12
- var l = {};
13
- x(l, {
14
- argsEnhancers: () => W
12
+ var y = {};
13
+ x(y, {
14
+ argsEnhancers: () => F
15
15
  });
16
16
 
17
17
  // src/actions/runtime/action.ts
18
18
  import { ImplicitActionsDuringRendering as I } from "storybook/internal/preview-errors";
19
19
  import { global as R } from "@storybook/global";
20
20
  import { addons as j } from "storybook/preview-api";
21
- import { v4 as P } from "uuid";
22
21
 
23
22
  // src/actions/constants.ts
24
- var m = "storybook/actions", B = `${m}/panel`, b = `${m}/action-event`, K = `${m}/action-clear`;
23
+ var m = "storybook/actions", Y = `${m}/panel`, b = `${m}/action-event`, $ = `${m}/action-clear`;
25
24
 
26
25
  // src/actions/runtime/configureActions.ts
27
26
  var E = {
@@ -34,9 +33,9 @@ var E = {
34
33
  var O = /* @__PURE__ */ n((t, e) => {
35
34
  let o = Object.getPrototypeOf(t);
36
35
  return !o || e(o) ? o : O(o, e);
37
- }, "findProto"), S = /* @__PURE__ */ n((t) => !!(typeof t == "object" && t && O(t, (e) => /^Synthetic(?:Base)?Event$/.test(e.constructor.name)) &&
38
- typeof t.persist == "function"), "isReactSyntheticEvent"), F = /* @__PURE__ */ n((t) => {
39
- if (S(t)) {
36
+ }, "findProto"), P = /* @__PURE__ */ n((t) => !!(typeof t == "object" && t && O(t, (e) => /^Synthetic(?:Base)?Event$/.test(e.constructor.name)) &&
37
+ typeof t.persist == "function"), "isReactSyntheticEvent"), S = /* @__PURE__ */ n((t) => {
38
+ if (P(t)) {
40
39
  let e = Object.create(
41
40
  t.constructor.prototype,
42
41
  Object.getOwnPropertyDescriptors(t)
@@ -49,10 +48,7 @@ typeof t.persist == "function"), "isReactSyntheticEvent"), F = /* @__PURE__ */ n
49
48
  }), e;
50
49
  }
51
50
  return t;
52
- }, "serializeArg"), C = /* @__PURE__ */ n(() => typeof crypto == "object" && typeof crypto.getRandomValues == "function" ? P() : (
53
- // pseudo random id, example response lo1e7zm4832bkr7yfl7
54
- Date.now().toString(36) + Math.random().toString(36).substring(2)
55
- ), "generateId");
51
+ }, "serializeArg");
56
52
  function g(t, e = {}) {
57
53
  let o = {
58
54
  ...E,
@@ -74,7 +70,8 @@ function g(t, e = {}) {
74
70
  throw A;
75
71
  }
76
72
  }
77
- let a = j.getChannel(), c = C(), p = 5, y = s.map(F), D = s.length > 1 ? y : y[0], k = {
73
+ let a = j.getChannel(), c = Date.now().toString(36) + Math.random().toString(36).substring(2), p = 5, l = s.map(S), D = s.length > 1 ? l :
74
+ l[0], k = {
78
75
  id: c,
79
76
  count: 0,
80
77
  data: { name: t, args: D },
@@ -90,7 +87,7 @@ function g(t, e = {}) {
90
87
  n(g, "action");
91
88
 
92
89
  // src/actions/addArgsHelpers.ts
93
- var v = /* @__PURE__ */ n((t, e) => typeof e[t] > "u" && !(t in e), "isInInitialArgs"), w = /* @__PURE__ */ n((t) => {
90
+ var w = /* @__PURE__ */ n((t, e) => typeof e[t] > "u" && !(t in e), "isInInitialArgs"), v = /* @__PURE__ */ n((t) => {
94
91
  let {
95
92
  initialArgs: e,
96
93
  argTypes: o,
@@ -102,32 +99,32 @@ var v = /* @__PURE__ */ n((t, e) => typeof e[t] > "u" && !(t in e), "isInInitial
102
99
  let s = new RegExp(i.argTypesRegex);
103
100
  return Object.entries(o).filter(
104
101
  ([c]) => !!s.test(c)
105
- ).reduce((c, [p, y]) => (v(p, e) && (c[p] = g(p, { implicit: !0, id: r })), c), {});
102
+ ).reduce((c, [p, l]) => (w(p, e) && (c[p] = g(p, { implicit: !0, id: r })), c), {});
106
103
  }, "inferActionsFromArgTypesRegex"), T = /* @__PURE__ */ n((t) => {
107
104
  let {
108
105
  initialArgs: e,
109
106
  argTypes: o,
110
107
  parameters: { actions: r }
111
108
  } = t;
112
- return r?.disable || !o ? {} : Object.entries(o).filter(([s, a]) => !!a.action).reduce((s, [a, c]) => (v(a, e) && (s[a] = g(typeof c.action ==
109
+ return r?.disable || !o ? {} : Object.entries(o).filter(([s, a]) => !!a.action).reduce((s, [a, c]) => (w(a, e) && (s[a] = g(typeof c.action ==
113
110
  "string" ? c.action : a)), s), {});
114
111
  }, "addActionsFromArgTypes");
115
112
 
116
113
  // src/actions/addArgs.ts
117
- var W = [
114
+ var F = [
118
115
  T,
119
- w
116
+ v
120
117
  ];
121
118
 
122
119
  // src/actions/loaders.ts
123
120
  var f = {};
124
121
  x(f, {
125
- loaders: () => V
122
+ loaders: () => M
126
123
  });
127
- import { onMockCall as M } from "storybook/test/spy";
128
- var _ = !1, L = /* @__PURE__ */ n((t) => {
124
+ import { onMockCall as C } from "storybook/test";
125
+ var _ = !1, W = /* @__PURE__ */ n((t) => {
129
126
  let { parameters: e } = t;
130
- e?.actions?.disable || _ || (M((o, r) => {
127
+ e?.actions?.disable || _ || (C((o, r) => {
131
128
  let i = o.getMockName();
132
129
  i !== "spy" && (!/^next\/.*::/.test(i) || [
133
130
  "next/router::useRouter()",
@@ -140,13 +137,13 @@ var _ = !1, L = /* @__PURE__ */ n((t) => {
140
137
  "next/headers::headers().delete"
141
138
  ].some((s) => i.startsWith(s))) && g(i)(r);
142
139
  }), _ = !0);
143
- }, "logActionsWhenMockCalled"), V = [L];
140
+ }, "logActionsWhenMockCalled"), M = [W];
144
141
 
145
142
  // src/actions/preview.ts
146
- var dt = /* @__PURE__ */ n(() => N({
147
- ...l,
143
+ var ct = /* @__PURE__ */ n(() => L({
144
+ ...y,
148
145
  ...f
149
146
  }), "default");
150
147
  export {
151
- dt as default
148
+ ct as default
152
149
  };