storybook 9.0.0-alpha.12 → 9.0.0-alpha.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/docs/addon-backgrounds.gif +0 -0
- package/assets/docs/highlight.png +0 -0
- 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/backgrounds/index.cjs +148 -0
- package/dist/backgrounds/index.d.ts +91 -0
- package/dist/backgrounds/index.js +130 -0
- package/dist/backgrounds/preview.cjs +143 -0
- package/dist/backgrounds/preview.d.ts +54 -0
- package/dist/backgrounds/preview.js +127 -0
- package/dist/bin/index.cjs +62 -73
- package/dist/bin/index.js +57 -68
- package/dist/builder-manager/index.cjs +390 -380
- package/dist/builder-manager/index.js +489 -479
- package/dist/channels/index.cjs +1018 -948
- package/dist/channels/index.js +1194 -1161
- package/dist/cli/bin/index.cjs +225 -225
- package/dist/cli/bin/index.js +234 -234
- package/dist/cli/index.cjs +1860 -1873
- package/dist/cli/index.js +308 -321
- package/dist/common/index.cjs +2396 -2380
- package/dist/common/index.d.ts +0 -11
- package/dist/common/index.js +2604 -2588
- package/dist/components/index.cjs +6393 -12704
- package/dist/components/index.d.ts +1 -2
- package/dist/components/index.js +4665 -10778
- package/dist/core-events/index.cjs +72 -84
- package/dist/core-events/index.d.ts +2 -77
- package/dist/core-events/index.js +61 -73
- package/dist/core-server/index.cjs +13484 -13318
- package/dist/core-server/index.js +13652 -13486
- package/dist/core-server/presets/common-manager.js +9815 -12
- package/dist/core-server/presets/common-preset.cjs +2809 -3005
- package/dist/core-server/presets/common-preset.js +2891 -3087
- package/dist/docs-tools/index.cjs +626 -600
- package/dist/docs-tools/index.js +613 -587
- package/dist/highlight/index.cjs +27 -0
- package/dist/highlight/index.d.ts +17 -0
- package/dist/highlight/index.js +7 -0
- package/dist/highlight/preview.cjs +81 -0
- package/dist/highlight/preview.d.ts +54 -0
- package/dist/highlight/preview.js +67 -0
- package/dist/instrumenter/index.cjs +70 -60
- package/dist/instrumenter/index.d.ts +8 -7
- package/dist/instrumenter/index.js +98 -88
- package/dist/manager/globals-module-info.cjs +12 -22
- package/dist/manager/globals-module-info.js +2 -12
- package/dist/manager/globals-runtime.js +31295 -33999
- package/dist/manager/runtime.js +3419 -3522
- package/dist/manager-api/index.cjs +2521 -2445
- package/dist/manager-api/index.d.ts +7 -21
- package/dist/manager-api/index.js +2431 -2349
- package/dist/measure/index.cjs +474 -0
- package/dist/measure/index.d.ts +66 -0
- package/dist/measure/index.js +462 -0
- package/dist/measure/preview.cjs +464 -0
- package/dist/measure/preview.d.ts +59 -0
- package/dist/measure/preview.js +448 -0
- package/dist/outline/index.cjs +528 -0
- package/dist/outline/index.d.ts +66 -0
- package/dist/outline/index.js +500 -0
- package/dist/outline/preview.cjs +518 -0
- package/dist/outline/preview.d.ts +59 -0
- package/dist/outline/preview.js +486 -0
- package/dist/preview/runtime.js +20735 -17220
- package/dist/preview-api/index.cjs +1069 -1057
- package/dist/preview-api/index.d.ts +384 -157
- package/dist/preview-api/index.js +1123 -1109
- package/dist/server-errors.cjs +66 -67
- package/dist/server-errors.d.ts +0 -1
- package/dist/server-errors.js +68 -69
- package/dist/test/index.cjs +1547 -1546
- package/dist/test/index.js +2308 -2307
- package/dist/test/preview.cjs +1906 -1905
- package/dist/test/preview.js +1439 -1438
- package/dist/test/spy.cjs +65 -64
- package/dist/test/spy.js +59 -58
- package/dist/types/index.cjs +10 -10
- package/dist/types/index.d.ts +203 -243
- package/package.json +122 -17
- package/dist/actions/manager.js +0 -1195
- package/dist/component-testing/manager.js +0 -3126
- package/dist/controls/manager.js +0 -5593
- package/dist/viewport/manager.js +0 -400
- /package/dist/{component-testing/manager.css → core-server/presets/common-manager.css} +0 -0
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var s = (r, e) =>
|
|
8
|
-
var O = (r, e) => () => (e || r((e = { exports: {} }).exports, e), e.exports),
|
|
2
|
+
var Os = Object.create;
|
|
3
|
+
var _e = Object.defineProperty;
|
|
4
|
+
var Ds = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var ks = Object.getOwnPropertyNames;
|
|
6
|
+
var js = Object.getPrototypeOf, Ms = Object.prototype.hasOwnProperty;
|
|
7
|
+
var s = (r, e) => _e(r, "name", { value: e, configurable: !0 });
|
|
8
|
+
var O = (r, e) => () => (e || r((e = { exports: {} }).exports, e), e.exports), _s = (r, e) => {
|
|
9
9
|
for (var t in e)
|
|
10
|
-
|
|
11
|
-
},
|
|
10
|
+
_e(r, t, { get: e[t], enumerable: !0 });
|
|
11
|
+
}, jt = (r, e, t, o) => {
|
|
12
12
|
if (e && typeof e == "object" || typeof e == "function")
|
|
13
|
-
for (let n of
|
|
14
|
-
!
|
|
13
|
+
for (let n of ks(e))
|
|
14
|
+
!Ms.call(r, n) && n !== t && _e(r, n, { get: () => e[n], enumerable: !(o = Ds(e, n)) || o.enumerable });
|
|
15
15
|
return r;
|
|
16
16
|
};
|
|
17
|
-
var
|
|
17
|
+
var I = (r, e, t) => (t = r != null ? Os(js(r)) : {}, jt(
|
|
18
18
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
19
19
|
// file that has been converted to a CommonJS file using a Babel-
|
|
20
20
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
21
21
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
22
|
-
e || !r || !r.__esModule ?
|
|
22
|
+
e || !r || !r.__esModule ? _e(t, "default", { value: r, enumerable: !0 }) : t,
|
|
23
23
|
r
|
|
24
|
-
)),
|
|
24
|
+
)), Ls = (r) => jt(_e({}, "__esModule", { value: !0 }), r);
|
|
25
25
|
|
|
26
26
|
// ../node_modules/map-or-similar/src/similar.js
|
|
27
|
-
var
|
|
27
|
+
var Ro = O((ml, xo) => {
|
|
28
28
|
function oe() {
|
|
29
29
|
return this.list = [], this.lastItem = void 0, this.size = 0, this;
|
|
30
30
|
}
|
|
@@ -65,14 +65,14 @@ var bo = O((dl, go) => {
|
|
|
65
65
|
oe.prototype.isEqual = function(r, e) {
|
|
66
66
|
return r === e || r !== r && e !== e;
|
|
67
67
|
};
|
|
68
|
-
|
|
68
|
+
xo.exports = oe;
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
// ../node_modules/map-or-similar/src/map-or-similar.js
|
|
72
|
-
var
|
|
73
|
-
|
|
72
|
+
var Eo = O((gl, wo) => {
|
|
73
|
+
wo.exports = function(r) {
|
|
74
74
|
if (typeof Map != "function" || r) {
|
|
75
|
-
var e =
|
|
75
|
+
var e = Ro();
|
|
76
76
|
return new e();
|
|
77
77
|
} else
|
|
78
78
|
return /* @__PURE__ */ new Map();
|
|
@@ -80,10 +80,10 @@ var To = O((ul, So) => {
|
|
|
80
80
|
});
|
|
81
81
|
|
|
82
82
|
// ../node_modules/memoizerific/src/memoizerific.js
|
|
83
|
-
var $r = O((
|
|
84
|
-
var
|
|
85
|
-
|
|
86
|
-
var e = new
|
|
83
|
+
var $r = O((bl, Co) => {
|
|
84
|
+
var Ao = Eo();
|
|
85
|
+
Co.exports = function(r) {
|
|
86
|
+
var e = new Ao(process.env.FORCE_SIMILAR_INSTEAD_OF_MAP === "true"), t = [];
|
|
87
87
|
return function(o) {
|
|
88
88
|
var n = /* @__PURE__ */ s(function() {
|
|
89
89
|
var i = e, a, l, c = arguments.length - 1, d = Array(c + 1), u = !0, p;
|
|
@@ -97,22 +97,22 @@ var $r = O((fl, Ro) => {
|
|
|
97
97
|
i = i.get(arguments[p]);
|
|
98
98
|
continue;
|
|
99
99
|
}
|
|
100
|
-
u = !1, a = new
|
|
100
|
+
u = !1, a = new Ao(process.env.FORCE_SIMILAR_INSTEAD_OF_MAP === "true"), i.set(arguments[p], a), i = a;
|
|
101
101
|
}
|
|
102
102
|
return u && (i.has(arguments[c]) ? l = i.get(arguments[c]) : u = !1), u || (l = o.apply(null, arguments), i.set(arguments[c], l)), r >
|
|
103
103
|
0 && (d[c] = {
|
|
104
104
|
cacheItem: i,
|
|
105
105
|
arg: arguments[c]
|
|
106
|
-
}, u ?
|
|
106
|
+
}, u ? Us(t, d) : t.push(d), t.length > r && Vs(t.shift())), n.wasMemoized = u, n.numArgs = c + 1, l;
|
|
107
107
|
}, "memoizerific");
|
|
108
108
|
return n.limit = r, n.wasMemoized = !1, n.cache = e, n.lru = t, n;
|
|
109
109
|
};
|
|
110
110
|
};
|
|
111
|
-
function
|
|
111
|
+
function Us(r, e) {
|
|
112
112
|
var t = r.length, o = e.length, n, i, a;
|
|
113
113
|
for (i = 0; i < t; i++) {
|
|
114
114
|
for (n = !0, a = 0; a < o; a++)
|
|
115
|
-
if (!
|
|
115
|
+
if (!Hs(r[i][a].arg, e[a].arg)) {
|
|
116
116
|
n = !1;
|
|
117
117
|
break;
|
|
118
118
|
}
|
|
@@ -121,25 +121,25 @@ var $r = O((fl, Ro) => {
|
|
|
121
121
|
}
|
|
122
122
|
r.push(r.splice(i, 1)[0]);
|
|
123
123
|
}
|
|
124
|
-
s(
|
|
125
|
-
function
|
|
124
|
+
s(Us, "moveToMostRecentLru");
|
|
125
|
+
function Vs(r) {
|
|
126
126
|
var e = r.length, t = r[e - 1], o, n;
|
|
127
127
|
for (t.cacheItem.delete(t.arg), n = e - 2; n >= 0 && (t = r[n], o = t.cacheItem.get(t.arg), !o || !o.size); n--)
|
|
128
128
|
t.cacheItem.delete(t.arg);
|
|
129
129
|
}
|
|
130
|
-
s(
|
|
131
|
-
function
|
|
130
|
+
s(Vs, "removeCachedResult");
|
|
131
|
+
function Hs(r, e) {
|
|
132
132
|
return r === e || r !== r && e !== e;
|
|
133
133
|
}
|
|
134
|
-
s(
|
|
134
|
+
s(Hs, "isEqual");
|
|
135
135
|
});
|
|
136
136
|
|
|
137
137
|
// ../node_modules/ts-dedent/dist/index.js
|
|
138
|
-
var W = O((
|
|
138
|
+
var W = O((qe) => {
|
|
139
139
|
"use strict";
|
|
140
|
-
Object.defineProperty(
|
|
141
|
-
|
|
142
|
-
function
|
|
140
|
+
Object.defineProperty(qe, "__esModule", { value: !0 });
|
|
141
|
+
qe.dedent = void 0;
|
|
142
|
+
function vo(r) {
|
|
143
143
|
for (var e = [], t = 1; t < arguments.length; t++)
|
|
144
144
|
e[t - 1] = arguments[t];
|
|
145
145
|
var o = Array.from(typeof r == "string" ? [r] : r);
|
|
@@ -147,8 +147,8 @@ var W = O((Ne) => {
|
|
|
147
147
|
var n = o.reduce(function(l, c) {
|
|
148
148
|
var d = c.match(/\n([\t ]+|(?!\s).)/g);
|
|
149
149
|
return d ? l.concat(d.map(function(u) {
|
|
150
|
-
var p,
|
|
151
|
-
return (
|
|
150
|
+
var p, h;
|
|
151
|
+
return (h = (p = u.match(/[\t ]/g)) === null || p === void 0 ? void 0 : p.length) !== null && h !== void 0 ? h : 0;
|
|
152
152
|
})) : l;
|
|
153
153
|
}, []);
|
|
154
154
|
if (n.length) {
|
|
@@ -165,23 +165,23 @@ var W = O((Ne) => {
|
|
|
165
165
|
var d = a.match(/(?:^|\n)( *)$/), u = d ? d[1] : "", p = l;
|
|
166
166
|
typeof l == "string" && l.includes(`
|
|
167
167
|
`) && (p = String(l).split(`
|
|
168
|
-
`).map(function(
|
|
169
|
-
return
|
|
168
|
+
`).map(function(h, g) {
|
|
169
|
+
return g === 0 ? h : "" + u + h;
|
|
170
170
|
}).join(`
|
|
171
171
|
`)), a += p + o[c + 1];
|
|
172
172
|
}), a;
|
|
173
173
|
}
|
|
174
|
-
s(
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
s(vo, "dedent");
|
|
175
|
+
qe.dedent = vo;
|
|
176
|
+
qe.default = vo;
|
|
177
177
|
});
|
|
178
178
|
|
|
179
179
|
// ../node_modules/picoquery/lib/string-util.js
|
|
180
|
-
var
|
|
180
|
+
var ht = O((mt) => {
|
|
181
181
|
"use strict";
|
|
182
|
-
Object.defineProperty(
|
|
183
|
-
|
|
184
|
-
var Y = Array.from({ length: 256 }, (r, e) => "%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase()),
|
|
182
|
+
Object.defineProperty(mt, "__esModule", { value: !0 });
|
|
183
|
+
mt.encodeString = Ti;
|
|
184
|
+
var Y = Array.from({ length: 256 }, (r, e) => "%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase()), Si = new Int8Array([
|
|
185
185
|
0,
|
|
186
186
|
0,
|
|
187
187
|
0,
|
|
@@ -311,7 +311,7 @@ var ft = O((ut) => {
|
|
|
311
311
|
1,
|
|
312
312
|
0
|
|
313
313
|
]);
|
|
314
|
-
function
|
|
314
|
+
function Ti(r) {
|
|
315
315
|
let e = r.length;
|
|
316
316
|
if (e === 0)
|
|
317
317
|
return "";
|
|
@@ -319,7 +319,7 @@ var ft = O((ut) => {
|
|
|
319
319
|
e: for (; n < e; n++) {
|
|
320
320
|
let i = r.charCodeAt(n);
|
|
321
321
|
for (; i < 128; ) {
|
|
322
|
-
if (
|
|
322
|
+
if (Si[i] !== 1 && (o < n && (t += r.slice(o, n)), o = n + 1, t += Y[i]), ++n === e)
|
|
323
323
|
break e;
|
|
324
324
|
i = r.charCodeAt(n);
|
|
325
325
|
}
|
|
@@ -338,88 +338,88 @@ var ft = O((ut) => {
|
|
|
338
338
|
}
|
|
339
339
|
return o === 0 ? r : o < e ? t + r.slice(o) : t;
|
|
340
340
|
}
|
|
341
|
-
s(
|
|
341
|
+
s(Ti, "encodeString");
|
|
342
342
|
});
|
|
343
343
|
|
|
344
344
|
// ../node_modules/picoquery/lib/shared.js
|
|
345
|
-
var
|
|
345
|
+
var Er = O((K) => {
|
|
346
346
|
"use strict";
|
|
347
347
|
Object.defineProperty(K, "__esModule", { value: !0 });
|
|
348
348
|
K.defaultOptions = K.defaultShouldSerializeObject = K.defaultValueSerializer = void 0;
|
|
349
|
-
var
|
|
349
|
+
var gt = ht(), xi = /* @__PURE__ */ s((r) => {
|
|
350
350
|
switch (typeof r) {
|
|
351
351
|
case "string":
|
|
352
|
-
return (0,
|
|
352
|
+
return (0, gt.encodeString)(r);
|
|
353
353
|
case "bigint":
|
|
354
354
|
case "boolean":
|
|
355
355
|
return "" + r;
|
|
356
356
|
case "number":
|
|
357
357
|
if (Number.isFinite(r))
|
|
358
|
-
return r < 1e21 ? "" + r : (0,
|
|
358
|
+
return r < 1e21 ? "" + r : (0, gt.encodeString)("" + r);
|
|
359
359
|
break;
|
|
360
360
|
}
|
|
361
|
-
return r instanceof Date ? (0,
|
|
361
|
+
return r instanceof Date ? (0, gt.encodeString)(r.toISOString()) : "";
|
|
362
362
|
}, "defaultValueSerializer");
|
|
363
|
-
K.defaultValueSerializer =
|
|
364
|
-
var
|
|
365
|
-
K.defaultShouldSerializeObject =
|
|
366
|
-
var
|
|
363
|
+
K.defaultValueSerializer = xi;
|
|
364
|
+
var Ri = /* @__PURE__ */ s((r) => r instanceof Date, "defaultShouldSerializeObject");
|
|
365
|
+
K.defaultShouldSerializeObject = Ri;
|
|
366
|
+
var Rn = /* @__PURE__ */ s((r) => r, "identityFunc");
|
|
367
367
|
K.defaultOptions = {
|
|
368
368
|
nesting: !0,
|
|
369
369
|
nestingSyntax: "dot",
|
|
370
370
|
arrayRepeat: !1,
|
|
371
371
|
arrayRepeatSyntax: "repeat",
|
|
372
372
|
delimiter: 38,
|
|
373
|
-
valueDeserializer:
|
|
373
|
+
valueDeserializer: Rn,
|
|
374
374
|
valueSerializer: K.defaultValueSerializer,
|
|
375
|
-
keyDeserializer:
|
|
375
|
+
keyDeserializer: Rn,
|
|
376
376
|
shouldSerializeObject: K.defaultShouldSerializeObject
|
|
377
377
|
};
|
|
378
378
|
});
|
|
379
379
|
|
|
380
380
|
// ../node_modules/picoquery/lib/object-util.js
|
|
381
|
-
var
|
|
381
|
+
var bt = O((Ar) => {
|
|
382
382
|
"use strict";
|
|
383
|
-
Object.defineProperty(
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
var Te =
|
|
387
|
-
function
|
|
383
|
+
Object.defineProperty(Ar, "__esModule", { value: !0 });
|
|
384
|
+
Ar.getDeepObject = Ai;
|
|
385
|
+
Ar.stringifyObject = wn;
|
|
386
|
+
var Te = Er(), wi = ht();
|
|
387
|
+
function Ei(r) {
|
|
388
388
|
return r === "__proto__" || r === "constructor" || r === "prototype";
|
|
389
389
|
}
|
|
390
|
-
s(
|
|
391
|
-
function
|
|
392
|
-
if (
|
|
390
|
+
s(Ei, "isPrototypeKey");
|
|
391
|
+
function Ai(r, e, t, o, n) {
|
|
392
|
+
if (Ei(e))
|
|
393
393
|
return r;
|
|
394
394
|
let i = r[e];
|
|
395
395
|
return typeof i == "object" && i !== null ? i : !o && (n || typeof t == "number" || typeof t == "string" && t * 0 === 0 && t.indexOf(".") ===
|
|
396
396
|
-1) ? r[e] = [] : r[e] = {};
|
|
397
397
|
}
|
|
398
|
-
s(
|
|
399
|
-
var
|
|
400
|
-
function
|
|
398
|
+
s(Ai, "getDeepObject");
|
|
399
|
+
var Ci = 20, vi = "[]", Pi = "[", Fi = "]", Ii = ".";
|
|
400
|
+
function wn(r, e, t = 0, o, n) {
|
|
401
401
|
let { nestingSyntax: i = Te.defaultOptions.nestingSyntax, arrayRepeat: a = Te.defaultOptions.arrayRepeat, arrayRepeatSyntax: l = Te.defaultOptions.
|
|
402
402
|
arrayRepeatSyntax, nesting: c = Te.defaultOptions.nesting, delimiter: d = Te.defaultOptions.delimiter, valueSerializer: u = Te.defaultOptions.
|
|
403
|
-
valueSerializer, shouldSerializeObject: p = Te.defaultOptions.shouldSerializeObject } = e,
|
|
404
|
-
d) : d,
|
|
405
|
-
if (t >
|
|
403
|
+
valueSerializer, shouldSerializeObject: p = Te.defaultOptions.shouldSerializeObject } = e, h = typeof d == "number" ? String.fromCharCode(
|
|
404
|
+
d) : d, g = n === !0 && a, E = i === "dot" || i === "js" && !n;
|
|
405
|
+
if (t > Ci)
|
|
406
406
|
return "";
|
|
407
|
-
let
|
|
407
|
+
let R = "", m = !0, b = !1;
|
|
408
408
|
for (let y in r) {
|
|
409
|
-
let f = r[y],
|
|
410
|
-
o ? (
|
|
411
|
-
"object" && f !== null && !p(f) ? (
|
|
412
|
-
|
|
409
|
+
let f = r[y], S;
|
|
410
|
+
o ? (S = o, g ? l === "bracket" && (S += vi) : E ? (S += Ii, S += y) : (S += Pi, S += y, S += Fi)) : S = y, m || (R += h), typeof f ==
|
|
411
|
+
"object" && f !== null && !p(f) ? (b = f.pop !== void 0, (c || a && b) && (R += wn(f, e, t + 1, S, b))) : (R += (0, wi.encodeString)(S),
|
|
412
|
+
R += "=", R += u(f, y)), m && (m = !1);
|
|
413
413
|
}
|
|
414
|
-
return
|
|
414
|
+
return R;
|
|
415
415
|
}
|
|
416
|
-
s(
|
|
416
|
+
s(wn, "stringifyObject");
|
|
417
417
|
});
|
|
418
418
|
|
|
419
419
|
// ../node_modules/fast-decode-uri-component/index.js
|
|
420
|
-
var
|
|
420
|
+
var vn = O((gp, Cn) => {
|
|
421
421
|
"use strict";
|
|
422
|
-
var
|
|
422
|
+
var En = 12, Oi = 0, St = [
|
|
423
423
|
// The first part of the table maps bytes to character to a transition.
|
|
424
424
|
0,
|
|
425
425
|
0,
|
|
@@ -802,18 +802,18 @@ var An = O((dp, wn) => {
|
|
|
802
802
|
7,
|
|
803
803
|
7
|
|
804
804
|
];
|
|
805
|
-
function
|
|
805
|
+
function Di(r) {
|
|
806
806
|
var e = r.indexOf("%");
|
|
807
807
|
if (e === -1) return r;
|
|
808
|
-
for (var t = r.length, o = "", n = 0, i = 0, a = e, l =
|
|
809
|
-
var c =
|
|
810
|
-
if (l =
|
|
808
|
+
for (var t = r.length, o = "", n = 0, i = 0, a = e, l = En; e > -1 && e < t; ) {
|
|
809
|
+
var c = An(r[e + 1], 4), d = An(r[e + 2], 0), u = c | d, p = St[u];
|
|
810
|
+
if (l = St[256 + l + p], i = i << 6 | u & St[364 + p], l === En)
|
|
811
811
|
o += r.slice(n, a), o += i <= 65535 ? String.fromCharCode(i) : String.fromCharCode(
|
|
812
812
|
55232 + (i >> 10),
|
|
813
813
|
56320 + (i & 1023)
|
|
814
814
|
), i = 0, n = e + 3, e = a = r.indexOf("%", n);
|
|
815
815
|
else {
|
|
816
|
-
if (l ===
|
|
816
|
+
if (l === Oi)
|
|
817
817
|
return null;
|
|
818
818
|
if (e += 3, e < t && r.charCodeAt(e) === 37) continue;
|
|
819
819
|
return null;
|
|
@@ -821,8 +821,8 @@ var An = O((dp, wn) => {
|
|
|
821
821
|
}
|
|
822
822
|
return o + r.slice(n);
|
|
823
823
|
}
|
|
824
|
-
s(
|
|
825
|
-
var
|
|
824
|
+
s(Di, "decodeURIComponent");
|
|
825
|
+
var ki = {
|
|
826
826
|
0: 0,
|
|
827
827
|
1: 1,
|
|
828
828
|
2: 2,
|
|
@@ -846,95 +846,95 @@ var An = O((dp, wn) => {
|
|
|
846
846
|
f: 15,
|
|
847
847
|
F: 15
|
|
848
848
|
};
|
|
849
|
-
function
|
|
850
|
-
var t =
|
|
849
|
+
function An(r, e) {
|
|
850
|
+
var t = ki[r];
|
|
851
851
|
return t === void 0 ? 255 : t << e;
|
|
852
852
|
}
|
|
853
|
-
s(
|
|
854
|
-
|
|
853
|
+
s(An, "hexCodeToInt");
|
|
854
|
+
Cn.exports = Di;
|
|
855
855
|
});
|
|
856
856
|
|
|
857
857
|
// ../node_modules/picoquery/lib/parse.js
|
|
858
|
-
var
|
|
858
|
+
var On = O((re) => {
|
|
859
859
|
"use strict";
|
|
860
|
-
var
|
|
860
|
+
var ji = re && re.__importDefault || function(r) {
|
|
861
861
|
return r && r.__esModule ? r : { default: r };
|
|
862
862
|
};
|
|
863
|
-
Object.defineProperty(
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
var Cr =
|
|
863
|
+
Object.defineProperty(re, "__esModule", { value: !0 });
|
|
864
|
+
re.numberValueDeserializer = re.numberKeyDeserializer = void 0;
|
|
865
|
+
re.parse = Li;
|
|
866
|
+
var Cr = bt(), xe = Er(), Pn = ji(vn()), Mi = /* @__PURE__ */ s((r) => {
|
|
867
867
|
let e = Number(r);
|
|
868
868
|
return Number.isNaN(e) ? r : e;
|
|
869
869
|
}, "numberKeyDeserializer");
|
|
870
|
-
|
|
871
|
-
var
|
|
870
|
+
re.numberKeyDeserializer = Mi;
|
|
871
|
+
var _i = /* @__PURE__ */ s((r) => {
|
|
872
872
|
let e = Number(r);
|
|
873
873
|
return Number.isNaN(e) ? r : e;
|
|
874
874
|
}, "numberValueDeserializer");
|
|
875
|
-
|
|
876
|
-
var
|
|
875
|
+
re.numberValueDeserializer = _i;
|
|
876
|
+
var Fn = /\+/g, In = /* @__PURE__ */ s(function() {
|
|
877
877
|
}, "Empty");
|
|
878
|
-
|
|
878
|
+
In.prototype = /* @__PURE__ */ Object.create(null);
|
|
879
879
|
function vr(r, e, t, o, n) {
|
|
880
880
|
let i = r.substring(e, t);
|
|
881
|
-
return o && (i = i.replace(
|
|
881
|
+
return o && (i = i.replace(Fn, " ")), n && (i = (0, Pn.default)(i) || i), i;
|
|
882
882
|
}
|
|
883
883
|
s(vr, "computeKeySlice");
|
|
884
|
-
function
|
|
884
|
+
function Li(r, e) {
|
|
885
885
|
let { valueDeserializer: t = xe.defaultOptions.valueDeserializer, keyDeserializer: o = xe.defaultOptions.keyDeserializer, arrayRepeatSyntax: n = xe.
|
|
886
886
|
defaultOptions.arrayRepeatSyntax, nesting: i = xe.defaultOptions.nesting, arrayRepeat: a = xe.defaultOptions.arrayRepeat, nestingSyntax: l = xe.
|
|
887
887
|
defaultOptions.nestingSyntax, delimiter: c = xe.defaultOptions.delimiter } = e ?? {}, d = typeof c == "string" ? c.charCodeAt(0) : c, u = l ===
|
|
888
|
-
"js", p = new
|
|
888
|
+
"js", p = new In();
|
|
889
889
|
if (typeof r != "string")
|
|
890
890
|
return p;
|
|
891
|
-
let
|
|
892
|
-
H = -1,
|
|
893
|
-
for (let k = 0; k <
|
|
894
|
-
if (C = k !==
|
|
895
|
-
if (
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
let
|
|
891
|
+
let h = r.length, g = "", E = -1, R = -1, m = -1, b = p, y, f = "", S = "", F = !1, T = !1, A = !1, D = !1, L = !1, G = !1, Ce = !1, C = 0,
|
|
892
|
+
H = -1, je = -1, kt = -1;
|
|
893
|
+
for (let k = 0; k < h + 1; k++) {
|
|
894
|
+
if (C = k !== h ? r.charCodeAt(k) : d, C === d) {
|
|
895
|
+
if (Ce = R > E, Ce || (R = k), m !== R - 1 && (S = vr(r, m + 1, H > -1 ? H : R, A, F), f = o(S), y !== void 0 && (b = (0, Cr.getDeepObject)(
|
|
896
|
+
b, y, f, u && L, u && G))), Ce || f !== "") {
|
|
897
|
+
Ce && (g = r.slice(R + 1, k), D && (g = g.replace(Fn, " ")), T && (g = (0, Pn.default)(g) || g));
|
|
898
|
+
let Me = t(g, f);
|
|
899
899
|
if (a) {
|
|
900
|
-
let er =
|
|
901
|
-
er === void 0 ? H > -1 ?
|
|
900
|
+
let er = b[f];
|
|
901
|
+
er === void 0 ? H > -1 ? b[f] = [Me] : b[f] = Me : er.pop ? er.push(Me) : b[f] = [er, Me];
|
|
902
902
|
} else
|
|
903
|
-
|
|
903
|
+
b[f] = Me;
|
|
904
904
|
}
|
|
905
|
-
|
|
906
|
-
} else C === 93 ? (a && n === "bracket" &&
|
|
907
|
-
k,
|
|
908
|
-
C === 46 ? i && (l === "dot" || u) &&
|
|
909
|
-
|
|
910
|
-
r,
|
|
911
|
-
k) : C === 61 ?
|
|
912
|
-
|
|
905
|
+
g = "", E = k, R = k, F = !1, T = !1, A = !1, D = !1, L = !1, G = !1, H = -1, m = k, b = p, y = void 0, f = "";
|
|
906
|
+
} else C === 93 ? (a && n === "bracket" && kt === 91 && (H = je), i && (l === "index" || u) && R <= E && (m !== je && (S = vr(r, m + 1,
|
|
907
|
+
k, A, F), f = o(S), y !== void 0 && (b = (0, Cr.getDeepObject)(b, y, f, void 0, u)), y = f, A = !1, F = !1), m = k, G = !0, L = !1)) :
|
|
908
|
+
C === 46 ? i && (l === "dot" || u) && R <= E && (m !== je && (S = vr(r, m + 1, k, A, F), f = o(S), y !== void 0 && (b = (0, Cr.getDeepObject)(
|
|
909
|
+
b, y, f, u)), y = f, A = !1, F = !1), L = !0, G = !1, m = k) : C === 91 ? i && (l === "index" || u) && R <= E && (m !== je && (S = vr(
|
|
910
|
+
r, m + 1, k, A, F), f = o(S), u && y !== void 0 && (b = (0, Cr.getDeepObject)(b, y, f, u)), y = f, A = !1, F = !1, L = !1, G = !0), m =
|
|
911
|
+
k) : C === 61 ? R <= E ? R = k : T = !0 : C === 43 ? R > E ? D = !0 : A = !0 : C === 37 && (R > E ? T = !0 : F = !0);
|
|
912
|
+
je = k, kt = C;
|
|
913
913
|
}
|
|
914
914
|
return p;
|
|
915
915
|
}
|
|
916
|
-
s(
|
|
916
|
+
s(Li, "parse");
|
|
917
917
|
});
|
|
918
918
|
|
|
919
919
|
// ../node_modules/picoquery/lib/stringify.js
|
|
920
|
-
var
|
|
920
|
+
var Dn = O((Tt) => {
|
|
921
921
|
"use strict";
|
|
922
|
-
Object.defineProperty(
|
|
923
|
-
|
|
924
|
-
var
|
|
925
|
-
function
|
|
922
|
+
Object.defineProperty(Tt, "__esModule", { value: !0 });
|
|
923
|
+
Tt.stringify = qi;
|
|
924
|
+
var Ni = bt();
|
|
925
|
+
function qi(r, e) {
|
|
926
926
|
if (r === null || typeof r != "object")
|
|
927
927
|
return "";
|
|
928
928
|
let t = e ?? {};
|
|
929
|
-
return (0,
|
|
929
|
+
return (0, Ni.stringifyObject)(r, t);
|
|
930
930
|
}
|
|
931
|
-
s(
|
|
931
|
+
s(qi, "stringify");
|
|
932
932
|
});
|
|
933
933
|
|
|
934
934
|
// ../node_modules/picoquery/lib/main.js
|
|
935
|
-
var Pr = O((
|
|
935
|
+
var Pr = O((V) => {
|
|
936
936
|
"use strict";
|
|
937
|
-
var
|
|
937
|
+
var zi = V && V.__createBinding || (Object.create ? function(r, e, t, o) {
|
|
938
938
|
o === void 0 && (o = t);
|
|
939
939
|
var n = Object.getOwnPropertyDescriptor(e, t);
|
|
940
940
|
(!n || ("get" in n ? !e.__esModule : n.writable || n.configurable)) && (n = { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
@@ -942,25 +942,25 @@ var Pr = O((U) => {
|
|
|
942
942
|
}, "get") }), Object.defineProperty(r, o, n);
|
|
943
943
|
} : function(r, e, t, o) {
|
|
944
944
|
o === void 0 && (o = t), r[o] = e[t];
|
|
945
|
-
}),
|
|
946
|
-
for (var t in r) t !== "default" && !Object.prototype.hasOwnProperty.call(e, t) &&
|
|
945
|
+
}), Bi = V && V.__exportStar || function(r, e) {
|
|
946
|
+
for (var t in r) t !== "default" && !Object.prototype.hasOwnProperty.call(e, t) && zi(e, r, t);
|
|
947
947
|
};
|
|
948
|
-
Object.defineProperty(
|
|
949
|
-
|
|
950
|
-
var
|
|
951
|
-
Object.defineProperty(
|
|
952
|
-
return
|
|
948
|
+
Object.defineProperty(V, "__esModule", { value: !0 });
|
|
949
|
+
V.stringify = V.parse = void 0;
|
|
950
|
+
var Gi = On();
|
|
951
|
+
Object.defineProperty(V, "parse", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
952
|
+
return Gi.parse;
|
|
953
953
|
}, "get") });
|
|
954
|
-
var
|
|
955
|
-
Object.defineProperty(
|
|
956
|
-
return
|
|
954
|
+
var Ui = Dn();
|
|
955
|
+
Object.defineProperty(V, "stringify", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
956
|
+
return Ui.stringify;
|
|
957
957
|
}, "get") });
|
|
958
|
-
|
|
958
|
+
Bi(Er(), V);
|
|
959
959
|
});
|
|
960
960
|
|
|
961
961
|
// ../node_modules/ansi-to-html/node_modules/entities/lib/maps/entities.json
|
|
962
|
-
var
|
|
963
|
-
|
|
962
|
+
var wt = O((Op, Xi) => {
|
|
963
|
+
Xi.exports = { Aacute: "\xC1", aacute: "\xE1", Abreve: "\u0102", abreve: "\u0103", ac: "\u223E", acd: "\u223F", acE: "\u223E\u0333", Acirc: "\
|
|
964
964
|
\xC2", acirc: "\xE2", acute: "\xB4", Acy: "\u0410", acy: "\u0430", AElig: "\xC6", aelig: "\xE6", af: "\u2061", Afr: "\u{1D504}", afr: "\u{1D51E}",
|
|
965
965
|
Agrave: "\xC0", agrave: "\xE0", alefsym: "\u2135", aleph: "\u2135", Alpha: "\u0391", alpha: "\u03B1", Amacr: "\u0100", amacr: "\u0101", amalg: "\
|
|
966
966
|
\u2A3F", amp: "&", AMP: "&", andand: "\u2A55", And: "\u2A53", and: "\u2227", andd: "\u2A5C", andslope: "\u2A58", andv: "\u2A5A", ang: "\u2220",
|
|
@@ -1241,8 +1241,8 @@ var Tt = O((Ap, Hi) => {
|
|
|
1241
1241
|
});
|
|
1242
1242
|
|
|
1243
1243
|
// ../node_modules/ansi-to-html/node_modules/entities/lib/maps/legacy.json
|
|
1244
|
-
var
|
|
1245
|
-
|
|
1244
|
+
var Gn = O((Dp, Ji) => {
|
|
1245
|
+
Ji.exports = { Aacute: "\xC1", aacute: "\xE1", Acirc: "\xC2", acirc: "\xE2", acute: "\xB4", AElig: "\xC6", aelig: "\xE6", Agrave: "\xC0", agrave: "\
|
|
1246
1246
|
\xE0", amp: "&", AMP: "&", Aring: "\xC5", aring: "\xE5", Atilde: "\xC3", atilde: "\xE3", Auml: "\xC4", auml: "\xE4", brvbar: "\xA6", Ccedil: "\
|
|
1247
1247
|
\xC7", ccedil: "\xE7", cedil: "\xB8", cent: "\xA2", copy: "\xA9", COPY: "\xA9", curren: "\xA4", deg: "\xB0", divide: "\xF7", Eacute: "\xC9",
|
|
1248
1248
|
eacute: "\xE9", Ecirc: "\xCA", ecirc: "\xEA", Egrave: "\xC8", egrave: "\xE8", ETH: "\xD0", eth: "\xF0", Euml: "\xCB", euml: "\xEB", frac12: "\
|
|
@@ -1256,25 +1256,25 @@ var qn = O((Ep, Wi) => {
|
|
|
1256
1256
|
});
|
|
1257
1257
|
|
|
1258
1258
|
// ../node_modules/ansi-to-html/node_modules/entities/lib/maps/xml.json
|
|
1259
|
-
var
|
|
1260
|
-
|
|
1259
|
+
var Et = O((kp, Qi) => {
|
|
1260
|
+
Qi.exports = { amp: "&", apos: "'", gt: ">", lt: "<", quot: '"' };
|
|
1261
1261
|
});
|
|
1262
1262
|
|
|
1263
1263
|
// ../node_modules/ansi-to-html/node_modules/entities/lib/maps/decode.json
|
|
1264
|
-
var
|
|
1265
|
-
|
|
1264
|
+
var Un = O((jp, Zi) => {
|
|
1265
|
+
Zi.exports = { "0": 65533, "128": 8364, "130": 8218, "131": 402, "132": 8222, "133": 8230, "134": 8224, "135": 8225, "136": 710, "137": 8240,
|
|
1266
1266
|
"138": 352, "139": 8249, "140": 338, "142": 381, "145": 8216, "146": 8217, "147": 8220, "148": 8221, "149": 8226, "150": 8211, "151": 8212,
|
|
1267
1267
|
"152": 732, "153": 8482, "154": 353, "155": 8250, "156": 339, "158": 382, "159": 376 };
|
|
1268
1268
|
});
|
|
1269
1269
|
|
|
1270
1270
|
// ../node_modules/ansi-to-html/node_modules/entities/lib/decode_codepoint.js
|
|
1271
|
-
var
|
|
1271
|
+
var Hn = O((Je) => {
|
|
1272
1272
|
"use strict";
|
|
1273
|
-
var
|
|
1273
|
+
var ea = Je && Je.__importDefault || function(r) {
|
|
1274
1274
|
return r && r.__esModule ? r : { default: r };
|
|
1275
1275
|
};
|
|
1276
1276
|
Object.defineProperty(Je, "__esModule", { value: !0 });
|
|
1277
|
-
var
|
|
1277
|
+
var Vn = ea(Un()), ra = (
|
|
1278
1278
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
1279
1279
|
String.fromCodePoint || function(r) {
|
|
1280
1280
|
var e = "";
|
|
@@ -1282,38 +1282,38 @@ var Gn = O((Je) => {
|
|
|
1282
1282
|
e;
|
|
1283
1283
|
}
|
|
1284
1284
|
);
|
|
1285
|
-
function
|
|
1286
|
-
return r >= 55296 && r <= 57343 || r > 1114111 ? "\uFFFD" : (r in
|
|
1285
|
+
function ta(r) {
|
|
1286
|
+
return r >= 55296 && r <= 57343 || r > 1114111 ? "\uFFFD" : (r in Vn.default && (r = Vn.default[r]), ra(r));
|
|
1287
1287
|
}
|
|
1288
|
-
s(
|
|
1289
|
-
Je.default =
|
|
1288
|
+
s(ta, "decodeCodePoint");
|
|
1289
|
+
Je.default = ta;
|
|
1290
1290
|
});
|
|
1291
1291
|
|
|
1292
1292
|
// ../node_modules/ansi-to-html/node_modules/entities/lib/decode.js
|
|
1293
|
-
var
|
|
1293
|
+
var Ct = O((X) => {
|
|
1294
1294
|
"use strict";
|
|
1295
1295
|
var Fr = X && X.__importDefault || function(r) {
|
|
1296
1296
|
return r && r.__esModule ? r : { default: r };
|
|
1297
1297
|
};
|
|
1298
1298
|
Object.defineProperty(X, "__esModule", { value: !0 });
|
|
1299
1299
|
X.decodeHTML = X.decodeHTMLStrict = X.decodeXML = void 0;
|
|
1300
|
-
var
|
|
1301
|
-
X.decodeXML =
|
|
1302
|
-
X.decodeHTMLStrict =
|
|
1303
|
-
function
|
|
1304
|
-
var e =
|
|
1300
|
+
var At = Fr(wt()), oa = Fr(Gn()), na = Fr(Et()), Wn = Fr(Hn()), sa = /&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;
|
|
1301
|
+
X.decodeXML = Yn(na.default);
|
|
1302
|
+
X.decodeHTMLStrict = Yn(At.default);
|
|
1303
|
+
function Yn(r) {
|
|
1304
|
+
var e = Kn(r);
|
|
1305
1305
|
return function(t) {
|
|
1306
|
-
return String(t).replace(
|
|
1306
|
+
return String(t).replace(sa, e);
|
|
1307
1307
|
};
|
|
1308
1308
|
}
|
|
1309
|
-
s(
|
|
1310
|
-
var
|
|
1309
|
+
s(Yn, "getStrictDecoder");
|
|
1310
|
+
var $n = /* @__PURE__ */ s(function(r, e) {
|
|
1311
1311
|
return r < e ? 1 : -1;
|
|
1312
1312
|
}, "sorter");
|
|
1313
1313
|
X.decodeHTML = function() {
|
|
1314
|
-
for (var r = Object.keys(
|
|
1314
|
+
for (var r = Object.keys(oa.default).sort($n), e = Object.keys(At.default).sort($n), t = 0, o = 0; t < e.length; t++)
|
|
1315
1315
|
r[o] === e[t] ? (e[t] += ";?", o++) : e[t] += ";";
|
|
1316
|
-
var n = new RegExp("&(?:" + e.join("|") + "|#[xX][\\da-fA-F]+;?|#\\d+;?)", "g"), i =
|
|
1316
|
+
var n = new RegExp("&(?:" + e.join("|") + "|#[xX][\\da-fA-F]+;?|#\\d+;?)", "g"), i = Kn(At.default);
|
|
1317
1317
|
function a(l) {
|
|
1318
1318
|
return l.substr(-1) !== ";" && (l += ";"), i(l);
|
|
1319
1319
|
}
|
|
@@ -1321,38 +1321,38 @@ var wt = O((X) => {
|
|
|
1321
1321
|
return String(l).replace(n, a);
|
|
1322
1322
|
};
|
|
1323
1323
|
}();
|
|
1324
|
-
function
|
|
1324
|
+
function Kn(r) {
|
|
1325
1325
|
return /* @__PURE__ */ s(function(t) {
|
|
1326
1326
|
if (t.charAt(1) === "#") {
|
|
1327
1327
|
var o = t.charAt(2);
|
|
1328
|
-
return o === "X" || o === "x" ?
|
|
1328
|
+
return o === "X" || o === "x" ? Wn.default(parseInt(t.substr(3), 16)) : Wn.default(parseInt(t.substr(2), 10));
|
|
1329
1329
|
}
|
|
1330
1330
|
return r[t.slice(1, -1)] || t;
|
|
1331
1331
|
}, "replace");
|
|
1332
1332
|
}
|
|
1333
|
-
s(
|
|
1333
|
+
s(Kn, "getReplacer");
|
|
1334
1334
|
});
|
|
1335
1335
|
|
|
1336
1336
|
// ../node_modules/ansi-to-html/node_modules/entities/lib/encode.js
|
|
1337
|
-
var
|
|
1337
|
+
var Pt = O((N) => {
|
|
1338
1338
|
"use strict";
|
|
1339
|
-
var
|
|
1339
|
+
var Xn = N && N.__importDefault || function(r) {
|
|
1340
1340
|
return r && r.__esModule ? r : { default: r };
|
|
1341
1341
|
};
|
|
1342
|
-
Object.defineProperty(
|
|
1343
|
-
|
|
1344
|
-
var
|
|
1345
|
-
|
|
1346
|
-
var
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
function
|
|
1342
|
+
Object.defineProperty(N, "__esModule", { value: !0 });
|
|
1343
|
+
N.escapeUTF8 = N.escape = N.encodeNonAsciiHTML = N.encodeHTML = N.encodeXML = void 0;
|
|
1344
|
+
var ia = Xn(Et()), Jn = Zn(ia.default), Qn = es(Jn);
|
|
1345
|
+
N.encodeXML = os(Jn);
|
|
1346
|
+
var aa = Xn(wt()), vt = Zn(aa.default), la = es(vt);
|
|
1347
|
+
N.encodeHTML = da(vt, la);
|
|
1348
|
+
N.encodeNonAsciiHTML = os(vt);
|
|
1349
|
+
function Zn(r) {
|
|
1350
1350
|
return Object.keys(r).sort().reduce(function(e, t) {
|
|
1351
1351
|
return e[r[t]] = "&" + t + ";", e;
|
|
1352
1352
|
}, {});
|
|
1353
1353
|
}
|
|
1354
|
-
s(
|
|
1355
|
-
function
|
|
1354
|
+
s(Zn, "getInverseObj");
|
|
1355
|
+
function es(r) {
|
|
1356
1356
|
for (var e = [], t = [], o = 0, n = Object.keys(r); o < n.length; o++) {
|
|
1357
1357
|
var i = n[o];
|
|
1358
1358
|
i.length === 1 ? e.push("\\" + i) : t.push(i);
|
|
@@ -1366,9 +1366,9 @@ var Et = O((q) => {
|
|
|
1366
1366
|
}
|
|
1367
1367
|
return t.unshift("[" + e.join("") + "]"), new RegExp(t.join("|"), "g");
|
|
1368
1368
|
}
|
|
1369
|
-
s(
|
|
1370
|
-
var
|
|
1371
|
-
|
|
1369
|
+
s(es, "getInverseReplacer");
|
|
1370
|
+
var rs = /(?:[\x80-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g,
|
|
1371
|
+
ca = (
|
|
1372
1372
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
1373
1373
|
String.prototype.codePointAt != null ? (
|
|
1374
1374
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -1383,62 +1383,62 @@ var Et = O((q) => {
|
|
|
1383
1383
|
)
|
|
1384
1384
|
);
|
|
1385
1385
|
function Ir(r) {
|
|
1386
|
-
return "&#x" + (r.length > 1 ?
|
|
1386
|
+
return "&#x" + (r.length > 1 ? ca(r) : r.charCodeAt(0)).toString(16).toUpperCase() + ";";
|
|
1387
1387
|
}
|
|
1388
1388
|
s(Ir, "singleCharReplacer");
|
|
1389
|
-
function
|
|
1389
|
+
function da(r, e) {
|
|
1390
1390
|
return function(t) {
|
|
1391
1391
|
return t.replace(e, function(o) {
|
|
1392
1392
|
return r[o];
|
|
1393
|
-
}).replace(
|
|
1393
|
+
}).replace(rs, Ir);
|
|
1394
1394
|
};
|
|
1395
1395
|
}
|
|
1396
|
-
s(
|
|
1397
|
-
var
|
|
1398
|
-
function
|
|
1399
|
-
return r.replace(
|
|
1396
|
+
s(da, "getInverse");
|
|
1397
|
+
var ts = new RegExp(Qn.source + "|" + rs.source, "g");
|
|
1398
|
+
function pa(r) {
|
|
1399
|
+
return r.replace(ts, Ir);
|
|
1400
1400
|
}
|
|
1401
|
-
s(
|
|
1402
|
-
|
|
1403
|
-
function
|
|
1404
|
-
return r.replace(
|
|
1401
|
+
s(pa, "escape");
|
|
1402
|
+
N.escape = pa;
|
|
1403
|
+
function ua(r) {
|
|
1404
|
+
return r.replace(Qn, Ir);
|
|
1405
1405
|
}
|
|
1406
|
-
s(
|
|
1407
|
-
|
|
1408
|
-
function
|
|
1406
|
+
s(ua, "escapeUTF8");
|
|
1407
|
+
N.escapeUTF8 = ua;
|
|
1408
|
+
function os(r) {
|
|
1409
1409
|
return function(e) {
|
|
1410
|
-
return e.replace(
|
|
1410
|
+
return e.replace(ts, function(t) {
|
|
1411
1411
|
return r[t] || Ir(t);
|
|
1412
1412
|
});
|
|
1413
1413
|
};
|
|
1414
1414
|
}
|
|
1415
|
-
s(
|
|
1415
|
+
s(os, "getASCIIEncoder");
|
|
1416
1416
|
});
|
|
1417
1417
|
|
|
1418
1418
|
// ../node_modules/ansi-to-html/node_modules/entities/lib/index.js
|
|
1419
|
-
var
|
|
1419
|
+
var ss = O((x) => {
|
|
1420
1420
|
"use strict";
|
|
1421
1421
|
Object.defineProperty(x, "__esModule", { value: !0 });
|
|
1422
1422
|
x.decodeXMLStrict = x.decodeHTML5Strict = x.decodeHTML4Strict = x.decodeHTML5 = x.decodeHTML4 = x.decodeHTMLStrict = x.decodeHTML = x.decodeXML =
|
|
1423
1423
|
x.encodeHTML5 = x.encodeHTML4 = x.escapeUTF8 = x.escape = x.encodeNonAsciiHTML = x.encodeHTML = x.encodeXML = x.encode = x.decodeStrict = x.
|
|
1424
1424
|
decode = void 0;
|
|
1425
|
-
var Or =
|
|
1426
|
-
function
|
|
1425
|
+
var Or = Ct(), ns = Pt();
|
|
1426
|
+
function fa(r, e) {
|
|
1427
1427
|
return (!e || e <= 0 ? Or.decodeXML : Or.decodeHTML)(r);
|
|
1428
1428
|
}
|
|
1429
|
-
s(
|
|
1430
|
-
x.decode =
|
|
1431
|
-
function
|
|
1429
|
+
s(fa, "decode");
|
|
1430
|
+
x.decode = fa;
|
|
1431
|
+
function ya(r, e) {
|
|
1432
1432
|
return (!e || e <= 0 ? Or.decodeXML : Or.decodeHTMLStrict)(r);
|
|
1433
1433
|
}
|
|
1434
|
-
s(
|
|
1435
|
-
x.decodeStrict =
|
|
1436
|
-
function
|
|
1437
|
-
return (!e || e <= 0 ?
|
|
1434
|
+
s(ya, "decodeStrict");
|
|
1435
|
+
x.decodeStrict = ya;
|
|
1436
|
+
function ma(r, e) {
|
|
1437
|
+
return (!e || e <= 0 ? ns.encodeXML : ns.encodeHTML)(r);
|
|
1438
1438
|
}
|
|
1439
|
-
s(
|
|
1440
|
-
x.encode =
|
|
1441
|
-
var we =
|
|
1439
|
+
s(ma, "encode");
|
|
1440
|
+
x.encode = ma;
|
|
1441
|
+
var we = Pt();
|
|
1442
1442
|
Object.defineProperty(x, "encodeXML", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
1443
1443
|
return we.encodeXML;
|
|
1444
1444
|
}, "get") });
|
|
@@ -1460,56 +1460,56 @@ var ts = O((x) => {
|
|
|
1460
1460
|
Object.defineProperty(x, "encodeHTML5", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
1461
1461
|
return we.encodeHTML;
|
|
1462
1462
|
}, "get") });
|
|
1463
|
-
var
|
|
1463
|
+
var de = Ct();
|
|
1464
1464
|
Object.defineProperty(x, "decodeXML", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
1465
|
-
return
|
|
1465
|
+
return de.decodeXML;
|
|
1466
1466
|
}, "get") });
|
|
1467
1467
|
Object.defineProperty(x, "decodeHTML", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
1468
|
-
return
|
|
1468
|
+
return de.decodeHTML;
|
|
1469
1469
|
}, "get") });
|
|
1470
1470
|
Object.defineProperty(x, "decodeHTMLStrict", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
1471
|
-
return
|
|
1471
|
+
return de.decodeHTMLStrict;
|
|
1472
1472
|
}, "get") });
|
|
1473
1473
|
Object.defineProperty(x, "decodeHTML4", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
1474
|
-
return
|
|
1474
|
+
return de.decodeHTML;
|
|
1475
1475
|
}, "get") });
|
|
1476
1476
|
Object.defineProperty(x, "decodeHTML5", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
1477
|
-
return
|
|
1477
|
+
return de.decodeHTML;
|
|
1478
1478
|
}, "get") });
|
|
1479
1479
|
Object.defineProperty(x, "decodeHTML4Strict", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
1480
|
-
return
|
|
1480
|
+
return de.decodeHTMLStrict;
|
|
1481
1481
|
}, "get") });
|
|
1482
1482
|
Object.defineProperty(x, "decodeHTML5Strict", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
1483
|
-
return
|
|
1483
|
+
return de.decodeHTMLStrict;
|
|
1484
1484
|
}, "get") });
|
|
1485
1485
|
Object.defineProperty(x, "decodeXMLStrict", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
1486
|
-
return
|
|
1486
|
+
return de.decodeXML;
|
|
1487
1487
|
}, "get") });
|
|
1488
1488
|
});
|
|
1489
1489
|
|
|
1490
1490
|
// ../node_modules/ansi-to-html/lib/ansi_to_html.js
|
|
1491
|
-
var
|
|
1491
|
+
var hs = O((Up, ms) => {
|
|
1492
1492
|
"use strict";
|
|
1493
|
-
function
|
|
1493
|
+
function ha(r, e) {
|
|
1494
1494
|
if (!(r instanceof e))
|
|
1495
1495
|
throw new TypeError("Cannot call a class as a function");
|
|
1496
1496
|
}
|
|
1497
|
-
s(
|
|
1498
|
-
function
|
|
1497
|
+
s(ha, "_classCallCheck");
|
|
1498
|
+
function is(r, e) {
|
|
1499
1499
|
for (var t = 0; t < e.length; t++) {
|
|
1500
1500
|
var o = e[t];
|
|
1501
1501
|
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(r, o.key, o);
|
|
1502
1502
|
}
|
|
1503
1503
|
}
|
|
1504
|
-
s(
|
|
1505
|
-
function
|
|
1506
|
-
return e &&
|
|
1504
|
+
s(is, "_defineProperties");
|
|
1505
|
+
function ga(r, e, t) {
|
|
1506
|
+
return e && is(r.prototype, e), t && is(r, t), r;
|
|
1507
1507
|
}
|
|
1508
|
-
s(
|
|
1509
|
-
function
|
|
1508
|
+
s(ga, "_createClass");
|
|
1509
|
+
function us(r, e) {
|
|
1510
1510
|
var t = typeof Symbol < "u" && r[Symbol.iterator] || r["@@iterator"];
|
|
1511
1511
|
if (!t) {
|
|
1512
|
-
if (Array.isArray(r) || (t =
|
|
1512
|
+
if (Array.isArray(r) || (t = ba(r)) || e && r && typeof r.length == "number") {
|
|
1513
1513
|
t && (r = t);
|
|
1514
1514
|
var o = 0, n = /* @__PURE__ */ s(function() {
|
|
1515
1515
|
}, "F");
|
|
@@ -1538,32 +1538,32 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1538
1538
|
}
|
|
1539
1539
|
}, "f") };
|
|
1540
1540
|
}
|
|
1541
|
-
s(
|
|
1542
|
-
function
|
|
1541
|
+
s(us, "_createForOfIteratorHelper");
|
|
1542
|
+
function ba(r, e) {
|
|
1543
1543
|
if (r) {
|
|
1544
|
-
if (typeof r == "string") return
|
|
1544
|
+
if (typeof r == "string") return as(r, e);
|
|
1545
1545
|
var t = Object.prototype.toString.call(r).slice(8, -1);
|
|
1546
1546
|
if (t === "Object" && r.constructor && (t = r.constructor.name), t === "Map" || t === "Set") return Array.from(r);
|
|
1547
|
-
if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return
|
|
1547
|
+
if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return as(r, e);
|
|
1548
1548
|
}
|
|
1549
1549
|
}
|
|
1550
|
-
s(
|
|
1551
|
-
function
|
|
1550
|
+
s(ba, "_unsupportedIterableToArray");
|
|
1551
|
+
function as(r, e) {
|
|
1552
1552
|
(e == null || e > r.length) && (e = r.length);
|
|
1553
1553
|
for (var t = 0, o = new Array(e); t < e; t++)
|
|
1554
1554
|
o[t] = r[t];
|
|
1555
1555
|
return o;
|
|
1556
1556
|
}
|
|
1557
|
-
s(
|
|
1558
|
-
var
|
|
1557
|
+
s(as, "_arrayLikeToArray");
|
|
1558
|
+
var Sa = ss(), ls = {
|
|
1559
1559
|
fg: "#FFF",
|
|
1560
1560
|
bg: "#000",
|
|
1561
1561
|
newline: !1,
|
|
1562
1562
|
escapeXML: !1,
|
|
1563
1563
|
stream: !1,
|
|
1564
|
-
colors:
|
|
1564
|
+
colors: Ta()
|
|
1565
1565
|
};
|
|
1566
|
-
function
|
|
1566
|
+
function Ta() {
|
|
1567
1567
|
var r = {
|
|
1568
1568
|
0: "#000",
|
|
1569
1569
|
1: "#A00",
|
|
@@ -1585,32 +1585,32 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1585
1585
|
return Dr(0, 5).forEach(function(e) {
|
|
1586
1586
|
Dr(0, 5).forEach(function(t) {
|
|
1587
1587
|
Dr(0, 5).forEach(function(o) {
|
|
1588
|
-
return
|
|
1588
|
+
return xa(e, t, o, r);
|
|
1589
1589
|
});
|
|
1590
1590
|
});
|
|
1591
1591
|
}), Dr(0, 23).forEach(function(e) {
|
|
1592
|
-
var t = e + 232, o =
|
|
1592
|
+
var t = e + 232, o = fs(e * 10 + 8);
|
|
1593
1593
|
r[t] = "#" + o + o + o;
|
|
1594
1594
|
}), r;
|
|
1595
1595
|
}
|
|
1596
|
-
s(
|
|
1597
|
-
function
|
|
1596
|
+
s(Ta, "getDefaultColors");
|
|
1597
|
+
function xa(r, e, t, o) {
|
|
1598
1598
|
var n = 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;
|
|
1599
|
-
o[n] =
|
|
1599
|
+
o[n] = Ra([i, a, l]);
|
|
1600
1600
|
}
|
|
1601
|
-
s(
|
|
1602
|
-
function
|
|
1601
|
+
s(xa, "setStyleColor");
|
|
1602
|
+
function fs(r) {
|
|
1603
1603
|
for (var e = r.toString(16); e.length < 2; )
|
|
1604
1604
|
e = "0" + e;
|
|
1605
1605
|
return e;
|
|
1606
1606
|
}
|
|
1607
|
-
s(
|
|
1608
|
-
function
|
|
1609
|
-
var e = [], t =
|
|
1607
|
+
s(fs, "toHexString");
|
|
1608
|
+
function Ra(r) {
|
|
1609
|
+
var e = [], t = us(r), o;
|
|
1610
1610
|
try {
|
|
1611
1611
|
for (t.s(); !(o = t.n()).done; ) {
|
|
1612
1612
|
var n = o.value;
|
|
1613
|
-
e.push(
|
|
1613
|
+
e.push(fs(n));
|
|
1614
1614
|
}
|
|
1615
1615
|
} catch (i) {
|
|
1616
1616
|
t.e(i);
|
|
@@ -1619,53 +1619,53 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1619
1619
|
}
|
|
1620
1620
|
return "#" + e.join("");
|
|
1621
1621
|
}
|
|
1622
|
-
s(
|
|
1623
|
-
function
|
|
1622
|
+
s(Ra, "toColorHexString");
|
|
1623
|
+
function cs(r, e, t, o) {
|
|
1624
1624
|
var n;
|
|
1625
|
-
return e === "text" ? n =
|
|
1626
|
-
erm256Background" ? n = Mr(r, o.colors[t]) : e === "rgb" && (n =
|
|
1625
|
+
return e === "text" ? n = Ca(t, o) : e === "display" ? n = Ea(r, t, o) : e === "xterm256Foreground" ? n = jr(r, o.colors[t]) : e === "xt\
|
|
1626
|
+
erm256Background" ? n = Mr(r, o.colors[t]) : e === "rgb" && (n = wa(r, t)), n;
|
|
1627
1627
|
}
|
|
1628
|
-
s(
|
|
1629
|
-
function
|
|
1628
|
+
s(cs, "generateOutput");
|
|
1629
|
+
function wa(r, e) {
|
|
1630
1630
|
e = e.substring(2).slice(0, -1);
|
|
1631
1631
|
var t = +e.substr(0, 2), o = e.substring(5).split(";"), n = o.map(function(i) {
|
|
1632
1632
|
return ("0" + Number(i).toString(16)).substr(-2);
|
|
1633
1633
|
}).join("");
|
|
1634
1634
|
return kr(r, (t === 38 ? "color:#" : "background-color:#") + n);
|
|
1635
1635
|
}
|
|
1636
|
-
s(
|
|
1637
|
-
function
|
|
1636
|
+
s(wa, "handleRgb");
|
|
1637
|
+
function Ea(r, e, t) {
|
|
1638
1638
|
e = parseInt(e, 10);
|
|
1639
1639
|
var o = {
|
|
1640
1640
|
"-1": /* @__PURE__ */ s(function() {
|
|
1641
1641
|
return "<br/>";
|
|
1642
1642
|
}, "_"),
|
|
1643
1643
|
0: /* @__PURE__ */ s(function() {
|
|
1644
|
-
return r.length &&
|
|
1644
|
+
return r.length && ys(r);
|
|
1645
1645
|
}, "_"),
|
|
1646
1646
|
1: /* @__PURE__ */ s(function() {
|
|
1647
|
-
return
|
|
1647
|
+
return pe(r, "b");
|
|
1648
1648
|
}, "_"),
|
|
1649
1649
|
3: /* @__PURE__ */ s(function() {
|
|
1650
|
-
return
|
|
1650
|
+
return pe(r, "i");
|
|
1651
1651
|
}, "_"),
|
|
1652
1652
|
4: /* @__PURE__ */ s(function() {
|
|
1653
|
-
return
|
|
1653
|
+
return pe(r, "u");
|
|
1654
1654
|
}, "_"),
|
|
1655
1655
|
8: /* @__PURE__ */ s(function() {
|
|
1656
1656
|
return kr(r, "display:none");
|
|
1657
1657
|
}, "_"),
|
|
1658
1658
|
9: /* @__PURE__ */ s(function() {
|
|
1659
|
-
return
|
|
1659
|
+
return pe(r, "strike");
|
|
1660
1660
|
}, "_"),
|
|
1661
1661
|
22: /* @__PURE__ */ s(function() {
|
|
1662
1662
|
return kr(r, "font-weight:normal;text-decoration:none;font-style:normal");
|
|
1663
1663
|
}, "_"),
|
|
1664
1664
|
23: /* @__PURE__ */ s(function() {
|
|
1665
|
-
return
|
|
1665
|
+
return ps(r, "i");
|
|
1666
1666
|
}, "_"),
|
|
1667
1667
|
24: /* @__PURE__ */ s(function() {
|
|
1668
|
-
return
|
|
1668
|
+
return ps(r, "u");
|
|
1669
1669
|
}, "_"),
|
|
1670
1670
|
39: /* @__PURE__ */ s(function() {
|
|
1671
1671
|
return jr(r, t.fg);
|
|
@@ -1677,107 +1677,107 @@ erm256Background" ? n = Mr(r, o.colors[t]) : e === "rgb" && (n = ba(r, t)), n;
|
|
|
1677
1677
|
return kr(r, "text-decoration:overline");
|
|
1678
1678
|
}, "_")
|
|
1679
1679
|
}, n;
|
|
1680
|
-
return o[e] ? n = o[e]() : 4 < e && e < 7 ? n =
|
|
1680
|
+
return o[e] ? n = o[e]() : 4 < e && e < 7 ? n = pe(r, "blink") : 29 < e && e < 38 ? n = jr(r, t.colors[e - 30]) : 39 < e && e < 48 ? n =
|
|
1681
1681
|
Mr(r, t.colors[e - 40]) : 89 < e && e < 98 ? n = jr(r, t.colors[8 + (e - 90)]) : 99 < e && e < 108 && (n = Mr(r, t.colors[8 + (e - 100)])),
|
|
1682
1682
|
n;
|
|
1683
1683
|
}
|
|
1684
|
-
s(
|
|
1685
|
-
function
|
|
1684
|
+
s(Ea, "handleDisplay");
|
|
1685
|
+
function ys(r) {
|
|
1686
1686
|
var e = r.slice(0);
|
|
1687
1687
|
return r.length = 0, e.reverse().map(function(t) {
|
|
1688
1688
|
return "</" + t + ">";
|
|
1689
1689
|
}).join("");
|
|
1690
1690
|
}
|
|
1691
|
-
s(
|
|
1691
|
+
s(ys, "resetStyles");
|
|
1692
1692
|
function Dr(r, e) {
|
|
1693
1693
|
for (var t = [], o = r; o <= e; o++)
|
|
1694
1694
|
t.push(o);
|
|
1695
1695
|
return t;
|
|
1696
1696
|
}
|
|
1697
1697
|
s(Dr, "range");
|
|
1698
|
-
function
|
|
1698
|
+
function Aa(r) {
|
|
1699
1699
|
return function(e) {
|
|
1700
1700
|
return (r === null || e.category !== r) && r !== "all";
|
|
1701
1701
|
};
|
|
1702
1702
|
}
|
|
1703
|
-
s(
|
|
1704
|
-
function
|
|
1703
|
+
s(Aa, "notCategory");
|
|
1704
|
+
function ds(r) {
|
|
1705
1705
|
r = parseInt(r, 10);
|
|
1706
1706
|
var e = null;
|
|
1707
1707
|
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\
|
|
1708
1708
|
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 <
|
|
1709
1709
|
r && r < 108) && (e = "background-color"), e;
|
|
1710
1710
|
}
|
|
1711
|
-
s(
|
|
1712
|
-
function
|
|
1713
|
-
return e.escapeXML ?
|
|
1711
|
+
s(ds, "categoryForCode");
|
|
1712
|
+
function Ca(r, e) {
|
|
1713
|
+
return e.escapeXML ? Sa.encodeXML(r) : r;
|
|
1714
1714
|
}
|
|
1715
|
-
s(
|
|
1716
|
-
function
|
|
1715
|
+
s(Ca, "pushText");
|
|
1716
|
+
function pe(r, e, t) {
|
|
1717
1717
|
return t || (t = ""), r.push(e), "<".concat(e).concat(t ? ' style="'.concat(t, '"') : "", ">");
|
|
1718
1718
|
}
|
|
1719
|
-
s(
|
|
1719
|
+
s(pe, "pushTag");
|
|
1720
1720
|
function kr(r, e) {
|
|
1721
|
-
return
|
|
1721
|
+
return pe(r, "span", e);
|
|
1722
1722
|
}
|
|
1723
1723
|
s(kr, "pushStyle");
|
|
1724
1724
|
function jr(r, e) {
|
|
1725
|
-
return
|
|
1725
|
+
return pe(r, "span", "color:" + e);
|
|
1726
1726
|
}
|
|
1727
1727
|
s(jr, "pushForegroundColor");
|
|
1728
1728
|
function Mr(r, e) {
|
|
1729
|
-
return
|
|
1729
|
+
return pe(r, "span", "background-color:" + e);
|
|
1730
1730
|
}
|
|
1731
1731
|
s(Mr, "pushBackgroundColor");
|
|
1732
|
-
function
|
|
1732
|
+
function ps(r, e) {
|
|
1733
1733
|
var t;
|
|
1734
1734
|
if (r.slice(-1)[0] === e && (t = r.pop()), t)
|
|
1735
1735
|
return "</" + e + ">";
|
|
1736
1736
|
}
|
|
1737
|
-
s(
|
|
1738
|
-
function
|
|
1737
|
+
s(ps, "closeTag");
|
|
1738
|
+
function va(r, e, t) {
|
|
1739
1739
|
var o = !1, n = 3;
|
|
1740
1740
|
function i() {
|
|
1741
1741
|
return "";
|
|
1742
1742
|
}
|
|
1743
1743
|
s(i, "remove");
|
|
1744
|
-
function a(
|
|
1745
|
-
return t("xterm256Foreground",
|
|
1744
|
+
function a(F, T) {
|
|
1745
|
+
return t("xterm256Foreground", T), "";
|
|
1746
1746
|
}
|
|
1747
1747
|
s(a, "removeXterm256Foreground");
|
|
1748
|
-
function l(
|
|
1749
|
-
return t("xterm256Background",
|
|
1748
|
+
function l(F, T) {
|
|
1749
|
+
return t("xterm256Background", T), "";
|
|
1750
1750
|
}
|
|
1751
1751
|
s(l, "removeXterm256Background");
|
|
1752
|
-
function c(
|
|
1753
|
-
return e.newline ? t("display", -1) : t("text",
|
|
1752
|
+
function c(F) {
|
|
1753
|
+
return e.newline ? t("display", -1) : t("text", F), "";
|
|
1754
1754
|
}
|
|
1755
1755
|
s(c, "newline");
|
|
1756
|
-
function d(
|
|
1757
|
-
o = !0,
|
|
1758
|
-
var
|
|
1756
|
+
function d(F, T) {
|
|
1757
|
+
o = !0, T.trim().length === 0 && (T = "0"), T = T.trimRight(";").split(";");
|
|
1758
|
+
var A = us(T), D;
|
|
1759
1759
|
try {
|
|
1760
|
-
for (
|
|
1761
|
-
var
|
|
1762
|
-
t("display",
|
|
1760
|
+
for (A.s(); !(D = A.n()).done; ) {
|
|
1761
|
+
var L = D.value;
|
|
1762
|
+
t("display", L);
|
|
1763
1763
|
}
|
|
1764
|
-
} catch (
|
|
1765
|
-
|
|
1764
|
+
} catch (G) {
|
|
1765
|
+
A.e(G);
|
|
1766
1766
|
} finally {
|
|
1767
|
-
|
|
1767
|
+
A.f();
|
|
1768
1768
|
}
|
|
1769
1769
|
return "";
|
|
1770
1770
|
}
|
|
1771
1771
|
s(d, "ansiMess");
|
|
1772
|
-
function u(
|
|
1773
|
-
return t("text",
|
|
1772
|
+
function u(F) {
|
|
1773
|
+
return t("text", F), "";
|
|
1774
1774
|
}
|
|
1775
1775
|
s(u, "realText");
|
|
1776
|
-
function p(
|
|
1777
|
-
return t("rgb",
|
|
1776
|
+
function p(F) {
|
|
1777
|
+
return t("rgb", F), "";
|
|
1778
1778
|
}
|
|
1779
1779
|
s(p, "rgb");
|
|
1780
|
-
var
|
|
1780
|
+
var h = [{
|
|
1781
1781
|
pattern: /^\x08+/,
|
|
1782
1782
|
sub: i
|
|
1783
1783
|
}, {
|
|
@@ -1837,120 +1837,120 @@ e" : r === 9 ? e = "strike" : 29 < r && r < 38 || r === 39 || 89 < r && r < 98 ?
|
|
|
1837
1837
|
pattern: /^(([^\x1b\x08\r\n])+)/,
|
|
1838
1838
|
sub: u
|
|
1839
1839
|
}];
|
|
1840
|
-
function
|
|
1841
|
-
|
|
1840
|
+
function g(F, T) {
|
|
1841
|
+
T > n && o || (o = !1, r = r.replace(F.pattern, F.sub));
|
|
1842
1842
|
}
|
|
1843
|
-
s(
|
|
1844
|
-
var E = [],
|
|
1845
|
-
e: for (;
|
|
1846
|
-
for (var
|
|
1847
|
-
var
|
|
1848
|
-
if (
|
|
1849
|
-
|
|
1843
|
+
s(g, "process");
|
|
1844
|
+
var E = [], R = r, m = R.length;
|
|
1845
|
+
e: for (; m > 0; ) {
|
|
1846
|
+
for (var b = 0, y = 0, f = h.length; y < f; b = ++y) {
|
|
1847
|
+
var S = h[b];
|
|
1848
|
+
if (g(S, b), r.length !== m) {
|
|
1849
|
+
m = r.length;
|
|
1850
1850
|
continue e;
|
|
1851
1851
|
}
|
|
1852
1852
|
}
|
|
1853
|
-
if (r.length ===
|
|
1853
|
+
if (r.length === m)
|
|
1854
1854
|
break;
|
|
1855
|
-
E.push(0),
|
|
1855
|
+
E.push(0), m = r.length;
|
|
1856
1856
|
}
|
|
1857
1857
|
return E;
|
|
1858
1858
|
}
|
|
1859
|
-
s(
|
|
1860
|
-
function
|
|
1861
|
-
return e !== "text" && (r = r.filter(
|
|
1859
|
+
s(va, "tokenize");
|
|
1860
|
+
function Pa(r, e, t) {
|
|
1861
|
+
return e !== "text" && (r = r.filter(Aa(ds(t))), r.push({
|
|
1862
1862
|
token: e,
|
|
1863
1863
|
data: t,
|
|
1864
|
-
category:
|
|
1864
|
+
category: ds(t)
|
|
1865
1865
|
})), r;
|
|
1866
1866
|
}
|
|
1867
|
-
s(
|
|
1868
|
-
var
|
|
1867
|
+
s(Pa, "updateStickyStack");
|
|
1868
|
+
var Fa = /* @__PURE__ */ function() {
|
|
1869
1869
|
function r(e) {
|
|
1870
|
-
|
|
1870
|
+
ha(this, r), e = e || {}, e.colors && (e.colors = Object.assign({}, ls.colors, e.colors)), this.options = Object.assign({}, ls, e), this.
|
|
1871
1871
|
stack = [], this.stickyStack = [];
|
|
1872
1872
|
}
|
|
1873
|
-
return s(r, "Filter"),
|
|
1873
|
+
return s(r, "Filter"), ga(r, [{
|
|
1874
1874
|
key: "toHtml",
|
|
1875
1875
|
value: /* @__PURE__ */ s(function(t) {
|
|
1876
1876
|
var o = this;
|
|
1877
1877
|
t = typeof t == "string" ? [t] : t;
|
|
1878
1878
|
var n = this.stack, i = this.options, a = [];
|
|
1879
1879
|
return this.stickyStack.forEach(function(l) {
|
|
1880
|
-
var c =
|
|
1880
|
+
var c = cs(n, l.token, l.data, i);
|
|
1881
1881
|
c && a.push(c);
|
|
1882
|
-
}),
|
|
1883
|
-
var d =
|
|
1884
|
-
d && a.push(d), i.stream && (o.stickyStack =
|
|
1885
|
-
}), n.length && a.push(
|
|
1882
|
+
}), va(t.join(""), i, function(l, c) {
|
|
1883
|
+
var d = cs(n, l, c, i);
|
|
1884
|
+
d && a.push(d), i.stream && (o.stickyStack = Pa(o.stickyStack, l, c));
|
|
1885
|
+
}), n.length && a.push(ys(n)), a.join("");
|
|
1886
1886
|
}, "toHtml")
|
|
1887
1887
|
}]), r;
|
|
1888
1888
|
}();
|
|
1889
|
-
|
|
1889
|
+
ms.exports = Fa;
|
|
1890
1890
|
});
|
|
1891
1891
|
|
|
1892
1892
|
// src/preview-api/index.ts
|
|
1893
|
-
var
|
|
1894
|
-
|
|
1895
|
-
DocsContext: () =>
|
|
1893
|
+
var ka = {};
|
|
1894
|
+
_s(ka, {
|
|
1895
|
+
DocsContext: () => ee,
|
|
1896
1896
|
HooksContext: () => te,
|
|
1897
1897
|
Preview: () => be,
|
|
1898
1898
|
PreviewWeb: () => Qe,
|
|
1899
1899
|
PreviewWithSelection: () => Se,
|
|
1900
|
-
ReporterAPI: () =>
|
|
1900
|
+
ReporterAPI: () => ie,
|
|
1901
1901
|
StoryStore: () => he,
|
|
1902
1902
|
UrlStore: () => Re,
|
|
1903
|
-
WebView: () =>
|
|
1904
|
-
addons: () =>
|
|
1903
|
+
WebView: () => Ee,
|
|
1904
|
+
addons: () => q,
|
|
1905
1905
|
applyHooks: () => or,
|
|
1906
|
-
combineArgs: () =>
|
|
1906
|
+
combineArgs: () => Ie,
|
|
1907
1907
|
combineParameters: () => z,
|
|
1908
|
-
composeConfigs: () =>
|
|
1908
|
+
composeConfigs: () => Z,
|
|
1909
1909
|
composeStepRunners: () => gr,
|
|
1910
|
-
composeStories: () =>
|
|
1911
|
-
composeStory: () =>
|
|
1912
|
-
createPlaywrightTest: () =>
|
|
1913
|
-
decorateStory: () =>
|
|
1910
|
+
composeStories: () => tn,
|
|
1911
|
+
composeStory: () => dt,
|
|
1912
|
+
createPlaywrightTest: () => on,
|
|
1913
|
+
decorateStory: () => it,
|
|
1914
1914
|
defaultDecorateStory: () => fr,
|
|
1915
|
-
definePreview: () =>
|
|
1915
|
+
definePreview: () => _t,
|
|
1916
|
+
emitTransformCode: () => Dt,
|
|
1916
1917
|
filterArgTypes: () => Ge,
|
|
1917
|
-
|
|
1918
|
-
getCoreAnnotations: () => tt,
|
|
1918
|
+
getCoreAnnotations: () => ne,
|
|
1919
1919
|
getCsfFactoryAnnotations: () => Sr,
|
|
1920
|
-
inferControls: () =>
|
|
1921
|
-
makeDecorator: () =>
|
|
1920
|
+
inferControls: () => ke,
|
|
1921
|
+
makeDecorator: () => Kt,
|
|
1922
1922
|
mockChannel: () => rr,
|
|
1923
|
-
normalizeProjectAnnotations: () =>
|
|
1924
|
-
normalizeStory: () =>
|
|
1923
|
+
normalizeProjectAnnotations: () => me,
|
|
1924
|
+
normalizeStory: () => ye,
|
|
1925
1925
|
prepareMeta: () => mr,
|
|
1926
|
-
prepareStory: () =>
|
|
1927
|
-
sanitizeStoryContextUpdate: () =>
|
|
1928
|
-
setDefaultProjectAnnotations: () =>
|
|
1929
|
-
setProjectAnnotations: () =>
|
|
1926
|
+
prepareStory: () => De,
|
|
1927
|
+
sanitizeStoryContextUpdate: () => at,
|
|
1928
|
+
setDefaultProjectAnnotations: () => en,
|
|
1929
|
+
setProjectAnnotations: () => rn,
|
|
1930
1930
|
simulateDOMContentLoaded: () => Ze,
|
|
1931
|
-
simulatePageLoad: () =>
|
|
1932
|
-
sortStoriesV7: () =>
|
|
1933
|
-
useArgs: () =>
|
|
1934
|
-
useCallback: () =>
|
|
1935
|
-
useChannel: () =>
|
|
1931
|
+
simulatePageLoad: () => Ot,
|
|
1932
|
+
sortStoriesV7: () => fn,
|
|
1933
|
+
useArgs: () => $t,
|
|
1934
|
+
useCallback: () => Pe,
|
|
1935
|
+
useChannel: () => Ht,
|
|
1936
1936
|
useEffect: () => Br,
|
|
1937
|
-
useGlobals: () =>
|
|
1938
|
-
useMemo: () =>
|
|
1939
|
-
useParameter: () =>
|
|
1940
|
-
useReducer: () =>
|
|
1941
|
-
useRef: () =>
|
|
1942
|
-
useState: () =>
|
|
1943
|
-
useStoryContext: () =>
|
|
1944
|
-
userOrAutoTitle: () =>
|
|
1945
|
-
userOrAutoTitleFromSpecifier: () =>
|
|
1937
|
+
useGlobals: () => Yt,
|
|
1938
|
+
useMemo: () => qt,
|
|
1939
|
+
useParameter: () => Wt,
|
|
1940
|
+
useReducer: () => Vt,
|
|
1941
|
+
useRef: () => Bt,
|
|
1942
|
+
useState: () => Ut,
|
|
1943
|
+
useStoryContext: () => Ne,
|
|
1944
|
+
userOrAutoTitle: () => cn,
|
|
1945
|
+
userOrAutoTitleFromSpecifier: () => ut
|
|
1946
1946
|
});
|
|
1947
|
-
module.exports =
|
|
1947
|
+
module.exports = Ls(ka);
|
|
1948
1948
|
|
|
1949
1949
|
// src/preview-api/modules/addons/main.ts
|
|
1950
1950
|
var tr = require("@storybook/global");
|
|
1951
1951
|
|
|
1952
1952
|
// src/preview-api/modules/addons/storybook-channel-mock.ts
|
|
1953
|
-
var
|
|
1953
|
+
var Mt = require("storybook/internal/channels");
|
|
1954
1954
|
function rr() {
|
|
1955
1955
|
let r = {
|
|
1956
1956
|
setHandler: /* @__PURE__ */ s(() => {
|
|
@@ -1958,7 +1958,7 @@ function rr() {
|
|
|
1958
1958
|
send: /* @__PURE__ */ s(() => {
|
|
1959
1959
|
}, "send")
|
|
1960
1960
|
};
|
|
1961
|
-
return new
|
|
1961
|
+
return new Mt.Channel({ transport: r });
|
|
1962
1962
|
}
|
|
1963
1963
|
s(rr, "mockChannel");
|
|
1964
1964
|
|
|
@@ -1985,20 +1985,20 @@ var Lr = class {
|
|
|
1985
1985
|
s(this, "AddonStore");
|
|
1986
1986
|
}
|
|
1987
1987
|
}, _r = "__STORYBOOK_ADDONS_PREVIEW";
|
|
1988
|
-
function
|
|
1988
|
+
function Ns() {
|
|
1989
1989
|
return tr.global[_r] || (tr.global[_r] = new Lr()), tr.global[_r];
|
|
1990
1990
|
}
|
|
1991
|
-
s(
|
|
1992
|
-
var
|
|
1991
|
+
s(Ns, "getAddonsStore");
|
|
1992
|
+
var q = Ns();
|
|
1993
1993
|
|
|
1994
1994
|
// src/preview-api/modules/addons/definePreview.ts
|
|
1995
|
-
function
|
|
1995
|
+
function _t(r) {
|
|
1996
1996
|
return r;
|
|
1997
1997
|
}
|
|
1998
|
-
s(
|
|
1998
|
+
s(_t, "definePreview");
|
|
1999
1999
|
|
|
2000
2000
|
// src/preview-api/modules/addons/hooks.ts
|
|
2001
|
-
var
|
|
2001
|
+
var ve = require("storybook/internal/client-logger"), U = require("storybook/internal/core-events"), Le = require("@storybook/global");
|
|
2002
2002
|
var te = class {
|
|
2003
2003
|
constructor() {
|
|
2004
2004
|
this.hookListsMap = void 0;
|
|
@@ -2042,22 +2042,22 @@ var te = class {
|
|
|
2042
2042
|
}), this.prevEffects = this.currentEffects, this.currentEffects = [];
|
|
2043
2043
|
}
|
|
2044
2044
|
addRenderListeners() {
|
|
2045
|
-
this.removeRenderListeners(),
|
|
2045
|
+
this.removeRenderListeners(), q.getChannel().on(U.STORY_RENDERED, this.renderListener);
|
|
2046
2046
|
}
|
|
2047
2047
|
removeRenderListeners() {
|
|
2048
|
-
|
|
2048
|
+
q.getChannel().removeListener(U.STORY_RENDERED, this.renderListener);
|
|
2049
2049
|
}
|
|
2050
2050
|
};
|
|
2051
|
-
function
|
|
2051
|
+
function Lt(r) {
|
|
2052
2052
|
let e = /* @__PURE__ */ s((...t) => {
|
|
2053
2053
|
let { hooks: o } = typeof t[0] == "function" ? t[1] : t[0], n = o.currentPhase, i = o.currentHooks, a = o.nextHookIndex, l = o.currentDecoratorName;
|
|
2054
2054
|
o.currentDecoratorName = r.name, o.prevMountedDecorators.has(r) ? (o.currentPhase = "UPDATE", o.currentHooks = o.hookListsMap.get(r) || []) :
|
|
2055
2055
|
(o.currentPhase = "MOUNT", o.currentHooks = [], o.hookListsMap.set(r, o.currentHooks), o.prevMountedDecorators.add(r)), o.nextHookIndex =
|
|
2056
2056
|
0;
|
|
2057
|
-
let c =
|
|
2058
|
-
|
|
2057
|
+
let c = Le.global.STORYBOOK_HOOKS_CONTEXT;
|
|
2058
|
+
Le.global.STORYBOOK_HOOKS_CONTEXT = o;
|
|
2059
2059
|
let d = r(...t);
|
|
2060
|
-
if (
|
|
2060
|
+
if (Le.global.STORYBOOK_HOOKS_CONTEXT = c, o.currentPhase === "UPDATE" && o.getNextHook() != null)
|
|
2061
2061
|
throw new Error(
|
|
2062
2062
|
"Rendered fewer hooks than expected. This may be caused by an accidental early return statement."
|
|
2063
2063
|
);
|
|
@@ -2065,11 +2065,11 @@ function kt(r) {
|
|
|
2065
2065
|
}, "hookified");
|
|
2066
2066
|
return e.originalFn = r, e;
|
|
2067
2067
|
}
|
|
2068
|
-
s(
|
|
2069
|
-
var Nr = 0,
|
|
2068
|
+
s(Lt, "hookify");
|
|
2069
|
+
var Nr = 0, qs = 25, or = /* @__PURE__ */ s((r) => (e, t) => {
|
|
2070
2070
|
let o = r(
|
|
2071
|
-
|
|
2072
|
-
t.map((n) =>
|
|
2071
|
+
Lt(e),
|
|
2072
|
+
t.map((n) => Lt(n))
|
|
2073
2073
|
);
|
|
2074
2074
|
return (n) => {
|
|
2075
2075
|
let { hooks: i } = n;
|
|
@@ -2077,29 +2077,29 @@ var Nr = 0, js = 25, or = /* @__PURE__ */ s((r) => (e, t) => {
|
|
|
2077
2077
|
hasUpdates = !1;
|
|
2078
2078
|
let a = o(n);
|
|
2079
2079
|
for (Nr = 1; i.hasUpdates; )
|
|
2080
|
-
if (i.hasUpdates = !1, i.currentEffects = [], a = o(n), Nr += 1, Nr >
|
|
2080
|
+
if (i.hasUpdates = !1, i.currentEffects = [], a = o(n), Nr += 1, Nr > qs)
|
|
2081
2081
|
throw new Error(
|
|
2082
2082
|
"Too many re-renders. Storybook limits the number of renders to prevent an infinite loop."
|
|
2083
2083
|
);
|
|
2084
2084
|
return i.addRenderListeners(), a;
|
|
2085
2085
|
};
|
|
2086
|
-
}, "applyHooks"),
|
|
2086
|
+
}, "applyHooks"), zs = /* @__PURE__ */ s((r, e) => r.length === e.length && r.every((t, o) => t === e[o]), "areDepsEqual"), qr = /* @__PURE__ */ s(
|
|
2087
2087
|
() => new Error("Storybook preview hooks can only be called inside decorators and story functions."), "invalidHooksError");
|
|
2088
|
-
function
|
|
2089
|
-
return
|
|
2088
|
+
function Nt() {
|
|
2089
|
+
return Le.global.STORYBOOK_HOOKS_CONTEXT || null;
|
|
2090
2090
|
}
|
|
2091
|
-
s(
|
|
2091
|
+
s(Nt, "getHooksContextOrNull");
|
|
2092
2092
|
function zr() {
|
|
2093
|
-
let r =
|
|
2093
|
+
let r = Nt();
|
|
2094
2094
|
if (r == null)
|
|
2095
2095
|
throw qr();
|
|
2096
2096
|
return r;
|
|
2097
2097
|
}
|
|
2098
2098
|
s(zr, "getHooksContextOrThrow");
|
|
2099
|
-
function
|
|
2099
|
+
function Bs(r, e, t) {
|
|
2100
2100
|
let o = zr();
|
|
2101
2101
|
if (o.currentPhase === "MOUNT") {
|
|
2102
|
-
t != null && !Array.isArray(t) &&
|
|
2102
|
+
t != null && !Array.isArray(t) && ve.logger.warn(
|
|
2103
2103
|
`${r} received a final argument that is not an array (instead, received ${t}). When specified, the final argument must be an array.`
|
|
2104
2104
|
);
|
|
2105
2105
|
let n = { name: r, deps: t };
|
|
@@ -2109,22 +2109,22 @@ function _s(r, e, t) {
|
|
|
2109
2109
|
let n = o.getNextHook();
|
|
2110
2110
|
if (n == null)
|
|
2111
2111
|
throw new Error("Rendered more hooks than during the previous render.");
|
|
2112
|
-
return n.name !== r &&
|
|
2112
|
+
return n.name !== r && ve.logger.warn(
|
|
2113
2113
|
`Storybook has detected a change in the order of Hooks${o.currentDecoratorName ? ` called by ${o.currentDecoratorName}` : ""}. This wi\
|
|
2114
2114
|
ll lead to bugs and errors if not fixed.`
|
|
2115
|
-
), t != null && n.deps == null &&
|
|
2115
|
+
), t != null && n.deps == null && ve.logger.warn(
|
|
2116
2116
|
`${r} received a final argument during this render, but not during the previous render. Even though the final argument is optional, it\
|
|
2117
2117
|
s type cannot change between renders.`
|
|
2118
|
-
), t != null && n.deps != null && t.length !== n.deps.length &&
|
|
2118
|
+
), t != null && n.deps != null && t.length !== n.deps.length && ve.logger.warn(`The final argument passed to ${r} changed size between r\
|
|
2119
2119
|
enders. The order and size of this array must remain constant.
|
|
2120
2120
|
Previous: ${n.deps}
|
|
2121
|
-
Incoming: ${t}`), (t == null || n.deps == null || !
|
|
2121
|
+
Incoming: ${t}`), (t == null || n.deps == null || !zs(t, n.deps)) && (e(n), n.deps = t), n;
|
|
2122
2122
|
}
|
|
2123
2123
|
throw qr();
|
|
2124
2124
|
}
|
|
2125
|
-
s(
|
|
2125
|
+
s(Bs, "useHook");
|
|
2126
2126
|
function nr(r, e, t) {
|
|
2127
|
-
let { memoizedState: o } =
|
|
2127
|
+
let { memoizedState: o } = Bs(
|
|
2128
2128
|
r,
|
|
2129
2129
|
(n) => {
|
|
2130
2130
|
n.memoizedState = e();
|
|
@@ -2134,103 +2134,103 @@ function nr(r, e, t) {
|
|
|
2134
2134
|
return o;
|
|
2135
2135
|
}
|
|
2136
2136
|
s(nr, "useMemoLike");
|
|
2137
|
-
function
|
|
2137
|
+
function qt(r, e) {
|
|
2138
2138
|
return nr("useMemo", r, e);
|
|
2139
2139
|
}
|
|
2140
|
-
s(
|
|
2141
|
-
function
|
|
2140
|
+
s(qt, "useMemo");
|
|
2141
|
+
function Pe(r, e) {
|
|
2142
2142
|
return nr("useCallback", () => r, e);
|
|
2143
2143
|
}
|
|
2144
|
-
s(
|
|
2145
|
-
function
|
|
2144
|
+
s(Pe, "useCallback");
|
|
2145
|
+
function zt(r, e) {
|
|
2146
2146
|
return nr(r, () => ({ current: e }), []);
|
|
2147
2147
|
}
|
|
2148
|
-
s(
|
|
2149
|
-
function
|
|
2150
|
-
return
|
|
2148
|
+
s(zt, "useRefLike");
|
|
2149
|
+
function Bt(r) {
|
|
2150
|
+
return zt("useRef", r);
|
|
2151
2151
|
}
|
|
2152
|
-
s(
|
|
2153
|
-
function
|
|
2154
|
-
let r =
|
|
2152
|
+
s(Bt, "useRef");
|
|
2153
|
+
function Gs() {
|
|
2154
|
+
let r = Nt();
|
|
2155
2155
|
if (r != null && r.currentPhase !== "NONE")
|
|
2156
2156
|
r.hasUpdates = !0;
|
|
2157
2157
|
else
|
|
2158
2158
|
try {
|
|
2159
|
-
|
|
2159
|
+
q.getChannel().emit(U.FORCE_RE_RENDER);
|
|
2160
2160
|
} catch {
|
|
2161
|
-
|
|
2161
|
+
ve.logger.warn("State updates of Storybook preview hooks work only in browser");
|
|
2162
2162
|
}
|
|
2163
2163
|
}
|
|
2164
|
-
s(
|
|
2165
|
-
function
|
|
2166
|
-
let t =
|
|
2164
|
+
s(Gs, "triggerUpdate");
|
|
2165
|
+
function Gt(r, e) {
|
|
2166
|
+
let t = zt(
|
|
2167
2167
|
r,
|
|
2168
2168
|
// @ts-expect-error S type should never be function, but there's no way to tell that to TypeScript
|
|
2169
2169
|
typeof e == "function" ? e() : e
|
|
2170
2170
|
), o = /* @__PURE__ */ s((n) => {
|
|
2171
|
-
t.current = typeof n == "function" ? n(t.current) : n,
|
|
2171
|
+
t.current = typeof n == "function" ? n(t.current) : n, Gs();
|
|
2172
2172
|
}, "setState");
|
|
2173
2173
|
return [t.current, o];
|
|
2174
2174
|
}
|
|
2175
|
-
s(
|
|
2176
|
-
function
|
|
2177
|
-
return
|
|
2175
|
+
s(Gt, "useStateLike");
|
|
2176
|
+
function Ut(r) {
|
|
2177
|
+
return Gt("useState", r);
|
|
2178
2178
|
}
|
|
2179
|
-
s(
|
|
2180
|
-
function
|
|
2181
|
-
let o = t != null ? () => t(e) : e, [n, i] =
|
|
2179
|
+
s(Ut, "useState");
|
|
2180
|
+
function Vt(r, e, t) {
|
|
2181
|
+
let o = t != null ? () => t(e) : e, [n, i] = Gt("useReducer", o);
|
|
2182
2182
|
return [n, /* @__PURE__ */ s((l) => i((c) => r(c, l)), "dispatch")];
|
|
2183
2183
|
}
|
|
2184
|
-
s(
|
|
2184
|
+
s(Vt, "useReducer");
|
|
2185
2185
|
function Br(r, e) {
|
|
2186
2186
|
let t = zr(), o = nr("useEffect", () => ({ create: r }), e);
|
|
2187
2187
|
t.currentEffects.includes(o) || t.currentEffects.push(o);
|
|
2188
2188
|
}
|
|
2189
2189
|
s(Br, "useEffect");
|
|
2190
|
-
function
|
|
2191
|
-
let t =
|
|
2190
|
+
function Ht(r, e = []) {
|
|
2191
|
+
let t = q.getChannel();
|
|
2192
2192
|
return Br(() => (Object.entries(r).forEach(([o, n]) => t.on(o, n)), () => {
|
|
2193
2193
|
Object.entries(r).forEach(
|
|
2194
2194
|
([o, n]) => t.removeListener(o, n)
|
|
2195
2195
|
);
|
|
2196
|
-
}), [...Object.keys(r), ...e]),
|
|
2196
|
+
}), [...Object.keys(r), ...e]), Pe(t.emit.bind(t), [t]);
|
|
2197
2197
|
}
|
|
2198
|
-
s(
|
|
2199
|
-
function
|
|
2198
|
+
s(Ht, "useChannel");
|
|
2199
|
+
function Ne() {
|
|
2200
2200
|
let { currentContext: r } = zr();
|
|
2201
2201
|
if (r == null)
|
|
2202
2202
|
throw qr();
|
|
2203
2203
|
return r;
|
|
2204
2204
|
}
|
|
2205
|
-
s(
|
|
2206
|
-
function
|
|
2207
|
-
let { parameters: t } =
|
|
2205
|
+
s(Ne, "useStoryContext");
|
|
2206
|
+
function Wt(r, e) {
|
|
2207
|
+
let { parameters: t } = Ne();
|
|
2208
2208
|
if (r)
|
|
2209
2209
|
return t[r] ?? e;
|
|
2210
2210
|
}
|
|
2211
|
-
s(
|
|
2212
|
-
function
|
|
2213
|
-
let r =
|
|
2214
|
-
(i) => r.emit(
|
|
2211
|
+
s(Wt, "useParameter");
|
|
2212
|
+
function $t() {
|
|
2213
|
+
let r = q.getChannel(), { id: e, args: t } = Ne(), o = Pe(
|
|
2214
|
+
(i) => r.emit(U.UPDATE_STORY_ARGS, { storyId: e, updatedArgs: i }),
|
|
2215
2215
|
[r, e]
|
|
2216
|
-
), n =
|
|
2217
|
-
(i) => r.emit(
|
|
2216
|
+
), n = Pe(
|
|
2217
|
+
(i) => r.emit(U.RESET_STORY_ARGS, { storyId: e, argNames: i }),
|
|
2218
2218
|
[r, e]
|
|
2219
2219
|
);
|
|
2220
2220
|
return [t, o, n];
|
|
2221
2221
|
}
|
|
2222
|
-
s(
|
|
2223
|
-
function
|
|
2224
|
-
let r =
|
|
2225
|
-
(o) => r.emit(
|
|
2222
|
+
s($t, "useArgs");
|
|
2223
|
+
function Yt() {
|
|
2224
|
+
let r = q.getChannel(), { globals: e } = Ne(), t = Pe(
|
|
2225
|
+
(o) => r.emit(U.UPDATE_GLOBALS, { globals: o }),
|
|
2226
2226
|
[r]
|
|
2227
2227
|
);
|
|
2228
2228
|
return [e, t];
|
|
2229
2229
|
}
|
|
2230
|
-
s(
|
|
2230
|
+
s(Yt, "useGlobals");
|
|
2231
2231
|
|
|
2232
2232
|
// src/preview-api/modules/addons/make-decorator.ts
|
|
2233
|
-
var
|
|
2233
|
+
var Kt = /* @__PURE__ */ s(({
|
|
2234
2234
|
name: r,
|
|
2235
2235
|
parameterName: e,
|
|
2236
2236
|
wrapper: t,
|
|
@@ -2268,7 +2268,7 @@ function Gr(r, e) {
|
|
|
2268
2268
|
s(Gr, "pickBy");
|
|
2269
2269
|
|
|
2270
2270
|
// ../node_modules/es-toolkit/dist/predicate/isPlainObject.mjs
|
|
2271
|
-
function
|
|
2271
|
+
function _(r) {
|
|
2272
2272
|
if (typeof r != "object" || r == null)
|
|
2273
2273
|
return !1;
|
|
2274
2274
|
if (Object.getPrototypeOf(r) === null)
|
|
@@ -2280,7 +2280,7 @@ function L(r) {
|
|
|
2280
2280
|
e = Object.getPrototypeOf(e);
|
|
2281
2281
|
return Object.getPrototypeOf(r) === e;
|
|
2282
2282
|
}
|
|
2283
|
-
s(
|
|
2283
|
+
s(_, "isPlainObject");
|
|
2284
2284
|
|
|
2285
2285
|
// ../node_modules/es-toolkit/dist/object/mapValues.mjs
|
|
2286
2286
|
function J(r, e) {
|
|
@@ -2294,17 +2294,17 @@ function J(r, e) {
|
|
|
2294
2294
|
s(J, "mapValues");
|
|
2295
2295
|
|
|
2296
2296
|
// ../node_modules/es-toolkit/dist/compat/_internal/tags.mjs
|
|
2297
|
-
var
|
|
2298
|
-
t Symbol]",
|
|
2299
|
-
rrayBuffer]", sr = "[object Object]",
|
|
2300
|
-
dArray]",
|
|
2301
|
-
Int16Array]",
|
|
2297
|
+
var Xt = "[object RegExp]", Jt = "[object String]", Qt = "[object Number]", Zt = "[object Boolean]", Ur = "[object Arguments]", eo = "[objec\
|
|
2298
|
+
t Symbol]", ro = "[object Date]", to = "[object Map]", oo = "[object Set]", no = "[object Array]", so = "[object Function]", io = "[object A\
|
|
2299
|
+
rrayBuffer]", sr = "[object Object]", ao = "[object Error]", lo = "[object DataView]", co = "[object Uint8Array]", po = "[object Uint8Clampe\
|
|
2300
|
+
dArray]", uo = "[object Uint16Array]", fo = "[object Uint32Array]", yo = "[object BigUint64Array]", mo = "[object Int8Array]", ho = "[object\
|
|
2301
|
+
Int16Array]", go = "[object Int32Array]", bo = "[object BigInt64Array]", So = "[object Float32Array]", To = "[object Float64Array]";
|
|
2302
2302
|
|
|
2303
2303
|
// ../node_modules/es-toolkit/dist/compat/_internal/getSymbols.mjs
|
|
2304
|
-
function
|
|
2304
|
+
function Vr(r) {
|
|
2305
2305
|
return Object.getOwnPropertySymbols(r).filter((e) => Object.prototype.propertyIsEnumerable.call(r, e));
|
|
2306
2306
|
}
|
|
2307
|
-
s(
|
|
2307
|
+
s(Vr, "getSymbols");
|
|
2308
2308
|
|
|
2309
2309
|
// ../node_modules/es-toolkit/dist/compat/_internal/getTag.mjs
|
|
2310
2310
|
function Hr(r) {
|
|
@@ -2336,22 +2336,22 @@ function Q(r, e, t) {
|
|
|
2336
2336
|
if (Object.is(r, e))
|
|
2337
2337
|
return !0;
|
|
2338
2338
|
let o = Hr(r), n = Hr(e);
|
|
2339
|
-
if (o ===
|
|
2339
|
+
if (o === Ur && (o = sr), n === Ur && (n = sr), o !== n)
|
|
2340
2340
|
return !1;
|
|
2341
2341
|
switch (o) {
|
|
2342
|
-
case
|
|
2342
|
+
case Jt:
|
|
2343
2343
|
return r.toString() === e.toString();
|
|
2344
|
-
case
|
|
2344
|
+
case Qt: {
|
|
2345
2345
|
let l = r.valueOf(), c = e.valueOf();
|
|
2346
2346
|
return l === c || Number.isNaN(l) && Number.isNaN(c);
|
|
2347
2347
|
}
|
|
2348
|
-
case
|
|
2349
|
-
case
|
|
2350
|
-
case
|
|
2348
|
+
case Zt:
|
|
2349
|
+
case ro:
|
|
2350
|
+
case eo:
|
|
2351
2351
|
return Object.is(r.valueOf(), e.valueOf());
|
|
2352
|
-
case
|
|
2352
|
+
case Xt:
|
|
2353
2353
|
return r.source === e.source && r.flags === e.flags;
|
|
2354
|
-
case
|
|
2354
|
+
case so:
|
|
2355
2355
|
return r === e;
|
|
2356
2356
|
}
|
|
2357
2357
|
t = t ?? /* @__PURE__ */ new Map();
|
|
@@ -2361,7 +2361,7 @@ function Q(r, e, t) {
|
|
|
2361
2361
|
t.set(r, e), t.set(e, r);
|
|
2362
2362
|
try {
|
|
2363
2363
|
switch (o) {
|
|
2364
|
-
case
|
|
2364
|
+
case to: {
|
|
2365
2365
|
if (r.size !== e.size)
|
|
2366
2366
|
return !1;
|
|
2367
2367
|
for (let [l, c] of r.entries())
|
|
@@ -2369,30 +2369,30 @@ function Q(r, e, t) {
|
|
|
2369
2369
|
return !1;
|
|
2370
2370
|
return !0;
|
|
2371
2371
|
}
|
|
2372
|
-
case
|
|
2372
|
+
case oo: {
|
|
2373
2373
|
if (r.size !== e.size)
|
|
2374
2374
|
return !1;
|
|
2375
2375
|
let l = Array.from(r.values()), c = Array.from(e.values());
|
|
2376
2376
|
for (let d = 0; d < l.length; d++) {
|
|
2377
|
-
let u = l[d], p = c.findIndex((
|
|
2377
|
+
let u = l[d], p = c.findIndex((h) => Q(u, h, t));
|
|
2378
2378
|
if (p === -1)
|
|
2379
2379
|
return !1;
|
|
2380
2380
|
c.splice(p, 1);
|
|
2381
2381
|
}
|
|
2382
2382
|
return !0;
|
|
2383
2383
|
}
|
|
2384
|
-
case
|
|
2385
|
-
case so:
|
|
2386
|
-
case io:
|
|
2387
|
-
case ao:
|
|
2388
|
-
case lo:
|
|
2384
|
+
case no:
|
|
2389
2385
|
case co:
|
|
2390
2386
|
case po:
|
|
2391
2387
|
case uo:
|
|
2392
2388
|
case fo:
|
|
2393
2389
|
case yo:
|
|
2394
2390
|
case mo:
|
|
2395
|
-
case ho:
|
|
2391
|
+
case ho:
|
|
2392
|
+
case go:
|
|
2393
|
+
case bo:
|
|
2394
|
+
case So:
|
|
2395
|
+
case To: {
|
|
2396
2396
|
if (typeof Buffer < "u" && Buffer.isBuffer(r) !== Buffer.isBuffer(e) || r.length !== e.length)
|
|
2397
2397
|
return !1;
|
|
2398
2398
|
for (let l = 0; l < r.length; l++)
|
|
@@ -2400,24 +2400,24 @@ function Q(r, e, t) {
|
|
|
2400
2400
|
return !1;
|
|
2401
2401
|
return !0;
|
|
2402
2402
|
}
|
|
2403
|
-
case
|
|
2403
|
+
case io:
|
|
2404
2404
|
return r.byteLength !== e.byteLength ? !1 : Q(new Uint8Array(r), new Uint8Array(e), t);
|
|
2405
|
-
case
|
|
2405
|
+
case lo:
|
|
2406
2406
|
return r.byteLength !== e.byteLength || r.byteOffset !== e.byteOffset ? !1 : Q(r.buffer, e.buffer, t);
|
|
2407
|
-
case
|
|
2407
|
+
case ao:
|
|
2408
2408
|
return r.name === e.name && r.message === e.message;
|
|
2409
2409
|
case sr: {
|
|
2410
|
-
if (!(Q(r.constructor, e.constructor, t) ||
|
|
2410
|
+
if (!(Q(r.constructor, e.constructor, t) || _(r) && _(e)))
|
|
2411
2411
|
return !1;
|
|
2412
|
-
let c = [...Object.keys(r), ...
|
|
2412
|
+
let c = [...Object.keys(r), ...Vr(r)], d = [...Object.keys(e), ...Vr(e)];
|
|
2413
2413
|
if (c.length !== d.length)
|
|
2414
2414
|
return !1;
|
|
2415
2415
|
for (let u = 0; u < c.length; u++) {
|
|
2416
|
-
let p = c[u],
|
|
2416
|
+
let p = c[u], h = r[p];
|
|
2417
2417
|
if (!Object.prototype.hasOwnProperty.call(e, p))
|
|
2418
2418
|
return !1;
|
|
2419
|
-
let
|
|
2420
|
-
if (!Q(
|
|
2419
|
+
let g = e[p];
|
|
2420
|
+
if (!Q(h, g, t))
|
|
2421
2421
|
return !1;
|
|
2422
2422
|
}
|
|
2423
2423
|
return !0;
|
|
@@ -2432,12 +2432,38 @@ function Q(r, e, t) {
|
|
|
2432
2432
|
s(Q, "areObjectsEqual");
|
|
2433
2433
|
|
|
2434
2434
|
// src/preview-api/modules/store/StoryStore.ts
|
|
2435
|
-
var Tr =
|
|
2435
|
+
var Tr = I($r(), 1);
|
|
2436
|
+
|
|
2437
|
+
// src/preview-api/core-annotations.ts
|
|
2438
|
+
var Yr = I(require("storybook/internal/component-testing/preview"), 1), Kr = I(require("storybook/actions/preview"), 1), Xr = I(require("storybook/backgrounds/preview"), 1),
|
|
2439
|
+
Jr = I(require("storybook/highlight/preview"), 1), Qr = I(require("storybook/measure/preview"), 1), Zr = I(require("storybook/outline/preview"), 1),
|
|
2440
|
+
et = I(require("storybook/test/preview"), 1), rt = I(require("storybook/viewport/preview"), 1);
|
|
2441
|
+
function ne() {
|
|
2442
|
+
return [
|
|
2443
|
+
// @ts-expect-error CJS fallback
|
|
2444
|
+
(Qr.default.default ?? Qr.default)(),
|
|
2445
|
+
// @ts-expect-error CJS fallback
|
|
2446
|
+
(Xr.default.default ?? Xr.default)(),
|
|
2447
|
+
// @ts-expect-error CJS fallback
|
|
2448
|
+
(Jr.default.default ?? Jr.default)(),
|
|
2449
|
+
// @ts-expect-error CJS fallback
|
|
2450
|
+
(Zr.default.default ?? Zr.default)(),
|
|
2451
|
+
// @ts-expect-error CJS fallback
|
|
2452
|
+
(rt.default.default ?? rt.default)(),
|
|
2453
|
+
// @ts-expect-error CJS fallback
|
|
2454
|
+
(Kr.default.default ?? Kr.default)(),
|
|
2455
|
+
// @ts-expect-error CJS fallback
|
|
2456
|
+
(Yr.default.default ?? Yr.default)(),
|
|
2457
|
+
// @ts-expect-error CJS fallback
|
|
2458
|
+
(et.default.default ?? et.default)()
|
|
2459
|
+
];
|
|
2460
|
+
}
|
|
2461
|
+
s(ne, "getCoreAnnotations");
|
|
2436
2462
|
|
|
2437
2463
|
// src/preview-api/modules/store/args.ts
|
|
2438
2464
|
var ir = require("storybook/internal/client-logger");
|
|
2439
|
-
var
|
|
2440
|
-
var
|
|
2465
|
+
var tt = I(W(), 1);
|
|
2466
|
+
var Fe = Symbol("incompatible"), ot = /* @__PURE__ */ s((r, e) => {
|
|
2441
2467
|
let t = e.type;
|
|
2442
2468
|
if (r == null || !t || e.mapping)
|
|
2443
2469
|
return r;
|
|
@@ -2451,47 +2477,47 @@ var Pe = Symbol("incompatible"), Kr = /* @__PURE__ */ s((r, e) => {
|
|
|
2451
2477
|
case "boolean":
|
|
2452
2478
|
return String(r) === "true";
|
|
2453
2479
|
case "array":
|
|
2454
|
-
return !t.value || !Array.isArray(r) ?
|
|
2455
|
-
let a =
|
|
2456
|
-
return a !==
|
|
2480
|
+
return !t.value || !Array.isArray(r) ? Fe : r.reduce((o, n, i) => {
|
|
2481
|
+
let a = ot(n, { type: t.value });
|
|
2482
|
+
return a !== Fe && (o[i] = a), o;
|
|
2457
2483
|
}, new Array(r.length));
|
|
2458
2484
|
case "object":
|
|
2459
|
-
return typeof r == "string" || typeof r == "number" ? r : !t.value || typeof r != "object" ?
|
|
2460
|
-
let a =
|
|
2461
|
-
return a ===
|
|
2485
|
+
return typeof r == "string" || typeof r == "number" ? r : !t.value || typeof r != "object" ? Fe : Object.entries(r).reduce((o, [n, i]) => {
|
|
2486
|
+
let a = ot(i, { type: t.value[n] });
|
|
2487
|
+
return a === Fe ? o : Object.assign(o, { [n]: a });
|
|
2462
2488
|
}, {});
|
|
2463
2489
|
default:
|
|
2464
|
-
return
|
|
2490
|
+
return Fe;
|
|
2465
2491
|
}
|
|
2466
|
-
}, "map"),
|
|
2492
|
+
}, "map"), Po = /* @__PURE__ */ s((r, e) => Object.entries(r).reduce((t, [o, n]) => {
|
|
2467
2493
|
if (!e[o])
|
|
2468
2494
|
return t;
|
|
2469
|
-
let i =
|
|
2470
|
-
return i ===
|
|
2471
|
-
}, {}), "mapArgsToTypes"),
|
|
2472
|
-
(t, o, n) => (t[n] =
|
|
2495
|
+
let i = ot(n, e[o]);
|
|
2496
|
+
return i === Fe ? t : Object.assign(t, { [o]: i });
|
|
2497
|
+
}, {}), "mapArgsToTypes"), Ie = /* @__PURE__ */ s((r, e) => Array.isArray(r) && Array.isArray(e) ? e.reduce(
|
|
2498
|
+
(t, o, n) => (t[n] = Ie(r[n], e[n]), t),
|
|
2473
2499
|
[...r]
|
|
2474
|
-
).filter((t) => t !== void 0) : !
|
|
2500
|
+
).filter((t) => t !== void 0) : !_(r) || !_(e) ? e : Object.keys({ ...r, ...e }).reduce((t, o) => {
|
|
2475
2501
|
if (o in e) {
|
|
2476
|
-
let n =
|
|
2502
|
+
let n = Ie(r[o], e[o]);
|
|
2477
2503
|
n !== void 0 && (t[o] = n);
|
|
2478
2504
|
} else
|
|
2479
2505
|
t[o] = r[o];
|
|
2480
2506
|
return t;
|
|
2481
|
-
}, {}), "combineArgs"),
|
|
2507
|
+
}, {}), "combineArgs"), Fo = /* @__PURE__ */ s((r, e) => Object.entries(e).reduce((t, [o, { options: n }]) => {
|
|
2482
2508
|
function i() {
|
|
2483
2509
|
return o in r && (t[o] = r[o]), t;
|
|
2484
2510
|
}
|
|
2485
2511
|
if (s(i, "allowArg"), !n)
|
|
2486
2512
|
return i();
|
|
2487
2513
|
if (!Array.isArray(n))
|
|
2488
|
-
return ir.once.error(
|
|
2514
|
+
return ir.once.error(tt.dedent`
|
|
2489
2515
|
Invalid argType: '${o}.options' should be an array.
|
|
2490
2516
|
|
|
2491
2517
|
More info: https://storybook.js.org/docs/api/arg-types
|
|
2492
2518
|
`), i();
|
|
2493
2519
|
if (n.some((p) => p && ["object", "function"].includes(typeof p)))
|
|
2494
|
-
return ir.once.error(
|
|
2520
|
+
return ir.once.error(tt.dedent`
|
|
2495
2521
|
Invalid argType: '${o}.options' should only contain primitives. Use a 'mapping' for complex values.
|
|
2496
2522
|
|
|
2497
2523
|
More info: https://storybook.js.org/docs/writing-stories/args#mapping-to-complex-arg-values
|
|
@@ -2501,40 +2527,40 @@ var Pe = Symbol("incompatible"), Kr = /* @__PURE__ */ s((r, e) => {
|
|
|
2501
2527
|
return i();
|
|
2502
2528
|
let d = a ? `${o}[${l}]` : o, u = n.map((p) => typeof p == "string" ? `'${p}'` : String(p)).join(", ");
|
|
2503
2529
|
return ir.once.warn(`Received illegal value for '${d}'. Supported options: ${u}`), t;
|
|
2504
|
-
}, {}), "validateOptions"),
|
|
2530
|
+
}, {}), "validateOptions"), ue = Symbol("Deeply equal"), Oe = /* @__PURE__ */ s((r, e) => {
|
|
2505
2531
|
if (typeof r != typeof e)
|
|
2506
2532
|
return e;
|
|
2507
2533
|
if (Wr(r, e))
|
|
2508
|
-
return
|
|
2534
|
+
return ue;
|
|
2509
2535
|
if (Array.isArray(r) && Array.isArray(e)) {
|
|
2510
2536
|
let t = e.reduce((o, n, i) => {
|
|
2511
|
-
let a =
|
|
2512
|
-
return a !==
|
|
2537
|
+
let a = Oe(r[i], n);
|
|
2538
|
+
return a !== ue && (o[i] = a), o;
|
|
2513
2539
|
}, new Array(e.length));
|
|
2514
2540
|
return e.length >= r.length ? t : t.concat(new Array(r.length - e.length).fill(void 0));
|
|
2515
2541
|
}
|
|
2516
|
-
return
|
|
2517
|
-
let n =
|
|
2518
|
-
return n ===
|
|
2542
|
+
return _(r) && _(e) ? Object.keys({ ...r, ...e }).reduce((t, o) => {
|
|
2543
|
+
let n = Oe(r?.[o], e?.[o]);
|
|
2544
|
+
return n === ue ? t : Object.assign(t, { [o]: n });
|
|
2519
2545
|
}, {}) : e;
|
|
2520
|
-
}, "deepDiff"),
|
|
2521
|
-
function
|
|
2546
|
+
}, "deepDiff"), nt = "UNTARGETED";
|
|
2547
|
+
function Io({
|
|
2522
2548
|
args: r,
|
|
2523
2549
|
argTypes: e
|
|
2524
2550
|
}) {
|
|
2525
2551
|
let t = {};
|
|
2526
2552
|
return Object.entries(r).forEach(([o, n]) => {
|
|
2527
|
-
let { target: i =
|
|
2553
|
+
let { target: i = nt } = e[o] || {};
|
|
2528
2554
|
t[i] = t[i] || {}, t[i][o] = n;
|
|
2529
2555
|
}), t;
|
|
2530
2556
|
}
|
|
2531
|
-
s(
|
|
2557
|
+
s(Io, "groupArgsByTarget");
|
|
2532
2558
|
|
|
2533
2559
|
// src/preview-api/modules/store/ArgsStore.ts
|
|
2534
|
-
function
|
|
2560
|
+
function Ws(r) {
|
|
2535
2561
|
return Object.keys(r).forEach((e) => r[e] === void 0 && delete r[e]), r;
|
|
2536
2562
|
}
|
|
2537
|
-
s(
|
|
2563
|
+
s(Ws, "deleteUndefined");
|
|
2538
2564
|
var ar = class {
|
|
2539
2565
|
constructor() {
|
|
2540
2566
|
this.initialArgsByStoryId = {};
|
|
@@ -2552,22 +2578,22 @@ var ar = class {
|
|
|
2552
2578
|
if (!this.initialArgsByStoryId[e.id])
|
|
2553
2579
|
this.initialArgsByStoryId[e.id] = e.initialArgs, this.argsByStoryId[e.id] = e.initialArgs;
|
|
2554
2580
|
else if (this.initialArgsByStoryId[e.id] !== e.initialArgs) {
|
|
2555
|
-
let t =
|
|
2556
|
-
this.initialArgsByStoryId[e.id] = e.initialArgs, this.argsByStoryId[e.id] = e.initialArgs, t !==
|
|
2581
|
+
let t = Oe(this.initialArgsByStoryId[e.id], this.argsByStoryId[e.id]);
|
|
2582
|
+
this.initialArgsByStoryId[e.id] = e.initialArgs, this.argsByStoryId[e.id] = e.initialArgs, t !== ue && this.updateFromDelta(e, t);
|
|
2557
2583
|
}
|
|
2558
2584
|
}
|
|
2559
2585
|
updateFromDelta(e, t) {
|
|
2560
|
-
let o =
|
|
2561
|
-
this.argsByStoryId[e.id] =
|
|
2586
|
+
let o = Fo(t, e.argTypes);
|
|
2587
|
+
this.argsByStoryId[e.id] = Ie(this.argsByStoryId[e.id], o);
|
|
2562
2588
|
}
|
|
2563
2589
|
updateFromPersisted(e, t) {
|
|
2564
|
-
let o =
|
|
2590
|
+
let o = Po(t, e.argTypes);
|
|
2565
2591
|
return this.updateFromDelta(e, o);
|
|
2566
2592
|
}
|
|
2567
2593
|
update(e, t) {
|
|
2568
2594
|
if (!(e in this.argsByStoryId))
|
|
2569
2595
|
throw new Error(`No args known for ${e} -- has it been rendered yet?`);
|
|
2570
|
-
this.argsByStoryId[e] =
|
|
2596
|
+
this.argsByStoryId[e] = Ws({
|
|
2571
2597
|
...this.argsByStoryId[e],
|
|
2572
2598
|
...t
|
|
2573
2599
|
});
|
|
@@ -2575,10 +2601,10 @@ var ar = class {
|
|
|
2575
2601
|
};
|
|
2576
2602
|
|
|
2577
2603
|
// src/preview-api/modules/store/GlobalsStore.ts
|
|
2578
|
-
var
|
|
2604
|
+
var Do = require("storybook/internal/client-logger");
|
|
2579
2605
|
|
|
2580
2606
|
// src/preview-api/modules/store/csf/getValuesFromArgTypes.ts
|
|
2581
|
-
var
|
|
2607
|
+
var Oo = /* @__PURE__ */ s((r = {}) => Object.entries(r).reduce((e, [t, { defaultValue: o }]) => (typeof o < "u" && (e[t] = o), e), {}), "ge\
|
|
2582
2608
|
tValuesFromArgTypes");
|
|
2583
2609
|
|
|
2584
2610
|
// src/preview-api/modules/store/GlobalsStore.ts
|
|
@@ -2593,13 +2619,13 @@ var lr = class {
|
|
|
2593
2619
|
this.set({ globals: e, globalTypes: t });
|
|
2594
2620
|
}
|
|
2595
2621
|
set({ globals: e = {}, globalTypes: t = {} }) {
|
|
2596
|
-
let o = this.initialGlobals &&
|
|
2622
|
+
let o = this.initialGlobals && Oe(this.initialGlobals, this.globals);
|
|
2597
2623
|
this.allowedGlobalNames = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)]);
|
|
2598
|
-
let n =
|
|
2599
|
-
this.initialGlobals = { ...n, ...e }, this.globals = this.initialGlobals, o && o !==
|
|
2624
|
+
let n = Oo(t);
|
|
2625
|
+
this.initialGlobals = { ...n, ...e }, this.globals = this.initialGlobals, o && o !== ue && this.updateFromPersisted(o);
|
|
2600
2626
|
}
|
|
2601
2627
|
filterAllowedGlobals(e) {
|
|
2602
|
-
return Object.entries(e).reduce((t, [o, n]) => (this.allowedGlobalNames.has(o) ? t[o] = n :
|
|
2628
|
+
return Object.entries(e).reduce((t, [o, n]) => (this.allowedGlobalNames.has(o) ? t[o] = n : Do.logger.warn(
|
|
2603
2629
|
`Attempted to set a global (${o}) that is not defined in initial globals or globalTypes`
|
|
2604
2630
|
), t), {});
|
|
2605
2631
|
}
|
|
@@ -2616,8 +2642,8 @@ var lr = class {
|
|
|
2616
2642
|
};
|
|
2617
2643
|
|
|
2618
2644
|
// src/preview-api/modules/store/StoryIndexStore.ts
|
|
2619
|
-
var
|
|
2620
|
-
var
|
|
2645
|
+
var ko = require("storybook/internal/preview-errors"), jo = I($r(), 1);
|
|
2646
|
+
var $s = (0, jo.default)(1)(
|
|
2621
2647
|
(r) => Object.values(r).reduce(
|
|
2622
2648
|
(e, t) => (e[t.importPath] = e[t.importPath] || t, e),
|
|
2623
2649
|
{}
|
|
@@ -2641,121 +2667,121 @@ var Gs = (0, Io.default)(1)(
|
|
|
2641
2667
|
storyIdToEntry(e) {
|
|
2642
2668
|
let t = this.entries[e];
|
|
2643
2669
|
if (!t)
|
|
2644
|
-
throw new
|
|
2670
|
+
throw new ko.MissingStoryAfterHmrError({ storyId: e });
|
|
2645
2671
|
return t;
|
|
2646
2672
|
}
|
|
2647
2673
|
importPathToEntry(e) {
|
|
2648
|
-
return
|
|
2674
|
+
return $s(this.entries)[e];
|
|
2649
2675
|
}
|
|
2650
2676
|
};
|
|
2651
2677
|
|
|
2652
2678
|
// src/preview-api/modules/store/csf/normalizeInputTypes.ts
|
|
2653
|
-
var
|
|
2654
|
-
g" ? { type: r } : r, "normalizeControl"),
|
|
2679
|
+
var Ys = /* @__PURE__ */ s((r) => typeof r == "string" ? { name: r } : r, "normalizeType"), Ks = /* @__PURE__ */ s((r) => typeof r == "strin\
|
|
2680
|
+
g" ? { type: r } : r, "normalizeControl"), Xs = /* @__PURE__ */ s((r, e) => {
|
|
2655
2681
|
let { type: t, control: o, ...n } = r, i = {
|
|
2656
2682
|
name: e,
|
|
2657
2683
|
...n
|
|
2658
2684
|
};
|
|
2659
|
-
return t && (i.type =
|
|
2660
|
-
}, "normalizeInputType"),
|
|
2685
|
+
return t && (i.type = Ys(t)), o ? i.control = Ks(o) : o === !1 && (i.control = { disable: !0 }), i;
|
|
2686
|
+
}, "normalizeInputType"), fe = /* @__PURE__ */ s((r) => J(r, Xs), "normalizeInputTypes");
|
|
2661
2687
|
|
|
2662
2688
|
// src/preview-api/modules/store/csf/normalizeStory.ts
|
|
2663
|
-
var dr = require("storybook/internal/client-logger"), pr = require("storybook/internal/csf"),
|
|
2689
|
+
var dr = require("storybook/internal/client-logger"), pr = require("storybook/internal/csf"), Mo = I(W(), 1);
|
|
2664
2690
|
|
|
2665
2691
|
// src/preview-api/modules/store/csf/normalizeArrays.ts
|
|
2666
|
-
var
|
|
2692
|
+
var v = /* @__PURE__ */ s((r) => Array.isArray(r) ? r : r ? [r] : [], "normalizeArrays");
|
|
2667
2693
|
|
|
2668
2694
|
// src/preview-api/modules/store/csf/normalizeStory.ts
|
|
2669
|
-
var
|
|
2695
|
+
var Js = Mo.dedent`
|
|
2670
2696
|
CSF .story annotations deprecated; annotate story functions directly:
|
|
2671
2697
|
- StoryFn.story.name => StoryFn.storyName
|
|
2672
2698
|
- StoryFn.story.(parameters|decorators) => StoryFn.(parameters|decorators)
|
|
2673
2699
|
See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#hoisted-csf-annotations for details and codemod.
|
|
2674
2700
|
`;
|
|
2675
|
-
function
|
|
2701
|
+
function ye(r, e, t) {
|
|
2676
2702
|
let o = e, n = typeof e == "function" ? e : null, { story: i } = o;
|
|
2677
|
-
i && (dr.logger.debug("deprecated story", i), (0, dr.deprecate)(
|
|
2703
|
+
i && (dr.logger.debug("deprecated story", i), (0, dr.deprecate)(Js));
|
|
2678
2704
|
let a = (0, pr.storyNameFromExport)(r), l = typeof o != "function" && o.name || o.storyName || i?.name || a, c = [
|
|
2679
|
-
...
|
|
2680
|
-
...
|
|
2681
|
-
], d = { ...i?.parameters, ...o.parameters }, u = { ...i?.args, ...o.args }, p = { ...i?.argTypes, ...o.argTypes },
|
|
2682
|
-
i?.loaders)],
|
|
2683
|
-
...
|
|
2684
|
-
...
|
|
2705
|
+
...v(o.decorators),
|
|
2706
|
+
...v(i?.decorators)
|
|
2707
|
+
], d = { ...i?.parameters, ...o.parameters }, u = { ...i?.args, ...o.args }, p = { ...i?.argTypes, ...o.argTypes }, h = [...v(o.loaders), ...v(
|
|
2708
|
+
i?.loaders)], g = [
|
|
2709
|
+
...v(o.beforeEach),
|
|
2710
|
+
...v(i?.beforeEach)
|
|
2685
2711
|
], E = [
|
|
2686
|
-
...
|
|
2687
|
-
...
|
|
2688
|
-
], { render:
|
|
2712
|
+
...v(o.experimental_afterEach),
|
|
2713
|
+
...v(i?.experimental_afterEach)
|
|
2714
|
+
], { render: R, play: m, tags: b = [], globals: y = {} } = o, f = d.__id || (0, pr.toId)(t.id, a);
|
|
2689
2715
|
return {
|
|
2690
2716
|
moduleExport: e,
|
|
2691
2717
|
id: f,
|
|
2692
2718
|
name: l,
|
|
2693
|
-
tags:
|
|
2719
|
+
tags: b,
|
|
2694
2720
|
decorators: c,
|
|
2695
2721
|
parameters: d,
|
|
2696
2722
|
args: u,
|
|
2697
|
-
argTypes:
|
|
2698
|
-
loaders:
|
|
2699
|
-
beforeEach:
|
|
2723
|
+
argTypes: fe(p),
|
|
2724
|
+
loaders: h,
|
|
2725
|
+
beforeEach: g,
|
|
2700
2726
|
experimental_afterEach: E,
|
|
2701
2727
|
globals: y,
|
|
2702
|
-
...
|
|
2728
|
+
...R && { render: R },
|
|
2703
2729
|
...n && { userStoryFn: n },
|
|
2704
|
-
...
|
|
2730
|
+
...m && { play: m }
|
|
2705
2731
|
};
|
|
2706
2732
|
}
|
|
2707
|
-
s(
|
|
2733
|
+
s(ye, "normalizeStory");
|
|
2708
2734
|
|
|
2709
2735
|
// src/preview-api/modules/store/csf/processCSFFile.ts
|
|
2710
|
-
var
|
|
2736
|
+
var st = require("storybook/internal/client-logger"), Be = require("storybook/internal/csf");
|
|
2711
2737
|
|
|
2712
2738
|
// src/preview-api/modules/store/csf/normalizeComponentAnnotations.ts
|
|
2713
|
-
var
|
|
2714
|
-
function
|
|
2739
|
+
var _o = require("storybook/internal/csf");
|
|
2740
|
+
function ze(r, e = r.title, t) {
|
|
2715
2741
|
let { id: o, argTypes: n } = r;
|
|
2716
2742
|
return {
|
|
2717
|
-
id: (0,
|
|
2743
|
+
id: (0, _o.sanitize)(o || e),
|
|
2718
2744
|
...r,
|
|
2719
2745
|
title: e,
|
|
2720
|
-
...n && { argTypes:
|
|
2746
|
+
...n && { argTypes: fe(n) },
|
|
2721
2747
|
parameters: {
|
|
2722
2748
|
fileName: t,
|
|
2723
2749
|
...r.parameters
|
|
2724
2750
|
}
|
|
2725
2751
|
};
|
|
2726
2752
|
}
|
|
2727
|
-
s(
|
|
2753
|
+
s(ze, "normalizeComponentAnnotations");
|
|
2728
2754
|
|
|
2729
2755
|
// src/preview-api/modules/store/csf/processCSFFile.ts
|
|
2730
|
-
var
|
|
2756
|
+
var Qs = /* @__PURE__ */ s((r) => {
|
|
2731
2757
|
let { globals: e, globalTypes: t } = r;
|
|
2732
|
-
(e || t) &&
|
|
2758
|
+
(e || t) && st.logger.error(
|
|
2733
2759
|
"Global args/argTypes can only be set globally",
|
|
2734
2760
|
JSON.stringify({
|
|
2735
2761
|
globals: e,
|
|
2736
2762
|
globalTypes: t
|
|
2737
2763
|
})
|
|
2738
2764
|
);
|
|
2739
|
-
}, "checkGlobals"),
|
|
2765
|
+
}, "checkGlobals"), Zs = /* @__PURE__ */ s((r) => {
|
|
2740
2766
|
let { options: e } = r;
|
|
2741
|
-
e?.storySort &&
|
|
2767
|
+
e?.storySort && st.logger.error("The storySort option parameter can only be set globally");
|
|
2742
2768
|
}, "checkStorySort"), ur = /* @__PURE__ */ s((r) => {
|
|
2743
|
-
r && (
|
|
2769
|
+
r && (Qs(r), Zs(r));
|
|
2744
2770
|
}, "checkDisallowedParameters");
|
|
2745
|
-
function
|
|
2771
|
+
function Lo(r, e, t) {
|
|
2746
2772
|
let { default: o, __namedExportsOrder: n, ...i } = r, a = Object.values(i)[0];
|
|
2747
|
-
if ((0,
|
|
2748
|
-
let d =
|
|
2773
|
+
if ((0, Be.isStory)(a)) {
|
|
2774
|
+
let d = ze(a.meta.input, t, e);
|
|
2749
2775
|
ur(d.parameters);
|
|
2750
2776
|
let u = { meta: d, stories: {}, moduleExports: r };
|
|
2751
2777
|
return Object.keys(i).forEach((p) => {
|
|
2752
|
-
if ((0,
|
|
2753
|
-
let
|
|
2754
|
-
ur(
|
|
2778
|
+
if ((0, Be.isExportStory)(p, d)) {
|
|
2779
|
+
let h = ye(p, i[p].input, d);
|
|
2780
|
+
ur(h.parameters), u.stories[h.id] = h;
|
|
2755
2781
|
}
|
|
2756
2782
|
}), u.projectAnnotations = a.meta.preview.composed, u;
|
|
2757
2783
|
}
|
|
2758
|
-
let l =
|
|
2784
|
+
let l = ze(
|
|
2759
2785
|
o,
|
|
2760
2786
|
t,
|
|
2761
2787
|
e
|
|
@@ -2763,55 +2789,34 @@ function ko(r, e, t) {
|
|
|
2763
2789
|
ur(l.parameters);
|
|
2764
2790
|
let c = { meta: l, stories: {}, moduleExports: r };
|
|
2765
2791
|
return Object.keys(i).forEach((d) => {
|
|
2766
|
-
if ((0,
|
|
2767
|
-
let u =
|
|
2792
|
+
if ((0, Be.isExportStory)(d, l)) {
|
|
2793
|
+
let u = ye(d, i[d], l);
|
|
2768
2794
|
ur(u.parameters), c.stories[u.id] = u;
|
|
2769
2795
|
}
|
|
2770
2796
|
}), c;
|
|
2771
2797
|
}
|
|
2772
|
-
s(
|
|
2798
|
+
s(Lo, "processCSFFile");
|
|
2773
2799
|
|
|
2774
2800
|
// src/preview-api/modules/store/csf/prepareStory.ts
|
|
2775
|
-
var yr = require("storybook/internal/csf"),
|
|
2776
|
-
|
|
2777
|
-
// src/preview-api/core-annotations.ts
|
|
2778
|
-
var Qr = D(require("storybook/internal/component-testing/preview"), 1), Zr = D(require("storybook/actions/preview"), 1), jo = require("storybook/preview-api"),
|
|
2779
|
-
et = D(require("storybook/test/preview"), 1), rt = D(require("storybook/viewport/preview"), 1);
|
|
2780
|
-
function tt() {
|
|
2781
|
-
return [
|
|
2782
|
-
// @ts-expect-error CJS fallback
|
|
2783
|
-
(rt.default.default ?? rt.default)(),
|
|
2784
|
-
// @ts-expect-error CJS fallback
|
|
2785
|
-
(Zr.default.default ?? Zr.default)(),
|
|
2786
|
-
// @ts-expect-error CJS fallback
|
|
2787
|
-
(Qr.default.default ?? Qr.default)(),
|
|
2788
|
-
// @ts-expect-error CJS fallback
|
|
2789
|
-
(et.default.default ?? et.default)()
|
|
2790
|
-
];
|
|
2791
|
-
}
|
|
2792
|
-
s(tt, "getCoreAnnotations");
|
|
2793
|
-
function Be() {
|
|
2794
|
-
return (0, jo.composeConfigs)(tt());
|
|
2795
|
-
}
|
|
2796
|
-
s(Be, "getComposedCoreAnnotations");
|
|
2801
|
+
var yr = require("storybook/internal/csf"), zo = require("storybook/internal/preview-errors"), Bo = require("@storybook/global"), Go = require("@storybook/global");
|
|
2797
2802
|
|
|
2798
2803
|
// src/preview-api/modules/preview-web/render/mount-utils.ts
|
|
2799
|
-
function
|
|
2800
|
-
return r != null &&
|
|
2804
|
+
function qo(r) {
|
|
2805
|
+
return r != null && ei(r).includes("mount");
|
|
2801
2806
|
}
|
|
2802
|
-
s(
|
|
2803
|
-
function
|
|
2807
|
+
s(qo, "mountDestructured");
|
|
2808
|
+
function ei(r) {
|
|
2804
2809
|
let e = r.toString().match(/[^(]*\(([^)]*)/);
|
|
2805
2810
|
if (!e)
|
|
2806
2811
|
return [];
|
|
2807
|
-
let t =
|
|
2812
|
+
let t = No(e[1]);
|
|
2808
2813
|
if (!t.length)
|
|
2809
2814
|
return [];
|
|
2810
2815
|
let o = t[0];
|
|
2811
|
-
return o.startsWith("{") && o.endsWith("}") ?
|
|
2816
|
+
return o.startsWith("{") && o.endsWith("}") ? No(o.slice(1, -1).replace(/\s/g, "")).map((i) => i.replace(/:.*|=.*/g, "")) : [];
|
|
2812
2817
|
}
|
|
2813
|
-
s(
|
|
2814
|
-
function
|
|
2818
|
+
s(ei, "getUsedProps");
|
|
2819
|
+
function No(r) {
|
|
2815
2820
|
let e = [], t = [], o = 0;
|
|
2816
2821
|
for (let i = 0; i < r.length; i++)
|
|
2817
2822
|
if (r[i] === "{" || r[i] === "[")
|
|
@@ -2825,15 +2830,15 @@ function Mo(r) {
|
|
|
2825
2830
|
let n = r.substring(o).trim();
|
|
2826
2831
|
return n && e.push(n), e;
|
|
2827
2832
|
}
|
|
2828
|
-
s(
|
|
2833
|
+
s(No, "splitByComma");
|
|
2829
2834
|
|
|
2830
2835
|
// src/preview-api/modules/store/decorators.ts
|
|
2831
|
-
function
|
|
2836
|
+
function it(r, e, t) {
|
|
2832
2837
|
let o = t(r);
|
|
2833
2838
|
return (n) => e(o, n);
|
|
2834
2839
|
}
|
|
2835
|
-
s(
|
|
2836
|
-
function
|
|
2840
|
+
s(it, "decorateStory");
|
|
2841
|
+
function at({
|
|
2837
2842
|
componentId: r,
|
|
2838
2843
|
title: e,
|
|
2839
2844
|
kind: t,
|
|
@@ -2847,17 +2852,17 @@ function nt({
|
|
|
2847
2852
|
} = {}) {
|
|
2848
2853
|
return d;
|
|
2849
2854
|
}
|
|
2850
|
-
s(
|
|
2855
|
+
s(at, "sanitizeStoryContextUpdate");
|
|
2851
2856
|
function fr(r, e) {
|
|
2852
2857
|
let t = {}, o = /* @__PURE__ */ s((i) => (a) => {
|
|
2853
2858
|
if (!t.value)
|
|
2854
2859
|
throw new Error("Decorated function called without init");
|
|
2855
2860
|
return t.value = {
|
|
2856
2861
|
...t.value,
|
|
2857
|
-
...
|
|
2862
|
+
...at(a)
|
|
2858
2863
|
}, i(t.value);
|
|
2859
2864
|
}, "bindWithContext"), n = e.reduce(
|
|
2860
|
-
(i, a) =>
|
|
2865
|
+
(i, a) => it(i, a, o),
|
|
2861
2866
|
r
|
|
2862
2867
|
);
|
|
2863
2868
|
return (i) => (t.value = i, n(i));
|
|
@@ -2868,133 +2873,125 @@ s(fr, "defaultDecorateStory");
|
|
|
2868
2873
|
var z = /* @__PURE__ */ s((...r) => {
|
|
2869
2874
|
let e = {}, t = r.filter(Boolean), o = t.reduce((n, i) => (Object.entries(i).forEach(([a, l]) => {
|
|
2870
2875
|
let c = n[a];
|
|
2871
|
-
Array.isArray(l) || typeof c > "u" ? n[a] = l :
|
|
2876
|
+
Array.isArray(l) || typeof c > "u" ? n[a] = l : _(l) && _(c) ? e[a] = !0 : typeof l < "u" && (n[a] = l);
|
|
2872
2877
|
}), n), {});
|
|
2873
2878
|
return Object.keys(e).forEach((n) => {
|
|
2874
2879
|
let i = t.filter(Boolean).map((a) => a[n]).filter((a) => typeof a < "u");
|
|
2875
|
-
i.every((a) =>
|
|
2880
|
+
i.every((a) => _(a)) ? o[n] = z(...i) : o[n] = i[i.length - 1];
|
|
2876
2881
|
}), o;
|
|
2877
2882
|
}, "combineParameters");
|
|
2878
2883
|
|
|
2879
2884
|
// src/preview-api/modules/store/csf/prepareStory.ts
|
|
2880
|
-
function
|
|
2881
|
-
let { moduleExport: o, id: n, name: i } = r || {}, a =
|
|
2885
|
+
function De(r, e, t) {
|
|
2886
|
+
let { moduleExport: o, id: n, name: i } = r || {}, a = Uo(
|
|
2882
2887
|
r,
|
|
2883
2888
|
e,
|
|
2884
2889
|
t
|
|
2885
|
-
),
|
|
2886
|
-
let
|
|
2887
|
-
for (let
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
A(r.loaders)
|
|
2890
|
+
), l = /* @__PURE__ */ s(async (T) => {
|
|
2891
|
+
let A = {};
|
|
2892
|
+
for (let D of [
|
|
2893
|
+
v(t.loaders),
|
|
2894
|
+
v(e.loaders),
|
|
2895
|
+
v(r.loaders)
|
|
2892
2896
|
]) {
|
|
2893
2897
|
if (T.abortSignal.aborted)
|
|
2894
|
-
return
|
|
2895
|
-
let
|
|
2896
|
-
Object.assign(
|
|
2898
|
+
return A;
|
|
2899
|
+
let L = await Promise.all(D.map((G) => G(T)));
|
|
2900
|
+
Object.assign(A, ...L);
|
|
2897
2901
|
}
|
|
2898
|
-
return
|
|
2899
|
-
}, "applyLoaders"),
|
|
2900
|
-
let
|
|
2901
|
-
for (let
|
|
2902
|
-
...
|
|
2903
|
-
...
|
|
2904
|
-
...
|
|
2905
|
-
...A(r.beforeEach)
|
|
2902
|
+
return A;
|
|
2903
|
+
}, "applyLoaders"), c = /* @__PURE__ */ s(async (T) => {
|
|
2904
|
+
let A = new Array();
|
|
2905
|
+
for (let D of [
|
|
2906
|
+
...v(t.beforeEach),
|
|
2907
|
+
...v(e.beforeEach),
|
|
2908
|
+
...v(r.beforeEach)
|
|
2906
2909
|
]) {
|
|
2907
2910
|
if (T.abortSignal.aborted)
|
|
2908
|
-
return
|
|
2909
|
-
let
|
|
2910
|
-
|
|
2911
|
+
return A;
|
|
2912
|
+
let L = await D(T);
|
|
2913
|
+
L && A.push(L);
|
|
2911
2914
|
}
|
|
2912
|
-
return
|
|
2913
|
-
}, "applyBeforeEach"),
|
|
2914
|
-
let
|
|
2915
|
-
...
|
|
2916
|
-
...
|
|
2917
|
-
...
|
|
2918
|
-
...A(r.experimental_afterEach)
|
|
2915
|
+
return A;
|
|
2916
|
+
}, "applyBeforeEach"), d = /* @__PURE__ */ s(async (T) => {
|
|
2917
|
+
let A = [
|
|
2918
|
+
...v(t.experimental_afterEach),
|
|
2919
|
+
...v(e.experimental_afterEach),
|
|
2920
|
+
...v(r.experimental_afterEach)
|
|
2919
2921
|
].reverse();
|
|
2920
|
-
for (let
|
|
2922
|
+
for (let D of A) {
|
|
2921
2923
|
if (T.abortSignal.aborted)
|
|
2922
2924
|
return;
|
|
2923
|
-
await
|
|
2925
|
+
await D(T);
|
|
2924
2926
|
}
|
|
2925
|
-
}, "applyAfterEach"),
|
|
2926
|
-
|
|
2927
|
-
...
|
|
2928
|
-
...
|
|
2929
|
-
...
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
mount ?? b, F = t.testingLibraryRender;
|
|
2927
|
+
}, "applyAfterEach"), u = /* @__PURE__ */ s((T) => T.originalStoryFn(T.args, T), "undecoratedStoryFn"), { applyDecorators: p = fr, runStep: h } = t,
|
|
2928
|
+
g = [
|
|
2929
|
+
...v(r?.decorators),
|
|
2930
|
+
...v(e?.decorators),
|
|
2931
|
+
...v(t?.decorators)
|
|
2932
|
+
], E = r?.userStoryFn || r?.render || e.render || t.render, R = or(p)(u, g), m = /* @__PURE__ */ s((T) => R(T), "unboundStoryFn"), b = r?.
|
|
2933
|
+
play ?? e?.play, y = qo(b);
|
|
2934
|
+
if (!E && !y)
|
|
2935
|
+
throw new zo.NoRenderFunctionError({ id: n });
|
|
2936
|
+
let f = /* @__PURE__ */ s((T) => async () => (await T.renderToCanvas(), T.canvas), "defaultMount"), S = r.mount ?? e.mount ?? t.mount ?? f,
|
|
2937
|
+
F = t.testingLibraryRender;
|
|
2937
2938
|
return {
|
|
2938
2939
|
storyGlobals: {},
|
|
2939
|
-
...
|
|
2940
|
+
...a,
|
|
2940
2941
|
moduleExport: o,
|
|
2941
2942
|
id: n,
|
|
2942
2943
|
name: i,
|
|
2943
2944
|
story: i,
|
|
2944
|
-
originalStoryFn:
|
|
2945
|
-
undecoratedStoryFn:
|
|
2946
|
-
unboundStoryFn:
|
|
2947
|
-
applyLoaders:
|
|
2948
|
-
applyBeforeEach:
|
|
2949
|
-
applyAfterEach:
|
|
2950
|
-
playFunction:
|
|
2951
|
-
runStep:
|
|
2952
|
-
mount:
|
|
2945
|
+
originalStoryFn: E,
|
|
2946
|
+
undecoratedStoryFn: u,
|
|
2947
|
+
unboundStoryFn: m,
|
|
2948
|
+
applyLoaders: l,
|
|
2949
|
+
applyBeforeEach: c,
|
|
2950
|
+
applyAfterEach: d,
|
|
2951
|
+
playFunction: b,
|
|
2952
|
+
runStep: h,
|
|
2953
|
+
mount: S,
|
|
2953
2954
|
testingLibraryRender: F,
|
|
2954
2955
|
renderToCanvas: t.renderToCanvas,
|
|
2955
|
-
usesMount:
|
|
2956
|
+
usesMount: y
|
|
2956
2957
|
};
|
|
2957
2958
|
}
|
|
2958
|
-
s(
|
|
2959
|
+
s(De, "prepareStory");
|
|
2959
2960
|
function mr(r, e, t) {
|
|
2960
2961
|
return {
|
|
2961
|
-
...
|
|
2962
|
+
...Uo(void 0, r, e),
|
|
2962
2963
|
moduleExport: t
|
|
2963
2964
|
};
|
|
2964
2965
|
}
|
|
2965
2966
|
s(mr, "prepareMeta");
|
|
2966
|
-
function
|
|
2967
|
-
let o = ["dev", "test"], n =
|
|
2967
|
+
function Uo(r, e, t) {
|
|
2968
|
+
let o = ["dev", "test"], n = Go.global.DOCS_OPTIONS?.autodocs === !0 ? ["autodocs"] : [], i = (0, yr.combineTags)(
|
|
2968
2969
|
...o,
|
|
2969
2970
|
...n,
|
|
2970
|
-
...i.tags ?? [],
|
|
2971
2971
|
...t.tags ?? [],
|
|
2972
2972
|
...e.tags ?? [],
|
|
2973
2973
|
...r?.tags ?? []
|
|
2974
|
-
),
|
|
2975
|
-
i.parameters,
|
|
2974
|
+
), a = z(
|
|
2976
2975
|
t.parameters,
|
|
2977
2976
|
e.parameters,
|
|
2978
2977
|
r?.parameters
|
|
2979
|
-
), { argTypesEnhancers:
|
|
2980
|
-
i.argTypes,
|
|
2978
|
+
), { argTypesEnhancers: l = [], argsEnhancers: c = [] } = t, d = z(
|
|
2981
2979
|
t.argTypes,
|
|
2982
2980
|
e.argTypes,
|
|
2983
2981
|
r?.argTypes
|
|
2984
2982
|
);
|
|
2985
2983
|
if (r) {
|
|
2986
|
-
let
|
|
2987
|
-
|
|
2984
|
+
let b = r?.userStoryFn || r?.render || e.render || t.render;
|
|
2985
|
+
a.__isArgsStory = b && b.length > 0;
|
|
2988
2986
|
}
|
|
2989
|
-
let
|
|
2990
|
-
...i.args,
|
|
2987
|
+
let u = {
|
|
2991
2988
|
...t.args,
|
|
2992
2989
|
...e.args,
|
|
2993
2990
|
...r?.args
|
|
2994
|
-
},
|
|
2991
|
+
}, p = {
|
|
2995
2992
|
...e.globals,
|
|
2996
2993
|
...r?.globals
|
|
2997
|
-
},
|
|
2994
|
+
}, h = {
|
|
2998
2995
|
componentId: e.id,
|
|
2999
2996
|
title: e.title,
|
|
3000
2997
|
kind: e.title,
|
|
@@ -3006,47 +3003,44 @@ function zo(r, e, t) {
|
|
|
3006
3003
|
// Back compat
|
|
3007
3004
|
component: e.component,
|
|
3008
3005
|
subcomponents: e.subcomponents,
|
|
3009
|
-
tags:
|
|
3010
|
-
parameters:
|
|
3011
|
-
initialArgs:
|
|
3012
|
-
argTypes:
|
|
3013
|
-
storyGlobals:
|
|
3006
|
+
tags: i,
|
|
3007
|
+
parameters: a,
|
|
3008
|
+
initialArgs: u,
|
|
3009
|
+
argTypes: d,
|
|
3010
|
+
storyGlobals: p
|
|
3014
3011
|
};
|
|
3015
|
-
|
|
3016
|
-
(
|
|
3017
|
-
|
|
3012
|
+
h.argTypes = l.reduce(
|
|
3013
|
+
(b, y) => y({ ...h, argTypes: b }),
|
|
3014
|
+
h.argTypes
|
|
3018
3015
|
);
|
|
3019
|
-
let
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
...f({
|
|
3027
|
-
...m,
|
|
3028
|
-
initialArgs: y
|
|
3016
|
+
let g = { ...u };
|
|
3017
|
+
h.initialArgs = [...c].reduce(
|
|
3018
|
+
(b, y) => ({
|
|
3019
|
+
...b,
|
|
3020
|
+
...y({
|
|
3021
|
+
...h,
|
|
3022
|
+
initialArgs: b
|
|
3029
3023
|
})
|
|
3030
3024
|
}),
|
|
3031
|
-
|
|
3025
|
+
g
|
|
3032
3026
|
);
|
|
3033
|
-
let { name:
|
|
3034
|
-
return
|
|
3027
|
+
let { name: E, story: R, ...m } = h;
|
|
3028
|
+
return m;
|
|
3035
3029
|
}
|
|
3036
|
-
s(
|
|
3030
|
+
s(Uo, "preparePartialAnnotations");
|
|
3037
3031
|
function hr(r) {
|
|
3038
3032
|
let { args: e } = r, t = {
|
|
3039
3033
|
...r,
|
|
3040
3034
|
allArgs: void 0,
|
|
3041
3035
|
argsByTarget: void 0
|
|
3042
3036
|
};
|
|
3043
|
-
if (
|
|
3044
|
-
let i =
|
|
3037
|
+
if (Bo.global.FEATURES?.argTypeTargetsV7) {
|
|
3038
|
+
let i = Io(r);
|
|
3045
3039
|
t = {
|
|
3046
3040
|
...r,
|
|
3047
3041
|
allArgs: r.args,
|
|
3048
3042
|
argsByTarget: i,
|
|
3049
|
-
args: i[
|
|
3043
|
+
args: i[nt] || {}
|
|
3050
3044
|
};
|
|
3051
3045
|
}
|
|
3052
3046
|
let o = Object.entries(t.args).reduce((i, [a, l]) => {
|
|
@@ -3066,9 +3060,9 @@ function hr(r) {
|
|
|
3066
3060
|
s(hr, "prepareContext");
|
|
3067
3061
|
|
|
3068
3062
|
// src/preview-api/modules/store/inferArgTypes.ts
|
|
3069
|
-
var
|
|
3070
|
-
var
|
|
3071
|
-
var
|
|
3063
|
+
var Vo = require("storybook/internal/client-logger");
|
|
3064
|
+
var Ho = I(W(), 1);
|
|
3065
|
+
var lt = /* @__PURE__ */ s((r, e, t) => {
|
|
3072
3066
|
let o = typeof r;
|
|
3073
3067
|
switch (o) {
|
|
3074
3068
|
case "boolean":
|
|
@@ -3080,44 +3074,44 @@ var st = /* @__PURE__ */ s((r, e, t) => {
|
|
|
3080
3074
|
default:
|
|
3081
3075
|
break;
|
|
3082
3076
|
}
|
|
3083
|
-
return r ? t.has(r) ? (
|
|
3077
|
+
return r ? t.has(r) ? (Vo.logger.warn(Ho.dedent`
|
|
3084
3078
|
We've detected a cycle in arg '${e}'. Args should be JSON-serializable.
|
|
3085
3079
|
|
|
3086
3080
|
Consider using the mapping feature or fully custom args:
|
|
3087
3081
|
- Mapping: https://storybook.js.org/docs/writing-stories/args#mapping-to-complex-arg-values
|
|
3088
3082
|
- Custom args: https://storybook.js.org/docs/essentials/controls#fully-custom-args
|
|
3089
|
-
`), { name: "other", value: "cyclic object" }) : (t.add(r), Array.isArray(r) ? { name: "array", value: r.length > 0 ?
|
|
3090
|
-
t)) : { name: "other", value: "unknown" } } : { name: "object", value: J(r, (i) =>
|
|
3091
|
-
}, "inferType"),
|
|
3083
|
+
`), { name: "other", value: "cyclic object" }) : (t.add(r), Array.isArray(r) ? { name: "array", value: r.length > 0 ? lt(r[0], e, new Set(
|
|
3084
|
+
t)) : { name: "other", value: "unknown" } } : { name: "object", value: J(r, (i) => lt(i, e, new Set(t))) }) : { name: "object", value: {} };
|
|
3085
|
+
}, "inferType"), ct = /* @__PURE__ */ s((r) => {
|
|
3092
3086
|
let { id: e, argTypes: t = {}, initialArgs: o = {} } = r, n = J(o, (a, l) => ({
|
|
3093
3087
|
name: l,
|
|
3094
|
-
type:
|
|
3088
|
+
type: lt(a, `${e}.${l}`, /* @__PURE__ */ new Set())
|
|
3095
3089
|
})), i = J(t, (a, l) => ({
|
|
3096
3090
|
name: l
|
|
3097
3091
|
}));
|
|
3098
3092
|
return z(n, i, t);
|
|
3099
3093
|
}, "inferArgTypes");
|
|
3100
|
-
|
|
3094
|
+
ct.secondPass = !0;
|
|
3101
3095
|
|
|
3102
3096
|
// src/preview-api/modules/store/inferControls.ts
|
|
3103
|
-
var
|
|
3097
|
+
var $o = require("storybook/internal/client-logger");
|
|
3104
3098
|
|
|
3105
3099
|
// src/preview-api/modules/store/filterArgTypes.ts
|
|
3106
|
-
var
|
|
3100
|
+
var Wo = /* @__PURE__ */ s((r, e) => Array.isArray(e) ? e.includes(r) : r.match(e), "matches"), Ge = /* @__PURE__ */ s((r, e, t) => !e && !t ?
|
|
3107
3101
|
r : r && Gr(r, (o, n) => {
|
|
3108
3102
|
let i = o.name || n.toString();
|
|
3109
|
-
return !!(!e ||
|
|
3103
|
+
return !!(!e || Wo(i, e)) && (!t || !Wo(i, t));
|
|
3110
3104
|
}), "filterArgTypes");
|
|
3111
3105
|
|
|
3112
3106
|
// src/preview-api/modules/store/inferControls.ts
|
|
3113
|
-
var
|
|
3107
|
+
var ri = /* @__PURE__ */ s((r, e, t) => {
|
|
3114
3108
|
let { type: o, options: n } = r;
|
|
3115
3109
|
if (o) {
|
|
3116
3110
|
if (t.color && t.color.test(e)) {
|
|
3117
3111
|
let i = o.name;
|
|
3118
3112
|
if (i === "string")
|
|
3119
3113
|
return { control: { type: "color" } };
|
|
3120
|
-
i !== "enum" &&
|
|
3114
|
+
i !== "enum" && $o.logger.warn(
|
|
3121
3115
|
`Addon controls: Control of type color only supports string, received "${i}" instead`
|
|
3122
3116
|
);
|
|
3123
3117
|
}
|
|
@@ -3143,7 +3137,7 @@ var Xs = /* @__PURE__ */ s((r, e, t) => {
|
|
|
3143
3137
|
return { control: { type: n ? "select" : "object" } };
|
|
3144
3138
|
}
|
|
3145
3139
|
}
|
|
3146
|
-
}, "inferControl"),
|
|
3140
|
+
}, "inferControl"), ke = /* @__PURE__ */ s((r) => {
|
|
3147
3141
|
let {
|
|
3148
3142
|
argTypes: e,
|
|
3149
3143
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
@@ -3151,13 +3145,13 @@ var Xs = /* @__PURE__ */ s((r, e, t) => {
|
|
|
3151
3145
|
} = r;
|
|
3152
3146
|
if (!t)
|
|
3153
3147
|
return e;
|
|
3154
|
-
let a = Ge(e, o, n), l = J(a, (c, d) => c?.type &&
|
|
3148
|
+
let a = Ge(e, o, n), l = J(a, (c, d) => c?.type && ri(c, d.toString(), i));
|
|
3155
3149
|
return z(l, a);
|
|
3156
3150
|
}, "inferControls");
|
|
3157
|
-
|
|
3151
|
+
ke.secondPass = !0;
|
|
3158
3152
|
|
|
3159
3153
|
// src/preview-api/modules/store/csf/normalizeProjectAnnotations.ts
|
|
3160
|
-
function
|
|
3154
|
+
function me({
|
|
3161
3155
|
argTypes: r,
|
|
3162
3156
|
globalTypes: e,
|
|
3163
3157
|
argTypesEnhancers: t,
|
|
@@ -3169,15 +3163,15 @@ function ye({
|
|
|
3169
3163
|
...c
|
|
3170
3164
|
}) {
|
|
3171
3165
|
return {
|
|
3172
|
-
...r && { argTypes:
|
|
3173
|
-
...e && { globalTypes:
|
|
3174
|
-
decorators:
|
|
3175
|
-
loaders:
|
|
3176
|
-
beforeEach:
|
|
3177
|
-
experimental_afterEach:
|
|
3166
|
+
...r && { argTypes: fe(r) },
|
|
3167
|
+
...e && { globalTypes: fe(e) },
|
|
3168
|
+
decorators: v(o),
|
|
3169
|
+
loaders: v(n),
|
|
3170
|
+
beforeEach: v(i),
|
|
3171
|
+
experimental_afterEach: v(a),
|
|
3178
3172
|
argTypesEnhancers: [
|
|
3179
3173
|
...t || [],
|
|
3180
|
-
|
|
3174
|
+
ct,
|
|
3181
3175
|
// There's an architectural decision to be made regarding embedded addons in core:
|
|
3182
3176
|
//
|
|
3183
3177
|
// Option 1: Keep embedded addons but ensure consistency by moving addon-specific code
|
|
@@ -3193,19 +3187,19 @@ function ye({
|
|
|
3193
3187
|
// currently rely on this behavior.
|
|
3194
3188
|
//
|
|
3195
3189
|
// TODO: Make an architectural decision on the handling of core addons
|
|
3196
|
-
|
|
3190
|
+
ke
|
|
3197
3191
|
],
|
|
3198
3192
|
initialGlobals: l,
|
|
3199
3193
|
...c
|
|
3200
3194
|
};
|
|
3201
3195
|
}
|
|
3202
|
-
s(
|
|
3196
|
+
s(me, "normalizeProjectAnnotations");
|
|
3203
3197
|
|
|
3204
3198
|
// src/preview-api/modules/store/csf/composeConfigs.ts
|
|
3205
|
-
var
|
|
3199
|
+
var Ko = require("@storybook/global");
|
|
3206
3200
|
|
|
3207
3201
|
// src/preview-api/modules/store/csf/beforeAll.ts
|
|
3208
|
-
var
|
|
3202
|
+
var Yo = /* @__PURE__ */ s((r) => async () => {
|
|
3209
3203
|
let e = [];
|
|
3210
3204
|
for (let t of r) {
|
|
3211
3205
|
let o = await t();
|
|
@@ -3229,61 +3223,61 @@ function gr(r) {
|
|
|
3229
3223
|
s(gr, "composeStepRunners");
|
|
3230
3224
|
|
|
3231
3225
|
// src/preview-api/modules/store/csf/composeConfigs.ts
|
|
3232
|
-
function
|
|
3226
|
+
function Ve(r, e) {
|
|
3233
3227
|
return r.map((t) => t.default?.[e] ?? t[e]).filter(Boolean);
|
|
3234
3228
|
}
|
|
3235
|
-
s(
|
|
3236
|
-
function
|
|
3237
|
-
return
|
|
3238
|
-
let i =
|
|
3229
|
+
s(Ve, "getField");
|
|
3230
|
+
function se(r, e, t = {}) {
|
|
3231
|
+
return Ve(r, e).reduce((o, n) => {
|
|
3232
|
+
let i = v(n);
|
|
3239
3233
|
return t.reverseFileOrder ? [...i, ...o] : [...o, ...i];
|
|
3240
3234
|
}, []);
|
|
3241
3235
|
}
|
|
3242
|
-
s(
|
|
3236
|
+
s(se, "getArrayField");
|
|
3243
3237
|
function br(r, e) {
|
|
3244
|
-
return Object.assign({}, ...
|
|
3238
|
+
return Object.assign({}, ...Ve(r, e));
|
|
3245
3239
|
}
|
|
3246
3240
|
s(br, "getObjectField");
|
|
3247
|
-
function
|
|
3248
|
-
return
|
|
3241
|
+
function Ue(r, e) {
|
|
3242
|
+
return Ve(r, e).pop();
|
|
3249
3243
|
}
|
|
3250
|
-
s(
|
|
3251
|
-
function
|
|
3252
|
-
let e = ne(r, "argTypesEnhancers"),
|
|
3244
|
+
s(Ue, "getSingletonField");
|
|
3245
|
+
function Z(r) {
|
|
3246
|
+
let e = [ne(), ...r], t = se(e, "argTypesEnhancers"), o = Ve(e, "runStep"), n = se(e, "beforeAll");
|
|
3253
3247
|
return {
|
|
3254
|
-
parameters: z(...
|
|
3255
|
-
decorators:
|
|
3256
|
-
reverseFileOrder: !(
|
|
3248
|
+
parameters: z(...Ve(e, "parameters")),
|
|
3249
|
+
decorators: se(e, "decorators", {
|
|
3250
|
+
reverseFileOrder: !(Ko.global.FEATURES?.legacyDecoratorFileOrder ?? !1)
|
|
3257
3251
|
}),
|
|
3258
|
-
args: br(
|
|
3259
|
-
argsEnhancers:
|
|
3260
|
-
argTypes: br(
|
|
3252
|
+
args: br(e, "args"),
|
|
3253
|
+
argsEnhancers: se(e, "argsEnhancers"),
|
|
3254
|
+
argTypes: br(e, "argTypes"),
|
|
3261
3255
|
argTypesEnhancers: [
|
|
3262
|
-
...
|
|
3263
|
-
...
|
|
3256
|
+
...t.filter((i) => !i.secondPass),
|
|
3257
|
+
...t.filter((i) => i.secondPass)
|
|
3264
3258
|
],
|
|
3265
|
-
initialGlobals: br(
|
|
3266
|
-
globalTypes: br(
|
|
3267
|
-
loaders:
|
|
3268
|
-
beforeAll:
|
|
3269
|
-
beforeEach:
|
|
3270
|
-
experimental_afterEach:
|
|
3271
|
-
render:
|
|
3272
|
-
renderToCanvas:
|
|
3273
|
-
applyDecorators:
|
|
3274
|
-
runStep: gr(
|
|
3275
|
-
tags:
|
|
3276
|
-
mount:
|
|
3277
|
-
testingLibraryRender:
|
|
3259
|
+
initialGlobals: br(e, "initialGlobals"),
|
|
3260
|
+
globalTypes: br(e, "globalTypes"),
|
|
3261
|
+
loaders: se(e, "loaders"),
|
|
3262
|
+
beforeAll: Yo(n),
|
|
3263
|
+
beforeEach: se(e, "beforeEach"),
|
|
3264
|
+
experimental_afterEach: se(e, "experimental_afterEach"),
|
|
3265
|
+
render: Ue(e, "render"),
|
|
3266
|
+
renderToCanvas: Ue(e, "renderToCanvas"),
|
|
3267
|
+
applyDecorators: Ue(e, "applyDecorators"),
|
|
3268
|
+
runStep: gr(o),
|
|
3269
|
+
tags: se(e, "tags"),
|
|
3270
|
+
mount: Ue(e, "mount"),
|
|
3271
|
+
testingLibraryRender: Ue(e, "testingLibraryRender")
|
|
3278
3272
|
};
|
|
3279
3273
|
}
|
|
3280
|
-
s(
|
|
3274
|
+
s(Z, "composeConfigs");
|
|
3281
3275
|
|
|
3282
3276
|
// src/preview-api/modules/store/csf/portable-stories.ts
|
|
3283
|
-
var
|
|
3277
|
+
var Jo = require("storybook/internal/csf"), Qo = require("storybook/internal/preview-errors"), Zo = I(W(), 1);
|
|
3284
3278
|
|
|
3285
3279
|
// src/preview-api/modules/store/reporter-api.ts
|
|
3286
|
-
var
|
|
3280
|
+
var ie = class {
|
|
3287
3281
|
constructor() {
|
|
3288
3282
|
this.reports = [];
|
|
3289
3283
|
}
|
|
@@ -3296,9 +3290,9 @@ var se = class {
|
|
|
3296
3290
|
};
|
|
3297
3291
|
|
|
3298
3292
|
// src/preview-api/modules/store/csf/csf-factory-utils.ts
|
|
3299
|
-
var
|
|
3293
|
+
var Xo = require("storybook/internal/csf");
|
|
3300
3294
|
function Sr(r, e, t) {
|
|
3301
|
-
return (0,
|
|
3295
|
+
return (0, Xo.isStory)(r) ? {
|
|
3302
3296
|
story: r.input,
|
|
3303
3297
|
meta: r.meta.input,
|
|
3304
3298
|
preview: r.meta.preview.composed
|
|
@@ -3307,45 +3301,46 @@ function Sr(r, e, t) {
|
|
|
3307
3301
|
s(Sr, "getCsfFactoryAnnotations");
|
|
3308
3302
|
|
|
3309
3303
|
// src/preview-api/modules/store/csf/portable-stories.ts
|
|
3310
|
-
function
|
|
3304
|
+
function en(r) {
|
|
3311
3305
|
globalThis.defaultProjectAnnotations = r;
|
|
3312
3306
|
}
|
|
3313
|
-
s(
|
|
3314
|
-
var
|
|
3315
|
-
function
|
|
3316
|
-
return r ?
|
|
3307
|
+
s(en, "setDefaultProjectAnnotations");
|
|
3308
|
+
var ti = "ComposedStory", oi = "Unnamed Story";
|
|
3309
|
+
function ni(r) {
|
|
3310
|
+
return r ? Z([r]) : {};
|
|
3317
3311
|
}
|
|
3318
|
-
s(
|
|
3319
|
-
function
|
|
3312
|
+
s(ni, "extractAnnotation");
|
|
3313
|
+
function rn(r) {
|
|
3320
3314
|
let e = Array.isArray(r) ? r : [r];
|
|
3321
|
-
return globalThis.globalProjectAnnotations =
|
|
3315
|
+
return globalThis.globalProjectAnnotations = Z([
|
|
3322
3316
|
globalThis.defaultProjectAnnotations ?? {},
|
|
3323
|
-
|
|
3317
|
+
Z(e.map(ni))
|
|
3324
3318
|
]), globalThis.globalProjectAnnotations ?? {};
|
|
3325
3319
|
}
|
|
3326
|
-
s(
|
|
3327
|
-
var
|
|
3328
|
-
function
|
|
3320
|
+
s(rn, "setProjectAnnotations");
|
|
3321
|
+
var ae = [];
|
|
3322
|
+
function dt(r, e, t, o, n) {
|
|
3329
3323
|
if (r === void 0)
|
|
3330
3324
|
throw new Error("Expected a story but received undefined.");
|
|
3331
|
-
e.title = e.title ??
|
|
3332
|
-
let i =
|
|
3325
|
+
e.title = e.title ?? ti;
|
|
3326
|
+
let i = ze(e), a = n || r.storyName || r.story?.name || r.name || oi, l = ye(
|
|
3333
3327
|
a,
|
|
3334
3328
|
r,
|
|
3335
3329
|
i
|
|
3336
|
-
), c =
|
|
3337
|
-
|
|
3330
|
+
), c = me(
|
|
3331
|
+
Z([
|
|
3332
|
+
...ne(),
|
|
3338
3333
|
o ?? globalThis.globalProjectAnnotations ?? {},
|
|
3339
3334
|
t ?? {}
|
|
3340
3335
|
])
|
|
3341
|
-
), d =
|
|
3336
|
+
), d = De(
|
|
3342
3337
|
l,
|
|
3343
3338
|
i,
|
|
3344
3339
|
c
|
|
3345
3340
|
), u = {
|
|
3346
3341
|
...c.initialGlobals,
|
|
3347
3342
|
...d.storyGlobals
|
|
3348
|
-
}, p = new
|
|
3343
|
+
}, p = new ie(), h = /* @__PURE__ */ s(() => {
|
|
3349
3344
|
let y = hr({
|
|
3350
3345
|
hooks: new te(),
|
|
3351
3346
|
globals: u,
|
|
@@ -3354,7 +3349,7 @@ function at(r, e, t, o, n) {
|
|
|
3354
3349
|
reporting: p,
|
|
3355
3350
|
loaded: {},
|
|
3356
3351
|
abortSignal: new AbortController().signal,
|
|
3357
|
-
step: /* @__PURE__ */ s((f,
|
|
3352
|
+
step: /* @__PURE__ */ s((f, S) => d.runStep(f, S, y), "step"),
|
|
3358
3353
|
canvasElement: null,
|
|
3359
3354
|
canvas: {},
|
|
3360
3355
|
userEvent: {},
|
|
@@ -3373,12 +3368,12 @@ function at(r, e, t, o, n) {
|
|
|
3373
3368
|
tags: d.tags,
|
|
3374
3369
|
showMain: /* @__PURE__ */ s(() => {
|
|
3375
3370
|
}, "showMain"),
|
|
3376
|
-
showError: /* @__PURE__ */ s((
|
|
3377
|
-
throw new Error(`${
|
|
3378
|
-
${
|
|
3371
|
+
showError: /* @__PURE__ */ s((S) => {
|
|
3372
|
+
throw new Error(`${S.title}
|
|
3373
|
+
${S.description}`);
|
|
3379
3374
|
}, "showError"),
|
|
3380
|
-
showException: /* @__PURE__ */ s((
|
|
3381
|
-
throw
|
|
3375
|
+
showException: /* @__PURE__ */ s((S) => {
|
|
3376
|
+
throw S;
|
|
3382
3377
|
}, "showException"),
|
|
3383
3378
|
forceRemount: !0,
|
|
3384
3379
|
storyContext: y,
|
|
@@ -3387,65 +3382,65 @@ ${b.description}`);
|
|
|
3387
3382
|
},
|
|
3388
3383
|
y.canvasElement
|
|
3389
3384
|
);
|
|
3390
|
-
f &&
|
|
3385
|
+
f && ae.push(f);
|
|
3391
3386
|
}), y.mount = d.mount(y), y;
|
|
3392
|
-
}, "initializeContext"),
|
|
3393
|
-
let f =
|
|
3394
|
-
return f.canvasElement ??= globalThis?.document?.body,
|
|
3395
|
-
}, "play"),
|
|
3396
|
-
let f =
|
|
3397
|
-
return Object.assign(f, y),
|
|
3398
|
-
}, "run"),
|
|
3387
|
+
}, "initializeContext"), g, E = /* @__PURE__ */ s(async (y) => {
|
|
3388
|
+
let f = h();
|
|
3389
|
+
return f.canvasElement ??= globalThis?.document?.body, g && (f.loaded = g.loaded), Object.assign(f, y), d.playFunction(f);
|
|
3390
|
+
}, "play"), R = /* @__PURE__ */ s((y) => {
|
|
3391
|
+
let f = h();
|
|
3392
|
+
return Object.assign(f, y), ii(d, f);
|
|
3393
|
+
}, "run"), m = d.playFunction ? E : void 0;
|
|
3399
3394
|
return Object.assign(
|
|
3400
3395
|
/* @__PURE__ */ s(function(f) {
|
|
3401
|
-
let
|
|
3402
|
-
return
|
|
3403
|
-
...
|
|
3396
|
+
let S = h();
|
|
3397
|
+
return g && (S.loaded = g.loaded), S.args = {
|
|
3398
|
+
...S.initialArgs,
|
|
3404
3399
|
...f
|
|
3405
|
-
}, d.unboundStoryFn(
|
|
3400
|
+
}, d.unboundStoryFn(S);
|
|
3406
3401
|
}, "storyFn"),
|
|
3407
3402
|
{
|
|
3408
3403
|
id: d.id,
|
|
3409
3404
|
storyName: a,
|
|
3410
3405
|
load: /* @__PURE__ */ s(async () => {
|
|
3411
|
-
for (let f of [...
|
|
3406
|
+
for (let f of [...ae].reverse())
|
|
3412
3407
|
await f();
|
|
3413
|
-
|
|
3414
|
-
let y =
|
|
3415
|
-
y.loaded = await d.applyLoaders(y),
|
|
3408
|
+
ae.length = 0;
|
|
3409
|
+
let y = h();
|
|
3410
|
+
y.loaded = await d.applyLoaders(y), ae.push(...(await d.applyBeforeEach(y)).filter(Boolean)), g = y;
|
|
3416
3411
|
}, "load"),
|
|
3417
3412
|
globals: u,
|
|
3418
3413
|
args: d.initialArgs,
|
|
3419
3414
|
parameters: d.parameters,
|
|
3420
3415
|
argTypes: d.argTypes,
|
|
3421
|
-
play:
|
|
3422
|
-
run:
|
|
3416
|
+
play: m,
|
|
3417
|
+
run: R,
|
|
3423
3418
|
reporting: p,
|
|
3424
3419
|
tags: d.tags
|
|
3425
3420
|
}
|
|
3426
3421
|
);
|
|
3427
3422
|
}
|
|
3428
|
-
s(
|
|
3429
|
-
var
|
|
3430
|
-
function
|
|
3423
|
+
s(dt, "composeStory");
|
|
3424
|
+
var si = /* @__PURE__ */ s((r, e, t, o) => dt(r, e, t, {}, o), "defaultComposeStory");
|
|
3425
|
+
function tn(r, e, t = si) {
|
|
3431
3426
|
let { default: o, __esModule: n, __namedExportsOrder: i, ...a } = r, l = o;
|
|
3432
3427
|
return Object.entries(a).reduce(
|
|
3433
3428
|
(d, [u, p]) => {
|
|
3434
|
-
let { story:
|
|
3435
|
-
return !l &&
|
|
3436
|
-
[u]: t(
|
|
3429
|
+
let { story: h, meta: g } = Sr(p);
|
|
3430
|
+
return !l && g && (l = g), (0, Jo.isExportStory)(u, l) ? Object.assign(d, {
|
|
3431
|
+
[u]: t(h, l, e, u)
|
|
3437
3432
|
}) : d;
|
|
3438
3433
|
},
|
|
3439
3434
|
{}
|
|
3440
3435
|
);
|
|
3441
3436
|
}
|
|
3442
|
-
s(
|
|
3443
|
-
function
|
|
3437
|
+
s(tn, "composeStories");
|
|
3438
|
+
function on(r) {
|
|
3444
3439
|
return r.extend({
|
|
3445
3440
|
mount: /* @__PURE__ */ s(async ({ mount: e, page: t }, o) => {
|
|
3446
3441
|
await o(async (n, ...i) => {
|
|
3447
3442
|
if (!("__pw_type" in n) || "__pw_type" in n && n.__pw_type !== "jsx")
|
|
3448
|
-
throw new Error(
|
|
3443
|
+
throw new Error(Zo.dedent`
|
|
3449
3444
|
Portable stories in Playwright CT only work when referencing JSX elements.
|
|
3450
3445
|
Please use JSX format for your components such as:
|
|
3451
3446
|
|
|
@@ -3470,40 +3465,42 @@ function en(r) {
|
|
|
3470
3465
|
}, "mount")
|
|
3471
3466
|
});
|
|
3472
3467
|
}
|
|
3473
|
-
s(
|
|
3474
|
-
async function
|
|
3475
|
-
for (let n of [...
|
|
3468
|
+
s(on, "createPlaywrightTest");
|
|
3469
|
+
async function ii(r, e) {
|
|
3470
|
+
for (let n of [...ae].reverse())
|
|
3476
3471
|
await n();
|
|
3477
|
-
if (
|
|
3472
|
+
if (ae.length = 0, !e.canvasElement) {
|
|
3478
3473
|
let n = document.createElement("div");
|
|
3479
|
-
globalThis?.document?.body?.appendChild(n), e.canvasElement = n,
|
|
3474
|
+
globalThis?.document?.body?.appendChild(n), e.canvasElement = n, ae.push(() => {
|
|
3480
3475
|
globalThis?.document?.body?.contains(n) && globalThis?.document?.body?.removeChild(n);
|
|
3481
3476
|
});
|
|
3482
3477
|
}
|
|
3483
3478
|
if (e.loaded = await r.applyLoaders(e), e.abortSignal.aborted)
|
|
3484
3479
|
return;
|
|
3485
|
-
|
|
3480
|
+
ae.push(...(await r.applyBeforeEach(e)).filter(Boolean));
|
|
3486
3481
|
let t = r.playFunction, o = r.usesMount;
|
|
3487
3482
|
o || await e.mount(), !e.abortSignal.aborted && (t && (o || (e.mount = async () => {
|
|
3488
|
-
throw new
|
|
3483
|
+
throw new Qo.MountMustBeDestructuredError({ playFunction: t.toString() });
|
|
3489
3484
|
}), await t(e)), await r.applyAfterEach(e));
|
|
3490
3485
|
}
|
|
3491
|
-
s(
|
|
3486
|
+
s(ii, "runStory");
|
|
3492
3487
|
|
|
3493
3488
|
// src/preview-api/modules/store/StoryStore.ts
|
|
3494
|
-
var
|
|
3489
|
+
var nn = 1e3, ai = 1e4, he = class {
|
|
3495
3490
|
constructor(e, t, o) {
|
|
3496
3491
|
this.importFn = t;
|
|
3497
|
-
this.storyIndex = new cr(e), this.projectAnnotations =
|
|
3492
|
+
this.storyIndex = new cr(e), this.projectAnnotations = me(
|
|
3493
|
+
Z([...ne(), o])
|
|
3494
|
+
);
|
|
3498
3495
|
let { initialGlobals: n, globalTypes: i } = this.projectAnnotations;
|
|
3499
3496
|
this.args = new ar(), this.userGlobals = new lr({ globals: n, globalTypes: i }), this.hooks = {}, this.cleanupCallbacks = {}, this.processCSFFileWithCache =
|
|
3500
|
-
(0, Tr.default)(
|
|
3497
|
+
(0, Tr.default)(nn)(Lo), this.prepareMetaWithCache = (0, Tr.default)(nn)(mr), this.prepareStoryWithCache = (0, Tr.default)(ai)(De);
|
|
3501
3498
|
}
|
|
3502
3499
|
static {
|
|
3503
3500
|
s(this, "StoryStore");
|
|
3504
3501
|
}
|
|
3505
3502
|
setProjectAnnotations(e) {
|
|
3506
|
-
this.projectAnnotations =
|
|
3503
|
+
this.projectAnnotations = me(e);
|
|
3507
3504
|
let { initialGlobals: t, globalTypes: o } = e;
|
|
3508
3505
|
this.userGlobals.set({ globals: t, globalTypes: o });
|
|
3509
3506
|
}
|
|
@@ -3591,7 +3588,7 @@ var rn = 1e3, ti = 1e4, he = class {
|
|
|
3591
3588
|
// A prepared story does not include args, globals or hooks. These are stored in the story store
|
|
3592
3589
|
// and updated separtely to the (immutable) story.
|
|
3593
3590
|
getStoryContext(e, { forceInitialArgs: t = !1 } = {}) {
|
|
3594
|
-
let o = this.userGlobals.get(), { initialGlobals: n } = this.userGlobals, i = new
|
|
3591
|
+
let o = this.userGlobals.get(), { initialGlobals: n } = this.userGlobals, i = new ie();
|
|
3595
3592
|
return hr({
|
|
3596
3593
|
...e,
|
|
3597
3594
|
args: t ? e.initialArgs : this.args.get(e.id),
|
|
@@ -3646,17 +3643,17 @@ var rn = 1e3, ti = 1e4, he = class {
|
|
|
3646
3643
|
};
|
|
3647
3644
|
|
|
3648
3645
|
// src/preview-api/modules/store/autoTitle.ts
|
|
3649
|
-
var
|
|
3646
|
+
var an = require("storybook/internal/client-logger");
|
|
3650
3647
|
|
|
3651
3648
|
// ../node_modules/slash/index.js
|
|
3652
|
-
function
|
|
3649
|
+
function pt(r) {
|
|
3653
3650
|
return r.startsWith("\\\\?\\") ? r : r.replace(/\\/g, "/");
|
|
3654
3651
|
}
|
|
3655
|
-
s(
|
|
3652
|
+
s(pt, "slash");
|
|
3656
3653
|
|
|
3657
3654
|
// src/preview-api/modules/store/autoTitle.ts
|
|
3658
|
-
var
|
|
3659
|
-
var
|
|
3655
|
+
var ln = I(W(), 1);
|
|
3656
|
+
var li = /* @__PURE__ */ s((r) => {
|
|
3660
3657
|
if (r.length === 0)
|
|
3661
3658
|
return r;
|
|
3662
3659
|
let e = r[r.length - 1], t = e?.replace(/(?:[.](?:story|stories))?([.][^.]+)$/i, "");
|
|
@@ -3666,28 +3663,28 @@ var oi = /* @__PURE__ */ s((r) => {
|
|
|
3666
3663
|
return t && o && t.toLowerCase() === o.toLowerCase() ? [...r.slice(0, -2), t] : t && (/^(story|stories)([.][^.]+)$/i.test(e) || /^index$/i.
|
|
3667
3664
|
test(t)) ? r.slice(0, -1) : [...r.slice(0, -1), t];
|
|
3668
3665
|
}, "sanitize");
|
|
3669
|
-
function
|
|
3666
|
+
function sn(r) {
|
|
3670
3667
|
return r.flatMap((e) => e.split("/")).filter(Boolean).join("/");
|
|
3671
3668
|
}
|
|
3672
|
-
s(
|
|
3673
|
-
var
|
|
3669
|
+
s(sn, "pathJoin");
|
|
3670
|
+
var ut = /* @__PURE__ */ s((r, e, t) => {
|
|
3674
3671
|
let { directory: o, importPathMatcher: n, titlePrefix: i = "" } = e || {};
|
|
3675
|
-
typeof r == "number" &&
|
|
3672
|
+
typeof r == "number" && an.once.warn(ln.dedent`
|
|
3676
3673
|
CSF Auto-title received a numeric fileName. This typically happens when
|
|
3677
3674
|
webpack is mis-configured in production mode. To force webpack to produce
|
|
3678
3675
|
filenames, set optimization.moduleIds = "named" in your webpack config.
|
|
3679
3676
|
`);
|
|
3680
|
-
let a =
|
|
3677
|
+
let a = pt(String(r));
|
|
3681
3678
|
if (n.exec(a)) {
|
|
3682
3679
|
if (!t) {
|
|
3683
|
-
let l = a.replace(o, ""), c =
|
|
3684
|
-
return c =
|
|
3680
|
+
let l = a.replace(o, ""), c = sn([i, l]).split("/");
|
|
3681
|
+
return c = li(c), c.join("/");
|
|
3685
3682
|
}
|
|
3686
|
-
return i ?
|
|
3683
|
+
return i ? sn([i, t]) : t;
|
|
3687
3684
|
}
|
|
3688
|
-
}, "userOrAutoTitleFromSpecifier"),
|
|
3685
|
+
}, "userOrAutoTitleFromSpecifier"), cn = /* @__PURE__ */ s((r, e, t) => {
|
|
3689
3686
|
for (let o = 0; o < e.length; o += 1) {
|
|
3690
|
-
let n =
|
|
3687
|
+
let n = ut(r, e[o], t);
|
|
3691
3688
|
if (n)
|
|
3692
3689
|
return n;
|
|
3693
3690
|
}
|
|
@@ -3695,13 +3692,13 @@ var ct = /* @__PURE__ */ s((r, e, t) => {
|
|
|
3695
3692
|
}, "userOrAutoTitle");
|
|
3696
3693
|
|
|
3697
3694
|
// src/preview-api/modules/store/sortStories.ts
|
|
3698
|
-
var
|
|
3695
|
+
var un = I(W(), 1);
|
|
3699
3696
|
|
|
3700
3697
|
// src/preview-api/modules/store/storySort.ts
|
|
3701
|
-
var
|
|
3698
|
+
var dn = /\s*\/\s*/, pn = /* @__PURE__ */ s((r = {}) => (e, t) => {
|
|
3702
3699
|
if (e.title === t.title && !r.includeNames)
|
|
3703
3700
|
return 0;
|
|
3704
|
-
let o = r.method || "configure", n = r.order || [], i = e.title.trim().split(
|
|
3701
|
+
let o = r.method || "configure", n = r.order || [], i = e.title.trim().split(dn), a = t.title.trim().split(dn);
|
|
3705
3702
|
r.includeNames && (i.push(e.name), a.push(t.name));
|
|
3706
3703
|
let l = 0;
|
|
3707
3704
|
for (; i[l] || a[l]; ) {
|
|
@@ -3711,8 +3708,8 @@ var an = /\s*\/\s*/, ln = /* @__PURE__ */ s((r = {}) => (e, t) => {
|
|
|
3711
3708
|
return 1;
|
|
3712
3709
|
let c = i[l], d = a[l];
|
|
3713
3710
|
if (c !== d) {
|
|
3714
|
-
let p = n.indexOf(c),
|
|
3715
|
-
return p !== -1 ||
|
|
3711
|
+
let p = n.indexOf(c), h = n.indexOf(d), g = n.indexOf("*");
|
|
3712
|
+
return p !== -1 || h !== -1 ? (p === -1 && (g !== -1 ? p = g : p = n.length), h === -1 && (g !== -1 ? h = g : h = n.length), p - h) : o ===
|
|
3716
3713
|
"configure" ? 0 : c.localeCompare(d, r.locales ? r.locales : void 0, {
|
|
3717
3714
|
numeric: !0,
|
|
3718
3715
|
sensitivity: "accent"
|
|
@@ -3725,20 +3722,20 @@ var an = /\s*\/\s*/, ln = /* @__PURE__ */ s((r = {}) => (e, t) => {
|
|
|
3725
3722
|
}, "storySort");
|
|
3726
3723
|
|
|
3727
3724
|
// src/preview-api/modules/store/sortStories.ts
|
|
3728
|
-
var
|
|
3725
|
+
var ci = /* @__PURE__ */ s((r, e, t) => {
|
|
3729
3726
|
if (e) {
|
|
3730
3727
|
let o;
|
|
3731
|
-
typeof e == "function" ? o = e : o =
|
|
3728
|
+
typeof e == "function" ? o = e : o = pn(e), r.sort(o);
|
|
3732
3729
|
} else
|
|
3733
3730
|
r.sort(
|
|
3734
3731
|
(o, n) => t.indexOf(o.importPath) - t.indexOf(n.importPath)
|
|
3735
3732
|
);
|
|
3736
3733
|
return r;
|
|
3737
|
-
}, "sortStoriesCommon"),
|
|
3734
|
+
}, "sortStoriesCommon"), fn = /* @__PURE__ */ s((r, e, t) => {
|
|
3738
3735
|
try {
|
|
3739
|
-
return
|
|
3736
|
+
return ci(r, e, t);
|
|
3740
3737
|
} catch (o) {
|
|
3741
|
-
throw new Error(
|
|
3738
|
+
throw new Error(un.dedent`
|
|
3742
3739
|
Error sorting stories with sort parameter ${e}:
|
|
3743
3740
|
|
|
3744
3741
|
> ${o.message}
|
|
@@ -3751,18 +3748,18 @@ var ni = /* @__PURE__ */ s((r, e, t) => {
|
|
|
3751
3748
|
}, "sortStoriesV7");
|
|
3752
3749
|
|
|
3753
3750
|
// src/preview-api/modules/preview-web/Preview.tsx
|
|
3754
|
-
var He = require("storybook/internal/client-logger"),
|
|
3755
|
-
|
|
3751
|
+
var He = require("storybook/internal/client-logger"), P = require("storybook/internal/core-events"), j = require("storybook/internal/preview-errors"),
|
|
3752
|
+
hn = require("@storybook/global");
|
|
3756
3753
|
|
|
3757
3754
|
// src/preview-api/modules/preview-web/render/StoryRender.ts
|
|
3758
3755
|
var B = require("storybook/internal/core-events"), Rr = require("storybook/internal/preview-errors");
|
|
3759
3756
|
|
|
3760
3757
|
// src/preview-api/modules/preview-web/render/Render.ts
|
|
3761
|
-
var
|
|
3758
|
+
var le = new Error("prepareAborted");
|
|
3762
3759
|
|
|
3763
3760
|
// src/preview-api/modules/preview-web/render/StoryRender.ts
|
|
3764
|
-
var { AbortController:
|
|
3765
|
-
function
|
|
3761
|
+
var { AbortController: yn } = globalThis;
|
|
3762
|
+
function mn(r) {
|
|
3766
3763
|
try {
|
|
3767
3764
|
let { name: e = "Error", message: t = String(r), stack: o } = r;
|
|
3768
3765
|
return { name: e, message: t, stack: o };
|
|
@@ -3770,7 +3767,7 @@ function un(r) {
|
|
|
3770
3767
|
return { name: "Error", message: String(r) };
|
|
3771
3768
|
}
|
|
3772
3769
|
}
|
|
3773
|
-
s(
|
|
3770
|
+
s(mn, "serializeError");
|
|
3774
3771
|
var ge = class {
|
|
3775
3772
|
constructor(e, t, o, n, i, a, l = { autoplay: !0, forceInitialArgs: !1 }, c) {
|
|
3776
3773
|
this.channel = e;
|
|
@@ -3787,7 +3784,7 @@ var ge = class {
|
|
|
3787
3784
|
this.teardownRender = /* @__PURE__ */ s(() => {
|
|
3788
3785
|
}, "teardownRender");
|
|
3789
3786
|
this.torndown = !1;
|
|
3790
|
-
this.abortController = new
|
|
3787
|
+
this.abortController = new yn(), c && (this.story = c, this.phase = "preparing");
|
|
3791
3788
|
}
|
|
3792
3789
|
static {
|
|
3793
3790
|
s(this, "StoryRender");
|
|
@@ -3804,7 +3801,7 @@ var ge = class {
|
|
|
3804
3801
|
if (await this.runPhase(this.abortController.signal, "preparing", async () => {
|
|
3805
3802
|
this.story = await this.store.loadStory({ storyId: this.id });
|
|
3806
3803
|
}), this.abortController.signal.aborted)
|
|
3807
|
-
throw await this.store.cleanupStory(this.story),
|
|
3804
|
+
throw await this.store.cleanupStory(this.story), le;
|
|
3808
3805
|
}
|
|
3809
3806
|
// The two story "renders" are equal and have both loaded the same story
|
|
3810
3807
|
isEqual(e) {
|
|
@@ -3845,28 +3842,28 @@ var ge = class {
|
|
|
3845
3842
|
tags: d,
|
|
3846
3843
|
applyLoaders: u,
|
|
3847
3844
|
applyBeforeEach: p,
|
|
3848
|
-
applyAfterEach:
|
|
3849
|
-
unboundStoryFn:
|
|
3845
|
+
applyAfterEach: h,
|
|
3846
|
+
unboundStoryFn: g,
|
|
3850
3847
|
playFunction: E,
|
|
3851
|
-
runStep:
|
|
3848
|
+
runStep: R
|
|
3852
3849
|
} = n;
|
|
3853
|
-
t && !e && (this.cancelRender(), this.abortController = new
|
|
3854
|
-
let
|
|
3850
|
+
t && !e && (this.cancelRender(), this.abortController = new yn());
|
|
3851
|
+
let m = this.abortController.signal, b = !1, y = n.usesMount;
|
|
3855
3852
|
try {
|
|
3856
3853
|
let f = {
|
|
3857
3854
|
...this.storyContext(),
|
|
3858
3855
|
viewMode: this.viewMode,
|
|
3859
|
-
abortSignal:
|
|
3856
|
+
abortSignal: m,
|
|
3860
3857
|
canvasElement: o,
|
|
3861
3858
|
loaded: {},
|
|
3862
|
-
step: /* @__PURE__ */ s((C, H) =>
|
|
3859
|
+
step: /* @__PURE__ */ s((C, H) => R(C, H, f), "step"),
|
|
3863
3860
|
context: null,
|
|
3864
3861
|
canvas: {},
|
|
3865
3862
|
userEvent: {},
|
|
3866
3863
|
renderToCanvas: /* @__PURE__ */ s(async () => {
|
|
3867
|
-
let C = await this.renderToScreen(
|
|
3864
|
+
let C = await this.renderToScreen(S, o);
|
|
3868
3865
|
this.teardownRender = C || (() => {
|
|
3869
|
-
}),
|
|
3866
|
+
}), b = !0;
|
|
3870
3867
|
}, "renderToCanvas"),
|
|
3871
3868
|
// The story provides (set in a renderer) a mount function that is a higher order function
|
|
3872
3869
|
// (context) => (...args) => Canvas
|
|
@@ -3876,13 +3873,13 @@ var ge = class {
|
|
|
3876
3873
|
mount: /* @__PURE__ */ s(async (...C) => {
|
|
3877
3874
|
this.callbacks.showStoryDuringRender?.();
|
|
3878
3875
|
let H = null;
|
|
3879
|
-
return await this.runPhase(
|
|
3876
|
+
return await this.runPhase(m, "rendering", async () => {
|
|
3880
3877
|
H = await n.mount(f)(...C);
|
|
3881
|
-
}), y && await this.runPhase(
|
|
3878
|
+
}), y && await this.runPhase(m, "playing"), H;
|
|
3882
3879
|
}, "mount")
|
|
3883
3880
|
};
|
|
3884
3881
|
f.context = f;
|
|
3885
|
-
let
|
|
3882
|
+
let S = {
|
|
3886
3883
|
componentId: a,
|
|
3887
3884
|
title: l,
|
|
3888
3885
|
kind: l,
|
|
@@ -3895,61 +3892,61 @@ var ge = class {
|
|
|
3895
3892
|
showException: /* @__PURE__ */ s((C) => (this.phase = "errored", this.callbacks.showException(C)), "showException"),
|
|
3896
3893
|
forceRemount: t || this.notYetRendered,
|
|
3897
3894
|
storyContext: f,
|
|
3898
|
-
storyFn: /* @__PURE__ */ s(() =>
|
|
3899
|
-
unboundStoryFn:
|
|
3895
|
+
storyFn: /* @__PURE__ */ s(() => g(f), "storyFn"),
|
|
3896
|
+
unboundStoryFn: g
|
|
3900
3897
|
};
|
|
3901
|
-
if (await this.runPhase(
|
|
3898
|
+
if (await this.runPhase(m, "loading", async () => {
|
|
3902
3899
|
f.loaded = await u(f);
|
|
3903
|
-
}),
|
|
3900
|
+
}), m.aborted)
|
|
3904
3901
|
return;
|
|
3905
|
-
let
|
|
3906
|
-
if (this.store.addCleanupCallbacks(n,
|
|
3902
|
+
let F = await p(f);
|
|
3903
|
+
if (this.store.addCleanupCallbacks(n, F), this.checkIfAborted(m) || (!b && !y && await f.mount(), this.notYetRendered = !1, m.aborted))
|
|
3907
3904
|
return;
|
|
3908
|
-
let
|
|
3905
|
+
let T = this.story.parameters?.test?.dangerouslyIgnoreUnhandledErrors === !0, A = /* @__PURE__ */ new Set(), D = /* @__PURE__ */ s((C) => A.
|
|
3909
3906
|
add("error" in C ? C.error : C.reason), "onError");
|
|
3910
3907
|
if (this.renderOptions.autoplay && t && E && this.phase !== "errored") {
|
|
3911
|
-
window.addEventListener("error",
|
|
3908
|
+
window.addEventListener("error", D), window.addEventListener("unhandledrejection", D), this.disableKeyListeners = !0;
|
|
3912
3909
|
try {
|
|
3913
3910
|
if (y ? await E(f) : (f.mount = async () => {
|
|
3914
3911
|
throw new Rr.MountMustBeDestructuredError({ playFunction: E.toString() });
|
|
3915
|
-
}, await this.runPhase(
|
|
3912
|
+
}, await this.runPhase(m, "playing", async () => E(f))), !b)
|
|
3916
3913
|
throw new Rr.NoStoryMountedError();
|
|
3917
|
-
this.checkIfAborted(
|
|
3914
|
+
this.checkIfAborted(m), !T && A.size > 0 ? await this.runPhase(m, "errored") : await this.runPhase(m, "played");
|
|
3918
3915
|
} catch (C) {
|
|
3919
|
-
if (this.callbacks.showStoryDuringRender?.(), await this.runPhase(
|
|
3920
|
-
this.channel.emit(B.PLAY_FUNCTION_THREW_EXCEPTION,
|
|
3916
|
+
if (this.callbacks.showStoryDuringRender?.(), await this.runPhase(m, "errored", async () => {
|
|
3917
|
+
this.channel.emit(B.PLAY_FUNCTION_THREW_EXCEPTION, mn(C));
|
|
3921
3918
|
}), this.story.parameters.throwPlayFunctionExceptions !== !1)
|
|
3922
3919
|
throw C;
|
|
3923
3920
|
console.error(C);
|
|
3924
3921
|
}
|
|
3925
|
-
if (!
|
|
3922
|
+
if (!T && A.size > 0 && this.channel.emit(
|
|
3926
3923
|
B.UNHANDLED_ERRORS_WHILE_PLAYING,
|
|
3927
|
-
Array.from(
|
|
3928
|
-
), this.disableKeyListeners = !1, window.removeEventListener("unhandledrejection",
|
|
3924
|
+
Array.from(A).map(mn)
|
|
3925
|
+
), this.disableKeyListeners = !1, window.removeEventListener("unhandledrejection", D), window.removeEventListener("error", D), m.aborted)
|
|
3929
3926
|
return;
|
|
3930
3927
|
}
|
|
3931
3928
|
await this.runPhase(
|
|
3932
|
-
|
|
3929
|
+
m,
|
|
3933
3930
|
"completed",
|
|
3934
3931
|
async () => this.channel.emit(B.STORY_RENDERED, i)
|
|
3935
|
-
), this.phase !== "errored" && await this.runPhase(
|
|
3936
|
-
await
|
|
3932
|
+
), this.phase !== "errored" && await this.runPhase(m, "afterEach", async () => {
|
|
3933
|
+
await h(f);
|
|
3937
3934
|
});
|
|
3938
|
-
let
|
|
3935
|
+
let L = !T && A.size > 0, G = f.reporting.reports.some(
|
|
3939
3936
|
(C) => C.status === "failed"
|
|
3940
|
-
),
|
|
3937
|
+
), Ce = L || G;
|
|
3941
3938
|
await this.runPhase(
|
|
3942
|
-
|
|
3939
|
+
m,
|
|
3943
3940
|
"finished",
|
|
3944
3941
|
async () => this.channel.emit(B.STORY_FINISHED, {
|
|
3945
3942
|
storyId: i,
|
|
3946
|
-
status:
|
|
3943
|
+
status: Ce ? "error" : "success",
|
|
3947
3944
|
reporters: f.reporting.reports
|
|
3948
3945
|
})
|
|
3949
3946
|
);
|
|
3950
3947
|
} catch (f) {
|
|
3951
3948
|
this.phase = "errored", this.callbacks.showException(f), await this.runPhase(
|
|
3952
|
-
|
|
3949
|
+
m,
|
|
3953
3950
|
"finished",
|
|
3954
3951
|
async () => this.channel.emit(B.STORY_FINISHED, {
|
|
3955
3952
|
storyId: i,
|
|
@@ -3998,8 +3995,8 @@ var ge = class {
|
|
|
3998
3995
|
};
|
|
3999
3996
|
|
|
4000
3997
|
// src/preview-api/modules/preview-web/Preview.tsx
|
|
4001
|
-
var { fetch:
|
|
4002
|
-
constructor(e, t, o =
|
|
3998
|
+
var { fetch: di } = hn.global, pi = "./index.json", be = class {
|
|
3999
|
+
constructor(e, t, o = q.getChannel(), n = !0) {
|
|
4003
4000
|
this.importFn = e;
|
|
4004
4001
|
this.getProjectAnnotations = t;
|
|
4005
4002
|
this.channel = o;
|
|
@@ -4042,10 +4039,10 @@ var { fetch: si } = fn.global, ii = "./index.json", be = class {
|
|
|
4042
4039
|
return this.storeInitializationPromise;
|
|
4043
4040
|
}
|
|
4044
4041
|
setupListeners() {
|
|
4045
|
-
this.channel.on(
|
|
4046
|
-
bind(this)), this.channel.on(
|
|
4047
|
-
bind(this)), this.channel.on(
|
|
4048
|
-
this)), this.channel.on(
|
|
4042
|
+
this.channel.on(P.STORY_INDEX_INVALIDATED, this.onStoryIndexChanged.bind(this)), this.channel.on(P.UPDATE_GLOBALS, this.onUpdateGlobals.
|
|
4043
|
+
bind(this)), this.channel.on(P.UPDATE_STORY_ARGS, this.onUpdateArgs.bind(this)), this.channel.on(P.ARGTYPES_INFO_REQUEST, this.onRequestArgTypesInfo.
|
|
4044
|
+
bind(this)), this.channel.on(P.RESET_STORY_ARGS, this.onResetArgs.bind(this)), this.channel.on(P.FORCE_RE_RENDER, this.onForceReRender.bind(
|
|
4045
|
+
this)), this.channel.on(P.FORCE_REMOUNT, this.onForceRemount.bind(this));
|
|
4049
4046
|
}
|
|
4050
4047
|
async getProjectAnnotationsOrRenderError() {
|
|
4051
4048
|
try {
|
|
@@ -4075,7 +4072,7 @@ var { fetch: si } = fn.global, ii = "./index.json", be = class {
|
|
|
4075
4072
|
}
|
|
4076
4073
|
}
|
|
4077
4074
|
async getStoryIndexFromServer() {
|
|
4078
|
-
let e = await
|
|
4075
|
+
let e = await di(pi);
|
|
4079
4076
|
if (e.status === 200)
|
|
4080
4077
|
return e.json();
|
|
4081
4078
|
throw new j.StoryIndexFetchError({ text: await e.text() });
|
|
@@ -4100,7 +4097,7 @@ var { fetch: si } = fn.global, ii = "./index.json", be = class {
|
|
|
4100
4097
|
globals: this.storyStoreValue.userGlobals.get() || {},
|
|
4101
4098
|
globalTypes: this.storyStoreValue.projectAnnotations.globalTypes || {}
|
|
4102
4099
|
};
|
|
4103
|
-
this.channel.emit(
|
|
4100
|
+
this.channel.emit(P.SET_GLOBALS, e);
|
|
4104
4101
|
}
|
|
4105
4102
|
// EVENT HANDLERS
|
|
4106
4103
|
// This happens when a config file gets reloaded
|
|
@@ -4145,7 +4142,7 @@ var { fetch: si } = fn.global, ii = "./index.json", be = class {
|
|
|
4145
4142
|
throw new j.CalledPreviewMethodBeforeInitializationError({ methodName: "onUpdateGlobals" });
|
|
4146
4143
|
if (this.storyStoreValue.userGlobals.update(e), t) {
|
|
4147
4144
|
let { initialGlobals: o, storyGlobals: n, userGlobals: i, globals: a } = this.storyStoreValue.getStoryContext(t);
|
|
4148
|
-
this.channel.emit(
|
|
4145
|
+
this.channel.emit(P.GLOBALS_UPDATED, {
|
|
4149
4146
|
initialGlobals: o,
|
|
4150
4147
|
userGlobals: i,
|
|
4151
4148
|
storyGlobals: n,
|
|
@@ -4153,7 +4150,7 @@ var { fetch: si } = fn.global, ii = "./index.json", be = class {
|
|
|
4153
4150
|
});
|
|
4154
4151
|
} else {
|
|
4155
4152
|
let { initialGlobals: o, globals: n } = this.storyStoreValue.userGlobals;
|
|
4156
|
-
this.channel.emit(
|
|
4153
|
+
this.channel.emit(P.GLOBALS_UPDATED, {
|
|
4157
4154
|
initialGlobals: o,
|
|
4158
4155
|
userGlobals: n,
|
|
4159
4156
|
storyGlobals: {},
|
|
@@ -4173,7 +4170,7 @@ var { fetch: si } = fn.global, ii = "./index.json", be = class {
|
|
|
4173
4170
|
o.story && o.story.usesMount ? o.remount() : o.rerender()
|
|
4174
4171
|
)
|
|
4175
4172
|
)
|
|
4176
|
-
), this.channel.emit(
|
|
4173
|
+
), this.channel.emit(P.STORY_ARGS_UPDATED, {
|
|
4177
4174
|
storyId: e,
|
|
4178
4175
|
args: this.storyStoreValue.args.get(e)
|
|
4179
4176
|
});
|
|
@@ -4182,14 +4179,14 @@ var { fetch: si } = fn.global, ii = "./index.json", be = class {
|
|
|
4182
4179
|
try {
|
|
4183
4180
|
await this.storeInitializationPromise;
|
|
4184
4181
|
let o = await this.storyStoreValue?.loadStory(t);
|
|
4185
|
-
this.channel.emit(
|
|
4182
|
+
this.channel.emit(P.ARGTYPES_INFO_RESPONSE, {
|
|
4186
4183
|
id: e,
|
|
4187
4184
|
success: !0,
|
|
4188
4185
|
payload: { argTypes: o?.argTypes || {} },
|
|
4189
4186
|
error: null
|
|
4190
4187
|
});
|
|
4191
4188
|
} catch (o) {
|
|
4192
|
-
this.channel.emit(
|
|
4189
|
+
this.channel.emit(P.ARGTYPES_INFO_RESPONSE, {
|
|
4193
4190
|
id: e,
|
|
4194
4191
|
success: !1,
|
|
4195
4192
|
error: o?.message
|
|
@@ -4262,34 +4259,34 @@ var { fetch: si } = fn.global, ii = "./index.json", be = class {
|
|
|
4262
4259
|
}
|
|
4263
4260
|
// UTILITIES
|
|
4264
4261
|
renderPreviewEntryError(e, t) {
|
|
4265
|
-
this.previewEntryError = t, He.logger.error(e), He.logger.error(t), this.channel.emit(
|
|
4262
|
+
this.previewEntryError = t, He.logger.error(e), He.logger.error(t), this.channel.emit(P.CONFIG_ERROR, t);
|
|
4266
4263
|
}
|
|
4267
4264
|
};
|
|
4268
4265
|
|
|
4269
4266
|
// src/preview-api/modules/preview-web/PreviewWeb.tsx
|
|
4270
|
-
var
|
|
4267
|
+
var As = require("@storybook/global");
|
|
4271
4268
|
|
|
4272
4269
|
// src/preview-api/modules/preview-web/PreviewWithSelection.tsx
|
|
4273
4270
|
var Ye = require("storybook/internal/client-logger"), w = require("storybook/internal/core-events"), $ = require("storybook/internal/preview-errors");
|
|
4274
4271
|
|
|
4275
4272
|
// ../node_modules/tiny-invariant/dist/esm/tiny-invariant.js
|
|
4276
|
-
var
|
|
4273
|
+
var ui = process.env.NODE_ENV === "production", ft = "Invariant failed";
|
|
4277
4274
|
function wr(r, e) {
|
|
4278
4275
|
if (!r) {
|
|
4279
|
-
if (
|
|
4280
|
-
throw new Error(
|
|
4281
|
-
var t = typeof e == "function" ? e() : e, o = t ? "".concat(
|
|
4276
|
+
if (ui)
|
|
4277
|
+
throw new Error(ft);
|
|
4278
|
+
var t = typeof e == "function" ? e() : e, o = t ? "".concat(ft, ": ").concat(t) : ft;
|
|
4282
4279
|
throw new Error(o);
|
|
4283
4280
|
}
|
|
4284
4281
|
}
|
|
4285
4282
|
s(wr, "invariant");
|
|
4286
4283
|
|
|
4287
4284
|
// src/preview-api/modules/preview-web/render/CsfDocsRender.ts
|
|
4288
|
-
var
|
|
4285
|
+
var Sn = require("storybook/internal/core-events");
|
|
4289
4286
|
|
|
4290
4287
|
// src/preview-api/modules/preview-web/docs-context/DocsContext.ts
|
|
4291
|
-
var
|
|
4292
|
-
var
|
|
4288
|
+
var gn = require("storybook/internal/csf"), bn = I(W(), 1);
|
|
4289
|
+
var ee = class {
|
|
4293
4290
|
constructor(e, t, o, n) {
|
|
4294
4291
|
this.channel = e;
|
|
4295
4292
|
this.store = t;
|
|
@@ -4392,7 +4389,7 @@ CSF file?"
|
|
|
4392
4389
|
if (t)
|
|
4393
4390
|
return { type: "meta", csfFile: t };
|
|
4394
4391
|
let o = this.exportToStory.get(
|
|
4395
|
-
(0,
|
|
4392
|
+
(0, gn.isStory)(e) ? e.input : e
|
|
4396
4393
|
);
|
|
4397
4394
|
return o ? { type: "story", story: o } : { type: "component", component: e };
|
|
4398
4395
|
}
|
|
@@ -4405,7 +4402,7 @@ CSF file?"
|
|
|
4405
4402
|
o = this.resolveModuleExport(e);
|
|
4406
4403
|
if (t.length && !t.includes(o.type)) {
|
|
4407
4404
|
let n = o.type === "component" ? "component or unknown" : o.type;
|
|
4408
|
-
throw new Error(
|
|
4405
|
+
throw new Error(bn.dedent`Invalid value passed to the 'of' prop. The value was resolved to a '${n}' type but the only types for this block are: ${t.
|
|
4409
4406
|
join(
|
|
4410
4407
|
", "
|
|
4411
4408
|
)}.
|
|
@@ -4455,7 +4452,7 @@ var We = class {
|
|
|
4455
4452
|
this.preparing = !0;
|
|
4456
4453
|
let { entryExports: e, csfFiles: t = [] } = await this.store.loadEntry(this.id);
|
|
4457
4454
|
if (this.torndown)
|
|
4458
|
-
throw
|
|
4455
|
+
throw le;
|
|
4459
4456
|
let { importPath: o, title: n } = this.entry, i = this.store.processCSFFileWithCache(
|
|
4460
4457
|
e,
|
|
4461
4458
|
o,
|
|
@@ -4469,7 +4466,7 @@ var We = class {
|
|
|
4469
4466
|
docsContext(e) {
|
|
4470
4467
|
if (!this.csfFiles)
|
|
4471
4468
|
throw new Error("Cannot render docs before preparing");
|
|
4472
|
-
let t = new
|
|
4469
|
+
let t = new ee(
|
|
4473
4470
|
this.channel,
|
|
4474
4471
|
this.store,
|
|
4475
4472
|
e,
|
|
@@ -4487,7 +4484,7 @@ var We = class {
|
|
|
4487
4484
|
);
|
|
4488
4485
|
let i = await n.renderer(), { render: a } = i, l = /* @__PURE__ */ s(async () => {
|
|
4489
4486
|
try {
|
|
4490
|
-
await a(o, n, e), this.channel.emit(
|
|
4487
|
+
await a(o, n, e), this.channel.emit(Sn.DOCS_RENDERED, this.id);
|
|
4491
4488
|
} catch (c) {
|
|
4492
4489
|
this.callbacks.showException(c);
|
|
4493
4490
|
}
|
|
@@ -4502,7 +4499,7 @@ var We = class {
|
|
|
4502
4499
|
};
|
|
4503
4500
|
|
|
4504
4501
|
// src/preview-api/modules/preview-web/render/MdxDocsRender.ts
|
|
4505
|
-
var
|
|
4502
|
+
var Tn = require("storybook/internal/core-events");
|
|
4506
4503
|
var $e = class {
|
|
4507
4504
|
constructor(e, t, o, n) {
|
|
4508
4505
|
this.channel = e;
|
|
@@ -4526,7 +4523,7 @@ var $e = class {
|
|
|
4526
4523
|
this.preparing = !0;
|
|
4527
4524
|
let { entryExports: e, csfFiles: t = [] } = await this.store.loadEntry(this.id);
|
|
4528
4525
|
if (this.torndown)
|
|
4529
|
-
throw
|
|
4526
|
+
throw le;
|
|
4530
4527
|
this.csfFiles = t, this.exports = e, this.preparing = !1;
|
|
4531
4528
|
}
|
|
4532
4529
|
isEqual(e) {
|
|
@@ -4535,7 +4532,7 @@ var $e = class {
|
|
|
4535
4532
|
docsContext(e) {
|
|
4536
4533
|
if (!this.csfFiles)
|
|
4537
4534
|
throw new Error("Cannot render docs before preparing");
|
|
4538
|
-
return new
|
|
4535
|
+
return new ee(
|
|
4539
4536
|
this.channel,
|
|
4540
4537
|
this.store,
|
|
4541
4538
|
e,
|
|
@@ -4552,7 +4549,7 @@ var $e = class {
|
|
|
4552
4549
|
);
|
|
4553
4550
|
let i = { ...n, page: this.exports.default }, a = await n.renderer(), { render: l } = a, c = /* @__PURE__ */ s(async () => {
|
|
4554
4551
|
try {
|
|
4555
|
-
await l(o, i, e), this.channel.emit(
|
|
4552
|
+
await l(o, i, e), this.channel.emit(Tn.DOCS_RENDERED, this.id);
|
|
4556
4553
|
} catch (d) {
|
|
4557
4554
|
this.callbacks.showException(d);
|
|
4558
4555
|
}
|
|
@@ -4567,29 +4564,29 @@ var $e = class {
|
|
|
4567
4564
|
};
|
|
4568
4565
|
|
|
4569
4566
|
// src/preview-api/modules/preview-web/PreviewWithSelection.tsx
|
|
4570
|
-
var
|
|
4571
|
-
function
|
|
4567
|
+
var fi = globalThis;
|
|
4568
|
+
function yi(r) {
|
|
4572
4569
|
let e = r.composedPath && r.composedPath()[0] || r.target;
|
|
4573
4570
|
return /input|textarea/i.test(e.tagName) || e.getAttribute("contenteditable") !== null;
|
|
4574
4571
|
}
|
|
4575
|
-
s(
|
|
4576
|
-
var
|
|
4577
|
-
function
|
|
4578
|
-
return r?.includes(
|
|
4572
|
+
s(yi, "focusInInput");
|
|
4573
|
+
var xn = "attached-mdx", mi = "unattached-mdx";
|
|
4574
|
+
function hi({ tags: r }) {
|
|
4575
|
+
return r?.includes(mi) || r?.includes(xn);
|
|
4579
4576
|
}
|
|
4580
|
-
s(
|
|
4581
|
-
function
|
|
4577
|
+
s(hi, "isMdxEntry");
|
|
4578
|
+
function yt(r) {
|
|
4582
4579
|
return r.type === "story";
|
|
4583
4580
|
}
|
|
4584
|
-
s(
|
|
4585
|
-
function
|
|
4581
|
+
s(yt, "isStoryRender");
|
|
4582
|
+
function gi(r) {
|
|
4586
4583
|
return r.type === "docs";
|
|
4587
4584
|
}
|
|
4588
|
-
s(
|
|
4589
|
-
function
|
|
4590
|
-
return
|
|
4585
|
+
s(gi, "isDocsRender");
|
|
4586
|
+
function bi(r) {
|
|
4587
|
+
return gi(r) && r.subtype === "csf";
|
|
4591
4588
|
}
|
|
4592
|
-
s(
|
|
4589
|
+
s(bi, "isCsfDocsRender");
|
|
4593
4590
|
var Se = class extends be {
|
|
4594
4591
|
constructor(t, o, n, i) {
|
|
4595
4592
|
super(t, o, void 0, !1);
|
|
@@ -4603,7 +4600,7 @@ var Se = class extends be {
|
|
|
4603
4600
|
s(this, "PreviewWithSelection");
|
|
4604
4601
|
}
|
|
4605
4602
|
setupListeners() {
|
|
4606
|
-
super.setupListeners(),
|
|
4603
|
+
super.setupListeners(), fi.onkeydown = this.onKeydown.bind(this), this.channel.on(w.SET_CURRENT_STORY, this.onSetCurrentStory.bind(this)),
|
|
4607
4604
|
this.channel.on(w.UPDATE_QUERY_PARAMS, this.onUpdateQueryParams.bind(this)), this.channel.on(w.PRELOAD_ENTRIES, this.onPreloadStories.bind(
|
|
4608
4605
|
this));
|
|
4609
4606
|
}
|
|
@@ -4659,7 +4656,7 @@ var Se = class extends be {
|
|
|
4659
4656
|
selectSpecifiedStory();
|
|
4660
4657
|
}
|
|
4661
4658
|
onKeydown(t) {
|
|
4662
|
-
if (!this.storyRenders.find((o) => o.disableKeyListeners) && !
|
|
4659
|
+
if (!this.storyRenders.find((o) => o.disableKeyListeners) && !yi(t)) {
|
|
4663
4660
|
let { altKey: o, ctrlKey: n, metaKey: i, shiftKey: a, key: l, code: c, keyCode: d } = t;
|
|
4664
4661
|
this.channel.emit(w.PREVIEW_KEYDOWN, {
|
|
4665
4662
|
event: { altKey: o, ctrlKey: n, metaKey: i, shiftKey: a, key: l, code: c, keyCode: d }
|
|
@@ -4700,8 +4697,8 @@ var Se = class extends be {
|
|
|
4700
4697
|
let { storyId: i } = n, a;
|
|
4701
4698
|
try {
|
|
4702
4699
|
a = await this.storyStoreValue.storyIdToEntry(i);
|
|
4703
|
-
} catch (
|
|
4704
|
-
this.currentRender && await this.teardownRender(this.currentRender), this.renderStoryLoadingException(i,
|
|
4700
|
+
} catch (g) {
|
|
4701
|
+
this.currentRender && await this.teardownRender(this.currentRender), this.renderStoryLoadingException(i, g);
|
|
4705
4702
|
return;
|
|
4706
4703
|
}
|
|
4707
4704
|
let l = this.currentSelection?.storyId !== i, c = this.currentRender?.type !== a.type;
|
|
@@ -4715,7 +4712,7 @@ var Se = class extends be {
|
|
|
4715
4712
|
this.mainStoryCallbacks(i),
|
|
4716
4713
|
i,
|
|
4717
4714
|
"story"
|
|
4718
|
-
) :
|
|
4715
|
+
) : hi(a) ? d = new $e(
|
|
4719
4716
|
this.channel,
|
|
4720
4717
|
this.storyStoreValue,
|
|
4721
4718
|
a,
|
|
@@ -4732,54 +4729,54 @@ var Se = class extends be {
|
|
|
4732
4729
|
this.currentRender = d;
|
|
4733
4730
|
try {
|
|
4734
4731
|
await d.prepare();
|
|
4735
|
-
} catch (
|
|
4736
|
-
p && await this.teardownRender(p),
|
|
4732
|
+
} catch (g) {
|
|
4733
|
+
p && await this.teardownRender(p), g !== le && this.renderStoryLoadingException(i, g);
|
|
4737
4734
|
return;
|
|
4738
4735
|
}
|
|
4739
|
-
let
|
|
4740
|
-
if (t &&
|
|
4736
|
+
let h = !l && p && !d.isEqual(p);
|
|
4737
|
+
if (t && yt(d) && (wr(!!d.story), this.storyStoreValue.args.updateFromPersisted(d.story, t)), p && !p.torndown && !l && !h && !c) {
|
|
4741
4738
|
this.currentRender = p, this.channel.emit(w.STORY_UNCHANGED, i), this.view.showMain();
|
|
4742
4739
|
return;
|
|
4743
4740
|
}
|
|
4744
|
-
if (p && await this.teardownRender(p, { viewModeChanged: c }), u && (l || c) && this.channel.emit(w.STORY_CHANGED, i),
|
|
4741
|
+
if (p && await this.teardownRender(p, { viewModeChanged: c }), u && (l || c) && this.channel.emit(w.STORY_CHANGED, i), yt(d)) {
|
|
4745
4742
|
wr(!!d.story);
|
|
4746
4743
|
let {
|
|
4747
|
-
parameters:
|
|
4744
|
+
parameters: g,
|
|
4748
4745
|
initialArgs: E,
|
|
4749
|
-
argTypes:
|
|
4750
|
-
unmappedArgs:
|
|
4751
|
-
initialGlobals:
|
|
4746
|
+
argTypes: R,
|
|
4747
|
+
unmappedArgs: m,
|
|
4748
|
+
initialGlobals: b,
|
|
4752
4749
|
userGlobals: y,
|
|
4753
4750
|
storyGlobals: f,
|
|
4754
|
-
globals:
|
|
4751
|
+
globals: S
|
|
4755
4752
|
} = this.storyStoreValue.getStoryContext(d.story);
|
|
4756
4753
|
this.channel.emit(w.STORY_PREPARED, {
|
|
4757
4754
|
id: i,
|
|
4758
|
-
parameters:
|
|
4755
|
+
parameters: g,
|
|
4759
4756
|
initialArgs: E,
|
|
4760
|
-
argTypes:
|
|
4761
|
-
args:
|
|
4762
|
-
}), this.channel.emit(w.GLOBALS_UPDATED, { userGlobals: y, storyGlobals: f, globals:
|
|
4757
|
+
argTypes: R,
|
|
4758
|
+
args: m
|
|
4759
|
+
}), this.channel.emit(w.GLOBALS_UPDATED, { userGlobals: y, storyGlobals: f, globals: S, initialGlobals: b });
|
|
4763
4760
|
} else {
|
|
4764
|
-
let { parameters:
|
|
4761
|
+
let { parameters: g } = this.storyStoreValue.projectAnnotations, { initialGlobals: E, globals: R } = this.storyStoreValue.userGlobals;
|
|
4765
4762
|
if (this.channel.emit(w.GLOBALS_UPDATED, {
|
|
4766
|
-
globals:
|
|
4763
|
+
globals: R,
|
|
4767
4764
|
initialGlobals: E,
|
|
4768
4765
|
storyGlobals: {},
|
|
4769
|
-
userGlobals:
|
|
4770
|
-
}),
|
|
4766
|
+
userGlobals: R
|
|
4767
|
+
}), bi(d) || d.entry.tags?.includes(xn)) {
|
|
4771
4768
|
if (!d.csfFiles)
|
|
4772
4769
|
throw new $.MdxFileWithNoCsfReferencesError({ storyId: i });
|
|
4773
|
-
({ parameters:
|
|
4770
|
+
({ parameters: g } = this.storyStoreValue.preparedMetaFromCSFFile({
|
|
4774
4771
|
csfFile: d.csfFiles[0]
|
|
4775
4772
|
}));
|
|
4776
4773
|
}
|
|
4777
4774
|
this.channel.emit(w.DOCS_PREPARED, {
|
|
4778
4775
|
id: i,
|
|
4779
|
-
parameters:
|
|
4776
|
+
parameters: g
|
|
4780
4777
|
});
|
|
4781
4778
|
}
|
|
4782
|
-
|
|
4779
|
+
yt(d) ? (wr(!!d.story), this.storyRenders.push(d), this.currentRender.renderToElement(
|
|
4783
4780
|
this.view.prepareForStory(d.story)
|
|
4784
4781
|
)) : this.currentRender.renderToElement(
|
|
4785
4782
|
this.view.prepareForDocs(),
|
|
@@ -4826,15 +4823,15 @@ errored", storyId: t }), this.view.showErrorDisplay(o), Ye.logger.error(`Error r
|
|
|
4826
4823
|
};
|
|
4827
4824
|
|
|
4828
4825
|
// src/preview-api/modules/preview-web/UrlStore.ts
|
|
4829
|
-
var
|
|
4826
|
+
var qn = require("@storybook/global"), Xe = I(Pr(), 1);
|
|
4830
4827
|
|
|
4831
4828
|
// src/preview-api/modules/preview-web/parseArgsParam.ts
|
|
4832
|
-
var
|
|
4833
|
-
var
|
|
4834
|
-
var
|
|
4835
|
-
|
|
4836
|
-
typeof e == "boolean" ? !0 : typeof e == "string" ?
|
|
4837
|
-
r, t)) :
|
|
4829
|
+
var jn = require("storybook/internal/client-logger");
|
|
4830
|
+
var Mn = I(Pr(), 1), _n = I(W(), 1);
|
|
4831
|
+
var kn = /^[a-zA-Z0-9 _-]*$/, Ln = /^-?[0-9]+(\.[0-9]+)?$/, Vi = /^#([a-f0-9]{3,4}|[a-f0-9]{6}|[a-f0-9]{8})$/i, Nn = /^(rgba?|hsla?)\(([0-9]{1,3}),\s?([0-9]{1,3})%?,\s?([0-9]{1,3})%?,?\s?([0-9](\.[0-9]{1,2})?)?\)$/i,
|
|
4832
|
+
xt = /* @__PURE__ */ s((r = "", e) => r === null || r === "" || !kn.test(r) ? !1 : e == null || e instanceof Date || typeof e == "number" ||
|
|
4833
|
+
typeof e == "boolean" ? !0 : typeof e == "string" ? kn.test(e) || Ln.test(e) || Vi.test(e) || Nn.test(e) : Array.isArray(e) ? e.every((t) => xt(
|
|
4834
|
+
r, t)) : _(e) ? Object.entries(e).every(([t, o]) => xt(t, o)) : !1, "validateArgs"), Hi = {
|
|
4838
4835
|
delimiter: ";",
|
|
4839
4836
|
// we're parsing a single query param
|
|
4840
4837
|
nesting: !0,
|
|
@@ -4856,17 +4853,17 @@ r, t)) : L(e) ? Object.entries(e).every(([t, o]) => bt(t, o)) : !1, "validateArg
|
|
|
4856
4853
|
return new Date(r.replaceAll(" ", "+").slice(6, -1));
|
|
4857
4854
|
if (r.startsWith("!hex(") && r.endsWith(")"))
|
|
4858
4855
|
return `#${r.slice(5, -1)}`;
|
|
4859
|
-
let e = r.slice(1).match(
|
|
4856
|
+
let e = r.slice(1).match(Nn);
|
|
4860
4857
|
if (e)
|
|
4861
4858
|
return r.startsWith("!rgba") || r.startsWith("!RGBA") ? `${e[1]}(${e[2]}, ${e[3]}, ${e[4]}, ${e[5]})` : r.startsWith("!hsla") || r.startsWith(
|
|
4862
4859
|
"!HSLA") ? `${e[1]}(${e[2]}, ${e[3]}%, ${e[4]}%, ${e[5]})` : r.startsWith("!rgb") || r.startsWith("!RGB") ? `${e[1]}(${e[2]}, ${e[3]}\
|
|
4863
4860
|
, ${e[4]})` : `${e[1]}(${e[2]}, ${e[3]}%, ${e[4]}%)`;
|
|
4864
4861
|
}
|
|
4865
|
-
return
|
|
4862
|
+
return Ln.test(r) ? Number(r) : r;
|
|
4866
4863
|
}
|
|
4867
|
-
},
|
|
4864
|
+
}, Rt = /* @__PURE__ */ s((r) => {
|
|
4868
4865
|
let e = r.split(";").map((t) => t.replace("=", "~").replace(":", "="));
|
|
4869
|
-
return Object.entries((0,
|
|
4866
|
+
return Object.entries((0, Mn.parse)(e.join(";"), Hi)).reduce((t, [o, n]) => xt(o, n) ? Object.assign(t, { [o]: n }) : (jn.once.warn(_n.dedent`
|
|
4870
4867
|
Omitted potentially unsafe URL args.
|
|
4871
4868
|
|
|
4872
4869
|
More info: https://storybook.js.org/docs/writing-stories/args#setting-args-through-the-url
|
|
@@ -4874,47 +4871,47 @@ r, t)) : L(e) ? Object.entries(e).every(([t, o]) => bt(t, o)) : !1, "validateArg
|
|
|
4874
4871
|
}, "parseArgsParam");
|
|
4875
4872
|
|
|
4876
4873
|
// src/preview-api/modules/preview-web/UrlStore.ts
|
|
4877
|
-
var { history:
|
|
4878
|
-
function
|
|
4874
|
+
var { history: zn, document: ce } = qn.global;
|
|
4875
|
+
function Wi(r) {
|
|
4879
4876
|
let e = (r || "").match(/^\/story\/(.+)/);
|
|
4880
4877
|
if (!e)
|
|
4881
4878
|
throw new Error(`Invalid path '${r}', must start with '/story/'`);
|
|
4882
4879
|
return e[1];
|
|
4883
4880
|
}
|
|
4884
|
-
s(
|
|
4885
|
-
var
|
|
4881
|
+
s(Wi, "pathToId");
|
|
4882
|
+
var Bn = /* @__PURE__ */ s(({
|
|
4886
4883
|
selection: r,
|
|
4887
4884
|
extraParams: e
|
|
4888
4885
|
}) => {
|
|
4889
|
-
let t =
|
|
4886
|
+
let t = ce?.location.search.slice(1), { path: o, selectedKind: n, selectedStory: i, ...a } = (0, Xe.parse)(t);
|
|
4890
4887
|
return `?${(0, Xe.stringify)({
|
|
4891
4888
|
...a,
|
|
4892
4889
|
...e,
|
|
4893
4890
|
...r && { id: r.storyId, viewMode: r.viewMode }
|
|
4894
4891
|
})}`;
|
|
4895
|
-
}, "getQueryString"),
|
|
4892
|
+
}, "getQueryString"), $i = /* @__PURE__ */ s((r) => {
|
|
4896
4893
|
if (!r)
|
|
4897
4894
|
return;
|
|
4898
|
-
let e =
|
|
4899
|
-
|
|
4900
|
-
}, "setPath"),
|
|
4895
|
+
let e = Bn({ selection: r }), { hash: t = "" } = ce.location;
|
|
4896
|
+
ce.title = r.storyId, zn.replaceState({}, "", `${ce.location.pathname}${e}${t}`);
|
|
4897
|
+
}, "setPath"), Yi = /* @__PURE__ */ s((r) => r != null && typeof r == "object" && Array.isArray(r) === !1, "isObject"), Ke = /* @__PURE__ */ s(
|
|
4901
4898
|
(r) => {
|
|
4902
4899
|
if (r !== void 0) {
|
|
4903
4900
|
if (typeof r == "string")
|
|
4904
4901
|
return r;
|
|
4905
4902
|
if (Array.isArray(r))
|
|
4906
4903
|
return Ke(r[0]);
|
|
4907
|
-
if (
|
|
4904
|
+
if (Yi(r))
|
|
4908
4905
|
return Ke(
|
|
4909
4906
|
Object.values(r).filter(Boolean)
|
|
4910
4907
|
);
|
|
4911
4908
|
}
|
|
4912
|
-
}, "getFirstString"),
|
|
4913
|
-
if (typeof
|
|
4914
|
-
let r =
|
|
4915
|
-
string" ?
|
|
4909
|
+
}, "getFirstString"), Ki = /* @__PURE__ */ s(() => {
|
|
4910
|
+
if (typeof ce < "u") {
|
|
4911
|
+
let r = ce.location.search.slice(1), e = (0, Xe.parse)(r), t = typeof e.args == "string" ? Rt(e.args) : void 0, o = typeof e.globals == "\
|
|
4912
|
+
string" ? Rt(e.globals) : void 0, n = Ke(e.viewMode);
|
|
4916
4913
|
(typeof n != "string" || !n.match(/docs|story/)) && (n = "story");
|
|
4917
|
-
let i = Ke(e.path), a = i ?
|
|
4914
|
+
let i = Ke(e.path), a = i ? Wi(i) : Ke(e.id);
|
|
4918
4915
|
if (a)
|
|
4919
4916
|
return { storySpecifier: a, args: t, globals: o, viewMode: n };
|
|
4920
4917
|
}
|
|
@@ -4924,37 +4921,37 @@ string" ? St(e.globals) : void 0, n = Ke(e.viewMode);
|
|
|
4924
4921
|
s(this, "UrlStore");
|
|
4925
4922
|
}
|
|
4926
4923
|
constructor() {
|
|
4927
|
-
this.selectionSpecifier =
|
|
4924
|
+
this.selectionSpecifier = Ki();
|
|
4928
4925
|
}
|
|
4929
4926
|
setSelection(e) {
|
|
4930
|
-
this.selection = e,
|
|
4927
|
+
this.selection = e, $i(this.selection);
|
|
4931
4928
|
}
|
|
4932
4929
|
setQueryParams(e) {
|
|
4933
|
-
let t =
|
|
4934
|
-
|
|
4930
|
+
let t = Bn({ extraParams: e }), { hash: o = "" } = ce.location;
|
|
4931
|
+
zn.replaceState({}, "", `${ce.location.pathname}${t}${o}`);
|
|
4935
4932
|
}
|
|
4936
4933
|
};
|
|
4937
4934
|
|
|
4938
4935
|
// src/preview-api/modules/preview-web/WebView.ts
|
|
4939
|
-
var
|
|
4940
|
-
var { document: M } =
|
|
4941
|
-
EPARING_STORY", i.PREPARING_DOCS = "PREPARING_DOCS", i.ERROR = "ERROR", i))(
|
|
4936
|
+
var Ss = require("storybook/internal/client-logger"), Ts = require("@storybook/global"), xs = I(hs(), 1), Rs = I(Pr(), 1), ws = I(W(), 1);
|
|
4937
|
+
var { document: M } = Ts.global, gs = 100, Es = /* @__PURE__ */ ((i) => (i.MAIN = "MAIN", i.NOPREVIEW = "NOPREVIEW", i.PREPARING_STORY = "PR\
|
|
4938
|
+
EPARING_STORY", i.PREPARING_DOCS = "PREPARING_DOCS", i.ERROR = "ERROR", i))(Es || {}), Ft = {
|
|
4942
4939
|
PREPARING_STORY: "sb-show-preparing-story",
|
|
4943
4940
|
PREPARING_DOCS: "sb-show-preparing-docs",
|
|
4944
4941
|
MAIN: "sb-show-main",
|
|
4945
4942
|
NOPREVIEW: "sb-show-nopreview",
|
|
4946
4943
|
ERROR: "sb-show-errordisplay"
|
|
4947
|
-
},
|
|
4944
|
+
}, It = {
|
|
4948
4945
|
centered: "sb-main-centered",
|
|
4949
4946
|
fullscreen: "sb-main-fullscreen",
|
|
4950
4947
|
padded: "sb-main-padded"
|
|
4951
|
-
},
|
|
4948
|
+
}, bs = new xs.default({
|
|
4952
4949
|
escapeXML: !0
|
|
4953
|
-
}),
|
|
4950
|
+
}), Ee = class {
|
|
4954
4951
|
constructor() {
|
|
4955
4952
|
this.testing = !1;
|
|
4956
4953
|
if (typeof M < "u") {
|
|
4957
|
-
let { __SPECIAL_TEST_PARAMETER__: e } = (0,
|
|
4954
|
+
let { __SPECIAL_TEST_PARAMETER__: e } = (0, Rs.parse)(M.location.search.slice(1));
|
|
4958
4955
|
switch (e) {
|
|
4959
4956
|
case "preparing-story": {
|
|
4960
4957
|
this.showPreparingStory(), this.testing = !0;
|
|
@@ -4992,27 +4989,27 @@ EPARING_STORY", i.PREPARING_DOCS = "PREPARING_DOCS", i.ERROR = "ERROR", i))(xs |
|
|
|
4992
4989
|
return;
|
|
4993
4990
|
}
|
|
4994
4991
|
this.checkIfLayoutExists(e);
|
|
4995
|
-
let t =
|
|
4992
|
+
let t = It[e];
|
|
4996
4993
|
M.body.classList.remove(this.currentLayoutClass), M.body.classList.add(t), this.currentLayoutClass = t;
|
|
4997
4994
|
}
|
|
4998
4995
|
checkIfLayoutExists(e) {
|
|
4999
|
-
|
|
5000
|
-
|
|
4996
|
+
It[e] || Ss.logger.warn(
|
|
4997
|
+
ws.dedent`
|
|
5001
4998
|
The desired layout: ${e} is not a valid option.
|
|
5002
|
-
The possible options are: ${Object.keys(
|
|
4999
|
+
The possible options are: ${Object.keys(It).join(", ")}, none.
|
|
5003
5000
|
`
|
|
5004
5001
|
);
|
|
5005
5002
|
}
|
|
5006
5003
|
showMode(e) {
|
|
5007
|
-
clearTimeout(this.preparingTimeout), Object.keys(
|
|
5008
|
-
t === e ? M.body.classList.add(
|
|
5004
|
+
clearTimeout(this.preparingTimeout), Object.keys(Es).forEach((t) => {
|
|
5005
|
+
t === e ? M.body.classList.add(Ft[t]) : M.body.classList.remove(Ft[t]);
|
|
5009
5006
|
});
|
|
5010
5007
|
}
|
|
5011
5008
|
showErrorDisplay({ message: e = "", stack: t = "" }) {
|
|
5012
5009
|
let o = e, n = t, i = e.split(`
|
|
5013
5010
|
`);
|
|
5014
5011
|
i.length > 1 && ([o] = i, n = i.slice(1).join(`
|
|
5015
|
-
`).replace(/^\n/, "")), M.getElementById("error-message").innerHTML =
|
|
5012
|
+
`).replace(/^\n/, "")), M.getElementById("error-message").innerHTML = bs.toHtml(o), M.getElementById("error-stack").innerHTML = bs.toHtml(n),
|
|
5016
5013
|
this.showMode("ERROR");
|
|
5017
5014
|
}
|
|
5018
5015
|
showNoPreview() {
|
|
@@ -5022,12 +5019,12 @@ true"));
|
|
|
5022
5019
|
showPreparingStory({ immediate: e = !1 } = {}) {
|
|
5023
5020
|
clearTimeout(this.preparingTimeout), e ? this.showMode("PREPARING_STORY") : this.preparingTimeout = setTimeout(
|
|
5024
5021
|
() => this.showMode("PREPARING_STORY"),
|
|
5025
|
-
|
|
5022
|
+
gs
|
|
5026
5023
|
);
|
|
5027
5024
|
}
|
|
5028
5025
|
showPreparingDocs({ immediate: e = !1 } = {}) {
|
|
5029
5026
|
clearTimeout(this.preparingTimeout), e ? this.showMode("PREPARING_DOCS") : this.preparingTimeout = setTimeout(() => this.showMode("PREPA\
|
|
5030
|
-
RING_DOCS"),
|
|
5027
|
+
RING_DOCS"), gs);
|
|
5031
5028
|
}
|
|
5032
5029
|
showMain() {
|
|
5033
5030
|
this.showMode("MAIN");
|
|
@@ -5039,17 +5036,17 @@ RING_DOCS"), ys);
|
|
|
5039
5036
|
this.docsRoot().setAttribute("hidden", "true"), this.storyRoot().removeAttribute("hidden");
|
|
5040
5037
|
}
|
|
5041
5038
|
showStoryDuringRender() {
|
|
5042
|
-
M.body.classList.add(
|
|
5039
|
+
M.body.classList.add(Ft.MAIN);
|
|
5043
5040
|
}
|
|
5044
5041
|
};
|
|
5045
5042
|
|
|
5046
5043
|
// src/preview-api/modules/preview-web/PreviewWeb.tsx
|
|
5047
5044
|
var Qe = class extends Se {
|
|
5048
5045
|
constructor(t, o) {
|
|
5049
|
-
super(t, o, new Re(), new
|
|
5046
|
+
super(t, o, new Re(), new Ee());
|
|
5050
5047
|
this.importFn = t;
|
|
5051
5048
|
this.getProjectAnnotations = o;
|
|
5052
|
-
|
|
5049
|
+
As.global.__STORYBOOK_PREVIEW__ = this;
|
|
5053
5050
|
}
|
|
5054
5051
|
static {
|
|
5055
5052
|
s(this, "PreviewWeb");
|
|
@@ -5057,8 +5054,8 @@ var Qe = class extends Se {
|
|
|
5057
5054
|
};
|
|
5058
5055
|
|
|
5059
5056
|
// src/preview-api/modules/preview-web/simulate-pageload.ts
|
|
5060
|
-
var
|
|
5061
|
-
var { document:
|
|
5057
|
+
var vs = require("@storybook/global");
|
|
5058
|
+
var { document: Ae } = vs.global, Ia = [
|
|
5062
5059
|
"application/javascript",
|
|
5063
5060
|
"application/ecmascript",
|
|
5064
5061
|
"application/x-ecmascript",
|
|
@@ -5077,35 +5074,50 @@ var { document: Ee } = As.global, Ea = [
|
|
|
5077
5074
|
"text/x-javascript",
|
|
5078
5075
|
// Support modern javascript
|
|
5079
5076
|
"module"
|
|
5080
|
-
],
|
|
5077
|
+
], Oa = "script", Cs = "scripts-root";
|
|
5081
5078
|
function Ze() {
|
|
5082
|
-
let r =
|
|
5083
|
-
r.initEvent("DOMContentLoaded", !0, !0),
|
|
5079
|
+
let r = Ae.createEvent("Event");
|
|
5080
|
+
r.initEvent("DOMContentLoaded", !0, !0), Ae.dispatchEvent(r);
|
|
5084
5081
|
}
|
|
5085
5082
|
s(Ze, "simulateDOMContentLoaded");
|
|
5086
|
-
function
|
|
5087
|
-
let o =
|
|
5083
|
+
function Da(r, e, t) {
|
|
5084
|
+
let o = Ae.createElement("script");
|
|
5088
5085
|
o.type = r.type === "module" ? "module" : "text/javascript", r.src ? (o.onload = e, o.onerror = e, o.src = r.src) : o.textContent = r.innerText,
|
|
5089
|
-
t ? t.appendChild(o) :
|
|
5086
|
+
t ? t.appendChild(o) : Ae.head.appendChild(o), r.parentNode.removeChild(r), r.src || e();
|
|
5090
5087
|
}
|
|
5091
|
-
s(
|
|
5092
|
-
function
|
|
5088
|
+
s(Da, "insertScript");
|
|
5089
|
+
function Ps(r, e, t = 0) {
|
|
5093
5090
|
r[t](() => {
|
|
5094
|
-
t++, t === r.length ? e() :
|
|
5091
|
+
t++, t === r.length ? e() : Ps(r, e, t);
|
|
5095
5092
|
});
|
|
5096
5093
|
}
|
|
5097
|
-
s(
|
|
5098
|
-
function
|
|
5099
|
-
let e =
|
|
5100
|
-
e ? e.innerHTML = "" : (e =
|
|
5101
|
-
let t = Array.from(r.querySelectorAll(
|
|
5094
|
+
s(Ps, "insertScriptsSequentially");
|
|
5095
|
+
function Ot(r) {
|
|
5096
|
+
let e = Ae.getElementById(Cs);
|
|
5097
|
+
e ? e.innerHTML = "" : (e = Ae.createElement("div"), e.id = Cs, Ae.body.appendChild(e));
|
|
5098
|
+
let t = Array.from(r.querySelectorAll(Oa));
|
|
5102
5099
|
if (t.length) {
|
|
5103
5100
|
let o = [];
|
|
5104
5101
|
t.forEach((n) => {
|
|
5105
5102
|
let i = n.getAttribute("type");
|
|
5106
|
-
(!i ||
|
|
5107
|
-
}), o.length &&
|
|
5103
|
+
(!i || Ia.includes(i)) && o.push((a) => Da(n, a, e));
|
|
5104
|
+
}), o.length && Ps(o, Ze, void 0);
|
|
5108
5105
|
} else
|
|
5109
5106
|
Ze();
|
|
5110
5107
|
}
|
|
5111
|
-
s(
|
|
5108
|
+
s(Ot, "simulatePageLoad");
|
|
5109
|
+
|
|
5110
|
+
// src/docs-tools/shared.ts
|
|
5111
|
+
var Fs = "storybook/docs", eu = `${Fs}/panel`;
|
|
5112
|
+
var Is = `${Fs}/snippet-rendered`;
|
|
5113
|
+
|
|
5114
|
+
// src/preview-api/modules/preview-web/emitTransformCode.ts
|
|
5115
|
+
async function Dt(r, e) {
|
|
5116
|
+
let t = e.parameters?.docs?.source?.transform, { id: o, unmappedArgs: n } = e, i = t && r ? t?.(r, e) : r, a = i ? await i : void 0;
|
|
5117
|
+
q.getChannel().emit(Is, {
|
|
5118
|
+
id: o,
|
|
5119
|
+
source: a,
|
|
5120
|
+
args: n
|
|
5121
|
+
});
|
|
5122
|
+
}
|
|
5123
|
+
s(Dt, "emitTransformCode");
|