storybook 9.0.0-alpha.13 → 9.0.0-alpha.15
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/dist/actions/decorator.js +46 -47
- package/dist/actions/index.cjs +28 -29
- package/dist/actions/index.d.ts +0 -3
- package/dist/actions/index.js +27 -28
- package/dist/actions/preview.cjs +22 -23
- package/dist/actions/preview.js +18 -19
- package/dist/bin/index.cjs +67 -71
- package/dist/bin/index.js +56 -60
- package/dist/channels/index.cjs +1018 -948
- package/dist/channels/index.js +1194 -1161
- package/dist/cli/bin/index.cjs +1 -1
- package/dist/cli/bin/index.js +1 -1
- package/dist/cli/index.cjs +1860 -1871
- package/dist/cli/index.js +308 -319
- package/dist/common/index.cjs +43 -49
- package/dist/common/index.d.ts +0 -4
- package/dist/common/index.js +43 -49
- package/dist/components/index.cjs +6375 -12708
- package/dist/components/index.d.ts +1 -2
- package/dist/components/index.js +4647 -10782
- package/dist/core-server/index.cjs +13626 -13550
- package/dist/core-server/index.js +11863 -11787
- package/dist/core-server/presets/common-manager.js +3221 -3138
- package/dist/manager/globals-runtime.js +29817 -33554
- package/dist/manager-api/index.cjs +2518 -2330
- package/dist/manager-api/index.js +2432 -2234
- package/dist/preview/runtime.js +18415 -16011
- package/dist/preview-api/index.cjs +619 -603
- package/dist/preview-api/index.d.ts +386 -118
- package/dist/preview-api/index.js +542 -526
- package/dist/server-errors.cjs +132 -118
- package/dist/server-errors.d.ts +4 -2
- package/dist/server-errors.js +127 -113
- package/dist/test/preview.d.ts +6 -0
- package/dist/types/index.d.ts +1 -4
- package/package.json +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Hn = Object.create;
|
|
2
2
|
var yr = Object.defineProperty;
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var Wn = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var $n = Object.getOwnPropertyNames;
|
|
5
|
+
var Yn = Object.getPrototypeOf, Kn = Object.prototype.hasOwnProperty;
|
|
6
6
|
var n = (r, e) => yr(r, "name", { value: e, configurable: !0 }), Ae = /* @__PURE__ */ ((r) => typeof require < "u" ? require : typeof Proxy <
|
|
7
7
|
"u" ? new Proxy(r, {
|
|
8
8
|
get: (e, t) => (typeof require < "u" ? require : e)[t]
|
|
@@ -11,13 +11,13 @@ var n = (r, e) => yr(r, "name", { value: e, configurable: !0 }), Ae = /* @__PURE
|
|
|
11
11
|
throw Error('Dynamic require of "' + r + '" is not supported');
|
|
12
12
|
});
|
|
13
13
|
var O = (r, e) => () => (e || r((e = { exports: {} }).exports, e), e.exports);
|
|
14
|
-
var
|
|
14
|
+
var Xn = (r, e, t, o) => {
|
|
15
15
|
if (e && typeof e == "object" || typeof e == "function")
|
|
16
|
-
for (let s of
|
|
17
|
-
!
|
|
16
|
+
for (let s of $n(e))
|
|
17
|
+
!Kn.call(r, s) && s !== t && yr(r, s, { get: () => e[s], enumerable: !(o = Wn(e, s)) || o.enumerable });
|
|
18
18
|
return r;
|
|
19
19
|
};
|
|
20
|
-
var fe = (r, e, t) => (t = r != null ?
|
|
20
|
+
var fe = (r, e, t) => (t = r != null ? Hn(Yn(r)) : {}, Xn(
|
|
21
21
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
22
|
// file that has been converted to a CommonJS file using a Babel-
|
|
23
23
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
@@ -163,8 +163,8 @@ var Or = O((Qt, Ir) => {
|
|
|
163
163
|
var ot = O((tt) => {
|
|
164
164
|
"use strict";
|
|
165
165
|
Object.defineProperty(tt, "__esModule", { value: !0 });
|
|
166
|
-
tt.encodeString =
|
|
167
|
-
var B = Array.from({ length: 256 }, (r, e) => "%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase()),
|
|
166
|
+
tt.encodeString = ta;
|
|
167
|
+
var B = Array.from({ length: 256 }, (r, e) => "%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase()), ra = new Int8Array([
|
|
168
168
|
0,
|
|
169
169
|
0,
|
|
170
170
|
0,
|
|
@@ -294,7 +294,7 @@ var ot = O((tt) => {
|
|
|
294
294
|
1,
|
|
295
295
|
0
|
|
296
296
|
]);
|
|
297
|
-
function
|
|
297
|
+
function ta(r) {
|
|
298
298
|
let e = r.length;
|
|
299
299
|
if (e === 0)
|
|
300
300
|
return "";
|
|
@@ -302,7 +302,7 @@ var ot = O((tt) => {
|
|
|
302
302
|
e: for (; s < e; s++) {
|
|
303
303
|
let i = r.charCodeAt(s);
|
|
304
304
|
for (; i < 128; ) {
|
|
305
|
-
if (
|
|
305
|
+
if (ra[i] !== 1 && (o < s && (t += r.slice(o, s)), o = s + 1, t += B[i]), ++s === e)
|
|
306
306
|
break e;
|
|
307
307
|
i = r.charCodeAt(s);
|
|
308
308
|
}
|
|
@@ -321,7 +321,7 @@ var ot = O((tt) => {
|
|
|
321
321
|
}
|
|
322
322
|
return o === 0 ? r : o < e ? t + r.slice(o) : t;
|
|
323
323
|
}
|
|
324
|
-
n(
|
|
324
|
+
n(ta, "encodeString");
|
|
325
325
|
});
|
|
326
326
|
|
|
327
327
|
// ../node_modules/picoquery/lib/shared.js
|
|
@@ -329,7 +329,7 @@ var er = O((G) => {
|
|
|
329
329
|
"use strict";
|
|
330
330
|
Object.defineProperty(G, "__esModule", { value: !0 });
|
|
331
331
|
G.defaultOptions = G.defaultShouldSerializeObject = G.defaultValueSerializer = void 0;
|
|
332
|
-
var nt = ot(),
|
|
332
|
+
var nt = ot(), oa = /* @__PURE__ */ n((r) => {
|
|
333
333
|
switch (typeof r) {
|
|
334
334
|
case "string":
|
|
335
335
|
return (0, nt.encodeString)(r);
|
|
@@ -343,9 +343,9 @@ var er = O((G) => {
|
|
|
343
343
|
}
|
|
344
344
|
return r instanceof Date ? (0, nt.encodeString)(r.toISOString()) : "";
|
|
345
345
|
}, "defaultValueSerializer");
|
|
346
|
-
G.defaultValueSerializer =
|
|
347
|
-
var
|
|
348
|
-
G.defaultShouldSerializeObject =
|
|
346
|
+
G.defaultValueSerializer = oa;
|
|
347
|
+
var na = /* @__PURE__ */ n((r) => r instanceof Date, "defaultShouldSerializeObject");
|
|
348
|
+
G.defaultShouldSerializeObject = na;
|
|
349
349
|
var Bo = /* @__PURE__ */ n((r) => r, "identityFunc");
|
|
350
350
|
G.defaultOptions = {
|
|
351
351
|
nesting: !0,
|
|
@@ -364,34 +364,34 @@ var er = O((G) => {
|
|
|
364
364
|
var st = O((rr) => {
|
|
365
365
|
"use strict";
|
|
366
366
|
Object.defineProperty(rr, "__esModule", { value: !0 });
|
|
367
|
-
rr.getDeepObject =
|
|
367
|
+
rr.getDeepObject = aa;
|
|
368
368
|
rr.stringifyObject = Go;
|
|
369
|
-
var le = er(),
|
|
370
|
-
function
|
|
369
|
+
var le = er(), sa = ot();
|
|
370
|
+
function ia(r) {
|
|
371
371
|
return r === "__proto__" || r === "constructor" || r === "prototype";
|
|
372
372
|
}
|
|
373
|
-
n(
|
|
374
|
-
function
|
|
375
|
-
if (
|
|
373
|
+
n(ia, "isPrototypeKey");
|
|
374
|
+
function aa(r, e, t, o, s) {
|
|
375
|
+
if (ia(e))
|
|
376
376
|
return r;
|
|
377
377
|
let i = r[e];
|
|
378
378
|
return typeof i == "object" && i !== null ? i : !o && (s || typeof t == "number" || typeof t == "string" && t * 0 === 0 && t.indexOf(".") ===
|
|
379
379
|
-1) ? r[e] = [] : r[e] = {};
|
|
380
380
|
}
|
|
381
|
-
n(
|
|
382
|
-
var
|
|
381
|
+
n(aa, "getDeepObject");
|
|
382
|
+
var la = 20, ca = "[]", da = "[", pa = "]", ua = ".";
|
|
383
383
|
function Go(r, e, t = 0, o, s) {
|
|
384
384
|
let { nestingSyntax: i = le.defaultOptions.nestingSyntax, arrayRepeat: a = le.defaultOptions.arrayRepeat, arrayRepeatSyntax: l = le.defaultOptions.
|
|
385
385
|
arrayRepeatSyntax, nesting: c = le.defaultOptions.nesting, delimiter: d = le.defaultOptions.delimiter, valueSerializer: p = le.defaultOptions.
|
|
386
386
|
valueSerializer, shouldSerializeObject: u = le.defaultOptions.shouldSerializeObject } = e, y = typeof d == "number" ? String.fromCharCode(
|
|
387
387
|
d) : d, g = s === !0 && a, S = i === "dot" || i === "js" && !s;
|
|
388
|
-
if (t >
|
|
388
|
+
if (t > la)
|
|
389
389
|
return "";
|
|
390
390
|
let b = "", h = !0, T = !1;
|
|
391
391
|
for (let m in r) {
|
|
392
392
|
let f = r[m], x;
|
|
393
|
-
o ? (x = o, g ? l === "bracket" && (x +=
|
|
394
|
-
"object" && f !== null && !u(f) ? (T = f.pop !== void 0, (c || a && T) && (b += Go(f, e, t + 1, x, T))) : (b += (0,
|
|
393
|
+
o ? (x = o, g ? l === "bracket" && (x += ca) : S ? (x += ua, x += m) : (x += da, x += m, x += pa)) : x = m, h || (b += y), typeof f ==
|
|
394
|
+
"object" && f !== null && !u(f) ? (T = f.pop !== void 0, (c || a && T) && (b += Go(f, e, t + 1, x, T))) : (b += (0, sa.encodeString)(x),
|
|
395
395
|
b += "=", b += p(f, m)), h && (h = !1);
|
|
396
396
|
}
|
|
397
397
|
return b;
|
|
@@ -400,9 +400,9 @@ var st = O((rr) => {
|
|
|
400
400
|
});
|
|
401
401
|
|
|
402
402
|
// ../node_modules/fast-decode-uri-component/index.js
|
|
403
|
-
var Wo = O((
|
|
403
|
+
var Wo = O((Qu, Ho) => {
|
|
404
404
|
"use strict";
|
|
405
|
-
var Uo = 12,
|
|
405
|
+
var Uo = 12, fa = 0, it = [
|
|
406
406
|
// The first part of the table maps bytes to character to a transition.
|
|
407
407
|
0,
|
|
408
408
|
0,
|
|
@@ -785,7 +785,7 @@ var Wo = O((Ku, Ho) => {
|
|
|
785
785
|
7,
|
|
786
786
|
7
|
|
787
787
|
];
|
|
788
|
-
function
|
|
788
|
+
function ya(r) {
|
|
789
789
|
var e = r.indexOf("%");
|
|
790
790
|
if (e === -1) return r;
|
|
791
791
|
for (var t = r.length, o = "", s = 0, i = 0, a = e, l = Uo; e > -1 && e < t; ) {
|
|
@@ -796,7 +796,7 @@ var Wo = O((Ku, Ho) => {
|
|
|
796
796
|
56320 + (i & 1023)
|
|
797
797
|
), i = 0, s = e + 3, e = a = r.indexOf("%", s);
|
|
798
798
|
else {
|
|
799
|
-
if (l ===
|
|
799
|
+
if (l === fa)
|
|
800
800
|
return null;
|
|
801
801
|
if (e += 3, e < t && r.charCodeAt(e) === 37) continue;
|
|
802
802
|
return null;
|
|
@@ -804,8 +804,8 @@ var Wo = O((Ku, Ho) => {
|
|
|
804
804
|
}
|
|
805
805
|
return o + r.slice(s);
|
|
806
806
|
}
|
|
807
|
-
n(
|
|
808
|
-
var
|
|
807
|
+
n(ya, "decodeURIComponent");
|
|
808
|
+
var ma = {
|
|
809
809
|
0: 0,
|
|
810
810
|
1: 1,
|
|
811
811
|
2: 2,
|
|
@@ -830,32 +830,32 @@ var Wo = O((Ku, Ho) => {
|
|
|
830
830
|
F: 15
|
|
831
831
|
};
|
|
832
832
|
function Vo(r, e) {
|
|
833
|
-
var t =
|
|
833
|
+
var t = ma[r];
|
|
834
834
|
return t === void 0 ? 255 : t << e;
|
|
835
835
|
}
|
|
836
836
|
n(Vo, "hexCodeToInt");
|
|
837
|
-
Ho.exports =
|
|
837
|
+
Ho.exports = ya;
|
|
838
838
|
});
|
|
839
839
|
|
|
840
840
|
// ../node_modules/picoquery/lib/parse.js
|
|
841
841
|
var Xo = O(($) => {
|
|
842
842
|
"use strict";
|
|
843
|
-
var
|
|
843
|
+
var ha = $ && $.__importDefault || function(r) {
|
|
844
844
|
return r && r.__esModule ? r : { default: r };
|
|
845
845
|
};
|
|
846
846
|
Object.defineProperty($, "__esModule", { value: !0 });
|
|
847
847
|
$.numberValueDeserializer = $.numberKeyDeserializer = void 0;
|
|
848
|
-
$.parse =
|
|
849
|
-
var tr = st(), ce = er(), $o =
|
|
848
|
+
$.parse = Sa;
|
|
849
|
+
var tr = st(), ce = er(), $o = ha(Wo()), ga = /* @__PURE__ */ n((r) => {
|
|
850
850
|
let e = Number(r);
|
|
851
851
|
return Number.isNaN(e) ? r : e;
|
|
852
852
|
}, "numberKeyDeserializer");
|
|
853
|
-
$.numberKeyDeserializer =
|
|
854
|
-
var
|
|
853
|
+
$.numberKeyDeserializer = ga;
|
|
854
|
+
var ba = /* @__PURE__ */ n((r) => {
|
|
855
855
|
let e = Number(r);
|
|
856
856
|
return Number.isNaN(e) ? r : e;
|
|
857
857
|
}, "numberValueDeserializer");
|
|
858
|
-
$.numberValueDeserializer =
|
|
858
|
+
$.numberValueDeserializer = ba;
|
|
859
859
|
var Yo = /\+/g, Ko = /* @__PURE__ */ n(function() {
|
|
860
860
|
}, "Empty");
|
|
861
861
|
Ko.prototype = /* @__PURE__ */ Object.create(null);
|
|
@@ -864,60 +864,60 @@ var Xo = O(($) => {
|
|
|
864
864
|
return o && (i = i.replace(Yo, " ")), s && (i = (0, $o.default)(i) || i), i;
|
|
865
865
|
}
|
|
866
866
|
n(or, "computeKeySlice");
|
|
867
|
-
function
|
|
867
|
+
function Sa(r, e) {
|
|
868
868
|
let { valueDeserializer: t = ce.defaultOptions.valueDeserializer, keyDeserializer: o = ce.defaultOptions.keyDeserializer, arrayRepeatSyntax: s = ce.
|
|
869
869
|
defaultOptions.arrayRepeatSyntax, nesting: i = ce.defaultOptions.nesting, arrayRepeat: a = ce.defaultOptions.arrayRepeat, nestingSyntax: l = ce.
|
|
870
870
|
defaultOptions.nestingSyntax, delimiter: c = ce.defaultOptions.delimiter } = e ?? {}, d = typeof c == "string" ? c.charCodeAt(0) : c, p = l ===
|
|
871
871
|
"js", u = new Ko();
|
|
872
872
|
if (typeof r != "string")
|
|
873
873
|
return u;
|
|
874
|
-
let y = r.length, g = "", S = -1, b = -1, h = -1, T = u, m, f = "", x = "", E = !1, R = !1, A = !1, F = !1, j = !1,
|
|
875
|
-
|
|
874
|
+
let y = r.length, g = "", S = -1, b = -1, h = -1, T = u, m, f = "", x = "", E = !1, R = !1, A = !1, F = !1, j = !1, N = !1, ue = !1, C = 0,
|
|
875
|
+
z = -1, we = -1, xt = -1;
|
|
876
876
|
for (let I = 0; I < y + 1; I++) {
|
|
877
|
-
if (
|
|
878
|
-
if (ue = b > S, ue || (b = I), h !== b - 1 && (x = or(r, h + 1,
|
|
879
|
-
T, m, f, p && j, p &&
|
|
877
|
+
if (C = I !== y ? r.charCodeAt(I) : d, C === d) {
|
|
878
|
+
if (ue = b > S, ue || (b = I), h !== b - 1 && (x = or(r, h + 1, z > -1 ? z : b, A, E), f = o(x), m !== void 0 && (T = (0, tr.getDeepObject)(
|
|
879
|
+
T, m, f, p && j, p && N))), ue || f !== "") {
|
|
880
880
|
ue && (g = r.slice(b + 1, I), F && (g = g.replace(Yo, " ")), R && (g = (0, $o.default)(g) || g));
|
|
881
881
|
let Ee = t(g, f);
|
|
882
882
|
if (a) {
|
|
883
|
-
let
|
|
884
|
-
|
|
883
|
+
let qe = T[f];
|
|
884
|
+
qe === void 0 ? z > -1 ? T[f] = [Ee] : T[f] = Ee : qe.pop ? qe.push(Ee) : T[f] = [qe, Ee];
|
|
885
885
|
} else
|
|
886
886
|
T[f] = Ee;
|
|
887
887
|
}
|
|
888
|
-
g = "", S = I, b = I, E = !1, R = !1, A = !1, F = !1, j = !1,
|
|
889
|
-
} else
|
|
890
|
-
I, A, E), f = o(x), m !== void 0 && (T = (0, tr.getDeepObject)(T, m, f, void 0, p)), m = f, A = !1, E = !1), h = I,
|
|
891
|
-
|
|
892
|
-
T, m, f, p)), m = f, A = !1, E = !1), j = !0,
|
|
893
|
-
r, h + 1, I, A, E), f = o(x), p && m !== void 0 && (T = (0, tr.getDeepObject)(T, m, f, p)), m = f, A = !1, E = !1, j = !1,
|
|
894
|
-
I) :
|
|
895
|
-
we = I, xt =
|
|
888
|
+
g = "", S = I, b = I, E = !1, R = !1, A = !1, F = !1, j = !1, N = !1, z = -1, h = I, T = u, m = void 0, f = "";
|
|
889
|
+
} else C === 93 ? (a && s === "bracket" && xt === 91 && (z = we), i && (l === "index" || p) && b <= S && (h !== we && (x = or(r, h + 1,
|
|
890
|
+
I, A, E), f = o(x), m !== void 0 && (T = (0, tr.getDeepObject)(T, m, f, void 0, p)), m = f, A = !1, E = !1), h = I, N = !0, j = !1)) :
|
|
891
|
+
C === 46 ? i && (l === "dot" || p) && b <= S && (h !== we && (x = or(r, h + 1, I, A, E), f = o(x), m !== void 0 && (T = (0, tr.getDeepObject)(
|
|
892
|
+
T, m, f, p)), m = f, A = !1, E = !1), j = !0, N = !1, h = I) : C === 91 ? i && (l === "index" || p) && b <= S && (h !== we && (x = or(
|
|
893
|
+
r, h + 1, I, A, E), f = o(x), p && m !== void 0 && (T = (0, tr.getDeepObject)(T, m, f, p)), m = f, A = !1, E = !1, j = !1, N = !0), h =
|
|
894
|
+
I) : C === 61 ? b <= S ? b = I : R = !0 : C === 43 ? b > S ? F = !0 : A = !0 : C === 37 && (b > S ? R = !0 : E = !0);
|
|
895
|
+
we = I, xt = C;
|
|
896
896
|
}
|
|
897
897
|
return u;
|
|
898
898
|
}
|
|
899
|
-
n(
|
|
899
|
+
n(Sa, "parse");
|
|
900
900
|
});
|
|
901
901
|
|
|
902
902
|
// ../node_modules/picoquery/lib/stringify.js
|
|
903
903
|
var Jo = O((at) => {
|
|
904
904
|
"use strict";
|
|
905
905
|
Object.defineProperty(at, "__esModule", { value: !0 });
|
|
906
|
-
at.stringify =
|
|
907
|
-
var
|
|
908
|
-
function
|
|
906
|
+
at.stringify = xa;
|
|
907
|
+
var Ta = st();
|
|
908
|
+
function xa(r, e) {
|
|
909
909
|
if (r === null || typeof r != "object")
|
|
910
910
|
return "";
|
|
911
911
|
let t = e ?? {};
|
|
912
|
-
return (0,
|
|
912
|
+
return (0, Ta.stringifyObject)(r, t);
|
|
913
913
|
}
|
|
914
|
-
n(
|
|
914
|
+
n(xa, "stringify");
|
|
915
915
|
});
|
|
916
916
|
|
|
917
917
|
// ../node_modules/picoquery/lib/main.js
|
|
918
918
|
var nr = O((q) => {
|
|
919
919
|
"use strict";
|
|
920
|
-
var
|
|
920
|
+
var Ra = q && q.__createBinding || (Object.create ? function(r, e, t, o) {
|
|
921
921
|
o === void 0 && (o = t);
|
|
922
922
|
var s = Object.getOwnPropertyDescriptor(e, t);
|
|
923
923
|
(!s || ("get" in s ? !e.__esModule : s.writable || s.configurable)) && (s = { enumerable: !0, get: /* @__PURE__ */ n(function() {
|
|
@@ -925,25 +925,25 @@ var nr = O((q) => {
|
|
|
925
925
|
}, "get") }), Object.defineProperty(r, o, s);
|
|
926
926
|
} : function(r, e, t, o) {
|
|
927
927
|
o === void 0 && (o = t), r[o] = e[t];
|
|
928
|
-
}),
|
|
929
|
-
for (var t in r) t !== "default" && !Object.prototype.hasOwnProperty.call(e, t) &&
|
|
928
|
+
}), wa = q && q.__exportStar || function(r, e) {
|
|
929
|
+
for (var t in r) t !== "default" && !Object.prototype.hasOwnProperty.call(e, t) && Ra(e, r, t);
|
|
930
930
|
};
|
|
931
931
|
Object.defineProperty(q, "__esModule", { value: !0 });
|
|
932
932
|
q.stringify = q.parse = void 0;
|
|
933
|
-
var
|
|
933
|
+
var Ea = Xo();
|
|
934
934
|
Object.defineProperty(q, "parse", { enumerable: !0, get: /* @__PURE__ */ n(function() {
|
|
935
|
-
return
|
|
935
|
+
return Ea.parse;
|
|
936
936
|
}, "get") });
|
|
937
|
-
var
|
|
937
|
+
var Aa = Jo();
|
|
938
938
|
Object.defineProperty(q, "stringify", { enumerable: !0, get: /* @__PURE__ */ n(function() {
|
|
939
|
-
return
|
|
939
|
+
return Aa.stringify;
|
|
940
940
|
}, "get") });
|
|
941
|
-
|
|
941
|
+
wa(er(), q);
|
|
942
942
|
});
|
|
943
943
|
|
|
944
944
|
// ../node_modules/ansi-to-html/node_modules/entities/lib/maps/entities.json
|
|
945
|
-
var pt = O((
|
|
946
|
-
|
|
945
|
+
var pt = O((hf, ja) => {
|
|
946
|
+
ja.exports = { Aacute: "\xC1", aacute: "\xE1", Abreve: "\u0102", abreve: "\u0103", ac: "\u223E", acd: "\u223F", acE: "\u223E\u0333", Acirc: "\
|
|
947
947
|
\xC2", acirc: "\xE2", acute: "\xB4", Acy: "\u0410", acy: "\u0430", AElig: "\xC6", aelig: "\xE6", af: "\u2061", Afr: "\u{1D504}", afr: "\u{1D51E}",
|
|
948
948
|
Agrave: "\xC0", agrave: "\xE0", alefsym: "\u2135", aleph: "\u2135", Alpha: "\u0391", alpha: "\u03B1", Amacr: "\u0100", amacr: "\u0101", amalg: "\
|
|
949
949
|
\u2A3F", amp: "&", AMP: "&", andand: "\u2A55", And: "\u2A53", and: "\u2227", andd: "\u2A5C", andslope: "\u2A58", andv: "\u2A5A", ang: "\u2220",
|
|
@@ -1224,8 +1224,8 @@ var pt = O((ff, Oa) => {
|
|
|
1224
1224
|
});
|
|
1225
1225
|
|
|
1226
1226
|
// ../node_modules/ansi-to-html/node_modules/entities/lib/maps/legacy.json
|
|
1227
|
-
var nn = O((
|
|
1228
|
-
|
|
1227
|
+
var nn = O((gf, Ma) => {
|
|
1228
|
+
Ma.exports = { Aacute: "\xC1", aacute: "\xE1", Acirc: "\xC2", acirc: "\xE2", acute: "\xB4", AElig: "\xC6", aelig: "\xE6", Agrave: "\xC0", agrave: "\
|
|
1229
1229
|
\xE0", amp: "&", AMP: "&", Aring: "\xC5", aring: "\xE5", Atilde: "\xC3", atilde: "\xE3", Auml: "\xC4", auml: "\xE4", brvbar: "\xA6", Ccedil: "\
|
|
1230
1230
|
\xC7", ccedil: "\xE7", cedil: "\xB8", cent: "\xA2", copy: "\xA9", COPY: "\xA9", curren: "\xA4", deg: "\xB0", divide: "\xF7", Eacute: "\xC9",
|
|
1231
1231
|
eacute: "\xE9", Ecirc: "\xCA", ecirc: "\xEA", Egrave: "\xC8", egrave: "\xE8", ETH: "\xD0", eth: "\xF0", Euml: "\xCB", euml: "\xEB", frac12: "\
|
|
@@ -1239,25 +1239,25 @@ var nn = O((yf, Da) => {
|
|
|
1239
1239
|
});
|
|
1240
1240
|
|
|
1241
1241
|
// ../node_modules/ansi-to-html/node_modules/entities/lib/maps/xml.json
|
|
1242
|
-
var ut = O((
|
|
1243
|
-
|
|
1242
|
+
var ut = O((bf, La) => {
|
|
1243
|
+
La.exports = { amp: "&", apos: "'", gt: ">", lt: "<", quot: '"' };
|
|
1244
1244
|
});
|
|
1245
1245
|
|
|
1246
1246
|
// ../node_modules/ansi-to-html/node_modules/entities/lib/maps/decode.json
|
|
1247
|
-
var sn = O((
|
|
1248
|
-
|
|
1247
|
+
var sn = O((Sf, _a) => {
|
|
1248
|
+
_a.exports = { "0": 65533, "128": 8364, "130": 8218, "131": 402, "132": 8222, "133": 8230, "134": 8224, "135": 8225, "136": 710, "137": 8240,
|
|
1249
1249
|
"138": 352, "139": 8249, "140": 338, "142": 381, "145": 8216, "146": 8217, "147": 8220, "148": 8221, "149": 8226, "150": 8211, "151": 8212,
|
|
1250
1250
|
"152": 732, "153": 8482, "154": 353, "155": 8250, "156": 339, "158": 382, "159": 376 };
|
|
1251
1251
|
});
|
|
1252
1252
|
|
|
1253
1253
|
// ../node_modules/ansi-to-html/node_modules/entities/lib/decode_codepoint.js
|
|
1254
|
-
var ln = O((
|
|
1254
|
+
var ln = O((Ne) => {
|
|
1255
1255
|
"use strict";
|
|
1256
|
-
var
|
|
1256
|
+
var Na = Ne && Ne.__importDefault || function(r) {
|
|
1257
1257
|
return r && r.__esModule ? r : { default: r };
|
|
1258
1258
|
};
|
|
1259
|
-
Object.defineProperty(
|
|
1260
|
-
var an =
|
|
1259
|
+
Object.defineProperty(Ne, "__esModule", { value: !0 });
|
|
1260
|
+
var an = Na(sn()), qa = (
|
|
1261
1261
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
1262
1262
|
String.fromCodePoint || function(r) {
|
|
1263
1263
|
var e = "";
|
|
@@ -1265,11 +1265,11 @@ var ln = O((qe) => {
|
|
|
1265
1265
|
e;
|
|
1266
1266
|
}
|
|
1267
1267
|
);
|
|
1268
|
-
function
|
|
1269
|
-
return r >= 55296 && r <= 57343 || r > 1114111 ? "\uFFFD" : (r in an.default && (r = an.default[r]),
|
|
1268
|
+
function za(r) {
|
|
1269
|
+
return r >= 55296 && r <= 57343 || r > 1114111 ? "\uFFFD" : (r in an.default && (r = an.default[r]), qa(r));
|
|
1270
1270
|
}
|
|
1271
|
-
n(
|
|
1272
|
-
|
|
1271
|
+
n(za, "decodeCodePoint");
|
|
1272
|
+
Ne.default = za;
|
|
1273
1273
|
});
|
|
1274
1274
|
|
|
1275
1275
|
// ../node_modules/ansi-to-html/node_modules/entities/lib/decode.js
|
|
@@ -1280,13 +1280,13 @@ var yt = O((U) => {
|
|
|
1280
1280
|
};
|
|
1281
1281
|
Object.defineProperty(U, "__esModule", { value: !0 });
|
|
1282
1282
|
U.decodeHTML = U.decodeHTMLStrict = U.decodeXML = void 0;
|
|
1283
|
-
var ft = sr(pt()),
|
|
1284
|
-
U.decodeXML = pn(
|
|
1283
|
+
var ft = sr(pt()), Ba = sr(nn()), Ga = sr(ut()), cn = sr(ln()), Ua = /&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;
|
|
1284
|
+
U.decodeXML = pn(Ga.default);
|
|
1285
1285
|
U.decodeHTMLStrict = pn(ft.default);
|
|
1286
1286
|
function pn(r) {
|
|
1287
1287
|
var e = un(r);
|
|
1288
1288
|
return function(t) {
|
|
1289
|
-
return String(t).replace(
|
|
1289
|
+
return String(t).replace(Ua, e);
|
|
1290
1290
|
};
|
|
1291
1291
|
}
|
|
1292
1292
|
n(pn, "getStrictDecoder");
|
|
@@ -1294,7 +1294,7 @@ var yt = O((U) => {
|
|
|
1294
1294
|
return r < e ? 1 : -1;
|
|
1295
1295
|
}, "sorter");
|
|
1296
1296
|
U.decodeHTML = function() {
|
|
1297
|
-
for (var r = Object.keys(
|
|
1297
|
+
for (var r = Object.keys(Ba.default).sort(dn), e = Object.keys(ft.default).sort(dn), t = 0, o = 0; t < e.length; t++)
|
|
1298
1298
|
r[o] === e[t] ? (e[t] += ";?", o++) : e[t] += ";";
|
|
1299
1299
|
var s = new RegExp("&(?:" + e.join("|") + "|#[xX][\\da-fA-F]+;?|#\\d+;?)", "g"), i = un(ft.default);
|
|
1300
1300
|
function a(l) {
|
|
@@ -1324,10 +1324,10 @@ var ht = O((M) => {
|
|
|
1324
1324
|
};
|
|
1325
1325
|
Object.defineProperty(M, "__esModule", { value: !0 });
|
|
1326
1326
|
M.escapeUTF8 = M.escape = M.encodeNonAsciiHTML = M.encodeHTML = M.encodeXML = void 0;
|
|
1327
|
-
var
|
|
1327
|
+
var Va = fn(ut()), yn = hn(Va.default), mn = gn(yn);
|
|
1328
1328
|
M.encodeXML = Tn(yn);
|
|
1329
|
-
var
|
|
1330
|
-
M.encodeHTML =
|
|
1329
|
+
var Ha = fn(pt()), mt = hn(Ha.default), Wa = gn(mt);
|
|
1330
|
+
M.encodeHTML = Ya(mt, Wa);
|
|
1331
1331
|
M.encodeNonAsciiHTML = Tn(mt);
|
|
1332
1332
|
function hn(r) {
|
|
1333
1333
|
return Object.keys(r).sort().reduce(function(e, t) {
|
|
@@ -1351,7 +1351,7 @@ var ht = O((M) => {
|
|
|
1351
1351
|
}
|
|
1352
1352
|
n(gn, "getInverseReplacer");
|
|
1353
1353
|
var bn = /(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g,
|
|
1354
|
-
|
|
1354
|
+
$a = (
|
|
1355
1355
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
1356
1356
|
String.prototype.codePointAt != null ? (
|
|
1357
1357
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -1366,28 +1366,28 @@ var ht = O((M) => {
|
|
|
1366
1366
|
)
|
|
1367
1367
|
);
|
|
1368
1368
|
function ir(r) {
|
|
1369
|
-
return "&#x" + (r.length > 1 ?
|
|
1369
|
+
return "&#x" + (r.length > 1 ? $a(r) : r.charCodeAt(0)).toString(16).toUpperCase() + ";";
|
|
1370
1370
|
}
|
|
1371
1371
|
n(ir, "singleCharReplacer");
|
|
1372
|
-
function
|
|
1372
|
+
function Ya(r, e) {
|
|
1373
1373
|
return function(t) {
|
|
1374
1374
|
return t.replace(e, function(o) {
|
|
1375
1375
|
return r[o];
|
|
1376
1376
|
}).replace(bn, ir);
|
|
1377
1377
|
};
|
|
1378
1378
|
}
|
|
1379
|
-
n(
|
|
1379
|
+
n(Ya, "getInverse");
|
|
1380
1380
|
var Sn = new RegExp(mn.source + "|" + bn.source, "g");
|
|
1381
|
-
function
|
|
1381
|
+
function Ka(r) {
|
|
1382
1382
|
return r.replace(Sn, ir);
|
|
1383
1383
|
}
|
|
1384
|
-
n(
|
|
1385
|
-
M.escape =
|
|
1386
|
-
function
|
|
1384
|
+
n(Ka, "escape");
|
|
1385
|
+
M.escape = Ka;
|
|
1386
|
+
function Xa(r) {
|
|
1387
1387
|
return r.replace(mn, ir);
|
|
1388
1388
|
}
|
|
1389
|
-
n(
|
|
1390
|
-
M.escapeUTF8 =
|
|
1389
|
+
n(Xa, "escapeUTF8");
|
|
1390
|
+
M.escapeUTF8 = Xa;
|
|
1391
1391
|
function Tn(r) {
|
|
1392
1392
|
return function(e) {
|
|
1393
1393
|
return e.replace(Sn, function(t) {
|
|
@@ -1406,21 +1406,21 @@ var Rn = O((w) => {
|
|
|
1406
1406
|
w.encodeHTML5 = w.encodeHTML4 = w.escapeUTF8 = w.escape = w.encodeNonAsciiHTML = w.encodeHTML = w.encodeXML = w.encode = w.decodeStrict = w.
|
|
1407
1407
|
decode = void 0;
|
|
1408
1408
|
var ar = yt(), xn = ht();
|
|
1409
|
-
function
|
|
1409
|
+
function Ja(r, e) {
|
|
1410
1410
|
return (!e || e <= 0 ? ar.decodeXML : ar.decodeHTML)(r);
|
|
1411
1411
|
}
|
|
1412
|
-
n(
|
|
1413
|
-
w.decode =
|
|
1414
|
-
function
|
|
1412
|
+
n(Ja, "decode");
|
|
1413
|
+
w.decode = Ja;
|
|
1414
|
+
function Qa(r, e) {
|
|
1415
1415
|
return (!e || e <= 0 ? ar.decodeXML : ar.decodeHTMLStrict)(r);
|
|
1416
1416
|
}
|
|
1417
|
-
n(
|
|
1418
|
-
w.decodeStrict =
|
|
1419
|
-
function
|
|
1417
|
+
n(Qa, "decodeStrict");
|
|
1418
|
+
w.decodeStrict = Qa;
|
|
1419
|
+
function Za(r, e) {
|
|
1420
1420
|
return (!e || e <= 0 ? xn.encodeXML : xn.encodeHTML)(r);
|
|
1421
1421
|
}
|
|
1422
|
-
n(
|
|
1423
|
-
w.encode =
|
|
1422
|
+
n(Za, "encode");
|
|
1423
|
+
w.encode = Za;
|
|
1424
1424
|
var de = ht();
|
|
1425
1425
|
Object.defineProperty(w, "encodeXML", { enumerable: !0, get: /* @__PURE__ */ n(function() {
|
|
1426
1426
|
return de.encodeXML;
|
|
@@ -1471,13 +1471,13 @@ var Rn = O((w) => {
|
|
|
1471
1471
|
});
|
|
1472
1472
|
|
|
1473
1473
|
// ../node_modules/ansi-to-html/lib/ansi_to_html.js
|
|
1474
|
-
var kn = O((
|
|
1474
|
+
var kn = O((Pf, Dn) => {
|
|
1475
1475
|
"use strict";
|
|
1476
|
-
function
|
|
1476
|
+
function el(r, e) {
|
|
1477
1477
|
if (!(r instanceof e))
|
|
1478
1478
|
throw new TypeError("Cannot call a class as a function");
|
|
1479
1479
|
}
|
|
1480
|
-
n(
|
|
1480
|
+
n(el, "_classCallCheck");
|
|
1481
1481
|
function wn(r, e) {
|
|
1482
1482
|
for (var t = 0; t < e.length; t++) {
|
|
1483
1483
|
var o = e[t];
|
|
@@ -1485,14 +1485,14 @@ var kn = O((Af, Dn) => {
|
|
|
1485
1485
|
}
|
|
1486
1486
|
}
|
|
1487
1487
|
n(wn, "_defineProperties");
|
|
1488
|
-
function
|
|
1488
|
+
function rl(r, e, t) {
|
|
1489
1489
|
return e && wn(r.prototype, e), t && wn(r, t), r;
|
|
1490
1490
|
}
|
|
1491
|
-
n(
|
|
1491
|
+
n(rl, "_createClass");
|
|
1492
1492
|
function Fn(r, e) {
|
|
1493
1493
|
var t = typeof Symbol < "u" && r[Symbol.iterator] || r["@@iterator"];
|
|
1494
1494
|
if (!t) {
|
|
1495
|
-
if (Array.isArray(r) || (t =
|
|
1495
|
+
if (Array.isArray(r) || (t = tl(r)) || e && r && typeof r.length == "number") {
|
|
1496
1496
|
t && (r = t);
|
|
1497
1497
|
var o = 0, s = /* @__PURE__ */ n(function() {
|
|
1498
1498
|
}, "F");
|
|
@@ -1522,7 +1522,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1522
1522
|
}, "f") };
|
|
1523
1523
|
}
|
|
1524
1524
|
n(Fn, "_createForOfIteratorHelper");
|
|
1525
|
-
function
|
|
1525
|
+
function tl(r, e) {
|
|
1526
1526
|
if (r) {
|
|
1527
1527
|
if (typeof r == "string") return En(r, e);
|
|
1528
1528
|
var t = Object.prototype.toString.call(r).slice(8, -1);
|
|
@@ -1530,7 +1530,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1530
1530
|
if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return En(r, e);
|
|
1531
1531
|
}
|
|
1532
1532
|
}
|
|
1533
|
-
n(
|
|
1533
|
+
n(tl, "_unsupportedIterableToArray");
|
|
1534
1534
|
function En(r, e) {
|
|
1535
1535
|
(e == null || e > r.length) && (e = r.length);
|
|
1536
1536
|
for (var t = 0, o = new Array(e); t < e; t++)
|
|
@@ -1538,15 +1538,15 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1538
1538
|
return o;
|
|
1539
1539
|
}
|
|
1540
1540
|
n(En, "_arrayLikeToArray");
|
|
1541
|
-
var
|
|
1541
|
+
var ol = Rn(), An = {
|
|
1542
1542
|
fg: "#FFF",
|
|
1543
1543
|
bg: "#000",
|
|
1544
1544
|
newline: !1,
|
|
1545
1545
|
escapeXML: !1,
|
|
1546
1546
|
stream: !1,
|
|
1547
|
-
colors:
|
|
1547
|
+
colors: nl()
|
|
1548
1548
|
};
|
|
1549
|
-
function
|
|
1549
|
+
function nl() {
|
|
1550
1550
|
var r = {
|
|
1551
1551
|
0: "#000",
|
|
1552
1552
|
1: "#A00",
|
|
@@ -1568,7 +1568,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1568
1568
|
return lr(0, 5).forEach(function(e) {
|
|
1569
1569
|
lr(0, 5).forEach(function(t) {
|
|
1570
1570
|
lr(0, 5).forEach(function(o) {
|
|
1571
|
-
return
|
|
1571
|
+
return sl(e, t, o, r);
|
|
1572
1572
|
});
|
|
1573
1573
|
});
|
|
1574
1574
|
}), lr(0, 23).forEach(function(e) {
|
|
@@ -1576,19 +1576,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1576
1576
|
r[t] = "#" + o + o + o;
|
|
1577
1577
|
}), r;
|
|
1578
1578
|
}
|
|
1579
|
-
n(
|
|
1580
|
-
function
|
|
1579
|
+
n(nl, "getDefaultColors");
|
|
1580
|
+
function sl(r, e, t, o) {
|
|
1581
1581
|
var s = 16 + r * 36 + e * 6 + t, i = r > 0 ? r * 40 + 55 : 0, a = e > 0 ? e * 40 + 55 : 0, l = t > 0 ? t * 40 + 55 : 0;
|
|
1582
|
-
o[s] =
|
|
1582
|
+
o[s] = il([i, a, l]);
|
|
1583
1583
|
}
|
|
1584
|
-
n(
|
|
1584
|
+
n(sl, "setStyleColor");
|
|
1585
1585
|
function In(r) {
|
|
1586
1586
|
for (var e = r.toString(16); e.length < 2; )
|
|
1587
1587
|
e = "0" + e;
|
|
1588
1588
|
return e;
|
|
1589
1589
|
}
|
|
1590
1590
|
n(In, "toHexString");
|
|
1591
|
-
function
|
|
1591
|
+
function il(r) {
|
|
1592
1592
|
var e = [], t = Fn(r), o;
|
|
1593
1593
|
try {
|
|
1594
1594
|
for (t.s(); !(o = t.n()).done; ) {
|
|
@@ -1602,22 +1602,22 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1602
1602
|
}
|
|
1603
1603
|
return "#" + e.join("");
|
|
1604
1604
|
}
|
|
1605
|
-
n(
|
|
1606
|
-
function
|
|
1605
|
+
n(il, "toColorHexString");
|
|
1606
|
+
function Cn(r, e, t, o) {
|
|
1607
1607
|
var s;
|
|
1608
|
-
return e === "text" ? s =
|
|
1609
|
-
erm256Background" ? s = pr(r, o.colors[t]) : e === "rgb" && (s =
|
|
1608
|
+
return e === "text" ? s = dl(t, o) : e === "display" ? s = ll(r, t, o) : e === "xterm256Foreground" ? s = dr(r, o.colors[t]) : e === "xt\
|
|
1609
|
+
erm256Background" ? s = pr(r, o.colors[t]) : e === "rgb" && (s = al(r, t)), s;
|
|
1610
1610
|
}
|
|
1611
|
-
n(
|
|
1612
|
-
function
|
|
1611
|
+
n(Cn, "generateOutput");
|
|
1612
|
+
function al(r, e) {
|
|
1613
1613
|
e = e.substring(2).slice(0, -1);
|
|
1614
1614
|
var t = +e.substr(0, 2), o = e.substring(5).split(";"), s = o.map(function(i) {
|
|
1615
1615
|
return ("0" + Number(i).toString(16)).substr(-2);
|
|
1616
1616
|
}).join("");
|
|
1617
1617
|
return cr(r, (t === 38 ? "color:#" : "background-color:#") + s);
|
|
1618
1618
|
}
|
|
1619
|
-
n(
|
|
1620
|
-
function
|
|
1619
|
+
n(al, "handleRgb");
|
|
1620
|
+
function ll(r, e, t) {
|
|
1621
1621
|
e = parseInt(e, 10);
|
|
1622
1622
|
var o = {
|
|
1623
1623
|
"-1": /* @__PURE__ */ n(function() {
|
|
@@ -1664,7 +1664,7 @@ erm256Background" ? s = pr(r, o.colors[t]) : e === "rgb" && (s = nl(r, t)), s;
|
|
|
1664
1664
|
pr(r, t.colors[e - 40]) : 89 < e && e < 98 ? s = dr(r, t.colors[8 + (e - 90)]) : 99 < e && e < 108 && (s = pr(r, t.colors[8 + (e - 100)])),
|
|
1665
1665
|
s;
|
|
1666
1666
|
}
|
|
1667
|
-
n(
|
|
1667
|
+
n(ll, "handleDisplay");
|
|
1668
1668
|
function On(r) {
|
|
1669
1669
|
var e = r.slice(0);
|
|
1670
1670
|
return r.length = 0, e.reverse().map(function(t) {
|
|
@@ -1678,24 +1678,24 @@ erm256Background" ? s = pr(r, o.colors[t]) : e === "rgb" && (s = nl(r, t)), s;
|
|
|
1678
1678
|
return t;
|
|
1679
1679
|
}
|
|
1680
1680
|
n(lr, "range");
|
|
1681
|
-
function
|
|
1681
|
+
function cl(r) {
|
|
1682
1682
|
return function(e) {
|
|
1683
1683
|
return (r === null || e.category !== r) && r !== "all";
|
|
1684
1684
|
};
|
|
1685
1685
|
}
|
|
1686
|
-
n(
|
|
1687
|
-
function
|
|
1686
|
+
n(cl, "notCategory");
|
|
1687
|
+
function vn(r) {
|
|
1688
1688
|
r = parseInt(r, 10);
|
|
1689
1689
|
var e = null;
|
|
1690
1690
|
return r === 0 ? e = "all" : r === 1 ? e = "bold" : 2 < r && r < 5 ? e = "underline" : 4 < r && r < 7 ? e = "blink" : r === 8 ? e = "hid\
|
|
1691
1691
|
e" : r === 9 ? e = "strike" : 29 < r && r < 38 || r === 39 || 89 < r && r < 98 ? e = "foreground-color" : (39 < r && r < 48 || r === 49 || 99 <
|
|
1692
1692
|
r && r < 108) && (e = "background-color"), e;
|
|
1693
1693
|
}
|
|
1694
|
-
n(
|
|
1695
|
-
function
|
|
1696
|
-
return e.escapeXML ?
|
|
1694
|
+
n(vn, "categoryForCode");
|
|
1695
|
+
function dl(r, e) {
|
|
1696
|
+
return e.escapeXML ? ol.encodeXML(r) : r;
|
|
1697
1697
|
}
|
|
1698
|
-
n(
|
|
1698
|
+
n(dl, "pushText");
|
|
1699
1699
|
function re(r, e, t) {
|
|
1700
1700
|
return t || (t = ""), r.push(e), "<".concat(e).concat(t ? ' style="'.concat(t, '"') : "", ">");
|
|
1701
1701
|
}
|
|
@@ -1718,7 +1718,7 @@ e" : r === 9 ? e = "strike" : 29 < r && r < 38 || r === 39 || 89 < r && r < 98 ?
|
|
|
1718
1718
|
return "</" + e + ">";
|
|
1719
1719
|
}
|
|
1720
1720
|
n(Pn, "closeTag");
|
|
1721
|
-
function
|
|
1721
|
+
function pl(r, e, t) {
|
|
1722
1722
|
var o = !1, s = 3;
|
|
1723
1723
|
function i() {
|
|
1724
1724
|
return "";
|
|
@@ -1744,8 +1744,8 @@ e" : r === 9 ? e = "strike" : 29 < r && r < 38 || r === 39 || 89 < r && r < 98 ?
|
|
|
1744
1744
|
var j = F.value;
|
|
1745
1745
|
t("display", j);
|
|
1746
1746
|
}
|
|
1747
|
-
} catch (
|
|
1748
|
-
A.e(
|
|
1747
|
+
} catch (N) {
|
|
1748
|
+
A.e(N);
|
|
1749
1749
|
} finally {
|
|
1750
1750
|
A.f();
|
|
1751
1751
|
}
|
|
@@ -1839,44 +1839,44 @@ e" : r === 9 ? e = "strike" : 29 < r && r < 38 || r === 39 || 89 < r && r < 98 ?
|
|
|
1839
1839
|
}
|
|
1840
1840
|
return S;
|
|
1841
1841
|
}
|
|
1842
|
-
n(
|
|
1843
|
-
function
|
|
1844
|
-
return e !== "text" && (r = r.filter(
|
|
1842
|
+
n(pl, "tokenize");
|
|
1843
|
+
function ul(r, e, t) {
|
|
1844
|
+
return e !== "text" && (r = r.filter(cl(vn(t))), r.push({
|
|
1845
1845
|
token: e,
|
|
1846
1846
|
data: t,
|
|
1847
|
-
category:
|
|
1847
|
+
category: vn(t)
|
|
1848
1848
|
})), r;
|
|
1849
1849
|
}
|
|
1850
|
-
n(
|
|
1851
|
-
var
|
|
1850
|
+
n(ul, "updateStickyStack");
|
|
1851
|
+
var fl = /* @__PURE__ */ function() {
|
|
1852
1852
|
function r(e) {
|
|
1853
|
-
|
|
1853
|
+
el(this, r), e = e || {}, e.colors && (e.colors = Object.assign({}, An.colors, e.colors)), this.options = Object.assign({}, An, e), this.
|
|
1854
1854
|
stack = [], this.stickyStack = [];
|
|
1855
1855
|
}
|
|
1856
|
-
return n(r, "Filter"),
|
|
1856
|
+
return n(r, "Filter"), rl(r, [{
|
|
1857
1857
|
key: "toHtml",
|
|
1858
1858
|
value: /* @__PURE__ */ n(function(t) {
|
|
1859
1859
|
var o = this;
|
|
1860
1860
|
t = typeof t == "string" ? [t] : t;
|
|
1861
1861
|
var s = this.stack, i = this.options, a = [];
|
|
1862
1862
|
return this.stickyStack.forEach(function(l) {
|
|
1863
|
-
var c =
|
|
1863
|
+
var c = Cn(s, l.token, l.data, i);
|
|
1864
1864
|
c && a.push(c);
|
|
1865
|
-
}),
|
|
1866
|
-
var d =
|
|
1867
|
-
d && a.push(d), i.stream && (o.stickyStack =
|
|
1865
|
+
}), pl(t.join(""), i, function(l, c) {
|
|
1866
|
+
var d = Cn(s, l, c, i);
|
|
1867
|
+
d && a.push(d), i.stream && (o.stickyStack = ul(o.stickyStack, l, c));
|
|
1868
1868
|
}), s.length && a.push(On(s)), a.join("");
|
|
1869
1869
|
}, "toHtml")
|
|
1870
1870
|
}]), r;
|
|
1871
1871
|
}();
|
|
1872
|
-
Dn.exports =
|
|
1872
|
+
Dn.exports = fl;
|
|
1873
1873
|
});
|
|
1874
1874
|
|
|
1875
1875
|
// src/preview-api/modules/addons/main.ts
|
|
1876
1876
|
import { global as hr } from "@storybook/global";
|
|
1877
1877
|
|
|
1878
1878
|
// src/preview-api/modules/addons/storybook-channel-mock.ts
|
|
1879
|
-
import { Channel as
|
|
1879
|
+
import { Channel as Jn } from "storybook/internal/channels";
|
|
1880
1880
|
function mr() {
|
|
1881
1881
|
let r = {
|
|
1882
1882
|
setHandler: /* @__PURE__ */ n(() => {
|
|
@@ -1884,7 +1884,7 @@ function mr() {
|
|
|
1884
1884
|
send: /* @__PURE__ */ n(() => {
|
|
1885
1885
|
}, "send")
|
|
1886
1886
|
};
|
|
1887
|
-
return new
|
|
1887
|
+
return new Jn({ transport: r });
|
|
1888
1888
|
}
|
|
1889
1889
|
n(mr, "mockChannel");
|
|
1890
1890
|
|
|
@@ -1910,26 +1910,26 @@ var Sr = class Sr {
|
|
|
1910
1910
|
};
|
|
1911
1911
|
n(Sr, "AddonStore");
|
|
1912
1912
|
var br = Sr, gr = "__STORYBOOK_ADDONS_PREVIEW";
|
|
1913
|
-
function
|
|
1913
|
+
function Qn() {
|
|
1914
1914
|
return hr[gr] || (hr[gr] = new br()), hr[gr];
|
|
1915
1915
|
}
|
|
1916
|
-
n(
|
|
1917
|
-
var
|
|
1916
|
+
n(Qn, "getAddonsStore");
|
|
1917
|
+
var L = Qn();
|
|
1918
1918
|
|
|
1919
1919
|
// src/preview-api/modules/addons/definePreview.ts
|
|
1920
|
-
function
|
|
1920
|
+
function Zn(r) {
|
|
1921
1921
|
return r;
|
|
1922
1922
|
}
|
|
1923
|
-
n(
|
|
1923
|
+
n(Zn, "definePreview");
|
|
1924
1924
|
|
|
1925
1925
|
// src/preview-api/modules/addons/hooks.ts
|
|
1926
|
-
import { logger as
|
|
1926
|
+
import { logger as Ce } from "storybook/internal/client-logger";
|
|
1927
1927
|
import {
|
|
1928
|
-
FORCE_RE_RENDER as
|
|
1929
|
-
RESET_STORY_ARGS as
|
|
1928
|
+
FORCE_RE_RENDER as es,
|
|
1929
|
+
RESET_STORY_ARGS as rs,
|
|
1930
1930
|
STORY_RENDERED as Rt,
|
|
1931
|
-
UPDATE_GLOBALS as
|
|
1932
|
-
UPDATE_STORY_ARGS as
|
|
1931
|
+
UPDATE_GLOBALS as ts,
|
|
1932
|
+
UPDATE_STORY_ARGS as os
|
|
1933
1933
|
} from "storybook/internal/core-events";
|
|
1934
1934
|
import { global as ze } from "@storybook/global";
|
|
1935
1935
|
var Er = class Er {
|
|
@@ -1972,10 +1972,10 @@ var Er = class Er {
|
|
|
1972
1972
|
}), this.prevEffects = this.currentEffects, this.currentEffects = [];
|
|
1973
1973
|
}
|
|
1974
1974
|
addRenderListeners() {
|
|
1975
|
-
this.removeRenderListeners(),
|
|
1975
|
+
this.removeRenderListeners(), L.getChannel().on(Rt, this.renderListener);
|
|
1976
1976
|
}
|
|
1977
1977
|
removeRenderListeners() {
|
|
1978
|
-
|
|
1978
|
+
L.getChannel().removeListener(Rt, this.renderListener);
|
|
1979
1979
|
}
|
|
1980
1980
|
};
|
|
1981
1981
|
n(Er, "HooksContext");
|
|
@@ -1998,7 +1998,7 @@ function wt(r) {
|
|
|
1998
1998
|
return e.originalFn = r, e;
|
|
1999
1999
|
}
|
|
2000
2000
|
n(wt, "hookify");
|
|
2001
|
-
var Tr = 0,
|
|
2001
|
+
var Tr = 0, ns = 25, xr = /* @__PURE__ */ n((r) => (e, t) => {
|
|
2002
2002
|
let o = r(
|
|
2003
2003
|
wt(e),
|
|
2004
2004
|
t.map((s) => wt(s))
|
|
@@ -2009,13 +2009,13 @@ var Tr = 0, rs = 25, xr = /* @__PURE__ */ n((r) => (e, t) => {
|
|
|
2009
2009
|
hasUpdates = !1;
|
|
2010
2010
|
let a = o(s);
|
|
2011
2011
|
for (Tr = 1; i.hasUpdates; )
|
|
2012
|
-
if (i.hasUpdates = !1, i.currentEffects = [], a = o(s), Tr += 1, Tr >
|
|
2012
|
+
if (i.hasUpdates = !1, i.currentEffects = [], a = o(s), Tr += 1, Tr > ns)
|
|
2013
2013
|
throw new Error(
|
|
2014
2014
|
"Too many re-renders. Storybook limits the number of renders to prevent an infinite loop."
|
|
2015
2015
|
);
|
|
2016
2016
|
return i.addRenderListeners(), a;
|
|
2017
2017
|
};
|
|
2018
|
-
}, "applyHooks"),
|
|
2018
|
+
}, "applyHooks"), ss = /* @__PURE__ */ n((r, e) => r.length === e.length && r.every((t, o) => t === e[o]), "areDepsEqual"), Rr = /* @__PURE__ */ n(
|
|
2019
2019
|
() => new Error("Storybook preview hooks can only be called inside decorators and story functions."), "invalidHooksError");
|
|
2020
2020
|
function Et() {
|
|
2021
2021
|
return ze.STORYBOOK_HOOKS_CONTEXT || null;
|
|
@@ -2028,10 +2028,10 @@ function wr() {
|
|
|
2028
2028
|
return r;
|
|
2029
2029
|
}
|
|
2030
2030
|
n(wr, "getHooksContextOrThrow");
|
|
2031
|
-
function
|
|
2031
|
+
function is(r, e, t) {
|
|
2032
2032
|
let o = wr();
|
|
2033
2033
|
if (o.currentPhase === "MOUNT") {
|
|
2034
|
-
t != null && !Array.isArray(t) &&
|
|
2034
|
+
t != null && !Array.isArray(t) && Ce.warn(
|
|
2035
2035
|
`${r} received a final argument that is not an array (instead, received ${t}). When specified, the final argument must be an array.`
|
|
2036
2036
|
);
|
|
2037
2037
|
let s = { name: r, deps: t };
|
|
@@ -2041,22 +2041,22 @@ function os(r, e, t) {
|
|
|
2041
2041
|
let s = o.getNextHook();
|
|
2042
2042
|
if (s == null)
|
|
2043
2043
|
throw new Error("Rendered more hooks than during the previous render.");
|
|
2044
|
-
return s.name !== r &&
|
|
2044
|
+
return s.name !== r && Ce.warn(
|
|
2045
2045
|
`Storybook has detected a change in the order of Hooks${o.currentDecoratorName ? ` called by ${o.currentDecoratorName}` : ""}. This wi\
|
|
2046
2046
|
ll lead to bugs and errors if not fixed.`
|
|
2047
|
-
), t != null && s.deps == null &&
|
|
2047
|
+
), t != null && s.deps == null && Ce.warn(
|
|
2048
2048
|
`${r} received a final argument during this render, but not during the previous render. Even though the final argument is optional, it\
|
|
2049
2049
|
s type cannot change between renders.`
|
|
2050
|
-
), t != null && s.deps != null && t.length !== s.deps.length &&
|
|
2050
|
+
), t != null && s.deps != null && t.length !== s.deps.length && Ce.warn(`The final argument passed to ${r} changed size between renders.\
|
|
2051
2051
|
The order and size of this array must remain constant.
|
|
2052
2052
|
Previous: ${s.deps}
|
|
2053
|
-
Incoming: ${t}`), (t == null || s.deps == null || !
|
|
2053
|
+
Incoming: ${t}`), (t == null || s.deps == null || !ss(t, s.deps)) && (e(s), s.deps = t), s;
|
|
2054
2054
|
}
|
|
2055
2055
|
throw Rr();
|
|
2056
2056
|
}
|
|
2057
|
-
n(
|
|
2057
|
+
n(is, "useHook");
|
|
2058
2058
|
function Be(r, e, t) {
|
|
2059
|
-
let { memoizedState: o } =
|
|
2059
|
+
let { memoizedState: o } = is(
|
|
2060
2060
|
r,
|
|
2061
2061
|
(s) => {
|
|
2062
2062
|
s.memoizedState = e();
|
|
@@ -2066,68 +2066,68 @@ function Be(r, e, t) {
|
|
|
2066
2066
|
return o;
|
|
2067
2067
|
}
|
|
2068
2068
|
n(Be, "useMemoLike");
|
|
2069
|
-
function
|
|
2069
|
+
function as(r, e) {
|
|
2070
2070
|
return Be("useMemo", r, e);
|
|
2071
2071
|
}
|
|
2072
|
-
n(
|
|
2073
|
-
function
|
|
2072
|
+
n(as, "useMemo");
|
|
2073
|
+
function ve(r, e) {
|
|
2074
2074
|
return Be("useCallback", () => r, e);
|
|
2075
2075
|
}
|
|
2076
|
-
n(
|
|
2076
|
+
n(ve, "useCallback");
|
|
2077
2077
|
function At(r, e) {
|
|
2078
2078
|
return Be(r, () => ({ current: e }), []);
|
|
2079
2079
|
}
|
|
2080
2080
|
n(At, "useRefLike");
|
|
2081
|
-
function
|
|
2081
|
+
function ls(r) {
|
|
2082
2082
|
return At("useRef", r);
|
|
2083
2083
|
}
|
|
2084
|
-
n(
|
|
2085
|
-
function
|
|
2084
|
+
n(ls, "useRef");
|
|
2085
|
+
function cs() {
|
|
2086
2086
|
let r = Et();
|
|
2087
2087
|
if (r != null && r.currentPhase !== "NONE")
|
|
2088
2088
|
r.hasUpdates = !0;
|
|
2089
2089
|
else
|
|
2090
2090
|
try {
|
|
2091
|
-
|
|
2091
|
+
L.getChannel().emit(es);
|
|
2092
2092
|
} catch {
|
|
2093
|
-
|
|
2093
|
+
Ce.warn("State updates of Storybook preview hooks work only in browser");
|
|
2094
2094
|
}
|
|
2095
2095
|
}
|
|
2096
|
-
n(
|
|
2097
|
-
function
|
|
2096
|
+
n(cs, "triggerUpdate");
|
|
2097
|
+
function Ct(r, e) {
|
|
2098
2098
|
let t = At(
|
|
2099
2099
|
r,
|
|
2100
2100
|
// @ts-expect-error S type should never be function, but there's no way to tell that to TypeScript
|
|
2101
2101
|
typeof e == "function" ? e() : e
|
|
2102
2102
|
), o = /* @__PURE__ */ n((s) => {
|
|
2103
|
-
t.current = typeof s == "function" ? s(t.current) : s,
|
|
2103
|
+
t.current = typeof s == "function" ? s(t.current) : s, cs();
|
|
2104
2104
|
}, "setState");
|
|
2105
2105
|
return [t.current, o];
|
|
2106
2106
|
}
|
|
2107
|
-
n(
|
|
2108
|
-
function
|
|
2109
|
-
return
|
|
2107
|
+
n(Ct, "useStateLike");
|
|
2108
|
+
function ds(r) {
|
|
2109
|
+
return Ct("useState", r);
|
|
2110
2110
|
}
|
|
2111
|
-
n(
|
|
2112
|
-
function
|
|
2113
|
-
let o = t != null ? () => t(e) : e, [s, i] =
|
|
2111
|
+
n(ds, "useState");
|
|
2112
|
+
function ps(r, e, t) {
|
|
2113
|
+
let o = t != null ? () => t(e) : e, [s, i] = Ct("useReducer", o);
|
|
2114
2114
|
return [s, /* @__PURE__ */ n((l) => i((c) => r(c, l)), "dispatch")];
|
|
2115
2115
|
}
|
|
2116
|
-
n(
|
|
2117
|
-
function
|
|
2116
|
+
n(ps, "useReducer");
|
|
2117
|
+
function vt(r, e) {
|
|
2118
2118
|
let t = wr(), o = Be("useEffect", () => ({ create: r }), e);
|
|
2119
2119
|
t.currentEffects.includes(o) || t.currentEffects.push(o);
|
|
2120
2120
|
}
|
|
2121
|
-
n(
|
|
2122
|
-
function
|
|
2123
|
-
let t =
|
|
2124
|
-
return
|
|
2121
|
+
n(vt, "useEffect");
|
|
2122
|
+
function us(r, e = []) {
|
|
2123
|
+
let t = L.getChannel();
|
|
2124
|
+
return vt(() => (Object.entries(r).forEach(([o, s]) => t.on(o, s)), () => {
|
|
2125
2125
|
Object.entries(r).forEach(
|
|
2126
2126
|
([o, s]) => t.removeListener(o, s)
|
|
2127
2127
|
);
|
|
2128
|
-
}), [...Object.keys(r), ...e]),
|
|
2128
|
+
}), [...Object.keys(r), ...e]), ve(t.emit.bind(t), [t]);
|
|
2129
2129
|
}
|
|
2130
|
-
n(
|
|
2130
|
+
n(us, "useChannel");
|
|
2131
2131
|
function Ge() {
|
|
2132
2132
|
let { currentContext: r } = wr();
|
|
2133
2133
|
if (r == null)
|
|
@@ -2135,34 +2135,34 @@ function Ge() {
|
|
|
2135
2135
|
return r;
|
|
2136
2136
|
}
|
|
2137
2137
|
n(Ge, "useStoryContext");
|
|
2138
|
-
function
|
|
2138
|
+
function fs(r, e) {
|
|
2139
2139
|
let { parameters: t } = Ge();
|
|
2140
2140
|
if (r)
|
|
2141
2141
|
return t[r] ?? e;
|
|
2142
2142
|
}
|
|
2143
|
-
n(
|
|
2144
|
-
function
|
|
2145
|
-
let r =
|
|
2146
|
-
(i) => r.emit(
|
|
2143
|
+
n(fs, "useParameter");
|
|
2144
|
+
function ys() {
|
|
2145
|
+
let r = L.getChannel(), { id: e, args: t } = Ge(), o = ve(
|
|
2146
|
+
(i) => r.emit(os, { storyId: e, updatedArgs: i }),
|
|
2147
2147
|
[r, e]
|
|
2148
|
-
), s =
|
|
2149
|
-
(i) => r.emit(
|
|
2148
|
+
), s = ve(
|
|
2149
|
+
(i) => r.emit(rs, { storyId: e, argNames: i }),
|
|
2150
2150
|
[r, e]
|
|
2151
2151
|
);
|
|
2152
2152
|
return [t, o, s];
|
|
2153
2153
|
}
|
|
2154
|
-
n(
|
|
2155
|
-
function
|
|
2156
|
-
let r =
|
|
2157
|
-
(o) => r.emit(
|
|
2154
|
+
n(ys, "useArgs");
|
|
2155
|
+
function ms() {
|
|
2156
|
+
let r = L.getChannel(), { globals: e } = Ge(), t = ve(
|
|
2157
|
+
(o) => r.emit(ts, { globals: o }),
|
|
2158
2158
|
[r]
|
|
2159
2159
|
);
|
|
2160
2160
|
return [e, t];
|
|
2161
2161
|
}
|
|
2162
|
-
n(
|
|
2162
|
+
n(ms, "useGlobals");
|
|
2163
2163
|
|
|
2164
2164
|
// src/preview-api/modules/addons/make-decorator.ts
|
|
2165
|
-
var
|
|
2165
|
+
var hs = /* @__PURE__ */ n(({
|
|
2166
2166
|
name: r,
|
|
2167
2167
|
parameterName: e,
|
|
2168
2168
|
wrapper: t,
|
|
@@ -2187,8 +2187,8 @@ var fs = /* @__PURE__ */ n(({
|
|
|
2187
2187
|
|
|
2188
2188
|
// src/preview-api/modules/store/StoryStore.ts
|
|
2189
2189
|
import {
|
|
2190
|
-
CalledExtractOnStoreError as
|
|
2191
|
-
MissingStoryFromCsfFileError as
|
|
2190
|
+
CalledExtractOnStoreError as ri,
|
|
2191
|
+
MissingStoryFromCsfFileError as ti
|
|
2192
2192
|
} from "storybook/internal/preview-errors";
|
|
2193
2193
|
|
|
2194
2194
|
// ../node_modules/es-toolkit/dist/object/pickBy.mjs
|
|
@@ -2229,17 +2229,17 @@ function V(r, e) {
|
|
|
2229
2229
|
n(V, "mapValues");
|
|
2230
2230
|
|
|
2231
2231
|
// ../node_modules/es-toolkit/dist/compat/_internal/tags.mjs
|
|
2232
|
-
var Pt = "[object RegExp]", Ft = "[object String]", It = "[object Number]", Ot = "[object Boolean]",
|
|
2233
|
-
t Symbol]", kt = "[object Date]", jt = "[object Map]", Mt = "[object Set]", Lt = "[object Array]", _t = "[object Function]",
|
|
2234
|
-
rrayBuffer]", Ue = "[object Object]",
|
|
2232
|
+
var Pt = "[object RegExp]", Ft = "[object String]", It = "[object Number]", Ot = "[object Boolean]", Cr = "[object Arguments]", Dt = "[objec\
|
|
2233
|
+
t Symbol]", kt = "[object Date]", jt = "[object Map]", Mt = "[object Set]", Lt = "[object Array]", _t = "[object Function]", Nt = "[object A\
|
|
2234
|
+
rrayBuffer]", Ue = "[object Object]", qt = "[object Error]", zt = "[object DataView]", Bt = "[object Uint8Array]", Gt = "[object Uint8Clampe\
|
|
2235
2235
|
dArray]", Ut = "[object Uint16Array]", Vt = "[object Uint32Array]", Ht = "[object BigUint64Array]", Wt = "[object Int8Array]", $t = "[object\
|
|
2236
2236
|
Int16Array]", Yt = "[object Int32Array]", Kt = "[object BigInt64Array]", Xt = "[object Float32Array]", Jt = "[object Float64Array]";
|
|
2237
2237
|
|
|
2238
2238
|
// ../node_modules/es-toolkit/dist/compat/_internal/getSymbols.mjs
|
|
2239
|
-
function
|
|
2239
|
+
function vr(r) {
|
|
2240
2240
|
return Object.getOwnPropertySymbols(r).filter((e) => Object.prototype.propertyIsEnumerable.call(r, e));
|
|
2241
2241
|
}
|
|
2242
|
-
n(
|
|
2242
|
+
n(vr, "getSymbols");
|
|
2243
2243
|
|
|
2244
2244
|
// ../node_modules/es-toolkit/dist/compat/_internal/getTag.mjs
|
|
2245
2245
|
function Pr(r) {
|
|
@@ -2271,7 +2271,7 @@ function H(r, e, t) {
|
|
|
2271
2271
|
if (Object.is(r, e))
|
|
2272
2272
|
return !0;
|
|
2273
2273
|
let o = Pr(r), s = Pr(e);
|
|
2274
|
-
if (o ===
|
|
2274
|
+
if (o === Cr && (o = Ue), s === Cr && (s = Ue), o !== s)
|
|
2275
2275
|
return !1;
|
|
2276
2276
|
switch (o) {
|
|
2277
2277
|
case Ft:
|
|
@@ -2335,16 +2335,16 @@ function H(r, e, t) {
|
|
|
2335
2335
|
return !1;
|
|
2336
2336
|
return !0;
|
|
2337
2337
|
}
|
|
2338
|
-
case
|
|
2338
|
+
case Nt:
|
|
2339
2339
|
return r.byteLength !== e.byteLength ? !1 : H(new Uint8Array(r), new Uint8Array(e), t);
|
|
2340
2340
|
case zt:
|
|
2341
2341
|
return r.byteLength !== e.byteLength || r.byteOffset !== e.byteOffset ? !1 : H(r.buffer, e.buffer, t);
|
|
2342
|
-
case
|
|
2342
|
+
case qt:
|
|
2343
2343
|
return r.name === e.name && r.message === e.message;
|
|
2344
2344
|
case Ue: {
|
|
2345
2345
|
if (!(H(r.constructor, e.constructor, t) || k(r) && k(e)))
|
|
2346
2346
|
return !1;
|
|
2347
|
-
let c = [...Object.keys(r), ...
|
|
2347
|
+
let c = [...Object.keys(r), ...vr(r)], d = [...Object.keys(e), ...vr(e)];
|
|
2348
2348
|
if (c.length !== d.length)
|
|
2349
2349
|
return !1;
|
|
2350
2350
|
for (let p = 0; p < c.length; p++) {
|
|
@@ -2533,10 +2533,10 @@ function co({
|
|
|
2533
2533
|
n(co, "groupArgsByTarget");
|
|
2534
2534
|
|
|
2535
2535
|
// src/preview-api/modules/store/ArgsStore.ts
|
|
2536
|
-
function
|
|
2536
|
+
function gs(r) {
|
|
2537
2537
|
return Object.keys(r).forEach((e) => r[e] === void 0 && delete r[e]), r;
|
|
2538
2538
|
}
|
|
2539
|
-
n(
|
|
2539
|
+
n(gs, "deleteUndefined");
|
|
2540
2540
|
var Mr = class Mr {
|
|
2541
2541
|
constructor() {
|
|
2542
2542
|
this.initialArgsByStoryId = {};
|
|
@@ -2566,7 +2566,7 @@ var Mr = class Mr {
|
|
|
2566
2566
|
update(e, t) {
|
|
2567
2567
|
if (!(e in this.argsByStoryId))
|
|
2568
2568
|
throw new Error(`No args known for ${e} -- has it been rendered yet?`);
|
|
2569
|
-
this.argsByStoryId[e] =
|
|
2569
|
+
this.argsByStoryId[e] = gs({
|
|
2570
2570
|
...this.argsByStoryId[e],
|
|
2571
2571
|
...t
|
|
2572
2572
|
});
|
|
@@ -2576,7 +2576,7 @@ n(Mr, "ArgsStore");
|
|
|
2576
2576
|
var Ve = Mr;
|
|
2577
2577
|
|
|
2578
2578
|
// src/preview-api/modules/store/GlobalsStore.ts
|
|
2579
|
-
import { logger as
|
|
2579
|
+
import { logger as bs } from "storybook/internal/client-logger";
|
|
2580
2580
|
|
|
2581
2581
|
// src/preview-api/modules/store/csf/getValuesFromArgTypes.ts
|
|
2582
2582
|
var po = /* @__PURE__ */ n((r = {}) => Object.entries(r).reduce((e, [t, { defaultValue: o }]) => (typeof o < "u" && (e[t] = o), e), {}), "ge\
|
|
@@ -2597,7 +2597,7 @@ var Lr = class Lr {
|
|
|
2597
2597
|
this.initialGlobals = { ...s, ...e }, this.globals = this.initialGlobals, o && o !== ne && this.updateFromPersisted(o);
|
|
2598
2598
|
}
|
|
2599
2599
|
filterAllowedGlobals(e) {
|
|
2600
|
-
return Object.entries(e).reduce((t, [o, s]) => (this.allowedGlobalNames.has(o) ? t[o] = s :
|
|
2600
|
+
return Object.entries(e).reduce((t, [o, s]) => (this.allowedGlobalNames.has(o) ? t[o] = s : bs.warn(
|
|
2601
2601
|
`Attempted to set a global (${o}) that is not defined in initial globals or globalTypes`
|
|
2602
2602
|
), t), {});
|
|
2603
2603
|
}
|
|
@@ -2617,8 +2617,8 @@ var He = Lr;
|
|
|
2617
2617
|
|
|
2618
2618
|
// src/preview-api/modules/store/StoryIndexStore.ts
|
|
2619
2619
|
var uo = fe(Or(), 1);
|
|
2620
|
-
import { MissingStoryAfterHmrError as
|
|
2621
|
-
var
|
|
2620
|
+
import { MissingStoryAfterHmrError as Ss } from "storybook/internal/preview-errors";
|
|
2621
|
+
var Ts = (0, uo.default)(1)(
|
|
2622
2622
|
(r) => Object.values(r).reduce(
|
|
2623
2623
|
(e, t) => (e[t.importPath] = e[t.importPath] || t, e),
|
|
2624
2624
|
{}
|
|
@@ -2639,35 +2639,35 @@ var gs = (0, uo.default)(1)(
|
|
|
2639
2639
|
storyIdToEntry(e) {
|
|
2640
2640
|
let t = this.entries[e];
|
|
2641
2641
|
if (!t)
|
|
2642
|
-
throw new
|
|
2642
|
+
throw new Ss({ storyId: e });
|
|
2643
2643
|
return t;
|
|
2644
2644
|
}
|
|
2645
2645
|
importPathToEntry(e) {
|
|
2646
|
-
return
|
|
2646
|
+
return Ts(this.entries)[e];
|
|
2647
2647
|
}
|
|
2648
2648
|
};
|
|
2649
2649
|
n(_r, "StoryIndexStore");
|
|
2650
2650
|
var We = _r;
|
|
2651
2651
|
|
|
2652
2652
|
// src/preview-api/modules/store/csf/normalizeInputTypes.ts
|
|
2653
|
-
var
|
|
2654
|
-
g" ? { type: r } : r, "normalizeControl"),
|
|
2653
|
+
var xs = /* @__PURE__ */ n((r) => typeof r == "string" ? { name: r } : r, "normalizeType"), Rs = /* @__PURE__ */ n((r) => typeof r == "strin\
|
|
2654
|
+
g" ? { type: r } : r, "normalizeControl"), ws = /* @__PURE__ */ n((r, e) => {
|
|
2655
2655
|
let { type: t, control: o, ...s } = r, i = {
|
|
2656
2656
|
name: e,
|
|
2657
2657
|
...s
|
|
2658
2658
|
};
|
|
2659
|
-
return t && (i.type =
|
|
2660
|
-
}, "normalizeInputType"), se = /* @__PURE__ */ n((r) => V(r,
|
|
2659
|
+
return t && (i.type = xs(t)), o ? i.control = Rs(o) : o === !1 && (i.control = { disable: !0 }), i;
|
|
2660
|
+
}, "normalizeInputType"), se = /* @__PURE__ */ n((r) => V(r, ws), "normalizeInputTypes");
|
|
2661
2661
|
|
|
2662
2662
|
// src/preview-api/modules/store/csf/normalizeStory.ts
|
|
2663
|
-
import { deprecate as
|
|
2664
|
-
import { storyNameFromExport as
|
|
2663
|
+
import { deprecate as Es, logger as As } from "storybook/internal/client-logger";
|
|
2664
|
+
import { storyNameFromExport as Cs, toId as vs } from "storybook/internal/csf";
|
|
2665
2665
|
|
|
2666
2666
|
// src/preview-api/modules/store/csf/normalizeArrays.ts
|
|
2667
|
-
var
|
|
2667
|
+
var v = /* @__PURE__ */ n((r) => Array.isArray(r) ? r : r ? [r] : [], "normalizeArrays");
|
|
2668
2668
|
|
|
2669
2669
|
// src/preview-api/modules/store/csf/normalizeStory.ts
|
|
2670
|
-
var
|
|
2670
|
+
var Ps = P`
|
|
2671
2671
|
CSF .story annotations deprecated; annotate story functions directly:
|
|
2672
2672
|
- StoryFn.story.name => StoryFn.storyName
|
|
2673
2673
|
- StoryFn.story.(parameters|decorators) => StoryFn.(parameters|decorators)
|
|
@@ -2675,18 +2675,18 @@ See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#hoisted-csf-
|
|
|
2675
2675
|
`;
|
|
2676
2676
|
function he(r, e, t) {
|
|
2677
2677
|
let o = e, s = typeof e == "function" ? e : null, { story: i } = o;
|
|
2678
|
-
i && (
|
|
2679
|
-
let a =
|
|
2680
|
-
...
|
|
2681
|
-
...
|
|
2682
|
-
], d = { ...i?.parameters, ...o.parameters }, p = { ...i?.args, ...o.args }, u = { ...i?.argTypes, ...o.argTypes }, y = [...
|
|
2678
|
+
i && (As.debug("deprecated story", i), Es(Ps));
|
|
2679
|
+
let a = Cs(r), l = typeof o != "function" && o.name || o.storyName || i?.name || a, c = [
|
|
2680
|
+
...v(o.decorators),
|
|
2681
|
+
...v(i?.decorators)
|
|
2682
|
+
], d = { ...i?.parameters, ...o.parameters }, p = { ...i?.args, ...o.args }, u = { ...i?.argTypes, ...o.argTypes }, y = [...v(o.loaders), ...v(
|
|
2683
2683
|
i?.loaders)], g = [
|
|
2684
|
-
...
|
|
2685
|
-
...
|
|
2684
|
+
...v(o.beforeEach),
|
|
2685
|
+
...v(i?.beforeEach)
|
|
2686
2686
|
], S = [
|
|
2687
|
-
...
|
|
2688
|
-
...
|
|
2689
|
-
], { render: b, play: h, tags: T = [], globals: m = {} } = o, f = d.__id ||
|
|
2687
|
+
...v(o.experimental_afterEach),
|
|
2688
|
+
...v(i?.experimental_afterEach)
|
|
2689
|
+
], { render: b, play: h, tags: T = [], globals: m = {} } = o, f = d.__id || vs(t.id, a);
|
|
2690
2690
|
return {
|
|
2691
2691
|
moduleExport: e,
|
|
2692
2692
|
id: f,
|
|
@@ -2709,14 +2709,14 @@ n(he, "normalizeStory");
|
|
|
2709
2709
|
|
|
2710
2710
|
// src/preview-api/modules/store/csf/processCSFFile.ts
|
|
2711
2711
|
import { logger as yo } from "storybook/internal/client-logger";
|
|
2712
|
-
import { isExportStory as fo, isStory as
|
|
2712
|
+
import { isExportStory as fo, isStory as Is } from "storybook/internal/csf";
|
|
2713
2713
|
|
|
2714
2714
|
// src/preview-api/modules/store/csf/normalizeComponentAnnotations.ts
|
|
2715
|
-
import { sanitize as
|
|
2715
|
+
import { sanitize as Fs } from "storybook/internal/csf";
|
|
2716
2716
|
function Fe(r, e = r.title, t) {
|
|
2717
2717
|
let { id: o, argTypes: s } = r;
|
|
2718
2718
|
return {
|
|
2719
|
-
id:
|
|
2719
|
+
id: Fs(o || e),
|
|
2720
2720
|
...r,
|
|
2721
2721
|
title: e,
|
|
2722
2722
|
...s && { argTypes: se(s) },
|
|
@@ -2729,7 +2729,7 @@ function Fe(r, e = r.title, t) {
|
|
|
2729
2729
|
n(Fe, "normalizeComponentAnnotations");
|
|
2730
2730
|
|
|
2731
2731
|
// src/preview-api/modules/store/csf/processCSFFile.ts
|
|
2732
|
-
var
|
|
2732
|
+
var Os = /* @__PURE__ */ n((r) => {
|
|
2733
2733
|
let { globals: e, globalTypes: t } = r;
|
|
2734
2734
|
(e || t) && yo.error(
|
|
2735
2735
|
"Global args/argTypes can only be set globally",
|
|
@@ -2738,15 +2738,15 @@ var Ps = /* @__PURE__ */ n((r) => {
|
|
|
2738
2738
|
globalTypes: t
|
|
2739
2739
|
})
|
|
2740
2740
|
);
|
|
2741
|
-
}, "checkGlobals"),
|
|
2741
|
+
}, "checkGlobals"), Ds = /* @__PURE__ */ n((r) => {
|
|
2742
2742
|
let { options: e } = r;
|
|
2743
2743
|
e?.storySort && yo.error("The storySort option parameter can only be set globally");
|
|
2744
2744
|
}, "checkStorySort"), $e = /* @__PURE__ */ n((r) => {
|
|
2745
|
-
r && (
|
|
2745
|
+
r && (Os(r), Ds(r));
|
|
2746
2746
|
}, "checkDisallowedParameters");
|
|
2747
2747
|
function mo(r, e, t) {
|
|
2748
2748
|
let { default: o, __namedExportsOrder: s, ...i } = r, a = Object.values(i)[0];
|
|
2749
|
-
if (
|
|
2749
|
+
if (Is(a)) {
|
|
2750
2750
|
let d = Fe(a.meta.input, t, e);
|
|
2751
2751
|
$e(d.parameters);
|
|
2752
2752
|
let p = { meta: d, stories: {}, moduleExports: r };
|
|
@@ -2774,17 +2774,17 @@ function mo(r, e, t) {
|
|
|
2774
2774
|
n(mo, "processCSFFile");
|
|
2775
2775
|
|
|
2776
2776
|
// src/preview-api/modules/store/csf/prepareStory.ts
|
|
2777
|
-
import { combineTags as
|
|
2778
|
-
import { NoRenderFunctionError as
|
|
2779
|
-
import { global as
|
|
2780
|
-
import { global as
|
|
2777
|
+
import { combineTags as js, includeConditionalArg as Ms } from "storybook/internal/csf";
|
|
2778
|
+
import { NoRenderFunctionError as Ls } from "storybook/internal/preview-errors";
|
|
2779
|
+
import { global as _s } from "@storybook/global";
|
|
2780
|
+
import { global as Ns } from "@storybook/global";
|
|
2781
2781
|
|
|
2782
2782
|
// src/preview-api/modules/preview-web/render/mount-utils.ts
|
|
2783
2783
|
function go(r) {
|
|
2784
|
-
return r != null &&
|
|
2784
|
+
return r != null && ks(r).includes("mount");
|
|
2785
2785
|
}
|
|
2786
2786
|
n(go, "mountDestructured");
|
|
2787
|
-
function
|
|
2787
|
+
function ks(r) {
|
|
2788
2788
|
let e = r.toString().match(/[^(]*\(([^)]*)/);
|
|
2789
2789
|
if (!e)
|
|
2790
2790
|
return [];
|
|
@@ -2794,7 +2794,7 @@ function Is(r) {
|
|
|
2794
2794
|
let o = t[0];
|
|
2795
2795
|
return o.startsWith("{") && o.endsWith("}") ? ho(o.slice(1, -1).replace(/\s/g, "")).map((i) => i.replace(/:.*|=.*/g, "")) : [];
|
|
2796
2796
|
}
|
|
2797
|
-
n(
|
|
2797
|
+
n(ks, "getUsedProps");
|
|
2798
2798
|
function ho(r) {
|
|
2799
2799
|
let e = [], t = [], o = 0;
|
|
2800
2800
|
for (let i = 0; i < r.length; i++)
|
|
@@ -2832,7 +2832,7 @@ function So({
|
|
|
2832
2832
|
return d;
|
|
2833
2833
|
}
|
|
2834
2834
|
n(So, "sanitizeStoryContextUpdate");
|
|
2835
|
-
function
|
|
2835
|
+
function Nr(r, e) {
|
|
2836
2836
|
let t = {}, o = /* @__PURE__ */ n((i) => (a) => {
|
|
2837
2837
|
if (!t.value)
|
|
2838
2838
|
throw new Error("Decorated function called without init");
|
|
@@ -2846,17 +2846,17 @@ function qr(r, e) {
|
|
|
2846
2846
|
);
|
|
2847
2847
|
return (i) => (t.value = i, s(i));
|
|
2848
2848
|
}
|
|
2849
|
-
n(
|
|
2849
|
+
n(Nr, "defaultDecorateStory");
|
|
2850
2850
|
|
|
2851
2851
|
// src/preview-api/modules/store/parameters.ts
|
|
2852
|
-
var
|
|
2852
|
+
var _ = /* @__PURE__ */ n((...r) => {
|
|
2853
2853
|
let e = {}, t = r.filter(Boolean), o = t.reduce((s, i) => (Object.entries(i).forEach(([a, l]) => {
|
|
2854
2854
|
let c = s[a];
|
|
2855
2855
|
Array.isArray(l) || typeof c > "u" ? s[a] = l : k(l) && k(c) ? e[a] = !0 : typeof l < "u" && (s[a] = l);
|
|
2856
2856
|
}), s), {});
|
|
2857
2857
|
return Object.keys(e).forEach((s) => {
|
|
2858
2858
|
let i = t.filter(Boolean).map((a) => a[s]).filter((a) => typeof a < "u");
|
|
2859
|
-
i.every((a) => k(a)) ? o[s] =
|
|
2859
|
+
i.every((a) => k(a)) ? o[s] = _(...i) : o[s] = i[i.length - 1];
|
|
2860
2860
|
}), o;
|
|
2861
2861
|
}, "combineParameters");
|
|
2862
2862
|
|
|
@@ -2869,22 +2869,22 @@ function Ie(r, e, t) {
|
|
|
2869
2869
|
), l = /* @__PURE__ */ n(async (R) => {
|
|
2870
2870
|
let A = {};
|
|
2871
2871
|
for (let F of [
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2872
|
+
v(t.loaders),
|
|
2873
|
+
v(e.loaders),
|
|
2874
|
+
v(r.loaders)
|
|
2875
2875
|
]) {
|
|
2876
2876
|
if (R.abortSignal.aborted)
|
|
2877
2877
|
return A;
|
|
2878
|
-
let j = await Promise.all(F.map((
|
|
2878
|
+
let j = await Promise.all(F.map((N) => N(R)));
|
|
2879
2879
|
Object.assign(A, ...j);
|
|
2880
2880
|
}
|
|
2881
2881
|
return A;
|
|
2882
2882
|
}, "applyLoaders"), c = /* @__PURE__ */ n(async (R) => {
|
|
2883
2883
|
let A = new Array();
|
|
2884
2884
|
for (let F of [
|
|
2885
|
-
...
|
|
2886
|
-
...
|
|
2887
|
-
...
|
|
2885
|
+
...v(t.beforeEach),
|
|
2886
|
+
...v(e.beforeEach),
|
|
2887
|
+
...v(r.beforeEach)
|
|
2888
2888
|
]) {
|
|
2889
2889
|
if (R.abortSignal.aborted)
|
|
2890
2890
|
return A;
|
|
@@ -2894,24 +2894,24 @@ function Ie(r, e, t) {
|
|
|
2894
2894
|
return A;
|
|
2895
2895
|
}, "applyBeforeEach"), d = /* @__PURE__ */ n(async (R) => {
|
|
2896
2896
|
let A = [
|
|
2897
|
-
...
|
|
2898
|
-
...
|
|
2899
|
-
...
|
|
2897
|
+
...v(t.experimental_afterEach),
|
|
2898
|
+
...v(e.experimental_afterEach),
|
|
2899
|
+
...v(r.experimental_afterEach)
|
|
2900
2900
|
].reverse();
|
|
2901
2901
|
for (let F of A) {
|
|
2902
2902
|
if (R.abortSignal.aborted)
|
|
2903
2903
|
return;
|
|
2904
2904
|
await F(R);
|
|
2905
2905
|
}
|
|
2906
|
-
}, "applyAfterEach"), p = /* @__PURE__ */ n((R) => R.originalStoryFn(R.args, R), "undecoratedStoryFn"), { applyDecorators: u =
|
|
2906
|
+
}, "applyAfterEach"), p = /* @__PURE__ */ n((R) => R.originalStoryFn(R.args, R), "undecoratedStoryFn"), { applyDecorators: u = Nr, runStep: y } = t,
|
|
2907
2907
|
g = [
|
|
2908
|
-
...
|
|
2909
|
-
...
|
|
2910
|
-
...
|
|
2908
|
+
...v(r?.decorators),
|
|
2909
|
+
...v(e?.decorators),
|
|
2910
|
+
...v(t?.decorators)
|
|
2911
2911
|
], S = r?.userStoryFn || r?.render || e.render || t.render, b = xr(u)(p, g), h = /* @__PURE__ */ n((R) => b(R), "unboundStoryFn"), T = r?.
|
|
2912
2912
|
play ?? e?.play, m = go(T);
|
|
2913
2913
|
if (!S && !m)
|
|
2914
|
-
throw new
|
|
2914
|
+
throw new Ls({ id: s });
|
|
2915
2915
|
let f = /* @__PURE__ */ n((R) => async () => (await R.renderToCanvas(), R.canvas), "defaultMount"), x = r.mount ?? e.mount ?? t.mount ?? f,
|
|
2916
2916
|
E = t.testingLibraryRender;
|
|
2917
2917
|
return {
|
|
@@ -2936,25 +2936,25 @@ function Ie(r, e, t) {
|
|
|
2936
2936
|
};
|
|
2937
2937
|
}
|
|
2938
2938
|
n(Ie, "prepareStory");
|
|
2939
|
-
function
|
|
2939
|
+
function qr(r, e, t) {
|
|
2940
2940
|
return {
|
|
2941
2941
|
...To(void 0, r, e),
|
|
2942
2942
|
moduleExport: t
|
|
2943
2943
|
};
|
|
2944
2944
|
}
|
|
2945
|
-
n(
|
|
2945
|
+
n(qr, "prepareMeta");
|
|
2946
2946
|
function To(r, e, t) {
|
|
2947
|
-
let o = ["dev", "test"], s =
|
|
2947
|
+
let o = ["dev", "test"], s = Ns.DOCS_OPTIONS?.autodocs === !0 ? ["autodocs"] : [], i = js(
|
|
2948
2948
|
...o,
|
|
2949
2949
|
...s,
|
|
2950
2950
|
...t.tags ?? [],
|
|
2951
2951
|
...e.tags ?? [],
|
|
2952
2952
|
...r?.tags ?? []
|
|
2953
|
-
), a =
|
|
2953
|
+
), a = _(
|
|
2954
2954
|
t.parameters,
|
|
2955
2955
|
e.parameters,
|
|
2956
2956
|
r?.parameters
|
|
2957
|
-
), { argTypesEnhancers: l = [], argsEnhancers: c = [] } = t, d =
|
|
2957
|
+
), { argTypesEnhancers: l = [], argsEnhancers: c = [] } = t, d = _(
|
|
2958
2958
|
t.argTypes,
|
|
2959
2959
|
e.argTypes,
|
|
2960
2960
|
r?.argTypes
|
|
@@ -3013,7 +3013,7 @@ function Ye(r) {
|
|
|
3013
3013
|
allArgs: void 0,
|
|
3014
3014
|
argsByTarget: void 0
|
|
3015
3015
|
};
|
|
3016
|
-
if (
|
|
3016
|
+
if (_s.FEATURES?.argTypeTargetsV7) {
|
|
3017
3017
|
let i = co(r);
|
|
3018
3018
|
t = {
|
|
3019
3019
|
...r,
|
|
@@ -3032,14 +3032,14 @@ function Ye(r) {
|
|
|
3032
3032
|
return i[a] = Array.isArray(l) ? l.map(c) : c(l), i;
|
|
3033
3033
|
}, {}), s = Object.entries(o).reduce((i, [a, l]) => {
|
|
3034
3034
|
let c = t.argTypes[a] || {};
|
|
3035
|
-
return
|
|
3035
|
+
return Ms(c, o, t.globals) && (i[a] = l), i;
|
|
3036
3036
|
}, {});
|
|
3037
3037
|
return { ...t, unmappedArgs: e, args: s };
|
|
3038
3038
|
}
|
|
3039
3039
|
n(Ye, "prepareContext");
|
|
3040
3040
|
|
|
3041
3041
|
// src/preview-api/modules/store/inferArgTypes.ts
|
|
3042
|
-
import { logger as
|
|
3042
|
+
import { logger as qs } from "storybook/internal/client-logger";
|
|
3043
3043
|
var zr = /* @__PURE__ */ n((r, e, t) => {
|
|
3044
3044
|
let o = typeof r;
|
|
3045
3045
|
switch (o) {
|
|
@@ -3052,7 +3052,7 @@ var zr = /* @__PURE__ */ n((r, e, t) => {
|
|
|
3052
3052
|
default:
|
|
3053
3053
|
break;
|
|
3054
3054
|
}
|
|
3055
|
-
return r ? t.has(r) ? (
|
|
3055
|
+
return r ? t.has(r) ? (qs.warn(P`
|
|
3056
3056
|
We've detected a cycle in arg '${e}'. Args should be JSON-serializable.
|
|
3057
3057
|
|
|
3058
3058
|
Consider using the mapping feature or fully custom args:
|
|
@@ -3067,12 +3067,12 @@ var zr = /* @__PURE__ */ n((r, e, t) => {
|
|
|
3067
3067
|
})), i = V(t, (a, l) => ({
|
|
3068
3068
|
name: l
|
|
3069
3069
|
}));
|
|
3070
|
-
return
|
|
3070
|
+
return _(s, i, t);
|
|
3071
3071
|
}, "inferArgTypes");
|
|
3072
3072
|
Br.secondPass = !0;
|
|
3073
3073
|
|
|
3074
3074
|
// src/preview-api/modules/store/inferControls.ts
|
|
3075
|
-
import { logger as
|
|
3075
|
+
import { logger as zs } from "storybook/internal/client-logger";
|
|
3076
3076
|
|
|
3077
3077
|
// src/preview-api/modules/store/filterArgTypes.ts
|
|
3078
3078
|
var xo = /* @__PURE__ */ n((r, e) => Array.isArray(e) ? e.includes(r) : r.match(e), "matches"), Ke = /* @__PURE__ */ n((r, e, t) => !e && !t ?
|
|
@@ -3082,14 +3082,14 @@ r : r && Ar(r, (o, s) => {
|
|
|
3082
3082
|
}), "filterArgTypes");
|
|
3083
3083
|
|
|
3084
3084
|
// src/preview-api/modules/store/inferControls.ts
|
|
3085
|
-
var
|
|
3085
|
+
var Bs = /* @__PURE__ */ n((r, e, t) => {
|
|
3086
3086
|
let { type: o, options: s } = r;
|
|
3087
3087
|
if (o) {
|
|
3088
3088
|
if (t.color && t.color.test(e)) {
|
|
3089
3089
|
let i = o.name;
|
|
3090
3090
|
if (i === "string")
|
|
3091
3091
|
return { control: { type: "color" } };
|
|
3092
|
-
i !== "enum" &&
|
|
3092
|
+
i !== "enum" && zs.warn(
|
|
3093
3093
|
`Addon controls: Control of type color only supports string, received "${i}" instead`
|
|
3094
3094
|
);
|
|
3095
3095
|
}
|
|
@@ -3123,8 +3123,8 @@ var qs = /* @__PURE__ */ n((r, e, t) => {
|
|
|
3123
3123
|
} = r;
|
|
3124
3124
|
if (!t)
|
|
3125
3125
|
return e;
|
|
3126
|
-
let a = Ke(e, o, s), l = V(a, (c, d) => c?.type &&
|
|
3127
|
-
return
|
|
3126
|
+
let a = Ke(e, o, s), l = V(a, (c, d) => c?.type && Bs(c, d.toString(), i));
|
|
3127
|
+
return _(l, a);
|
|
3128
3128
|
}, "inferControls");
|
|
3129
3129
|
Oe.secondPass = !0;
|
|
3130
3130
|
|
|
@@ -3143,10 +3143,10 @@ function ge({
|
|
|
3143
3143
|
return {
|
|
3144
3144
|
...r && { argTypes: se(r) },
|
|
3145
3145
|
...e && { globalTypes: se(e) },
|
|
3146
|
-
decorators:
|
|
3147
|
-
loaders:
|
|
3148
|
-
beforeEach:
|
|
3149
|
-
experimental_afterEach:
|
|
3146
|
+
decorators: v(o),
|
|
3147
|
+
loaders: v(s),
|
|
3148
|
+
beforeEach: v(i),
|
|
3149
|
+
experimental_afterEach: v(a),
|
|
3150
3150
|
argTypesEnhancers: [
|
|
3151
3151
|
...t || [],
|
|
3152
3152
|
Br,
|
|
@@ -3174,7 +3174,7 @@ function ge({
|
|
|
3174
3174
|
n(ge, "normalizeProjectAnnotations");
|
|
3175
3175
|
|
|
3176
3176
|
// src/preview-api/modules/store/csf/composeConfigs.ts
|
|
3177
|
-
import { global as
|
|
3177
|
+
import { global as Gs } from "@storybook/global";
|
|
3178
3178
|
|
|
3179
3179
|
// src/preview-api/modules/store/csf/beforeAll.ts
|
|
3180
3180
|
var Ro = /* @__PURE__ */ n((r) => async () => {
|
|
@@ -3207,7 +3207,7 @@ function ke(r, e) {
|
|
|
3207
3207
|
n(ke, "getField");
|
|
3208
3208
|
function Y(r, e, t = {}) {
|
|
3209
3209
|
return ke(r, e).reduce((o, s) => {
|
|
3210
|
-
let i =
|
|
3210
|
+
let i = v(s);
|
|
3211
3211
|
return t.reverseFileOrder ? [...i, ...o] : [...o, ...i];
|
|
3212
3212
|
}, []);
|
|
3213
3213
|
}
|
|
@@ -3223,9 +3223,9 @@ n(De, "getSingletonField");
|
|
|
3223
3223
|
function K(r) {
|
|
3224
3224
|
let e = [oe(), ...r], t = Y(e, "argTypesEnhancers"), o = ke(e, "runStep"), s = Y(e, "beforeAll");
|
|
3225
3225
|
return {
|
|
3226
|
-
parameters:
|
|
3226
|
+
parameters: _(...ke(e, "parameters")),
|
|
3227
3227
|
decorators: Y(e, "decorators", {
|
|
3228
|
-
reverseFileOrder: !(
|
|
3228
|
+
reverseFileOrder: !(Gs.FEATURES?.legacyDecoratorFileOrder ?? !1)
|
|
3229
3229
|
}),
|
|
3230
3230
|
args: Xe(e, "args"),
|
|
3231
3231
|
argsEnhancers: Y(e, "argsEnhancers"),
|
|
@@ -3252,8 +3252,8 @@ function K(r) {
|
|
|
3252
3252
|
n(K, "composeConfigs");
|
|
3253
3253
|
|
|
3254
3254
|
// src/preview-api/modules/store/csf/portable-stories.ts
|
|
3255
|
-
import { isExportStory as
|
|
3256
|
-
import { MountMustBeDestructuredError as
|
|
3255
|
+
import { isExportStory as Vs } from "storybook/internal/csf";
|
|
3256
|
+
import { MountMustBeDestructuredError as Hs } from "storybook/internal/preview-errors";
|
|
3257
3257
|
|
|
3258
3258
|
// src/preview-api/modules/store/reporter-api.ts
|
|
3259
3259
|
var Ur = class Ur {
|
|
@@ -3268,9 +3268,9 @@ n(Ur, "ReporterAPI");
|
|
|
3268
3268
|
var ie = Ur;
|
|
3269
3269
|
|
|
3270
3270
|
// src/preview-api/modules/store/csf/csf-factory-utils.ts
|
|
3271
|
-
import { isStory as
|
|
3271
|
+
import { isStory as Us } from "storybook/internal/csf";
|
|
3272
3272
|
function Vr(r, e, t) {
|
|
3273
|
-
return
|
|
3273
|
+
return Us(r) ? {
|
|
3274
3274
|
story: r.input,
|
|
3275
3275
|
meta: r.meta.input,
|
|
3276
3276
|
preview: r.meta.preview.composed
|
|
@@ -3279,29 +3279,29 @@ function Vr(r, e, t) {
|
|
|
3279
3279
|
n(Vr, "getCsfFactoryAnnotations");
|
|
3280
3280
|
|
|
3281
3281
|
// src/preview-api/modules/store/csf/portable-stories.ts
|
|
3282
|
-
function
|
|
3282
|
+
function Ws(r) {
|
|
3283
3283
|
globalThis.defaultProjectAnnotations = r;
|
|
3284
3284
|
}
|
|
3285
|
-
n(
|
|
3286
|
-
var
|
|
3287
|
-
function
|
|
3285
|
+
n(Ws, "setDefaultProjectAnnotations");
|
|
3286
|
+
var $s = "ComposedStory", Ys = "Unnamed Story";
|
|
3287
|
+
function Ks(r) {
|
|
3288
3288
|
return r ? K([r]) : {};
|
|
3289
3289
|
}
|
|
3290
|
-
n(
|
|
3291
|
-
function
|
|
3290
|
+
n(Ks, "extractAnnotation");
|
|
3291
|
+
function Xs(r) {
|
|
3292
3292
|
let e = Array.isArray(r) ? r : [r];
|
|
3293
3293
|
return globalThis.globalProjectAnnotations = K([
|
|
3294
3294
|
globalThis.defaultProjectAnnotations ?? {},
|
|
3295
|
-
K(e.map(
|
|
3295
|
+
K(e.map(Ks))
|
|
3296
3296
|
]), globalThis.globalProjectAnnotations ?? {};
|
|
3297
3297
|
}
|
|
3298
|
-
n(
|
|
3298
|
+
n(Xs, "setProjectAnnotations");
|
|
3299
3299
|
var X = [];
|
|
3300
3300
|
function wo(r, e, t, o, s) {
|
|
3301
3301
|
if (r === void 0)
|
|
3302
3302
|
throw new Error("Expected a story but received undefined.");
|
|
3303
|
-
e.title = e.title ??
|
|
3304
|
-
let i = Fe(e), a = s || r.storyName || r.story?.name || r.name ||
|
|
3303
|
+
e.title = e.title ?? $s;
|
|
3304
|
+
let i = Fe(e), a = s || r.storyName || r.story?.name || r.name || Ys, l = he(
|
|
3305
3305
|
a,
|
|
3306
3306
|
r,
|
|
3307
3307
|
i
|
|
@@ -3367,7 +3367,7 @@ ${x.description}`);
|
|
|
3367
3367
|
return f.canvasElement ??= globalThis?.document?.body, g && (f.loaded = g.loaded), Object.assign(f, m), d.playFunction(f);
|
|
3368
3368
|
}, "play"), b = /* @__PURE__ */ n((m) => {
|
|
3369
3369
|
let f = y();
|
|
3370
|
-
return Object.assign(f, m),
|
|
3370
|
+
return Object.assign(f, m), ei(d, f);
|
|
3371
3371
|
}, "run"), h = d.playFunction ? S : void 0;
|
|
3372
3372
|
return Object.assign(
|
|
3373
3373
|
/* @__PURE__ */ n(function(f) {
|
|
@@ -3399,21 +3399,21 @@ ${x.description}`);
|
|
|
3399
3399
|
);
|
|
3400
3400
|
}
|
|
3401
3401
|
n(wo, "composeStory");
|
|
3402
|
-
var
|
|
3403
|
-
function
|
|
3402
|
+
var Js = /* @__PURE__ */ n((r, e, t, o) => wo(r, e, t, {}, o), "defaultComposeStory");
|
|
3403
|
+
function Qs(r, e, t = Js) {
|
|
3404
3404
|
let { default: o, __esModule: s, __namedExportsOrder: i, ...a } = r, l = o;
|
|
3405
3405
|
return Object.entries(a).reduce(
|
|
3406
3406
|
(d, [p, u]) => {
|
|
3407
3407
|
let { story: y, meta: g } = Vr(u);
|
|
3408
|
-
return !l && g && (l = g),
|
|
3408
|
+
return !l && g && (l = g), Vs(p, l) ? Object.assign(d, {
|
|
3409
3409
|
[p]: t(y, l, e, p)
|
|
3410
3410
|
}) : d;
|
|
3411
3411
|
},
|
|
3412
3412
|
{}
|
|
3413
3413
|
);
|
|
3414
3414
|
}
|
|
3415
|
-
n(
|
|
3416
|
-
function
|
|
3415
|
+
n(Qs, "composeStories");
|
|
3416
|
+
function Zs(r) {
|
|
3417
3417
|
return r.extend({
|
|
3418
3418
|
mount: /* @__PURE__ */ n(async ({ mount: e, page: t }, o) => {
|
|
3419
3419
|
await o(async (s, ...i) => {
|
|
@@ -3443,8 +3443,8 @@ function Xs(r) {
|
|
|
3443
3443
|
}, "mount")
|
|
3444
3444
|
});
|
|
3445
3445
|
}
|
|
3446
|
-
n(
|
|
3447
|
-
async function
|
|
3446
|
+
n(Zs, "createPlaywrightTest");
|
|
3447
|
+
async function ei(r, e) {
|
|
3448
3448
|
for (let s of [...X].reverse())
|
|
3449
3449
|
await s();
|
|
3450
3450
|
if (X.length = 0, !e.canvasElement) {
|
|
@@ -3458,13 +3458,13 @@ async function Js(r, e) {
|
|
|
3458
3458
|
X.push(...(await r.applyBeforeEach(e)).filter(Boolean));
|
|
3459
3459
|
let t = r.playFunction, o = r.usesMount;
|
|
3460
3460
|
o || await e.mount(), !e.abortSignal.aborted && (t && (o || (e.mount = async () => {
|
|
3461
|
-
throw new
|
|
3461
|
+
throw new Hs({ playFunction: t.toString() });
|
|
3462
3462
|
}), await t(e)), await r.applyAfterEach(e));
|
|
3463
3463
|
}
|
|
3464
|
-
n(
|
|
3464
|
+
n(ei, "runStory");
|
|
3465
3465
|
|
|
3466
3466
|
// src/preview-api/modules/store/StoryStore.ts
|
|
3467
|
-
var Eo = 1e3,
|
|
3467
|
+
var Eo = 1e3, oi = 1e4, Hr = class Hr {
|
|
3468
3468
|
constructor(e, t, o) {
|
|
3469
3469
|
this.importFn = t;
|
|
3470
3470
|
this.storyIndex = new We(e), this.projectAnnotations = ge(
|
|
@@ -3472,7 +3472,7 @@ var Eo = 1e3, ei = 1e4, Hr = class Hr {
|
|
|
3472
3472
|
);
|
|
3473
3473
|
let { initialGlobals: s, globalTypes: i } = this.projectAnnotations;
|
|
3474
3474
|
this.args = new Ve(), this.userGlobals = new He({ globals: s, globalTypes: i }), this.hooks = {}, this.cleanupCallbacks = {}, this.processCSFFileWithCache =
|
|
3475
|
-
(0, Je.default)(Eo)(mo), this.prepareMetaWithCache = (0, Je.default)(Eo)(
|
|
3475
|
+
(0, Je.default)(Eo)(mo), this.prepareMetaWithCache = (0, Je.default)(Eo)(qr), this.prepareStoryWithCache = (0, Je.default)(oi)(Ie);
|
|
3476
3476
|
}
|
|
3477
3477
|
setProjectAnnotations(e) {
|
|
3478
3478
|
this.projectAnnotations = ge(e);
|
|
@@ -3536,7 +3536,7 @@ var Eo = 1e3, ei = 1e4, Hr = class Hr {
|
|
|
3536
3536
|
}) {
|
|
3537
3537
|
let o = t.stories[e];
|
|
3538
3538
|
if (!o)
|
|
3539
|
-
throw new
|
|
3539
|
+
throw new ti({ storyId: e });
|
|
3540
3540
|
let s = t.meta, i = this.prepareStoryWithCache(
|
|
3541
3541
|
o,
|
|
3542
3542
|
s,
|
|
@@ -3592,7 +3592,7 @@ var Eo = 1e3, ei = 1e4, Hr = class Hr {
|
|
|
3592
3592
|
extract(e = { includeDocsOnly: !1 }) {
|
|
3593
3593
|
let { cachedCSFFiles: t } = this;
|
|
3594
3594
|
if (!t)
|
|
3595
|
-
throw new
|
|
3595
|
+
throw new ri();
|
|
3596
3596
|
return Object.entries(this.storyIndex.entries).reduce(
|
|
3597
3597
|
(o, [s, { type: i, importPath: a }]) => {
|
|
3598
3598
|
if (i === "docs")
|
|
@@ -3620,7 +3620,7 @@ n(Hr, "StoryStore");
|
|
|
3620
3620
|
var be = Hr;
|
|
3621
3621
|
|
|
3622
3622
|
// src/preview-api/modules/store/autoTitle.ts
|
|
3623
|
-
import { once as
|
|
3623
|
+
import { once as ni } from "storybook/internal/client-logger";
|
|
3624
3624
|
|
|
3625
3625
|
// ../node_modules/slash/index.js
|
|
3626
3626
|
function Wr(r) {
|
|
@@ -3629,7 +3629,7 @@ function Wr(r) {
|
|
|
3629
3629
|
n(Wr, "slash");
|
|
3630
3630
|
|
|
3631
3631
|
// src/preview-api/modules/store/autoTitle.ts
|
|
3632
|
-
var
|
|
3632
|
+
var si = /* @__PURE__ */ n((r) => {
|
|
3633
3633
|
if (r.length === 0)
|
|
3634
3634
|
return r;
|
|
3635
3635
|
let e = r[r.length - 1], t = e?.replace(/(?:[.](?:story|stories))?([.][^.]+)$/i, "");
|
|
@@ -3643,9 +3643,9 @@ function Ao(r) {
|
|
|
3643
3643
|
return r.flatMap((e) => e.split("/")).filter(Boolean).join("/");
|
|
3644
3644
|
}
|
|
3645
3645
|
n(Ao, "pathJoin");
|
|
3646
|
-
var
|
|
3646
|
+
var Co = /* @__PURE__ */ n((r, e, t) => {
|
|
3647
3647
|
let { directory: o, importPathMatcher: s, titlePrefix: i = "" } = e || {};
|
|
3648
|
-
typeof r == "number" &&
|
|
3648
|
+
typeof r == "number" && ni.warn(P`
|
|
3649
3649
|
CSF Auto-title received a numeric fileName. This typically happens when
|
|
3650
3650
|
webpack is mis-configured in production mode. To force webpack to produce
|
|
3651
3651
|
filenames, set optimization.moduleIds = "named" in your webpack config.
|
|
@@ -3654,13 +3654,13 @@ var vo = /* @__PURE__ */ n((r, e, t) => {
|
|
|
3654
3654
|
if (s.exec(a)) {
|
|
3655
3655
|
if (!t) {
|
|
3656
3656
|
let l = a.replace(o, ""), c = Ao([i, l]).split("/");
|
|
3657
|
-
return c =
|
|
3657
|
+
return c = si(c), c.join("/");
|
|
3658
3658
|
}
|
|
3659
3659
|
return i ? Ao([i, t]) : t;
|
|
3660
3660
|
}
|
|
3661
|
-
}, "userOrAutoTitleFromSpecifier"),
|
|
3661
|
+
}, "userOrAutoTitleFromSpecifier"), ii = /* @__PURE__ */ n((r, e, t) => {
|
|
3662
3662
|
for (let o = 0; o < e.length; o += 1) {
|
|
3663
|
-
let s =
|
|
3663
|
+
let s = Co(r, e[o], t);
|
|
3664
3664
|
if (s)
|
|
3665
3665
|
return s;
|
|
3666
3666
|
}
|
|
@@ -3668,10 +3668,10 @@ var vo = /* @__PURE__ */ n((r, e, t) => {
|
|
|
3668
3668
|
}, "userOrAutoTitle");
|
|
3669
3669
|
|
|
3670
3670
|
// src/preview-api/modules/store/storySort.ts
|
|
3671
|
-
var
|
|
3671
|
+
var vo = /\s*\/\s*/, Po = /* @__PURE__ */ n((r = {}) => (e, t) => {
|
|
3672
3672
|
if (e.title === t.title && !r.includeNames)
|
|
3673
3673
|
return 0;
|
|
3674
|
-
let o = r.method || "configure", s = r.order || [], i = e.title.trim().split(
|
|
3674
|
+
let o = r.method || "configure", s = r.order || [], i = e.title.trim().split(vo), a = t.title.trim().split(vo);
|
|
3675
3675
|
r.includeNames && (i.push(e.name), a.push(t.name));
|
|
3676
3676
|
let l = 0;
|
|
3677
3677
|
for (; i[l] || a[l]; ) {
|
|
@@ -3695,7 +3695,7 @@ var Co = /\s*\/\s*/, Po = /* @__PURE__ */ n((r = {}) => (e, t) => {
|
|
|
3695
3695
|
}, "storySort");
|
|
3696
3696
|
|
|
3697
3697
|
// src/preview-api/modules/store/sortStories.ts
|
|
3698
|
-
var
|
|
3698
|
+
var ai = /* @__PURE__ */ n((r, e, t) => {
|
|
3699
3699
|
if (e) {
|
|
3700
3700
|
let o;
|
|
3701
3701
|
typeof e == "function" ? o = e : o = Po(e), r.sort(o);
|
|
@@ -3704,9 +3704,9 @@ var ni = /* @__PURE__ */ n((r, e, t) => {
|
|
|
3704
3704
|
(o, s) => t.indexOf(o.importPath) - t.indexOf(s.importPath)
|
|
3705
3705
|
);
|
|
3706
3706
|
return r;
|
|
3707
|
-
}, "sortStoriesCommon"),
|
|
3707
|
+
}, "sortStoriesCommon"), li = /* @__PURE__ */ n((r, e, t) => {
|
|
3708
3708
|
try {
|
|
3709
|
-
return
|
|
3709
|
+
return ai(r, e, t);
|
|
3710
3710
|
} catch (o) {
|
|
3711
3711
|
throw new Error(P`
|
|
3712
3712
|
Error sorting stories with sort parameter ${e}:
|
|
@@ -3721,40 +3721,40 @@ var ni = /* @__PURE__ */ n((r, e, t) => {
|
|
|
3721
3721
|
}, "sortStoriesV7");
|
|
3722
3722
|
|
|
3723
3723
|
// src/preview-api/modules/preview-web/Preview.tsx
|
|
3724
|
-
import { deprecate as
|
|
3724
|
+
import { deprecate as yi, logger as ko } from "storybook/internal/client-logger";
|
|
3725
3725
|
import {
|
|
3726
|
-
ARGTYPES_INFO_REQUEST as
|
|
3726
|
+
ARGTYPES_INFO_REQUEST as mi,
|
|
3727
3727
|
ARGTYPES_INFO_RESPONSE as jo,
|
|
3728
|
-
CONFIG_ERROR as
|
|
3729
|
-
FORCE_REMOUNT as
|
|
3730
|
-
FORCE_RE_RENDER as
|
|
3728
|
+
CONFIG_ERROR as hi,
|
|
3729
|
+
FORCE_REMOUNT as gi,
|
|
3730
|
+
FORCE_RE_RENDER as bi,
|
|
3731
3731
|
GLOBALS_UPDATED as Mo,
|
|
3732
|
-
RESET_STORY_ARGS as
|
|
3733
|
-
SET_GLOBALS as
|
|
3734
|
-
STORY_ARGS_UPDATED as
|
|
3735
|
-
STORY_INDEX_INVALIDATED as
|
|
3736
|
-
UPDATE_GLOBALS as
|
|
3737
|
-
UPDATE_STORY_ARGS as
|
|
3732
|
+
RESET_STORY_ARGS as Si,
|
|
3733
|
+
SET_GLOBALS as Ti,
|
|
3734
|
+
STORY_ARGS_UPDATED as xi,
|
|
3735
|
+
STORY_INDEX_INVALIDATED as Ri,
|
|
3736
|
+
UPDATE_GLOBALS as wi,
|
|
3737
|
+
UPDATE_STORY_ARGS as Ei
|
|
3738
3738
|
} from "storybook/internal/core-events";
|
|
3739
3739
|
import {
|
|
3740
3740
|
CalledPreviewMethodBeforeInitializationError as W,
|
|
3741
|
-
MissingRenderToCanvasError as
|
|
3742
|
-
StoryIndexFetchError as
|
|
3743
|
-
StoryStoreAccessedBeforeInitializationError as
|
|
3741
|
+
MissingRenderToCanvasError as Ai,
|
|
3742
|
+
StoryIndexFetchError as Ci,
|
|
3743
|
+
StoryStoreAccessedBeforeInitializationError as vi
|
|
3744
3744
|
} from "storybook/internal/preview-errors";
|
|
3745
|
-
import { global as
|
|
3745
|
+
import { global as Pi } from "@storybook/global";
|
|
3746
3746
|
|
|
3747
3747
|
// src/preview-api/modules/preview-web/render/StoryRender.ts
|
|
3748
3748
|
import {
|
|
3749
|
-
PLAY_FUNCTION_THREW_EXCEPTION as
|
|
3749
|
+
PLAY_FUNCTION_THREW_EXCEPTION as ci,
|
|
3750
3750
|
STORY_FINISHED as Fo,
|
|
3751
|
-
STORY_RENDERED as
|
|
3751
|
+
STORY_RENDERED as di,
|
|
3752
3752
|
STORY_RENDER_PHASE_CHANGED as Io,
|
|
3753
|
-
UNHANDLED_ERRORS_WHILE_PLAYING as
|
|
3753
|
+
UNHANDLED_ERRORS_WHILE_PLAYING as pi
|
|
3754
3754
|
} from "storybook/internal/core-events";
|
|
3755
3755
|
import {
|
|
3756
|
-
MountMustBeDestructuredError as
|
|
3757
|
-
NoStoryMountedError as
|
|
3756
|
+
MountMustBeDestructuredError as ui,
|
|
3757
|
+
NoStoryMountedError as fi
|
|
3758
3758
|
} from "storybook/internal/preview-errors";
|
|
3759
3759
|
|
|
3760
3760
|
// src/preview-api/modules/preview-web/render/Render.ts
|
|
@@ -3854,13 +3854,13 @@ var $r = class $r {
|
|
|
3854
3854
|
abortSignal: h,
|
|
3855
3855
|
canvasElement: o,
|
|
3856
3856
|
loaded: {},
|
|
3857
|
-
step: /* @__PURE__ */ n((
|
|
3857
|
+
step: /* @__PURE__ */ n((C, z) => b(C, z, f), "step"),
|
|
3858
3858
|
context: null,
|
|
3859
3859
|
canvas: {},
|
|
3860
3860
|
userEvent: {},
|
|
3861
3861
|
renderToCanvas: /* @__PURE__ */ n(async () => {
|
|
3862
|
-
let
|
|
3863
|
-
this.teardownRender =
|
|
3862
|
+
let C = await this.renderToScreen(x, o);
|
|
3863
|
+
this.teardownRender = C || (() => {
|
|
3864
3864
|
}), T = !0;
|
|
3865
3865
|
}, "renderToCanvas"),
|
|
3866
3866
|
// The story provides (set in a renderer) a mount function that is a higher order function
|
|
@@ -3868,12 +3868,12 @@ var $r = class $r {
|
|
|
3868
3868
|
//
|
|
3869
3869
|
// Before assigning it to the context, we resolve the context dependency,
|
|
3870
3870
|
// so that a user can just call it as await mount(...args) in their play function.
|
|
3871
|
-
mount: /* @__PURE__ */ n(async (...
|
|
3871
|
+
mount: /* @__PURE__ */ n(async (...C) => {
|
|
3872
3872
|
this.callbacks.showStoryDuringRender?.();
|
|
3873
|
-
let
|
|
3873
|
+
let z = null;
|
|
3874
3874
|
return await this.runPhase(h, "rendering", async () => {
|
|
3875
|
-
|
|
3876
|
-
}), m && await this.runPhase(h, "playing"),
|
|
3875
|
+
z = await s.mount(f)(...C);
|
|
3876
|
+
}), m && await this.runPhase(h, "playing"), z;
|
|
3877
3877
|
}, "mount")
|
|
3878
3878
|
};
|
|
3879
3879
|
f.context = f;
|
|
@@ -3886,8 +3886,8 @@ var $r = class $r {
|
|
|
3886
3886
|
story: c,
|
|
3887
3887
|
tags: d,
|
|
3888
3888
|
...this.callbacks,
|
|
3889
|
-
showError: /* @__PURE__ */ n((
|
|
3890
|
-
showException: /* @__PURE__ */ n((
|
|
3889
|
+
showError: /* @__PURE__ */ n((C) => (this.phase = "errored", this.callbacks.showError(C)), "showError"),
|
|
3890
|
+
showException: /* @__PURE__ */ n((C) => (this.phase = "errored", this.callbacks.showException(C)), "showException"),
|
|
3891
3891
|
forceRemount: t || this.notYetRendered,
|
|
3892
3892
|
storyContext: f,
|
|
3893
3893
|
storyFn: /* @__PURE__ */ n(() => g(f), "storyFn"),
|
|
@@ -3900,25 +3900,25 @@ var $r = class $r {
|
|
|
3900
3900
|
let E = await u(f);
|
|
3901
3901
|
if (this.store.addCleanupCallbacks(s, E), this.checkIfAborted(h) || (!T && !m && await f.mount(), this.notYetRendered = !1, h.aborted))
|
|
3902
3902
|
return;
|
|
3903
|
-
let R = this.story.parameters?.test?.dangerouslyIgnoreUnhandledErrors === !0, A = /* @__PURE__ */ new Set(), F = /* @__PURE__ */ n((
|
|
3904
|
-
add("error" in
|
|
3903
|
+
let R = this.story.parameters?.test?.dangerouslyIgnoreUnhandledErrors === !0, A = /* @__PURE__ */ new Set(), F = /* @__PURE__ */ n((C) => A.
|
|
3904
|
+
add("error" in C ? C.error : C.reason), "onError");
|
|
3905
3905
|
if (this.renderOptions.autoplay && t && S && this.phase !== "errored") {
|
|
3906
3906
|
window.addEventListener("error", F), window.addEventListener("unhandledrejection", F), this.disableKeyListeners = !0;
|
|
3907
3907
|
try {
|
|
3908
3908
|
if (m ? await S(f) : (f.mount = async () => {
|
|
3909
|
-
throw new
|
|
3909
|
+
throw new ui({ playFunction: S.toString() });
|
|
3910
3910
|
}, await this.runPhase(h, "playing", async () => S(f))), !T)
|
|
3911
|
-
throw new
|
|
3911
|
+
throw new fi();
|
|
3912
3912
|
this.checkIfAborted(h), !R && A.size > 0 ? await this.runPhase(h, "errored") : await this.runPhase(h, "played");
|
|
3913
|
-
} catch (
|
|
3913
|
+
} catch (C) {
|
|
3914
3914
|
if (this.callbacks.showStoryDuringRender?.(), await this.runPhase(h, "errored", async () => {
|
|
3915
|
-
this.channel.emit(
|
|
3915
|
+
this.channel.emit(ci, Do(C));
|
|
3916
3916
|
}), this.story.parameters.throwPlayFunctionExceptions !== !1)
|
|
3917
|
-
throw
|
|
3918
|
-
console.error(
|
|
3917
|
+
throw C;
|
|
3918
|
+
console.error(C);
|
|
3919
3919
|
}
|
|
3920
3920
|
if (!R && A.size > 0 && this.channel.emit(
|
|
3921
|
-
|
|
3921
|
+
pi,
|
|
3922
3922
|
Array.from(A).map(Do)
|
|
3923
3923
|
), this.disableKeyListeners = !1, window.removeEventListener("unhandledrejection", F), window.removeEventListener("error", F), h.aborted)
|
|
3924
3924
|
return;
|
|
@@ -3926,13 +3926,13 @@ var $r = class $r {
|
|
|
3926
3926
|
await this.runPhase(
|
|
3927
3927
|
h,
|
|
3928
3928
|
"completed",
|
|
3929
|
-
async () => this.channel.emit(
|
|
3929
|
+
async () => this.channel.emit(di, i)
|
|
3930
3930
|
), this.phase !== "errored" && await this.runPhase(h, "afterEach", async () => {
|
|
3931
3931
|
await y(f);
|
|
3932
3932
|
});
|
|
3933
|
-
let j = !R && A.size > 0,
|
|
3934
|
-
(
|
|
3935
|
-
), ue = j ||
|
|
3933
|
+
let j = !R && A.size > 0, N = f.reporting.reports.some(
|
|
3934
|
+
(C) => C.status === "failed"
|
|
3935
|
+
), ue = j || N;
|
|
3936
3936
|
await this.runPhase(
|
|
3937
3937
|
h,
|
|
3938
3938
|
"finished",
|
|
@@ -3995,8 +3995,8 @@ n($r, "StoryRender");
|
|
|
3995
3995
|
var ae = $r;
|
|
3996
3996
|
|
|
3997
3997
|
// src/preview-api/modules/preview-web/Preview.tsx
|
|
3998
|
-
var { fetch:
|
|
3999
|
-
constructor(e, t, o =
|
|
3998
|
+
var { fetch: Fi } = Pi, Ii = "./index.json", Yr = class Yr {
|
|
3999
|
+
constructor(e, t, o = L.getChannel(), s = !0) {
|
|
4000
4000
|
this.importFn = e;
|
|
4001
4001
|
this.getProjectAnnotations = t;
|
|
4002
4002
|
this.channel = o;
|
|
@@ -4016,8 +4016,8 @@ var { fetch: vi } = Ai, Ci = "./index.json", Yr = class Yr {
|
|
|
4016
4016
|
{
|
|
4017
4017
|
get: /* @__PURE__ */ n((e, t) => {
|
|
4018
4018
|
if (this.storyStoreValue)
|
|
4019
|
-
return
|
|
4020
|
-
throw new
|
|
4019
|
+
return yi("Accessing the Story Store is deprecated and will be removed in 9.0"), this.storyStoreValue[t];
|
|
4020
|
+
throw new vi();
|
|
4021
4021
|
}, "get")
|
|
4022
4022
|
}
|
|
4023
4023
|
);
|
|
@@ -4036,15 +4036,15 @@ var { fetch: vi } = Ai, Ci = "./index.json", Yr = class Yr {
|
|
|
4036
4036
|
return this.storeInitializationPromise;
|
|
4037
4037
|
}
|
|
4038
4038
|
setupListeners() {
|
|
4039
|
-
this.channel.on(
|
|
4040
|
-
onUpdateArgs.bind(this)), this.channel.on(
|
|
4041
|
-
channel.on(
|
|
4039
|
+
this.channel.on(Ri, this.onStoryIndexChanged.bind(this)), this.channel.on(wi, this.onUpdateGlobals.bind(this)), this.channel.on(Ei, this.
|
|
4040
|
+
onUpdateArgs.bind(this)), this.channel.on(mi, this.onRequestArgTypesInfo.bind(this)), this.channel.on(Si, this.onResetArgs.bind(this)), this.
|
|
4041
|
+
channel.on(bi, this.onForceReRender.bind(this)), this.channel.on(gi, this.onForceRemount.bind(this));
|
|
4042
4042
|
}
|
|
4043
4043
|
async getProjectAnnotationsOrRenderError() {
|
|
4044
4044
|
try {
|
|
4045
4045
|
let e = await this.getProjectAnnotations();
|
|
4046
4046
|
if (this.renderToCanvas = e.renderToCanvas, !this.renderToCanvas)
|
|
4047
|
-
throw new
|
|
4047
|
+
throw new Ai();
|
|
4048
4048
|
return e;
|
|
4049
4049
|
} catch (e) {
|
|
4050
4050
|
throw this.renderPreviewEntryError("Error reading preview.js:", e), e;
|
|
@@ -4068,10 +4068,10 @@ var { fetch: vi } = Ai, Ci = "./index.json", Yr = class Yr {
|
|
|
4068
4068
|
}
|
|
4069
4069
|
}
|
|
4070
4070
|
async getStoryIndexFromServer() {
|
|
4071
|
-
let e = await
|
|
4071
|
+
let e = await Fi(Ii);
|
|
4072
4072
|
if (e.status === 200)
|
|
4073
4073
|
return e.json();
|
|
4074
|
-
throw new
|
|
4074
|
+
throw new Ci({ text: await e.text() });
|
|
4075
4075
|
}
|
|
4076
4076
|
// If initialization gets as far as the story index, this function runs.
|
|
4077
4077
|
initializeWithStoryIndex(e) {
|
|
@@ -4093,7 +4093,7 @@ var { fetch: vi } = Ai, Ci = "./index.json", Yr = class Yr {
|
|
|
4093
4093
|
globals: this.storyStoreValue.userGlobals.get() || {},
|
|
4094
4094
|
globalTypes: this.storyStoreValue.projectAnnotations.globalTypes || {}
|
|
4095
4095
|
};
|
|
4096
|
-
this.channel.emit(
|
|
4096
|
+
this.channel.emit(Ti, e);
|
|
4097
4097
|
}
|
|
4098
4098
|
// EVENT HANDLERS
|
|
4099
4099
|
// This happens when a config file gets reloaded
|
|
@@ -4166,7 +4166,7 @@ var { fetch: vi } = Ai, Ci = "./index.json", Yr = class Yr {
|
|
|
4166
4166
|
o.story && o.story.usesMount ? o.remount() : o.rerender()
|
|
4167
4167
|
)
|
|
4168
4168
|
)
|
|
4169
|
-
), this.channel.emit(
|
|
4169
|
+
), this.channel.emit(xi, {
|
|
4170
4170
|
storyId: e,
|
|
4171
4171
|
args: this.storyStoreValue.args.get(e)
|
|
4172
4172
|
});
|
|
@@ -4255,46 +4255,46 @@ var { fetch: vi } = Ai, Ci = "./index.json", Yr = class Yr {
|
|
|
4255
4255
|
}
|
|
4256
4256
|
// UTILITIES
|
|
4257
4257
|
renderPreviewEntryError(e, t) {
|
|
4258
|
-
this.previewEntryError = t, ko.error(e), ko.error(t), this.channel.emit(
|
|
4258
|
+
this.previewEntryError = t, ko.error(e), ko.error(t), this.channel.emit(hi, t);
|
|
4259
4259
|
}
|
|
4260
4260
|
};
|
|
4261
4261
|
n(Yr, "Preview");
|
|
4262
4262
|
var Se = Yr;
|
|
4263
4263
|
|
|
4264
4264
|
// src/preview-api/modules/preview-web/PreviewWeb.tsx
|
|
4265
|
-
import { global as
|
|
4265
|
+
import { global as hl } from "@storybook/global";
|
|
4266
4266
|
|
|
4267
4267
|
// src/preview-api/modules/preview-web/PreviewWithSelection.tsx
|
|
4268
4268
|
import { logger as Ze } from "storybook/internal/client-logger";
|
|
4269
4269
|
import {
|
|
4270
4270
|
CURRENT_STORY_WAS_SET as Lo,
|
|
4271
|
-
DOCS_PREPARED as
|
|
4271
|
+
DOCS_PREPARED as Mi,
|
|
4272
4272
|
GLOBALS_UPDATED as _o,
|
|
4273
|
-
PRELOAD_ENTRIES as
|
|
4274
|
-
PREVIEW_KEYDOWN as
|
|
4275
|
-
SET_CURRENT_STORY as
|
|
4276
|
-
STORY_CHANGED as
|
|
4277
|
-
STORY_ERRORED as
|
|
4278
|
-
STORY_MISSING as
|
|
4279
|
-
STORY_PREPARED as
|
|
4280
|
-
STORY_RENDER_PHASE_CHANGED as
|
|
4281
|
-
STORY_SPECIFIED as
|
|
4282
|
-
STORY_THREW_EXCEPTION as
|
|
4283
|
-
STORY_UNCHANGED as
|
|
4284
|
-
UPDATE_QUERY_PARAMS as
|
|
4273
|
+
PRELOAD_ENTRIES as Li,
|
|
4274
|
+
PREVIEW_KEYDOWN as _i,
|
|
4275
|
+
SET_CURRENT_STORY as Ni,
|
|
4276
|
+
STORY_CHANGED as qi,
|
|
4277
|
+
STORY_ERRORED as zi,
|
|
4278
|
+
STORY_MISSING as No,
|
|
4279
|
+
STORY_PREPARED as Bi,
|
|
4280
|
+
STORY_RENDER_PHASE_CHANGED as qo,
|
|
4281
|
+
STORY_SPECIFIED as Gi,
|
|
4282
|
+
STORY_THREW_EXCEPTION as Ui,
|
|
4283
|
+
STORY_UNCHANGED as Vi,
|
|
4284
|
+
UPDATE_QUERY_PARAMS as Hi
|
|
4285
4285
|
} from "storybook/internal/core-events";
|
|
4286
4286
|
import {
|
|
4287
4287
|
CalledPreviewMethodBeforeInitializationError as Zr,
|
|
4288
|
-
EmptyIndexError as
|
|
4289
|
-
MdxFileWithNoCsfReferencesError as
|
|
4290
|
-
NoStoryMatchError as
|
|
4288
|
+
EmptyIndexError as Wi,
|
|
4289
|
+
MdxFileWithNoCsfReferencesError as $i,
|
|
4290
|
+
NoStoryMatchError as Yi
|
|
4291
4291
|
} from "storybook/internal/preview-errors";
|
|
4292
4292
|
|
|
4293
4293
|
// ../node_modules/tiny-invariant/dist/esm/tiny-invariant.js
|
|
4294
|
-
var
|
|
4294
|
+
var Oi = !1, Kr = "Invariant failed";
|
|
4295
4295
|
function Qe(r, e) {
|
|
4296
4296
|
if (!r) {
|
|
4297
|
-
if (
|
|
4297
|
+
if (Oi)
|
|
4298
4298
|
throw new Error(Kr);
|
|
4299
4299
|
var t = typeof e == "function" ? e() : e, o = t ? "".concat(Kr, ": ").concat(t) : Kr;
|
|
4300
4300
|
throw new Error(o);
|
|
@@ -4303,10 +4303,10 @@ function Qe(r, e) {
|
|
|
4303
4303
|
n(Qe, "invariant");
|
|
4304
4304
|
|
|
4305
4305
|
// src/preview-api/modules/preview-web/render/CsfDocsRender.ts
|
|
4306
|
-
import { DOCS_RENDERED as
|
|
4306
|
+
import { DOCS_RENDERED as ki } from "storybook/internal/core-events";
|
|
4307
4307
|
|
|
4308
4308
|
// src/preview-api/modules/preview-web/docs-context/DocsContext.ts
|
|
4309
|
-
import { isStory as
|
|
4309
|
+
import { isStory as Di } from "storybook/internal/csf";
|
|
4310
4310
|
var Xr = class Xr {
|
|
4311
4311
|
constructor(e, t, o, s) {
|
|
4312
4312
|
this.channel = e;
|
|
@@ -4407,7 +4407,7 @@ CSF file?"
|
|
|
4407
4407
|
if (t)
|
|
4408
4408
|
return { type: "meta", csfFile: t };
|
|
4409
4409
|
let o = this.exportToStory.get(
|
|
4410
|
-
|
|
4410
|
+
Di(e) ? e.input : e
|
|
4411
4411
|
);
|
|
4412
4412
|
return o ? { type: "story", story: o } : { type: "component", component: e };
|
|
4413
4413
|
}
|
|
@@ -4501,7 +4501,7 @@ var Jr = class Jr {
|
|
|
4501
4501
|
);
|
|
4502
4502
|
let i = await s.renderer(), { render: a } = i, l = /* @__PURE__ */ n(async () => {
|
|
4503
4503
|
try {
|
|
4504
|
-
await a(o, s, e), this.channel.emit(
|
|
4504
|
+
await a(o, s, e), this.channel.emit(ki, this.id);
|
|
4505
4505
|
} catch (c) {
|
|
4506
4506
|
this.callbacks.showException(c);
|
|
4507
4507
|
}
|
|
@@ -4518,7 +4518,7 @@ n(Jr, "CsfDocsRender");
|
|
|
4518
4518
|
var je = Jr;
|
|
4519
4519
|
|
|
4520
4520
|
// src/preview-api/modules/preview-web/render/MdxDocsRender.ts
|
|
4521
|
-
import { DOCS_RENDERED as
|
|
4521
|
+
import { DOCS_RENDERED as ji } from "storybook/internal/core-events";
|
|
4522
4522
|
var Qr = class Qr {
|
|
4523
4523
|
constructor(e, t, o, s) {
|
|
4524
4524
|
this.channel = e;
|
|
@@ -4565,7 +4565,7 @@ var Qr = class Qr {
|
|
|
4565
4565
|
);
|
|
4566
4566
|
let i = { ...s, page: this.exports.default }, a = await s.renderer(), { render: l } = a, c = /* @__PURE__ */ n(async () => {
|
|
4567
4567
|
try {
|
|
4568
|
-
await l(o, i, e), this.channel.emit(
|
|
4568
|
+
await l(o, i, e), this.channel.emit(ji, this.id);
|
|
4569
4569
|
} catch (d) {
|
|
4570
4570
|
this.callbacks.showException(d);
|
|
4571
4571
|
}
|
|
@@ -4582,29 +4582,29 @@ n(Qr, "MdxDocsRender");
|
|
|
4582
4582
|
var Me = Qr;
|
|
4583
4583
|
|
|
4584
4584
|
// src/preview-api/modules/preview-web/PreviewWithSelection.tsx
|
|
4585
|
-
var
|
|
4586
|
-
function
|
|
4585
|
+
var Ki = globalThis;
|
|
4586
|
+
function Xi(r) {
|
|
4587
4587
|
let e = r.composedPath && r.composedPath()[0] || r.target;
|
|
4588
4588
|
return /input|textarea/i.test(e.tagName) || e.getAttribute("contenteditable") !== null;
|
|
4589
4589
|
}
|
|
4590
|
-
n(
|
|
4591
|
-
var zo = "attached-mdx",
|
|
4592
|
-
function
|
|
4593
|
-
return r?.includes(
|
|
4590
|
+
n(Xi, "focusInInput");
|
|
4591
|
+
var zo = "attached-mdx", Ji = "unattached-mdx";
|
|
4592
|
+
function Qi({ tags: r }) {
|
|
4593
|
+
return r?.includes(Ji) || r?.includes(zo);
|
|
4594
4594
|
}
|
|
4595
|
-
n(
|
|
4595
|
+
n(Qi, "isMdxEntry");
|
|
4596
4596
|
function et(r) {
|
|
4597
4597
|
return r.type === "story";
|
|
4598
4598
|
}
|
|
4599
4599
|
n(et, "isStoryRender");
|
|
4600
|
-
function
|
|
4600
|
+
function Zi(r) {
|
|
4601
4601
|
return r.type === "docs";
|
|
4602
4602
|
}
|
|
4603
|
-
n(
|
|
4604
|
-
function
|
|
4605
|
-
return
|
|
4603
|
+
n(Zi, "isDocsRender");
|
|
4604
|
+
function ea(r) {
|
|
4605
|
+
return Zi(r) && r.subtype === "csf";
|
|
4606
4606
|
}
|
|
4607
|
-
n(
|
|
4607
|
+
n(ea, "isCsfDocsRender");
|
|
4608
4608
|
var rt = class rt extends Se {
|
|
4609
4609
|
constructor(t, o, s, i) {
|
|
4610
4610
|
super(t, o, void 0, !1);
|
|
@@ -4615,8 +4615,8 @@ var rt = class rt extends Se {
|
|
|
4615
4615
|
this.initialize();
|
|
4616
4616
|
}
|
|
4617
4617
|
setupListeners() {
|
|
4618
|
-
super.setupListeners(),
|
|
4619
|
-
|
|
4618
|
+
super.setupListeners(), Ki.onkeydown = this.onKeydown.bind(this), this.channel.on(Ni, this.onSetCurrentStory.bind(this)), this.channel.on(
|
|
4619
|
+
Hi, this.onUpdateQueryParams.bind(this)), this.channel.on(Li, this.onPreloadStories.bind(this));
|
|
4620
4620
|
}
|
|
4621
4621
|
async setInitialGlobals() {
|
|
4622
4622
|
if (!this.storyStoreValue)
|
|
@@ -4644,14 +4644,14 @@ var rt = class rt extends Se {
|
|
|
4644
4644
|
}
|
|
4645
4645
|
let { storySpecifier: t, args: o } = this.selectionStore.selectionSpecifier, s = this.storyStoreValue.storyIndex.entryFromSpecifier(t);
|
|
4646
4646
|
if (!s) {
|
|
4647
|
-
t === "*" ? this.renderStoryLoadingException(t, new
|
|
4647
|
+
t === "*" ? this.renderStoryLoadingException(t, new Wi()) : this.renderStoryLoadingException(
|
|
4648
4648
|
t,
|
|
4649
|
-
new
|
|
4649
|
+
new Yi({ storySpecifier: t.toString() })
|
|
4650
4650
|
);
|
|
4651
4651
|
return;
|
|
4652
4652
|
}
|
|
4653
4653
|
let { id: i, type: a } = s;
|
|
4654
|
-
this.selectionStore.setSelection({ storyId: i, viewMode: a }), this.channel.emit(
|
|
4654
|
+
this.selectionStore.setSelection({ storyId: i, viewMode: a }), this.channel.emit(Gi, this.selectionStore.selection), this.channel.emit(Lo,
|
|
4655
4655
|
this.selectionStore.selection), await this.renderSelection({ persistedArgs: o });
|
|
4656
4656
|
}
|
|
4657
4657
|
// EVENT HANDLERS
|
|
@@ -4670,9 +4670,9 @@ var rt = class rt extends Se {
|
|
|
4670
4670
|
selectSpecifiedStory();
|
|
4671
4671
|
}
|
|
4672
4672
|
onKeydown(t) {
|
|
4673
|
-
if (!this.storyRenders.find((o) => o.disableKeyListeners) &&
|
|
4673
|
+
if (!this.storyRenders.find((o) => o.disableKeyListeners) && !Xi(t)) {
|
|
4674
4674
|
let { altKey: o, ctrlKey: s, metaKey: i, shiftKey: a, key: l, code: c, keyCode: d } = t;
|
|
4675
|
-
this.channel.emit(
|
|
4675
|
+
this.channel.emit(_i, {
|
|
4676
4676
|
event: { altKey: o, ctrlKey: s, metaKey: i, shiftKey: a, key: l, code: c, keyCode: d }
|
|
4677
4677
|
});
|
|
4678
4678
|
}
|
|
@@ -4726,7 +4726,7 @@ var rt = class rt extends Se {
|
|
|
4726
4726
|
this.mainStoryCallbacks(i),
|
|
4727
4727
|
i,
|
|
4728
4728
|
"story"
|
|
4729
|
-
) :
|
|
4729
|
+
) : Qi(a) ? d = new Me(
|
|
4730
4730
|
this.channel,
|
|
4731
4731
|
this.storyStoreValue,
|
|
4732
4732
|
a,
|
|
@@ -4749,10 +4749,10 @@ var rt = class rt extends Se {
|
|
|
4749
4749
|
}
|
|
4750
4750
|
let y = !l && u && !d.isEqual(u);
|
|
4751
4751
|
if (t && et(d) && (Qe(!!d.story), this.storyStoreValue.args.updateFromPersisted(d.story, t)), u && !u.torndown && !l && !y && !c) {
|
|
4752
|
-
this.currentRender = u, this.channel.emit(
|
|
4752
|
+
this.currentRender = u, this.channel.emit(Vi, i), this.view.showMain();
|
|
4753
4753
|
return;
|
|
4754
4754
|
}
|
|
4755
|
-
if (u && await this.teardownRender(u, { viewModeChanged: c }), p && (l || c) && this.channel.emit(
|
|
4755
|
+
if (u && await this.teardownRender(u, { viewModeChanged: c }), p && (l || c) && this.channel.emit(qi, i), et(d)) {
|
|
4756
4756
|
Qe(!!d.story);
|
|
4757
4757
|
let {
|
|
4758
4758
|
parameters: g,
|
|
@@ -4764,7 +4764,7 @@ var rt = class rt extends Se {
|
|
|
4764
4764
|
storyGlobals: f,
|
|
4765
4765
|
globals: x
|
|
4766
4766
|
} = this.storyStoreValue.getStoryContext(d.story);
|
|
4767
|
-
this.channel.emit(
|
|
4767
|
+
this.channel.emit(Bi, {
|
|
4768
4768
|
id: i,
|
|
4769
4769
|
parameters: g,
|
|
4770
4770
|
initialArgs: S,
|
|
@@ -4778,14 +4778,14 @@ var rt = class rt extends Se {
|
|
|
4778
4778
|
initialGlobals: S,
|
|
4779
4779
|
storyGlobals: {},
|
|
4780
4780
|
userGlobals: b
|
|
4781
|
-
}),
|
|
4781
|
+
}), ea(d) || d.entry.tags?.includes(zo)) {
|
|
4782
4782
|
if (!d.csfFiles)
|
|
4783
|
-
throw new
|
|
4783
|
+
throw new $i({ storyId: i });
|
|
4784
4784
|
({ parameters: g } = this.storyStoreValue.preparedMetaFromCSFFile({
|
|
4785
4785
|
csfFile: d.csfFiles[0]
|
|
4786
4786
|
}));
|
|
4787
4787
|
}
|
|
4788
|
-
this.channel.emit(
|
|
4788
|
+
this.channel.emit(Mi, {
|
|
4789
4789
|
id: i,
|
|
4790
4790
|
parameters: g
|
|
4791
4791
|
});
|
|
@@ -4814,21 +4814,21 @@ var rt = class rt extends Se {
|
|
|
4814
4814
|
super.renderPreviewEntryError(t, o), this.view.showErrorDisplay(o);
|
|
4815
4815
|
}
|
|
4816
4816
|
renderMissingStory() {
|
|
4817
|
-
this.view.showNoPreview(), this.channel.emit(
|
|
4817
|
+
this.view.showNoPreview(), this.channel.emit(No);
|
|
4818
4818
|
}
|
|
4819
4819
|
renderStoryLoadingException(t, o) {
|
|
4820
|
-
Ze.error(o), this.view.showErrorDisplay(o), this.channel.emit(
|
|
4820
|
+
Ze.error(o), this.view.showErrorDisplay(o), this.channel.emit(No, t);
|
|
4821
4821
|
}
|
|
4822
4822
|
// renderException is used if we fail to render the story and it is uncaught by the app layer
|
|
4823
4823
|
renderException(t, o) {
|
|
4824
4824
|
let { name: s = "Error", message: i = String(o), stack: a } = o;
|
|
4825
|
-
this.channel.emit(
|
|
4825
|
+
this.channel.emit(Ui, { name: s, message: i, stack: a }), this.channel.emit(qo, { newPhase: "errored", storyId: t }), this.view.showErrorDisplay(
|
|
4826
4826
|
o), Ze.error(`Error rendering story '${t}':`), Ze.error(o);
|
|
4827
4827
|
}
|
|
4828
4828
|
// renderError is used by the various app layers to inform the user they have done something
|
|
4829
4829
|
// wrong -- for instance returned the wrong thing from a story
|
|
4830
4830
|
renderError(t, { title: o, description: s }) {
|
|
4831
|
-
Ze.error(`Error rendering story ${o}: ${s}`), this.channel.emit(
|
|
4831
|
+
Ze.error(`Error rendering story ${o}: ${s}`), this.channel.emit(zi, { title: o, description: s }), this.channel.emit(qo, { newPhase: "er\
|
|
4832
4832
|
rored", storyId: t }), this.view.showErrorDisplay({
|
|
4833
4833
|
message: o,
|
|
4834
4834
|
stack: s
|
|
@@ -4840,15 +4840,15 @@ var Te = rt;
|
|
|
4840
4840
|
|
|
4841
4841
|
// src/preview-api/modules/preview-web/UrlStore.ts
|
|
4842
4842
|
var _e = fe(nr(), 1);
|
|
4843
|
-
import { global as
|
|
4843
|
+
import { global as Fa } from "@storybook/global";
|
|
4844
4844
|
|
|
4845
4845
|
// src/preview-api/modules/preview-web/parseArgsParam.ts
|
|
4846
|
-
import { once as
|
|
4846
|
+
import { once as Ca } from "storybook/internal/client-logger";
|
|
4847
4847
|
var Zo = fe(nr(), 1);
|
|
4848
|
-
var Qo = /^[a-zA-Z0-9 _-]*$/, en = /^-?[0-9]+(\.[0-9]+)?$/,
|
|
4848
|
+
var Qo = /^[a-zA-Z0-9 _-]*$/, en = /^-?[0-9]+(\.[0-9]+)?$/, va = /^#([a-f0-9]{3,4}|[a-f0-9]{6}|[a-f0-9]{8})$/i, rn = /^(rgba?|hsla?)\(([0-9]{1,3}),\s?([0-9]{1,3})%?,\s?([0-9]{1,3})%?,?\s?([0-9](\.[0-9]{1,2})?)?\)$/i,
|
|
4849
4849
|
lt = /* @__PURE__ */ n((r = "", e) => r === null || r === "" || !Qo.test(r) ? !1 : e == null || e instanceof Date || typeof e == "number" ||
|
|
4850
|
-
typeof e == "boolean" ? !0 : typeof e == "string" ? Qo.test(e) || en.test(e) ||
|
|
4851
|
-
r, t)) : k(e) ? Object.entries(e).every(([t, o]) => lt(t, o)) : !1, "validateArgs"),
|
|
4850
|
+
typeof e == "boolean" ? !0 : typeof e == "string" ? Qo.test(e) || en.test(e) || va.test(e) || rn.test(e) : Array.isArray(e) ? e.every((t) => lt(
|
|
4851
|
+
r, t)) : k(e) ? Object.entries(e).every(([t, o]) => lt(t, o)) : !1, "validateArgs"), Pa = {
|
|
4852
4852
|
delimiter: ";",
|
|
4853
4853
|
// we're parsing a single query param
|
|
4854
4854
|
nesting: !0,
|
|
@@ -4880,7 +4880,7 @@ r, t)) : k(e) ? Object.entries(e).every(([t, o]) => lt(t, o)) : !1, "validateArg
|
|
|
4880
4880
|
}
|
|
4881
4881
|
}, ct = /* @__PURE__ */ n((r) => {
|
|
4882
4882
|
let e = r.split(";").map((t) => t.replace("=", "~").replace(":", "="));
|
|
4883
|
-
return Object.entries((0, Zo.parse)(e.join(";"),
|
|
4883
|
+
return Object.entries((0, Zo.parse)(e.join(";"), Pa)).reduce((t, [o, s]) => lt(o, s) ? Object.assign(t, { [o]: s }) : (Ca.warn(P`
|
|
4884
4884
|
Omitted potentially unsafe URL args.
|
|
4885
4885
|
|
|
4886
4886
|
More info: https://storybook.js.org/docs/writing-stories/args#setting-args-through-the-url
|
|
@@ -4888,14 +4888,14 @@ r, t)) : k(e) ? Object.entries(e).every(([t, o]) => lt(t, o)) : !1, "validateArg
|
|
|
4888
4888
|
}, "parseArgsParam");
|
|
4889
4889
|
|
|
4890
4890
|
// src/preview-api/modules/preview-web/UrlStore.ts
|
|
4891
|
-
var { history: tn, document: Z } =
|
|
4892
|
-
function
|
|
4891
|
+
var { history: tn, document: Z } = Fa;
|
|
4892
|
+
function Ia(r) {
|
|
4893
4893
|
let e = (r || "").match(/^\/story\/(.+)/);
|
|
4894
4894
|
if (!e)
|
|
4895
4895
|
throw new Error(`Invalid path '${r}', must start with '/story/'`);
|
|
4896
4896
|
return e[1];
|
|
4897
4897
|
}
|
|
4898
|
-
n(
|
|
4898
|
+
n(Ia, "pathToId");
|
|
4899
4899
|
var on = /* @__PURE__ */ n(({
|
|
4900
4900
|
selection: r,
|
|
4901
4901
|
extraParams: e
|
|
@@ -4906,39 +4906,39 @@ var on = /* @__PURE__ */ n(({
|
|
|
4906
4906
|
...e,
|
|
4907
4907
|
...r && { id: r.storyId, viewMode: r.viewMode }
|
|
4908
4908
|
})}`;
|
|
4909
|
-
}, "getQueryString"),
|
|
4909
|
+
}, "getQueryString"), Oa = /* @__PURE__ */ n((r) => {
|
|
4910
4910
|
if (!r)
|
|
4911
4911
|
return;
|
|
4912
4912
|
let e = on({ selection: r }), { hash: t = "" } = Z.location;
|
|
4913
4913
|
Z.title = r.storyId, tn.replaceState({}, "", `${Z.location.pathname}${e}${t}`);
|
|
4914
|
-
}, "setPath"),
|
|
4914
|
+
}, "setPath"), Da = /* @__PURE__ */ n((r) => r != null && typeof r == "object" && Array.isArray(r) === !1, "isObject"), Le = /* @__PURE__ */ n(
|
|
4915
4915
|
(r) => {
|
|
4916
4916
|
if (r !== void 0) {
|
|
4917
4917
|
if (typeof r == "string")
|
|
4918
4918
|
return r;
|
|
4919
4919
|
if (Array.isArray(r))
|
|
4920
4920
|
return Le(r[0]);
|
|
4921
|
-
if (
|
|
4921
|
+
if (Da(r))
|
|
4922
4922
|
return Le(
|
|
4923
4923
|
Object.values(r).filter(Boolean)
|
|
4924
4924
|
);
|
|
4925
4925
|
}
|
|
4926
|
-
}, "getFirstString"),
|
|
4926
|
+
}, "getFirstString"), ka = /* @__PURE__ */ n(() => {
|
|
4927
4927
|
if (typeof Z < "u") {
|
|
4928
4928
|
let r = Z.location.search.slice(1), e = (0, _e.parse)(r), t = typeof e.args == "string" ? ct(e.args) : void 0, o = typeof e.globals == "\
|
|
4929
4929
|
string" ? ct(e.globals) : void 0, s = Le(e.viewMode);
|
|
4930
4930
|
(typeof s != "string" || !s.match(/docs|story/)) && (s = "story");
|
|
4931
|
-
let i = Le(e.path), a = i ?
|
|
4931
|
+
let i = Le(e.path), a = i ? Ia(i) : Le(e.id);
|
|
4932
4932
|
if (a)
|
|
4933
4933
|
return { storySpecifier: a, args: t, globals: o, viewMode: s };
|
|
4934
4934
|
}
|
|
4935
4935
|
return null;
|
|
4936
4936
|
}, "getSelectionSpecifierFromPath"), dt = class dt {
|
|
4937
4937
|
constructor() {
|
|
4938
|
-
this.selectionSpecifier =
|
|
4938
|
+
this.selectionSpecifier = ka();
|
|
4939
4939
|
}
|
|
4940
4940
|
setSelection(e) {
|
|
4941
|
-
this.selection = e,
|
|
4941
|
+
this.selection = e, Oa(this.selection);
|
|
4942
4942
|
}
|
|
4943
4943
|
setQueryParams(e) {
|
|
4944
4944
|
let t = on({ extraParams: e }), { hash: o = "" } = Z.location;
|
|
@@ -4950,10 +4950,10 @@ var xe = dt;
|
|
|
4950
4950
|
|
|
4951
4951
|
// src/preview-api/modules/preview-web/WebView.ts
|
|
4952
4952
|
var Ln = fe(kn(), 1), _n = fe(nr(), 1);
|
|
4953
|
-
import { logger as
|
|
4954
|
-
import { global as
|
|
4955
|
-
var { document: D } =
|
|
4956
|
-
_STORY", i.PREPARING_DOCS = "PREPARING_DOCS", i.ERROR = "ERROR", i))(
|
|
4953
|
+
import { logger as yl } from "storybook/internal/client-logger";
|
|
4954
|
+
import { global as ml } from "@storybook/global";
|
|
4955
|
+
var { document: D } = ml, jn = 100, Nn = /* @__PURE__ */ ((i) => (i.MAIN = "MAIN", i.NOPREVIEW = "NOPREVIEW", i.PREPARING_STORY = "PREPARING\
|
|
4956
|
+
_STORY", i.PREPARING_DOCS = "PREPARING_DOCS", i.ERROR = "ERROR", i))(Nn || {}), gt = {
|
|
4957
4957
|
PREPARING_STORY: "sb-show-preparing-story",
|
|
4958
4958
|
PREPARING_DOCS: "sb-show-preparing-docs",
|
|
4959
4959
|
MAIN: "sb-show-main",
|
|
@@ -5008,7 +5008,7 @@ _STORY", i.PREPARING_DOCS = "PREPARING_DOCS", i.ERROR = "ERROR", i))(qn || {}),
|
|
|
5008
5008
|
D.body.classList.remove(this.currentLayoutClass), D.body.classList.add(t), this.currentLayoutClass = t;
|
|
5009
5009
|
}
|
|
5010
5010
|
checkIfLayoutExists(e) {
|
|
5011
|
-
bt[e] ||
|
|
5011
|
+
bt[e] || yl.warn(
|
|
5012
5012
|
P`
|
|
5013
5013
|
The desired layout: ${e} is not a valid option.
|
|
5014
5014
|
The possible options are: ${Object.keys(bt).join(", ")}, none.
|
|
@@ -5016,7 +5016,7 @@ _STORY", i.PREPARING_DOCS = "PREPARING_DOCS", i.ERROR = "ERROR", i))(qn || {}),
|
|
|
5016
5016
|
);
|
|
5017
5017
|
}
|
|
5018
5018
|
showMode(e) {
|
|
5019
|
-
clearTimeout(this.preparingTimeout), Object.keys(
|
|
5019
|
+
clearTimeout(this.preparingTimeout), Object.keys(Nn).forEach((t) => {
|
|
5020
5020
|
t === e ? D.body.classList.add(gt[t]) : D.body.classList.remove(gt[t]);
|
|
5021
5021
|
});
|
|
5022
5022
|
}
|
|
@@ -5063,15 +5063,15 @@ var Tt = class Tt extends Te {
|
|
|
5063
5063
|
super(t, o, new xe(), new Re());
|
|
5064
5064
|
this.importFn = t;
|
|
5065
5065
|
this.getProjectAnnotations = o;
|
|
5066
|
-
|
|
5066
|
+
hl.__STORYBOOK_PREVIEW__ = this;
|
|
5067
5067
|
}
|
|
5068
5068
|
};
|
|
5069
5069
|
n(Tt, "PreviewWeb");
|
|
5070
5070
|
var ur = Tt;
|
|
5071
5071
|
|
|
5072
5072
|
// src/preview-api/modules/preview-web/simulate-pageload.ts
|
|
5073
|
-
import { global as
|
|
5074
|
-
var { document: pe } =
|
|
5073
|
+
import { global as gl } from "@storybook/global";
|
|
5074
|
+
var { document: pe } = gl, bl = [
|
|
5075
5075
|
"application/javascript",
|
|
5076
5076
|
"application/ecmascript",
|
|
5077
5077
|
"application/x-ecmascript",
|
|
@@ -5090,18 +5090,18 @@ var { document: pe } = yl, ml = [
|
|
|
5090
5090
|
"text/x-javascript",
|
|
5091
5091
|
// Support modern javascript
|
|
5092
5092
|
"module"
|
|
5093
|
-
],
|
|
5093
|
+
], Sl = "script", qn = "scripts-root";
|
|
5094
5094
|
function fr() {
|
|
5095
5095
|
let r = pe.createEvent("Event");
|
|
5096
5096
|
r.initEvent("DOMContentLoaded", !0, !0), pe.dispatchEvent(r);
|
|
5097
5097
|
}
|
|
5098
5098
|
n(fr, "simulateDOMContentLoaded");
|
|
5099
|
-
function
|
|
5099
|
+
function Tl(r, e, t) {
|
|
5100
5100
|
let o = pe.createElement("script");
|
|
5101
5101
|
o.type = r.type === "module" ? "module" : "text/javascript", r.src ? (o.onload = e, o.onerror = e, o.src = r.src) : o.textContent = r.innerText,
|
|
5102
5102
|
t ? t.appendChild(o) : pe.head.appendChild(o), r.parentNode.removeChild(r), r.src || e();
|
|
5103
5103
|
}
|
|
5104
|
-
n(
|
|
5104
|
+
n(Tl, "insertScript");
|
|
5105
5105
|
function zn(r, e, t = 0) {
|
|
5106
5106
|
r[t](() => {
|
|
5107
5107
|
t++, t === r.length ? e() : zn(r, e, t);
|
|
@@ -5109,19 +5109,34 @@ function zn(r, e, t = 0) {
|
|
|
5109
5109
|
}
|
|
5110
5110
|
n(zn, "insertScriptsSequentially");
|
|
5111
5111
|
function Bn(r) {
|
|
5112
|
-
let e = pe.getElementById(
|
|
5113
|
-
e ? e.innerHTML = "" : (e = pe.createElement("div"), e.id =
|
|
5114
|
-
let t = Array.from(r.querySelectorAll(
|
|
5112
|
+
let e = pe.getElementById(qn);
|
|
5113
|
+
e ? e.innerHTML = "" : (e = pe.createElement("div"), e.id = qn, pe.body.appendChild(e));
|
|
5114
|
+
let t = Array.from(r.querySelectorAll(Sl));
|
|
5115
5115
|
if (t.length) {
|
|
5116
5116
|
let o = [];
|
|
5117
5117
|
t.forEach((s) => {
|
|
5118
5118
|
let i = s.getAttribute("type");
|
|
5119
|
-
(!i ||
|
|
5119
|
+
(!i || bl.includes(i)) && o.push((a) => Tl(s, a, e));
|
|
5120
5120
|
}), o.length && zn(o, fr, void 0);
|
|
5121
5121
|
} else
|
|
5122
5122
|
fr();
|
|
5123
5123
|
}
|
|
5124
5124
|
n(Bn, "simulatePageLoad");
|
|
5125
|
+
|
|
5126
|
+
// src/docs-tools/shared.ts
|
|
5127
|
+
var Gn = "storybook/docs", Vf = `${Gn}/panel`;
|
|
5128
|
+
var Un = `${Gn}/snippet-rendered`;
|
|
5129
|
+
|
|
5130
|
+
// src/preview-api/modules/preview-web/emitTransformCode.ts
|
|
5131
|
+
async function Vn(r, e) {
|
|
5132
|
+
let t = e.parameters?.docs?.source?.transform, { id: o, unmappedArgs: s } = e, i = t && r ? t?.(r, e) : r, a = i ? await i : void 0;
|
|
5133
|
+
L.getChannel().emit(Un, {
|
|
5134
|
+
id: o,
|
|
5135
|
+
source: a,
|
|
5136
|
+
args: s
|
|
5137
|
+
});
|
|
5138
|
+
}
|
|
5139
|
+
n(Vn, "emitTransformCode");
|
|
5125
5140
|
export {
|
|
5126
5141
|
Q as DocsContext,
|
|
5127
5142
|
te as HooksContext,
|
|
@@ -5132,45 +5147,46 @@ export {
|
|
|
5132
5147
|
be as StoryStore,
|
|
5133
5148
|
xe as UrlStore,
|
|
5134
5149
|
Re as WebView,
|
|
5135
|
-
|
|
5150
|
+
L as addons,
|
|
5136
5151
|
xr as applyHooks,
|
|
5137
5152
|
Pe as combineArgs,
|
|
5138
|
-
|
|
5153
|
+
_ as combineParameters,
|
|
5139
5154
|
K as composeConfigs,
|
|
5140
5155
|
Gr as composeStepRunners,
|
|
5141
|
-
|
|
5156
|
+
Qs as composeStories,
|
|
5142
5157
|
wo as composeStory,
|
|
5143
|
-
|
|
5158
|
+
Zs as createPlaywrightTest,
|
|
5144
5159
|
bo as decorateStory,
|
|
5145
|
-
|
|
5146
|
-
|
|
5160
|
+
Nr as defaultDecorateStory,
|
|
5161
|
+
Zn as definePreview,
|
|
5162
|
+
Vn as emitTransformCode,
|
|
5147
5163
|
Ke as filterArgTypes,
|
|
5148
5164
|
oe as getCoreAnnotations,
|
|
5149
5165
|
Vr as getCsfFactoryAnnotations,
|
|
5150
5166
|
Oe as inferControls,
|
|
5151
|
-
|
|
5167
|
+
hs as makeDecorator,
|
|
5152
5168
|
mr as mockChannel,
|
|
5153
5169
|
ge as normalizeProjectAnnotations,
|
|
5154
5170
|
he as normalizeStory,
|
|
5155
|
-
|
|
5171
|
+
qr as prepareMeta,
|
|
5156
5172
|
Ie as prepareStory,
|
|
5157
5173
|
So as sanitizeStoryContextUpdate,
|
|
5158
|
-
|
|
5159
|
-
|
|
5174
|
+
Ws as setDefaultProjectAnnotations,
|
|
5175
|
+
Xs as setProjectAnnotations,
|
|
5160
5176
|
fr as simulateDOMContentLoaded,
|
|
5161
5177
|
Bn as simulatePageLoad,
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5178
|
+
li as sortStoriesV7,
|
|
5179
|
+
ys as useArgs,
|
|
5180
|
+
ve as useCallback,
|
|
5181
|
+
us as useChannel,
|
|
5182
|
+
vt as useEffect,
|
|
5183
|
+
ms as useGlobals,
|
|
5184
|
+
as as useMemo,
|
|
5185
|
+
fs as useParameter,
|
|
5186
|
+
ps as useReducer,
|
|
5187
|
+
ls as useRef,
|
|
5188
|
+
ds as useState,
|
|
5173
5189
|
Ge as useStoryContext,
|
|
5174
|
-
|
|
5175
|
-
|
|
5190
|
+
ii as userOrAutoTitle,
|
|
5191
|
+
Co as userOrAutoTitleFromSpecifier
|
|
5176
5192
|
};
|