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