storybook 9.0.0-alpha.20 → 9.0.0-alpha.21
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 +1 -3
- package/dist/actions/decorator.js +34 -38
- package/dist/actions/index.cjs +1 -4
- package/dist/actions/index.js +1 -4
- package/dist/actions/preview.cjs +1 -4
- package/dist/actions/preview.js +1 -4
- package/dist/babel/index.cjs +822 -816
- package/dist/babel/index.js +822 -816
- package/dist/backgrounds/index.cjs +16 -16
- package/dist/backgrounds/index.js +14 -14
- package/dist/backgrounds/preview.cjs +34 -34
- package/dist/backgrounds/preview.js +29 -29
- package/dist/bin/index.cjs +67 -65
- package/dist/bin/index.js +61 -59
- package/dist/builder-manager/index.cjs +482 -472
- package/dist/builder-manager/index.js +283 -273
- package/dist/channels/index.js +941 -919
- package/dist/cli/bin/index.cjs +1 -1
- package/dist/cli/bin/index.js +1 -1
- package/dist/cli/index.cjs +61752 -7591
- package/dist/cli/index.d.ts +22 -14
- package/dist/cli/index.js +61775 -7614
- package/dist/common/index.cjs +16015 -8979
- package/dist/common/index.d.ts +30 -1
- package/dist/common/index.js +16105 -9063
- package/dist/components/index.cjs +3694 -3643
- package/dist/components/index.d.ts +5 -2
- package/dist/components/index.js +2352 -2294
- package/dist/core-server/index.cjs +3540 -3540
- package/dist/core-server/index.js +730 -730
- package/dist/core-server/presets/common-manager.js +2642 -2592
- package/dist/core-server/presets/common-preset.cjs +723 -715
- package/dist/core-server/presets/common-preset.js +10 -2
- package/dist/docs-tools/index.js +640 -632
- package/dist/highlight/index.cjs +16 -16
- package/dist/highlight/index.d.ts +45 -1
- package/dist/highlight/index.js +2 -2
- package/dist/highlight/preview.cjs +522 -68
- package/dist/highlight/preview.js +508 -56
- package/dist/instrumenter/index.js +1179 -1170
- package/dist/manager/globals-module-info.cjs +1 -0
- package/dist/manager/globals-module-info.js +1 -0
- package/dist/manager/globals-runtime.js +19385 -19190
- package/dist/manager/runtime.js +2084 -2079
- package/dist/manager-api/index.cjs +352 -352
- package/dist/manager-api/index.js +1694 -1663
- package/dist/manager-errors.js +41 -37
- package/dist/measure/index.cjs +99 -97
- package/dist/measure/index.js +95 -93
- package/dist/measure/preview.cjs +127 -125
- package/dist/measure/preview.js +125 -123
- package/dist/outline/index.cjs +41 -41
- package/dist/outline/index.js +12 -12
- package/dist/outline/preview.cjs +23 -23
- package/dist/outline/preview.js +7 -7
- package/dist/preview/runtime.js +13577 -12959
- package/dist/preview-api/index.cjs +0 -1
- package/dist/preview-api/index.d.ts +120 -385
- package/dist/preview-api/index.js +827 -812
- 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 +105 -72
- package/dist/server-errors.d.ts +9 -1
- package/dist/server-errors.js +87 -54
- package/dist/telemetry/index.cjs +374 -370
- package/dist/telemetry/index.js +460 -456
- package/dist/test/index.js +9831 -9743
- package/dist/test/preview.d.ts +0 -6
- package/dist/test/preview.js +3628 -3568
- package/dist/types/index.d.ts +72 -6
- package/package.json +1 -1
|
@@ -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__;
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var r = (e, o) =>
|
|
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 = {
|
|
@@ -25,9 +24,9 @@ var a = {
|
|
|
25
24
|
var A = /* @__PURE__ */ r((e, o) => {
|
|
26
25
|
let t = Object.getPrototypeOf(e);
|
|
27
26
|
return !t || o(t) ? t : A(t, o);
|
|
28
|
-
}, "findProto"),
|
|
29
|
-
typeof e.persist == "function"), "isReactSyntheticEvent"),
|
|
30
|
-
if (
|
|
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)) {
|
|
31
30
|
let o = Object.create(
|
|
32
31
|
e.constructor.prototype,
|
|
33
32
|
Object.getOwnPropertyDescriptors(e)
|
|
@@ -40,7 +39,7 @@ typeof e.persist == "function"), "isReactSyntheticEvent"), k = /* @__PURE__ */ r
|
|
|
40
39
|
}), o;
|
|
41
40
|
}
|
|
42
41
|
return e;
|
|
43
|
-
}, "serializeArg"),
|
|
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");
|
|
@@ -50,34 +49,31 @@ function O(e, o = {}) {
|
|
|
50
49
|
...o
|
|
51
50
|
}, n = /* @__PURE__ */ r(function(...i) {
|
|
52
51
|
if (o.implicit) {
|
|
53
|
-
let
|
|
54
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
55
|
-
E.__STORYBOOK_PREVIEW__
|
|
56
|
-
) : void 0)?.storyRenders.find(
|
|
52
|
+
let d = ("__STORYBOOK_PREVIEW__" in E ? E.__STORYBOOK_PREVIEW__ : void 0)?.storyRenders.find(
|
|
57
53
|
(c) => c.phase === "playing" || c.phase === "rendering"
|
|
58
54
|
);
|
|
59
|
-
if (
|
|
60
|
-
let c = !globalThis?.FEATURES?.disallowImplicitActionsInRenderV8,
|
|
61
|
-
phase:
|
|
55
|
+
if (d) {
|
|
56
|
+
let c = !globalThis?.FEATURES?.disallowImplicitActionsInRenderV8, u = new D({
|
|
57
|
+
phase: d.phase,
|
|
62
58
|
name: e,
|
|
63
59
|
deprecated: c
|
|
64
60
|
});
|
|
65
61
|
if (c)
|
|
66
|
-
console.warn(
|
|
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: e, args:
|
|
70
|
+
data: { name: e, args: w },
|
|
75
71
|
options: {
|
|
76
72
|
...t,
|
|
77
73
|
maxDepth: l + (t.depth || 3)
|
|
78
74
|
}
|
|
79
75
|
};
|
|
80
|
-
m.emit(g,
|
|
76
|
+
m.emit(g, _);
|
|
81
77
|
}, "actionHandler");
|
|
82
78
|
return n.isAction = !0, n.implicit = o.implicit, n;
|
|
83
79
|
}
|
|
@@ -101,38 +97,38 @@ var b = /* @__PURE__ */ r((...e) => {
|
|
|
101
97
|
}, "actions");
|
|
102
98
|
|
|
103
99
|
// src/actions/decorator.ts
|
|
104
|
-
var
|
|
100
|
+
var F = /^(\S+)\s*(.*)$/, M = Element != null && !Element.prototype.matches, C = M ? "msMatchesSelector" : "matches", v = /* @__PURE__ */ r(
|
|
105
101
|
(e, o) => {
|
|
106
|
-
if (e[
|
|
102
|
+
if (e[C](o))
|
|
107
103
|
return !0;
|
|
108
104
|
let t = e.parentElement;
|
|
109
|
-
return t ?
|
|
110
|
-
}, "hasMatchInAncestry"),
|
|
105
|
+
return t ? v(t, o) : !1;
|
|
106
|
+
}, "hasMatchInAncestry"), N = /* @__PURE__ */ r((e, ...o) => {
|
|
111
107
|
let t = e(...o);
|
|
112
108
|
return Object.entries(t).map(([n, s]) => {
|
|
113
|
-
let [i, m, p] = n.match(
|
|
109
|
+
let [i, m, p] = n.match(F) || [];
|
|
114
110
|
return {
|
|
115
111
|
eventName: m,
|
|
116
112
|
handler: /* @__PURE__ */ r((l) => {
|
|
117
|
-
(!p ||
|
|
113
|
+
(!p || v(l.target, p)) && s(l);
|
|
118
114
|
}, "handler")
|
|
119
115
|
};
|
|
120
116
|
});
|
|
121
|
-
}, "createHandlers"),
|
|
122
|
-
let t =
|
|
123
|
-
|
|
124
|
-
if (t
|
|
125
|
-
let n =
|
|
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);
|
|
126
122
|
return n.forEach(({ eventName: s, handler: i }) => t.addEventListener(s, i)), () => n.forEach(({ eventName: s, handler: i }) => t.removeEventListener(
|
|
127
123
|
s, i));
|
|
128
124
|
}
|
|
129
125
|
}, [t, e, o]);
|
|
130
|
-
}, "applyEventHandlers"),
|
|
126
|
+
}, "applyEventHandlers"), ct = T({
|
|
131
127
|
name: "withActions",
|
|
132
128
|
parameterName: h,
|
|
133
129
|
skipIfNoParametersOrOptions: !0,
|
|
134
|
-
wrapper: /* @__PURE__ */ r((e, o, { parameters: t }) => (t?.handles &&
|
|
130
|
+
wrapper: /* @__PURE__ */ r((e, o, { parameters: t }) => (t?.handles && V(b, ...t.handles), e(o)), "wrapper")
|
|
135
131
|
});
|
|
136
132
|
export {
|
|
137
|
-
|
|
133
|
+
ct as withActions
|
|
138
134
|
};
|
package/dist/actions/index.cjs
CHANGED
|
@@ -75,10 +75,7 @@ function l(t, o = {}) {
|
|
|
75
75
|
...o
|
|
76
76
|
}, e = /* @__PURE__ */ r(function(...c) {
|
|
77
77
|
if (o.implicit) {
|
|
78
|
-
let d = ("__STORYBOOK_PREVIEW__" in f.global ? (
|
|
79
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
80
|
-
f.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) {
|
package/dist/actions/index.js
CHANGED
|
@@ -48,10 +48,7 @@ function g(o, n = {}) {
|
|
|
48
48
|
...n
|
|
49
49
|
}, e = /* @__PURE__ */ r(function(...i) {
|
|
50
50
|
if (n.implicit) {
|
|
51
|
-
let y = ("__STORYBOOK_PREVIEW__" in u ? (
|
|
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
54
|
if (y) {
|
package/dist/actions/preview.cjs
CHANGED
|
@@ -71,10 +71,7 @@ function g(e, t = {}) {
|
|
|
71
71
|
...t
|
|
72
72
|
}, r = /* @__PURE__ */ i(function(...s) {
|
|
73
73
|
if (t.implicit) {
|
|
74
|
-
let x = ("__STORYBOOK_PREVIEW__" in u.global ? (
|
|
75
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
76
|
-
u.global.__STORYBOOK_PREVIEW__
|
|
77
|
-
) : void 0)?.storyRenders.find(
|
|
74
|
+
let x = ("__STORYBOOK_PREVIEW__" in u.global ? u.global.__STORYBOOK_PREVIEW__ : void 0)?.storyRenders.find(
|
|
78
75
|
(d) => d.phase === "playing" || d.phase === "rendering"
|
|
79
76
|
);
|
|
80
77
|
if (x) {
|
package/dist/actions/preview.js
CHANGED
|
@@ -59,10 +59,7 @@ function g(t, e = {}) {
|
|
|
59
59
|
...e
|
|
60
60
|
}, r = /* @__PURE__ */ n(function(...s) {
|
|
61
61
|
if (e.implicit) {
|
|
62
|
-
let u = ("__STORYBOOK_PREVIEW__" in R ? (
|
|
63
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
64
|
-
R.__STORYBOOK_PREVIEW__
|
|
65
|
-
) : void 0)?.storyRenders.find(
|
|
62
|
+
let u = ("__STORYBOOK_PREVIEW__" in R ? R.__STORYBOOK_PREVIEW__ : void 0)?.storyRenders.find(
|
|
66
63
|
(d) => d.phase === "playing" || d.phase === "rendering"
|
|
67
64
|
);
|
|
68
65
|
if (u) {
|