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
|
@@ -197,7 +197,8 @@
|
|
|
197
197
|
line-height: 19px;
|
|
198
198
|
border-radius: 4px;
|
|
199
199
|
|
|
200
|
-
font-family:
|
|
200
|
+
font-family:
|
|
201
|
+
'Operator Mono', 'Fira Code Retina', 'Fira Code', 'FiraCode-Retina', 'Andale Mono',
|
|
201
202
|
'Lucida Console', Consolas, Monaco, monospace;
|
|
202
203
|
margin: 0;
|
|
203
204
|
overflow: auto;
|
|
@@ -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
|
};
|