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.
- package/assets/server/base-preview-head.html +2 -1
- package/dist/actions/decorator.js +49 -52
- package/dist/actions/index.cjs +42 -44
- package/dist/actions/index.js +37 -40
- package/dist/actions/preview.cjs +44 -46
- package/dist/actions/preview.d.ts +501 -0
- package/dist/actions/preview.js +24 -27
- package/dist/babel/index.cjs +15060 -14974
- package/dist/babel/index.d.ts +37 -18
- package/dist/babel/index.js +15097 -15011
- package/dist/backgrounds/index.d.ts +501 -0
- package/dist/backgrounds/preview.d.ts +501 -0
- package/dist/bin/index.cjs +44 -44
- package/dist/bin/index.js +44 -44
- package/dist/builder-manager/index.cjs +303 -283
- package/dist/builder-manager/index.js +545 -524
- package/dist/channels/index.js +919 -941
- package/dist/cli/bin/index.cjs +4184 -736
- package/dist/cli/bin/index.js +4198 -748
- package/dist/cli/index.cjs +36838 -28392
- package/dist/cli/index.d.ts +974 -1
- package/dist/cli/index.js +41620 -33168
- package/dist/client-logger/index.d.ts +2 -1
- package/dist/common/index.cjs +4783 -4691
- package/dist/common/index.d.ts +8 -2
- package/dist/common/index.js +5165 -5069
- package/dist/components/index.cjs +7905 -5600
- package/dist/components/index.d.ts +12 -12
- package/dist/components/index.js +4713 -3786
- package/dist/controls/preview.d.ts +501 -0
- package/dist/core-server/index.cjs +6799 -6708
- package/dist/core-server/index.d.ts +526 -25
- package/dist/core-server/index.js +6948 -6851
- package/dist/core-server/presets/common-manager.js +4528 -3377
- package/dist/core-server/presets/common-override-preset.cjs +10 -12
- package/dist/core-server/presets/common-override-preset.js +3 -5
- package/dist/core-server/presets/common-preset.cjs +2301 -2238
- package/dist/core-server/presets/common-preset.js +2389 -2322
- package/dist/docs-tools/index.cjs +484 -464
- package/dist/docs-tools/index.js +781 -768
- package/dist/highlight/index.cjs +19 -18
- package/dist/highlight/index.d.ts +4 -5
- package/dist/highlight/index.js +3 -2
- package/dist/highlight/preview.cjs +314 -310
- package/dist/highlight/preview.d.ts +501 -0
- package/dist/highlight/preview.js +296 -292
- package/dist/instrumenter/index.cjs +561 -559
- package/dist/instrumenter/index.js +1564 -1516
- package/dist/manager/globals-module-info.cjs +2 -0
- package/dist/manager/globals-module-info.js +2 -0
- package/dist/manager/globals-runtime.js +23602 -23339
- package/dist/manager/runtime.js +4891 -4650
- package/dist/manager-api/index.cjs +2400 -2321
- package/dist/manager-api/index.d.ts +513 -1
- package/dist/manager-api/index.js +1951 -1903
- package/dist/manager-errors.js +37 -41
- package/dist/measure/index.d.ts +501 -0
- package/dist/measure/preview.d.ts +501 -0
- package/dist/node-logger/index.cjs +25 -25
- package/dist/node-logger/index.js +25 -25
- package/dist/outline/index.d.ts +501 -0
- package/dist/outline/preview.d.ts +501 -0
- package/dist/preview/runtime.js +35803 -35785
- package/dist/preview-api/index.cjs +1287 -1265
- package/dist/preview-api/index.d.ts +1 -1
- package/dist/preview-api/index.js +1367 -1361
- package/dist/preview-errors.js +152 -173
- package/dist/router/index.cjs +5674 -2282
- package/dist/router/index.d.ts +622 -243
- package/dist/router/index.js +1318 -872
- package/dist/server-errors.cjs +192 -177
- package/dist/server-errors.d.ts +11 -1
- package/dist/server-errors.js +173 -158
- package/dist/telemetry/index.cjs +4934 -1445
- package/dist/telemetry/index.d.ts +2 -1
- package/dist/telemetry/index.js +4966 -1475
- package/dist/test/index.cjs +1876 -1878
- package/dist/test/index.d.ts +1269 -83
- package/dist/test/index.js +9157 -9248
- package/dist/test/preview.cjs +49 -15862
- package/dist/test/preview.d.ts +520 -13
- package/dist/test/preview.js +42 -14493
- package/dist/theming/create.cjs +2244 -79
- package/dist/theming/create.js +951 -67
- package/dist/theming/index.cjs +3209 -1067
- package/dist/theming/index.js +1816 -947
- package/dist/types/index.cjs +4 -4
- package/dist/types/index.d.ts +3124 -2596
- package/dist/viewport/index.d.ts +502 -3
- package/dist/viewport/preview.d.ts +501 -0
- package/package.json +14 -38
- package/dist/test/spy.cjs +0 -258
- package/dist/test/spy.d.ts +0 -66
- package/dist/test/spy.js +0 -240
package/dist/actions/preview.js
CHANGED
|
@@ -6,22 +6,21 @@ var x = (t, e) => {
|
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
// src/actions/preview.ts
|
|
9
|
-
import { definePreview as
|
|
9
|
+
import { definePreview as L } from "storybook/preview-api";
|
|
10
10
|
|
|
11
11
|
// src/actions/addArgs.ts
|
|
12
|
-
var
|
|
13
|
-
x(
|
|
14
|
-
argsEnhancers: () =>
|
|
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",
|
|
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"),
|
|
38
|
-
typeof t.persist == "function"), "isReactSyntheticEvent"),
|
|
39
|
-
if (
|
|
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")
|
|
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 =
|
|
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
|
|
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,
|
|
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]) => (
|
|
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
|
|
114
|
+
var F = [
|
|
118
115
|
T,
|
|
119
|
-
|
|
116
|
+
v
|
|
120
117
|
];
|
|
121
118
|
|
|
122
119
|
// src/actions/loaders.ts
|
|
123
120
|
var f = {};
|
|
124
121
|
x(f, {
|
|
125
|
-
loaders: () =>
|
|
122
|
+
loaders: () => M
|
|
126
123
|
});
|
|
127
|
-
import { onMockCall as
|
|
128
|
-
var _ = !1,
|
|
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 || _ || (
|
|
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"),
|
|
140
|
+
}, "logActionsWhenMockCalled"), M = [W];
|
|
144
141
|
|
|
145
142
|
// src/actions/preview.ts
|
|
146
|
-
var
|
|
147
|
-
...
|
|
143
|
+
var ct = /* @__PURE__ */ n(() => L({
|
|
144
|
+
...y,
|
|
148
145
|
...f
|
|
149
146
|
}), "default");
|
|
150
147
|
export {
|
|
151
|
-
|
|
148
|
+
ct as default
|
|
152
149
|
};
|