storybook 9.0.0-alpha.8 → 9.0.0-beta.0
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/docs/addon-backgrounds.gif +0 -0
- package/assets/docs/addon-controls-args-annotated.png +0 -0
- package/assets/docs/addon-controls-args-background-color.png +0 -0
- package/assets/docs/addon-controls-args-background-string.png +0 -0
- package/assets/docs/addon-controls-args-docs.png +0 -0
- package/assets/docs/addon-controls-args-logging.png +0 -0
- package/assets/docs/addon-controls-args-no-annotation.png +0 -0
- package/assets/docs/addon-controls-args-reflow-slider.png +0 -0
- package/assets/docs/addon-controls-args-reflow.png +0 -0
- package/assets/docs/addon-controls-args-template.png +0 -0
- package/assets/docs/addon-controls-expanded.png +0 -0
- package/assets/docs/addon-controls-hero.gif +0 -0
- package/assets/docs/addon-controls-install.png +0 -0
- package/assets/docs/hero.gif +0 -0
- package/assets/docs/highlight.png +0 -0
- package/assets/docs/viewport.png +0 -0
- package/assets/server/base-preview-head.html +1 -3
- package/bin/index.cjs +2 -2
- package/dist/actions/decorator.js +67 -72
- package/dist/actions/index.cjs +27 -31
- package/dist/actions/index.d.ts +0 -3
- package/dist/actions/index.js +27 -31
- package/dist/actions/preview.cjs +23 -27
- package/dist/actions/preview.d.ts +0 -1
- package/dist/actions/preview.js +19 -23
- package/dist/babel/index.cjs +822 -816
- package/dist/babel/index.js +822 -816
- package/dist/backgrounds/index.cjs +148 -0
- package/dist/backgrounds/index.d.ts +91 -0
- package/dist/backgrounds/index.js +130 -0
- package/dist/backgrounds/preview.cjs +143 -0
- package/dist/backgrounds/preview.d.ts +54 -0
- package/dist/backgrounds/preview.js +127 -0
- package/dist/bin/index.cjs +73 -92
- package/dist/bin/index.js +66 -85
- package/dist/builder-manager/index.cjs +316 -296
- package/dist/builder-manager/index.js +567 -547
- package/dist/channels/index.cjs +1020 -950
- package/dist/channels/index.js +1256 -1201
- package/dist/cli/bin/index.cjs +198 -198
- package/dist/cli/bin/index.js +204 -204
- package/dist/cli/index.cjs +61734 -7589
- package/dist/cli/index.d.ts +24 -20
- package/dist/cli/index.js +61775 -7630
- package/dist/common/index.cjs +16175 -9123
- package/dist/common/index.d.ts +34 -25
- package/dist/common/index.js +16270 -9212
- package/dist/component-testing/index.cjs +23 -0
- package/dist/component-testing/index.d.ts +3 -0
- package/dist/component-testing/index.js +5 -0
- package/dist/component-testing/preview.cjs +40 -0
- package/dist/component-testing/preview.d.ts +5 -0
- package/dist/component-testing/preview.js +25 -0
- package/dist/components/index.cjs +6479 -13005
- package/dist/components/index.d.ts +8 -257
- package/dist/components/index.js +6160 -18689
- package/dist/controls/decorator.d.ts +5 -0
- package/dist/controls/decorator.js +8 -0
- package/dist/controls/index.cjs +26 -0
- package/dist/controls/index.d.ts +39 -0
- package/dist/controls/index.js +6 -0
- package/dist/controls/preview.cjs +26 -0
- package/dist/controls/preview.d.ts +54 -0
- package/dist/controls/preview.js +9 -0
- package/dist/core-events/index.cjs +91 -106
- package/dist/core-events/index.d.ts +2 -80
- package/dist/core-events/index.js +79 -94
- package/dist/core-server/index.cjs +12314 -12114
- package/dist/core-server/index.d.ts +32 -23
- package/dist/core-server/index.js +12495 -12296
- package/dist/core-server/presets/common-manager.css +170 -0
- package/dist/core-server/presets/common-manager.js +12153 -12
- package/dist/core-server/presets/common-preset.cjs +3004 -3151
- package/dist/core-server/presets/common-preset.js +2833 -2981
- package/dist/csf/index.d.ts +1 -3
- package/dist/csf-tools/index.cjs +412 -403
- package/dist/csf-tools/index.d.ts +0 -4
- package/dist/csf-tools/index.js +410 -401
- package/dist/docs-tools/index.cjs +2569 -575
- package/dist/docs-tools/index.js +2565 -564
- package/dist/highlight/index.cjs +27 -0
- package/dist/highlight/index.d.ts +61 -0
- package/dist/highlight/index.js +7 -0
- package/dist/highlight/preview.cjs +535 -0
- package/dist/highlight/preview.d.ts +54 -0
- package/dist/highlight/preview.js +519 -0
- package/dist/instrumenter/index.cjs +1417 -1761
- package/dist/instrumenter/index.d.ts +8 -7
- package/dist/instrumenter/index.js +1332 -1667
- package/dist/manager/globals-module-info.cjs +22 -33
- package/dist/manager/globals-module-info.js +7 -18
- package/dist/manager/globals-runtime.js +45449 -49535
- package/dist/manager/runtime.js +4392 -3774
- package/dist/manager-api/index.cjs +2622 -2529
- package/dist/manager-api/index.d.ts +109 -114
- package/dist/manager-api/index.js +2603 -2475
- package/dist/manager-errors.js +41 -37
- package/dist/measure/index.cjs +476 -0
- package/dist/measure/index.d.ts +66 -0
- package/dist/measure/index.js +464 -0
- package/dist/measure/preview.cjs +466 -0
- package/dist/measure/preview.d.ts +59 -0
- package/dist/measure/preview.js +450 -0
- package/dist/outline/index.cjs +528 -0
- package/dist/outline/index.d.ts +66 -0
- package/dist/outline/index.js +500 -0
- package/dist/outline/preview.cjs +518 -0
- package/dist/outline/preview.d.ts +59 -0
- package/dist/outline/preview.js +486 -0
- package/dist/preview/runtime.js +42328 -38511
- package/dist/preview-api/index.cjs +1204 -1293
- package/dist/preview-api/index.d.ts +126 -178
- package/dist/preview-api/index.js +1614 -1685
- package/dist/preview-errors.cjs +65 -51
- package/dist/preview-errors.d.ts +6 -2
- package/dist/preview-errors.js +176 -142
- package/dist/server-errors.cjs +160 -113
- package/dist/server-errors.d.ts +12 -2
- package/dist/server-errors.js +157 -110
- package/dist/telemetry/index.cjs +407 -403
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/telemetry/index.js +493 -489
- package/dist/test/index.cjs +1553 -1552
- package/dist/test/index.js +9603 -9514
- package/dist/test/preview.cjs +1906 -1905
- package/dist/test/preview.d.ts +0 -6
- package/dist/test/preview.js +3664 -3603
- package/dist/test/spy.cjs +65 -64
- package/dist/test/spy.js +59 -58
- package/dist/types/index.cjs +11 -12
- package/dist/types/index.d.ts +601 -338
- package/dist/types/index.js +1 -2
- package/dist/viewport/index.cjs +310 -0
- package/dist/viewport/index.d.ts +320 -0
- package/dist/viewport/index.js +290 -0
- package/dist/viewport/preview.cjs +35 -0
- package/dist/viewport/preview.d.ts +68 -0
- package/dist/viewport/preview.js +19 -0
- package/package.json +207 -12
- package/dist/actions/manager.js +0 -1196
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
<base target="_parent" />
|
|
2
2
|
|
|
3
3
|
<style>
|
|
4
|
-
/* While we aren't showing the main block yet, but still preparing, we want everything the user
|
|
5
|
-
has rendered, which may or may not be in #storybook-root, to be display none */
|
|
4
|
+
/* While we aren't showing the main block yet, but still preparing, we want everything the user has rendered, which may or may not be in #storybook-root, to be display none */
|
|
6
5
|
.sb-show-preparing-story:not(.sb-show-main) > :not(.sb-preparing-story) {
|
|
7
6
|
display: none;
|
|
8
7
|
}
|
|
@@ -437,7 +436,6 @@
|
|
|
437
436
|
|
|
438
437
|
<script>
|
|
439
438
|
/* globals window */
|
|
440
|
-
/* eslint-disable no-underscore-dangle */
|
|
441
439
|
try {
|
|
442
440
|
if (window.top !== window) {
|
|
443
441
|
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.top.__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
package/bin/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const majorNodeVersion = parseInt(process.versions.node, 10);
|
|
4
|
-
if (majorNodeVersion <
|
|
5
|
-
console.error('To run Storybook you need to have Node.js
|
|
4
|
+
if (majorNodeVersion < 20) {
|
|
5
|
+
console.error('To run Storybook you need to have Node.js 20 or higher');
|
|
6
6
|
process.exit(1);
|
|
7
7
|
}
|
|
8
8
|
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var r = (
|
|
1
|
+
var R = Object.defineProperty;
|
|
2
|
+
var r = (e, o) => R(e, "name", { value: o, configurable: !0 });
|
|
3
3
|
|
|
4
4
|
// src/actions/decorator.ts
|
|
5
|
-
import {
|
|
6
|
-
import { makeDecorator as M, useEffect as C } from "storybook/preview-api";
|
|
5
|
+
import { makeDecorator as T, useEffect as k } from "storybook/preview-api";
|
|
7
6
|
|
|
8
7
|
// src/actions/constants.ts
|
|
9
|
-
var h = "actions", y = "storybook/actions",
|
|
8
|
+
var h = "actions", y = "storybook/actions", B = `${y}/panel`, g = `${y}/action-event`, H = `${y}/action-clear`;
|
|
10
9
|
|
|
11
10
|
// src/actions/runtime/action.ts
|
|
12
|
-
import { ImplicitActionsDuringRendering as
|
|
11
|
+
import { ImplicitActionsDuringRendering as D } from "storybook/internal/preview-errors";
|
|
13
12
|
import { global as E } from "@storybook/global";
|
|
14
|
-
import { addons as
|
|
15
|
-
import { v4 as
|
|
13
|
+
import { addons as j } from "storybook/preview-api";
|
|
14
|
+
import { v4 as S } from "uuid";
|
|
16
15
|
|
|
17
16
|
// src/actions/runtime/configureActions.ts
|
|
18
17
|
var a = {
|
|
@@ -22,72 +21,68 @@ var a = {
|
|
|
22
21
|
};
|
|
23
22
|
|
|
24
23
|
// src/actions/runtime/action.ts
|
|
25
|
-
var A = /* @__PURE__ */ r((
|
|
26
|
-
let t = Object.getPrototypeOf(
|
|
27
|
-
return !t ||
|
|
28
|
-
}, "findProto"),
|
|
29
|
-
typeof
|
|
30
|
-
if (
|
|
31
|
-
let
|
|
32
|
-
|
|
33
|
-
Object.getOwnPropertyDescriptors(
|
|
24
|
+
var A = /* @__PURE__ */ r((e, o) => {
|
|
25
|
+
let t = Object.getPrototypeOf(e);
|
|
26
|
+
return !t || o(t) ? t : A(t, o);
|
|
27
|
+
}, "findProto"), I = /* @__PURE__ */ r((e) => !!(typeof e == "object" && e && A(e, (o) => /^Synthetic(?:Base)?Event$/.test(o.constructor.name)) &&
|
|
28
|
+
typeof e.persist == "function"), "isReactSyntheticEvent"), P = /* @__PURE__ */ r((e) => {
|
|
29
|
+
if (I(e)) {
|
|
30
|
+
let o = Object.create(
|
|
31
|
+
e.constructor.prototype,
|
|
32
|
+
Object.getOwnPropertyDescriptors(e)
|
|
34
33
|
);
|
|
35
|
-
|
|
36
|
-
let t = Object.getOwnPropertyDescriptor(
|
|
37
|
-
return typeof n == "object" && n?.constructor.name === "Window" && Object.defineProperty(
|
|
34
|
+
o.persist();
|
|
35
|
+
let t = Object.getOwnPropertyDescriptor(o, "view"), n = t?.value;
|
|
36
|
+
return typeof n == "object" && n?.constructor.name === "Window" && Object.defineProperty(o, "view", {
|
|
38
37
|
...t,
|
|
39
38
|
value: Object.create(n.constructor.prototype)
|
|
40
|
-
}),
|
|
39
|
+
}), o;
|
|
41
40
|
}
|
|
42
|
-
return
|
|
43
|
-
}, "serializeArg"),
|
|
41
|
+
return e;
|
|
42
|
+
}, "serializeArg"), x = /* @__PURE__ */ r(() => typeof crypto == "object" && typeof crypto.getRandomValues == "function" ? S() : (
|
|
44
43
|
// pseudo random id, example response lo1e7zm4832bkr7yfl7
|
|
45
44
|
Date.now().toString(36) + Math.random().toString(36).substring(2)
|
|
46
45
|
), "generateId");
|
|
47
|
-
function O(
|
|
46
|
+
function O(e, o = {}) {
|
|
48
47
|
let t = {
|
|
49
48
|
...a,
|
|
50
|
-
...
|
|
49
|
+
...o
|
|
51
50
|
}, n = /* @__PURE__ */ r(function(...i) {
|
|
52
|
-
if (
|
|
53
|
-
let
|
|
54
|
-
|
|
55
|
-
E.__STORYBOOK_PREVIEW__
|
|
56
|
-
) : void 0)?.storyRenders.find(
|
|
57
|
-
(s) => s.phase === "playing" || s.phase === "rendering"
|
|
51
|
+
if (o.implicit) {
|
|
52
|
+
let d = ("__STORYBOOK_PREVIEW__" in E ? E.__STORYBOOK_PREVIEW__ : void 0)?.storyRenders.find(
|
|
53
|
+
(c) => c.phase === "playing" || c.phase === "rendering"
|
|
58
54
|
);
|
|
59
|
-
if (
|
|
60
|
-
let
|
|
61
|
-
phase:
|
|
62
|
-
name:
|
|
63
|
-
deprecated:
|
|
55
|
+
if (d) {
|
|
56
|
+
let c = !globalThis?.FEATURES?.disallowImplicitActionsInRenderV8, u = new D({
|
|
57
|
+
phase: d.phase,
|
|
58
|
+
name: e,
|
|
59
|
+
deprecated: c
|
|
64
60
|
});
|
|
65
|
-
if (
|
|
66
|
-
console.warn(
|
|
61
|
+
if (c)
|
|
62
|
+
console.warn(u);
|
|
67
63
|
else
|
|
68
|
-
throw
|
|
64
|
+
throw u;
|
|
69
65
|
}
|
|
70
66
|
}
|
|
71
|
-
let m =
|
|
67
|
+
let m = j.getChannel(), p = x(), l = 5, f = i.map(P), w = i.length > 1 ? f : f[0], _ = {
|
|
72
68
|
id: p,
|
|
73
69
|
count: 0,
|
|
74
|
-
data: { name:
|
|
70
|
+
data: { name: e, args: w },
|
|
75
71
|
options: {
|
|
76
72
|
...t,
|
|
77
|
-
maxDepth: l + (t.depth || 3)
|
|
78
|
-
allowFunction: t.allowFunction || !1
|
|
73
|
+
maxDepth: l + (t.depth || 3)
|
|
79
74
|
}
|
|
80
75
|
};
|
|
81
|
-
m.emit(g,
|
|
76
|
+
m.emit(g, _);
|
|
82
77
|
}, "actionHandler");
|
|
83
|
-
return n.isAction = !0, n.implicit =
|
|
78
|
+
return n.isAction = !0, n.implicit = o.implicit, n;
|
|
84
79
|
}
|
|
85
80
|
r(O, "action");
|
|
86
81
|
|
|
87
82
|
// 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" && (
|
|
83
|
+
var b = /* @__PURE__ */ r((...e) => {
|
|
84
|
+
let o = a, t = e;
|
|
85
|
+
t.length === 1 && Array.isArray(t[0]) && ([t] = t), t.length !== 1 && typeof t[t.length - 1] != "string" && (o = {
|
|
91
86
|
...a,
|
|
92
87
|
...t.pop()
|
|
93
88
|
});
|
|
@@ -95,45 +90,45 @@ var b = /* @__PURE__ */ r((...o) => {
|
|
|
95
90
|
(t.length !== 1 || typeof n == "string") && (n = {}, t.forEach((i) => {
|
|
96
91
|
n[i] = i;
|
|
97
92
|
}));
|
|
98
|
-
let
|
|
93
|
+
let s = {};
|
|
99
94
|
return Object.keys(n).forEach((i) => {
|
|
100
|
-
|
|
101
|
-
}),
|
|
95
|
+
s[i] = O(n[i], o);
|
|
96
|
+
}), s;
|
|
102
97
|
}, "actions");
|
|
103
98
|
|
|
104
99
|
// src/actions/decorator.ts
|
|
105
|
-
var
|
|
106
|
-
(
|
|
107
|
-
if (
|
|
100
|
+
var F = /^(\S+)\s*(.*)$/, M = Element != null && !Element.prototype.matches, C = M ? "msMatchesSelector" : "matches", v = /* @__PURE__ */ r(
|
|
101
|
+
(e, o) => {
|
|
102
|
+
if (e[C](o))
|
|
108
103
|
return !0;
|
|
109
|
-
let t =
|
|
110
|
-
return t ?
|
|
111
|
-
}, "hasMatchInAncestry"),
|
|
112
|
-
let t =
|
|
113
|
-
return Object.entries(t).map(([n,
|
|
114
|
-
let [i, m, p] = n.match(
|
|
104
|
+
let t = e.parentElement;
|
|
105
|
+
return t ? v(t, o) : !1;
|
|
106
|
+
}, "hasMatchInAncestry"), N = /* @__PURE__ */ r((e, ...o) => {
|
|
107
|
+
let t = e(...o);
|
|
108
|
+
return Object.entries(t).map(([n, s]) => {
|
|
109
|
+
let [i, m, p] = n.match(F) || [];
|
|
115
110
|
return {
|
|
116
111
|
eventName: m,
|
|
117
112
|
handler: /* @__PURE__ */ r((l) => {
|
|
118
|
-
(!p ||
|
|
113
|
+
(!p || v(l.target, p)) && s(l);
|
|
119
114
|
}, "handler")
|
|
120
115
|
};
|
|
121
116
|
});
|
|
122
|
-
}, "createHandlers"),
|
|
123
|
-
let t =
|
|
124
|
-
|
|
125
|
-
if (t
|
|
126
|
-
let n =
|
|
127
|
-
return n.forEach(({ eventName:
|
|
128
|
-
|
|
117
|
+
}, "createHandlers"), V = /* @__PURE__ */ r((e, ...o) => {
|
|
118
|
+
let t = typeof globalThis.document < "u" && globalThis.document.getElementById("storybook-root");
|
|
119
|
+
k(() => {
|
|
120
|
+
if (t) {
|
|
121
|
+
let n = N(e, ...o);
|
|
122
|
+
return n.forEach(({ eventName: s, handler: i }) => t.addEventListener(s, i)), () => n.forEach(({ eventName: s, handler: i }) => t.removeEventListener(
|
|
123
|
+
s, i));
|
|
129
124
|
}
|
|
130
|
-
}, [t,
|
|
131
|
-
}, "applyEventHandlers"),
|
|
125
|
+
}, [t, e, o]);
|
|
126
|
+
}, "applyEventHandlers"), ct = T({
|
|
132
127
|
name: "withActions",
|
|
133
128
|
parameterName: h,
|
|
134
129
|
skipIfNoParametersOrOptions: !0,
|
|
135
|
-
wrapper: /* @__PURE__ */ r((
|
|
130
|
+
wrapper: /* @__PURE__ */ r((e, o, { parameters: t }) => (t?.handles && V(b, ...t.handles), e(o)), "wrapper")
|
|
136
131
|
});
|
|
137
132
|
export {
|
|
138
|
-
|
|
133
|
+
ct as withActions
|
|
139
134
|
};
|
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,20 +65,17 @@ 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
|
|
79
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
80
|
-
m.global.__STORYBOOK_PREVIEW__
|
|
81
|
-
) : void 0)?.storyRenders.find(
|
|
78
|
+
let d = ("__STORYBOOK_PREVIEW__" in f.global ? f.global.__STORYBOOK_PREVIEW__ : void 0)?.storyRenders.find(
|
|
82
79
|
(p) => p.phase === "playing" || p.phase === "rendering"
|
|
83
80
|
);
|
|
84
81
|
if (d) {
|
|
@@ -93,24 +90,23 @@ function y(t, o = {}) {
|
|
|
93
90
|
throw g;
|
|
94
91
|
}
|
|
95
92
|
}
|
|
96
|
-
let
|
|
97
|
-
id:
|
|
93
|
+
let E = O.addons.getChannel(), v = $(), w = 5, u = c.map(Y), _ = c.length > 1 ? u : u[0], D = {
|
|
94
|
+
id: v,
|
|
98
95
|
count: 0,
|
|
99
96
|
data: { name: t, args: _ },
|
|
100
97
|
options: {
|
|
101
98
|
...n,
|
|
102
|
-
maxDepth:
|
|
103
|
-
allowFunction: n.allowFunction || !1
|
|
99
|
+
maxDepth: w + (n.depth || 3)
|
|
104
100
|
}
|
|
105
101
|
};
|
|
106
|
-
|
|
102
|
+
E.emit(y, D);
|
|
107
103
|
}, "actionHandler");
|
|
108
104
|
return e.isAction = !0, e.implicit = o.implicit, e;
|
|
109
105
|
}
|
|
110
|
-
|
|
106
|
+
r(l, "action");
|
|
111
107
|
|
|
112
108
|
// src/actions/runtime/actions.ts
|
|
113
|
-
var B = /* @__PURE__ */
|
|
109
|
+
var B = /* @__PURE__ */ r((...t) => {
|
|
114
110
|
let o = s, n = t;
|
|
115
111
|
n.length === 1 && Array.isArray(n[0]) && ([n] = n), n.length !== 1 && typeof n[n.length - 1] != "string" && (o = {
|
|
116
112
|
...s,
|
|
@@ -120,8 +116,8 @@ var B = /* @__PURE__ */ i((...t) => {
|
|
|
120
116
|
(n.length !== 1 || typeof e == "string") && (e = {}, n.forEach((c) => {
|
|
121
117
|
e[c] = c;
|
|
122
118
|
}));
|
|
123
|
-
let
|
|
119
|
+
let i = {};
|
|
124
120
|
return Object.keys(e).forEach((c) => {
|
|
125
|
-
|
|
126
|
-
}),
|
|
121
|
+
i[c] = l(e[c], o);
|
|
122
|
+
}), i;
|
|
127
123
|
}, "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,59 @@ 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
|
|
52
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
53
|
-
u.__STORYBOOK_PREVIEW__
|
|
54
|
-
) : void 0)?.storyRenders.find(
|
|
51
|
+
let y = ("__STORYBOOK_PREVIEW__" in u ? u.__STORYBOOK_PREVIEW__ : void 0)?.storyRenders.find(
|
|
55
52
|
(s) => s.phase === "playing" || s.phase === "rendering"
|
|
56
53
|
);
|
|
57
|
-
if (
|
|
58
|
-
let s = !globalThis?.FEATURES?.disallowImplicitActionsInRenderV8,
|
|
59
|
-
phase:
|
|
54
|
+
if (y) {
|
|
55
|
+
let s = !globalThis?.FEATURES?.disallowImplicitActionsInRenderV8, f = new w({
|
|
56
|
+
phase: y.phase,
|
|
60
57
|
name: o,
|
|
61
58
|
deprecated: s
|
|
62
59
|
});
|
|
63
60
|
if (s)
|
|
64
|
-
console.warn(
|
|
61
|
+
console.warn(f);
|
|
65
62
|
else
|
|
66
|
-
throw
|
|
63
|
+
throw f;
|
|
67
64
|
}
|
|
68
65
|
}
|
|
69
|
-
let A = _.getChannel(), O = j(), h = 5,
|
|
66
|
+
let A = _.getChannel(), O = j(), h = 5, m = i.map(R), b = i.length > 1 ? m : m[0], E = {
|
|
70
67
|
id: O,
|
|
71
68
|
count: 0,
|
|
72
69
|
data: { name: o, args: b },
|
|
73
70
|
options: {
|
|
74
71
|
...t,
|
|
75
|
-
maxDepth: h + (t.depth || 3)
|
|
76
|
-
allowFunction: t.allowFunction || !1
|
|
72
|
+
maxDepth: h + (t.depth || 3)
|
|
77
73
|
}
|
|
78
74
|
};
|
|
79
|
-
A.emit(
|
|
75
|
+
A.emit(l, E);
|
|
80
76
|
}, "actionHandler");
|
|
81
77
|
return e.isAction = !0, e.implicit = n.implicit, e;
|
|
82
78
|
}
|
|
83
|
-
|
|
79
|
+
r(g, "action");
|
|
84
80
|
|
|
85
81
|
// src/actions/runtime/actions.ts
|
|
86
|
-
var G = /* @__PURE__ */
|
|
82
|
+
var G = /* @__PURE__ */ r((...o) => {
|
|
87
83
|
let n = c, t = o;
|
|
88
84
|
t.length === 1 && Array.isArray(t[0]) && ([t] = t), t.length !== 1 && typeof t[t.length - 1] != "string" && (n = {
|
|
89
85
|
...c,
|
|
90
86
|
...t.pop()
|
|
91
87
|
});
|
|
92
88
|
let e = t[0];
|
|
93
|
-
(t.length !== 1 || typeof e == "string") && (e = {}, t.forEach((
|
|
94
|
-
e[
|
|
89
|
+
(t.length !== 1 || typeof e == "string") && (e = {}, t.forEach((i) => {
|
|
90
|
+
e[i] = i;
|
|
95
91
|
}));
|
|
96
92
|
let p = {};
|
|
97
|
-
return Object.keys(e).forEach((
|
|
98
|
-
p[
|
|
93
|
+
return Object.keys(e).forEach((i) => {
|
|
94
|
+
p[i] = g(e[i], n);
|
|
99
95
|
}), p;
|
|
100
96
|
}, "actions");
|
|
101
97
|
export {
|
|
102
98
|
a as ADDON_ID,
|
|
103
99
|
k as CLEAR_ID,
|
|
104
|
-
|
|
105
|
-
|
|
100
|
+
C as CYCLIC_KEY,
|
|
101
|
+
l as EVENT_ID,
|
|
106
102
|
T as PANEL_ID,
|
|
107
103
|
S as PARAM_KEY,
|
|
108
104
|
g as action,
|