storybook 9.0.0-alpha.13 → 9.0.0-alpha.15
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/dist/actions/decorator.js +46 -47
- package/dist/actions/index.cjs +28 -29
- package/dist/actions/index.d.ts +0 -3
- package/dist/actions/index.js +27 -28
- package/dist/actions/preview.cjs +22 -23
- package/dist/actions/preview.js +18 -19
- package/dist/bin/index.cjs +67 -71
- package/dist/bin/index.js +56 -60
- package/dist/channels/index.cjs +1018 -948
- package/dist/channels/index.js +1194 -1161
- package/dist/cli/bin/index.cjs +1 -1
- package/dist/cli/bin/index.js +1 -1
- package/dist/cli/index.cjs +1860 -1871
- package/dist/cli/index.js +308 -319
- package/dist/common/index.cjs +43 -49
- package/dist/common/index.d.ts +0 -4
- package/dist/common/index.js +43 -49
- package/dist/components/index.cjs +6375 -12708
- package/dist/components/index.d.ts +1 -2
- package/dist/components/index.js +4647 -10782
- package/dist/core-server/index.cjs +13626 -13550
- package/dist/core-server/index.js +11863 -11787
- package/dist/core-server/presets/common-manager.js +3221 -3138
- package/dist/manager/globals-runtime.js +29817 -33554
- package/dist/manager-api/index.cjs +2518 -2330
- package/dist/manager-api/index.js +2432 -2234
- package/dist/preview/runtime.js +18415 -16011
- package/dist/preview-api/index.cjs +619 -603
- package/dist/preview-api/index.d.ts +386 -118
- package/dist/preview-api/index.js +542 -526
- package/dist/server-errors.cjs +132 -118
- package/dist/server-errors.d.ts +4 -2
- package/dist/server-errors.js +127 -113
- package/dist/test/preview.d.ts +6 -0
- package/dist/types/index.d.ts +1 -4
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var j = Object.defineProperty;
|
|
2
|
-
var r = (
|
|
2
|
+
var r = (e, o) => j(e, "name", { value: o, configurable: !0 });
|
|
3
3
|
|
|
4
4
|
// src/actions/decorator.ts
|
|
5
5
|
import { global as F } from "@storybook/global";
|
|
@@ -22,47 +22,47 @@ var a = {
|
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
// src/actions/runtime/action.ts
|
|
25
|
-
var A = /* @__PURE__ */ r((
|
|
26
|
-
let t = Object.getPrototypeOf(
|
|
27
|
-
return !t ||
|
|
28
|
-
}, "findProto"), x = /* @__PURE__ */ r((
|
|
29
|
-
typeof
|
|
30
|
-
if (x(
|
|
31
|
-
let
|
|
32
|
-
|
|
33
|
-
Object.getOwnPropertyDescriptors(
|
|
25
|
+
var A = /* @__PURE__ */ r((e, o) => {
|
|
26
|
+
let t = Object.getPrototypeOf(e);
|
|
27
|
+
return !t || o(t) ? t : A(t, o);
|
|
28
|
+
}, "findProto"), x = /* @__PURE__ */ r((e) => !!(typeof e == "object" && e && A(e, (o) => /^Synthetic(?:Base)?Event$/.test(o.constructor.name)) &&
|
|
29
|
+
typeof e.persist == "function"), "isReactSyntheticEvent"), k = /* @__PURE__ */ r((e) => {
|
|
30
|
+
if (x(e)) {
|
|
31
|
+
let o = Object.create(
|
|
32
|
+
e.constructor.prototype,
|
|
33
|
+
Object.getOwnPropertyDescriptors(e)
|
|
34
34
|
);
|
|
35
|
-
|
|
36
|
-
let t = Object.getOwnPropertyDescriptor(
|
|
37
|
-
return typeof n == "object" && n?.constructor.name === "Window" && Object.defineProperty(
|
|
35
|
+
o.persist();
|
|
36
|
+
let t = Object.getOwnPropertyDescriptor(o, "view"), n = t?.value;
|
|
37
|
+
return typeof n == "object" && n?.constructor.name === "Window" && Object.defineProperty(o, "view", {
|
|
38
38
|
...t,
|
|
39
39
|
value: Object.create(n.constructor.prototype)
|
|
40
|
-
}),
|
|
40
|
+
}), o;
|
|
41
41
|
}
|
|
42
|
-
return
|
|
42
|
+
return e;
|
|
43
43
|
}, "serializeArg"), T = /* @__PURE__ */ r(() => typeof crypto == "object" && typeof crypto.getRandomValues == "function" ? P() : (
|
|
44
44
|
// pseudo random id, example response lo1e7zm4832bkr7yfl7
|
|
45
45
|
Date.now().toString(36) + Math.random().toString(36).substring(2)
|
|
46
46
|
), "generateId");
|
|
47
|
-
function O(
|
|
47
|
+
function O(e, o = {}) {
|
|
48
48
|
let t = {
|
|
49
49
|
...a,
|
|
50
|
-
...
|
|
50
|
+
...o
|
|
51
51
|
}, n = /* @__PURE__ */ r(function(...i) {
|
|
52
|
-
if (
|
|
52
|
+
if (o.implicit) {
|
|
53
53
|
let u = ("__STORYBOOK_PREVIEW__" in E ? (
|
|
54
54
|
// eslint-disable-next-line no-underscore-dangle
|
|
55
55
|
E.__STORYBOOK_PREVIEW__
|
|
56
56
|
) : void 0)?.storyRenders.find(
|
|
57
|
-
(
|
|
57
|
+
(c) => c.phase === "playing" || c.phase === "rendering"
|
|
58
58
|
);
|
|
59
59
|
if (u) {
|
|
60
|
-
let
|
|
60
|
+
let c = !globalThis?.FEATURES?.disallowImplicitActionsInRenderV8, d = new S({
|
|
61
61
|
phase: u.phase,
|
|
62
|
-
name:
|
|
63
|
-
deprecated:
|
|
62
|
+
name: e,
|
|
63
|
+
deprecated: c
|
|
64
64
|
});
|
|
65
|
-
if (
|
|
65
|
+
if (c)
|
|
66
66
|
console.warn(d);
|
|
67
67
|
else
|
|
68
68
|
throw d;
|
|
@@ -71,23 +71,22 @@ function O(o, e = {}) {
|
|
|
71
71
|
let m = I.getChannel(), p = T(), l = 5, f = i.map(k), R = i.length > 1 ? f : f[0], D = {
|
|
72
72
|
id: p,
|
|
73
73
|
count: 0,
|
|
74
|
-
data: { name:
|
|
74
|
+
data: { name: e, args: R },
|
|
75
75
|
options: {
|
|
76
76
|
...t,
|
|
77
|
-
maxDepth: l + (t.depth || 3)
|
|
78
|
-
allowFunction: t.allowFunction || !1
|
|
77
|
+
maxDepth: l + (t.depth || 3)
|
|
79
78
|
}
|
|
80
79
|
};
|
|
81
80
|
m.emit(g, D);
|
|
82
81
|
}, "actionHandler");
|
|
83
|
-
return n.isAction = !0, n.implicit =
|
|
82
|
+
return n.isAction = !0, n.implicit = o.implicit, n;
|
|
84
83
|
}
|
|
85
84
|
r(O, "action");
|
|
86
85
|
|
|
87
86
|
// src/actions/runtime/actions.ts
|
|
88
|
-
var b = /* @__PURE__ */ r((...
|
|
89
|
-
let
|
|
90
|
-
t.length === 1 && Array.isArray(t[0]) && ([t] = t), t.length !== 1 && typeof t[t.length - 1] != "string" && (
|
|
87
|
+
var b = /* @__PURE__ */ r((...e) => {
|
|
88
|
+
let o = a, t = e;
|
|
89
|
+
t.length === 1 && Array.isArray(t[0]) && ([t] = t), t.length !== 1 && typeof t[t.length - 1] != "string" && (o = {
|
|
91
90
|
...a,
|
|
92
91
|
...t.pop()
|
|
93
92
|
});
|
|
@@ -95,44 +94,44 @@ var b = /* @__PURE__ */ r((...o) => {
|
|
|
95
94
|
(t.length !== 1 || typeof n == "string") && (n = {}, t.forEach((i) => {
|
|
96
95
|
n[i] = i;
|
|
97
96
|
}));
|
|
98
|
-
let
|
|
97
|
+
let s = {};
|
|
99
98
|
return Object.keys(n).forEach((i) => {
|
|
100
|
-
|
|
101
|
-
}),
|
|
99
|
+
s[i] = O(n[i], o);
|
|
100
|
+
}), s;
|
|
102
101
|
}, "actions");
|
|
103
102
|
|
|
104
103
|
// src/actions/decorator.ts
|
|
105
104
|
var { document: v, Element: w } = F, N = /^(\S+)\s*(.*)$/, V = w != null && !w.prototype.matches, Y = V ? "msMatchesSelector" : "matches", _ = /* @__PURE__ */ r(
|
|
106
|
-
(
|
|
107
|
-
if (
|
|
105
|
+
(e, o) => {
|
|
106
|
+
if (e[Y](o))
|
|
108
107
|
return !0;
|
|
109
|
-
let t =
|
|
110
|
-
return t ? _(t,
|
|
111
|
-
}, "hasMatchInAncestry"), $ = /* @__PURE__ */ r((
|
|
112
|
-
let t =
|
|
113
|
-
return Object.entries(t).map(([n,
|
|
108
|
+
let t = e.parentElement;
|
|
109
|
+
return t ? _(t, o) : !1;
|
|
110
|
+
}, "hasMatchInAncestry"), $ = /* @__PURE__ */ r((e, ...o) => {
|
|
111
|
+
let t = e(...o);
|
|
112
|
+
return Object.entries(t).map(([n, s]) => {
|
|
114
113
|
let [i, m, p] = n.match(N) || [];
|
|
115
114
|
return {
|
|
116
115
|
eventName: m,
|
|
117
116
|
handler: /* @__PURE__ */ r((l) => {
|
|
118
|
-
(!p || _(l.target, p)) &&
|
|
117
|
+
(!p || _(l.target, p)) && s(l);
|
|
119
118
|
}, "handler")
|
|
120
119
|
};
|
|
121
120
|
});
|
|
122
|
-
}, "createHandlers"), B = /* @__PURE__ */ r((
|
|
121
|
+
}, "createHandlers"), B = /* @__PURE__ */ r((e, ...o) => {
|
|
123
122
|
let t = v && v.getElementById("storybook-root");
|
|
124
123
|
C(() => {
|
|
125
124
|
if (t != null) {
|
|
126
|
-
let n = $(
|
|
127
|
-
return n.forEach(({ eventName:
|
|
128
|
-
|
|
125
|
+
let n = $(e, ...o);
|
|
126
|
+
return n.forEach(({ eventName: s, handler: i }) => t.addEventListener(s, i)), () => n.forEach(({ eventName: s, handler: i }) => t.removeEventListener(
|
|
127
|
+
s, i));
|
|
129
128
|
}
|
|
130
|
-
}, [t,
|
|
129
|
+
}, [t, e, o]);
|
|
131
130
|
}, "applyEventHandlers"), mt = M({
|
|
132
131
|
name: "withActions",
|
|
133
132
|
parameterName: h,
|
|
134
133
|
skipIfNoParametersOrOptions: !0,
|
|
135
|
-
wrapper: /* @__PURE__ */ r((
|
|
134
|
+
wrapper: /* @__PURE__ */ r((e, o, { parameters: t }) => (t?.handles && B(b, ...t.handles), e(o)), "wrapper")
|
|
136
135
|
});
|
|
137
136
|
export {
|
|
138
137
|
mt as withActions
|
package/dist/actions/index.cjs
CHANGED
|
@@ -3,14 +3,14 @@ var a = Object.defineProperty;
|
|
|
3
3
|
var x = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var R = Object.getOwnPropertyNames;
|
|
5
5
|
var j = Object.prototype.hasOwnProperty;
|
|
6
|
-
var
|
|
6
|
+
var r = (t, o) => a(t, "name", { value: o, configurable: !0 });
|
|
7
7
|
var I = (t, o) => {
|
|
8
8
|
for (var n in o)
|
|
9
9
|
a(t, n, { get: o[n], enumerable: !0 });
|
|
10
10
|
}, P = (t, o, n, e) => {
|
|
11
11
|
if (o && typeof o == "object" || typeof o == "function")
|
|
12
|
-
for (let
|
|
13
|
-
!j.call(t,
|
|
12
|
+
for (let i of R(o))
|
|
13
|
+
!j.call(t, i) && i !== n && a(t, i, { get: () => o[i], enumerable: !(e = x(o, i)) || e.enumerable });
|
|
14
14
|
return t;
|
|
15
15
|
};
|
|
16
16
|
var S = (t) => P(a({}, "__esModule", { value: !0 }), t);
|
|
@@ -18,13 +18,13 @@ var S = (t) => P(a({}, "__esModule", { value: !0 }), t);
|
|
|
18
18
|
// src/actions/index.ts
|
|
19
19
|
var K = {};
|
|
20
20
|
I(K, {
|
|
21
|
-
ADDON_ID: () =>
|
|
22
|
-
CLEAR_ID: () =>
|
|
23
|
-
CYCLIC_KEY: () =>
|
|
24
|
-
EVENT_ID: () =>
|
|
21
|
+
ADDON_ID: () => m,
|
|
22
|
+
CLEAR_ID: () => C,
|
|
23
|
+
CYCLIC_KEY: () => F,
|
|
24
|
+
EVENT_ID: () => y,
|
|
25
25
|
PANEL_ID: () => k,
|
|
26
26
|
PARAM_KEY: () => T,
|
|
27
|
-
action: () =>
|
|
27
|
+
action: () => l,
|
|
28
28
|
actions: () => B,
|
|
29
29
|
config: () => s,
|
|
30
30
|
configureActions: () => V
|
|
@@ -32,26 +32,26 @@ I(K, {
|
|
|
32
32
|
module.exports = S(K);
|
|
33
33
|
|
|
34
34
|
// src/actions/constants.ts
|
|
35
|
-
var T = "actions",
|
|
35
|
+
var T = "actions", m = "storybook/actions", k = `${m}/panel`, y = `${m}/action-event`, C = `${m}/action-clear`, F = "$___storybook.isCyclic";
|
|
36
36
|
|
|
37
37
|
// src/actions/runtime/action.ts
|
|
38
|
-
var A = require("storybook/internal/preview-errors"),
|
|
38
|
+
var A = require("storybook/internal/preview-errors"), f = require("@storybook/global"), O = require("storybook/preview-api"), h = require("uuid");
|
|
39
39
|
|
|
40
40
|
// src/actions/runtime/configureActions.ts
|
|
41
41
|
var s = {
|
|
42
42
|
depth: 10,
|
|
43
43
|
clearOnStoryChange: !0,
|
|
44
44
|
limit: 50
|
|
45
|
-
}, V = /* @__PURE__ */
|
|
45
|
+
}, V = /* @__PURE__ */ r((t = {}) => {
|
|
46
46
|
Object.assign(s, t);
|
|
47
47
|
}, "configureActions");
|
|
48
48
|
|
|
49
49
|
// src/actions/runtime/action.ts
|
|
50
|
-
var b = /* @__PURE__ */
|
|
50
|
+
var b = /* @__PURE__ */ r((t, o) => {
|
|
51
51
|
let n = Object.getPrototypeOf(t);
|
|
52
52
|
return !n || o(n) ? n : b(n, o);
|
|
53
|
-
}, "findProto"), W = /* @__PURE__ */
|
|
54
|
-
typeof t.persist == "function"), "isReactSyntheticEvent"), Y = /* @__PURE__ */
|
|
53
|
+
}, "findProto"), W = /* @__PURE__ */ r((t) => !!(typeof t == "object" && t && b(t, (o) => /^Synthetic(?:Base)?Event$/.test(o.constructor.name)) &&
|
|
54
|
+
typeof t.persist == "function"), "isReactSyntheticEvent"), Y = /* @__PURE__ */ r((t) => {
|
|
55
55
|
if (W(t)) {
|
|
56
56
|
let o = Object.create(
|
|
57
57
|
t.constructor.prototype,
|
|
@@ -65,19 +65,19 @@ typeof t.persist == "function"), "isReactSyntheticEvent"), Y = /* @__PURE__ */ i
|
|
|
65
65
|
}), o;
|
|
66
66
|
}
|
|
67
67
|
return t;
|
|
68
|
-
}, "serializeArg"), $ = /* @__PURE__ */
|
|
68
|
+
}, "serializeArg"), $ = /* @__PURE__ */ r(() => typeof crypto == "object" && typeof crypto.getRandomValues == "function" ? (0, h.v4)() : (
|
|
69
69
|
// pseudo random id, example response lo1e7zm4832bkr7yfl7
|
|
70
70
|
Date.now().toString(36) + Math.random().toString(36).substring(2)
|
|
71
71
|
), "generateId");
|
|
72
|
-
function
|
|
72
|
+
function l(t, o = {}) {
|
|
73
73
|
let n = {
|
|
74
74
|
...s,
|
|
75
75
|
...o
|
|
76
|
-
}, e = /* @__PURE__ */
|
|
76
|
+
}, e = /* @__PURE__ */ r(function(...c) {
|
|
77
77
|
if (o.implicit) {
|
|
78
|
-
let d = ("__STORYBOOK_PREVIEW__" in
|
|
78
|
+
let d = ("__STORYBOOK_PREVIEW__" in f.global ? (
|
|
79
79
|
// eslint-disable-next-line no-underscore-dangle
|
|
80
|
-
|
|
80
|
+
f.global.__STORYBOOK_PREVIEW__
|
|
81
81
|
) : void 0)?.storyRenders.find(
|
|
82
82
|
(p) => p.phase === "playing" || p.phase === "rendering"
|
|
83
83
|
);
|
|
@@ -93,24 +93,23 @@ function y(t, o = {}) {
|
|
|
93
93
|
throw g;
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
let
|
|
97
|
-
id:
|
|
96
|
+
let E = O.addons.getChannel(), v = $(), w = 5, u = c.map(Y), _ = c.length > 1 ? u : u[0], D = {
|
|
97
|
+
id: v,
|
|
98
98
|
count: 0,
|
|
99
99
|
data: { name: t, args: _ },
|
|
100
100
|
options: {
|
|
101
101
|
...n,
|
|
102
|
-
maxDepth:
|
|
103
|
-
allowFunction: n.allowFunction || !1
|
|
102
|
+
maxDepth: w + (n.depth || 3)
|
|
104
103
|
}
|
|
105
104
|
};
|
|
106
|
-
|
|
105
|
+
E.emit(y, D);
|
|
107
106
|
}, "actionHandler");
|
|
108
107
|
return e.isAction = !0, e.implicit = o.implicit, e;
|
|
109
108
|
}
|
|
110
|
-
|
|
109
|
+
r(l, "action");
|
|
111
110
|
|
|
112
111
|
// src/actions/runtime/actions.ts
|
|
113
|
-
var B = /* @__PURE__ */
|
|
112
|
+
var B = /* @__PURE__ */ r((...t) => {
|
|
114
113
|
let o = s, n = t;
|
|
115
114
|
n.length === 1 && Array.isArray(n[0]) && ([n] = n), n.length !== 1 && typeof n[n.length - 1] != "string" && (o = {
|
|
116
115
|
...s,
|
|
@@ -120,8 +119,8 @@ var B = /* @__PURE__ */ i((...t) => {
|
|
|
120
119
|
(n.length !== 1 || typeof e == "string") && (e = {}, n.forEach((c) => {
|
|
121
120
|
e[c] = c;
|
|
122
121
|
}));
|
|
123
|
-
let
|
|
122
|
+
let i = {};
|
|
124
123
|
return Object.keys(e).forEach((c) => {
|
|
125
|
-
|
|
126
|
-
}),
|
|
124
|
+
i[c] = l(e[c], o);
|
|
125
|
+
}), i;
|
|
127
126
|
}, "actions");
|
package/dist/actions/index.d.ts
CHANGED
|
@@ -7,15 +7,12 @@ declare const CYCLIC_KEY = "$___storybook.isCyclic";
|
|
|
7
7
|
|
|
8
8
|
interface Options$1 {
|
|
9
9
|
allowRegExp: boolean;
|
|
10
|
-
allowFunction: boolean;
|
|
11
10
|
allowSymbol: boolean;
|
|
12
11
|
allowDate: boolean;
|
|
13
12
|
allowUndefined: boolean;
|
|
14
|
-
allowClass: boolean;
|
|
15
13
|
allowError: boolean;
|
|
16
14
|
maxDepth: number;
|
|
17
15
|
space: number | undefined;
|
|
18
|
-
lazyEval: boolean;
|
|
19
16
|
}
|
|
20
17
|
|
|
21
18
|
interface Options {
|
package/dist/actions/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var v = Object.defineProperty;
|
|
2
|
+
var r = (o, n) => v(o, "name", { value: n, configurable: !0 });
|
|
3
3
|
|
|
4
4
|
// src/actions/constants.ts
|
|
5
|
-
var S = "actions", a = "storybook/actions", T = `${a}/panel`,
|
|
5
|
+
var S = "actions", a = "storybook/actions", T = `${a}/panel`, l = `${a}/action-event`, k = `${a}/action-clear`, C = "$___storybook.isCyclic";
|
|
6
6
|
|
|
7
7
|
// src/actions/runtime/action.ts
|
|
8
|
-
import { ImplicitActionsDuringRendering as
|
|
8
|
+
import { ImplicitActionsDuringRendering as w } from "storybook/internal/preview-errors";
|
|
9
9
|
import { global as u } from "@storybook/global";
|
|
10
10
|
import { addons as _ } from "storybook/preview-api";
|
|
11
11
|
import { v4 as D } from "uuid";
|
|
@@ -15,16 +15,16 @@ var c = {
|
|
|
15
15
|
depth: 10,
|
|
16
16
|
clearOnStoryChange: !0,
|
|
17
17
|
limit: 50
|
|
18
|
-
}, V = /* @__PURE__ */
|
|
18
|
+
}, V = /* @__PURE__ */ r((o = {}) => {
|
|
19
19
|
Object.assign(c, o);
|
|
20
20
|
}, "configureActions");
|
|
21
21
|
|
|
22
22
|
// src/actions/runtime/action.ts
|
|
23
|
-
var d = /* @__PURE__ */
|
|
23
|
+
var d = /* @__PURE__ */ r((o, n) => {
|
|
24
24
|
let t = Object.getPrototypeOf(o);
|
|
25
25
|
return !t || n(t) ? t : d(t, n);
|
|
26
|
-
}, "findProto"), x = /* @__PURE__ */
|
|
27
|
-
typeof o.persist == "function"), "isReactSyntheticEvent"), R = /* @__PURE__ */
|
|
26
|
+
}, "findProto"), x = /* @__PURE__ */ r((o) => !!(typeof o == "object" && o && d(o, (n) => /^Synthetic(?:Base)?Event$/.test(n.constructor.name)) &&
|
|
27
|
+
typeof o.persist == "function"), "isReactSyntheticEvent"), R = /* @__PURE__ */ r((o) => {
|
|
28
28
|
if (x(o)) {
|
|
29
29
|
let n = Object.create(
|
|
30
30
|
o.constructor.prototype,
|
|
@@ -38,7 +38,7 @@ typeof o.persist == "function"), "isReactSyntheticEvent"), R = /* @__PURE__ */ i
|
|
|
38
38
|
}), n;
|
|
39
39
|
}
|
|
40
40
|
return o;
|
|
41
|
-
}, "serializeArg"), j = /* @__PURE__ */
|
|
41
|
+
}, "serializeArg"), j = /* @__PURE__ */ r(() => typeof crypto == "object" && typeof crypto.getRandomValues == "function" ? D() : (
|
|
42
42
|
// pseudo random id, example response lo1e7zm4832bkr7yfl7
|
|
43
43
|
Date.now().toString(36) + Math.random().toString(36).substring(2)
|
|
44
44
|
), "generateId");
|
|
@@ -46,63 +46,62 @@ function g(o, n = {}) {
|
|
|
46
46
|
let t = {
|
|
47
47
|
...c,
|
|
48
48
|
...n
|
|
49
|
-
}, e = /* @__PURE__ */
|
|
49
|
+
}, e = /* @__PURE__ */ r(function(...i) {
|
|
50
50
|
if (n.implicit) {
|
|
51
|
-
let
|
|
51
|
+
let y = ("__STORYBOOK_PREVIEW__" in u ? (
|
|
52
52
|
// eslint-disable-next-line no-underscore-dangle
|
|
53
53
|
u.__STORYBOOK_PREVIEW__
|
|
54
54
|
) : void 0)?.storyRenders.find(
|
|
55
55
|
(s) => s.phase === "playing" || s.phase === "rendering"
|
|
56
56
|
);
|
|
57
|
-
if (
|
|
58
|
-
let s = !globalThis?.FEATURES?.disallowImplicitActionsInRenderV8,
|
|
59
|
-
phase:
|
|
57
|
+
if (y) {
|
|
58
|
+
let s = !globalThis?.FEATURES?.disallowImplicitActionsInRenderV8, f = new w({
|
|
59
|
+
phase: y.phase,
|
|
60
60
|
name: o,
|
|
61
61
|
deprecated: s
|
|
62
62
|
});
|
|
63
63
|
if (s)
|
|
64
|
-
console.warn(
|
|
64
|
+
console.warn(f);
|
|
65
65
|
else
|
|
66
|
-
throw
|
|
66
|
+
throw f;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
let A = _.getChannel(), O = j(), h = 5,
|
|
69
|
+
let A = _.getChannel(), O = j(), h = 5, m = i.map(R), b = i.length > 1 ? m : m[0], E = {
|
|
70
70
|
id: O,
|
|
71
71
|
count: 0,
|
|
72
72
|
data: { name: o, args: b },
|
|
73
73
|
options: {
|
|
74
74
|
...t,
|
|
75
|
-
maxDepth: h + (t.depth || 3)
|
|
76
|
-
allowFunction: t.allowFunction || !1
|
|
75
|
+
maxDepth: h + (t.depth || 3)
|
|
77
76
|
}
|
|
78
77
|
};
|
|
79
|
-
A.emit(
|
|
78
|
+
A.emit(l, E);
|
|
80
79
|
}, "actionHandler");
|
|
81
80
|
return e.isAction = !0, e.implicit = n.implicit, e;
|
|
82
81
|
}
|
|
83
|
-
|
|
82
|
+
r(g, "action");
|
|
84
83
|
|
|
85
84
|
// src/actions/runtime/actions.ts
|
|
86
|
-
var G = /* @__PURE__ */
|
|
85
|
+
var G = /* @__PURE__ */ r((...o) => {
|
|
87
86
|
let n = c, t = o;
|
|
88
87
|
t.length === 1 && Array.isArray(t[0]) && ([t] = t), t.length !== 1 && typeof t[t.length - 1] != "string" && (n = {
|
|
89
88
|
...c,
|
|
90
89
|
...t.pop()
|
|
91
90
|
});
|
|
92
91
|
let e = t[0];
|
|
93
|
-
(t.length !== 1 || typeof e == "string") && (e = {}, t.forEach((
|
|
94
|
-
e[
|
|
92
|
+
(t.length !== 1 || typeof e == "string") && (e = {}, t.forEach((i) => {
|
|
93
|
+
e[i] = i;
|
|
95
94
|
}));
|
|
96
95
|
let p = {};
|
|
97
|
-
return Object.keys(e).forEach((
|
|
98
|
-
p[
|
|
96
|
+
return Object.keys(e).forEach((i) => {
|
|
97
|
+
p[i] = g(e[i], n);
|
|
99
98
|
}), p;
|
|
100
99
|
}, "actions");
|
|
101
100
|
export {
|
|
102
101
|
a as ADDON_ID,
|
|
103
102
|
k as CLEAR_ID,
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
C as CYCLIC_KEY,
|
|
104
|
+
l as EVENT_ID,
|
|
106
105
|
T as PANEL_ID,
|
|
107
106
|
S as PARAM_KEY,
|
|
108
107
|
g as action,
|
package/dist/actions/preview.cjs
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
2
|
+
var y = Object.defineProperty;
|
|
3
3
|
var C = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var W = Object.getOwnPropertyNames;
|
|
5
5
|
var M = Object.prototype.hasOwnProperty;
|
|
6
|
-
var i = (e, t) =>
|
|
7
|
-
var
|
|
6
|
+
var i = (e, t) => y(e, "name", { value: t, configurable: !0 });
|
|
7
|
+
var l = (e, t) => {
|
|
8
8
|
for (var o in t)
|
|
9
|
-
|
|
9
|
+
y(e, o, { get: t[o], enumerable: !0 });
|
|
10
10
|
}, L = (e, t, o, r) => {
|
|
11
11
|
if (t && typeof t == "object" || typeof t == "function")
|
|
12
12
|
for (let n of W(t))
|
|
13
|
-
!M.call(e, n) && n !== o &&
|
|
13
|
+
!M.call(e, n) && n !== o && y(e, n, { get: () => t[n], enumerable: !(r = C(t, n)) || r.enumerable });
|
|
14
14
|
return e;
|
|
15
15
|
};
|
|
16
|
-
var V = (e) => L(
|
|
16
|
+
var V = (e) => L(y({}, "__esModule", { value: !0 }), e);
|
|
17
17
|
|
|
18
18
|
// src/actions/preview.ts
|
|
19
19
|
var U = {};
|
|
20
|
-
|
|
20
|
+
l(U, {
|
|
21
21
|
default: () => H
|
|
22
22
|
});
|
|
23
23
|
module.exports = V(U);
|
|
24
|
-
var
|
|
24
|
+
var P = require("storybook/preview-api");
|
|
25
25
|
|
|
26
26
|
// src/actions/addArgs.ts
|
|
27
27
|
var A = {};
|
|
28
|
-
|
|
28
|
+
l(A, {
|
|
29
29
|
argsEnhancers: () => B
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
// src/actions/runtime/action.ts
|
|
33
|
-
var O = require("storybook/internal/preview-errors"), u = require("@storybook/global"),
|
|
33
|
+
var O = require("storybook/internal/preview-errors"), u = require("@storybook/global"), v = require("storybook/preview-api"), w = require("uuid");
|
|
34
34
|
|
|
35
35
|
// src/actions/constants.ts
|
|
36
36
|
var f = "storybook/actions", J = `${f}/panel`, E = `${f}/action-event`, Q = `${f}/action-clear`;
|
|
@@ -61,11 +61,11 @@ typeof e.persist == "function"), "isReactSyntheticEvent"), Y = /* @__PURE__ */ i
|
|
|
61
61
|
}), t;
|
|
62
62
|
}
|
|
63
63
|
return e;
|
|
64
|
-
}, "serializeArg"), $ = /* @__PURE__ */ i(() => typeof crypto == "object" && typeof crypto.getRandomValues == "function" ? (0,
|
|
64
|
+
}, "serializeArg"), $ = /* @__PURE__ */ i(() => typeof crypto == "object" && typeof crypto.getRandomValues == "function" ? (0, w.v4)() : (
|
|
65
65
|
// pseudo random id, example response lo1e7zm4832bkr7yfl7
|
|
66
66
|
Date.now().toString(36) + Math.random().toString(36).substring(2)
|
|
67
67
|
), "generateId");
|
|
68
|
-
function
|
|
68
|
+
function g(e, t = {}) {
|
|
69
69
|
let o = {
|
|
70
70
|
...R,
|
|
71
71
|
...t
|
|
@@ -89,21 +89,20 @@ function l(e, t = {}) {
|
|
|
89
89
|
throw b;
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
let a =
|
|
92
|
+
let a = v.addons.getChannel(), c = $(), p = 5, m = s.map(Y), S = s.length > 1 ? m : m[0], F = {
|
|
93
93
|
id: c,
|
|
94
94
|
count: 0,
|
|
95
|
-
data: { name: e, args:
|
|
95
|
+
data: { name: e, args: S },
|
|
96
96
|
options: {
|
|
97
97
|
...o,
|
|
98
|
-
maxDepth: p + (o.depth || 3)
|
|
99
|
-
allowFunction: o.allowFunction || !1
|
|
98
|
+
maxDepth: p + (o.depth || 3)
|
|
100
99
|
}
|
|
101
100
|
};
|
|
102
|
-
a.emit(E,
|
|
101
|
+
a.emit(E, F);
|
|
103
102
|
}, "actionHandler");
|
|
104
103
|
return r.isAction = !0, r.implicit = t.implicit, r;
|
|
105
104
|
}
|
|
106
|
-
i(
|
|
105
|
+
i(g, "action");
|
|
107
106
|
|
|
108
107
|
// src/actions/addArgsHelpers.ts
|
|
109
108
|
var _ = /* @__PURE__ */ i((e, t) => typeof t[e] > "u" && !(e in t), "isInInitialArgs"), D = /* @__PURE__ */ i((e) => {
|
|
@@ -118,14 +117,14 @@ var _ = /* @__PURE__ */ i((e, t) => typeof t[e] > "u" && !(e in t), "isInInitial
|
|
|
118
117
|
let s = new RegExp(n.argTypesRegex);
|
|
119
118
|
return Object.entries(o).filter(
|
|
120
119
|
([c]) => !!s.test(c)
|
|
121
|
-
).reduce((c, [p,
|
|
120
|
+
).reduce((c, [p, m]) => (_(p, t) && (c[p] = g(p, { implicit: !0, id: r })), c), {});
|
|
122
121
|
}, "inferActionsFromArgTypesRegex"), k = /* @__PURE__ */ i((e) => {
|
|
123
122
|
let {
|
|
124
123
|
initialArgs: t,
|
|
125
124
|
argTypes: o,
|
|
126
125
|
parameters: { actions: r }
|
|
127
126
|
} = e;
|
|
128
|
-
return r?.disable || !o ? {} : Object.entries(o).filter(([s, a]) => !!a.action).reduce((s, [a, c]) => (_(a, t) && (s[a] =
|
|
127
|
+
return r?.disable || !o ? {} : Object.entries(o).filter(([s, a]) => !!a.action).reduce((s, [a, c]) => (_(a, t) && (s[a] = g(typeof c.action ==
|
|
129
128
|
"string" ? c.action : a)), s), {});
|
|
130
129
|
}, "addActionsFromArgTypes");
|
|
131
130
|
|
|
@@ -137,7 +136,7 @@ var B = [
|
|
|
137
136
|
|
|
138
137
|
// src/actions/loaders.ts
|
|
139
138
|
var h = {};
|
|
140
|
-
|
|
139
|
+
l(h, {
|
|
141
140
|
loaders: () => z
|
|
142
141
|
});
|
|
143
142
|
var j = require("storybook/test/spy");
|
|
@@ -154,12 +153,12 @@ var I = !1, K = /* @__PURE__ */ i((e) => {
|
|
|
154
153
|
"next/headers::cookies().delete",
|
|
155
154
|
"next/headers::headers().set",
|
|
156
155
|
"next/headers::headers().delete"
|
|
157
|
-
].some((s) => n.startsWith(s))) &&
|
|
156
|
+
].some((s) => n.startsWith(s))) && g(n)(r);
|
|
158
157
|
}), I = !0);
|
|
159
158
|
}, "logActionsWhenMockCalled"), z = [K];
|
|
160
159
|
|
|
161
160
|
// src/actions/preview.ts
|
|
162
|
-
var H = /* @__PURE__ */ i(() => (0,
|
|
161
|
+
var H = /* @__PURE__ */ i(() => (0, P.definePreview)({
|
|
163
162
|
...A,
|
|
164
163
|
...h
|
|
165
164
|
}), "default");
|