storybook 9.1.0-alpha.5 → 9.1.0-alpha.7
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/browser/favicon-wrapper.svg +46 -0
- package/assets/browser/favicon.svg +1 -1
- package/dist/bin/index.cjs +62 -69
- package/dist/bin/index.js +43 -50
- package/dist/cli/bin/index.cjs +932 -932
- package/dist/cli/bin/index.js +635 -634
- package/dist/cli/index.cjs +14965 -14973
- package/dist/cli/index.d.ts +713 -15
- package/dist/cli/index.js +13488 -13495
- package/dist/common/index.cjs +13169 -13067
- package/dist/common/index.d.ts +348 -73
- package/dist/common/index.js +24024 -23919
- package/dist/components/index.cjs +1462 -1448
- package/dist/components/index.d.ts +3 -1
- package/dist/components/index.js +412 -397
- package/dist/core-server/index.cjs +6649 -6588
- package/dist/core-server/index.d.ts +14 -2
- package/dist/core-server/index.js +6053 -5993
- package/dist/core-server/presets/common-manager.js +3438 -3353
- package/dist/core-server/presets/common-preset.cjs +2370 -2374
- package/dist/core-server/presets/common-preset.js +1881 -1881
- package/dist/csf/index.cjs +2536 -736
- package/dist/csf/index.d.ts +251 -9
- package/dist/csf/index.js +2558 -749
- package/dist/csf-tools/index.cjs +226 -224
- package/dist/csf-tools/index.js +116 -112
- package/dist/instrumenter/index.cjs +1150 -1099
- package/dist/instrumenter/index.d.ts +1 -0
- package/dist/instrumenter/index.js +1261 -1214
- package/dist/manager/globals-runtime.js +21317 -23959
- package/dist/manager/runtime.js +3713 -3534
- package/dist/manager-api/index.cjs +74 -74
- package/dist/manager-api/index.d.ts +8 -531
- package/dist/manager-api/index.js +142 -142
- package/dist/node-logger/index.cjs +8520 -994
- package/dist/node-logger/index.d.ts +395 -2
- package/dist/node-logger/index.js +8535 -995
- package/dist/preview/runtime.js +13337 -16032
- package/dist/preview-api/index.cjs +273 -271
- package/dist/preview-api/index.d.ts +4 -1
- package/dist/preview-api/index.js +14 -12
- package/dist/server-errors.cjs +201 -242
- package/dist/server-errors.d.ts +1 -12
- package/dist/server-errors.js +182 -223
- package/dist/telemetry/index.cjs +1314 -1313
- package/dist/telemetry/index.d.ts +3 -2
- package/dist/telemetry/index.js +1195 -1192
- package/dist/test/index.cjs +9136 -9815
- package/dist/test/index.js +8339 -9025
- package/dist/types/index.d.ts +15 -15
- package/package.json +6 -188
- package/dist/actions/preview.cjs +0 -159
- package/dist/actions/preview.d.ts +0 -45
- package/dist/actions/preview.js +0 -149
- package/dist/backgrounds/index.cjs +0 -16
- package/dist/backgrounds/index.d.ts +0 -2
- package/dist/backgrounds/index.js +0 -0
- package/dist/backgrounds/preview.cjs +0 -143
- package/dist/backgrounds/preview.d.ts +0 -53
- package/dist/backgrounds/preview.js +0 -127
- package/dist/component-testing/index.cjs +0 -23
- package/dist/component-testing/index.d.ts +0 -3
- package/dist/component-testing/index.js +0 -5
- package/dist/component-testing/preview.cjs +0 -40
- package/dist/component-testing/preview.d.ts +0 -5
- package/dist/component-testing/preview.js +0 -25
- package/dist/controls/preview.cjs +0 -26
- package/dist/controls/preview.d.ts +0 -43
- package/dist/controls/preview.js +0 -9
- package/dist/highlight/preview.cjs +0 -590
- package/dist/highlight/preview.d.ts +0 -20
- package/dist/highlight/preview.js +0 -575
- package/dist/measure/index.cjs +0 -16
- package/dist/measure/index.d.ts +0 -2
- package/dist/measure/index.js +0 -0
- package/dist/measure/preview.cjs +0 -466
- package/dist/measure/preview.d.ts +0 -25
- package/dist/measure/preview.js +0 -450
- package/dist/outline/index.cjs +0 -16
- package/dist/outline/index.d.ts +0 -2
- package/dist/outline/index.js +0 -0
- package/dist/outline/preview.cjs +0 -518
- package/dist/outline/preview.d.ts +0 -25
- package/dist/outline/preview.js +0 -486
- package/dist/test/preview.cjs +0 -73
- package/dist/test/preview.d.ts +0 -17
- package/dist/test/preview.js +0 -66
- package/dist/viewport/preview.cjs +0 -35
- package/dist/viewport/preview.d.ts +0 -62
- package/dist/viewport/preview.js +0 -19
|
@@ -86,11 +86,11 @@ var Jr = I((Cl, Ao) => {
|
|
|
86
86
|
var e = new wo(process.env.FORCE_SIMILAR_INSTEAD_OF_MAP === "true"), t = [];
|
|
87
87
|
return function(o) {
|
|
88
88
|
var n = /* @__PURE__ */ s(function() {
|
|
89
|
-
var i = e, a, l,
|
|
90
|
-
if ((n.numArgs || n.numArgs === 0) && n.numArgs !==
|
|
89
|
+
var i = e, a, l, d = arguments.length - 1, c = Array(d + 1), u = !0, p;
|
|
90
|
+
if ((n.numArgs || n.numArgs === 0) && n.numArgs !== d + 1)
|
|
91
91
|
throw new Error("Memoizerific functions should always be called with the same number of arguments");
|
|
92
|
-
for (p = 0; p <
|
|
93
|
-
if (
|
|
92
|
+
for (p = 0; p < d; p++) {
|
|
93
|
+
if (c[p] = {
|
|
94
94
|
cacheItem: i,
|
|
95
95
|
arg: arguments[p]
|
|
96
96
|
}, i.has(arguments[p])) {
|
|
@@ -99,11 +99,11 @@ var Jr = I((Cl, Ao) => {
|
|
|
99
99
|
}
|
|
100
100
|
u = !1, a = new wo(process.env.FORCE_SIMILAR_INSTEAD_OF_MAP === "true"), i.set(arguments[p], a), i = a;
|
|
101
101
|
}
|
|
102
|
-
return u && (i.has(arguments[
|
|
103
|
-
0 && (d
|
|
102
|
+
return u && (i.has(arguments[d]) ? l = i.get(arguments[d]) : u = !1), u || (l = o.apply(null, arguments), i.set(arguments[d], l)), r >
|
|
103
|
+
0 && (c[d] = {
|
|
104
104
|
cacheItem: i,
|
|
105
|
-
arg: arguments[
|
|
106
|
-
}, u ? Us(t,
|
|
105
|
+
arg: arguments[d]
|
|
106
|
+
}, u ? Us(t, c) : t.push(c), t.length > r && Hs(t.shift())), n.wasMemoized = u, n.numArgs = d + 1, l;
|
|
107
107
|
}, "memoizerific");
|
|
108
108
|
return n.limit = r, n.wasMemoized = !1, n.cache = e, n.lru = t, n;
|
|
109
109
|
};
|
|
@@ -144,11 +144,11 @@ var $ = I((ze) => {
|
|
|
144
144
|
e[t - 1] = arguments[t];
|
|
145
145
|
var o = Array.from(typeof r == "string" ? [r] : r);
|
|
146
146
|
o[o.length - 1] = o[o.length - 1].replace(/\r?\n([\t ]*)$/, "");
|
|
147
|
-
var n = o.reduce(function(l,
|
|
148
|
-
var
|
|
149
|
-
return
|
|
150
|
-
var p,
|
|
151
|
-
return (
|
|
147
|
+
var n = o.reduce(function(l, d) {
|
|
148
|
+
var c = d.match(/\n([\t ]+|(?!\s).)/g);
|
|
149
|
+
return c ? l.concat(c.map(function(u) {
|
|
150
|
+
var p, y;
|
|
151
|
+
return (y = (p = u.match(/[\t ]/g)) === null || p === void 0 ? void 0 : p.length) !== null && y !== void 0 ? y : 0;
|
|
152
152
|
})) : l;
|
|
153
153
|
}, []);
|
|
154
154
|
if (n.length) {
|
|
@@ -161,14 +161,14 @@ var $ = I((ze) => {
|
|
|
161
161
|
}
|
|
162
162
|
o[0] = o[0].replace(/^\r?\n/, "");
|
|
163
163
|
var a = o[0];
|
|
164
|
-
return e.forEach(function(l,
|
|
165
|
-
var
|
|
164
|
+
return e.forEach(function(l, d) {
|
|
165
|
+
var c = a.match(/(?:^|\n)( *)$/), u = c ? c[1] : "", p = l;
|
|
166
166
|
typeof l == "string" && l.includes(`
|
|
167
167
|
`) && (p = String(l).split(`
|
|
168
|
-
`).map(function(
|
|
169
|
-
return h === 0 ?
|
|
168
|
+
`).map(function(y, h) {
|
|
169
|
+
return h === 0 ? y : "" + u + y;
|
|
170
170
|
}).join(`
|
|
171
|
-
`)), a += p + o[
|
|
171
|
+
`)), a += p + o[d + 1];
|
|
172
172
|
}), a;
|
|
173
173
|
}
|
|
174
174
|
s(Eo, "dedent");
|
|
@@ -399,17 +399,17 @@ var yt = I((Fr) => {
|
|
|
399
399
|
var vi = 20, Pi = "[]", Fi = "[", Ii = "]", Oi = ".";
|
|
400
400
|
function wn(r, e, t = 0, o, n) {
|
|
401
401
|
let { nestingSyntax: i = xe.defaultOptions.nestingSyntax, arrayRepeat: a = xe.defaultOptions.arrayRepeat, arrayRepeatSyntax: l = xe.defaultOptions.
|
|
402
|
-
arrayRepeatSyntax, nesting:
|
|
403
|
-
valueSerializer, shouldSerializeObject: p = xe.defaultOptions.shouldSerializeObject } = e,
|
|
404
|
-
|
|
402
|
+
arrayRepeatSyntax, nesting: d = xe.defaultOptions.nesting, delimiter: c = xe.defaultOptions.delimiter, valueSerializer: u = xe.defaultOptions.
|
|
403
|
+
valueSerializer, shouldSerializeObject: p = xe.defaultOptions.shouldSerializeObject } = e, y = typeof c == "number" ? String.fromCharCode(
|
|
404
|
+
c) : c, h = n === !0 && a, x = i === "dot" || i === "js" && !n;
|
|
405
405
|
if (t > vi)
|
|
406
406
|
return "";
|
|
407
|
-
let R = "",
|
|
407
|
+
let R = "", m = !0, b = !1;
|
|
408
408
|
for (let w in r) {
|
|
409
409
|
let f = r[w], g;
|
|
410
|
-
o ? (g = o, h ? l === "bracket" && (g += Pi) : x ? (g += Oi, g += w) : (g += Fi, g += w, g += Ii)) : g = w,
|
|
411
|
-
"object" && f !== null && !p(f) ? (b = f.pop !== void 0, (
|
|
412
|
-
R += "=", R += u(f, w)),
|
|
410
|
+
o ? (g = o, h ? l === "bracket" && (g += Pi) : x ? (g += Oi, g += w) : (g += Fi, g += w, g += Ii)) : g = w, m || (R += y), typeof f ==
|
|
411
|
+
"object" && f !== null && !p(f) ? (b = f.pop !== void 0, (d || a && b) && (R += wn(f, e, t + 1, g, b))) : (R += (0, Ai.encodeString)(g),
|
|
412
|
+
R += "=", R += u(f, w)), m && (m = !1);
|
|
413
413
|
}
|
|
414
414
|
return R;
|
|
415
415
|
}
|
|
@@ -806,7 +806,7 @@ var vn = I((Ep, Cn) => {
|
|
|
806
806
|
var e = r.indexOf("%");
|
|
807
807
|
if (e === -1) return r;
|
|
808
808
|
for (var t = r.length, o = "", n = 0, i = 0, a = e, l = An; e > -1 && e < t; ) {
|
|
809
|
-
var
|
|
809
|
+
var d = En(r[e + 1], 4), c = En(r[e + 2], 0), u = d | c, p = mt[u];
|
|
810
810
|
if (l = mt[256 + l + p], i = i << 6 | u & mt[364 + p], l === An)
|
|
811
811
|
o += r.slice(n, a), o += i <= 65535 ? String.fromCharCode(i) : String.fromCharCode(
|
|
812
812
|
55232 + (i >> 10),
|
|
@@ -884,15 +884,15 @@ var On = I((re) => {
|
|
|
884
884
|
function Li(r, e) {
|
|
885
885
|
let { valueDeserializer: t = Re.defaultOptions.valueDeserializer, keyDeserializer: o = Re.defaultOptions.keyDeserializer, arrayRepeatSyntax: n = Re.
|
|
886
886
|
defaultOptions.arrayRepeatSyntax, nesting: i = Re.defaultOptions.nesting, arrayRepeat: a = Re.defaultOptions.arrayRepeat, nestingSyntax: l = Re.
|
|
887
|
-
defaultOptions.nestingSyntax, delimiter:
|
|
887
|
+
defaultOptions.nestingSyntax, delimiter: d = Re.defaultOptions.delimiter } = e ?? {}, c = typeof d == "string" ? d.charCodeAt(0) : d, u = l ===
|
|
888
888
|
"js", p = new In();
|
|
889
889
|
if (typeof r != "string")
|
|
890
890
|
return p;
|
|
891
|
-
let
|
|
891
|
+
let y = r.length, h = "", x = -1, R = -1, m = -1, b = p, w, f = "", g = "", A = !1, S = !1, C = !1, M = !1, j = !1, G = !1, ve = !1, U = 0,
|
|
892
892
|
P = -1, W = -1, Ft = -1;
|
|
893
|
-
for (let O = 0; O <
|
|
894
|
-
if (U = O !==
|
|
895
|
-
if (ve = R > x, ve || (R = O),
|
|
893
|
+
for (let O = 0; O < y + 1; O++) {
|
|
894
|
+
if (U = O !== y ? r.charCodeAt(O) : c, U === c) {
|
|
895
|
+
if (ve = R > x, ve || (R = O), m !== R - 1 && (g = Or(r, m + 1, P > -1 ? P : R, C, A), f = o(g), w !== void 0 && (b = (0, Ir.getDeepObject)(
|
|
896
896
|
b, w, f, u && j, u && G))), ve || f !== "") {
|
|
897
897
|
ve && (h = r.slice(R + 1, O), M && (h = h.replace(Fn, " ")), S && (h = (0, Pn.default)(h) || h));
|
|
898
898
|
let je = t(h, f);
|
|
@@ -902,12 +902,12 @@ var On = I((re) => {
|
|
|
902
902
|
} else
|
|
903
903
|
b[f] = je;
|
|
904
904
|
}
|
|
905
|
-
h = "", x = O, R = O, A = !1, S = !1, C = !1, M = !1, j = !1, G = !1, P = -1,
|
|
906
|
-
} else U === 93 ? (a && n === "bracket" && Ft === 91 && (P = W), i && (l === "index" || u) && R <= x && (
|
|
907
|
-
C, A), f = o(g), w !== void 0 && (b = (0, Ir.getDeepObject)(b, w, f, void 0, u)), w = f, C = !1, A = !1),
|
|
908
|
-
46 ? i && (l === "dot" || u) && R <= x && (
|
|
909
|
-
b, w, f, u)), w = f, C = !1, A = !1), j = !0, G = !1,
|
|
910
|
-
|
|
905
|
+
h = "", x = O, R = O, A = !1, S = !1, C = !1, M = !1, j = !1, G = !1, P = -1, m = O, b = p, w = void 0, f = "";
|
|
906
|
+
} else U === 93 ? (a && n === "bracket" && Ft === 91 && (P = W), i && (l === "index" || u) && R <= x && (m !== W && (g = Or(r, m + 1, O,
|
|
907
|
+
C, A), f = o(g), w !== void 0 && (b = (0, Ir.getDeepObject)(b, w, f, void 0, u)), w = f, C = !1, A = !1), m = O, G = !0, j = !1)) : U ===
|
|
908
|
+
46 ? i && (l === "dot" || u) && R <= x && (m !== W && (g = Or(r, m + 1, O, C, A), f = o(g), w !== void 0 && (b = (0, Ir.getDeepObject)(
|
|
909
|
+
b, w, f, u)), w = f, C = !1, A = !1), j = !0, G = !1, m = O) : U === 91 ? i && (l === "index" || u) && R <= x && (m !== W && (g = Or(r,
|
|
910
|
+
m + 1, O, C, A), f = o(g), u && w !== void 0 && (b = (0, Ir.getDeepObject)(b, w, f, u)), w = f, C = !1, A = !1, j = !1, G = !0), m = O) :
|
|
911
911
|
U === 61 ? R <= x ? R = O : S = !0 : U === 43 ? R > x ? M = !0 : C = !0 : U === 37 && (R > x ? S = !0 : A = !0);
|
|
912
912
|
W = O, Ft = U;
|
|
913
913
|
}
|
|
@@ -1361,8 +1361,8 @@ var At = I((L) => {
|
|
|
1361
1361
|
for (var a = 0; a < e.length - 1; a++) {
|
|
1362
1362
|
for (var l = a; l < e.length - 1 && e[l].charCodeAt(1) + 1 === e[l + 1].charCodeAt(1); )
|
|
1363
1363
|
l += 1;
|
|
1364
|
-
var
|
|
1365
|
-
|
|
1364
|
+
var d = 1 + l - a;
|
|
1365
|
+
d < 3 || e.splice(a, d, e[a] + "-" + e[l]);
|
|
1366
1366
|
}
|
|
1367
1367
|
return t.unshift("[" + e.join("") + "]"), new RegExp(t.join("|"), "g");
|
|
1368
1368
|
}
|
|
@@ -1515,8 +1515,8 @@ var hs = I((Jp, ms) => {
|
|
|
1515
1515
|
}, "F");
|
|
1516
1516
|
return { s: n, n: /* @__PURE__ */ s(function() {
|
|
1517
1517
|
return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] };
|
|
1518
|
-
}, "n"), e: /* @__PURE__ */ s(function(
|
|
1519
|
-
throw
|
|
1518
|
+
}, "n"), e: /* @__PURE__ */ s(function(c) {
|
|
1519
|
+
throw c;
|
|
1520
1520
|
}, "e"), f: n };
|
|
1521
1521
|
}
|
|
1522
1522
|
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
@@ -1526,10 +1526,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1526
1526
|
return { s: /* @__PURE__ */ s(function() {
|
|
1527
1527
|
t = t.call(r);
|
|
1528
1528
|
}, "s"), n: /* @__PURE__ */ s(function() {
|
|
1529
|
-
var
|
|
1530
|
-
return i =
|
|
1531
|
-
}, "n"), e: /* @__PURE__ */ s(function(
|
|
1532
|
-
a = !0, l =
|
|
1529
|
+
var c = t.next();
|
|
1530
|
+
return i = c.done, c;
|
|
1531
|
+
}, "n"), e: /* @__PURE__ */ s(function(c) {
|
|
1532
|
+
a = !0, l = c;
|
|
1533
1533
|
}, "e"), f: /* @__PURE__ */ s(function() {
|
|
1534
1534
|
try {
|
|
1535
1535
|
!i && t.return != null && t.return();
|
|
@@ -1749,11 +1749,11 @@ e" : r === 9 ? e = "strike" : 29 < r && r < 38 || r === 39 || 89 < r && r < 98 ?
|
|
|
1749
1749
|
return t("xterm256Background", S), "";
|
|
1750
1750
|
}
|
|
1751
1751
|
s(l, "removeXterm256Background");
|
|
1752
|
-
function
|
|
1752
|
+
function d(A) {
|
|
1753
1753
|
return e.newline ? t("display", -1) : t("text", A), "";
|
|
1754
1754
|
}
|
|
1755
|
-
s(
|
|
1756
|
-
function
|
|
1755
|
+
s(d, "newline");
|
|
1756
|
+
function c(A, S) {
|
|
1757
1757
|
o = !0, S.trim().length === 0 && (S = "0"), S = S.trimRight(";").split(";");
|
|
1758
1758
|
var C = us(S), M;
|
|
1759
1759
|
try {
|
|
@@ -1768,7 +1768,7 @@ e" : r === 9 ? e = "strike" : 29 < r && r < 38 || r === 39 || 89 < r && r < 98 ?
|
|
|
1768
1768
|
}
|
|
1769
1769
|
return "";
|
|
1770
1770
|
}
|
|
1771
|
-
s(
|
|
1771
|
+
s(c, "ansiMess");
|
|
1772
1772
|
function u(A) {
|
|
1773
1773
|
return t("text", A), "";
|
|
1774
1774
|
}
|
|
@@ -1777,7 +1777,7 @@ e" : r === 9 ? e = "strike" : 29 < r && r < 38 || r === 39 || 89 < r && r < 98 ?
|
|
|
1777
1777
|
return t("rgb", A), "";
|
|
1778
1778
|
}
|
|
1779
1779
|
s(p, "rgb");
|
|
1780
|
-
var
|
|
1780
|
+
var y = [{
|
|
1781
1781
|
pattern: /^\x08+/,
|
|
1782
1782
|
sub: i
|
|
1783
1783
|
}, {
|
|
@@ -1797,16 +1797,16 @@ e" : r === 9 ? e = "strike" : 29 < r && r < 38 || r === 39 || 89 < r && r < 98 ?
|
|
|
1797
1797
|
sub: l
|
|
1798
1798
|
}, {
|
|
1799
1799
|
pattern: /^\n/,
|
|
1800
|
-
sub:
|
|
1800
|
+
sub: d
|
|
1801
1801
|
}, {
|
|
1802
1802
|
pattern: /^\r+\n/,
|
|
1803
|
-
sub:
|
|
1803
|
+
sub: d
|
|
1804
1804
|
}, {
|
|
1805
1805
|
pattern: /^\r/,
|
|
1806
|
-
sub:
|
|
1806
|
+
sub: d
|
|
1807
1807
|
}, {
|
|
1808
1808
|
pattern: /^\x1b\[((?:\d{1,3};?)+|)m/,
|
|
1809
|
-
sub:
|
|
1809
|
+
sub: c
|
|
1810
1810
|
}, {
|
|
1811
1811
|
// CSI n J
|
|
1812
1812
|
// ED - Erase in Display Clears part of the screen.
|
|
@@ -1841,18 +1841,18 @@ e" : r === 9 ? e = "strike" : 29 < r && r < 38 || r === 39 || 89 < r && r < 98 ?
|
|
|
1841
1841
|
S > n && o || (o = !1, r = r.replace(A.pattern, A.sub));
|
|
1842
1842
|
}
|
|
1843
1843
|
s(h, "process");
|
|
1844
|
-
var x = [], R = r,
|
|
1845
|
-
e: for (;
|
|
1846
|
-
for (var b = 0, w = 0, f =
|
|
1847
|
-
var g =
|
|
1848
|
-
if (h(g, b), r.length !==
|
|
1849
|
-
|
|
1844
|
+
var x = [], R = r, m = R.length;
|
|
1845
|
+
e: for (; m > 0; ) {
|
|
1846
|
+
for (var b = 0, w = 0, f = y.length; w < f; b = ++w) {
|
|
1847
|
+
var g = y[b];
|
|
1848
|
+
if (h(g, b), r.length !== m) {
|
|
1849
|
+
m = r.length;
|
|
1850
1850
|
continue e;
|
|
1851
1851
|
}
|
|
1852
1852
|
}
|
|
1853
|
-
if (r.length ===
|
|
1853
|
+
if (r.length === m)
|
|
1854
1854
|
break;
|
|
1855
|
-
x.push(0),
|
|
1855
|
+
x.push(0), m = r.length;
|
|
1856
1856
|
}
|
|
1857
1857
|
return x;
|
|
1858
1858
|
}
|
|
@@ -1877,11 +1877,11 @@ e" : r === 9 ? e = "strike" : 29 < r && r < 38 || r === 39 || 89 < r && r < 98 ?
|
|
|
1877
1877
|
t = typeof t == "string" ? [t] : t;
|
|
1878
1878
|
var n = this.stack, i = this.options, a = [];
|
|
1879
1879
|
return this.stickyStack.forEach(function(l) {
|
|
1880
|
-
var
|
|
1881
|
-
|
|
1882
|
-
}), Pa(t.join(""), i, function(l,
|
|
1883
|
-
var
|
|
1884
|
-
|
|
1880
|
+
var d = cs(n, l.token, l.data, i);
|
|
1881
|
+
d && a.push(d);
|
|
1882
|
+
}), Pa(t.join(""), i, function(l, d) {
|
|
1883
|
+
var c = cs(n, l, d, i);
|
|
1884
|
+
c && a.push(c), i.stream && (o.stickyStack = Fa(o.stickyStack, l, d));
|
|
1885
1885
|
}), n.length && a.push(ys(n)), a.join("");
|
|
1886
1886
|
}, "toHtml")
|
|
1887
1887
|
}]), r;
|
|
@@ -2049,14 +2049,14 @@ function Dt(r) {
|
|
|
2049
2049
|
o.currentDecoratorName = r.name, o.prevMountedDecorators.has(r) ? (o.currentPhase = "UPDATE", o.currentHooks = o.hookListsMap.get(r) || []) :
|
|
2050
2050
|
(o.currentPhase = "MOUNT", o.currentHooks = [], o.hookListsMap.set(r, o.currentHooks), o.prevMountedDecorators.add(r)), o.nextHookIndex =
|
|
2051
2051
|
0;
|
|
2052
|
-
let
|
|
2052
|
+
let d = Ne.global.STORYBOOK_HOOKS_CONTEXT;
|
|
2053
2053
|
Ne.global.STORYBOOK_HOOKS_CONTEXT = o;
|
|
2054
|
-
let
|
|
2055
|
-
if (Ne.global.STORYBOOK_HOOKS_CONTEXT =
|
|
2054
|
+
let c = r(...t);
|
|
2055
|
+
if (Ne.global.STORYBOOK_HOOKS_CONTEXT = d, o.currentPhase === "UPDATE" && o.getNextHook() != null)
|
|
2056
2056
|
throw new Error(
|
|
2057
2057
|
"Rendered fewer hooks than expected. This may be caused by an accidental early return statement."
|
|
2058
2058
|
);
|
|
2059
|
-
return o.currentPhase = n, o.currentHooks = i, o.nextHookIndex = a, o.currentDecoratorName = l,
|
|
2059
|
+
return o.currentPhase = n, o.currentHooks = i, o.nextHookIndex = a, o.currentDecoratorName = l, c;
|
|
2060
2060
|
}, "hookified");
|
|
2061
2061
|
return e.originalFn = r, e;
|
|
2062
2062
|
}
|
|
@@ -2174,7 +2174,7 @@ function Lt(r) {
|
|
|
2174
2174
|
s(Lt, "useState");
|
|
2175
2175
|
function qt(r, e, t) {
|
|
2176
2176
|
let o = t != null ? () => t(e) : e, [n, i] = Nt("useReducer", o);
|
|
2177
|
-
return [n, /* @__PURE__ */ s((l) => i((
|
|
2177
|
+
return [n, /* @__PURE__ */ s((l) => i((d) => r(d, l)), "dispatch")];
|
|
2178
2178
|
}
|
|
2179
2179
|
s(qt, "useReducer");
|
|
2180
2180
|
function Vr(r, e) {
|
|
@@ -2232,10 +2232,10 @@ var Ht = /* @__PURE__ */ s(({
|
|
|
2232
2232
|
skipIfNoParametersOrOptions: o = !1
|
|
2233
2233
|
}) => {
|
|
2234
2234
|
let n = /* @__PURE__ */ s((i) => (a, l) => {
|
|
2235
|
-
let
|
|
2236
|
-
return
|
|
2235
|
+
let d = l.parameters && l.parameters[e];
|
|
2236
|
+
return d && d.disable || o && !i && !d ? a(l) : t(a, l, {
|
|
2237
2237
|
options: i,
|
|
2238
|
-
parameters:
|
|
2238
|
+
parameters: d
|
|
2239
2239
|
});
|
|
2240
2240
|
}, "decorator");
|
|
2241
2241
|
return (...i) => typeof i[0] == "function" ? n()(...i) : (...a) => {
|
|
@@ -2350,8 +2350,8 @@ function Be(r, e, t, o) {
|
|
|
2350
2350
|
case $t:
|
|
2351
2351
|
return r.toString() === e.toString();
|
|
2352
2352
|
case Yt: {
|
|
2353
|
-
let
|
|
2354
|
-
return go(
|
|
2353
|
+
let d = r.valueOf(), c = e.valueOf();
|
|
2354
|
+
return go(d, c);
|
|
2355
2355
|
}
|
|
2356
2356
|
case Kt:
|
|
2357
2357
|
case Jt:
|
|
@@ -2372,20 +2372,20 @@ function Be(r, e, t, o) {
|
|
|
2372
2372
|
case Qt: {
|
|
2373
2373
|
if (r.size !== e.size)
|
|
2374
2374
|
return !1;
|
|
2375
|
-
for (let [
|
|
2376
|
-
if (!e.has(
|
|
2375
|
+
for (let [d, c] of r.entries())
|
|
2376
|
+
if (!e.has(d) || !qe(c, e.get(d), d, r, e, t, o))
|
|
2377
2377
|
return !1;
|
|
2378
2378
|
return !0;
|
|
2379
2379
|
}
|
|
2380
2380
|
case Zt: {
|
|
2381
2381
|
if (r.size !== e.size)
|
|
2382
2382
|
return !1;
|
|
2383
|
-
let
|
|
2384
|
-
for (let u = 0; u <
|
|
2385
|
-
let p =
|
|
2386
|
-
if (
|
|
2383
|
+
let d = Array.from(r.values()), c = Array.from(e.values());
|
|
2384
|
+
for (let u = 0; u < d.length; u++) {
|
|
2385
|
+
let p = d[u], y = c.findIndex((h) => qe(p, h, void 0, r, e, t, o));
|
|
2386
|
+
if (y === -1)
|
|
2387
2387
|
return !1;
|
|
2388
|
-
|
|
2388
|
+
c.splice(y, 1);
|
|
2389
2389
|
}
|
|
2390
2390
|
return !0;
|
|
2391
2391
|
}
|
|
@@ -2403,8 +2403,8 @@ function Be(r, e, t, o) {
|
|
|
2403
2403
|
case ho: {
|
|
2404
2404
|
if (typeof Buffer < "u" && Buffer.isBuffer(r) !== Buffer.isBuffer(e) || r.length !== e.length)
|
|
2405
2405
|
return !1;
|
|
2406
|
-
for (let
|
|
2407
|
-
if (!qe(r[
|
|
2406
|
+
for (let d = 0; d < r.length; d++)
|
|
2407
|
+
if (!qe(r[d], e[d], d, r, e, t, o))
|
|
2408
2408
|
return !1;
|
|
2409
2409
|
return !0;
|
|
2410
2410
|
}
|
|
@@ -2417,15 +2417,15 @@ function Be(r, e, t, o) {
|
|
|
2417
2417
|
case ar: {
|
|
2418
2418
|
if (!(Be(r.constructor, e.constructor, t, o) || N(r) && N(e)))
|
|
2419
2419
|
return !1;
|
|
2420
|
-
let
|
|
2421
|
-
if (
|
|
2420
|
+
let c = [...Object.keys(r), ...Wr(r)], u = [...Object.keys(e), ...Wr(e)];
|
|
2421
|
+
if (c.length !== u.length)
|
|
2422
2422
|
return !1;
|
|
2423
|
-
for (let p = 0; p <
|
|
2424
|
-
let
|
|
2425
|
-
if (!Object.hasOwn(e,
|
|
2423
|
+
for (let p = 0; p < c.length; p++) {
|
|
2424
|
+
let y = c[p], h = r[y];
|
|
2425
|
+
if (!Object.hasOwn(e, y))
|
|
2426
2426
|
return !1;
|
|
2427
|
-
let x = e[
|
|
2428
|
-
if (!qe(h, x,
|
|
2427
|
+
let x = e[y];
|
|
2428
|
+
if (!qe(h, x, y, r, e, t, o))
|
|
2429
2429
|
return !1;
|
|
2430
2430
|
}
|
|
2431
2431
|
return !0;
|
|
@@ -2510,11 +2510,11 @@ var Ie = Symbol("incompatible"), Zr = /* @__PURE__ */ s((r, e) => {
|
|
|
2510
2510
|
|
|
2511
2511
|
More info: https://storybook.js.org/docs/writing-stories/args#mapping-to-complex-arg-values
|
|
2512
2512
|
`), i();
|
|
2513
|
-
let a = Array.isArray(r[o]), l = a && r[o].findIndex((p) => !n.includes(p)),
|
|
2514
|
-
if (r[o] === void 0 || n.includes(r[o]) ||
|
|
2513
|
+
let a = Array.isArray(r[o]), l = a && r[o].findIndex((p) => !n.includes(p)), d = a && l === -1;
|
|
2514
|
+
if (r[o] === void 0 || n.includes(r[o]) || d)
|
|
2515
2515
|
return i();
|
|
2516
|
-
let
|
|
2517
|
-
return lr.once.warn(`Received illegal value for '${
|
|
2516
|
+
let c = a ? `${o}[${l}]` : o, u = n.map((p) => typeof p == "string" ? `'${p}'` : String(p)).join(", ");
|
|
2517
|
+
return lr.once.warn(`Received illegal value for '${c}'. Supported options: ${u}`), t;
|
|
2518
2518
|
}, {}), "validateOptions"), pe = Symbol("Deeply equal"), De = /* @__PURE__ */ s((r, e) => {
|
|
2519
2519
|
if (typeof r != typeof e)
|
|
2520
2520
|
return e;
|
|
@@ -2691,33 +2691,33 @@ See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#hoisted-csf-
|
|
|
2691
2691
|
function fe(r, e, t) {
|
|
2692
2692
|
let o = e, n = typeof e == "function" ? e : null, { story: i } = o;
|
|
2693
2693
|
i && (fr.logger.debug("deprecated story", i), (0, fr.deprecate)(Js));
|
|
2694
|
-
let a = (0, yr.storyNameFromExport)(r), l = typeof o != "function" && o.name || o.storyName || i?.name || a,
|
|
2694
|
+
let a = (0, yr.storyNameFromExport)(r), l = typeof o != "function" && o.name || o.storyName || i?.name || a, d = [
|
|
2695
2695
|
...v(o.decorators),
|
|
2696
2696
|
...v(i?.decorators)
|
|
2697
|
-
],
|
|
2697
|
+
], c = { ...i?.parameters, ...o.parameters }, u = { ...i?.args, ...o.args }, p = { ...i?.argTypes, ...o.argTypes }, y = [...v(o.loaders), ...v(
|
|
2698
2698
|
i?.loaders)], h = [
|
|
2699
2699
|
...v(o.beforeEach),
|
|
2700
2700
|
...v(i?.beforeEach)
|
|
2701
2701
|
], x = [
|
|
2702
2702
|
...v(o.afterEach),
|
|
2703
2703
|
...v(i?.afterEach)
|
|
2704
|
-
], { render: R, play:
|
|
2704
|
+
], { render: R, play: m, tags: b = [], globals: w = {} } = o, f = c.__id || (0, yr.toId)(t.id, a);
|
|
2705
2705
|
return {
|
|
2706
2706
|
moduleExport: e,
|
|
2707
2707
|
id: f,
|
|
2708
2708
|
name: l,
|
|
2709
2709
|
tags: b,
|
|
2710
|
-
decorators:
|
|
2711
|
-
parameters:
|
|
2710
|
+
decorators: d,
|
|
2711
|
+
parameters: c,
|
|
2712
2712
|
args: u,
|
|
2713
2713
|
argTypes: ue(p),
|
|
2714
|
-
loaders:
|
|
2714
|
+
loaders: y,
|
|
2715
2715
|
beforeEach: h,
|
|
2716
2716
|
afterEach: x,
|
|
2717
2717
|
globals: w,
|
|
2718
2718
|
...R && { render: R },
|
|
2719
2719
|
...n && { userStoryFn: n },
|
|
2720
|
-
...
|
|
2720
|
+
...m && { play: m }
|
|
2721
2721
|
};
|
|
2722
2722
|
}
|
|
2723
2723
|
s(fe, "normalizeStory");
|
|
@@ -2761,13 +2761,13 @@ var Qs = /* @__PURE__ */ s((r) => {
|
|
|
2761
2761
|
function Mo(r, e, t) {
|
|
2762
2762
|
let { default: o, __namedExportsOrder: n, ...i } = r, a = Object.values(i)[0];
|
|
2763
2763
|
if ((0, Ue.isStory)(a)) {
|
|
2764
|
-
let
|
|
2765
|
-
mr(
|
|
2766
|
-
let u = { meta:
|
|
2764
|
+
let c = Ge(a.meta.input, t, e);
|
|
2765
|
+
mr(c.parameters);
|
|
2766
|
+
let u = { meta: c, stories: {}, moduleExports: r };
|
|
2767
2767
|
return Object.keys(i).forEach((p) => {
|
|
2768
|
-
if ((0, Ue.isExportStory)(p,
|
|
2769
|
-
let
|
|
2770
|
-
mr(
|
|
2768
|
+
if ((0, Ue.isExportStory)(p, c)) {
|
|
2769
|
+
let y = fe(p, i[p].input, c);
|
|
2770
|
+
mr(y.parameters), u.stories[y.id] = y;
|
|
2771
2771
|
}
|
|
2772
2772
|
}), u.projectAnnotations = a.meta.preview.composed, u;
|
|
2773
2773
|
}
|
|
@@ -2777,13 +2777,13 @@ function Mo(r, e, t) {
|
|
|
2777
2777
|
e
|
|
2778
2778
|
);
|
|
2779
2779
|
mr(l.parameters);
|
|
2780
|
-
let
|
|
2781
|
-
return Object.keys(i).forEach((
|
|
2782
|
-
if ((0, Ue.isExportStory)(
|
|
2783
|
-
let u = fe(
|
|
2784
|
-
mr(u.parameters),
|
|
2780
|
+
let d = { meta: l, stories: {}, moduleExports: r };
|
|
2781
|
+
return Object.keys(i).forEach((c) => {
|
|
2782
|
+
if ((0, Ue.isExportStory)(c, l)) {
|
|
2783
|
+
let u = fe(c, i[c], l);
|
|
2784
|
+
mr(u.parameters), d.stories[u.id] = u;
|
|
2785
2785
|
}
|
|
2786
|
-
}),
|
|
2786
|
+
}), d;
|
|
2787
2787
|
}
|
|
2788
2788
|
s(Mo, "processCSFFile");
|
|
2789
2789
|
|
|
@@ -2837,10 +2837,10 @@ function ot({
|
|
|
2837
2837
|
story: i,
|
|
2838
2838
|
parameters: a,
|
|
2839
2839
|
initialArgs: l,
|
|
2840
|
-
argTypes:
|
|
2841
|
-
...
|
|
2840
|
+
argTypes: d,
|
|
2841
|
+
...c
|
|
2842
2842
|
} = {}) {
|
|
2843
|
-
return
|
|
2843
|
+
return c;
|
|
2844
2844
|
}
|
|
2845
2845
|
s(ot, "sanitizeStoryContextUpdate");
|
|
2846
2846
|
function hr(r, e) {
|
|
@@ -2862,8 +2862,8 @@ s(hr, "defaultDecorateStory");
|
|
|
2862
2862
|
// src/preview-api/modules/store/parameters.ts
|
|
2863
2863
|
var B = /* @__PURE__ */ s((...r) => {
|
|
2864
2864
|
let e = {}, t = r.filter(Boolean), o = t.reduce((n, i) => (Object.entries(i).forEach(([a, l]) => {
|
|
2865
|
-
let
|
|
2866
|
-
Array.isArray(l) || typeof
|
|
2865
|
+
let d = n[a];
|
|
2866
|
+
Array.isArray(l) || typeof d > "u" ? n[a] = l : N(l) && N(d) ? e[a] = !0 : typeof l < "u" && (n[a] = l);
|
|
2867
2867
|
}), n), {});
|
|
2868
2868
|
return Object.keys(e).forEach((n) => {
|
|
2869
2869
|
let i = t.filter(Boolean).map((a) => a[n]).filter((a) => typeof a < "u");
|
|
@@ -2890,7 +2890,7 @@ function ke(r, e, t) {
|
|
|
2890
2890
|
Object.assign(C, ...j);
|
|
2891
2891
|
}
|
|
2892
2892
|
return C;
|
|
2893
|
-
}, "applyLoaders"),
|
|
2893
|
+
}, "applyLoaders"), d = /* @__PURE__ */ s(async (S) => {
|
|
2894
2894
|
let C = new Array();
|
|
2895
2895
|
for (let M of [
|
|
2896
2896
|
...v(t.beforeEach),
|
|
@@ -2903,7 +2903,7 @@ function ke(r, e, t) {
|
|
|
2903
2903
|
j && C.push(j);
|
|
2904
2904
|
}
|
|
2905
2905
|
return C;
|
|
2906
|
-
}, "applyBeforeEach"),
|
|
2906
|
+
}, "applyBeforeEach"), c = /* @__PURE__ */ s(async (S) => {
|
|
2907
2907
|
let C = [
|
|
2908
2908
|
...v(t.afterEach),
|
|
2909
2909
|
...v(e.afterEach),
|
|
@@ -2914,12 +2914,12 @@ function ke(r, e, t) {
|
|
|
2914
2914
|
return;
|
|
2915
2915
|
await M(S);
|
|
2916
2916
|
}
|
|
2917
|
-
}, "applyAfterEach"), u = /* @__PURE__ */ s((S) => S.originalStoryFn(S.args, S), "undecoratedStoryFn"), { applyDecorators: p = hr, runStep:
|
|
2917
|
+
}, "applyAfterEach"), u = /* @__PURE__ */ s((S) => S.originalStoryFn(S.args, S), "undecoratedStoryFn"), { applyDecorators: p = hr, runStep: y } = t,
|
|
2918
2918
|
h = [
|
|
2919
2919
|
...v(r?.decorators),
|
|
2920
2920
|
...v(e?.decorators),
|
|
2921
2921
|
...v(t?.decorators)
|
|
2922
|
-
], x = r?.userStoryFn || r?.render || e.render || t.render, R = sr(p)(u, h),
|
|
2922
|
+
], x = r?.userStoryFn || r?.render || e.render || t.render, R = sr(p)(u, h), m = /* @__PURE__ */ s((S) => R(S), "unboundStoryFn"), b = r?.
|
|
2923
2923
|
play ?? e?.play, w = _o(b);
|
|
2924
2924
|
if (!x && !w)
|
|
2925
2925
|
throw new No.NoRenderFunctionError({ id: n });
|
|
@@ -2934,12 +2934,12 @@ function ke(r, e, t) {
|
|
|
2934
2934
|
story: i,
|
|
2935
2935
|
originalStoryFn: x,
|
|
2936
2936
|
undecoratedStoryFn: u,
|
|
2937
|
-
unboundStoryFn:
|
|
2937
|
+
unboundStoryFn: m,
|
|
2938
2938
|
applyLoaders: l,
|
|
2939
|
-
applyBeforeEach:
|
|
2940
|
-
applyAfterEach:
|
|
2939
|
+
applyBeforeEach: d,
|
|
2940
|
+
applyAfterEach: c,
|
|
2941
2941
|
playFunction: b,
|
|
2942
|
-
runStep:
|
|
2942
|
+
runStep: y,
|
|
2943
2943
|
mount: g,
|
|
2944
2944
|
testingLibraryRender: A,
|
|
2945
2945
|
renderToCanvas: t.renderToCanvas,
|
|
@@ -2965,7 +2965,7 @@ function Bo(r, e, t) {
|
|
|
2965
2965
|
t.parameters,
|
|
2966
2966
|
e.parameters,
|
|
2967
2967
|
r?.parameters
|
|
2968
|
-
), { argTypesEnhancers: l = [], argsEnhancers:
|
|
2968
|
+
), { argTypesEnhancers: l = [], argsEnhancers: d = [] } = t, c = B(
|
|
2969
2969
|
t.argTypes,
|
|
2970
2970
|
e.argTypes,
|
|
2971
2971
|
r?.argTypes
|
|
@@ -2981,7 +2981,7 @@ function Bo(r, e, t) {
|
|
|
2981
2981
|
}, p = {
|
|
2982
2982
|
...e.globals,
|
|
2983
2983
|
...r?.globals
|
|
2984
|
-
},
|
|
2984
|
+
}, y = {
|
|
2985
2985
|
componentId: e.id,
|
|
2986
2986
|
title: e.title,
|
|
2987
2987
|
kind: e.title,
|
|
@@ -2996,26 +2996,26 @@ function Bo(r, e, t) {
|
|
|
2996
2996
|
tags: i,
|
|
2997
2997
|
parameters: a,
|
|
2998
2998
|
initialArgs: u,
|
|
2999
|
-
argTypes:
|
|
2999
|
+
argTypes: c,
|
|
3000
3000
|
storyGlobals: p
|
|
3001
3001
|
};
|
|
3002
|
-
|
|
3003
|
-
(b, w) => w({ ...
|
|
3004
|
-
|
|
3002
|
+
y.argTypes = l.reduce(
|
|
3003
|
+
(b, w) => w({ ...y, argTypes: b }),
|
|
3004
|
+
y.argTypes
|
|
3005
3005
|
);
|
|
3006
3006
|
let h = { ...u };
|
|
3007
|
-
|
|
3007
|
+
y.initialArgs = [...d].reduce(
|
|
3008
3008
|
(b, w) => ({
|
|
3009
3009
|
...b,
|
|
3010
3010
|
...w({
|
|
3011
|
-
...
|
|
3011
|
+
...y,
|
|
3012
3012
|
initialArgs: b
|
|
3013
3013
|
})
|
|
3014
3014
|
}),
|
|
3015
3015
|
h
|
|
3016
3016
|
);
|
|
3017
|
-
let { name: x, story: R, ...
|
|
3018
|
-
return
|
|
3017
|
+
let { name: x, story: R, ...m } = y;
|
|
3018
|
+
return m;
|
|
3019
3019
|
}
|
|
3020
3020
|
s(Bo, "preparePartialAnnotations");
|
|
3021
3021
|
function Sr(r) {
|
|
@@ -3036,14 +3036,14 @@ function Sr(r) {
|
|
|
3036
3036
|
let o = Object.entries(t.args).reduce((i, [a, l]) => {
|
|
3037
3037
|
if (!t.argTypes[a]?.mapping)
|
|
3038
3038
|
return i[a] = l, i;
|
|
3039
|
-
let
|
|
3039
|
+
let d = /* @__PURE__ */ s((c) => {
|
|
3040
3040
|
let u = t.argTypes[a].mapping;
|
|
3041
|
-
return u &&
|
|
3041
|
+
return u && c in u ? u[c] : c;
|
|
3042
3042
|
}, "mappingFn");
|
|
3043
|
-
return i[a] = Array.isArray(l) ? l.map(
|
|
3043
|
+
return i[a] = Array.isArray(l) ? l.map(d) : d(l), i;
|
|
3044
3044
|
}, {}), n = Object.entries(o).reduce((i, [a, l]) => {
|
|
3045
|
-
let
|
|
3046
|
-
return (0, gr.includeConditionalArg)(
|
|
3045
|
+
let d = t.argTypes[a] || {};
|
|
3046
|
+
return (0, gr.includeConditionalArg)(d, o, t.globals) && (i[a] = l), i;
|
|
3047
3047
|
}, {});
|
|
3048
3048
|
return { ...t, unmappedArgs: e, args: n };
|
|
3049
3049
|
}
|
|
@@ -3134,7 +3134,7 @@ var ri = /* @__PURE__ */ s((r, e, t) => {
|
|
|
3134
3134
|
} = r;
|
|
3135
3135
|
if (!t)
|
|
3136
3136
|
return e;
|
|
3137
|
-
let a = He(e, o, n), l = Q(a, (
|
|
3137
|
+
let a = He(e, o, n), l = Q(a, (d, c) => d?.type && ri(d, c.toString(), i));
|
|
3138
3138
|
return B(l, a);
|
|
3139
3139
|
}, "inferControls");
|
|
3140
3140
|
Me.secondPass = !0;
|
|
@@ -3149,7 +3149,7 @@ function ye({
|
|
|
3149
3149
|
beforeEach: i,
|
|
3150
3150
|
afterEach: a,
|
|
3151
3151
|
initialGlobals: l,
|
|
3152
|
-
...
|
|
3152
|
+
...d
|
|
3153
3153
|
}) {
|
|
3154
3154
|
return {
|
|
3155
3155
|
...r && { argTypes: ue(r) },
|
|
@@ -3179,7 +3179,7 @@ function ye({
|
|
|
3179
3179
|
Me
|
|
3180
3180
|
],
|
|
3181
3181
|
initialGlobals: l,
|
|
3182
|
-
...
|
|
3182
|
+
...d
|
|
3183
3183
|
};
|
|
3184
3184
|
}
|
|
3185
3185
|
s(ye, "normalizeProjectAnnotations");
|
|
@@ -3390,45 +3390,45 @@ function it(r, e, t, o, n) {
|
|
|
3390
3390
|
a,
|
|
3391
3391
|
r,
|
|
3392
3392
|
i
|
|
3393
|
-
),
|
|
3393
|
+
), d = ye(
|
|
3394
3394
|
Z([
|
|
3395
3395
|
o ?? globalThis.globalProjectAnnotations ?? {},
|
|
3396
3396
|
t ?? {}
|
|
3397
3397
|
])
|
|
3398
|
-
),
|
|
3398
|
+
), c = ke(
|
|
3399
3399
|
l,
|
|
3400
3400
|
i,
|
|
3401
|
-
|
|
3401
|
+
d
|
|
3402
3402
|
), p = {
|
|
3403
|
-
...dr(
|
|
3404
|
-
...
|
|
3405
|
-
...
|
|
3406
|
-
},
|
|
3403
|
+
...dr(d.globalTypes),
|
|
3404
|
+
...d.initialGlobals,
|
|
3405
|
+
...c.storyGlobals
|
|
3406
|
+
}, y = new se(), h = /* @__PURE__ */ s(() => {
|
|
3407
3407
|
let f = Sr({
|
|
3408
3408
|
hooks: new te(),
|
|
3409
3409
|
globals: p,
|
|
3410
|
-
args: { ...
|
|
3410
|
+
args: { ...c.initialArgs },
|
|
3411
3411
|
viewMode: "story",
|
|
3412
|
-
reporting:
|
|
3412
|
+
reporting: y,
|
|
3413
3413
|
loaded: {},
|
|
3414
3414
|
abortSignal: new AbortController().signal,
|
|
3415
|
-
step: /* @__PURE__ */ s((g, A) =>
|
|
3415
|
+
step: /* @__PURE__ */ s((g, A) => c.runStep(g, A, f), "step"),
|
|
3416
3416
|
canvasElement: null,
|
|
3417
3417
|
canvas: {},
|
|
3418
3418
|
userEvent: {},
|
|
3419
|
-
globalTypes:
|
|
3420
|
-
...
|
|
3419
|
+
globalTypes: d.globalTypes,
|
|
3420
|
+
...c,
|
|
3421
3421
|
context: null,
|
|
3422
3422
|
mount: null
|
|
3423
3423
|
});
|
|
3424
|
-
return f.parameters.__isPortableStory = !0, f.context = f,
|
|
3425
|
-
let g = await
|
|
3424
|
+
return f.parameters.__isPortableStory = !0, f.context = f, c.renderToCanvas && (f.renderToCanvas = async () => {
|
|
3425
|
+
let g = await c.renderToCanvas?.(
|
|
3426
3426
|
{
|
|
3427
|
-
componentId:
|
|
3428
|
-
title:
|
|
3429
|
-
id:
|
|
3430
|
-
name:
|
|
3431
|
-
tags:
|
|
3427
|
+
componentId: c.componentId,
|
|
3428
|
+
title: c.title,
|
|
3429
|
+
id: c.id,
|
|
3430
|
+
name: c.name,
|
|
3431
|
+
tags: c.tags,
|
|
3432
3432
|
showMain: /* @__PURE__ */ s(() => {
|
|
3433
3433
|
}, "showMain"),
|
|
3434
3434
|
showError: /* @__PURE__ */ s((A) => {
|
|
@@ -3440,46 +3440,46 @@ ${A.description}`);
|
|
|
3440
3440
|
}, "showException"),
|
|
3441
3441
|
forceRemount: !0,
|
|
3442
3442
|
storyContext: f,
|
|
3443
|
-
storyFn: /* @__PURE__ */ s(() =>
|
|
3444
|
-
unboundStoryFn:
|
|
3443
|
+
storyFn: /* @__PURE__ */ s(() => c.unboundStoryFn(f), "storyFn"),
|
|
3444
|
+
unboundStoryFn: c.unboundStoryFn
|
|
3445
3445
|
},
|
|
3446
3446
|
f.canvasElement
|
|
3447
3447
|
);
|
|
3448
3448
|
g && ie.push(g);
|
|
3449
|
-
}), f.mount =
|
|
3449
|
+
}), f.mount = c.mount(f), f;
|
|
3450
3450
|
}, "initializeContext"), x, R = /* @__PURE__ */ s(async (f) => {
|
|
3451
3451
|
let g = h();
|
|
3452
|
-
return g.canvasElement ??= globalThis?.document?.body, x && (g.loaded = x.loaded), Object.assign(g, f),
|
|
3453
|
-
}, "play"),
|
|
3452
|
+
return g.canvasElement ??= globalThis?.document?.body, x && (g.loaded = x.loaded), Object.assign(g, f), c.playFunction(g);
|
|
3453
|
+
}, "play"), m = /* @__PURE__ */ s((f) => {
|
|
3454
3454
|
let g = h();
|
|
3455
|
-
return Object.assign(g, f), ai(
|
|
3456
|
-
}, "run"), b =
|
|
3455
|
+
return Object.assign(g, f), ai(c, g);
|
|
3456
|
+
}, "run"), b = c.playFunction ? R : void 0;
|
|
3457
3457
|
return Object.assign(
|
|
3458
3458
|
/* @__PURE__ */ s(function(g) {
|
|
3459
3459
|
let A = h();
|
|
3460
3460
|
return x && (A.loaded = x.loaded), A.args = {
|
|
3461
3461
|
...A.initialArgs,
|
|
3462
3462
|
...g
|
|
3463
|
-
},
|
|
3463
|
+
}, c.unboundStoryFn(A);
|
|
3464
3464
|
}, "storyFn"),
|
|
3465
3465
|
{
|
|
3466
|
-
id:
|
|
3466
|
+
id: c.id,
|
|
3467
3467
|
storyName: a,
|
|
3468
3468
|
load: /* @__PURE__ */ s(async () => {
|
|
3469
3469
|
for (let g of [...ie].reverse())
|
|
3470
3470
|
await g();
|
|
3471
3471
|
ie.length = 0;
|
|
3472
3472
|
let f = h();
|
|
3473
|
-
f.loaded = await
|
|
3473
|
+
f.loaded = await c.applyLoaders(f), ie.push(...(await c.applyBeforeEach(f)).filter(Boolean)), x = f;
|
|
3474
3474
|
}, "load"),
|
|
3475
3475
|
globals: p,
|
|
3476
|
-
args:
|
|
3477
|
-
parameters:
|
|
3478
|
-
argTypes:
|
|
3476
|
+
args: c.initialArgs,
|
|
3477
|
+
parameters: c.parameters,
|
|
3478
|
+
argTypes: c.argTypes,
|
|
3479
3479
|
play: b,
|
|
3480
|
-
run:
|
|
3481
|
-
reporting:
|
|
3482
|
-
tags:
|
|
3480
|
+
run: m,
|
|
3481
|
+
reporting: y,
|
|
3482
|
+
tags: c.tags
|
|
3483
3483
|
}
|
|
3484
3484
|
);
|
|
3485
3485
|
}
|
|
@@ -3488,11 +3488,11 @@ var ii = /* @__PURE__ */ s((r, e, t, o) => it(r, e, t, {}, o), "defaultComposeSt
|
|
|
3488
3488
|
function rn(r, e, t = ii) {
|
|
3489
3489
|
let { default: o, __esModule: n, __namedExportsOrder: i, ...a } = r, l = o;
|
|
3490
3490
|
return Object.entries(a).reduce(
|
|
3491
|
-
(
|
|
3492
|
-
let { story:
|
|
3493
|
-
return !l && h && (l = h), (0, Ko.isExportStory)(u, l) ? Object.assign(
|
|
3494
|
-
[u]: t(
|
|
3495
|
-
}) :
|
|
3491
|
+
(c, [u, p]) => {
|
|
3492
|
+
let { story: y, meta: h } = wr(p);
|
|
3493
|
+
return !l && h && (l = h), (0, Ko.isExportStory)(u, l) ? Object.assign(c, {
|
|
3494
|
+
[u]: t(y, l, e, u)
|
|
3495
|
+
}) : c;
|
|
3496
3496
|
},
|
|
3497
3497
|
{}
|
|
3498
3498
|
);
|
|
@@ -3515,15 +3515,16 @@ function tn(r) {
|
|
|
3515
3515
|
|
|
3516
3516
|
More info: https://storybook.js.org/docs/api/portable-stories-playwright
|
|
3517
3517
|
`);
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3518
|
+
let { props: a, ...l } = n;
|
|
3519
|
+
await t.evaluate(async (c) => {
|
|
3520
|
+
let u = await globalThis.__pwUnwrapObject?.(c);
|
|
3521
|
+
return ("__pw_type" in u ? u.type : u)?.load?.();
|
|
3522
|
+
}, l);
|
|
3523
|
+
let d = await e(n, ...i);
|
|
3524
|
+
return await t.evaluate(async (c) => {
|
|
3525
|
+
let u = await globalThis.__pwUnwrapObject?.(c), p = "__pw_type" in u ? u.type : u, y = document.querySelector("#root");
|
|
3526
|
+
return p?.play?.({ canvasElement: y });
|
|
3527
|
+
}, l), d;
|
|
3527
3528
|
});
|
|
3528
3529
|
}, "mount")
|
|
3529
3530
|
});
|
|
@@ -3689,17 +3690,17 @@ var on = 1e3, li = 1e4, ge = class {
|
|
|
3689
3690
|
(o, [n, { type: i, importPath: a }]) => {
|
|
3690
3691
|
if (i === "docs")
|
|
3691
3692
|
return o;
|
|
3692
|
-
let l = t[a],
|
|
3693
|
-
return !e.includeDocsOnly &&
|
|
3694
|
-
(
|
|
3695
|
-
Object.assign(
|
|
3693
|
+
let l = t[a], d = this.storyFromCSFFile({ storyId: n, csfFile: l });
|
|
3694
|
+
return !e.includeDocsOnly && d.parameters.docsOnly || (o[n] = Object.entries(d).reduce(
|
|
3695
|
+
(c, [u, p]) => u === "moduleExport" || typeof p == "function" ? c : Array.isArray(p) ? Object.assign(c, { [u]: p.slice().sort() }) :
|
|
3696
|
+
Object.assign(c, { [u]: p }),
|
|
3696
3697
|
{
|
|
3697
3698
|
//
|
|
3698
|
-
args:
|
|
3699
|
+
args: d.initialArgs,
|
|
3699
3700
|
globals: {
|
|
3700
3701
|
...this.userGlobals.initialGlobals,
|
|
3701
3702
|
...this.userGlobals.globals,
|
|
3702
|
-
...
|
|
3703
|
+
...d.storyGlobals
|
|
3703
3704
|
}
|
|
3704
3705
|
}
|
|
3705
3706
|
)), o;
|
|
@@ -3744,8 +3745,8 @@ var lt = /* @__PURE__ */ s((r, e, t) => {
|
|
|
3744
3745
|
let a = at(String(r));
|
|
3745
3746
|
if (n.exec(a)) {
|
|
3746
3747
|
if (!t) {
|
|
3747
|
-
let l = a.replace(o, ""),
|
|
3748
|
-
return
|
|
3748
|
+
let l = a.replace(o, ""), d = sn([i, l]).split("/");
|
|
3749
|
+
return d = ci(d), d.join("/");
|
|
3749
3750
|
}
|
|
3750
3751
|
return i ? sn([i, t]) : t;
|
|
3751
3752
|
}
|
|
@@ -3773,16 +3774,16 @@ var dn = /\s*\/\s*/, pn = /* @__PURE__ */ s((r = {}) => (e, t) => {
|
|
|
3773
3774
|
return -1;
|
|
3774
3775
|
if (!a[l])
|
|
3775
3776
|
return 1;
|
|
3776
|
-
let
|
|
3777
|
-
if (
|
|
3778
|
-
let p = n.indexOf(
|
|
3779
|
-
return p !== -1 ||
|
|
3780
|
-
"configure" ? 0 :
|
|
3777
|
+
let d = i[l], c = a[l];
|
|
3778
|
+
if (d !== c) {
|
|
3779
|
+
let p = n.indexOf(d), y = n.indexOf(c), h = n.indexOf("*");
|
|
3780
|
+
return p !== -1 || y !== -1 ? (p === -1 && (h !== -1 ? p = h : p = n.length), y === -1 && (h !== -1 ? y = h : y = n.length), p - y) : o ===
|
|
3781
|
+
"configure" ? 0 : d.localeCompare(c, r.locales ? r.locales : void 0, {
|
|
3781
3782
|
numeric: !0,
|
|
3782
3783
|
sensitivity: "accent"
|
|
3783
3784
|
});
|
|
3784
3785
|
}
|
|
3785
|
-
let u = n.indexOf(
|
|
3786
|
+
let u = n.indexOf(d);
|
|
3786
3787
|
u === -1 && (u = n.indexOf("*")), n = u !== -1 && Array.isArray(n[u + 1]) ? n[u + 1] : [], l += 1;
|
|
3787
3788
|
}
|
|
3788
3789
|
return 0;
|
|
@@ -3836,7 +3837,7 @@ function mn(r) {
|
|
|
3836
3837
|
}
|
|
3837
3838
|
s(mn, "serializeError");
|
|
3838
3839
|
var be = class {
|
|
3839
|
-
constructor(e, t, o, n, i, a, l = { autoplay: !0, forceInitialArgs: !1 },
|
|
3840
|
+
constructor(e, t, o, n, i, a, l = { autoplay: !0, forceInitialArgs: !1 }, d) {
|
|
3840
3841
|
this.channel = e;
|
|
3841
3842
|
this.store = t;
|
|
3842
3843
|
this.renderToScreen = o;
|
|
@@ -3851,7 +3852,7 @@ var be = class {
|
|
|
3851
3852
|
this.teardownRender = /* @__PURE__ */ s(() => {
|
|
3852
3853
|
}, "teardownRender");
|
|
3853
3854
|
this.torndown = !1;
|
|
3854
|
-
this.abortController = new yn(),
|
|
3855
|
+
this.abortController = new yn(), d && (this.story = d, this.phase = "preparing");
|
|
3855
3856
|
}
|
|
3856
3857
|
static {
|
|
3857
3858
|
s(this, "StoryRender");
|
|
@@ -3905,22 +3906,22 @@ var be = class {
|
|
|
3905
3906
|
id: i,
|
|
3906
3907
|
componentId: a,
|
|
3907
3908
|
title: l,
|
|
3908
|
-
name:
|
|
3909
|
-
tags:
|
|
3909
|
+
name: d,
|
|
3910
|
+
tags: c,
|
|
3910
3911
|
applyLoaders: u,
|
|
3911
3912
|
applyBeforeEach: p,
|
|
3912
|
-
applyAfterEach:
|
|
3913
|
+
applyAfterEach: y,
|
|
3913
3914
|
unboundStoryFn: h,
|
|
3914
3915
|
playFunction: x,
|
|
3915
3916
|
runStep: R
|
|
3916
3917
|
} = n;
|
|
3917
3918
|
t && !e && (this.cancelRender(), this.abortController = new yn());
|
|
3918
|
-
let
|
|
3919
|
+
let m = this.abortController.signal, b = !1, w = n.usesMount;
|
|
3919
3920
|
try {
|
|
3920
3921
|
let f = {
|
|
3921
3922
|
...this.storyContext(),
|
|
3922
3923
|
viewMode: this.viewMode,
|
|
3923
|
-
abortSignal:
|
|
3924
|
+
abortSignal: m,
|
|
3924
3925
|
canvasElement: o,
|
|
3925
3926
|
loaded: {},
|
|
3926
3927
|
step: /* @__PURE__ */ s((P, W) => R(P, W, f), "step"),
|
|
@@ -3940,9 +3941,9 @@ var be = class {
|
|
|
3940
3941
|
mount: /* @__PURE__ */ s(async (...P) => {
|
|
3941
3942
|
this.callbacks.showStoryDuringRender?.();
|
|
3942
3943
|
let W = null;
|
|
3943
|
-
return await this.runPhase(
|
|
3944
|
+
return await this.runPhase(m, "rendering", async () => {
|
|
3944
3945
|
W = await n.mount(f)(...P);
|
|
3945
|
-
}), w && await this.runPhase(
|
|
3946
|
+
}), w && await this.runPhase(m, "playing"), W;
|
|
3946
3947
|
}, "mount")
|
|
3947
3948
|
};
|
|
3948
3949
|
f.context = f;
|
|
@@ -3951,9 +3952,9 @@ var be = class {
|
|
|
3951
3952
|
title: l,
|
|
3952
3953
|
kind: l,
|
|
3953
3954
|
id: i,
|
|
3954
|
-
name:
|
|
3955
|
-
story:
|
|
3956
|
-
tags:
|
|
3955
|
+
name: d,
|
|
3956
|
+
story: d,
|
|
3957
|
+
tags: c,
|
|
3957
3958
|
...this.callbacks,
|
|
3958
3959
|
showError: /* @__PURE__ */ s((P) => (this.phase = "errored", this.callbacks.showError(P)), "showError"),
|
|
3959
3960
|
showException: /* @__PURE__ */ s((P) => (this.phase = "errored", this.callbacks.showException(P)), "showException"),
|
|
@@ -3962,12 +3963,12 @@ var be = class {
|
|
|
3962
3963
|
storyFn: /* @__PURE__ */ s(() => h(f), "storyFn"),
|
|
3963
3964
|
unboundStoryFn: h
|
|
3964
3965
|
};
|
|
3965
|
-
if (await this.runPhase(
|
|
3966
|
+
if (await this.runPhase(m, "loading", async () => {
|
|
3966
3967
|
f.loaded = await u(f);
|
|
3967
|
-
}),
|
|
3968
|
+
}), m.aborted)
|
|
3968
3969
|
return;
|
|
3969
3970
|
let A = await p(f);
|
|
3970
|
-
if (this.store.addCleanupCallbacks(n, ...A), this.checkIfAborted(
|
|
3971
|
+
if (this.store.addCleanupCallbacks(n, ...A), this.checkIfAborted(m) || (!b && !w && await f.mount(), this.notYetRendered = !1, m.aborted))
|
|
3971
3972
|
return;
|
|
3972
3973
|
let S = this.story.parameters?.test?.dangerouslyIgnoreUnhandledErrors === !0, C = /* @__PURE__ */ new Set(), M = /* @__PURE__ */ s((P) => {
|
|
3973
3974
|
P.error && C.add(P.error);
|
|
@@ -3975,15 +3976,15 @@ var be = class {
|
|
|
3975
3976
|
P.reason && C.add(P.reason);
|
|
3976
3977
|
}, "onUnhandledRejection");
|
|
3977
3978
|
if (this.renderOptions.autoplay && t && x && this.phase !== "errored") {
|
|
3978
|
-
window
|
|
3979
|
+
window?.addEventListener?.("error", M), window?.addEventListener?.("unhandledrejection", j), this.disableKeyListeners = !0;
|
|
3979
3980
|
try {
|
|
3980
3981
|
if (w ? await x(f) : (f.mount = async () => {
|
|
3981
3982
|
throw new Cr.MountMustBeDestructuredError({ playFunction: x.toString() });
|
|
3982
|
-
}, await this.runPhase(
|
|
3983
|
+
}, await this.runPhase(m, "playing", async () => x(f))), !b)
|
|
3983
3984
|
throw new Cr.NoStoryMountedError();
|
|
3984
|
-
this.checkIfAborted(
|
|
3985
|
+
this.checkIfAborted(m), !S && C.size > 0 ? await this.runPhase(m, "errored") : await this.runPhase(m, "played");
|
|
3985
3986
|
} catch (P) {
|
|
3986
|
-
if (this.callbacks.showStoryDuringRender?.(), await this.runPhase(
|
|
3987
|
+
if (this.callbacks.showStoryDuringRender?.(), await this.runPhase(m, "errored", async () => {
|
|
3987
3988
|
this.channel.emit(z.PLAY_FUNCTION_THREW_EXCEPTION, mn(P));
|
|
3988
3989
|
}), this.story.parameters.throwPlayFunctionExceptions !== !1)
|
|
3989
3990
|
throw P;
|
|
@@ -3992,21 +3993,22 @@ var be = class {
|
|
|
3992
3993
|
if (!S && C.size > 0 && this.channel.emit(
|
|
3993
3994
|
z.UNHANDLED_ERRORS_WHILE_PLAYING,
|
|
3994
3995
|
Array.from(C).map(mn)
|
|
3995
|
-
), this.disableKeyListeners = !1, window
|
|
3996
|
+
), this.disableKeyListeners = !1, window?.removeEventListener?.("unhandledrejection", j), window?.removeEventListener?.("error", M),
|
|
3997
|
+
m.aborted)
|
|
3996
3998
|
return;
|
|
3997
3999
|
}
|
|
3998
|
-
await this.runPhase(
|
|
3999
|
-
Rr() ? this.store.addCleanupCallbacks(n, me()) : await he(
|
|
4000
|
-
}), await this.runPhase(
|
|
4000
|
+
await this.runPhase(m, "completing", async () => {
|
|
4001
|
+
Rr() ? this.store.addCleanupCallbacks(n, me()) : await he(m);
|
|
4002
|
+
}), await this.runPhase(m, "completed", async () => {
|
|
4001
4003
|
this.channel.emit(z.STORY_RENDERED, i);
|
|
4002
|
-
}), this.phase !== "errored" && await this.runPhase(
|
|
4003
|
-
await
|
|
4004
|
+
}), this.phase !== "errored" && await this.runPhase(m, "afterEach", async () => {
|
|
4005
|
+
await y(f);
|
|
4004
4006
|
});
|
|
4005
4007
|
let G = !S && C.size > 0, ve = f.reporting.reports.some(
|
|
4006
4008
|
(P) => P.status === "failed"
|
|
4007
4009
|
), U = G || ve;
|
|
4008
4010
|
await this.runPhase(
|
|
4009
|
-
|
|
4011
|
+
m,
|
|
4010
4012
|
"finished",
|
|
4011
4013
|
async () => this.channel.emit(z.STORY_FINISHED, {
|
|
4012
4014
|
storyId: i,
|
|
@@ -4016,7 +4018,7 @@ var be = class {
|
|
|
4016
4018
|
);
|
|
4017
4019
|
} catch (f) {
|
|
4018
4020
|
this.phase = "errored", this.callbacks.showException(f), await this.runPhase(
|
|
4019
|
-
|
|
4021
|
+
m,
|
|
4020
4022
|
"finished",
|
|
4021
4023
|
async () => this.channel.emit(z.STORY_FINISHED, {
|
|
4022
4024
|
storyId: i,
|
|
@@ -4059,7 +4061,7 @@ var be = class {
|
|
|
4059
4061
|
}
|
|
4060
4062
|
await new Promise((t) => setTimeout(t, 0));
|
|
4061
4063
|
}
|
|
4062
|
-
window
|
|
4064
|
+
window?.location?.reload?.(), await new Promise(() => {
|
|
4063
4065
|
});
|
|
4064
4066
|
}
|
|
4065
4067
|
};
|
|
@@ -4271,7 +4273,7 @@ var { fetch: pi } = hn.global, ui = "./index.json", Se = class {
|
|
|
4271
4273
|
...Object.keys(n.initialArgs),
|
|
4272
4274
|
...Object.keys(this.storyStoreValue.args.get(e))
|
|
4273
4275
|
])
|
|
4274
|
-
]).reduce((l,
|
|
4276
|
+
]).reduce((l, d) => (l[d] = n.initialArgs[d], l), {});
|
|
4275
4277
|
await this.onUpdateArgs({ storyId: e, updatedArgs: a });
|
|
4276
4278
|
}
|
|
4277
4279
|
// ForceReRender does not include a story id, so we simply must
|
|
@@ -4555,12 +4557,12 @@ var Ye = class {
|
|
|
4555
4557
|
let i = await n.renderer(), { render: a } = i, l = /* @__PURE__ */ s(async () => {
|
|
4556
4558
|
try {
|
|
4557
4559
|
await a(o, n, e), this.channel.emit(Sn.DOCS_RENDERED, this.id);
|
|
4558
|
-
} catch (
|
|
4559
|
-
this.callbacks.showException(
|
|
4560
|
+
} catch (d) {
|
|
4561
|
+
this.callbacks.showException(d);
|
|
4560
4562
|
}
|
|
4561
4563
|
}, "renderDocs");
|
|
4562
|
-
return this.rerender = async () => l(), this.teardownRender = async ({ viewModeChanged:
|
|
4563
|
-
!
|
|
4564
|
+
return this.rerender = async () => l(), this.teardownRender = async ({ viewModeChanged: d }) => {
|
|
4565
|
+
!d || !e || i.unmount(e);
|
|
4564
4566
|
}, l();
|
|
4565
4567
|
}
|
|
4566
4568
|
async teardown({ viewModeChanged: e } = {}) {
|
|
@@ -4617,16 +4619,16 @@ var Ke = class {
|
|
|
4617
4619
|
throw new Error(
|
|
4618
4620
|
"Cannot render a story in viewMode=docs if `@storybook/addon-docs` is not installed"
|
|
4619
4621
|
);
|
|
4620
|
-
let i = { ...n, page: this.exports.default }, a = await n.renderer(), { render: l } = a,
|
|
4622
|
+
let i = { ...n, page: this.exports.default }, a = await n.renderer(), { render: l } = a, d = /* @__PURE__ */ s(async () => {
|
|
4621
4623
|
try {
|
|
4622
4624
|
await l(o, i, e), this.channel.emit(Tn.DOCS_RENDERED, this.id);
|
|
4623
|
-
} catch (
|
|
4624
|
-
this.callbacks.showException(
|
|
4625
|
+
} catch (c) {
|
|
4626
|
+
this.callbacks.showException(c);
|
|
4625
4627
|
}
|
|
4626
4628
|
}, "renderDocs");
|
|
4627
|
-
return this.rerender = async () =>
|
|
4628
|
-
!
|
|
4629
|
-
},
|
|
4629
|
+
return this.rerender = async () => d(), this.teardownRender = async ({ viewModeChanged: c } = {}) => {
|
|
4630
|
+
!c || !e || (a.unmount(e), this.torndown = !0);
|
|
4631
|
+
}, d();
|
|
4630
4632
|
}
|
|
4631
4633
|
async teardown({ viewModeChanged: e } = {}) {
|
|
4632
4634
|
this.teardownRender?.({ viewModeChanged: e }), this.torndown = !0;
|
|
@@ -4727,9 +4729,9 @@ var Te = class extends Se {
|
|
|
4727
4729
|
}
|
|
4728
4730
|
onKeydown(t) {
|
|
4729
4731
|
if (!this.storyRenders.find((o) => o.disableKeyListeners) && !mi(t)) {
|
|
4730
|
-
let { altKey: o, ctrlKey: n, metaKey: i, shiftKey: a, key: l, code:
|
|
4732
|
+
let { altKey: o, ctrlKey: n, metaKey: i, shiftKey: a, key: l, code: d, keyCode: c } = t;
|
|
4731
4733
|
this.channel.emit(E.PREVIEW_KEYDOWN, {
|
|
4732
|
-
event: { altKey: o, ctrlKey: n, metaKey: i, shiftKey: a, key: l, code:
|
|
4734
|
+
event: { altKey: o, ctrlKey: n, metaKey: i, shiftKey: a, key: l, code: d, keyCode: c }
|
|
4733
4735
|
});
|
|
4734
4736
|
}
|
|
4735
4737
|
}
|
|
@@ -4771,23 +4773,23 @@ var Te = class extends Se {
|
|
|
4771
4773
|
this.currentRender && await this.teardownRender(this.currentRender), this.renderStoryLoadingException(i, h);
|
|
4772
4774
|
return;
|
|
4773
4775
|
}
|
|
4774
|
-
let l = this.currentSelection?.storyId !== i,
|
|
4775
|
-
a.type === "story" ? this.view.showPreparingStory({ immediate:
|
|
4776
|
+
let l = this.currentSelection?.storyId !== i, d = this.currentRender?.type !== a.type;
|
|
4777
|
+
a.type === "story" ? this.view.showPreparingStory({ immediate: d }) : this.view.showPreparingDocs({ immediate: d }), this.currentRender?.
|
|
4776
4778
|
isPreparing() && await this.teardownRender(this.currentRender);
|
|
4777
|
-
let
|
|
4778
|
-
a.type === "story" ?
|
|
4779
|
+
let c;
|
|
4780
|
+
a.type === "story" ? c = new be(
|
|
4779
4781
|
this.channel,
|
|
4780
4782
|
this.storyStoreValue,
|
|
4781
4783
|
o,
|
|
4782
4784
|
this.mainStoryCallbacks(i),
|
|
4783
4785
|
i,
|
|
4784
4786
|
"story"
|
|
4785
|
-
) : gi(a) ?
|
|
4787
|
+
) : gi(a) ? c = new Ke(
|
|
4786
4788
|
this.channel,
|
|
4787
4789
|
this.storyStoreValue,
|
|
4788
4790
|
a,
|
|
4789
4791
|
this.mainStoryCallbacks(i)
|
|
4790
|
-
) :
|
|
4792
|
+
) : c = new Ye(
|
|
4791
4793
|
this.channel,
|
|
4792
4794
|
this.storyStoreValue,
|
|
4793
4795
|
a,
|
|
@@ -4796,36 +4798,36 @@ var Te = class extends Se {
|
|
|
4796
4798
|
let u = this.currentSelection;
|
|
4797
4799
|
this.currentSelection = n;
|
|
4798
4800
|
let p = this.currentRender;
|
|
4799
|
-
this.currentRender =
|
|
4801
|
+
this.currentRender = c;
|
|
4800
4802
|
try {
|
|
4801
|
-
await
|
|
4803
|
+
await c.prepare();
|
|
4802
4804
|
} catch (h) {
|
|
4803
4805
|
p && await this.teardownRender(p), h !== ae && this.renderStoryLoadingException(i, h);
|
|
4804
4806
|
return;
|
|
4805
4807
|
}
|
|
4806
|
-
let
|
|
4807
|
-
if (t && dt(
|
|
4808
|
+
let y = !l && p && !c.isEqual(p);
|
|
4809
|
+
if (t && dt(c) && (vr(!!c.story), this.storyStoreValue.args.updateFromPersisted(c.story, t)), p && !p.torndown && !l && !y && !d) {
|
|
4808
4810
|
this.currentRender = p, this.channel.emit(E.STORY_UNCHANGED, i), this.view.showMain();
|
|
4809
4811
|
return;
|
|
4810
4812
|
}
|
|
4811
|
-
if (p && await this.teardownRender(p, { viewModeChanged:
|
|
4812
|
-
vr(!!
|
|
4813
|
+
if (p && await this.teardownRender(p, { viewModeChanged: d }), u && (l || d) && this.channel.emit(E.STORY_CHANGED, i), dt(c)) {
|
|
4814
|
+
vr(!!c.story);
|
|
4813
4815
|
let {
|
|
4814
4816
|
parameters: h,
|
|
4815
4817
|
initialArgs: x,
|
|
4816
4818
|
argTypes: R,
|
|
4817
|
-
unmappedArgs:
|
|
4819
|
+
unmappedArgs: m,
|
|
4818
4820
|
initialGlobals: b,
|
|
4819
4821
|
userGlobals: w,
|
|
4820
4822
|
storyGlobals: f,
|
|
4821
4823
|
globals: g
|
|
4822
|
-
} = this.storyStoreValue.getStoryContext(
|
|
4824
|
+
} = this.storyStoreValue.getStoryContext(c.story);
|
|
4823
4825
|
this.channel.emit(E.STORY_PREPARED, {
|
|
4824
4826
|
id: i,
|
|
4825
4827
|
parameters: h,
|
|
4826
4828
|
initialArgs: x,
|
|
4827
4829
|
argTypes: R,
|
|
4828
|
-
args:
|
|
4830
|
+
args: m
|
|
4829
4831
|
}), this.channel.emit(E.GLOBALS_UPDATED, { userGlobals: w, storyGlobals: f, globals: g, initialGlobals: b });
|
|
4830
4832
|
} else {
|
|
4831
4833
|
let { parameters: h } = this.storyStoreValue.projectAnnotations, { initialGlobals: x, globals: R } = this.storyStoreValue.userGlobals;
|
|
@@ -4834,11 +4836,11 @@ var Te = class extends Se {
|
|
|
4834
4836
|
initialGlobals: x,
|
|
4835
4837
|
storyGlobals: {},
|
|
4836
4838
|
userGlobals: R
|
|
4837
|
-
}), Si(
|
|
4838
|
-
if (!
|
|
4839
|
+
}), Si(c) || c.entry.tags?.includes(xn)) {
|
|
4840
|
+
if (!c.csfFiles)
|
|
4839
4841
|
throw new Y.MdxFileWithNoCsfReferencesError({ storyId: i });
|
|
4840
4842
|
({ parameters: h } = this.storyStoreValue.preparedMetaFromCSFFile({
|
|
4841
|
-
csfFile:
|
|
4843
|
+
csfFile: c.csfFiles[0]
|
|
4842
4844
|
}));
|
|
4843
4845
|
}
|
|
4844
4846
|
this.channel.emit(E.DOCS_PREPARED, {
|
|
@@ -4846,8 +4848,8 @@ var Te = class extends Se {
|
|
|
4846
4848
|
parameters: h
|
|
4847
4849
|
});
|
|
4848
4850
|
}
|
|
4849
|
-
dt(
|
|
4850
|
-
this.view.prepareForStory(
|
|
4851
|
+
dt(c) ? (vr(!!c.story), this.storyRenders.push(c), this.currentRender.renderToElement(
|
|
4852
|
+
this.view.prepareForStory(c.story)
|
|
4851
4853
|
)) : this.currentRender.renderToElement(
|
|
4852
4854
|
this.view.prepareForDocs(),
|
|
4853
4855
|
// This argument is used for docs, which is currently only compatible with HTMLElements
|