storybook 9.0.0-alpha.1 → 9.0.0-alpha.10
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/README.md +31 -29
- package/assets/browser/favicon.svg +1 -0
- package/assets/browser/nunito-sans-bold-italic.woff2 +0 -0
- package/assets/browser/nunito-sans-bold.woff2 +0 -0
- package/assets/browser/nunito-sans-italic.woff2 +0 -0
- package/assets/browser/nunito-sans-regular.woff2 +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/message-reference.png +0 -0
- package/assets/docs/viewport.png +0 -0
- package/assets/server/addon.tsconfig.json +6 -0
- package/assets/server/base-preview-body.html +119 -0
- package/assets/server/base-preview-head.html +451 -0
- package/assets/server/template.ejs +87 -0
- package/bin/index.cjs +1 -1
- package/dist/actions/decorator.d.ts +6 -0
- package/dist/actions/decorator.js +139 -0
- package/dist/actions/index.cjs +127 -0
- package/dist/actions/index.d.ts +105 -0
- package/dist/actions/index.js +112 -0
- package/dist/actions/manager.js +1196 -0
- package/dist/actions/preview.cjs +165 -0
- package/dist/actions/preview.d.ts +55 -0
- package/dist/actions/preview.js +156 -0
- package/dist/babel/index.cjs +54034 -0
- package/dist/babel/index.d.ts +7488 -0
- package/dist/babel/index.js +54044 -0
- package/dist/bin/index.cjs +119 -0
- package/dist/bin/index.js +113 -0
- package/dist/builder-manager/index.cjs +2140 -0
- package/dist/builder-manager/index.d.ts +19 -0
- package/dist/builder-manager/index.js +2162 -0
- package/dist/channels/index.cjs +1913 -0
- package/dist/channels/index.d.ts +108 -0
- package/dist/channels/index.js +1881 -0
- package/dist/cli/bin/index.cjs +2687 -0
- package/dist/cli/bin/index.d.ts +2 -0
- package/dist/cli/bin/index.js +2707 -0
- package/dist/cli/index.cjs +17327 -0
- package/dist/cli/index.d.ts +209 -0
- package/dist/cli/index.js +17349 -0
- package/dist/client-logger/index.cjs +80 -0
- package/dist/client-logger/index.d.ts +29 -0
- package/dist/client-logger/index.js +64 -0
- package/dist/common/index.cjs +20569 -0
- package/dist/common/index.d.ts +949 -0
- package/dist/common/index.js +20654 -0
- package/dist/components/index.cjs +27924 -0
- package/dist/components/index.d.ts +1423 -0
- package/dist/components/index.js +24673 -0
- 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/manager.js +5545 -0
- package/dist/controls/preview.cjs +26 -0
- package/dist/controls/preview.d.ts +55 -0
- package/dist/controls/preview.js +9 -0
- package/dist/core-events/index.cjs +167 -0
- package/dist/core-events/index.d.ts +426 -0
- package/dist/core-events/index.js +149 -0
- package/dist/core-server/index.cjs +38183 -0
- package/dist/core-server/index.d.ts +720 -0
- package/dist/core-server/index.js +38272 -0
- package/dist/core-server/presets/common-manager.js +20 -0
- package/dist/core-server/presets/common-override-preset.cjs +4824 -0
- package/dist/core-server/presets/common-override-preset.js +4829 -0
- package/dist/core-server/presets/common-preset.cjs +10231 -0
- package/dist/core-server/presets/common-preset.js +10309 -0
- package/dist/csf/index.cjs +179 -0
- package/dist/csf/index.d.ts +750 -0
- package/dist/csf/index.js +172 -0
- package/dist/csf-tools/index.cjs +1422 -0
- package/dist/csf-tools/index.d.ts +250 -0
- package/dist/csf-tools/index.js +1439 -0
- package/dist/docs-tools/index.cjs +2891 -0
- package/dist/docs-tools/index.d.ts +162 -0
- package/dist/docs-tools/index.js +2876 -0
- package/dist/index.cjs +17 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -7
- package/dist/instrumenter/index.cjs +3485 -0
- package/dist/instrumenter/index.d.ts +104 -0
- package/dist/instrumenter/index.js +4965 -0
- package/dist/manager/globals-module-info.cjs +817 -0
- package/dist/manager/globals-module-info.d.ts +36 -0
- package/dist/manager/globals-module-info.js +804 -0
- package/dist/manager/globals-runtime.js +77536 -0
- package/dist/manager/globals.cjs +47 -0
- package/dist/manager/globals.d.ts +24 -0
- package/dist/manager/globals.js +34 -0
- package/dist/manager/runtime.js +12323 -0
- package/dist/manager-api/index.cjs +11074 -0
- package/dist/manager-api/index.d.ts +1512 -0
- package/dist/manager-api/index.js +4835 -0
- package/dist/manager-errors.d.ts +89 -0
- package/dist/manager-errors.js +99 -0
- package/dist/node-logger/index.cjs +1642 -0
- package/dist/node-logger/index.d.ts +117 -0
- package/dist/node-logger/index.js +1652 -0
- package/dist/preview/globals.cjs +38 -0
- package/dist/preview/globals.d.ts +15 -0
- package/dist/preview/globals.js +25 -0
- package/dist/preview/runtime.js +43629 -0
- package/dist/preview-api/index.cjs +5224 -0
- package/dist/preview-api/index.d.ts +1093 -0
- package/dist/preview-api/index.js +5292 -0
- package/dist/preview-errors.cjs +503 -0
- package/dist/preview-errors.d.ts +212 -0
- package/dist/preview-errors.js +449 -0
- package/dist/router/index.cjs +3296 -0
- package/dist/router/index.d.ts +385 -0
- package/dist/router/index.js +1843 -0
- package/dist/server-errors.cjs +727 -0
- package/dist/server-errors.d.ts +296 -0
- package/dist/server-errors.js +728 -0
- package/dist/telemetry/index.cjs +2756 -0
- package/dist/telemetry/index.d.ts +133 -0
- package/dist/telemetry/index.js +2797 -0
- package/dist/test/index.cjs +35685 -0
- package/dist/test/index.d.ts +186 -0
- package/dist/test/index.js +33751 -0
- package/dist/test/preview.cjs +15869 -0
- package/dist/test/preview.d.ts +54 -0
- package/dist/test/preview.js +14440 -0
- package/dist/test/spy.cjs +257 -0
- package/dist/test/spy.d.ts +66 -0
- package/dist/test/spy.js +239 -0
- package/dist/theming/create.cjs +232 -0
- package/dist/theming/create.d.ts +50 -0
- package/dist/theming/create.js +216 -0
- package/dist/theming/index.cjs +2665 -0
- package/dist/theming/index.d.ts +11939 -0
- package/dist/theming/index.js +2485 -0
- package/dist/types/index.cjs +27 -0
- package/dist/types/index.d.ts +2795 -0
- package/dist/types/index.js +7 -0
- 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/manager.js +400 -0
- package/dist/viewport/preview.cjs +35 -0
- package/dist/viewport/preview.d.ts +69 -0
- package/dist/viewport/preview.js +19 -0
- package/package.json +518 -209
- package/.eslintrc.cjs +0 -31
- package/__mocks__/@aw-web-design/x-default-browser.js +0 -2
- package/core/babel/index.cjs +0 -1
- package/core/babel/index.d.ts +0 -2
- package/core/babel/index.js +0 -1
- package/core/builder-manager/index.cjs +0 -1
- package/core/builder-manager/index.d.ts +0 -2
- package/core/builder-manager/index.js +0 -1
- package/core/channels/index.cjs +0 -1
- package/core/channels/index.d.ts +0 -2
- package/core/channels/index.js +0 -1
- package/core/cli/bin/index.cjs +0 -1
- package/core/cli/bin/index.d.ts +0 -2
- package/core/cli/bin/index.js +0 -1
- package/core/cli/index.cjs +0 -1
- package/core/cli/index.d.ts +0 -2
- package/core/cli/index.js +0 -1
- package/core/client-logger/index.cjs +0 -1
- package/core/client-logger/index.d.ts +0 -2
- package/core/client-logger/index.js +0 -1
- package/core/common/index.cjs +0 -1
- package/core/common/index.d.ts +0 -2
- package/core/common/index.js +0 -1
- package/core/components/index.cjs +0 -1
- package/core/components/index.d.ts +0 -2
- package/core/components/index.js +0 -1
- package/core/core-events/index.cjs +0 -1
- package/core/core-events/index.d.ts +0 -2
- package/core/core-events/index.js +0 -1
- package/core/core-server/index.cjs +0 -1
- package/core/core-server/index.d.ts +0 -2
- package/core/core-server/index.js +0 -1
- package/core/core-server/presets/common-manager.js +0 -1
- package/core/core-server/presets/common-override-preset.cjs +0 -1
- package/core/core-server/presets/common-override-preset.js +0 -1
- package/core/core-server/presets/common-preset.cjs +0 -1
- package/core/core-server/presets/common-preset.js +0 -1
- package/core/csf/index.cjs +0 -1
- package/core/csf/index.d.ts +0 -2
- package/core/csf/index.js +0 -1
- package/core/csf-tools/index.cjs +0 -1
- package/core/csf-tools/index.d.ts +0 -2
- package/core/csf-tools/index.js +0 -1
- package/core/docs-tools/index.cjs +0 -1
- package/core/docs-tools/index.d.ts +0 -2
- package/core/docs-tools/index.js +0 -1
- package/core/index.cjs +0 -1
- package/core/index.d.ts +0 -2
- package/core/index.js +0 -1
- package/core/manager/globals-module-info.cjs +0 -1
- package/core/manager/globals-module-info.d.ts +0 -2
- package/core/manager/globals-module-info.js +0 -1
- package/core/manager/globals-runtime.js +0 -1
- package/core/manager/globals.cjs +0 -1
- package/core/manager/globals.d.ts +0 -2
- package/core/manager/globals.js +0 -1
- package/core/manager-api/index.cjs +0 -1
- package/core/manager-api/index.d.ts +0 -2
- package/core/manager-api/index.js +0 -1
- package/core/manager-errors.d.ts +0 -2
- package/core/manager-errors.js +0 -1
- package/core/node-logger/index.cjs +0 -1
- package/core/node-logger/index.d.ts +0 -2
- package/core/node-logger/index.js +0 -1
- package/core/preview/globals.cjs +0 -1
- package/core/preview/globals.d.ts +0 -2
- package/core/preview/globals.js +0 -1
- package/core/preview/runtime.js +0 -1
- package/core/preview-api/index.cjs +0 -1
- package/core/preview-api/index.d.ts +0 -2
- package/core/preview-api/index.js +0 -1
- package/core/preview-errors.cjs +0 -1
- package/core/preview-errors.d.ts +0 -2
- package/core/preview-errors.js +0 -1
- package/core/router/index.cjs +0 -1
- package/core/router/index.d.ts +0 -2
- package/core/router/index.js +0 -1
- package/core/server-errors.cjs +0 -1
- package/core/server-errors.d.ts +0 -2
- package/core/server-errors.js +0 -1
- package/core/telemetry/index.cjs +0 -1
- package/core/telemetry/index.d.ts +0 -2
- package/core/telemetry/index.js +0 -1
- package/core/theming/create.cjs +0 -1
- package/core/theming/create.d.ts +0 -2
- package/core/theming/create.js +0 -1
- package/core/theming/index.cjs +0 -1
- package/core/theming/index.d.ts +0 -2
- package/core/theming/index.js +0 -1
- package/core/types/index.cjs +0 -1
- package/core/types/index.d.ts +0 -2
- package/core/types/index.js +0 -1
- package/core.cjs +0 -0
- package/core.d.ts +0 -0
- package/core.js +0 -1
- package/dist/chunk-OWLSIX54.js +0 -8
- package/dist/core-path.cjs +0 -1
- package/dist/core-path.d.ts +0 -3
- package/dist/core-path.js +0 -9
- package/dist/proxy.cjs +0 -1
- package/dist/proxy.d.ts +0 -2
- package/dist/proxy.js +0 -9
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var g = Object.defineProperty;
|
|
3
|
+
var C = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var W = Object.getOwnPropertyNames;
|
|
5
|
+
var M = Object.prototype.hasOwnProperty;
|
|
6
|
+
var i = (e, t) => g(e, "name", { value: t, configurable: !0 });
|
|
7
|
+
var m = (e, t) => {
|
|
8
|
+
for (var o in t)
|
|
9
|
+
g(e, o, { get: t[o], enumerable: !0 });
|
|
10
|
+
}, L = (e, t, o, r) => {
|
|
11
|
+
if (t && typeof t == "object" || typeof t == "function")
|
|
12
|
+
for (let n of W(t))
|
|
13
|
+
!M.call(e, n) && n !== o && g(e, n, { get: () => t[n], enumerable: !(r = C(t, n)) || r.enumerable });
|
|
14
|
+
return e;
|
|
15
|
+
};
|
|
16
|
+
var V = (e) => L(g({}, "__esModule", { value: !0 }), e);
|
|
17
|
+
|
|
18
|
+
// src/actions/preview.ts
|
|
19
|
+
var U = {};
|
|
20
|
+
m(U, {
|
|
21
|
+
default: () => H
|
|
22
|
+
});
|
|
23
|
+
module.exports = V(U);
|
|
24
|
+
var F = require("storybook/preview-api");
|
|
25
|
+
|
|
26
|
+
// src/actions/addArgs.ts
|
|
27
|
+
var A = {};
|
|
28
|
+
m(A, {
|
|
29
|
+
argsEnhancers: () => B
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// src/actions/runtime/action.ts
|
|
33
|
+
var O = require("storybook/internal/preview-errors"), u = require("@storybook/global"), w = require("storybook/preview-api"), v = require("uuid");
|
|
34
|
+
|
|
35
|
+
// src/actions/constants.ts
|
|
36
|
+
var f = "storybook/actions", J = `${f}/panel`, E = `${f}/action-event`, Q = `${f}/action-clear`;
|
|
37
|
+
|
|
38
|
+
// src/actions/runtime/configureActions.ts
|
|
39
|
+
var R = {
|
|
40
|
+
depth: 10,
|
|
41
|
+
clearOnStoryChange: !0,
|
|
42
|
+
limit: 50
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// src/actions/runtime/action.ts
|
|
46
|
+
var T = /* @__PURE__ */ i((e, t) => {
|
|
47
|
+
let o = Object.getPrototypeOf(e);
|
|
48
|
+
return !o || t(o) ? o : T(o, t);
|
|
49
|
+
}, "findProto"), N = /* @__PURE__ */ i((e) => !!(typeof e == "object" && e && T(e, (t) => /^Synthetic(?:Base)?Event$/.test(t.constructor.name)) &&
|
|
50
|
+
typeof e.persist == "function"), "isReactSyntheticEvent"), Y = /* @__PURE__ */ i((e) => {
|
|
51
|
+
if (N(e)) {
|
|
52
|
+
let t = Object.create(
|
|
53
|
+
e.constructor.prototype,
|
|
54
|
+
Object.getOwnPropertyDescriptors(e)
|
|
55
|
+
);
|
|
56
|
+
t.persist();
|
|
57
|
+
let o = Object.getOwnPropertyDescriptor(t, "view"), r = o?.value;
|
|
58
|
+
return typeof r == "object" && r?.constructor.name === "Window" && Object.defineProperty(t, "view", {
|
|
59
|
+
...o,
|
|
60
|
+
value: Object.create(r.constructor.prototype)
|
|
61
|
+
}), t;
|
|
62
|
+
}
|
|
63
|
+
return e;
|
|
64
|
+
}, "serializeArg"), $ = /* @__PURE__ */ i(() => typeof crypto == "object" && typeof crypto.getRandomValues == "function" ? (0, v.v4)() : (
|
|
65
|
+
// pseudo random id, example response lo1e7zm4832bkr7yfl7
|
|
66
|
+
Date.now().toString(36) + Math.random().toString(36).substring(2)
|
|
67
|
+
), "generateId");
|
|
68
|
+
function l(e, t = {}) {
|
|
69
|
+
let o = {
|
|
70
|
+
...R,
|
|
71
|
+
...t
|
|
72
|
+
}, r = /* @__PURE__ */ i(function(...s) {
|
|
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(
|
|
78
|
+
(d) => d.phase === "playing" || d.phase === "rendering"
|
|
79
|
+
);
|
|
80
|
+
if (x) {
|
|
81
|
+
let d = !globalThis?.FEATURES?.disallowImplicitActionsInRenderV8, b = new O.ImplicitActionsDuringRendering({
|
|
82
|
+
phase: x.phase,
|
|
83
|
+
name: e,
|
|
84
|
+
deprecated: d
|
|
85
|
+
});
|
|
86
|
+
if (d)
|
|
87
|
+
console.warn(b);
|
|
88
|
+
else
|
|
89
|
+
throw b;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
let a = w.addons.getChannel(), c = $(), p = 5, y = s.map(Y), P = s.length > 1 ? y : y[0], S = {
|
|
93
|
+
id: c,
|
|
94
|
+
count: 0,
|
|
95
|
+
data: { name: e, args: P },
|
|
96
|
+
options: {
|
|
97
|
+
...o,
|
|
98
|
+
maxDepth: p + (o.depth || 3),
|
|
99
|
+
allowFunction: o.allowFunction || !1
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
a.emit(E, S);
|
|
103
|
+
}, "actionHandler");
|
|
104
|
+
return r.isAction = !0, r.implicit = t.implicit, r;
|
|
105
|
+
}
|
|
106
|
+
i(l, "action");
|
|
107
|
+
|
|
108
|
+
// src/actions/addArgsHelpers.ts
|
|
109
|
+
var _ = /* @__PURE__ */ i((e, t) => typeof t[e] > "u" && !(e in t), "isInInitialArgs"), D = /* @__PURE__ */ i((e) => {
|
|
110
|
+
let {
|
|
111
|
+
initialArgs: t,
|
|
112
|
+
argTypes: o,
|
|
113
|
+
id: r,
|
|
114
|
+
parameters: { actions: n }
|
|
115
|
+
} = e;
|
|
116
|
+
if (!n || n.disable || !n.argTypesRegex || !o)
|
|
117
|
+
return {};
|
|
118
|
+
let s = new RegExp(n.argTypesRegex);
|
|
119
|
+
return Object.entries(o).filter(
|
|
120
|
+
([c]) => !!s.test(c)
|
|
121
|
+
).reduce((c, [p, y]) => (_(p, t) && (c[p] = l(p, { implicit: !0, id: r })), c), {});
|
|
122
|
+
}, "inferActionsFromArgTypesRegex"), k = /* @__PURE__ */ i((e) => {
|
|
123
|
+
let {
|
|
124
|
+
initialArgs: t,
|
|
125
|
+
argTypes: o,
|
|
126
|
+
parameters: { actions: r }
|
|
127
|
+
} = e;
|
|
128
|
+
return r?.disable || !o ? {} : Object.entries(o).filter(([s, a]) => !!a.action).reduce((s, [a, c]) => (_(a, t) && (s[a] = l(typeof c.action ==
|
|
129
|
+
"string" ? c.action : a)), s), {});
|
|
130
|
+
}, "addActionsFromArgTypes");
|
|
131
|
+
|
|
132
|
+
// src/actions/addArgs.ts
|
|
133
|
+
var B = [
|
|
134
|
+
k,
|
|
135
|
+
D
|
|
136
|
+
];
|
|
137
|
+
|
|
138
|
+
// src/actions/loaders.ts
|
|
139
|
+
var h = {};
|
|
140
|
+
m(h, {
|
|
141
|
+
loaders: () => z
|
|
142
|
+
});
|
|
143
|
+
var j = require("storybook/test/spy");
|
|
144
|
+
var I = !1, K = /* @__PURE__ */ i((e) => {
|
|
145
|
+
let { parameters: t } = e;
|
|
146
|
+
t?.actions?.disable || I || ((0, j.onMockCall)((o, r) => {
|
|
147
|
+
let n = o.getMockName();
|
|
148
|
+
n !== "spy" && (!/^next\/.*::/.test(n) || [
|
|
149
|
+
"next/router::useRouter()",
|
|
150
|
+
"next/navigation::useRouter()",
|
|
151
|
+
"next/navigation::redirect",
|
|
152
|
+
"next/cache::",
|
|
153
|
+
"next/headers::cookies().set",
|
|
154
|
+
"next/headers::cookies().delete",
|
|
155
|
+
"next/headers::headers().set",
|
|
156
|
+
"next/headers::headers().delete"
|
|
157
|
+
].some((s) => n.startsWith(s))) && l(n)(r);
|
|
158
|
+
}), I = !0);
|
|
159
|
+
}, "logActionsWhenMockCalled"), z = [K];
|
|
160
|
+
|
|
161
|
+
// src/actions/preview.ts
|
|
162
|
+
var H = /* @__PURE__ */ i(() => (0, F.definePreview)({
|
|
163
|
+
...A,
|
|
164
|
+
...h
|
|
165
|
+
}), "default");
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Renderer as Renderer$1, ProjectAnnotations as ProjectAnnotations$1, StoryIdentifier, StoryContext, PartialStoryFn, LegacyStoryFn } from 'storybook/internal/csf';
|
|
2
|
+
import { NormalizedProjectAnnotations, ProjectAnnotations as ProjectAnnotations$2, ComposedStoryFn } from 'storybook/internal/types';
|
|
3
|
+
|
|
4
|
+
declare global {
|
|
5
|
+
interface SymbolConstructor {
|
|
6
|
+
readonly observable: symbol;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface Renderer extends Renderer$1 {
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type MaybePromise<T> = Promise<T> | T;
|
|
14
|
+
type TeardownRenderToCanvas = () => MaybePromise<void>;
|
|
15
|
+
type RenderToCanvas<TRenderer extends Renderer> = (context: RenderContext<TRenderer>, element: TRenderer['canvasElement']) => MaybePromise<void | TeardownRenderToCanvas>;
|
|
16
|
+
interface ProjectAnnotations<TRenderer extends Renderer> extends ProjectAnnotations$1<TRenderer> {
|
|
17
|
+
addons?: ProjectAnnotations<TRenderer>[];
|
|
18
|
+
testingLibraryRender?: (...args: never[]) => {
|
|
19
|
+
unmount: () => void;
|
|
20
|
+
};
|
|
21
|
+
renderToCanvas?: RenderToCanvas<TRenderer>;
|
|
22
|
+
renderToDOM?: RenderToCanvas<TRenderer>;
|
|
23
|
+
}
|
|
24
|
+
declare type RenderContext<TRenderer extends Renderer = Renderer> = StoryIdentifier & {
|
|
25
|
+
showMain: () => void;
|
|
26
|
+
showError: (error: {
|
|
27
|
+
title: string;
|
|
28
|
+
description: string;
|
|
29
|
+
}) => void;
|
|
30
|
+
showException: (err: Error) => void;
|
|
31
|
+
forceRemount: boolean;
|
|
32
|
+
storyContext: StoryContext<TRenderer>;
|
|
33
|
+
storyFn: PartialStoryFn<TRenderer>;
|
|
34
|
+
unboundStoryFn: LegacyStoryFn<TRenderer>;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
declare global {
|
|
38
|
+
var globalProjectAnnotations: NormalizedProjectAnnotations<any>;
|
|
39
|
+
var defaultProjectAnnotations: ProjectAnnotations$2<any>;
|
|
40
|
+
}
|
|
41
|
+
type WrappedStoryRef = {
|
|
42
|
+
__pw_type: 'jsx' | 'importRef';
|
|
43
|
+
};
|
|
44
|
+
type UnwrappedJSXStoryRef = {
|
|
45
|
+
__pw_type: 'jsx';
|
|
46
|
+
type: UnwrappedImportStoryRef;
|
|
47
|
+
};
|
|
48
|
+
type UnwrappedImportStoryRef = ComposedStoryFn;
|
|
49
|
+
declare global {
|
|
50
|
+
function __pwUnwrapObject(storyRef: WrappedStoryRef): Promise<UnwrappedJSXStoryRef | UnwrappedImportStoryRef>;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
declare const _default: () => ProjectAnnotations<Renderer>;
|
|
54
|
+
|
|
55
|
+
export { _default as default };
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
var h = Object.defineProperty;
|
|
2
|
+
var n = (t, e) => h(t, "name", { value: e, configurable: !0 });
|
|
3
|
+
var x = (t, e) => {
|
|
4
|
+
for (var o in e)
|
|
5
|
+
h(t, o, { get: e[o], enumerable: !0 });
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
// src/actions/preview.ts
|
|
9
|
+
import { definePreview as N } from "storybook/preview-api";
|
|
10
|
+
|
|
11
|
+
// src/actions/addArgs.ts
|
|
12
|
+
var m = {};
|
|
13
|
+
x(m, {
|
|
14
|
+
argsEnhancers: () => W
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
// src/actions/runtime/action.ts
|
|
18
|
+
import { ImplicitActionsDuringRendering as I } from "storybook/internal/preview-errors";
|
|
19
|
+
import { global as R } from "@storybook/global";
|
|
20
|
+
import { addons as j } from "storybook/preview-api";
|
|
21
|
+
import { v4 as F } from "uuid";
|
|
22
|
+
|
|
23
|
+
// src/actions/constants.ts
|
|
24
|
+
var y = "storybook/actions", B = `${y}/panel`, b = `${y}/action-event`, K = `${y}/action-clear`;
|
|
25
|
+
|
|
26
|
+
// src/actions/runtime/configureActions.ts
|
|
27
|
+
var E = {
|
|
28
|
+
depth: 10,
|
|
29
|
+
clearOnStoryChange: !0,
|
|
30
|
+
limit: 50
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// src/actions/runtime/action.ts
|
|
34
|
+
var O = /* @__PURE__ */ n((t, e) => {
|
|
35
|
+
let o = Object.getPrototypeOf(t);
|
|
36
|
+
return !o || e(o) ? o : O(o, e);
|
|
37
|
+
}, "findProto"), P = /* @__PURE__ */ n((t) => !!(typeof t == "object" && t && O(t, (e) => /^Synthetic(?:Base)?Event$/.test(e.constructor.name)) &&
|
|
38
|
+
typeof t.persist == "function"), "isReactSyntheticEvent"), S = /* @__PURE__ */ n((t) => {
|
|
39
|
+
if (P(t)) {
|
|
40
|
+
let e = Object.create(
|
|
41
|
+
t.constructor.prototype,
|
|
42
|
+
Object.getOwnPropertyDescriptors(t)
|
|
43
|
+
);
|
|
44
|
+
e.persist();
|
|
45
|
+
let o = Object.getOwnPropertyDescriptor(e, "view"), r = o?.value;
|
|
46
|
+
return typeof r == "object" && r?.constructor.name === "Window" && Object.defineProperty(e, "view", {
|
|
47
|
+
...o,
|
|
48
|
+
value: Object.create(r.constructor.prototype)
|
|
49
|
+
}), e;
|
|
50
|
+
}
|
|
51
|
+
return t;
|
|
52
|
+
}, "serializeArg"), C = /* @__PURE__ */ n(() => typeof crypto == "object" && typeof crypto.getRandomValues == "function" ? F() : (
|
|
53
|
+
// pseudo random id, example response lo1e7zm4832bkr7yfl7
|
|
54
|
+
Date.now().toString(36) + Math.random().toString(36).substring(2)
|
|
55
|
+
), "generateId");
|
|
56
|
+
function l(t, e = {}) {
|
|
57
|
+
let o = {
|
|
58
|
+
...E,
|
|
59
|
+
...e
|
|
60
|
+
}, r = /* @__PURE__ */ n(function(...s) {
|
|
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(
|
|
66
|
+
(d) => d.phase === "playing" || d.phase === "rendering"
|
|
67
|
+
);
|
|
68
|
+
if (u) {
|
|
69
|
+
let d = !globalThis?.FEATURES?.disallowImplicitActionsInRenderV8, A = new I({
|
|
70
|
+
phase: u.phase,
|
|
71
|
+
name: t,
|
|
72
|
+
deprecated: d
|
|
73
|
+
});
|
|
74
|
+
if (d)
|
|
75
|
+
console.warn(A);
|
|
76
|
+
else
|
|
77
|
+
throw A;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
let a = j.getChannel(), c = C(), p = 5, g = s.map(S), D = s.length > 1 ? g : g[0], k = {
|
|
81
|
+
id: c,
|
|
82
|
+
count: 0,
|
|
83
|
+
data: { name: t, args: D },
|
|
84
|
+
options: {
|
|
85
|
+
...o,
|
|
86
|
+
maxDepth: p + (o.depth || 3),
|
|
87
|
+
allowFunction: o.allowFunction || !1
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
a.emit(b, k);
|
|
91
|
+
}, "actionHandler");
|
|
92
|
+
return r.isAction = !0, r.implicit = e.implicit, r;
|
|
93
|
+
}
|
|
94
|
+
n(l, "action");
|
|
95
|
+
|
|
96
|
+
// src/actions/addArgsHelpers.ts
|
|
97
|
+
var w = /* @__PURE__ */ n((t, e) => typeof e[t] > "u" && !(t in e), "isInInitialArgs"), v = /* @__PURE__ */ n((t) => {
|
|
98
|
+
let {
|
|
99
|
+
initialArgs: e,
|
|
100
|
+
argTypes: o,
|
|
101
|
+
id: r,
|
|
102
|
+
parameters: { actions: i }
|
|
103
|
+
} = t;
|
|
104
|
+
if (!i || i.disable || !i.argTypesRegex || !o)
|
|
105
|
+
return {};
|
|
106
|
+
let s = new RegExp(i.argTypesRegex);
|
|
107
|
+
return Object.entries(o).filter(
|
|
108
|
+
([c]) => !!s.test(c)
|
|
109
|
+
).reduce((c, [p, g]) => (w(p, e) && (c[p] = l(p, { implicit: !0, id: r })), c), {});
|
|
110
|
+
}, "inferActionsFromArgTypesRegex"), T = /* @__PURE__ */ n((t) => {
|
|
111
|
+
let {
|
|
112
|
+
initialArgs: e,
|
|
113
|
+
argTypes: o,
|
|
114
|
+
parameters: { actions: r }
|
|
115
|
+
} = t;
|
|
116
|
+
return r?.disable || !o ? {} : Object.entries(o).filter(([s, a]) => !!a.action).reduce((s, [a, c]) => (w(a, e) && (s[a] = l(typeof c.action ==
|
|
117
|
+
"string" ? c.action : a)), s), {});
|
|
118
|
+
}, "addActionsFromArgTypes");
|
|
119
|
+
|
|
120
|
+
// src/actions/addArgs.ts
|
|
121
|
+
var W = [
|
|
122
|
+
T,
|
|
123
|
+
v
|
|
124
|
+
];
|
|
125
|
+
|
|
126
|
+
// src/actions/loaders.ts
|
|
127
|
+
var f = {};
|
|
128
|
+
x(f, {
|
|
129
|
+
loaders: () => V
|
|
130
|
+
});
|
|
131
|
+
import { onMockCall as M } from "storybook/test/spy";
|
|
132
|
+
var _ = !1, L = /* @__PURE__ */ n((t) => {
|
|
133
|
+
let { parameters: e } = t;
|
|
134
|
+
e?.actions?.disable || _ || (M((o, r) => {
|
|
135
|
+
let i = o.getMockName();
|
|
136
|
+
i !== "spy" && (!/^next\/.*::/.test(i) || [
|
|
137
|
+
"next/router::useRouter()",
|
|
138
|
+
"next/navigation::useRouter()",
|
|
139
|
+
"next/navigation::redirect",
|
|
140
|
+
"next/cache::",
|
|
141
|
+
"next/headers::cookies().set",
|
|
142
|
+
"next/headers::cookies().delete",
|
|
143
|
+
"next/headers::headers().set",
|
|
144
|
+
"next/headers::headers().delete"
|
|
145
|
+
].some((s) => i.startsWith(s))) && l(i)(r);
|
|
146
|
+
}), _ = !0);
|
|
147
|
+
}, "logActionsWhenMockCalled"), V = [L];
|
|
148
|
+
|
|
149
|
+
// src/actions/preview.ts
|
|
150
|
+
var dt = /* @__PURE__ */ n(() => N({
|
|
151
|
+
...m,
|
|
152
|
+
...f
|
|
153
|
+
}), "default");
|
|
154
|
+
export {
|
|
155
|
+
dt as default
|
|
156
|
+
};
|