storybook 9.1.0-alpha.2 → 9.1.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/index.cjs +16 -16
- package/dist/actions/index.d.ts +1 -38
- package/dist/actions/index.js +12 -12
- package/dist/actions/preview.cjs +25 -25
- package/dist/actions/preview.d.ts +37 -547
- package/dist/actions/preview.js +18 -18
- package/dist/backgrounds/index.cjs +12 -144
- package/dist/backgrounds/index.d.ts +1 -591
- package/dist/backgrounds/index.js +0 -130
- package/dist/backgrounds/preview.cjs +63 -63
- package/dist/backgrounds/preview.d.ts +40 -542
- package/dist/backgrounds/preview.js +47 -47
- package/dist/bin/index.cjs +50 -50
- package/dist/bin/index.js +50 -50
- package/dist/builder-manager/index.cjs +379 -378
- package/dist/builder-manager/index.d.ts +567 -2
- package/dist/builder-manager/index.js +280 -279
- package/dist/cli/bin/index.cjs +1 -1
- package/dist/cli/bin/index.js +1 -1
- package/dist/common/index.cjs +87 -79
- package/dist/common/index.d.ts +2 -2
- package/dist/common/index.js +725 -716
- package/dist/component-testing/preview.cjs +12 -12
- package/dist/component-testing/preview.d.ts +2 -2
- package/dist/component-testing/preview.js +7 -7
- package/dist/components/index.cjs +1899 -1895
- package/dist/components/index.js +1343 -1339
- package/dist/controls/index.cjs +16 -16
- package/dist/controls/index.d.ts +1 -36
- package/dist/controls/preview.cjs +17 -17
- package/dist/controls/preview.d.ts +34 -546
- package/dist/controls/preview.js +3 -3
- package/dist/csf/index.cjs +1210 -95
- package/dist/csf/index.d.ts +59 -18
- package/dist/csf/index.js +1214 -90
- package/dist/csf-tools/index.cjs +2 -1
- package/dist/csf-tools/index.js +2 -2
- package/dist/highlight/index.cjs +15 -15
- package/dist/highlight/index.d.ts +1 -12
- package/dist/highlight/index.js +4 -4
- package/dist/highlight/preview.cjs +63 -63
- package/dist/highlight/preview.d.ts +11 -546
- package/dist/highlight/preview.js +11 -10
- package/dist/manager/globals-runtime.js +31934 -31888
- package/dist/manager-api/index.cjs +1 -1
- package/dist/manager-api/index.js +1 -1
- package/dist/measure/index.cjs +12 -472
- package/dist/measure/index.d.ts +1 -566
- package/dist/measure/index.js +0 -464
- package/dist/measure/preview.cjs +127 -127
- package/dist/measure/preview.d.ts +11 -546
- package/dist/measure/preview.js +117 -117
- package/dist/outline/index.cjs +12 -524
- package/dist/outline/index.d.ts +1 -566
- package/dist/outline/index.js +0 -500
- package/dist/outline/preview.cjs +32 -32
- package/dist/outline/preview.d.ts +11 -546
- package/dist/outline/preview.js +27 -27
- package/dist/preview/runtime.js +9415 -9379
- package/dist/preview-api/index.cjs +1228 -1261
- package/dist/preview-api/index.d.ts +6 -8
- package/dist/preview-api/index.js +927 -963
- package/dist/telemetry/index.cjs +1477 -1288
- package/dist/telemetry/index.js +1503 -1314
- package/dist/test/index.cjs +4437 -4394
- package/dist/test/index.js +3776 -3733
- package/dist/test/preview.cjs +42 -42
- package/dist/test/preview.d.ts +12 -550
- package/dist/test/preview.js +36 -36
- package/dist/types/index.d.ts +5 -3
- package/dist/viewport/index.cjs +17 -24
- package/dist/viewport/index.d.ts +9 -532
- package/dist/viewport/index.js +9 -16
- package/dist/viewport/preview.cjs +22 -22
- package/dist/viewport/preview.d.ts +45 -552
- package/dist/viewport/preview.js +8 -8
- package/package.json +1 -1
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
2
|
+
var Os = Object.create;
|
|
3
|
+
var _e = Object.defineProperty;
|
|
4
|
+
var Ds = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var ks = Object.getOwnPropertyNames;
|
|
6
|
+
var Ms = Object.getPrototypeOf, js = Object.prototype.hasOwnProperty;
|
|
7
|
+
var s = (r, e) => _e(r, "name", { value: e, configurable: !0 });
|
|
8
|
+
var I = (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
|
+
}, It = (r, e, t, o) => {
|
|
12
12
|
if (e && typeof e == "object" || typeof e == "function")
|
|
13
|
-
for (let
|
|
14
|
-
!
|
|
13
|
+
for (let n of ks(e))
|
|
14
|
+
!js.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 _ = (r, e, t) => (t = r != null ? Os(Ms(r)) : {}, It(
|
|
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
|
+
)), Ns = (r) => It(_e({}, "__esModule", { value: !0 }), r);
|
|
25
25
|
|
|
26
26
|
// ../node_modules/map-or-similar/src/similar.js
|
|
27
|
-
var
|
|
27
|
+
var To = I((wl, So) => {
|
|
28
28
|
function oe() {
|
|
29
29
|
return this.list = [], this.lastItem = void 0, this.size = 0, this;
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
s(oe, "Similar");
|
|
32
32
|
oe.prototype.get = function(r) {
|
|
33
33
|
var e;
|
|
34
34
|
if (this.lastItem && this.isEqual(this.lastItem.key, r))
|
|
@@ -65,14 +65,14 @@ var Io = O((kl, Fo) => {
|
|
|
65
65
|
oe.prototype.isEqual = function(r, e) {
|
|
66
66
|
return r === e || r !== r && e !== e;
|
|
67
67
|
};
|
|
68
|
-
|
|
68
|
+
So.exports = oe;
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
// ../node_modules/map-or-similar/src/map-or-similar.js
|
|
72
|
-
var
|
|
73
|
-
|
|
72
|
+
var Ro = I((El, xo) => {
|
|
73
|
+
xo.exports = function(r) {
|
|
74
74
|
if (typeof Map != "function" || r) {
|
|
75
|
-
var e =
|
|
75
|
+
var e = To();
|
|
76
76
|
return new e();
|
|
77
77
|
} else
|
|
78
78
|
return /* @__PURE__ */ new Map();
|
|
@@ -80,14 +80,14 @@ var Do = O((Ml, Oo) => {
|
|
|
80
80
|
});
|
|
81
81
|
|
|
82
82
|
// ../node_modules/memoizerific/src/memoizerific.js
|
|
83
|
-
var
|
|
84
|
-
var
|
|
85
|
-
|
|
86
|
-
var e = new
|
|
83
|
+
var Jr = I((Cl, Ao) => {
|
|
84
|
+
var wo = Ro();
|
|
85
|
+
Ao.exports = function(r) {
|
|
86
|
+
var e = new wo(process.env.FORCE_SIMILAR_INSTEAD_OF_MAP === "true"), t = [];
|
|
87
87
|
return function(o) {
|
|
88
|
-
var
|
|
88
|
+
var n = /* @__PURE__ */ s(function() {
|
|
89
89
|
var i = e, a, l, c = arguments.length - 1, d = Array(c + 1), u = !0, p;
|
|
90
|
-
if ((
|
|
90
|
+
if ((n.numArgs || n.numArgs === 0) && n.numArgs !== c + 1)
|
|
91
91
|
throw new Error("Memoizerific functions should always be called with the same number of arguments");
|
|
92
92
|
for (p = 0; p < c; p++) {
|
|
93
93
|
if (d[p] = {
|
|
@@ -97,63 +97,63 @@ var Qr = O((_l, jo) => {
|
|
|
97
97
|
i = i.get(arguments[p]);
|
|
98
98
|
continue;
|
|
99
99
|
}
|
|
100
|
-
u = !1, a = new
|
|
100
|
+
u = !1, a = new wo(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 && Hs(t.shift())), n.wasMemoized = u, n.numArgs = c + 1, l;
|
|
107
107
|
}, "memoizerific");
|
|
108
|
-
return
|
|
108
|
+
return n.limit = r, n.wasMemoized = !1, n.cache = e, n.lru = t, n;
|
|
109
109
|
};
|
|
110
110
|
};
|
|
111
|
-
function
|
|
112
|
-
var t = r.length, o = e.length,
|
|
111
|
+
function Us(r, e) {
|
|
112
|
+
var t = r.length, o = e.length, n, i, a;
|
|
113
113
|
for (i = 0; i < t; i++) {
|
|
114
|
-
for (
|
|
115
|
-
if (!
|
|
116
|
-
|
|
114
|
+
for (n = !0, a = 0; a < o; a++)
|
|
115
|
+
if (!Vs(r[i][a].arg, e[a].arg)) {
|
|
116
|
+
n = !1;
|
|
117
117
|
break;
|
|
118
118
|
}
|
|
119
|
-
if (
|
|
119
|
+
if (n)
|
|
120
120
|
break;
|
|
121
121
|
}
|
|
122
122
|
r.push(r.splice(i, 1)[0]);
|
|
123
123
|
}
|
|
124
|
-
|
|
125
|
-
function
|
|
126
|
-
var e = r.length, t = r[e - 1], o,
|
|
127
|
-
for (t.cacheItem.delete(t.arg),
|
|
124
|
+
s(Us, "moveToMostRecentLru");
|
|
125
|
+
function Hs(r) {
|
|
126
|
+
var e = r.length, t = r[e - 1], o, n;
|
|
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
|
-
|
|
131
|
-
function
|
|
130
|
+
s(Hs, "removeCachedResult");
|
|
131
|
+
function Vs(r, e) {
|
|
132
132
|
return r === e || r !== r && e !== e;
|
|
133
133
|
}
|
|
134
|
-
|
|
134
|
+
s(Vs, "isEqual");
|
|
135
135
|
});
|
|
136
136
|
|
|
137
137
|
// ../node_modules/ts-dedent/dist/index.js
|
|
138
|
-
var $ =
|
|
138
|
+
var $ = I((ze) => {
|
|
139
139
|
"use strict";
|
|
140
|
-
Object.defineProperty(
|
|
141
|
-
|
|
142
|
-
function
|
|
140
|
+
Object.defineProperty(ze, "__esModule", { value: !0 });
|
|
141
|
+
ze.dedent = void 0;
|
|
142
|
+
function Eo(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);
|
|
146
146
|
o[o.length - 1] = o[o.length - 1].replace(/\r?\n([\t ]*)$/, "");
|
|
147
|
-
var
|
|
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
150
|
var p, m;
|
|
151
151
|
return (m = (p = u.match(/[\t ]/g)) === null || p === void 0 ? void 0 : p.length) !== null && m !== void 0 ? m : 0;
|
|
152
152
|
})) : l;
|
|
153
153
|
}, []);
|
|
154
|
-
if (
|
|
154
|
+
if (n.length) {
|
|
155
155
|
var i = new RegExp(`
|
|
156
|
-
[ ]{` + Math.min.apply(Math,
|
|
156
|
+
[ ]{` + Math.min.apply(Math, n) + "}", "g");
|
|
157
157
|
o = o.map(function(l) {
|
|
158
158
|
return l.replace(i, `
|
|
159
159
|
`);
|
|
@@ -171,17 +171,17 @@ var $ = O((Ge) => {
|
|
|
171
171
|
`)), a += p + o[c + 1];
|
|
172
172
|
}), a;
|
|
173
173
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
s(Eo, "dedent");
|
|
175
|
+
ze.dedent = Eo;
|
|
176
|
+
ze.default = Eo;
|
|
177
177
|
});
|
|
178
178
|
|
|
179
179
|
// ../node_modules/picoquery/lib/string-util.js
|
|
180
|
-
var
|
|
180
|
+
var ut = I((pt) => {
|
|
181
181
|
"use strict";
|
|
182
|
-
Object.defineProperty(
|
|
183
|
-
|
|
184
|
-
var K = Array.from({ length: 256 }, (r, e) => "%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase()),
|
|
182
|
+
Object.defineProperty(pt, "__esModule", { value: !0 });
|
|
183
|
+
pt.encodeString = xi;
|
|
184
|
+
var K = Array.from({ length: 256 }, (r, e) => "%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase()), Ti = new Int8Array([
|
|
185
185
|
0,
|
|
186
186
|
0,
|
|
187
187
|
0,
|
|
@@ -311,115 +311,115 @@ var xt = O((Tt) => {
|
|
|
311
311
|
1,
|
|
312
312
|
0
|
|
313
313
|
]);
|
|
314
|
-
function
|
|
314
|
+
function xi(r) {
|
|
315
315
|
let e = r.length;
|
|
316
316
|
if (e === 0)
|
|
317
317
|
return "";
|
|
318
|
-
let t = "", o = 0,
|
|
319
|
-
e: for (;
|
|
320
|
-
let i = r.charCodeAt(
|
|
318
|
+
let t = "", o = 0, n = 0;
|
|
319
|
+
e: for (; n < e; n++) {
|
|
320
|
+
let i = r.charCodeAt(n);
|
|
321
321
|
for (; i < 128; ) {
|
|
322
|
-
if (
|
|
322
|
+
if (Ti[i] !== 1 && (o < n && (t += r.slice(o, n)), o = n + 1, t += K[i]), ++n === e)
|
|
323
323
|
break e;
|
|
324
|
-
i = r.charCodeAt(
|
|
324
|
+
i = r.charCodeAt(n);
|
|
325
325
|
}
|
|
326
|
-
if (o <
|
|
327
|
-
o =
|
|
326
|
+
if (o < n && (t += r.slice(o, n)), i < 2048) {
|
|
327
|
+
o = n + 1, t += K[192 | i >> 6] + K[128 | i & 63];
|
|
328
328
|
continue;
|
|
329
329
|
}
|
|
330
330
|
if (i < 55296 || i >= 57344) {
|
|
331
|
-
o =
|
|
331
|
+
o = n + 1, t += K[224 | i >> 12] + K[128 | i >> 6 & 63] + K[128 | i & 63];
|
|
332
332
|
continue;
|
|
333
333
|
}
|
|
334
|
-
if (++
|
|
334
|
+
if (++n, n >= e)
|
|
335
335
|
throw new Error("URI malformed");
|
|
336
|
-
let a = r.charCodeAt(
|
|
337
|
-
o =
|
|
336
|
+
let a = r.charCodeAt(n) & 1023;
|
|
337
|
+
o = n + 1, i = 65536 + ((i & 1023) << 10 | a), t += K[240 | i >> 18] + K[128 | i >> 12 & 63] + K[128 | i >> 6 & 63] + K[128 | i & 63];
|
|
338
338
|
}
|
|
339
339
|
return o === 0 ? r : o < e ? t + r.slice(o) : t;
|
|
340
340
|
}
|
|
341
|
-
|
|
341
|
+
s(xi, "encodeString");
|
|
342
342
|
});
|
|
343
343
|
|
|
344
344
|
// ../node_modules/picoquery/lib/shared.js
|
|
345
|
-
var
|
|
345
|
+
var Pr = I((X) => {
|
|
346
346
|
"use strict";
|
|
347
347
|
Object.defineProperty(X, "__esModule", { value: !0 });
|
|
348
348
|
X.defaultOptions = X.defaultShouldSerializeObject = X.defaultValueSerializer = void 0;
|
|
349
|
-
var
|
|
349
|
+
var ft = ut(), Ri = /* @__PURE__ */ s((r) => {
|
|
350
350
|
switch (typeof r) {
|
|
351
351
|
case "string":
|
|
352
|
-
return (0,
|
|
352
|
+
return (0, ft.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, ft.encodeString)("" + r);
|
|
359
359
|
break;
|
|
360
360
|
}
|
|
361
|
-
return r instanceof Date ? (0,
|
|
361
|
+
return r instanceof Date ? (0, ft.encodeString)(r.toISOString()) : "";
|
|
362
362
|
}, "defaultValueSerializer");
|
|
363
|
-
X.defaultValueSerializer =
|
|
364
|
-
var
|
|
365
|
-
X.defaultShouldSerializeObject =
|
|
366
|
-
var
|
|
363
|
+
X.defaultValueSerializer = Ri;
|
|
364
|
+
var wi = /* @__PURE__ */ s((r) => r instanceof Date, "defaultShouldSerializeObject");
|
|
365
|
+
X.defaultShouldSerializeObject = wi;
|
|
366
|
+
var Rn = /* @__PURE__ */ s((r) => r, "identityFunc");
|
|
367
367
|
X.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: X.defaultValueSerializer,
|
|
375
|
-
keyDeserializer:
|
|
375
|
+
keyDeserializer: Rn,
|
|
376
376
|
shouldSerializeObject: X.defaultShouldSerializeObject
|
|
377
377
|
};
|
|
378
378
|
});
|
|
379
379
|
|
|
380
380
|
// ../node_modules/picoquery/lib/object-util.js
|
|
381
|
-
var
|
|
381
|
+
var yt = I((Fr) => {
|
|
382
382
|
"use strict";
|
|
383
|
-
Object.defineProperty(
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
var xe =
|
|
387
|
-
function
|
|
383
|
+
Object.defineProperty(Fr, "__esModule", { value: !0 });
|
|
384
|
+
Fr.getDeepObject = Ci;
|
|
385
|
+
Fr.stringifyObject = wn;
|
|
386
|
+
var xe = Pr(), Ai = ut();
|
|
387
|
+
function Ei(r) {
|
|
388
388
|
return r === "__proto__" || r === "constructor" || r === "prototype";
|
|
389
389
|
}
|
|
390
|
-
|
|
391
|
-
function
|
|
392
|
-
if (
|
|
390
|
+
s(Ei, "isPrototypeKey");
|
|
391
|
+
function Ci(r, e, t, o, n) {
|
|
392
|
+
if (Ei(e))
|
|
393
393
|
return r;
|
|
394
394
|
let i = r[e];
|
|
395
|
-
return typeof i == "object" && i !== null ? i : !o && (
|
|
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
|
-
|
|
399
|
-
var
|
|
400
|
-
function
|
|
398
|
+
s(Ci, "getDeepObject");
|
|
399
|
+
var vi = 20, Pi = "[]", Fi = "[", Ii = "]", Oi = ".";
|
|
400
|
+
function wn(r, e, t = 0, o, n) {
|
|
401
401
|
let { nestingSyntax: i = xe.defaultOptions.nestingSyntax, arrayRepeat: a = xe.defaultOptions.arrayRepeat, arrayRepeatSyntax: l = xe.defaultOptions.
|
|
402
402
|
arrayRepeatSyntax, nesting: c = xe.defaultOptions.nesting, delimiter: d = xe.defaultOptions.delimiter, valueSerializer: u = xe.defaultOptions.
|
|
403
403
|
valueSerializer, shouldSerializeObject: p = xe.defaultOptions.shouldSerializeObject } = e, m = typeof d == "number" ? String.fromCharCode(
|
|
404
|
-
d) : d, h =
|
|
405
|
-
if (t >
|
|
404
|
+
d) : d, h = n === !0 && a, x = i === "dot" || i === "js" && !n;
|
|
405
|
+
if (t > vi)
|
|
406
406
|
return "";
|
|
407
407
|
let R = "", y = !0, b = !1;
|
|
408
408
|
for (let w in r) {
|
|
409
409
|
let f = r[w], g;
|
|
410
|
-
o ? (g = o, h ? l === "bracket" && (g +=
|
|
411
|
-
"object" && f !== null && !p(f) ? (b = f.pop !== void 0, (c || a && b) && (R +=
|
|
410
|
+
o ? (g = o, h ? l === "bracket" && (g += Pi) : x ? (g += Oi, g += w) : (g += Fi, g += w, g += Ii)) : g = w, y || (R += m), typeof f ==
|
|
411
|
+
"object" && f !== null && !p(f) ? (b = f.pop !== void 0, (c || a && b) && (R += wn(f, e, t + 1, g, b))) : (R += (0, Ai.encodeString)(g),
|
|
412
412
|
R += "=", R += u(f, w)), y && (y = !1);
|
|
413
413
|
}
|
|
414
414
|
return R;
|
|
415
415
|
}
|
|
416
|
-
|
|
416
|
+
s(wn, "stringifyObject");
|
|
417
417
|
});
|
|
418
418
|
|
|
419
419
|
// ../node_modules/fast-decode-uri-component/index.js
|
|
420
|
-
var
|
|
420
|
+
var vn = I((Ep, Cn) => {
|
|
421
421
|
"use strict";
|
|
422
|
-
var
|
|
422
|
+
var An = 12, Di = 0, mt = [
|
|
423
423
|
// The first part of the table maps bytes to character to a transition.
|
|
424
424
|
0,
|
|
425
425
|
0,
|
|
@@ -802,27 +802,27 @@ var Mn = O((qp, jn) => {
|
|
|
802
802
|
7,
|
|
803
803
|
7
|
|
804
804
|
];
|
|
805
|
-
function
|
|
805
|
+
function ki(r) {
|
|
806
806
|
var e = r.indexOf("%");
|
|
807
807
|
if (e === -1) return r;
|
|
808
|
-
for (var t = r.length, o = "",
|
|
809
|
-
var c =
|
|
810
|
-
if (l =
|
|
811
|
-
o += r.slice(
|
|
808
|
+
for (var t = r.length, o = "", n = 0, i = 0, a = e, l = An; e > -1 && e < t; ) {
|
|
809
|
+
var c = En(r[e + 1], 4), d = En(r[e + 2], 0), u = c | d, p = mt[u];
|
|
810
|
+
if (l = mt[256 + l + p], i = i << 6 | u & mt[364 + p], l === An)
|
|
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
|
-
), i = 0,
|
|
814
|
+
), i = 0, n = e + 3, e = a = r.indexOf("%", n);
|
|
815
815
|
else {
|
|
816
|
-
if (l ===
|
|
816
|
+
if (l === Di)
|
|
817
817
|
return null;
|
|
818
818
|
if (e += 3, e < t && r.charCodeAt(e) === 37) continue;
|
|
819
819
|
return null;
|
|
820
820
|
}
|
|
821
821
|
}
|
|
822
|
-
return o + r.slice(
|
|
822
|
+
return o + r.slice(n);
|
|
823
823
|
}
|
|
824
|
-
|
|
825
|
-
var
|
|
824
|
+
s(ki, "decodeURIComponent");
|
|
825
|
+
var Mi = {
|
|
826
826
|
0: 0,
|
|
827
827
|
1: 1,
|
|
828
828
|
2: 2,
|
|
@@ -846,121 +846,121 @@ var Mn = O((qp, jn) => {
|
|
|
846
846
|
f: 15,
|
|
847
847
|
F: 15
|
|
848
848
|
};
|
|
849
|
-
function
|
|
850
|
-
var t =
|
|
849
|
+
function En(r, e) {
|
|
850
|
+
var t = Mi[r];
|
|
851
851
|
return t === void 0 ? 255 : t << e;
|
|
852
852
|
}
|
|
853
|
-
|
|
854
|
-
|
|
853
|
+
s(En, "hexCodeToInt");
|
|
854
|
+
Cn.exports = ki;
|
|
855
855
|
});
|
|
856
856
|
|
|
857
857
|
// ../node_modules/picoquery/lib/parse.js
|
|
858
|
-
var
|
|
858
|
+
var On = I((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
863
|
Object.defineProperty(re, "__esModule", { value: !0 });
|
|
864
864
|
re.numberValueDeserializer = re.numberKeyDeserializer = void 0;
|
|
865
|
-
re.parse =
|
|
866
|
-
var
|
|
865
|
+
re.parse = Li;
|
|
866
|
+
var Ir = yt(), Re = Pr(), Pn = ji(vn()), _i = /* @__PURE__ */ s((r) => {
|
|
867
867
|
let e = Number(r);
|
|
868
868
|
return Number.isNaN(e) ? r : e;
|
|
869
869
|
}, "numberKeyDeserializer");
|
|
870
|
-
re.numberKeyDeserializer =
|
|
871
|
-
var
|
|
870
|
+
re.numberKeyDeserializer = _i;
|
|
871
|
+
var Ni = /* @__PURE__ */ s((r) => {
|
|
872
872
|
let e = Number(r);
|
|
873
873
|
return Number.isNaN(e) ? r : e;
|
|
874
874
|
}, "numberValueDeserializer");
|
|
875
|
-
re.numberValueDeserializer =
|
|
876
|
-
var
|
|
875
|
+
re.numberValueDeserializer = Ni;
|
|
876
|
+
var Fn = /\+/g, In = /* @__PURE__ */ s(function() {
|
|
877
877
|
}, "Empty");
|
|
878
|
-
|
|
879
|
-
function
|
|
878
|
+
In.prototype = /* @__PURE__ */ Object.create(null);
|
|
879
|
+
function Or(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
|
-
|
|
884
|
-
function
|
|
885
|
-
let { valueDeserializer: t = Re.defaultOptions.valueDeserializer, keyDeserializer: o = Re.defaultOptions.keyDeserializer, arrayRepeatSyntax:
|
|
883
|
+
s(Or, "computeKeySlice");
|
|
884
|
+
function Li(r, e) {
|
|
885
|
+
let { valueDeserializer: t = Re.defaultOptions.valueDeserializer, keyDeserializer: o = Re.defaultOptions.keyDeserializer, arrayRepeatSyntax: n = Re.
|
|
886
886
|
defaultOptions.arrayRepeatSyntax, nesting: i = Re.defaultOptions.nesting, arrayRepeat: a = Re.defaultOptions.arrayRepeat, nestingSyntax: l = Re.
|
|
887
887
|
defaultOptions.nestingSyntax, delimiter: c = Re.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 m = r.length, h = "", x = -1, R = -1, y = -1, b = p, w, f = "", g = "", A = !1, S = !1, C = !1, M = !1,
|
|
892
|
-
P = -1, W = -1,
|
|
893
|
-
for (let
|
|
894
|
-
if (U =
|
|
895
|
-
if (ve = R > x, ve || (R =
|
|
896
|
-
b, w, f, u &&
|
|
897
|
-
ve && (h = r.slice(R + 1,
|
|
898
|
-
let
|
|
891
|
+
let m = r.length, h = "", x = -1, R = -1, y = -1, b = p, w, f = "", g = "", A = !1, S = !1, C = !1, M = !1, j = !1, G = !1, ve = !1, U = 0,
|
|
892
|
+
P = -1, W = -1, Ft = -1;
|
|
893
|
+
for (let O = 0; O < m + 1; O++) {
|
|
894
|
+
if (U = O !== m ? r.charCodeAt(O) : d, U === d) {
|
|
895
|
+
if (ve = R > x, ve || (R = O), y !== R - 1 && (g = Or(r, y + 1, P > -1 ? P : R, C, A), f = o(g), w !== void 0 && (b = (0, Ir.getDeepObject)(
|
|
896
|
+
b, w, f, u && j, u && G))), ve || f !== "") {
|
|
897
|
+
ve && (h = r.slice(R + 1, O), M && (h = h.replace(Fn, " ")), S && (h = (0, Pn.default)(h) || h));
|
|
898
|
+
let je = t(h, f);
|
|
899
899
|
if (a) {
|
|
900
|
-
let
|
|
901
|
-
|
|
900
|
+
let tr = b[f];
|
|
901
|
+
tr === void 0 ? P > -1 ? b[f] = [je] : b[f] = je : tr.pop ? tr.push(je) : b[f] = [tr, je];
|
|
902
902
|
} else
|
|
903
|
-
b[f] =
|
|
903
|
+
b[f] = je;
|
|
904
904
|
}
|
|
905
|
-
h = "", x =
|
|
906
|
-
} else U === 93 ? (a &&
|
|
907
|
-
C, A), f = o(g), w !== void 0 && (b = (0,
|
|
908
|
-
46 ? i && (l === "dot" || u) && R <= x && (y !== W && (g =
|
|
909
|
-
b, w, f, u)), w = f, C = !1, A = !1),
|
|
910
|
-
y + 1,
|
|
911
|
-
U === 61 ? R <= x ? R =
|
|
912
|
-
W =
|
|
905
|
+
h = "", x = O, R = O, A = !1, S = !1, C = !1, M = !1, j = !1, G = !1, P = -1, y = O, b = p, w = void 0, f = "";
|
|
906
|
+
} else U === 93 ? (a && n === "bracket" && Ft === 91 && (P = W), i && (l === "index" || u) && R <= x && (y !== W && (g = Or(r, y + 1, O,
|
|
907
|
+
C, A), f = o(g), w !== void 0 && (b = (0, Ir.getDeepObject)(b, w, f, void 0, u)), w = f, C = !1, A = !1), y = O, G = !0, j = !1)) : U ===
|
|
908
|
+
46 ? i && (l === "dot" || u) && R <= x && (y !== W && (g = Or(r, y + 1, O, C, A), f = o(g), w !== void 0 && (b = (0, Ir.getDeepObject)(
|
|
909
|
+
b, w, f, u)), w = f, C = !1, A = !1), j = !0, G = !1, y = O) : U === 91 ? i && (l === "index" || u) && R <= x && (y !== W && (g = Or(r,
|
|
910
|
+
y + 1, O, C, A), f = o(g), u && w !== void 0 && (b = (0, Ir.getDeepObject)(b, w, f, u)), w = f, C = !1, A = !1, j = !1, G = !0), y = O) :
|
|
911
|
+
U === 61 ? R <= x ? R = O : S = !0 : U === 43 ? R > x ? M = !0 : C = !0 : U === 37 && (R > x ? S = !0 : A = !0);
|
|
912
|
+
W = O, Ft = U;
|
|
913
913
|
}
|
|
914
914
|
return p;
|
|
915
915
|
}
|
|
916
|
-
|
|
916
|
+
s(Li, "parse");
|
|
917
917
|
});
|
|
918
918
|
|
|
919
919
|
// ../node_modules/picoquery/lib/stringify.js
|
|
920
|
-
var
|
|
920
|
+
var Dn = I((ht) => {
|
|
921
921
|
"use strict";
|
|
922
|
-
Object.defineProperty(
|
|
923
|
-
|
|
924
|
-
var
|
|
925
|
-
function
|
|
922
|
+
Object.defineProperty(ht, "__esModule", { value: !0 });
|
|
923
|
+
ht.stringify = Bi;
|
|
924
|
+
var qi = yt();
|
|
925
|
+
function Bi(r, e) {
|
|
926
926
|
if (r === null || typeof r != "object")
|
|
927
927
|
return "";
|
|
928
928
|
let t = e ?? {};
|
|
929
|
-
return (0,
|
|
929
|
+
return (0, qi.stringifyObject)(r, t);
|
|
930
930
|
}
|
|
931
|
-
|
|
931
|
+
s(Bi, "stringify");
|
|
932
932
|
});
|
|
933
933
|
|
|
934
934
|
// ../node_modules/picoquery/lib/main.js
|
|
935
|
-
var
|
|
935
|
+
var Dr = I((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
|
-
var
|
|
940
|
-
(!
|
|
939
|
+
var n = Object.getOwnPropertyDescriptor(e, t);
|
|
940
|
+
(!n || ("get" in n ? !e.__esModule : n.writable || n.configurable)) && (n = { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
941
941
|
return e[t];
|
|
942
|
-
}, "get") }), Object.defineProperty(r, o,
|
|
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
|
+
}), Gi = 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
948
|
Object.defineProperty(V, "__esModule", { value: !0 });
|
|
949
949
|
V.stringify = V.parse = void 0;
|
|
950
|
-
var
|
|
951
|
-
Object.defineProperty(V, "parse", { enumerable: !0, get: /* @__PURE__ */
|
|
952
|
-
return
|
|
950
|
+
var Ui = On();
|
|
951
|
+
Object.defineProperty(V, "parse", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
952
|
+
return Ui.parse;
|
|
953
953
|
}, "get") });
|
|
954
|
-
var
|
|
955
|
-
Object.defineProperty(V, "stringify", { enumerable: !0, get: /* @__PURE__ */
|
|
956
|
-
return
|
|
954
|
+
var Hi = Dn();
|
|
955
|
+
Object.defineProperty(V, "stringify", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
956
|
+
return Hi.stringify;
|
|
957
957
|
}, "get") });
|
|
958
|
-
|
|
958
|
+
Gi(Pr(), V);
|
|
959
959
|
});
|
|
960
960
|
|
|
961
961
|
// ../node_modules/entities/lib/maps/entities.json
|
|
962
|
-
var
|
|
963
|
-
|
|
962
|
+
var St = I((qp, Ji) => {
|
|
963
|
+
Ji.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 Pt = O((Zp, sa) => {
|
|
|
1241
1241
|
});
|
|
1242
1242
|
|
|
1243
1243
|
// ../node_modules/entities/lib/maps/legacy.json
|
|
1244
|
-
var
|
|
1245
|
-
|
|
1244
|
+
var Gn = I((Bp, Qi) => {
|
|
1245
|
+
Qi.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 Xn = O((eu, ia) => {
|
|
|
1256
1256
|
});
|
|
1257
1257
|
|
|
1258
1258
|
// ../node_modules/entities/lib/maps/xml.json
|
|
1259
|
-
var
|
|
1260
|
-
|
|
1259
|
+
var Tt = I((zp, Zi) => {
|
|
1260
|
+
Zi.exports = { amp: "&", apos: "'", gt: ">", lt: "<", quot: '"' };
|
|
1261
1261
|
});
|
|
1262
1262
|
|
|
1263
1263
|
// ../node_modules/entities/lib/maps/decode.json
|
|
1264
|
-
var
|
|
1265
|
-
|
|
1264
|
+
var Un = I((Gp, ea) => {
|
|
1265
|
+
ea.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/entities/lib/decode_codepoint.js
|
|
1271
|
-
var
|
|
1271
|
+
var Vn = I((Ze) => {
|
|
1272
1272
|
"use strict";
|
|
1273
|
-
var
|
|
1273
|
+
var ra = Ze && Ze.__importDefault || function(r) {
|
|
1274
1274
|
return r && r.__esModule ? r : { default: r };
|
|
1275
1275
|
};
|
|
1276
|
-
Object.defineProperty(
|
|
1277
|
-
var
|
|
1276
|
+
Object.defineProperty(Ze, "__esModule", { value: !0 });
|
|
1277
|
+
var Hn = ra(Un()), ta = (
|
|
1278
1278
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
1279
1279
|
String.fromCodePoint || function(r) {
|
|
1280
1280
|
var e = "";
|
|
@@ -1282,79 +1282,79 @@ var Zn = O((er) => {
|
|
|
1282
1282
|
e;
|
|
1283
1283
|
}
|
|
1284
1284
|
);
|
|
1285
|
-
function
|
|
1286
|
-
return r >= 55296 && r <= 57343 || r > 1114111 ? "\uFFFD" : (r in
|
|
1285
|
+
function oa(r) {
|
|
1286
|
+
return r >= 55296 && r <= 57343 || r > 1114111 ? "\uFFFD" : (r in Hn.default && (r = Hn.default[r]), ta(r));
|
|
1287
1287
|
}
|
|
1288
|
-
|
|
1289
|
-
|
|
1288
|
+
s(oa, "decodeCodePoint");
|
|
1289
|
+
Ze.default = oa;
|
|
1290
1290
|
});
|
|
1291
1291
|
|
|
1292
1292
|
// ../node_modules/entities/lib/decode.js
|
|
1293
|
-
var
|
|
1293
|
+
var Rt = I((J) => {
|
|
1294
1294
|
"use strict";
|
|
1295
|
-
var
|
|
1295
|
+
var kr = J && J.__importDefault || function(r) {
|
|
1296
1296
|
return r && r.__esModule ? r : { default: r };
|
|
1297
1297
|
};
|
|
1298
1298
|
Object.defineProperty(J, "__esModule", { value: !0 });
|
|
1299
1299
|
J.decodeHTML = J.decodeHTMLStrict = J.decodeXML = void 0;
|
|
1300
|
-
var
|
|
1301
|
-
J.decodeXML =
|
|
1302
|
-
J.decodeHTMLStrict =
|
|
1303
|
-
function
|
|
1304
|
-
var e =
|
|
1300
|
+
var xt = kr(St()), na = kr(Gn()), sa = kr(Tt()), Wn = kr(Vn()), ia = /&(?:[a-zA-Z0-9]+|#[xX][\da-fA-F]+|#\d+);/g;
|
|
1301
|
+
J.decodeXML = Yn(sa.default);
|
|
1302
|
+
J.decodeHTMLStrict = Yn(xt.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(ia, e);
|
|
1307
1307
|
};
|
|
1308
1308
|
}
|
|
1309
|
-
|
|
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
|
J.decodeHTML = function() {
|
|
1314
|
-
for (var r = Object.keys(
|
|
1314
|
+
for (var r = Object.keys(na.default).sort($n), e = Object.keys(xt.default).sort($n), t = 0, o = 0; t < e.length; t++)
|
|
1315
1315
|
r[o] === e[t] ? (e[t] += ";?", o++) : e[t] += ";";
|
|
1316
|
-
var
|
|
1316
|
+
var n = new RegExp("&(?:" + e.join("|") + "|#[xX][\\da-fA-F]+;?|#\\d+;?)", "g"), i = Kn(xt.default);
|
|
1317
1317
|
function a(l) {
|
|
1318
1318
|
return l.substr(-1) !== ";" && (l += ";"), i(l);
|
|
1319
1319
|
}
|
|
1320
|
-
return
|
|
1321
|
-
return String(l).replace(
|
|
1320
|
+
return s(a, "replacer"), function(l) {
|
|
1321
|
+
return String(l).replace(n, a);
|
|
1322
1322
|
};
|
|
1323
1323
|
}();
|
|
1324
|
-
function
|
|
1325
|
-
return /* @__PURE__ */
|
|
1324
|
+
function Kn(r) {
|
|
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
|
-
|
|
1333
|
+
s(Kn, "getReplacer");
|
|
1334
1334
|
});
|
|
1335
1335
|
|
|
1336
1336
|
// ../node_modules/entities/lib/encode.js
|
|
1337
|
-
var
|
|
1337
|
+
var At = I((L) => {
|
|
1338
1338
|
"use strict";
|
|
1339
|
-
var
|
|
1339
|
+
var Xn = L && L.__importDefault || function(r) {
|
|
1340
1340
|
return r && r.__esModule ? r : { default: r };
|
|
1341
1341
|
};
|
|
1342
1342
|
Object.defineProperty(L, "__esModule", { value: !0 });
|
|
1343
1343
|
L.escapeUTF8 = L.escape = L.encodeNonAsciiHTML = L.encodeHTML = L.encodeXML = void 0;
|
|
1344
|
-
var
|
|
1345
|
-
L.encodeXML =
|
|
1346
|
-
var
|
|
1347
|
-
L.encodeHTML =
|
|
1348
|
-
L.encodeNonAsciiHTML =
|
|
1349
|
-
function
|
|
1344
|
+
var aa = Xn(Tt()), Jn = Zn(aa.default), Qn = es(Jn);
|
|
1345
|
+
L.encodeXML = os(Jn);
|
|
1346
|
+
var la = Xn(St()), wt = Zn(la.default), ca = es(wt);
|
|
1347
|
+
L.encodeHTML = pa(wt, ca);
|
|
1348
|
+
L.encodeNonAsciiHTML = os(wt);
|
|
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
|
-
|
|
1355
|
-
function
|
|
1356
|
-
for (var e = [], t = [], o = 0,
|
|
1357
|
-
var i =
|
|
1354
|
+
s(Zn, "getInverseObj");
|
|
1355
|
+
function es(r) {
|
|
1356
|
+
for (var e = [], t = [], o = 0, n = Object.keys(r); o < n.length; o++) {
|
|
1357
|
+
var i = n[o];
|
|
1358
1358
|
i.length === 1 ? e.push("\\" + i) : t.push(i);
|
|
1359
1359
|
}
|
|
1360
1360
|
e.sort();
|
|
@@ -1366,9 +1366,9 @@ var kt = O((L) => {
|
|
|
1366
1366
|
}
|
|
1367
1367
|
return t.unshift("[" + e.join("") + "]"), new RegExp(t.join("|"), "g");
|
|
1368
1368
|
}
|
|
1369
|
-
|
|
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
|
+
da = (
|
|
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,154 +1383,154 @@ var kt = O((L) => {
|
|
|
1383
1383
|
)
|
|
1384
1384
|
);
|
|
1385
1385
|
function Mr(r) {
|
|
1386
|
-
return "&#x" + (r.length > 1 ?
|
|
1386
|
+
return "&#x" + (r.length > 1 ? da(r) : r.charCodeAt(0)).toString(16).toUpperCase() + ";";
|
|
1387
1387
|
}
|
|
1388
|
-
|
|
1389
|
-
function
|
|
1388
|
+
s(Mr, "singleCharReplacer");
|
|
1389
|
+
function pa(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, Mr);
|
|
1394
1394
|
};
|
|
1395
1395
|
}
|
|
1396
|
-
|
|
1397
|
-
var
|
|
1398
|
-
function
|
|
1399
|
-
return r.replace(
|
|
1396
|
+
s(pa, "getInverse");
|
|
1397
|
+
var ts = new RegExp(Qn.source + "|" + rs.source, "g");
|
|
1398
|
+
function ua(r) {
|
|
1399
|
+
return r.replace(ts, Mr);
|
|
1400
1400
|
}
|
|
1401
|
-
|
|
1402
|
-
L.escape =
|
|
1403
|
-
function
|
|
1404
|
-
return r.replace(
|
|
1401
|
+
s(ua, "escape");
|
|
1402
|
+
L.escape = ua;
|
|
1403
|
+
function fa(r) {
|
|
1404
|
+
return r.replace(Qn, Mr);
|
|
1405
1405
|
}
|
|
1406
|
-
|
|
1407
|
-
L.escapeUTF8 =
|
|
1408
|
-
function
|
|
1406
|
+
s(fa, "escapeUTF8");
|
|
1407
|
+
L.escapeUTF8 = fa;
|
|
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] || Mr(t);
|
|
1412
1412
|
});
|
|
1413
1413
|
};
|
|
1414
1414
|
}
|
|
1415
|
-
|
|
1415
|
+
s(os, "getASCIIEncoder");
|
|
1416
1416
|
});
|
|
1417
1417
|
|
|
1418
1418
|
// ../node_modules/entities/lib/index.js
|
|
1419
|
-
var
|
|
1419
|
+
var ss = I((T) => {
|
|
1420
1420
|
"use strict";
|
|
1421
1421
|
Object.defineProperty(T, "__esModule", { value: !0 });
|
|
1422
1422
|
T.decodeXMLStrict = T.decodeHTML5Strict = T.decodeHTML4Strict = T.decodeHTML5 = T.decodeHTML4 = T.decodeHTMLStrict = T.decodeHTML = T.decodeXML =
|
|
1423
1423
|
T.encodeHTML5 = T.encodeHTML4 = T.escapeUTF8 = T.escape = T.encodeNonAsciiHTML = T.encodeHTML = T.encodeXML = T.encode = T.decodeStrict = T.
|
|
1424
1424
|
decode = void 0;
|
|
1425
|
-
var
|
|
1426
|
-
function
|
|
1427
|
-
return (!e || e <= 0 ?
|
|
1428
|
-
}
|
|
1429
|
-
|
|
1430
|
-
T.decode =
|
|
1431
|
-
function
|
|
1432
|
-
return (!e || e <= 0 ?
|
|
1433
|
-
}
|
|
1434
|
-
|
|
1435
|
-
T.decodeStrict =
|
|
1436
|
-
function
|
|
1437
|
-
return (!e || e <= 0 ?
|
|
1438
|
-
}
|
|
1439
|
-
|
|
1440
|
-
T.encode =
|
|
1441
|
-
var Ae =
|
|
1442
|
-
Object.defineProperty(T, "encodeXML", { enumerable: !0, get: /* @__PURE__ */
|
|
1425
|
+
var jr = Rt(), ns = At();
|
|
1426
|
+
function ya(r, e) {
|
|
1427
|
+
return (!e || e <= 0 ? jr.decodeXML : jr.decodeHTML)(r);
|
|
1428
|
+
}
|
|
1429
|
+
s(ya, "decode");
|
|
1430
|
+
T.decode = ya;
|
|
1431
|
+
function ma(r, e) {
|
|
1432
|
+
return (!e || e <= 0 ? jr.decodeXML : jr.decodeHTMLStrict)(r);
|
|
1433
|
+
}
|
|
1434
|
+
s(ma, "decodeStrict");
|
|
1435
|
+
T.decodeStrict = ma;
|
|
1436
|
+
function ha(r, e) {
|
|
1437
|
+
return (!e || e <= 0 ? ns.encodeXML : ns.encodeHTML)(r);
|
|
1438
|
+
}
|
|
1439
|
+
s(ha, "encode");
|
|
1440
|
+
T.encode = ha;
|
|
1441
|
+
var Ae = At();
|
|
1442
|
+
Object.defineProperty(T, "encodeXML", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
1443
1443
|
return Ae.encodeXML;
|
|
1444
1444
|
}, "get") });
|
|
1445
|
-
Object.defineProperty(T, "encodeHTML", { enumerable: !0, get: /* @__PURE__ */
|
|
1445
|
+
Object.defineProperty(T, "encodeHTML", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
1446
1446
|
return Ae.encodeHTML;
|
|
1447
1447
|
}, "get") });
|
|
1448
|
-
Object.defineProperty(T, "encodeNonAsciiHTML", { enumerable: !0, get: /* @__PURE__ */
|
|
1448
|
+
Object.defineProperty(T, "encodeNonAsciiHTML", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
1449
1449
|
return Ae.encodeNonAsciiHTML;
|
|
1450
1450
|
}, "get") });
|
|
1451
|
-
Object.defineProperty(T, "escape", { enumerable: !0, get: /* @__PURE__ */
|
|
1451
|
+
Object.defineProperty(T, "escape", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
1452
1452
|
return Ae.escape;
|
|
1453
1453
|
}, "get") });
|
|
1454
|
-
Object.defineProperty(T, "escapeUTF8", { enumerable: !0, get: /* @__PURE__ */
|
|
1454
|
+
Object.defineProperty(T, "escapeUTF8", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
1455
1455
|
return Ae.escapeUTF8;
|
|
1456
1456
|
}, "get") });
|
|
1457
|
-
Object.defineProperty(T, "encodeHTML4", { enumerable: !0, get: /* @__PURE__ */
|
|
1457
|
+
Object.defineProperty(T, "encodeHTML4", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
1458
1458
|
return Ae.encodeHTML;
|
|
1459
1459
|
}, "get") });
|
|
1460
|
-
Object.defineProperty(T, "encodeHTML5", { enumerable: !0, get: /* @__PURE__ */
|
|
1460
|
+
Object.defineProperty(T, "encodeHTML5", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
1461
1461
|
return Ae.encodeHTML;
|
|
1462
1462
|
}, "get") });
|
|
1463
|
-
var ce =
|
|
1464
|
-
Object.defineProperty(T, "decodeXML", { enumerable: !0, get: /* @__PURE__ */
|
|
1463
|
+
var ce = Rt();
|
|
1464
|
+
Object.defineProperty(T, "decodeXML", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
1465
1465
|
return ce.decodeXML;
|
|
1466
1466
|
}, "get") });
|
|
1467
|
-
Object.defineProperty(T, "decodeHTML", { enumerable: !0, get: /* @__PURE__ */
|
|
1467
|
+
Object.defineProperty(T, "decodeHTML", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
1468
1468
|
return ce.decodeHTML;
|
|
1469
1469
|
}, "get") });
|
|
1470
|
-
Object.defineProperty(T, "decodeHTMLStrict", { enumerable: !0, get: /* @__PURE__ */
|
|
1470
|
+
Object.defineProperty(T, "decodeHTMLStrict", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
1471
1471
|
return ce.decodeHTMLStrict;
|
|
1472
1472
|
}, "get") });
|
|
1473
|
-
Object.defineProperty(T, "decodeHTML4", { enumerable: !0, get: /* @__PURE__ */
|
|
1473
|
+
Object.defineProperty(T, "decodeHTML4", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
1474
1474
|
return ce.decodeHTML;
|
|
1475
1475
|
}, "get") });
|
|
1476
|
-
Object.defineProperty(T, "decodeHTML5", { enumerable: !0, get: /* @__PURE__ */
|
|
1476
|
+
Object.defineProperty(T, "decodeHTML5", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
1477
1477
|
return ce.decodeHTML;
|
|
1478
1478
|
}, "get") });
|
|
1479
|
-
Object.defineProperty(T, "decodeHTML4Strict", { enumerable: !0, get: /* @__PURE__ */
|
|
1479
|
+
Object.defineProperty(T, "decodeHTML4Strict", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
1480
1480
|
return ce.decodeHTMLStrict;
|
|
1481
1481
|
}, "get") });
|
|
1482
|
-
Object.defineProperty(T, "decodeHTML5Strict", { enumerable: !0, get: /* @__PURE__ */
|
|
1482
|
+
Object.defineProperty(T, "decodeHTML5Strict", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
1483
1483
|
return ce.decodeHTMLStrict;
|
|
1484
1484
|
}, "get") });
|
|
1485
|
-
Object.defineProperty(T, "decodeXMLStrict", { enumerable: !0, get: /* @__PURE__ */
|
|
1485
|
+
Object.defineProperty(T, "decodeXMLStrict", { enumerable: !0, get: /* @__PURE__ */ s(function() {
|
|
1486
1486
|
return ce.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 = I((Jp, ms) => {
|
|
1492
1492
|
"use strict";
|
|
1493
|
-
function
|
|
1493
|
+
function ga(r, e) {
|
|
1494
1494
|
if (!(r instanceof e))
|
|
1495
1495
|
throw new TypeError("Cannot call a class as a function");
|
|
1496
1496
|
}
|
|
1497
|
-
|
|
1498
|
-
function
|
|
1497
|
+
s(ga, "_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
|
-
|
|
1505
|
-
function
|
|
1506
|
-
return e &&
|
|
1504
|
+
s(is, "_defineProperties");
|
|
1505
|
+
function ba(r, e, t) {
|
|
1506
|
+
return e && is(r.prototype, e), t && is(r, t), r;
|
|
1507
1507
|
}
|
|
1508
|
-
|
|
1509
|
-
function
|
|
1508
|
+
s(ba, "_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 = Sa(r)) || e && r && typeof r.length == "number") {
|
|
1513
1513
|
t && (r = t);
|
|
1514
|
-
var o = 0,
|
|
1514
|
+
var o = 0, n = /* @__PURE__ */ s(function() {
|
|
1515
1515
|
}, "F");
|
|
1516
|
-
return { s, n: /* @__PURE__ */
|
|
1516
|
+
return { s: n, n: /* @__PURE__ */ s(function() {
|
|
1517
1517
|
return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] };
|
|
1518
|
-
}, "n"), e: /* @__PURE__ */
|
|
1518
|
+
}, "n"), e: /* @__PURE__ */ s(function(d) {
|
|
1519
1519
|
throw d;
|
|
1520
|
-
}, "e"), f:
|
|
1520
|
+
}, "e"), f: n };
|
|
1521
1521
|
}
|
|
1522
1522
|
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
1523
1523
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1524
1524
|
}
|
|
1525
1525
|
var i = !0, a = !1, l;
|
|
1526
|
-
return { s: /* @__PURE__ */
|
|
1526
|
+
return { s: /* @__PURE__ */ s(function() {
|
|
1527
1527
|
t = t.call(r);
|
|
1528
|
-
}, "s"), n: /* @__PURE__ */
|
|
1528
|
+
}, "s"), n: /* @__PURE__ */ s(function() {
|
|
1529
1529
|
var d = t.next();
|
|
1530
1530
|
return i = d.done, d;
|
|
1531
|
-
}, "n"), e: /* @__PURE__ */
|
|
1531
|
+
}, "n"), e: /* @__PURE__ */ s(function(d) {
|
|
1532
1532
|
a = !0, l = d;
|
|
1533
|
-
}, "e"), f: /* @__PURE__ */
|
|
1533
|
+
}, "e"), f: /* @__PURE__ */ s(function() {
|
|
1534
1534
|
try {
|
|
1535
1535
|
!i && t.return != null && t.return();
|
|
1536
1536
|
} finally {
|
|
@@ -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
|
-
|
|
1542
|
-
function
|
|
1541
|
+
s(us, "_createForOfIteratorHelper");
|
|
1542
|
+
function Sa(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
|
-
|
|
1551
|
-
function
|
|
1550
|
+
s(Sa, "_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
|
-
|
|
1558
|
-
var
|
|
1557
|
+
s(as, "_arrayLikeToArray");
|
|
1558
|
+
var Ta = 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: xa()
|
|
1565
1565
|
};
|
|
1566
|
-
function
|
|
1566
|
+
function xa() {
|
|
1567
1567
|
var r = {
|
|
1568
1568
|
0: "#000",
|
|
1569
1569
|
1: "#A00",
|
|
@@ -1582,35 +1582,35 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1582
1582
|
14: "#5FF",
|
|
1583
1583
|
15: "#FFF"
|
|
1584
1584
|
};
|
|
1585
|
-
return
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
return
|
|
1585
|
+
return _r(0, 5).forEach(function(e) {
|
|
1586
|
+
_r(0, 5).forEach(function(t) {
|
|
1587
|
+
_r(0, 5).forEach(function(o) {
|
|
1588
|
+
return Ra(e, t, o, r);
|
|
1589
1589
|
});
|
|
1590
1590
|
});
|
|
1591
|
-
}),
|
|
1592
|
-
var t = e + 232, o =
|
|
1591
|
+
}), _r(0, 23).forEach(function(e) {
|
|
1592
|
+
var t = e + 232, o = fs(e * 10 + 8);
|
|
1593
1593
|
r[t] = "#" + o + o + o;
|
|
1594
1594
|
}), r;
|
|
1595
1595
|
}
|
|
1596
|
-
|
|
1597
|
-
function
|
|
1598
|
-
var
|
|
1599
|
-
o[
|
|
1596
|
+
s(xa, "getDefaultColors");
|
|
1597
|
+
function Ra(r, e, t, o) {
|
|
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] = wa([i, a, l]);
|
|
1600
1600
|
}
|
|
1601
|
-
|
|
1602
|
-
function
|
|
1601
|
+
s(Ra, "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
|
-
|
|
1608
|
-
function
|
|
1609
|
-
var e = [], t =
|
|
1607
|
+
s(fs, "toHexString");
|
|
1608
|
+
function wa(r) {
|
|
1609
|
+
var e = [], t = us(r), o;
|
|
1610
1610
|
try {
|
|
1611
1611
|
for (t.s(); !(o = t.n()).done; ) {
|
|
1612
|
-
var
|
|
1613
|
-
e.push(
|
|
1612
|
+
var n = o.value;
|
|
1613
|
+
e.push(fs(n));
|
|
1614
1614
|
}
|
|
1615
1615
|
} catch (i) {
|
|
1616
1616
|
t.e(i);
|
|
@@ -1619,147 +1619,147 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1619
1619
|
}
|
|
1620
1620
|
return "#" + e.join("");
|
|
1621
1621
|
}
|
|
1622
|
-
|
|
1623
|
-
function
|
|
1624
|
-
var
|
|
1625
|
-
return e === "text" ?
|
|
1626
|
-
erm256Background" ?
|
|
1622
|
+
s(wa, "toColorHexString");
|
|
1623
|
+
function cs(r, e, t, o) {
|
|
1624
|
+
var n;
|
|
1625
|
+
return e === "text" ? n = va(t, o) : e === "display" ? n = Ea(r, t, o) : e === "xterm256Foreground" ? n = Lr(r, o.colors[t]) : e === "xt\
|
|
1626
|
+
erm256Background" ? n = qr(r, o.colors[t]) : e === "rgb" && (n = Aa(r, t)), n;
|
|
1627
1627
|
}
|
|
1628
|
-
|
|
1629
|
-
function
|
|
1628
|
+
s(cs, "generateOutput");
|
|
1629
|
+
function Aa(r, e) {
|
|
1630
1630
|
e = e.substring(2).slice(0, -1);
|
|
1631
|
-
var t = +e.substr(0, 2), o = e.substring(5).split(";"),
|
|
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
|
-
return
|
|
1634
|
+
return Nr(r, (t === 38 ? "color:#" : "background-color:#") + n);
|
|
1635
1635
|
}
|
|
1636
|
-
|
|
1637
|
-
function
|
|
1636
|
+
s(Aa, "handleRgb");
|
|
1637
|
+
function Ea(r, e, t) {
|
|
1638
1638
|
e = parseInt(e, 10);
|
|
1639
1639
|
var o = {
|
|
1640
|
-
"-1": /* @__PURE__ */
|
|
1640
|
+
"-1": /* @__PURE__ */ s(function() {
|
|
1641
1641
|
return "<br/>";
|
|
1642
1642
|
}, "_"),
|
|
1643
|
-
0: /* @__PURE__ */
|
|
1644
|
-
return r.length &&
|
|
1643
|
+
0: /* @__PURE__ */ s(function() {
|
|
1644
|
+
return r.length && ys(r);
|
|
1645
1645
|
}, "_"),
|
|
1646
|
-
1: /* @__PURE__ */
|
|
1646
|
+
1: /* @__PURE__ */ s(function() {
|
|
1647
1647
|
return de(r, "b");
|
|
1648
1648
|
}, "_"),
|
|
1649
|
-
3: /* @__PURE__ */
|
|
1649
|
+
3: /* @__PURE__ */ s(function() {
|
|
1650
1650
|
return de(r, "i");
|
|
1651
1651
|
}, "_"),
|
|
1652
|
-
4: /* @__PURE__ */
|
|
1652
|
+
4: /* @__PURE__ */ s(function() {
|
|
1653
1653
|
return de(r, "u");
|
|
1654
1654
|
}, "_"),
|
|
1655
|
-
8: /* @__PURE__ */
|
|
1656
|
-
return
|
|
1655
|
+
8: /* @__PURE__ */ s(function() {
|
|
1656
|
+
return Nr(r, "display:none");
|
|
1657
1657
|
}, "_"),
|
|
1658
|
-
9: /* @__PURE__ */
|
|
1658
|
+
9: /* @__PURE__ */ s(function() {
|
|
1659
1659
|
return de(r, "strike");
|
|
1660
1660
|
}, "_"),
|
|
1661
|
-
22: /* @__PURE__ */
|
|
1662
|
-
return
|
|
1661
|
+
22: /* @__PURE__ */ s(function() {
|
|
1662
|
+
return Nr(r, "font-weight:normal;text-decoration:none;font-style:normal");
|
|
1663
1663
|
}, "_"),
|
|
1664
|
-
23: /* @__PURE__ */
|
|
1665
|
-
return
|
|
1664
|
+
23: /* @__PURE__ */ s(function() {
|
|
1665
|
+
return ps(r, "i");
|
|
1666
1666
|
}, "_"),
|
|
1667
|
-
24: /* @__PURE__ */
|
|
1668
|
-
return
|
|
1667
|
+
24: /* @__PURE__ */ s(function() {
|
|
1668
|
+
return ps(r, "u");
|
|
1669
1669
|
}, "_"),
|
|
1670
|
-
39: /* @__PURE__ */
|
|
1671
|
-
return
|
|
1670
|
+
39: /* @__PURE__ */ s(function() {
|
|
1671
|
+
return Lr(r, t.fg);
|
|
1672
1672
|
}, "_"),
|
|
1673
|
-
49: /* @__PURE__ */
|
|
1674
|
-
return
|
|
1673
|
+
49: /* @__PURE__ */ s(function() {
|
|
1674
|
+
return qr(r, t.bg);
|
|
1675
1675
|
}, "_"),
|
|
1676
|
-
53: /* @__PURE__ */
|
|
1677
|
-
return
|
|
1676
|
+
53: /* @__PURE__ */ s(function() {
|
|
1677
|
+
return Nr(r, "text-decoration:overline");
|
|
1678
1678
|
}, "_")
|
|
1679
|
-
},
|
|
1680
|
-
return o[e] ?
|
|
1681
|
-
|
|
1682
|
-
|
|
1679
|
+
}, n;
|
|
1680
|
+
return o[e] ? n = o[e]() : 4 < e && e < 7 ? n = de(r, "blink") : 29 < e && e < 38 ? n = Lr(r, t.colors[e - 30]) : 39 < e && e < 48 ? n =
|
|
1681
|
+
qr(r, t.colors[e - 40]) : 89 < e && e < 98 ? n = Lr(r, t.colors[8 + (e - 90)]) : 99 < e && e < 108 && (n = qr(r, t.colors[8 + (e - 100)])),
|
|
1682
|
+
n;
|
|
1683
1683
|
}
|
|
1684
|
-
|
|
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
|
-
|
|
1692
|
-
function
|
|
1691
|
+
s(ys, "resetStyles");
|
|
1692
|
+
function _r(r, e) {
|
|
1693
1693
|
for (var t = [], o = r; o <= e; o++)
|
|
1694
1694
|
t.push(o);
|
|
1695
1695
|
return t;
|
|
1696
1696
|
}
|
|
1697
|
-
|
|
1698
|
-
function
|
|
1697
|
+
s(_r, "range");
|
|
1698
|
+
function Ca(r) {
|
|
1699
1699
|
return function(e) {
|
|
1700
1700
|
return (r === null || e.category !== r) && r !== "all";
|
|
1701
1701
|
};
|
|
1702
1702
|
}
|
|
1703
|
-
|
|
1704
|
-
function
|
|
1703
|
+
s(Ca, "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
|
-
|
|
1712
|
-
function
|
|
1713
|
-
return e.escapeXML ?
|
|
1711
|
+
s(ds, "categoryForCode");
|
|
1712
|
+
function va(r, e) {
|
|
1713
|
+
return e.escapeXML ? Ta.encodeXML(r) : r;
|
|
1714
1714
|
}
|
|
1715
|
-
|
|
1715
|
+
s(va, "pushText");
|
|
1716
1716
|
function de(r, e, t) {
|
|
1717
1717
|
return t || (t = ""), r.push(e), "<".concat(e).concat(t ? ' style="'.concat(t, '"') : "", ">");
|
|
1718
1718
|
}
|
|
1719
|
-
|
|
1720
|
-
function
|
|
1719
|
+
s(de, "pushTag");
|
|
1720
|
+
function Nr(r, e) {
|
|
1721
1721
|
return de(r, "span", e);
|
|
1722
1722
|
}
|
|
1723
|
-
|
|
1724
|
-
function
|
|
1723
|
+
s(Nr, "pushStyle");
|
|
1724
|
+
function Lr(r, e) {
|
|
1725
1725
|
return de(r, "span", "color:" + e);
|
|
1726
1726
|
}
|
|
1727
|
-
|
|
1728
|
-
function
|
|
1727
|
+
s(Lr, "pushForegroundColor");
|
|
1728
|
+
function qr(r, e) {
|
|
1729
1729
|
return de(r, "span", "background-color:" + e);
|
|
1730
1730
|
}
|
|
1731
|
-
|
|
1732
|
-
function
|
|
1731
|
+
s(qr, "pushBackgroundColor");
|
|
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
|
-
|
|
1738
|
-
function
|
|
1739
|
-
var o = !1,
|
|
1737
|
+
s(ps, "closeTag");
|
|
1738
|
+
function Pa(r, e, t) {
|
|
1739
|
+
var o = !1, n = 3;
|
|
1740
1740
|
function i() {
|
|
1741
1741
|
return "";
|
|
1742
1742
|
}
|
|
1743
|
-
|
|
1743
|
+
s(i, "remove");
|
|
1744
1744
|
function a(A, S) {
|
|
1745
1745
|
return t("xterm256Foreground", S), "";
|
|
1746
1746
|
}
|
|
1747
|
-
|
|
1747
|
+
s(a, "removeXterm256Foreground");
|
|
1748
1748
|
function l(A, S) {
|
|
1749
1749
|
return t("xterm256Background", S), "";
|
|
1750
1750
|
}
|
|
1751
|
-
|
|
1751
|
+
s(l, "removeXterm256Background");
|
|
1752
1752
|
function c(A) {
|
|
1753
1753
|
return e.newline ? t("display", -1) : t("text", A), "";
|
|
1754
1754
|
}
|
|
1755
|
-
|
|
1755
|
+
s(c, "newline");
|
|
1756
1756
|
function d(A, S) {
|
|
1757
1757
|
o = !0, S.trim().length === 0 && (S = "0"), S = S.trimRight(";").split(";");
|
|
1758
|
-
var C =
|
|
1758
|
+
var C = us(S), M;
|
|
1759
1759
|
try {
|
|
1760
1760
|
for (C.s(); !(M = C.n()).done; ) {
|
|
1761
|
-
var
|
|
1762
|
-
t("display",
|
|
1761
|
+
var j = M.value;
|
|
1762
|
+
t("display", j);
|
|
1763
1763
|
}
|
|
1764
1764
|
} catch (G) {
|
|
1765
1765
|
C.e(G);
|
|
@@ -1768,15 +1768,15 @@ e" : r === 9 ? e = "strike" : 29 < r && r < 38 || r === 39 || 89 < r && r < 98 ?
|
|
|
1768
1768
|
}
|
|
1769
1769
|
return "";
|
|
1770
1770
|
}
|
|
1771
|
-
|
|
1771
|
+
s(d, "ansiMess");
|
|
1772
1772
|
function u(A) {
|
|
1773
1773
|
return t("text", A), "";
|
|
1774
1774
|
}
|
|
1775
|
-
|
|
1775
|
+
s(u, "realText");
|
|
1776
1776
|
function p(A) {
|
|
1777
1777
|
return t("rgb", A), "";
|
|
1778
1778
|
}
|
|
1779
|
-
|
|
1779
|
+
s(p, "rgb");
|
|
1780
1780
|
var m = [{
|
|
1781
1781
|
pattern: /^\x08+/,
|
|
1782
1782
|
sub: i
|
|
@@ -1838,9 +1838,9 @@ e" : r === 9 ? e = "strike" : 29 < r && r < 38 || r === 39 || 89 < r && r < 98 ?
|
|
|
1838
1838
|
sub: u
|
|
1839
1839
|
}];
|
|
1840
1840
|
function h(A, S) {
|
|
1841
|
-
S >
|
|
1841
|
+
S > n && o || (o = !1, r = r.replace(A.pattern, A.sub));
|
|
1842
1842
|
}
|
|
1843
|
-
|
|
1843
|
+
s(h, "process");
|
|
1844
1844
|
var x = [], R = r, y = R.length;
|
|
1845
1845
|
e: for (; y > 0; ) {
|
|
1846
1846
|
for (var b = 0, w = 0, f = m.length; w < f; b = ++w) {
|
|
@@ -1856,127 +1856,126 @@ e" : r === 9 ? e = "strike" : 29 < r && r < 38 || r === 39 || 89 < r && r < 98 ?
|
|
|
1856
1856
|
}
|
|
1857
1857
|
return x;
|
|
1858
1858
|
}
|
|
1859
|
-
|
|
1860
|
-
function
|
|
1861
|
-
return e !== "text" && (r = r.filter(
|
|
1859
|
+
s(Pa, "tokenize");
|
|
1860
|
+
function Fa(r, e, t) {
|
|
1861
|
+
return e !== "text" && (r = r.filter(Ca(ds(t))), r.push({
|
|
1862
1862
|
token: e,
|
|
1863
1863
|
data: t,
|
|
1864
|
-
category:
|
|
1864
|
+
category: ds(t)
|
|
1865
1865
|
})), r;
|
|
1866
1866
|
}
|
|
1867
|
-
|
|
1868
|
-
var
|
|
1867
|
+
s(Fa, "updateStickyStack");
|
|
1868
|
+
var Ia = /* @__PURE__ */ function() {
|
|
1869
1869
|
function r(e) {
|
|
1870
|
-
|
|
1870
|
+
ga(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
|
|
1873
|
+
return s(r, "Filter"), ba(r, [{
|
|
1874
1874
|
key: "toHtml",
|
|
1875
|
-
value: /* @__PURE__ */
|
|
1875
|
+
value: /* @__PURE__ */ s(function(t) {
|
|
1876
1876
|
var o = this;
|
|
1877
1877
|
t = typeof t == "string" ? [t] : t;
|
|
1878
|
-
var
|
|
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
|
-
}),
|
|
1882
|
+
}), Pa(t.join(""), i, function(l, c) {
|
|
1883
|
+
var d = cs(n, l, c, i);
|
|
1884
|
+
d && a.push(d), i.stream && (o.stickyStack = Fa(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 = Ia;
|
|
1890
1890
|
});
|
|
1891
1891
|
|
|
1892
1892
|
// src/preview-api/index.ts
|
|
1893
|
-
var
|
|
1894
|
-
|
|
1893
|
+
var Ma = {};
|
|
1894
|
+
_s(Ma, {
|
|
1895
1895
|
DocsContext: () => ee,
|
|
1896
1896
|
HooksContext: () => te,
|
|
1897
1897
|
Preview: () => Se,
|
|
1898
|
-
PreviewWeb: () =>
|
|
1898
|
+
PreviewWeb: () => er,
|
|
1899
1899
|
PreviewWithSelection: () => Te,
|
|
1900
1900
|
ReporterAPI: () => se,
|
|
1901
1901
|
StoryStore: () => ge,
|
|
1902
1902
|
UrlStore: () => we,
|
|
1903
1903
|
WebView: () => Ee,
|
|
1904
1904
|
addons: () => q,
|
|
1905
|
-
applyHooks: () =>
|
|
1906
|
-
combineArgs: () =>
|
|
1905
|
+
applyHooks: () => sr,
|
|
1906
|
+
combineArgs: () => Oe,
|
|
1907
1907
|
combineParameters: () => B,
|
|
1908
1908
|
composeConfigs: () => Z,
|
|
1909
|
-
composeStepRunners: () =>
|
|
1910
|
-
composeStories: () =>
|
|
1911
|
-
composeStory: () =>
|
|
1912
|
-
createPlaywrightTest: () =>
|
|
1913
|
-
decorateStory: () =>
|
|
1914
|
-
defaultDecorateStory: () =>
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
getCoreAnnotations: () => Ie,
|
|
1919
|
-
getCsfFactoryAnnotations: () => Ar,
|
|
1909
|
+
composeStepRunners: () => Tr,
|
|
1910
|
+
composeStories: () => rn,
|
|
1911
|
+
composeStory: () => it,
|
|
1912
|
+
createPlaywrightTest: () => tn,
|
|
1913
|
+
decorateStory: () => tt,
|
|
1914
|
+
defaultDecorateStory: () => hr,
|
|
1915
|
+
emitTransformCode: () => Pt,
|
|
1916
|
+
filterArgTypes: () => He,
|
|
1917
|
+
getCsfFactoryAnnotations: () => wr,
|
|
1920
1918
|
inferControls: () => Me,
|
|
1921
|
-
makeDecorator: () =>
|
|
1922
|
-
mockChannel: () =>
|
|
1919
|
+
makeDecorator: () => Ht,
|
|
1920
|
+
mockChannel: () => or,
|
|
1921
|
+
normalizeArrays: () => v,
|
|
1923
1922
|
normalizeProjectAnnotations: () => ye,
|
|
1924
1923
|
normalizeStory: () => fe,
|
|
1925
1924
|
pauseAnimations: () => me,
|
|
1926
|
-
prepareMeta: () =>
|
|
1927
|
-
prepareStory: () =>
|
|
1928
|
-
sanitizeStoryContextUpdate: () =>
|
|
1929
|
-
setDefaultProjectAnnotations: () =>
|
|
1930
|
-
setProjectAnnotations: () =>
|
|
1931
|
-
simulateDOMContentLoaded: () =>
|
|
1932
|
-
simulatePageLoad: () =>
|
|
1933
|
-
sortStoriesV7: () =>
|
|
1934
|
-
useArgs: () =>
|
|
1925
|
+
prepareMeta: () => br,
|
|
1926
|
+
prepareStory: () => ke,
|
|
1927
|
+
sanitizeStoryContextUpdate: () => ot,
|
|
1928
|
+
setDefaultProjectAnnotations: () => Zo,
|
|
1929
|
+
setProjectAnnotations: () => en,
|
|
1930
|
+
simulateDOMContentLoaded: () => rr,
|
|
1931
|
+
simulatePageLoad: () => vt,
|
|
1932
|
+
sortStoriesV7: () => fn,
|
|
1933
|
+
useArgs: () => Gt,
|
|
1935
1934
|
useCallback: () => Fe,
|
|
1936
|
-
useChannel: () =>
|
|
1937
|
-
useEffect: () =>
|
|
1938
|
-
useGlobals: () =>
|
|
1939
|
-
useMemo: () =>
|
|
1940
|
-
useParameter: () =>
|
|
1941
|
-
useReducer: () =>
|
|
1942
|
-
useRef: () =>
|
|
1943
|
-
useState: () =>
|
|
1944
|
-
useStoryContext: () =>
|
|
1945
|
-
userOrAutoTitle: () =>
|
|
1946
|
-
userOrAutoTitleFromSpecifier: () =>
|
|
1935
|
+
useChannel: () => Bt,
|
|
1936
|
+
useEffect: () => Vr,
|
|
1937
|
+
useGlobals: () => Ut,
|
|
1938
|
+
useMemo: () => Mt,
|
|
1939
|
+
useParameter: () => zt,
|
|
1940
|
+
useReducer: () => qt,
|
|
1941
|
+
useRef: () => _t,
|
|
1942
|
+
useState: () => Lt,
|
|
1943
|
+
useStoryContext: () => Le,
|
|
1944
|
+
userOrAutoTitle: () => cn,
|
|
1945
|
+
userOrAutoTitleFromSpecifier: () => lt,
|
|
1947
1946
|
waitForAnimations: () => he
|
|
1948
1947
|
});
|
|
1949
|
-
module.exports =
|
|
1948
|
+
module.exports = Ns(Ma);
|
|
1950
1949
|
|
|
1951
1950
|
// src/preview-api/modules/addons/main.ts
|
|
1952
|
-
var
|
|
1951
|
+
var nr = require("@storybook/global");
|
|
1953
1952
|
|
|
1954
1953
|
// src/preview-api/modules/addons/storybook-channel-mock.ts
|
|
1955
|
-
var
|
|
1956
|
-
function
|
|
1954
|
+
var Ot = require("storybook/internal/channels");
|
|
1955
|
+
function or() {
|
|
1957
1956
|
let r = {
|
|
1958
|
-
setHandler: /* @__PURE__ */
|
|
1957
|
+
setHandler: /* @__PURE__ */ s(() => {
|
|
1959
1958
|
}, "setHandler"),
|
|
1960
|
-
send: /* @__PURE__ */
|
|
1959
|
+
send: /* @__PURE__ */ s(() => {
|
|
1961
1960
|
}, "send")
|
|
1962
1961
|
};
|
|
1963
|
-
return new
|
|
1962
|
+
return new Ot.Channel({ transport: r });
|
|
1964
1963
|
}
|
|
1965
|
-
|
|
1964
|
+
s(or, "mockChannel");
|
|
1966
1965
|
|
|
1967
1966
|
// src/preview-api/modules/addons/main.ts
|
|
1968
|
-
var
|
|
1967
|
+
var zr = class {
|
|
1969
1968
|
constructor() {
|
|
1970
|
-
this.getChannel = /* @__PURE__ */
|
|
1969
|
+
this.getChannel = /* @__PURE__ */ s(() => {
|
|
1971
1970
|
if (!this.channel) {
|
|
1972
|
-
let e =
|
|
1971
|
+
let e = or();
|
|
1973
1972
|
return this.setChannel(e), e;
|
|
1974
1973
|
}
|
|
1975
1974
|
return this.channel;
|
|
1976
1975
|
}, "getChannel");
|
|
1977
|
-
this.ready = /* @__PURE__ */
|
|
1978
|
-
this.hasChannel = /* @__PURE__ */
|
|
1979
|
-
this.setChannel = /* @__PURE__ */
|
|
1976
|
+
this.ready = /* @__PURE__ */ s(() => this.promise, "ready");
|
|
1977
|
+
this.hasChannel = /* @__PURE__ */ s(() => !!this.channel, "hasChannel");
|
|
1978
|
+
this.setChannel = /* @__PURE__ */ s((e) => {
|
|
1980
1979
|
this.channel = e, this.resolve();
|
|
1981
1980
|
}, "setChannel");
|
|
1982
1981
|
this.promise = new Promise((e) => {
|
|
@@ -1984,23 +1983,17 @@ var Gr = class {
|
|
|
1984
1983
|
});
|
|
1985
1984
|
}
|
|
1986
1985
|
static {
|
|
1987
|
-
|
|
1986
|
+
s(this, "AddonStore");
|
|
1988
1987
|
}
|
|
1989
|
-
},
|
|
1990
|
-
function
|
|
1991
|
-
return
|
|
1992
|
-
}
|
|
1993
|
-
n(Ws, "getAddonsStore");
|
|
1994
|
-
var q = Ws();
|
|
1995
|
-
|
|
1996
|
-
// src/preview-api/modules/addons/definePreview.ts
|
|
1997
|
-
function zt(r) {
|
|
1998
|
-
return r;
|
|
1988
|
+
}, Br = "__STORYBOOK_ADDONS_PREVIEW";
|
|
1989
|
+
function Ls() {
|
|
1990
|
+
return nr.global[Br] || (nr.global[Br] = new zr()), nr.global[Br];
|
|
1999
1991
|
}
|
|
2000
|
-
|
|
1992
|
+
s(Ls, "getAddonsStore");
|
|
1993
|
+
var q = Ls();
|
|
2001
1994
|
|
|
2002
1995
|
// src/preview-api/modules/addons/hooks.ts
|
|
2003
|
-
var Pe = require("storybook/internal/client-logger"), H = require("storybook/internal/core-events"),
|
|
1996
|
+
var Pe = require("storybook/internal/client-logger"), H = require("storybook/internal/core-events"), Ne = require("@storybook/global");
|
|
2004
1997
|
var te = class {
|
|
2005
1998
|
constructor() {
|
|
2006
1999
|
this.hookListsMap = void 0;
|
|
@@ -2014,13 +2007,13 @@ var te = class {
|
|
|
2014
2007
|
this.currentDecoratorName = void 0;
|
|
2015
2008
|
this.hasUpdates = void 0;
|
|
2016
2009
|
this.currentContext = void 0;
|
|
2017
|
-
this.renderListener = /* @__PURE__ */
|
|
2010
|
+
this.renderListener = /* @__PURE__ */ s((e) => {
|
|
2018
2011
|
e === this.currentContext?.id && (this.triggerEffects(), this.currentContext = null, this.removeRenderListeners());
|
|
2019
2012
|
}, "renderListener");
|
|
2020
2013
|
this.init();
|
|
2021
2014
|
}
|
|
2022
2015
|
static {
|
|
2023
|
-
|
|
2016
|
+
s(this, "HooksContext");
|
|
2024
2017
|
}
|
|
2025
2018
|
init() {
|
|
2026
2019
|
this.hookListsMap = /* @__PURE__ */ new WeakMap(), this.mountedDecorators = /* @__PURE__ */ new Set(), this.prevMountedDecorators = /* @__PURE__ */ new Set(),
|
|
@@ -2050,110 +2043,110 @@ var te = class {
|
|
|
2050
2043
|
q.getChannel().removeListener(H.STORY_RENDERED, this.renderListener);
|
|
2051
2044
|
}
|
|
2052
2045
|
};
|
|
2053
|
-
function
|
|
2054
|
-
let e = /* @__PURE__ */
|
|
2055
|
-
let { hooks: o } = typeof t[0] == "function" ? t[1] : t[0],
|
|
2046
|
+
function Dt(r) {
|
|
2047
|
+
let e = /* @__PURE__ */ s((...t) => {
|
|
2048
|
+
let { hooks: o } = typeof t[0] == "function" ? t[1] : t[0], n = o.currentPhase, i = o.currentHooks, a = o.nextHookIndex, l = o.currentDecoratorName;
|
|
2056
2049
|
o.currentDecoratorName = r.name, o.prevMountedDecorators.has(r) ? (o.currentPhase = "UPDATE", o.currentHooks = o.hookListsMap.get(r) || []) :
|
|
2057
2050
|
(o.currentPhase = "MOUNT", o.currentHooks = [], o.hookListsMap.set(r, o.currentHooks), o.prevMountedDecorators.add(r)), o.nextHookIndex =
|
|
2058
2051
|
0;
|
|
2059
|
-
let c =
|
|
2060
|
-
|
|
2052
|
+
let c = Ne.global.STORYBOOK_HOOKS_CONTEXT;
|
|
2053
|
+
Ne.global.STORYBOOK_HOOKS_CONTEXT = o;
|
|
2061
2054
|
let d = r(...t);
|
|
2062
|
-
if (
|
|
2055
|
+
if (Ne.global.STORYBOOK_HOOKS_CONTEXT = c, o.currentPhase === "UPDATE" && o.getNextHook() != null)
|
|
2063
2056
|
throw new Error(
|
|
2064
2057
|
"Rendered fewer hooks than expected. This may be caused by an accidental early return statement."
|
|
2065
2058
|
);
|
|
2066
|
-
return o.currentPhase =
|
|
2059
|
+
return o.currentPhase = n, o.currentHooks = i, o.nextHookIndex = a, o.currentDecoratorName = l, d;
|
|
2067
2060
|
}, "hookified");
|
|
2068
2061
|
return e.originalFn = r, e;
|
|
2069
2062
|
}
|
|
2070
|
-
|
|
2071
|
-
var
|
|
2063
|
+
s(Dt, "hookify");
|
|
2064
|
+
var Gr = 0, qs = 25, sr = /* @__PURE__ */ s((r) => (e, t) => {
|
|
2072
2065
|
let o = r(
|
|
2073
|
-
|
|
2074
|
-
t.map((
|
|
2066
|
+
Dt(e),
|
|
2067
|
+
t.map((n) => Dt(n))
|
|
2075
2068
|
);
|
|
2076
|
-
return (
|
|
2077
|
-
let { hooks: i } =
|
|
2078
|
-
i.prevMountedDecorators ??= /* @__PURE__ */ new Set(), i.mountedDecorators = /* @__PURE__ */ new Set([e, ...t]), i.currentContext =
|
|
2069
|
+
return (n) => {
|
|
2070
|
+
let { hooks: i } = n;
|
|
2071
|
+
i.prevMountedDecorators ??= /* @__PURE__ */ new Set(), i.mountedDecorators = /* @__PURE__ */ new Set([e, ...t]), i.currentContext = n, i.
|
|
2079
2072
|
hasUpdates = !1;
|
|
2080
|
-
let a = o(
|
|
2081
|
-
for (
|
|
2082
|
-
if (i.hasUpdates = !1, i.currentEffects = [], a = o(
|
|
2073
|
+
let a = o(n);
|
|
2074
|
+
for (Gr = 1; i.hasUpdates; )
|
|
2075
|
+
if (i.hasUpdates = !1, i.currentEffects = [], a = o(n), Gr += 1, Gr > qs)
|
|
2083
2076
|
throw new Error(
|
|
2084
2077
|
"Too many re-renders. Storybook limits the number of renders to prevent an infinite loop."
|
|
2085
2078
|
);
|
|
2086
2079
|
return i.addRenderListeners(), a;
|
|
2087
2080
|
};
|
|
2088
|
-
}, "applyHooks"),
|
|
2081
|
+
}, "applyHooks"), Bs = /* @__PURE__ */ s((r, e) => r.length === e.length && r.every((t, o) => t === e[o]), "areDepsEqual"), Ur = /* @__PURE__ */ s(
|
|
2089
2082
|
() => new Error("Storybook preview hooks can only be called inside decorators and story functions."), "invalidHooksError");
|
|
2090
|
-
function
|
|
2091
|
-
return
|
|
2083
|
+
function kt() {
|
|
2084
|
+
return Ne.global.STORYBOOK_HOOKS_CONTEXT || null;
|
|
2092
2085
|
}
|
|
2093
|
-
|
|
2094
|
-
function
|
|
2095
|
-
let r =
|
|
2086
|
+
s(kt, "getHooksContextOrNull");
|
|
2087
|
+
function Hr() {
|
|
2088
|
+
let r = kt();
|
|
2096
2089
|
if (r == null)
|
|
2097
|
-
throw
|
|
2090
|
+
throw Ur();
|
|
2098
2091
|
return r;
|
|
2099
2092
|
}
|
|
2100
|
-
|
|
2101
|
-
function
|
|
2102
|
-
let o =
|
|
2093
|
+
s(Hr, "getHooksContextOrThrow");
|
|
2094
|
+
function zs(r, e, t) {
|
|
2095
|
+
let o = Hr();
|
|
2103
2096
|
if (o.currentPhase === "MOUNT") {
|
|
2104
2097
|
t != null && !Array.isArray(t) && Pe.logger.warn(
|
|
2105
2098
|
`${r} received a final argument that is not an array (instead, received ${t}). When specified, the final argument must be an array.`
|
|
2106
2099
|
);
|
|
2107
|
-
let
|
|
2108
|
-
return o.currentHooks.push(
|
|
2100
|
+
let n = { name: r, deps: t };
|
|
2101
|
+
return o.currentHooks.push(n), e(n), n;
|
|
2109
2102
|
}
|
|
2110
2103
|
if (o.currentPhase === "UPDATE") {
|
|
2111
|
-
let
|
|
2112
|
-
if (
|
|
2104
|
+
let n = o.getNextHook();
|
|
2105
|
+
if (n == null)
|
|
2113
2106
|
throw new Error("Rendered more hooks than during the previous render.");
|
|
2114
|
-
return
|
|
2107
|
+
return n.name !== r && Pe.logger.warn(
|
|
2115
2108
|
`Storybook has detected a change in the order of Hooks${o.currentDecoratorName ? ` called by ${o.currentDecoratorName}` : ""}. This wi\
|
|
2116
2109
|
ll lead to bugs and errors if not fixed.`
|
|
2117
|
-
), t != null &&
|
|
2110
|
+
), t != null && n.deps == null && Pe.logger.warn(
|
|
2118
2111
|
`${r} received a final argument during this render, but not during the previous render. Even though the final argument is optional, it\
|
|
2119
2112
|
s type cannot change between renders.`
|
|
2120
|
-
), t != null &&
|
|
2113
|
+
), t != null && n.deps != null && t.length !== n.deps.length && Pe.logger.warn(`The final argument passed to ${r} changed size between r\
|
|
2121
2114
|
enders. The order and size of this array must remain constant.
|
|
2122
|
-
Previous: ${
|
|
2123
|
-
Incoming: ${t}`), (t == null ||
|
|
2115
|
+
Previous: ${n.deps}
|
|
2116
|
+
Incoming: ${t}`), (t == null || n.deps == null || !Bs(t, n.deps)) && (e(n), n.deps = t), n;
|
|
2124
2117
|
}
|
|
2125
|
-
throw
|
|
2118
|
+
throw Ur();
|
|
2126
2119
|
}
|
|
2127
|
-
|
|
2128
|
-
function
|
|
2129
|
-
let { memoizedState: o } =
|
|
2120
|
+
s(zs, "useHook");
|
|
2121
|
+
function ir(r, e, t) {
|
|
2122
|
+
let { memoizedState: o } = zs(
|
|
2130
2123
|
r,
|
|
2131
|
-
(
|
|
2132
|
-
|
|
2124
|
+
(n) => {
|
|
2125
|
+
n.memoizedState = e();
|
|
2133
2126
|
},
|
|
2134
2127
|
t
|
|
2135
2128
|
);
|
|
2136
2129
|
return o;
|
|
2137
2130
|
}
|
|
2138
|
-
|
|
2139
|
-
function
|
|
2140
|
-
return
|
|
2131
|
+
s(ir, "useMemoLike");
|
|
2132
|
+
function Mt(r, e) {
|
|
2133
|
+
return ir("useMemo", r, e);
|
|
2141
2134
|
}
|
|
2142
|
-
|
|
2135
|
+
s(Mt, "useMemo");
|
|
2143
2136
|
function Fe(r, e) {
|
|
2144
|
-
return
|
|
2137
|
+
return ir("useCallback", () => r, e);
|
|
2145
2138
|
}
|
|
2146
|
-
|
|
2147
|
-
function
|
|
2148
|
-
return
|
|
2139
|
+
s(Fe, "useCallback");
|
|
2140
|
+
function jt(r, e) {
|
|
2141
|
+
return ir(r, () => ({ current: e }), []);
|
|
2149
2142
|
}
|
|
2150
|
-
|
|
2151
|
-
function
|
|
2152
|
-
return
|
|
2143
|
+
s(jt, "useRefLike");
|
|
2144
|
+
function _t(r) {
|
|
2145
|
+
return jt("useRef", r);
|
|
2153
2146
|
}
|
|
2154
|
-
|
|
2155
|
-
function
|
|
2156
|
-
let r =
|
|
2147
|
+
s(_t, "useRef");
|
|
2148
|
+
function Gs() {
|
|
2149
|
+
let r = kt();
|
|
2157
2150
|
if (r != null && r.currentPhase !== "NONE")
|
|
2158
2151
|
r.hasUpdates = !0;
|
|
2159
2152
|
else
|
|
@@ -2163,91 +2156,91 @@ function Xs() {
|
|
|
2163
2156
|
Pe.logger.warn("State updates of Storybook preview hooks work only in browser");
|
|
2164
2157
|
}
|
|
2165
2158
|
}
|
|
2166
|
-
|
|
2167
|
-
function
|
|
2168
|
-
let t =
|
|
2159
|
+
s(Gs, "triggerUpdate");
|
|
2160
|
+
function Nt(r, e) {
|
|
2161
|
+
let t = jt(
|
|
2169
2162
|
r,
|
|
2170
2163
|
// @ts-expect-error S type should never be function, but there's no way to tell that to TypeScript
|
|
2171
2164
|
typeof e == "function" ? e() : e
|
|
2172
|
-
), o = /* @__PURE__ */
|
|
2173
|
-
t.current = typeof
|
|
2165
|
+
), o = /* @__PURE__ */ s((n) => {
|
|
2166
|
+
t.current = typeof n == "function" ? n(t.current) : n, Gs();
|
|
2174
2167
|
}, "setState");
|
|
2175
2168
|
return [t.current, o];
|
|
2176
2169
|
}
|
|
2177
|
-
|
|
2178
|
-
function
|
|
2179
|
-
return
|
|
2170
|
+
s(Nt, "useStateLike");
|
|
2171
|
+
function Lt(r) {
|
|
2172
|
+
return Nt("useState", r);
|
|
2180
2173
|
}
|
|
2181
|
-
|
|
2182
|
-
function
|
|
2183
|
-
let o = t != null ? () => t(e) : e, [
|
|
2184
|
-
return [
|
|
2174
|
+
s(Lt, "useState");
|
|
2175
|
+
function qt(r, e, t) {
|
|
2176
|
+
let o = t != null ? () => t(e) : e, [n, i] = Nt("useReducer", o);
|
|
2177
|
+
return [n, /* @__PURE__ */ s((l) => i((c) => r(c, l)), "dispatch")];
|
|
2185
2178
|
}
|
|
2186
|
-
|
|
2187
|
-
function
|
|
2188
|
-
let t =
|
|
2179
|
+
s(qt, "useReducer");
|
|
2180
|
+
function Vr(r, e) {
|
|
2181
|
+
let t = Hr(), o = ir("useEffect", () => ({ create: r }), e);
|
|
2189
2182
|
t.currentEffects.includes(o) || t.currentEffects.push(o);
|
|
2190
2183
|
}
|
|
2191
|
-
|
|
2192
|
-
function
|
|
2184
|
+
s(Vr, "useEffect");
|
|
2185
|
+
function Bt(r, e = []) {
|
|
2193
2186
|
let t = q.getChannel();
|
|
2194
|
-
return
|
|
2187
|
+
return Vr(() => (Object.entries(r).forEach(([o, n]) => t.on(o, n)), () => {
|
|
2195
2188
|
Object.entries(r).forEach(
|
|
2196
|
-
([o,
|
|
2189
|
+
([o, n]) => t.removeListener(o, n)
|
|
2197
2190
|
);
|
|
2198
2191
|
}), [...Object.keys(r), ...e]), Fe(t.emit.bind(t), [t]);
|
|
2199
2192
|
}
|
|
2200
|
-
|
|
2201
|
-
function
|
|
2202
|
-
let { currentContext: r } =
|
|
2193
|
+
s(Bt, "useChannel");
|
|
2194
|
+
function Le() {
|
|
2195
|
+
let { currentContext: r } = Hr();
|
|
2203
2196
|
if (r == null)
|
|
2204
|
-
throw
|
|
2197
|
+
throw Ur();
|
|
2205
2198
|
return r;
|
|
2206
2199
|
}
|
|
2207
|
-
|
|
2208
|
-
function
|
|
2209
|
-
let { parameters: t } =
|
|
2200
|
+
s(Le, "useStoryContext");
|
|
2201
|
+
function zt(r, e) {
|
|
2202
|
+
let { parameters: t } = Le();
|
|
2210
2203
|
if (r)
|
|
2211
2204
|
return t[r] ?? e;
|
|
2212
2205
|
}
|
|
2213
|
-
|
|
2214
|
-
function
|
|
2215
|
-
let r = q.getChannel(), { id: e, args: t } =
|
|
2206
|
+
s(zt, "useParameter");
|
|
2207
|
+
function Gt() {
|
|
2208
|
+
let r = q.getChannel(), { id: e, args: t } = Le(), o = Fe(
|
|
2216
2209
|
(i) => r.emit(H.UPDATE_STORY_ARGS, { storyId: e, updatedArgs: i }),
|
|
2217
2210
|
[r, e]
|
|
2218
|
-
),
|
|
2211
|
+
), n = Fe(
|
|
2219
2212
|
(i) => r.emit(H.RESET_STORY_ARGS, { storyId: e, argNames: i }),
|
|
2220
2213
|
[r, e]
|
|
2221
2214
|
);
|
|
2222
|
-
return [t, o,
|
|
2215
|
+
return [t, o, n];
|
|
2223
2216
|
}
|
|
2224
|
-
|
|
2225
|
-
function
|
|
2226
|
-
let r = q.getChannel(), { globals: e } =
|
|
2217
|
+
s(Gt, "useArgs");
|
|
2218
|
+
function Ut() {
|
|
2219
|
+
let r = q.getChannel(), { globals: e } = Le(), t = Fe(
|
|
2227
2220
|
(o) => r.emit(H.UPDATE_GLOBALS, { globals: o }),
|
|
2228
2221
|
[r]
|
|
2229
2222
|
);
|
|
2230
2223
|
return [e, t];
|
|
2231
2224
|
}
|
|
2232
|
-
|
|
2225
|
+
s(Ut, "useGlobals");
|
|
2233
2226
|
|
|
2234
2227
|
// src/preview-api/modules/addons/make-decorator.ts
|
|
2235
|
-
var
|
|
2228
|
+
var Ht = /* @__PURE__ */ s(({
|
|
2236
2229
|
name: r,
|
|
2237
2230
|
parameterName: e,
|
|
2238
2231
|
wrapper: t,
|
|
2239
2232
|
skipIfNoParametersOrOptions: o = !1
|
|
2240
2233
|
}) => {
|
|
2241
|
-
let
|
|
2234
|
+
let n = /* @__PURE__ */ s((i) => (a, l) => {
|
|
2242
2235
|
let c = l.parameters && l.parameters[e];
|
|
2243
2236
|
return c && c.disable || o && !i && !c ? a(l) : t(a, l, {
|
|
2244
2237
|
options: i,
|
|
2245
2238
|
parameters: c
|
|
2246
2239
|
});
|
|
2247
2240
|
}, "decorator");
|
|
2248
|
-
return (...i) => typeof i[0] == "function" ?
|
|
2241
|
+
return (...i) => typeof i[0] == "function" ? n()(...i) : (...a) => {
|
|
2249
2242
|
if (a.length > 1)
|
|
2250
|
-
return i.length > 1 ?
|
|
2243
|
+
return i.length > 1 ? n(i)(...a) : n(...i)(...a);
|
|
2251
2244
|
throw new Error(
|
|
2252
2245
|
`Passing stories directly into ${r}() is not allowed,
|
|
2253
2246
|
instead use addDecorator(${r}) and pass options with the '${e}' parameter`
|
|
@@ -2256,31 +2249,31 @@ var eo = /* @__PURE__ */ n(({
|
|
|
2256
2249
|
}, "makeDecorator");
|
|
2257
2250
|
|
|
2258
2251
|
// src/preview-api/modules/store/StoryStore.ts
|
|
2259
|
-
var
|
|
2252
|
+
var nn = require("storybook/internal/csf"), Er = require("storybook/internal/preview-errors");
|
|
2260
2253
|
|
|
2261
2254
|
// ../node_modules/es-toolkit/dist/function/noop.mjs
|
|
2262
|
-
function
|
|
2255
|
+
function Vt() {
|
|
2263
2256
|
}
|
|
2264
|
-
|
|
2257
|
+
s(Vt, "noop");
|
|
2265
2258
|
|
|
2266
2259
|
// ../node_modules/es-toolkit/dist/compat/_internal/getSymbols.mjs
|
|
2267
|
-
function
|
|
2260
|
+
function Wr(r) {
|
|
2268
2261
|
return Object.getOwnPropertySymbols(r).filter((e) => Object.prototype.propertyIsEnumerable.call(r, e));
|
|
2269
2262
|
}
|
|
2270
|
-
|
|
2263
|
+
s(Wr, "getSymbols");
|
|
2271
2264
|
|
|
2272
2265
|
// ../node_modules/es-toolkit/dist/compat/_internal/getTag.mjs
|
|
2273
|
-
function
|
|
2266
|
+
function $r(r) {
|
|
2274
2267
|
return r == null ? r === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(r);
|
|
2275
2268
|
}
|
|
2276
|
-
|
|
2269
|
+
s($r, "getTag");
|
|
2277
2270
|
|
|
2278
2271
|
// ../node_modules/es-toolkit/dist/compat/_internal/tags.mjs
|
|
2279
|
-
var
|
|
2280
|
-
t Symbol]",
|
|
2281
|
-
rrayBuffer]",
|
|
2282
|
-
dArray]",
|
|
2283
|
-
Int16Array]",
|
|
2272
|
+
var Wt = "[object RegExp]", $t = "[object String]", Yt = "[object Number]", Kt = "[object Boolean]", Yr = "[object Arguments]", Xt = "[objec\
|
|
2273
|
+
t Symbol]", Jt = "[object Date]", Qt = "[object Map]", Zt = "[object Set]", eo = "[object Array]", ro = "[object Function]", to = "[object A\
|
|
2274
|
+
rrayBuffer]", ar = "[object Object]", oo = "[object Error]", no = "[object DataView]", so = "[object Uint8Array]", io = "[object Uint8Clampe\
|
|
2275
|
+
dArray]", ao = "[object Uint16Array]", lo = "[object Uint32Array]", co = "[object BigUint64Array]", po = "[object Int8Array]", uo = "[object\
|
|
2276
|
+
Int16Array]", fo = "[object Int32Array]", yo = "[object BigInt64Array]", mo = "[object Float32Array]", ho = "[object Float64Array]";
|
|
2284
2277
|
|
|
2285
2278
|
// ../node_modules/es-toolkit/dist/predicate/isPlainObject.mjs
|
|
2286
2279
|
function N(r) {
|
|
@@ -2290,43 +2283,43 @@ function N(r) {
|
|
|
2290
2283
|
return e === null || e === Object.prototype || Object.getPrototypeOf(e) === null ? Object.prototype.toString.call(r) === "[object Object]" :
|
|
2291
2284
|
!1;
|
|
2292
2285
|
}
|
|
2293
|
-
|
|
2286
|
+
s(N, "isPlainObject");
|
|
2294
2287
|
|
|
2295
2288
|
// ../node_modules/es-toolkit/dist/object/mapValues.mjs
|
|
2296
2289
|
function Q(r, e) {
|
|
2297
2290
|
let t = {}, o = Object.keys(r);
|
|
2298
|
-
for (let
|
|
2299
|
-
let i = o[
|
|
2291
|
+
for (let n = 0; n < o.length; n++) {
|
|
2292
|
+
let i = o[n], a = r[i];
|
|
2300
2293
|
t[i] = e(a, i, r);
|
|
2301
2294
|
}
|
|
2302
2295
|
return t;
|
|
2303
2296
|
}
|
|
2304
|
-
|
|
2297
|
+
s(Q, "mapValues");
|
|
2305
2298
|
|
|
2306
2299
|
// ../node_modules/es-toolkit/dist/object/pickBy.mjs
|
|
2307
|
-
function
|
|
2300
|
+
function Kr(r, e) {
|
|
2308
2301
|
let t = {}, o = Object.keys(r);
|
|
2309
|
-
for (let
|
|
2310
|
-
let i = o[
|
|
2302
|
+
for (let n = 0; n < o.length; n++) {
|
|
2303
|
+
let i = o[n], a = r[i];
|
|
2311
2304
|
e(a, i) && (t[i] = a);
|
|
2312
2305
|
}
|
|
2313
2306
|
return t;
|
|
2314
2307
|
}
|
|
2315
|
-
|
|
2308
|
+
s(Kr, "pickBy");
|
|
2316
2309
|
|
|
2317
2310
|
// ../node_modules/es-toolkit/dist/compat/util/eq.mjs
|
|
2318
|
-
function
|
|
2311
|
+
function go(r, e) {
|
|
2319
2312
|
return r === e || Number.isNaN(r) && Number.isNaN(e);
|
|
2320
2313
|
}
|
|
2321
|
-
|
|
2314
|
+
s(go, "eq");
|
|
2322
2315
|
|
|
2323
2316
|
// ../node_modules/es-toolkit/dist/predicate/isEqualWith.mjs
|
|
2324
|
-
function
|
|
2325
|
-
return
|
|
2317
|
+
function bo(r, e, t) {
|
|
2318
|
+
return qe(r, e, void 0, void 0, void 0, void 0, t);
|
|
2326
2319
|
}
|
|
2327
|
-
|
|
2328
|
-
function
|
|
2329
|
-
let l = a(r, e, t, o,
|
|
2320
|
+
s(bo, "isEqualWith");
|
|
2321
|
+
function qe(r, e, t, o, n, i, a) {
|
|
2322
|
+
let l = a(r, e, t, o, n, i);
|
|
2330
2323
|
if (l !== void 0)
|
|
2331
2324
|
return l;
|
|
2332
2325
|
if (typeof r == typeof e)
|
|
@@ -2342,31 +2335,31 @@ function Be(r, e, t, o, s, i, a) {
|
|
|
2342
2335
|
case "function":
|
|
2343
2336
|
return r === e;
|
|
2344
2337
|
case "object":
|
|
2345
|
-
return
|
|
2338
|
+
return Be(r, e, i, a);
|
|
2346
2339
|
}
|
|
2347
|
-
return
|
|
2340
|
+
return Be(r, e, i, a);
|
|
2348
2341
|
}
|
|
2349
|
-
|
|
2350
|
-
function
|
|
2342
|
+
s(qe, "isEqualWithImpl");
|
|
2343
|
+
function Be(r, e, t, o) {
|
|
2351
2344
|
if (Object.is(r, e))
|
|
2352
2345
|
return !0;
|
|
2353
|
-
let
|
|
2354
|
-
if (
|
|
2346
|
+
let n = $r(r), i = $r(e);
|
|
2347
|
+
if (n === Yr && (n = ar), i === Yr && (i = ar), n !== i)
|
|
2355
2348
|
return !1;
|
|
2356
|
-
switch (
|
|
2357
|
-
case
|
|
2349
|
+
switch (n) {
|
|
2350
|
+
case $t:
|
|
2358
2351
|
return r.toString() === e.toString();
|
|
2359
|
-
case
|
|
2352
|
+
case Yt: {
|
|
2360
2353
|
let c = r.valueOf(), d = e.valueOf();
|
|
2361
|
-
return
|
|
2354
|
+
return go(c, d);
|
|
2362
2355
|
}
|
|
2363
|
-
case
|
|
2364
|
-
case
|
|
2365
|
-
case
|
|
2356
|
+
case Kt:
|
|
2357
|
+
case Jt:
|
|
2358
|
+
case Xt:
|
|
2366
2359
|
return Object.is(r.valueOf(), e.valueOf());
|
|
2367
|
-
case
|
|
2360
|
+
case Wt:
|
|
2368
2361
|
return r.source === e.source && r.flags === e.flags;
|
|
2369
|
-
case
|
|
2362
|
+
case ro:
|
|
2370
2363
|
return r === e;
|
|
2371
2364
|
}
|
|
2372
2365
|
t = t ?? /* @__PURE__ */ new Map();
|
|
@@ -2375,56 +2368,56 @@ function ze(r, e, t, o) {
|
|
|
2375
2368
|
return a === e;
|
|
2376
2369
|
t.set(r, e), t.set(e, r);
|
|
2377
2370
|
try {
|
|
2378
|
-
switch (
|
|
2379
|
-
case
|
|
2371
|
+
switch (n) {
|
|
2372
|
+
case Qt: {
|
|
2380
2373
|
if (r.size !== e.size)
|
|
2381
2374
|
return !1;
|
|
2382
2375
|
for (let [c, d] of r.entries())
|
|
2383
|
-
if (!e.has(c) || !
|
|
2376
|
+
if (!e.has(c) || !qe(d, e.get(c), c, r, e, t, o))
|
|
2384
2377
|
return !1;
|
|
2385
2378
|
return !0;
|
|
2386
2379
|
}
|
|
2387
|
-
case
|
|
2380
|
+
case Zt: {
|
|
2388
2381
|
if (r.size !== e.size)
|
|
2389
2382
|
return !1;
|
|
2390
2383
|
let c = Array.from(r.values()), d = Array.from(e.values());
|
|
2391
2384
|
for (let u = 0; u < c.length; u++) {
|
|
2392
|
-
let p = c[u], m = d.findIndex((h) =>
|
|
2385
|
+
let p = c[u], m = d.findIndex((h) => qe(p, h, void 0, r, e, t, o));
|
|
2393
2386
|
if (m === -1)
|
|
2394
2387
|
return !1;
|
|
2395
2388
|
d.splice(m, 1);
|
|
2396
2389
|
}
|
|
2397
2390
|
return !0;
|
|
2398
2391
|
}
|
|
2392
|
+
case eo:
|
|
2393
|
+
case so:
|
|
2394
|
+
case io:
|
|
2395
|
+
case ao:
|
|
2396
|
+
case lo:
|
|
2397
|
+
case co:
|
|
2399
2398
|
case po:
|
|
2400
|
-
case
|
|
2401
|
-
case
|
|
2402
|
-
case
|
|
2403
|
-
case
|
|
2404
|
-
case
|
|
2405
|
-
case xo:
|
|
2406
|
-
case Ro:
|
|
2407
|
-
case wo:
|
|
2408
|
-
case Ao:
|
|
2409
|
-
case Eo:
|
|
2410
|
-
case Co: {
|
|
2399
|
+
case uo:
|
|
2400
|
+
case fo:
|
|
2401
|
+
case yo:
|
|
2402
|
+
case mo:
|
|
2403
|
+
case ho: {
|
|
2411
2404
|
if (typeof Buffer < "u" && Buffer.isBuffer(r) !== Buffer.isBuffer(e) || r.length !== e.length)
|
|
2412
2405
|
return !1;
|
|
2413
2406
|
for (let c = 0; c < r.length; c++)
|
|
2414
|
-
if (!
|
|
2407
|
+
if (!qe(r[c], e[c], c, r, e, t, o))
|
|
2415
2408
|
return !1;
|
|
2416
2409
|
return !0;
|
|
2417
2410
|
}
|
|
2418
|
-
case
|
|
2419
|
-
return r.byteLength !== e.byteLength ? !1 :
|
|
2420
|
-
case
|
|
2421
|
-
return r.byteLength !== e.byteLength || r.byteOffset !== e.byteOffset ? !1 :
|
|
2422
|
-
case
|
|
2411
|
+
case to:
|
|
2412
|
+
return r.byteLength !== e.byteLength ? !1 : Be(new Uint8Array(r), new Uint8Array(e), t, o);
|
|
2413
|
+
case no:
|
|
2414
|
+
return r.byteLength !== e.byteLength || r.byteOffset !== e.byteOffset ? !1 : Be(new Uint8Array(r), new Uint8Array(e), t, o);
|
|
2415
|
+
case oo:
|
|
2423
2416
|
return r.name === e.name && r.message === e.message;
|
|
2424
|
-
case
|
|
2425
|
-
if (!(
|
|
2417
|
+
case ar: {
|
|
2418
|
+
if (!(Be(r.constructor, e.constructor, t, o) || N(r) && N(e)))
|
|
2426
2419
|
return !1;
|
|
2427
|
-
let d = [...Object.keys(r),
|
|
2420
|
+
let d = [...Object.keys(r), ...Wr(r)], u = [...Object.keys(e), ...Wr(e)];
|
|
2428
2421
|
if (d.length !== u.length)
|
|
2429
2422
|
return !1;
|
|
2430
2423
|
for (let p = 0; p < d.length; p++) {
|
|
@@ -2432,7 +2425,7 @@ function ze(r, e, t, o) {
|
|
|
2432
2425
|
if (!Object.hasOwn(e, m))
|
|
2433
2426
|
return !1;
|
|
2434
2427
|
let x = e[m];
|
|
2435
|
-
if (!
|
|
2428
|
+
if (!qe(h, x, m, r, e, t, o))
|
|
2436
2429
|
return !1;
|
|
2437
2430
|
}
|
|
2438
2431
|
return !0;
|
|
@@ -2444,47 +2437,21 @@ function ze(r, e, t, o) {
|
|
|
2444
2437
|
t.delete(r), t.delete(e);
|
|
2445
2438
|
}
|
|
2446
2439
|
}
|
|
2447
|
-
|
|
2440
|
+
s(Be, "areObjectsEqual");
|
|
2448
2441
|
|
|
2449
2442
|
// ../node_modules/es-toolkit/dist/predicate/isEqual.mjs
|
|
2450
|
-
function
|
|
2451
|
-
return
|
|
2443
|
+
function Xr(r, e) {
|
|
2444
|
+
return bo(r, e, Vt);
|
|
2452
2445
|
}
|
|
2453
|
-
|
|
2446
|
+
s(Xr, "isEqual");
|
|
2454
2447
|
|
|
2455
2448
|
// src/preview-api/modules/store/StoryStore.ts
|
|
2456
|
-
var
|
|
2457
|
-
|
|
2458
|
-
// src/shared/preview/core-annotations.ts
|
|
2459
|
-
var Zr = I(require("storybook/internal/component-testing/preview"), 1), et = I(require("storybook/actions/preview"), 1), rt = I(require("storybook/backgrounds/preview"), 1),
|
|
2460
|
-
tt = I(require("storybook/highlight/preview"), 1), ot = I(require("storybook/measure/preview"), 1), nt = I(require("storybook/outline/preview"), 1),
|
|
2461
|
-
st = I(require("storybook/test/preview"), 1), it = I(require("storybook/viewport/preview"), 1);
|
|
2462
|
-
function Ie() {
|
|
2463
|
-
return [
|
|
2464
|
-
// @ts-expect-error CJS fallback
|
|
2465
|
-
(ot.default.default ?? ot.default)(),
|
|
2466
|
-
// @ts-expect-error CJS fallback
|
|
2467
|
-
(rt.default.default ?? rt.default)(),
|
|
2468
|
-
// @ts-expect-error CJS fallback
|
|
2469
|
-
(tt.default.default ?? tt.default)(),
|
|
2470
|
-
// @ts-expect-error CJS fallback
|
|
2471
|
-
(nt.default.default ?? nt.default)(),
|
|
2472
|
-
// @ts-expect-error CJS fallback
|
|
2473
|
-
(it.default.default ?? it.default)(),
|
|
2474
|
-
// @ts-expect-error CJS fallback
|
|
2475
|
-
(et.default.default ?? et.default)(),
|
|
2476
|
-
// @ts-expect-error CJS fallback
|
|
2477
|
-
(Zr.default.default ?? Zr.default)(),
|
|
2478
|
-
// @ts-expect-error CJS fallback
|
|
2479
|
-
(st.default.default ?? st.default)()
|
|
2480
|
-
];
|
|
2481
|
-
}
|
|
2482
|
-
n(Ie, "getCoreAnnotations");
|
|
2449
|
+
var Ar = _(Jr(), 1);
|
|
2483
2450
|
|
|
2484
2451
|
// src/preview-api/modules/store/args.ts
|
|
2485
|
-
var
|
|
2486
|
-
var
|
|
2487
|
-
var
|
|
2452
|
+
var lr = require("storybook/internal/client-logger");
|
|
2453
|
+
var Qr = _($(), 1);
|
|
2454
|
+
var Ie = Symbol("incompatible"), Zr = /* @__PURE__ */ s((r, e) => {
|
|
2488
2455
|
let t = e.type;
|
|
2489
2456
|
if (r == null || !t || e.mapping)
|
|
2490
2457
|
return r;
|
|
@@ -2498,97 +2465,97 @@ var Oe = Symbol("incompatible"), lt = /* @__PURE__ */ n((r, e) => {
|
|
|
2498
2465
|
case "boolean":
|
|
2499
2466
|
return String(r) === "true";
|
|
2500
2467
|
case "array":
|
|
2501
|
-
return !t.value || !Array.isArray(r) ?
|
|
2502
|
-
let a =
|
|
2503
|
-
return a !==
|
|
2468
|
+
return !t.value || !Array.isArray(r) ? Ie : r.reduce((o, n, i) => {
|
|
2469
|
+
let a = Zr(n, { type: t.value });
|
|
2470
|
+
return a !== Ie && (o[i] = a), o;
|
|
2504
2471
|
}, new Array(r.length));
|
|
2505
2472
|
case "object":
|
|
2506
|
-
return typeof r == "string" || typeof r == "number" ? r : !t.value || typeof r != "object" ?
|
|
2507
|
-
let a =
|
|
2508
|
-
return a ===
|
|
2473
|
+
return typeof r == "string" || typeof r == "number" ? r : !t.value || typeof r != "object" ? Ie : Object.entries(r).reduce((o, [n, i]) => {
|
|
2474
|
+
let a = Zr(i, { type: t.value[n] });
|
|
2475
|
+
return a === Ie ? o : Object.assign(o, { [n]: a });
|
|
2509
2476
|
}, {});
|
|
2510
2477
|
default:
|
|
2511
|
-
return
|
|
2478
|
+
return Ie;
|
|
2512
2479
|
}
|
|
2513
|
-
}, "map"),
|
|
2480
|
+
}, "map"), Co = /* @__PURE__ */ s((r, e) => Object.entries(r).reduce((t, [o, n]) => {
|
|
2514
2481
|
if (!e[o])
|
|
2515
2482
|
return t;
|
|
2516
|
-
let i =
|
|
2517
|
-
return i ===
|
|
2518
|
-
}, {}), "mapArgsToTypes"),
|
|
2519
|
-
(t, o,
|
|
2483
|
+
let i = Zr(n, e[o]);
|
|
2484
|
+
return i === Ie ? t : Object.assign(t, { [o]: i });
|
|
2485
|
+
}, {}), "mapArgsToTypes"), Oe = /* @__PURE__ */ s((r, e) => Array.isArray(r) && Array.isArray(e) ? e.reduce(
|
|
2486
|
+
(t, o, n) => (t[n] = Oe(r[n], e[n]), t),
|
|
2520
2487
|
[...r]
|
|
2521
2488
|
).filter((t) => t !== void 0) : !N(r) || !N(e) ? e : Object.keys({ ...r, ...e }).reduce((t, o) => {
|
|
2522
2489
|
if (o in e) {
|
|
2523
|
-
let
|
|
2524
|
-
|
|
2490
|
+
let n = Oe(r[o], e[o]);
|
|
2491
|
+
n !== void 0 && (t[o] = n);
|
|
2525
2492
|
} else
|
|
2526
2493
|
t[o] = r[o];
|
|
2527
2494
|
return t;
|
|
2528
|
-
}, {}), "combineArgs"),
|
|
2495
|
+
}, {}), "combineArgs"), vo = /* @__PURE__ */ s((r, e) => Object.entries(e).reduce((t, [o, { options: n }]) => {
|
|
2529
2496
|
function i() {
|
|
2530
2497
|
return o in r && (t[o] = r[o]), t;
|
|
2531
2498
|
}
|
|
2532
|
-
if (
|
|
2499
|
+
if (s(i, "allowArg"), !n)
|
|
2533
2500
|
return i();
|
|
2534
|
-
if (!Array.isArray(
|
|
2535
|
-
return
|
|
2501
|
+
if (!Array.isArray(n))
|
|
2502
|
+
return lr.once.error(Qr.dedent`
|
|
2536
2503
|
Invalid argType: '${o}.options' should be an array.
|
|
2537
2504
|
|
|
2538
2505
|
More info: https://storybook.js.org/docs/api/arg-types
|
|
2539
2506
|
`), i();
|
|
2540
|
-
if (
|
|
2541
|
-
return
|
|
2507
|
+
if (n.some((p) => p && ["object", "function"].includes(typeof p)))
|
|
2508
|
+
return lr.once.error(Qr.dedent`
|
|
2542
2509
|
Invalid argType: '${o}.options' should only contain primitives. Use a 'mapping' for complex values.
|
|
2543
2510
|
|
|
2544
2511
|
More info: https://storybook.js.org/docs/writing-stories/args#mapping-to-complex-arg-values
|
|
2545
2512
|
`), i();
|
|
2546
|
-
let a = Array.isArray(r[o]), l = a && r[o].findIndex((p) => !
|
|
2547
|
-
if (r[o] === void 0 ||
|
|
2513
|
+
let a = Array.isArray(r[o]), l = a && r[o].findIndex((p) => !n.includes(p)), c = a && l === -1;
|
|
2514
|
+
if (r[o] === void 0 || n.includes(r[o]) || c)
|
|
2548
2515
|
return i();
|
|
2549
|
-
let d = a ? `${o}[${l}]` : o, u =
|
|
2550
|
-
return
|
|
2551
|
-
}, {}), "validateOptions"), pe = Symbol("Deeply equal"),
|
|
2516
|
+
let d = a ? `${o}[${l}]` : o, u = n.map((p) => typeof p == "string" ? `'${p}'` : String(p)).join(", ");
|
|
2517
|
+
return lr.once.warn(`Received illegal value for '${d}'. Supported options: ${u}`), t;
|
|
2518
|
+
}, {}), "validateOptions"), pe = Symbol("Deeply equal"), De = /* @__PURE__ */ s((r, e) => {
|
|
2552
2519
|
if (typeof r != typeof e)
|
|
2553
2520
|
return e;
|
|
2554
|
-
if (
|
|
2521
|
+
if (Xr(r, e))
|
|
2555
2522
|
return pe;
|
|
2556
2523
|
if (Array.isArray(r) && Array.isArray(e)) {
|
|
2557
|
-
let t = e.reduce((o,
|
|
2558
|
-
let a =
|
|
2524
|
+
let t = e.reduce((o, n, i) => {
|
|
2525
|
+
let a = De(r[i], n);
|
|
2559
2526
|
return a !== pe && (o[i] = a), o;
|
|
2560
2527
|
}, new Array(e.length));
|
|
2561
2528
|
return e.length >= r.length ? t : t.concat(new Array(r.length - e.length).fill(void 0));
|
|
2562
2529
|
}
|
|
2563
2530
|
return N(r) && N(e) ? Object.keys({ ...r, ...e }).reduce((t, o) => {
|
|
2564
|
-
let
|
|
2565
|
-
return
|
|
2531
|
+
let n = De(r?.[o], e?.[o]);
|
|
2532
|
+
return n === pe ? t : Object.assign(t, { [o]: n });
|
|
2566
2533
|
}, {}) : e;
|
|
2567
|
-
}, "deepDiff"),
|
|
2568
|
-
function
|
|
2534
|
+
}, "deepDiff"), et = "UNTARGETED";
|
|
2535
|
+
function Po({
|
|
2569
2536
|
args: r,
|
|
2570
2537
|
argTypes: e
|
|
2571
2538
|
}) {
|
|
2572
2539
|
let t = {};
|
|
2573
|
-
return Object.entries(r).forEach(([o,
|
|
2574
|
-
let { target: i =
|
|
2575
|
-
t[i] = t[i] || {}, t[i][o] =
|
|
2540
|
+
return Object.entries(r).forEach(([o, n]) => {
|
|
2541
|
+
let { target: i = et } = e[o] || {};
|
|
2542
|
+
t[i] = t[i] || {}, t[i][o] = n;
|
|
2576
2543
|
}), t;
|
|
2577
2544
|
}
|
|
2578
|
-
|
|
2545
|
+
s(Po, "groupArgsByTarget");
|
|
2579
2546
|
|
|
2580
2547
|
// src/preview-api/modules/store/ArgsStore.ts
|
|
2581
|
-
function
|
|
2548
|
+
function Ws(r) {
|
|
2582
2549
|
return Object.keys(r).forEach((e) => r[e] === void 0 && delete r[e]), r;
|
|
2583
2550
|
}
|
|
2584
|
-
|
|
2585
|
-
var
|
|
2551
|
+
s(Ws, "deleteUndefined");
|
|
2552
|
+
var cr = class {
|
|
2586
2553
|
constructor() {
|
|
2587
2554
|
this.initialArgsByStoryId = {};
|
|
2588
2555
|
this.argsByStoryId = {};
|
|
2589
2556
|
}
|
|
2590
2557
|
static {
|
|
2591
|
-
|
|
2558
|
+
s(this, "ArgsStore");
|
|
2592
2559
|
}
|
|
2593
2560
|
get(e) {
|
|
2594
2561
|
if (!(e in this.argsByStoryId))
|
|
@@ -2599,22 +2566,22 @@ var dr = class {
|
|
|
2599
2566
|
if (!this.initialArgsByStoryId[e.id])
|
|
2600
2567
|
this.initialArgsByStoryId[e.id] = e.initialArgs, this.argsByStoryId[e.id] = e.initialArgs;
|
|
2601
2568
|
else if (this.initialArgsByStoryId[e.id] !== e.initialArgs) {
|
|
2602
|
-
let t =
|
|
2569
|
+
let t = De(this.initialArgsByStoryId[e.id], this.argsByStoryId[e.id]);
|
|
2603
2570
|
this.initialArgsByStoryId[e.id] = e.initialArgs, this.argsByStoryId[e.id] = e.initialArgs, t !== pe && this.updateFromDelta(e, t);
|
|
2604
2571
|
}
|
|
2605
2572
|
}
|
|
2606
2573
|
updateFromDelta(e, t) {
|
|
2607
|
-
let o =
|
|
2608
|
-
this.argsByStoryId[e.id] =
|
|
2574
|
+
let o = vo(t, e.argTypes);
|
|
2575
|
+
this.argsByStoryId[e.id] = Oe(this.argsByStoryId[e.id], o);
|
|
2609
2576
|
}
|
|
2610
2577
|
updateFromPersisted(e, t) {
|
|
2611
|
-
let o =
|
|
2578
|
+
let o = Co(t, e.argTypes);
|
|
2612
2579
|
return this.updateFromDelta(e, o);
|
|
2613
2580
|
}
|
|
2614
2581
|
update(e, t) {
|
|
2615
2582
|
if (!(e in this.argsByStoryId))
|
|
2616
2583
|
throw new Error(`No args known for ${e} -- has it been rendered yet?`);
|
|
2617
|
-
this.argsByStoryId[e] =
|
|
2584
|
+
this.argsByStoryId[e] = Ws({
|
|
2618
2585
|
...this.argsByStoryId[e],
|
|
2619
2586
|
...t
|
|
2620
2587
|
});
|
|
@@ -2622,16 +2589,16 @@ var dr = class {
|
|
|
2622
2589
|
};
|
|
2623
2590
|
|
|
2624
2591
|
// src/preview-api/modules/store/GlobalsStore.ts
|
|
2625
|
-
var
|
|
2592
|
+
var Fo = require("storybook/internal/client-logger");
|
|
2626
2593
|
|
|
2627
2594
|
// src/preview-api/modules/store/csf/getValuesFromArgTypes.ts
|
|
2628
|
-
var
|
|
2595
|
+
var dr = /* @__PURE__ */ s((r = {}) => Object.entries(r).reduce((e, [t, { defaultValue: o }]) => (typeof o < "u" && (e[t] = o), e), {}), "ge\
|
|
2629
2596
|
tValuesFromArgTypes");
|
|
2630
2597
|
|
|
2631
2598
|
// src/preview-api/modules/store/GlobalsStore.ts
|
|
2632
|
-
var
|
|
2599
|
+
var pr = class {
|
|
2633
2600
|
static {
|
|
2634
|
-
|
|
2601
|
+
s(this, "GlobalsStore");
|
|
2635
2602
|
}
|
|
2636
2603
|
constructor({
|
|
2637
2604
|
globals: e = {},
|
|
@@ -2640,13 +2607,13 @@ var ur = class {
|
|
|
2640
2607
|
this.set({ globals: e, globalTypes: t });
|
|
2641
2608
|
}
|
|
2642
2609
|
set({ globals: e = {}, globalTypes: t = {} }) {
|
|
2643
|
-
let o = this.initialGlobals &&
|
|
2610
|
+
let o = this.initialGlobals && De(this.initialGlobals, this.globals);
|
|
2644
2611
|
this.allowedGlobalNames = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)]);
|
|
2645
|
-
let
|
|
2646
|
-
this.initialGlobals = { ...
|
|
2612
|
+
let n = dr(t);
|
|
2613
|
+
this.initialGlobals = { ...n, ...e }, this.globals = this.initialGlobals, o && o !== pe && this.updateFromPersisted(o);
|
|
2647
2614
|
}
|
|
2648
2615
|
filterAllowedGlobals(e) {
|
|
2649
|
-
return Object.entries(e).reduce((t, [o,
|
|
2616
|
+
return Object.entries(e).reduce((t, [o, n]) => (this.allowedGlobalNames.has(o) ? t[o] = n : Fo.logger.warn(
|
|
2650
2617
|
`Attempted to set a global (${o}) that is not defined in initial globals or globalTypes`
|
|
2651
2618
|
), t), {});
|
|
2652
2619
|
}
|
|
@@ -2665,15 +2632,15 @@ var ur = class {
|
|
|
2665
2632
|
};
|
|
2666
2633
|
|
|
2667
2634
|
// src/preview-api/modules/store/StoryIndexStore.ts
|
|
2668
|
-
var
|
|
2669
|
-
var
|
|
2635
|
+
var Io = require("storybook/internal/preview-errors"), Oo = _(Jr(), 1);
|
|
2636
|
+
var $s = (0, Oo.default)(1)(
|
|
2670
2637
|
(r) => Object.values(r).reduce(
|
|
2671
2638
|
(e, t) => (e[t.importPath] = e[t.importPath] || t, e),
|
|
2672
2639
|
{}
|
|
2673
2640
|
)
|
|
2674
|
-
),
|
|
2641
|
+
), ur = class {
|
|
2675
2642
|
static {
|
|
2676
|
-
|
|
2643
|
+
s(this, "StoryIndexStore");
|
|
2677
2644
|
}
|
|
2678
2645
|
constructor({ entries: e } = { v: 5, entries: {} }) {
|
|
2679
2646
|
this.entries = e;
|
|
@@ -2684,47 +2651,47 @@ var ri = (0, zo.default)(1)(
|
|
|
2684
2651
|
return t[0];
|
|
2685
2652
|
if (typeof e == "string")
|
|
2686
2653
|
return this.entries[e] ? this.entries[e] : t.find((i) => i.id.startsWith(e));
|
|
2687
|
-
let { name: o, title:
|
|
2688
|
-
return t.find((i) => i.name === o && i.title ===
|
|
2654
|
+
let { name: o, title: n } = e;
|
|
2655
|
+
return t.find((i) => i.name === o && i.title === n);
|
|
2689
2656
|
}
|
|
2690
2657
|
storyIdToEntry(e) {
|
|
2691
2658
|
let t = this.entries[e];
|
|
2692
2659
|
if (!t)
|
|
2693
|
-
throw new
|
|
2660
|
+
throw new Io.MissingStoryAfterHmrError({ storyId: e });
|
|
2694
2661
|
return t;
|
|
2695
2662
|
}
|
|
2696
2663
|
importPathToEntry(e) {
|
|
2697
|
-
return
|
|
2664
|
+
return $s(this.entries)[e];
|
|
2698
2665
|
}
|
|
2699
2666
|
};
|
|
2700
2667
|
|
|
2701
2668
|
// src/preview-api/modules/store/csf/normalizeInputTypes.ts
|
|
2702
|
-
var
|
|
2703
|
-
g" ? { type: r } : r, "normalizeControl"),
|
|
2704
|
-
let { type: t, control: o, ...
|
|
2669
|
+
var Ys = /* @__PURE__ */ s((r) => typeof r == "string" ? { name: r } : r, "normalizeType"), Ks = /* @__PURE__ */ s((r) => typeof r == "strin\
|
|
2670
|
+
g" ? { type: r } : r, "normalizeControl"), Xs = /* @__PURE__ */ s((r, e) => {
|
|
2671
|
+
let { type: t, control: o, ...n } = r, i = {
|
|
2705
2672
|
name: e,
|
|
2706
|
-
...
|
|
2673
|
+
...n
|
|
2707
2674
|
};
|
|
2708
|
-
return t && (i.type =
|
|
2709
|
-
}, "normalizeInputType"), ue = /* @__PURE__ */
|
|
2675
|
+
return t && (i.type = Ys(t)), o ? i.control = Ks(o) : o === !1 && (i.control = { disable: !0 }), i;
|
|
2676
|
+
}, "normalizeInputType"), ue = /* @__PURE__ */ s((r) => Q(r, Xs), "normalizeInputTypes");
|
|
2710
2677
|
|
|
2711
2678
|
// src/preview-api/modules/store/csf/normalizeStory.ts
|
|
2712
|
-
var
|
|
2679
|
+
var fr = require("storybook/internal/client-logger"), yr = require("storybook/internal/csf"), Do = _($(), 1);
|
|
2713
2680
|
|
|
2714
2681
|
// src/preview-api/modules/store/csf/normalizeArrays.ts
|
|
2715
|
-
var v = /* @__PURE__ */
|
|
2682
|
+
var v = /* @__PURE__ */ s((r) => Array.isArray(r) ? r : r ? [r] : [], "normalizeArrays");
|
|
2716
2683
|
|
|
2717
2684
|
// src/preview-api/modules/store/csf/normalizeStory.ts
|
|
2718
|
-
var
|
|
2685
|
+
var Js = Do.dedent`
|
|
2719
2686
|
CSF .story annotations deprecated; annotate story functions directly:
|
|
2720
2687
|
- StoryFn.story.name => StoryFn.storyName
|
|
2721
2688
|
- StoryFn.story.(parameters|decorators) => StoryFn.(parameters|decorators)
|
|
2722
2689
|
See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#hoisted-csf-annotations for details and codemod.
|
|
2723
2690
|
`;
|
|
2724
2691
|
function fe(r, e, t) {
|
|
2725
|
-
let o = e,
|
|
2726
|
-
i && (
|
|
2727
|
-
let a = (0,
|
|
2692
|
+
let o = e, n = typeof e == "function" ? e : null, { story: i } = o;
|
|
2693
|
+
i && (fr.logger.debug("deprecated story", i), (0, fr.deprecate)(Js));
|
|
2694
|
+
let a = (0, yr.storyNameFromExport)(r), l = typeof o != "function" && o.name || o.storyName || i?.name || a, c = [
|
|
2728
2695
|
...v(o.decorators),
|
|
2729
2696
|
...v(i?.decorators)
|
|
2730
2697
|
], d = { ...i?.parameters, ...o.parameters }, u = { ...i?.args, ...o.args }, p = { ...i?.argTypes, ...o.argTypes }, m = [...v(o.loaders), ...v(
|
|
@@ -2734,7 +2701,7 @@ function fe(r, e, t) {
|
|
|
2734
2701
|
], x = [
|
|
2735
2702
|
...v(o.afterEach),
|
|
2736
2703
|
...v(i?.afterEach)
|
|
2737
|
-
], { render: R, play: y, tags: b = [], globals: w = {} } = o, f = d.__id || (0,
|
|
2704
|
+
], { render: R, play: y, tags: b = [], globals: w = {} } = o, f = d.__id || (0, yr.toId)(t.id, a);
|
|
2738
2705
|
return {
|
|
2739
2706
|
moduleExport: e,
|
|
2740
2707
|
id: f,
|
|
@@ -2749,97 +2716,97 @@ function fe(r, e, t) {
|
|
|
2749
2716
|
afterEach: x,
|
|
2750
2717
|
globals: w,
|
|
2751
2718
|
...R && { render: R },
|
|
2752
|
-
...
|
|
2719
|
+
...n && { userStoryFn: n },
|
|
2753
2720
|
...y && { play: y }
|
|
2754
2721
|
};
|
|
2755
2722
|
}
|
|
2756
|
-
|
|
2723
|
+
s(fe, "normalizeStory");
|
|
2757
2724
|
|
|
2758
2725
|
// src/preview-api/modules/store/csf/processCSFFile.ts
|
|
2759
|
-
var
|
|
2726
|
+
var rt = require("storybook/internal/client-logger"), Ue = require("storybook/internal/csf");
|
|
2760
2727
|
|
|
2761
2728
|
// src/preview-api/modules/store/csf/normalizeComponentAnnotations.ts
|
|
2762
|
-
var
|
|
2763
|
-
function
|
|
2764
|
-
let { id: o, argTypes:
|
|
2729
|
+
var ko = require("storybook/internal/csf");
|
|
2730
|
+
function Ge(r, e = r.title, t) {
|
|
2731
|
+
let { id: o, argTypes: n } = r;
|
|
2765
2732
|
return {
|
|
2766
|
-
id: (0,
|
|
2733
|
+
id: (0, ko.sanitize)(o || e),
|
|
2767
2734
|
...r,
|
|
2768
2735
|
title: e,
|
|
2769
|
-
...
|
|
2736
|
+
...n && { argTypes: ue(n) },
|
|
2770
2737
|
parameters: {
|
|
2771
2738
|
fileName: t,
|
|
2772
2739
|
...r.parameters
|
|
2773
2740
|
}
|
|
2774
2741
|
};
|
|
2775
2742
|
}
|
|
2776
|
-
|
|
2743
|
+
s(Ge, "normalizeComponentAnnotations");
|
|
2777
2744
|
|
|
2778
2745
|
// src/preview-api/modules/store/csf/processCSFFile.ts
|
|
2779
|
-
var
|
|
2746
|
+
var Qs = /* @__PURE__ */ s((r) => {
|
|
2780
2747
|
let { globals: e, globalTypes: t } = r;
|
|
2781
|
-
(e || t) &&
|
|
2748
|
+
(e || t) && rt.logger.error(
|
|
2782
2749
|
"Global args/argTypes can only be set globally",
|
|
2783
2750
|
JSON.stringify({
|
|
2784
2751
|
globals: e,
|
|
2785
2752
|
globalTypes: t
|
|
2786
2753
|
})
|
|
2787
2754
|
);
|
|
2788
|
-
}, "checkGlobals"),
|
|
2755
|
+
}, "checkGlobals"), Zs = /* @__PURE__ */ s((r) => {
|
|
2789
2756
|
let { options: e } = r;
|
|
2790
|
-
e?.storySort &&
|
|
2791
|
-
}, "checkStorySort"),
|
|
2792
|
-
r && (
|
|
2757
|
+
e?.storySort && rt.logger.error("The storySort option parameter can only be set globally");
|
|
2758
|
+
}, "checkStorySort"), mr = /* @__PURE__ */ s((r) => {
|
|
2759
|
+
r && (Qs(r), Zs(r));
|
|
2793
2760
|
}, "checkDisallowedParameters");
|
|
2794
|
-
function
|
|
2795
|
-
let { default: o, __namedExportsOrder:
|
|
2796
|
-
if ((0,
|
|
2797
|
-
let d =
|
|
2798
|
-
|
|
2761
|
+
function Mo(r, e, t) {
|
|
2762
|
+
let { default: o, __namedExportsOrder: n, ...i } = r, a = Object.values(i)[0];
|
|
2763
|
+
if ((0, Ue.isStory)(a)) {
|
|
2764
|
+
let d = Ge(a.meta.input, t, e);
|
|
2765
|
+
mr(d.parameters);
|
|
2799
2766
|
let u = { meta: d, stories: {}, moduleExports: r };
|
|
2800
2767
|
return Object.keys(i).forEach((p) => {
|
|
2801
|
-
if ((0,
|
|
2768
|
+
if ((0, Ue.isExportStory)(p, d)) {
|
|
2802
2769
|
let m = fe(p, i[p].input, d);
|
|
2803
|
-
|
|
2770
|
+
mr(m.parameters), u.stories[m.id] = m;
|
|
2804
2771
|
}
|
|
2805
2772
|
}), u.projectAnnotations = a.meta.preview.composed, u;
|
|
2806
2773
|
}
|
|
2807
|
-
let l =
|
|
2774
|
+
let l = Ge(
|
|
2808
2775
|
o,
|
|
2809
2776
|
t,
|
|
2810
2777
|
e
|
|
2811
2778
|
);
|
|
2812
|
-
|
|
2779
|
+
mr(l.parameters);
|
|
2813
2780
|
let c = { meta: l, stories: {}, moduleExports: r };
|
|
2814
2781
|
return Object.keys(i).forEach((d) => {
|
|
2815
|
-
if ((0,
|
|
2782
|
+
if ((0, Ue.isExportStory)(d, l)) {
|
|
2816
2783
|
let u = fe(d, i[d], l);
|
|
2817
|
-
|
|
2784
|
+
mr(u.parameters), c.stories[u.id] = u;
|
|
2818
2785
|
}
|
|
2819
2786
|
}), c;
|
|
2820
2787
|
}
|
|
2821
|
-
|
|
2788
|
+
s(Mo, "processCSFFile");
|
|
2822
2789
|
|
|
2823
2790
|
// src/preview-api/modules/store/csf/prepareStory.ts
|
|
2824
|
-
var
|
|
2791
|
+
var gr = require("storybook/internal/csf"), No = require("storybook/internal/preview-errors"), Lo = require("@storybook/global"), qo = require("@storybook/global");
|
|
2825
2792
|
|
|
2826
2793
|
// src/preview-api/modules/preview-web/render/mount-utils.ts
|
|
2827
|
-
function
|
|
2828
|
-
return r != null &&
|
|
2794
|
+
function _o(r) {
|
|
2795
|
+
return r != null && ei(r).includes("mount");
|
|
2829
2796
|
}
|
|
2830
|
-
|
|
2831
|
-
function
|
|
2797
|
+
s(_o, "mountDestructured");
|
|
2798
|
+
function ei(r) {
|
|
2832
2799
|
let e = r.toString().match(/[^(]*\(([^)]*)/);
|
|
2833
2800
|
if (!e)
|
|
2834
2801
|
return [];
|
|
2835
|
-
let t =
|
|
2802
|
+
let t = jo(e[1]);
|
|
2836
2803
|
if (!t.length)
|
|
2837
2804
|
return [];
|
|
2838
2805
|
let o = t[0];
|
|
2839
|
-
return o.startsWith("{") && o.endsWith("}") ?
|
|
2806
|
+
return o.startsWith("{") && o.endsWith("}") ? jo(o.slice(1, -1).replace(/\s/g, "")).map((i) => i.replace(/:.*|=.*/g, "")) : [];
|
|
2840
2807
|
}
|
|
2841
|
-
|
|
2842
|
-
function
|
|
2808
|
+
s(ei, "getUsedProps");
|
|
2809
|
+
function jo(r) {
|
|
2843
2810
|
let e = [], t = [], o = 0;
|
|
2844
2811
|
for (let i = 0; i < r.length; i++)
|
|
2845
2812
|
if (r[i] === "{" || r[i] === "[")
|
|
@@ -2850,23 +2817,23 @@ function Vo(r) {
|
|
|
2850
2817
|
let a = r.substring(o, i).trim();
|
|
2851
2818
|
a && e.push(a), o = i + 1;
|
|
2852
2819
|
}
|
|
2853
|
-
let
|
|
2854
|
-
return
|
|
2820
|
+
let n = r.substring(o).trim();
|
|
2821
|
+
return n && e.push(n), e;
|
|
2855
2822
|
}
|
|
2856
|
-
|
|
2823
|
+
s(jo, "splitByComma");
|
|
2857
2824
|
|
|
2858
2825
|
// src/preview-api/modules/store/decorators.ts
|
|
2859
|
-
function
|
|
2826
|
+
function tt(r, e, t) {
|
|
2860
2827
|
let o = t(r);
|
|
2861
|
-
return (
|
|
2828
|
+
return (n) => e(o, n);
|
|
2862
2829
|
}
|
|
2863
|
-
|
|
2864
|
-
function
|
|
2830
|
+
s(tt, "decorateStory");
|
|
2831
|
+
function ot({
|
|
2865
2832
|
componentId: r,
|
|
2866
2833
|
title: e,
|
|
2867
2834
|
kind: t,
|
|
2868
2835
|
id: o,
|
|
2869
|
-
name:
|
|
2836
|
+
name: n,
|
|
2870
2837
|
story: i,
|
|
2871
2838
|
parameters: a,
|
|
2872
2839
|
initialArgs: l,
|
|
@@ -2875,42 +2842,42 @@ function ut({
|
|
|
2875
2842
|
} = {}) {
|
|
2876
2843
|
return d;
|
|
2877
2844
|
}
|
|
2878
|
-
|
|
2879
|
-
function
|
|
2880
|
-
let t = {}, o = /* @__PURE__ */
|
|
2845
|
+
s(ot, "sanitizeStoryContextUpdate");
|
|
2846
|
+
function hr(r, e) {
|
|
2847
|
+
let t = {}, o = /* @__PURE__ */ s((i) => (a) => {
|
|
2881
2848
|
if (!t.value)
|
|
2882
2849
|
throw new Error("Decorated function called without init");
|
|
2883
2850
|
return t.value = {
|
|
2884
2851
|
...t.value,
|
|
2885
|
-
...
|
|
2852
|
+
...ot(a)
|
|
2886
2853
|
}, i(t.value);
|
|
2887
|
-
}, "bindWithContext"),
|
|
2888
|
-
(i, a) =>
|
|
2854
|
+
}, "bindWithContext"), n = e.reduce(
|
|
2855
|
+
(i, a) => tt(i, a, o),
|
|
2889
2856
|
r
|
|
2890
2857
|
);
|
|
2891
|
-
return (i) => (t.value = i,
|
|
2858
|
+
return (i) => (t.value = i, n(i));
|
|
2892
2859
|
}
|
|
2893
|
-
|
|
2860
|
+
s(hr, "defaultDecorateStory");
|
|
2894
2861
|
|
|
2895
2862
|
// src/preview-api/modules/store/parameters.ts
|
|
2896
|
-
var B = /* @__PURE__ */
|
|
2897
|
-
let e = {}, t = r.filter(Boolean), o = t.reduce((
|
|
2898
|
-
let c =
|
|
2899
|
-
Array.isArray(l) || typeof c > "u" ?
|
|
2900
|
-
}),
|
|
2901
|
-
return Object.keys(e).forEach((
|
|
2902
|
-
let i = t.filter(Boolean).map((a) => a[
|
|
2903
|
-
i.every((a) => N(a)) ? o[
|
|
2863
|
+
var B = /* @__PURE__ */ s((...r) => {
|
|
2864
|
+
let e = {}, t = r.filter(Boolean), o = t.reduce((n, i) => (Object.entries(i).forEach(([a, l]) => {
|
|
2865
|
+
let c = n[a];
|
|
2866
|
+
Array.isArray(l) || typeof c > "u" ? n[a] = l : N(l) && N(c) ? e[a] = !0 : typeof l < "u" && (n[a] = l);
|
|
2867
|
+
}), n), {});
|
|
2868
|
+
return Object.keys(e).forEach((n) => {
|
|
2869
|
+
let i = t.filter(Boolean).map((a) => a[n]).filter((a) => typeof a < "u");
|
|
2870
|
+
i.every((a) => N(a)) ? o[n] = B(...i) : o[n] = i[i.length - 1];
|
|
2904
2871
|
}), o;
|
|
2905
2872
|
}, "combineParameters");
|
|
2906
2873
|
|
|
2907
2874
|
// src/preview-api/modules/store/csf/prepareStory.ts
|
|
2908
|
-
function
|
|
2909
|
-
let { moduleExport: o, id:
|
|
2875
|
+
function ke(r, e, t) {
|
|
2876
|
+
let { moduleExport: o, id: n, name: i } = r || {}, a = Bo(
|
|
2910
2877
|
r,
|
|
2911
2878
|
e,
|
|
2912
2879
|
t
|
|
2913
|
-
), l = /* @__PURE__ */
|
|
2880
|
+
), l = /* @__PURE__ */ s(async (S) => {
|
|
2914
2881
|
let C = {};
|
|
2915
2882
|
for (let M of [
|
|
2916
2883
|
v(t.loaders),
|
|
@@ -2919,11 +2886,11 @@ function je(r, e, t) {
|
|
|
2919
2886
|
]) {
|
|
2920
2887
|
if (S.abortSignal.aborted)
|
|
2921
2888
|
return C;
|
|
2922
|
-
let
|
|
2923
|
-
Object.assign(C, ...
|
|
2889
|
+
let j = await Promise.all(M.map((G) => G(S)));
|
|
2890
|
+
Object.assign(C, ...j);
|
|
2924
2891
|
}
|
|
2925
2892
|
return C;
|
|
2926
|
-
}, "applyLoaders"), c = /* @__PURE__ */
|
|
2893
|
+
}, "applyLoaders"), c = /* @__PURE__ */ s(async (S) => {
|
|
2927
2894
|
let C = new Array();
|
|
2928
2895
|
for (let M of [
|
|
2929
2896
|
...v(t.beforeEach),
|
|
@@ -2932,11 +2899,11 @@ function je(r, e, t) {
|
|
|
2932
2899
|
]) {
|
|
2933
2900
|
if (S.abortSignal.aborted)
|
|
2934
2901
|
return C;
|
|
2935
|
-
let
|
|
2936
|
-
|
|
2902
|
+
let j = await M(S);
|
|
2903
|
+
j && C.push(j);
|
|
2937
2904
|
}
|
|
2938
2905
|
return C;
|
|
2939
|
-
}, "applyBeforeEach"), d = /* @__PURE__ */
|
|
2906
|
+
}, "applyBeforeEach"), d = /* @__PURE__ */ s(async (S) => {
|
|
2940
2907
|
let C = [
|
|
2941
2908
|
...v(t.afterEach),
|
|
2942
2909
|
...v(e.afterEach),
|
|
@@ -2947,22 +2914,22 @@ function je(r, e, t) {
|
|
|
2947
2914
|
return;
|
|
2948
2915
|
await M(S);
|
|
2949
2916
|
}
|
|
2950
|
-
}, "applyAfterEach"), u = /* @__PURE__ */
|
|
2917
|
+
}, "applyAfterEach"), u = /* @__PURE__ */ s((S) => S.originalStoryFn(S.args, S), "undecoratedStoryFn"), { applyDecorators: p = hr, runStep: m } = t,
|
|
2951
2918
|
h = [
|
|
2952
2919
|
...v(r?.decorators),
|
|
2953
2920
|
...v(e?.decorators),
|
|
2954
2921
|
...v(t?.decorators)
|
|
2955
|
-
], x = r?.userStoryFn || r?.render || e.render || t.render, R =
|
|
2956
|
-
play ?? e?.play, w =
|
|
2922
|
+
], x = r?.userStoryFn || r?.render || e.render || t.render, R = sr(p)(u, h), y = /* @__PURE__ */ s((S) => R(S), "unboundStoryFn"), b = r?.
|
|
2923
|
+
play ?? e?.play, w = _o(b);
|
|
2957
2924
|
if (!x && !w)
|
|
2958
|
-
throw new
|
|
2959
|
-
let f = /* @__PURE__ */
|
|
2925
|
+
throw new No.NoRenderFunctionError({ id: n });
|
|
2926
|
+
let f = /* @__PURE__ */ s((S) => async () => (await S.renderToCanvas(), S.canvas), "defaultMount"), g = r.mount ?? e.mount ?? t.mount ?? f,
|
|
2960
2927
|
A = t.testingLibraryRender;
|
|
2961
2928
|
return {
|
|
2962
2929
|
storyGlobals: {},
|
|
2963
2930
|
...a,
|
|
2964
2931
|
moduleExport: o,
|
|
2965
|
-
id:
|
|
2932
|
+
id: n,
|
|
2966
2933
|
name: i,
|
|
2967
2934
|
story: i,
|
|
2968
2935
|
originalStoryFn: x,
|
|
@@ -2979,18 +2946,18 @@ function je(r, e, t) {
|
|
|
2979
2946
|
usesMount: w
|
|
2980
2947
|
};
|
|
2981
2948
|
}
|
|
2982
|
-
|
|
2983
|
-
function
|
|
2949
|
+
s(ke, "prepareStory");
|
|
2950
|
+
function br(r, e, t) {
|
|
2984
2951
|
return {
|
|
2985
|
-
...
|
|
2952
|
+
...Bo(void 0, r, e),
|
|
2986
2953
|
moduleExport: t
|
|
2987
2954
|
};
|
|
2988
2955
|
}
|
|
2989
|
-
|
|
2990
|
-
function
|
|
2991
|
-
let o = ["dev", "test"],
|
|
2956
|
+
s(br, "prepareMeta");
|
|
2957
|
+
function Bo(r, e, t) {
|
|
2958
|
+
let o = ["dev", "test"], n = qo.global.DOCS_OPTIONS?.autodocs === !0 ? ["autodocs"] : [], i = (0, gr.combineTags)(
|
|
2992
2959
|
...o,
|
|
2993
|
-
...
|
|
2960
|
+
...n,
|
|
2994
2961
|
...t.tags ?? [],
|
|
2995
2962
|
...e.tags ?? [],
|
|
2996
2963
|
...r?.tags ?? []
|
|
@@ -3050,42 +3017,42 @@ function Xo(r, e, t) {
|
|
|
3050
3017
|
let { name: x, story: R, ...y } = m;
|
|
3051
3018
|
return y;
|
|
3052
3019
|
}
|
|
3053
|
-
|
|
3054
|
-
function
|
|
3020
|
+
s(Bo, "preparePartialAnnotations");
|
|
3021
|
+
function Sr(r) {
|
|
3055
3022
|
let { args: e } = r, t = {
|
|
3056
3023
|
...r,
|
|
3057
3024
|
allArgs: void 0,
|
|
3058
3025
|
argsByTarget: void 0
|
|
3059
3026
|
};
|
|
3060
|
-
if (
|
|
3061
|
-
let i =
|
|
3027
|
+
if (Lo.global.FEATURES?.argTypeTargetsV7) {
|
|
3028
|
+
let i = Po(r);
|
|
3062
3029
|
t = {
|
|
3063
3030
|
...r,
|
|
3064
3031
|
allArgs: r.args,
|
|
3065
3032
|
argsByTarget: i,
|
|
3066
|
-
args: i[
|
|
3033
|
+
args: i[et] || {}
|
|
3067
3034
|
};
|
|
3068
3035
|
}
|
|
3069
3036
|
let o = Object.entries(t.args).reduce((i, [a, l]) => {
|
|
3070
3037
|
if (!t.argTypes[a]?.mapping)
|
|
3071
3038
|
return i[a] = l, i;
|
|
3072
|
-
let c = /* @__PURE__ */
|
|
3039
|
+
let c = /* @__PURE__ */ s((d) => {
|
|
3073
3040
|
let u = t.argTypes[a].mapping;
|
|
3074
3041
|
return u && d in u ? u[d] : d;
|
|
3075
3042
|
}, "mappingFn");
|
|
3076
3043
|
return i[a] = Array.isArray(l) ? l.map(c) : c(l), i;
|
|
3077
|
-
}, {}),
|
|
3044
|
+
}, {}), n = Object.entries(o).reduce((i, [a, l]) => {
|
|
3078
3045
|
let c = t.argTypes[a] || {};
|
|
3079
|
-
return (0,
|
|
3046
|
+
return (0, gr.includeConditionalArg)(c, o, t.globals) && (i[a] = l), i;
|
|
3080
3047
|
}, {});
|
|
3081
|
-
return { ...t, unmappedArgs: e, args:
|
|
3048
|
+
return { ...t, unmappedArgs: e, args: n };
|
|
3082
3049
|
}
|
|
3083
|
-
|
|
3050
|
+
s(Sr, "prepareContext");
|
|
3084
3051
|
|
|
3085
3052
|
// src/preview-api/modules/store/inferArgTypes.ts
|
|
3086
|
-
var
|
|
3087
|
-
var
|
|
3088
|
-
var
|
|
3053
|
+
var zo = require("storybook/internal/client-logger");
|
|
3054
|
+
var Go = _($(), 1);
|
|
3055
|
+
var nt = /* @__PURE__ */ s((r, e, t) => {
|
|
3089
3056
|
let o = typeof r;
|
|
3090
3057
|
switch (o) {
|
|
3091
3058
|
case "boolean":
|
|
@@ -3097,44 +3064,44 @@ var ft = /* @__PURE__ */ n((r, e, t) => {
|
|
|
3097
3064
|
default:
|
|
3098
3065
|
break;
|
|
3099
3066
|
}
|
|
3100
|
-
return r ? t.has(r) ? (
|
|
3067
|
+
return r ? t.has(r) ? (zo.logger.warn(Go.dedent`
|
|
3101
3068
|
We've detected a cycle in arg '${e}'. Args should be JSON-serializable.
|
|
3102
3069
|
|
|
3103
3070
|
Consider using the mapping feature or fully custom args:
|
|
3104
3071
|
- Mapping: https://storybook.js.org/docs/writing-stories/args#mapping-to-complex-arg-values
|
|
3105
3072
|
- Custom args: https://storybook.js.org/docs/essentials/controls#fully-custom-args
|
|
3106
|
-
`), { name: "other", value: "cyclic object" }) : (t.add(r), Array.isArray(r) ? { name: "array", value: r.length > 0 ?
|
|
3107
|
-
t)) : { name: "other", value: "unknown" } } : { name: "object", value: Q(r, (i) =>
|
|
3108
|
-
}, "inferType"),
|
|
3109
|
-
let { id: e, argTypes: t = {}, initialArgs: o = {} } = r,
|
|
3073
|
+
`), { name: "other", value: "cyclic object" }) : (t.add(r), Array.isArray(r) ? { name: "array", value: r.length > 0 ? nt(r[0], e, new Set(
|
|
3074
|
+
t)) : { name: "other", value: "unknown" } } : { name: "object", value: Q(r, (i) => nt(i, e, new Set(t))) }) : { name: "object", value: {} };
|
|
3075
|
+
}, "inferType"), st = /* @__PURE__ */ s((r) => {
|
|
3076
|
+
let { id: e, argTypes: t = {}, initialArgs: o = {} } = r, n = Q(o, (a, l) => ({
|
|
3110
3077
|
name: l,
|
|
3111
|
-
type:
|
|
3078
|
+
type: nt(a, `${e}.${l}`, /* @__PURE__ */ new Set())
|
|
3112
3079
|
})), i = Q(t, (a, l) => ({
|
|
3113
3080
|
name: l
|
|
3114
3081
|
}));
|
|
3115
|
-
return B(
|
|
3082
|
+
return B(n, i, t);
|
|
3116
3083
|
}, "inferArgTypes");
|
|
3117
|
-
|
|
3084
|
+
st.secondPass = !0;
|
|
3118
3085
|
|
|
3119
3086
|
// src/preview-api/modules/store/inferControls.ts
|
|
3120
|
-
var
|
|
3087
|
+
var Ho = require("storybook/internal/client-logger");
|
|
3121
3088
|
|
|
3122
3089
|
// src/preview-api/modules/store/filterArgTypes.ts
|
|
3123
|
-
var
|
|
3124
|
-
r : r &&
|
|
3125
|
-
let i = o.name ||
|
|
3126
|
-
return !!(!e ||
|
|
3090
|
+
var Uo = /* @__PURE__ */ s((r, e) => Array.isArray(e) ? e.includes(r) : r.match(e), "matches"), He = /* @__PURE__ */ s((r, e, t) => !e && !t ?
|
|
3091
|
+
r : r && Kr(r, (o, n) => {
|
|
3092
|
+
let i = o.name || n.toString();
|
|
3093
|
+
return !!(!e || Uo(i, e)) && (!t || !Uo(i, t));
|
|
3127
3094
|
}), "filterArgTypes");
|
|
3128
3095
|
|
|
3129
3096
|
// src/preview-api/modules/store/inferControls.ts
|
|
3130
|
-
var
|
|
3131
|
-
let { type: o, options:
|
|
3097
|
+
var ri = /* @__PURE__ */ s((r, e, t) => {
|
|
3098
|
+
let { type: o, options: n } = r;
|
|
3132
3099
|
if (o) {
|
|
3133
3100
|
if (t.color && t.color.test(e)) {
|
|
3134
3101
|
let i = o.name;
|
|
3135
3102
|
if (i === "string")
|
|
3136
3103
|
return { control: { type: "color" } };
|
|
3137
|
-
i !== "enum" &&
|
|
3104
|
+
i !== "enum" && Ho.logger.warn(
|
|
3138
3105
|
`Addon controls: Control of type color only supports string, received "${i}" instead`
|
|
3139
3106
|
);
|
|
3140
3107
|
}
|
|
@@ -3157,17 +3124,17 @@ var ci = /* @__PURE__ */ n((r, e, t) => {
|
|
|
3157
3124
|
case "symbol":
|
|
3158
3125
|
return null;
|
|
3159
3126
|
default:
|
|
3160
|
-
return { control: { type:
|
|
3127
|
+
return { control: { type: n ? "select" : "object" } };
|
|
3161
3128
|
}
|
|
3162
3129
|
}
|
|
3163
|
-
}, "inferControl"), Me = /* @__PURE__ */
|
|
3130
|
+
}, "inferControl"), Me = /* @__PURE__ */ s((r) => {
|
|
3164
3131
|
let {
|
|
3165
3132
|
argTypes: e,
|
|
3166
|
-
parameters: { __isArgsStory: t, controls: { include: o = null, exclude:
|
|
3133
|
+
parameters: { __isArgsStory: t, controls: { include: o = null, exclude: n = null, matchers: i = {} } = {} }
|
|
3167
3134
|
} = r;
|
|
3168
3135
|
if (!t)
|
|
3169
3136
|
return e;
|
|
3170
|
-
let a =
|
|
3137
|
+
let a = He(e, o, n), l = Q(a, (c, d) => c?.type && ri(c, d.toString(), i));
|
|
3171
3138
|
return B(l, a);
|
|
3172
3139
|
}, "inferControls");
|
|
3173
3140
|
Me.secondPass = !0;
|
|
@@ -3178,7 +3145,7 @@ function ye({
|
|
|
3178
3145
|
globalTypes: e,
|
|
3179
3146
|
argTypesEnhancers: t,
|
|
3180
3147
|
decorators: o,
|
|
3181
|
-
loaders:
|
|
3148
|
+
loaders: n,
|
|
3182
3149
|
beforeEach: i,
|
|
3183
3150
|
afterEach: a,
|
|
3184
3151
|
initialGlobals: l,
|
|
@@ -3188,12 +3155,12 @@ function ye({
|
|
|
3188
3155
|
...r && { argTypes: ue(r) },
|
|
3189
3156
|
...e && { globalTypes: ue(e) },
|
|
3190
3157
|
decorators: v(o),
|
|
3191
|
-
loaders: v(
|
|
3158
|
+
loaders: v(n),
|
|
3192
3159
|
beforeEach: v(i),
|
|
3193
3160
|
afterEach: v(a),
|
|
3194
3161
|
argTypesEnhancers: [
|
|
3195
3162
|
...t || [],
|
|
3196
|
-
|
|
3163
|
+
st,
|
|
3197
3164
|
// There's an architectural decision to be made regarding embedded addons in core:
|
|
3198
3165
|
//
|
|
3199
3166
|
// Option 1: Keep embedded addons but ensure consistency by moving addon-specific code
|
|
@@ -3215,13 +3182,13 @@ function ye({
|
|
|
3215
3182
|
...c
|
|
3216
3183
|
};
|
|
3217
3184
|
}
|
|
3218
|
-
|
|
3185
|
+
s(ye, "normalizeProjectAnnotations");
|
|
3219
3186
|
|
|
3220
3187
|
// src/preview-api/modules/store/csf/composeConfigs.ts
|
|
3221
|
-
var
|
|
3188
|
+
var Wo = require("@storybook/global");
|
|
3222
3189
|
|
|
3223
3190
|
// src/preview-api/modules/store/csf/beforeAll.ts
|
|
3224
|
-
var
|
|
3191
|
+
var Vo = /* @__PURE__ */ s((r) => async () => {
|
|
3225
3192
|
let e = [];
|
|
3226
3193
|
for (let t of r) {
|
|
3227
3194
|
let o = await t();
|
|
@@ -3234,7 +3201,7 @@ var rn = /* @__PURE__ */ n((r) => async () => {
|
|
|
3234
3201
|
}, "composeBeforeAllHooks");
|
|
3235
3202
|
|
|
3236
3203
|
// src/preview-api/modules/store/csf/stepRunners.ts
|
|
3237
|
-
function
|
|
3204
|
+
function Tr(r) {
|
|
3238
3205
|
return async (e, t, o) => {
|
|
3239
3206
|
await r.reduceRight(
|
|
3240
3207
|
(i, a) => async () => a(e, i, o),
|
|
@@ -3242,64 +3209,64 @@ function xr(r) {
|
|
|
3242
3209
|
)();
|
|
3243
3210
|
};
|
|
3244
3211
|
}
|
|
3245
|
-
|
|
3212
|
+
s(Tr, "composeStepRunners");
|
|
3246
3213
|
|
|
3247
3214
|
// src/preview-api/modules/store/csf/composeConfigs.ts
|
|
3248
|
-
function
|
|
3215
|
+
function We(r, e) {
|
|
3249
3216
|
return r.map((t) => t.default?.[e] ?? t[e]).filter(Boolean);
|
|
3250
3217
|
}
|
|
3251
|
-
|
|
3218
|
+
s(We, "getField");
|
|
3252
3219
|
function ne(r, e, t = {}) {
|
|
3253
|
-
return
|
|
3254
|
-
let i = v(
|
|
3220
|
+
return We(r, e).reduce((o, n) => {
|
|
3221
|
+
let i = v(n);
|
|
3255
3222
|
return t.reverseFileOrder ? [...i, ...o] : [...o, ...i];
|
|
3256
3223
|
}, []);
|
|
3257
3224
|
}
|
|
3258
|
-
|
|
3259
|
-
function
|
|
3260
|
-
return Object.assign({},
|
|
3225
|
+
s(ne, "getArrayField");
|
|
3226
|
+
function xr(r, e) {
|
|
3227
|
+
return Object.assign({}, ...We(r, e));
|
|
3261
3228
|
}
|
|
3262
|
-
|
|
3263
|
-
function
|
|
3264
|
-
return
|
|
3229
|
+
s(xr, "getObjectField");
|
|
3230
|
+
function Ve(r, e) {
|
|
3231
|
+
return We(r, e).pop();
|
|
3265
3232
|
}
|
|
3266
|
-
|
|
3233
|
+
s(Ve, "getSingletonField");
|
|
3267
3234
|
function Z(r) {
|
|
3268
|
-
let e = ne(r, "argTypesEnhancers"), t =
|
|
3235
|
+
let e = ne(r, "argTypesEnhancers"), t = We(r, "runStep"), o = ne(r, "beforeAll");
|
|
3269
3236
|
return {
|
|
3270
|
-
parameters: B(
|
|
3237
|
+
parameters: B(...We(r, "parameters")),
|
|
3271
3238
|
decorators: ne(r, "decorators", {
|
|
3272
|
-
reverseFileOrder: !(
|
|
3239
|
+
reverseFileOrder: !(Wo.global.FEATURES?.legacyDecoratorFileOrder ?? !1)
|
|
3273
3240
|
}),
|
|
3274
|
-
args:
|
|
3241
|
+
args: xr(r, "args"),
|
|
3275
3242
|
argsEnhancers: ne(r, "argsEnhancers"),
|
|
3276
|
-
argTypes:
|
|
3243
|
+
argTypes: xr(r, "argTypes"),
|
|
3277
3244
|
argTypesEnhancers: [
|
|
3278
|
-
...e.filter((
|
|
3279
|
-
...e.filter((
|
|
3245
|
+
...e.filter((n) => !n.secondPass),
|
|
3246
|
+
...e.filter((n) => n.secondPass)
|
|
3280
3247
|
],
|
|
3281
|
-
initialGlobals:
|
|
3282
|
-
globalTypes:
|
|
3248
|
+
initialGlobals: xr(r, "initialGlobals"),
|
|
3249
|
+
globalTypes: xr(r, "globalTypes"),
|
|
3283
3250
|
loaders: ne(r, "loaders"),
|
|
3284
|
-
beforeAll:
|
|
3251
|
+
beforeAll: Vo(o),
|
|
3285
3252
|
beforeEach: ne(r, "beforeEach"),
|
|
3286
3253
|
afterEach: ne(r, "afterEach"),
|
|
3287
|
-
render:
|
|
3288
|
-
renderToCanvas:
|
|
3289
|
-
applyDecorators:
|
|
3290
|
-
runStep:
|
|
3254
|
+
render: Ve(r, "render"),
|
|
3255
|
+
renderToCanvas: Ve(r, "renderToCanvas"),
|
|
3256
|
+
applyDecorators: Ve(r, "applyDecorators"),
|
|
3257
|
+
runStep: Tr(t),
|
|
3291
3258
|
tags: ne(r, "tags"),
|
|
3292
|
-
mount:
|
|
3293
|
-
testingLibraryRender:
|
|
3259
|
+
mount: Ve(r, "mount"),
|
|
3260
|
+
testingLibraryRender: Ve(r, "testingLibraryRender")
|
|
3294
3261
|
};
|
|
3295
3262
|
}
|
|
3296
|
-
|
|
3263
|
+
s(Z, "composeConfigs");
|
|
3297
3264
|
|
|
3298
3265
|
// src/preview-api/modules/store/csf/portable-stories.ts
|
|
3299
|
-
var
|
|
3266
|
+
var Ko = require("storybook/internal/csf"), Xo = require("storybook/internal/csf"), Jo = require("storybook/internal/preview-errors"), Qo = _($(), 1);
|
|
3300
3267
|
|
|
3301
3268
|
// src/preview-api/modules/preview-web/render/animation-utils.ts
|
|
3302
|
-
function
|
|
3269
|
+
function Rr() {
|
|
3303
3270
|
try {
|
|
3304
3271
|
return (
|
|
3305
3272
|
// @ts-expect-error this property exists in certain environments
|
|
@@ -3310,7 +3277,7 @@ function wr() {
|
|
|
3310
3277
|
return !1;
|
|
3311
3278
|
}
|
|
3312
3279
|
}
|
|
3313
|
-
|
|
3280
|
+
s(Rr, "isTestEnvironment");
|
|
3314
3281
|
function me(r = !0) {
|
|
3315
3282
|
if (!("document" in globalThis && "createElement" in globalThis.document))
|
|
3316
3283
|
return () => {
|
|
@@ -3329,7 +3296,7 @@ function me(r = !0) {
|
|
|
3329
3296
|
t.parentNode?.removeChild(t);
|
|
3330
3297
|
};
|
|
3331
3298
|
}
|
|
3332
|
-
|
|
3299
|
+
s(me, "pauseAnimations");
|
|
3333
3300
|
async function he(r) {
|
|
3334
3301
|
if (!("document" in globalThis && "getAnimations" in globalThis.document && "querySelectorAll" in globalThis.document))
|
|
3335
3302
|
return;
|
|
@@ -3339,13 +3306,13 @@ async function he(r) {
|
|
|
3339
3306
|
// If new animations are created while waiting, we'll wait for them too
|
|
3340
3307
|
new Promise((t) => {
|
|
3341
3308
|
setTimeout(() => {
|
|
3342
|
-
let o = [globalThis.document,
|
|
3309
|
+
let o = [globalThis.document, ...$o(globalThis.document)], n = /* @__PURE__ */ s(async () => {
|
|
3343
3310
|
if (e || r?.aborted)
|
|
3344
3311
|
return;
|
|
3345
|
-
let i = o.flatMap((a) => a?.getAnimations?.() || []).filter((a) => a.playState === "running" && !
|
|
3346
|
-
i.length > 0 && (await Promise.all(i.map((a) => a.finished)), await
|
|
3312
|
+
let i = o.flatMap((a) => a?.getAnimations?.() || []).filter((a) => a.playState === "running" && !ti(a));
|
|
3313
|
+
i.length > 0 && (await Promise.all(i.map((a) => a.finished)), await n());
|
|
3347
3314
|
}, "checkAnimationsFinished");
|
|
3348
|
-
|
|
3315
|
+
n().then(t);
|
|
3349
3316
|
}, 100);
|
|
3350
3317
|
}),
|
|
3351
3318
|
// If animations don't finish within the timeout, continue without waiting
|
|
@@ -3356,20 +3323,20 @@ async function he(r) {
|
|
|
3356
3323
|
)
|
|
3357
3324
|
]);
|
|
3358
3325
|
}
|
|
3359
|
-
|
|
3360
|
-
function
|
|
3361
|
-
return [r, ...r.querySelectorAll("*")].reduce((e, t) => ("shadowRoot" in t && t.shadowRoot && e.push(t.shadowRoot,
|
|
3326
|
+
s(he, "waitForAnimations");
|
|
3327
|
+
function $o(r) {
|
|
3328
|
+
return [r, ...r.querySelectorAll("*")].reduce((e, t) => ("shadowRoot" in t && t.shadowRoot && e.push(t.shadowRoot, ...$o(t.shadowRoot)), e),
|
|
3362
3329
|
[]);
|
|
3363
3330
|
}
|
|
3364
|
-
|
|
3365
|
-
function
|
|
3331
|
+
s($o, "getShadowRoots");
|
|
3332
|
+
function ti(r) {
|
|
3366
3333
|
if (r instanceof CSSAnimation && r.effect instanceof KeyframeEffect && r.effect.target) {
|
|
3367
3334
|
let e = getComputedStyle(r.effect.target, r.effect.pseudoElement), t = e.animationName?.split(", ").indexOf(r.animationName);
|
|
3368
3335
|
return e.animationIterationCount.split(", ")[t] === "infinite";
|
|
3369
3336
|
}
|
|
3370
3337
|
return !1;
|
|
3371
3338
|
}
|
|
3372
|
-
|
|
3339
|
+
s(ti, "isInfiniteAnimation");
|
|
3373
3340
|
|
|
3374
3341
|
// src/preview-api/modules/store/reporter-api.ts
|
|
3375
3342
|
var se = class {
|
|
@@ -3377,7 +3344,7 @@ var se = class {
|
|
|
3377
3344
|
this.reports = [];
|
|
3378
3345
|
}
|
|
3379
3346
|
static {
|
|
3380
|
-
|
|
3347
|
+
s(this, "ReporterAPI");
|
|
3381
3348
|
}
|
|
3382
3349
|
async addReport(e) {
|
|
3383
3350
|
this.reports.push(e);
|
|
@@ -3385,41 +3352,41 @@ var se = class {
|
|
|
3385
3352
|
};
|
|
3386
3353
|
|
|
3387
3354
|
// src/preview-api/modules/store/csf/csf-factory-utils.ts
|
|
3388
|
-
var
|
|
3389
|
-
function
|
|
3390
|
-
return (0,
|
|
3355
|
+
var Yo = require("storybook/internal/csf");
|
|
3356
|
+
function wr(r, e, t) {
|
|
3357
|
+
return (0, Yo.isStory)(r) ? {
|
|
3391
3358
|
story: r.input,
|
|
3392
3359
|
meta: r.meta.input,
|
|
3393
3360
|
preview: r.meta.preview.composed
|
|
3394
3361
|
} : { story: r, meta: e, preview: t };
|
|
3395
3362
|
}
|
|
3396
|
-
|
|
3363
|
+
s(wr, "getCsfFactoryAnnotations");
|
|
3397
3364
|
|
|
3398
3365
|
// src/preview-api/modules/store/csf/portable-stories.ts
|
|
3399
|
-
function
|
|
3366
|
+
function Zo(r) {
|
|
3400
3367
|
globalThis.defaultProjectAnnotations = r;
|
|
3401
3368
|
}
|
|
3402
|
-
|
|
3403
|
-
var
|
|
3404
|
-
function
|
|
3369
|
+
s(Zo, "setDefaultProjectAnnotations");
|
|
3370
|
+
var oi = "ComposedStory", ni = "Unnamed Story";
|
|
3371
|
+
function si(r) {
|
|
3405
3372
|
return r ? Z([r]) : {};
|
|
3406
3373
|
}
|
|
3407
|
-
|
|
3408
|
-
function
|
|
3374
|
+
s(si, "extractAnnotation");
|
|
3375
|
+
function en(r) {
|
|
3409
3376
|
let e = Array.isArray(r) ? r : [r];
|
|
3410
3377
|
return globalThis.globalProjectAnnotations = Z([
|
|
3411
|
-
...
|
|
3378
|
+
...(0, Xo.getCoreAnnotations)(),
|
|
3412
3379
|
globalThis.defaultProjectAnnotations ?? {},
|
|
3413
|
-
Z(e.map(
|
|
3380
|
+
Z(e.map(si))
|
|
3414
3381
|
]), globalThis.globalProjectAnnotations ?? {};
|
|
3415
3382
|
}
|
|
3416
|
-
|
|
3383
|
+
s(en, "setProjectAnnotations");
|
|
3417
3384
|
var ie = [];
|
|
3418
|
-
function
|
|
3385
|
+
function it(r, e, t, o, n) {
|
|
3419
3386
|
if (r === void 0)
|
|
3420
3387
|
throw new Error("Expected a story but received undefined.");
|
|
3421
|
-
e.title = e.title ??
|
|
3422
|
-
let i =
|
|
3388
|
+
e.title = e.title ?? oi;
|
|
3389
|
+
let i = Ge(e), a = n || r.storyName || r.story?.name || r.name || ni, l = fe(
|
|
3423
3390
|
a,
|
|
3424
3391
|
r,
|
|
3425
3392
|
i
|
|
@@ -3428,16 +3395,16 @@ function mt(r, e, t, o, s) {
|
|
|
3428
3395
|
o ?? globalThis.globalProjectAnnotations ?? {},
|
|
3429
3396
|
t ?? {}
|
|
3430
3397
|
])
|
|
3431
|
-
), d =
|
|
3398
|
+
), d = ke(
|
|
3432
3399
|
l,
|
|
3433
3400
|
i,
|
|
3434
3401
|
c
|
|
3435
3402
|
), p = {
|
|
3436
|
-
...
|
|
3403
|
+
...dr(c.globalTypes),
|
|
3437
3404
|
...c.initialGlobals,
|
|
3438
3405
|
...d.storyGlobals
|
|
3439
|
-
}, m = new se(), h = /* @__PURE__ */
|
|
3440
|
-
let f =
|
|
3406
|
+
}, m = new se(), h = /* @__PURE__ */ s(() => {
|
|
3407
|
+
let f = Sr({
|
|
3441
3408
|
hooks: new te(),
|
|
3442
3409
|
globals: p,
|
|
3443
3410
|
args: { ...d.initialArgs },
|
|
@@ -3445,7 +3412,7 @@ function mt(r, e, t, o, s) {
|
|
|
3445
3412
|
reporting: m,
|
|
3446
3413
|
loaded: {},
|
|
3447
3414
|
abortSignal: new AbortController().signal,
|
|
3448
|
-
step: /* @__PURE__ */
|
|
3415
|
+
step: /* @__PURE__ */ s((g, A) => d.runStep(g, A, f), "step"),
|
|
3449
3416
|
canvasElement: null,
|
|
3450
3417
|
canvas: {},
|
|
3451
3418
|
userEvent: {},
|
|
@@ -3462,33 +3429,33 @@ function mt(r, e, t, o, s) {
|
|
|
3462
3429
|
id: d.id,
|
|
3463
3430
|
name: d.name,
|
|
3464
3431
|
tags: d.tags,
|
|
3465
|
-
showMain: /* @__PURE__ */
|
|
3432
|
+
showMain: /* @__PURE__ */ s(() => {
|
|
3466
3433
|
}, "showMain"),
|
|
3467
|
-
showError: /* @__PURE__ */
|
|
3434
|
+
showError: /* @__PURE__ */ s((A) => {
|
|
3468
3435
|
throw new Error(`${A.title}
|
|
3469
3436
|
${A.description}`);
|
|
3470
3437
|
}, "showError"),
|
|
3471
|
-
showException: /* @__PURE__ */
|
|
3438
|
+
showException: /* @__PURE__ */ s((A) => {
|
|
3472
3439
|
throw A;
|
|
3473
3440
|
}, "showException"),
|
|
3474
3441
|
forceRemount: !0,
|
|
3475
3442
|
storyContext: f,
|
|
3476
|
-
storyFn: /* @__PURE__ */
|
|
3443
|
+
storyFn: /* @__PURE__ */ s(() => d.unboundStoryFn(f), "storyFn"),
|
|
3477
3444
|
unboundStoryFn: d.unboundStoryFn
|
|
3478
3445
|
},
|
|
3479
3446
|
f.canvasElement
|
|
3480
3447
|
);
|
|
3481
3448
|
g && ie.push(g);
|
|
3482
3449
|
}), f.mount = d.mount(f), f;
|
|
3483
|
-
}, "initializeContext"), x, R = /* @__PURE__ */
|
|
3450
|
+
}, "initializeContext"), x, R = /* @__PURE__ */ s(async (f) => {
|
|
3484
3451
|
let g = h();
|
|
3485
3452
|
return g.canvasElement ??= globalThis?.document?.body, x && (g.loaded = x.loaded), Object.assign(g, f), d.playFunction(g);
|
|
3486
|
-
}, "play"), y = /* @__PURE__ */
|
|
3453
|
+
}, "play"), y = /* @__PURE__ */ s((f) => {
|
|
3487
3454
|
let g = h();
|
|
3488
|
-
return Object.assign(g, f),
|
|
3455
|
+
return Object.assign(g, f), ai(d, g);
|
|
3489
3456
|
}, "run"), b = d.playFunction ? R : void 0;
|
|
3490
3457
|
return Object.assign(
|
|
3491
|
-
/* @__PURE__ */
|
|
3458
|
+
/* @__PURE__ */ s(function(g) {
|
|
3492
3459
|
let A = h();
|
|
3493
3460
|
return x && (A.loaded = x.loaded), A.args = {
|
|
3494
3461
|
...A.initialArgs,
|
|
@@ -3498,7 +3465,7 @@ ${A.description}`);
|
|
|
3498
3465
|
{
|
|
3499
3466
|
id: d.id,
|
|
3500
3467
|
storyName: a,
|
|
3501
|
-
load: /* @__PURE__ */
|
|
3468
|
+
load: /* @__PURE__ */ s(async () => {
|
|
3502
3469
|
for (let g of [...ie].reverse())
|
|
3503
3470
|
await g();
|
|
3504
3471
|
ie.length = 0;
|
|
@@ -3516,27 +3483,27 @@ ${A.description}`);
|
|
|
3516
3483
|
}
|
|
3517
3484
|
);
|
|
3518
3485
|
}
|
|
3519
|
-
|
|
3520
|
-
var
|
|
3521
|
-
function
|
|
3522
|
-
let { default: o, __esModule:
|
|
3486
|
+
s(it, "composeStory");
|
|
3487
|
+
var ii = /* @__PURE__ */ s((r, e, t, o) => it(r, e, t, {}, o), "defaultComposeStory");
|
|
3488
|
+
function rn(r, e, t = ii) {
|
|
3489
|
+
let { default: o, __esModule: n, __namedExportsOrder: i, ...a } = r, l = o;
|
|
3523
3490
|
return Object.entries(a).reduce(
|
|
3524
3491
|
(d, [u, p]) => {
|
|
3525
|
-
let { story: m, meta: h } =
|
|
3526
|
-
return !l && h && (l = h), (0,
|
|
3492
|
+
let { story: m, meta: h } = wr(p);
|
|
3493
|
+
return !l && h && (l = h), (0, Ko.isExportStory)(u, l) ? Object.assign(d, {
|
|
3527
3494
|
[u]: t(m, l, e, u)
|
|
3528
3495
|
}) : d;
|
|
3529
3496
|
},
|
|
3530
3497
|
{}
|
|
3531
3498
|
);
|
|
3532
3499
|
}
|
|
3533
|
-
|
|
3534
|
-
function
|
|
3500
|
+
s(rn, "composeStories");
|
|
3501
|
+
function tn(r) {
|
|
3535
3502
|
return r.extend({
|
|
3536
|
-
mount: /* @__PURE__ */
|
|
3537
|
-
await o(async (
|
|
3538
|
-
if (!("__pw_type" in
|
|
3539
|
-
throw new Error(
|
|
3503
|
+
mount: /* @__PURE__ */ s(async ({ mount: e, page: t }, o) => {
|
|
3504
|
+
await o(async (n, ...i) => {
|
|
3505
|
+
if (!("__pw_type" in n) || "__pw_type" in n && n.__pw_type !== "jsx")
|
|
3506
|
+
throw new Error(Qo.dedent`
|
|
3540
3507
|
Portable stories in Playwright CT only work when referencing JSX elements.
|
|
3541
3508
|
Please use JSX format for your components such as:
|
|
3542
3509
|
|
|
@@ -3551,18 +3518,18 @@ function un(r) {
|
|
|
3551
3518
|
await t.evaluate(async (l) => {
|
|
3552
3519
|
let c = await globalThis.__pwUnwrapObject?.(l);
|
|
3553
3520
|
return ("__pw_type" in c ? c.type : c)?.load?.();
|
|
3554
|
-
},
|
|
3555
|
-
let a = await e(
|
|
3521
|
+
}, n);
|
|
3522
|
+
let a = await e(n, ...i);
|
|
3556
3523
|
return await t.evaluate(async (l) => {
|
|
3557
3524
|
let c = await globalThis.__pwUnwrapObject?.(l), d = "__pw_type" in c ? c.type : c, u = document.querySelector("#root");
|
|
3558
3525
|
return d?.play?.({ canvasElement: u });
|
|
3559
|
-
},
|
|
3526
|
+
}, n), a;
|
|
3560
3527
|
});
|
|
3561
3528
|
}, "mount")
|
|
3562
3529
|
});
|
|
3563
3530
|
}
|
|
3564
|
-
|
|
3565
|
-
async function
|
|
3531
|
+
s(tn, "createPlaywrightTest");
|
|
3532
|
+
async function ai(r, e) {
|
|
3566
3533
|
for (let i of [...ie].reverse())
|
|
3567
3534
|
await i();
|
|
3568
3535
|
if (ie.length = 0, !e.canvasElement) {
|
|
@@ -3578,26 +3545,26 @@ async function mi(r, e) {
|
|
|
3578
3545
|
if (o || await e.mount(), e.abortSignal.aborted)
|
|
3579
3546
|
return;
|
|
3580
3547
|
t && (o || (e.mount = async () => {
|
|
3581
|
-
throw new
|
|
3548
|
+
throw new Jo.MountMustBeDestructuredError({ playFunction: t.toString() });
|
|
3582
3549
|
}), await t(e));
|
|
3583
|
-
let
|
|
3584
|
-
|
|
3550
|
+
let n;
|
|
3551
|
+
Rr() ? n = me() : await he(e.abortSignal), await r.applyAfterEach(e), await n?.();
|
|
3585
3552
|
}
|
|
3586
|
-
|
|
3553
|
+
s(ai, "runStory");
|
|
3587
3554
|
|
|
3588
3555
|
// src/preview-api/modules/store/StoryStore.ts
|
|
3589
|
-
var
|
|
3556
|
+
var on = 1e3, li = 1e4, ge = class {
|
|
3590
3557
|
constructor(e, t, o) {
|
|
3591
3558
|
this.importFn = t;
|
|
3592
|
-
this.storyIndex = new
|
|
3593
|
-
Z([...
|
|
3559
|
+
this.storyIndex = new ur(e), this.projectAnnotations = ye(
|
|
3560
|
+
Z([...(0, nn.getCoreAnnotations)(), o])
|
|
3594
3561
|
);
|
|
3595
|
-
let { initialGlobals:
|
|
3596
|
-
this.args = new
|
|
3597
|
-
(0,
|
|
3562
|
+
let { initialGlobals: n, globalTypes: i } = this.projectAnnotations;
|
|
3563
|
+
this.args = new cr(), this.userGlobals = new pr({ globals: n, globalTypes: i }), this.hooks = {}, this.cleanupCallbacks = {}, this.processCSFFileWithCache =
|
|
3564
|
+
(0, Ar.default)(on)(Mo), this.prepareMetaWithCache = (0, Ar.default)(on)(br), this.prepareStoryWithCache = (0, Ar.default)(li)(ke);
|
|
3598
3565
|
}
|
|
3599
3566
|
static {
|
|
3600
|
-
|
|
3567
|
+
s(this, "StoryStore");
|
|
3601
3568
|
}
|
|
3602
3569
|
setProjectAnnotations(e) {
|
|
3603
3570
|
this.projectAnnotations = ye(e);
|
|
@@ -3620,20 +3587,20 @@ var fn = 1e3, hi = 1e4, ge = class {
|
|
|
3620
3587
|
}
|
|
3621
3588
|
// To load a single CSF file to service a story we need to look up the importPath in the index
|
|
3622
3589
|
async loadCSFFileByStoryId(e) {
|
|
3623
|
-
let { importPath: t, title: o } = this.storyIndex.storyIdToEntry(e),
|
|
3624
|
-
return this.processCSFFileWithCache(
|
|
3590
|
+
let { importPath: t, title: o } = this.storyIndex.storyIdToEntry(e), n = await this.importFn(t);
|
|
3591
|
+
return this.processCSFFileWithCache(n, t, o);
|
|
3625
3592
|
}
|
|
3626
3593
|
async loadAllCSFFiles() {
|
|
3627
3594
|
let e = {};
|
|
3628
|
-
return Object.entries(this.storyIndex.entries).forEach(([o, { importPath:
|
|
3629
|
-
e[
|
|
3595
|
+
return Object.entries(this.storyIndex.entries).forEach(([o, { importPath: n }]) => {
|
|
3596
|
+
e[n] = o;
|
|
3630
3597
|
}), (await Promise.all(
|
|
3631
|
-
Object.entries(e).map(async ([o,
|
|
3598
|
+
Object.entries(e).map(async ([o, n]) => ({
|
|
3632
3599
|
importPath: o,
|
|
3633
|
-
csfFile: await this.loadCSFFileByStoryId(
|
|
3600
|
+
csfFile: await this.loadCSFFileByStoryId(n)
|
|
3634
3601
|
}))
|
|
3635
3602
|
)).reduce(
|
|
3636
|
-
(o, { importPath:
|
|
3603
|
+
(o, { importPath: n, csfFile: i }) => (o[n] = i, o),
|
|
3637
3604
|
{}
|
|
3638
3605
|
);
|
|
3639
3606
|
}
|
|
@@ -3661,10 +3628,10 @@ var fn = 1e3, hi = 1e4, ge = class {
|
|
|
3661
3628
|
}) {
|
|
3662
3629
|
let o = t.stories[e];
|
|
3663
3630
|
if (!o)
|
|
3664
|
-
throw new
|
|
3665
|
-
let
|
|
3631
|
+
throw new Er.MissingStoryFromCsfFileError({ storyId: e });
|
|
3632
|
+
let n = t.meta, i = this.prepareStoryWithCache(
|
|
3666
3633
|
o,
|
|
3667
|
-
|
|
3634
|
+
n,
|
|
3668
3635
|
t.projectAnnotations ?? this.projectAnnotations
|
|
3669
3636
|
);
|
|
3670
3637
|
return this.args.setInitial(i), this.hooks[i.id] = this.hooks[i.id] || new te(), i;
|
|
@@ -3676,23 +3643,23 @@ var fn = 1e3, hi = 1e4, ge = class {
|
|
|
3676
3643
|
return Object.keys(this.storyIndex.entries).filter((t) => !!e.stories[t]).map((t) => this.storyFromCSFFile({ storyId: t, csfFile: e }));
|
|
3677
3644
|
}
|
|
3678
3645
|
async loadEntry(e) {
|
|
3679
|
-
let t = await this.storyIdToEntry(e), o = t.type === "docs" ? t.storiesImports : [], [
|
|
3646
|
+
let t = await this.storyIdToEntry(e), o = t.type === "docs" ? t.storiesImports : [], [n, ...i] = await Promise.all([
|
|
3680
3647
|
this.importFn(t.importPath),
|
|
3681
3648
|
...o.map((a) => {
|
|
3682
3649
|
let l = this.storyIndex.importPathToEntry(a);
|
|
3683
3650
|
return this.loadCSFFileByStoryId(l.id);
|
|
3684
3651
|
})
|
|
3685
3652
|
]);
|
|
3686
|
-
return { entryExports:
|
|
3653
|
+
return { entryExports: n, csfFiles: i };
|
|
3687
3654
|
}
|
|
3688
3655
|
// A prepared story does not include args, globals or hooks. These are stored in the story store
|
|
3689
3656
|
// and updated separtely to the (immutable) story.
|
|
3690
3657
|
getStoryContext(e, { forceInitialArgs: t = !1 } = {}) {
|
|
3691
|
-
let o = this.userGlobals.get(), { initialGlobals:
|
|
3692
|
-
return
|
|
3658
|
+
let o = this.userGlobals.get(), { initialGlobals: n } = this.userGlobals, i = new se();
|
|
3659
|
+
return Sr({
|
|
3693
3660
|
...e,
|
|
3694
3661
|
args: t ? e.initialArgs : this.args.get(e.id),
|
|
3695
|
-
initialGlobals:
|
|
3662
|
+
initialGlobals: n,
|
|
3696
3663
|
globalTypes: this.projectAnnotations.globalTypes,
|
|
3697
3664
|
userGlobals: o,
|
|
3698
3665
|
reporting: i,
|
|
@@ -3717,13 +3684,13 @@ var fn = 1e3, hi = 1e4, ge = class {
|
|
|
3717
3684
|
extract(e = { includeDocsOnly: !1 }) {
|
|
3718
3685
|
let { cachedCSFFiles: t } = this;
|
|
3719
3686
|
if (!t)
|
|
3720
|
-
throw new
|
|
3687
|
+
throw new Er.CalledExtractOnStoreError();
|
|
3721
3688
|
return Object.entries(this.storyIndex.entries).reduce(
|
|
3722
|
-
(o, [
|
|
3689
|
+
(o, [n, { type: i, importPath: a }]) => {
|
|
3723
3690
|
if (i === "docs")
|
|
3724
3691
|
return o;
|
|
3725
|
-
let l = t[a], c = this.storyFromCSFFile({ storyId:
|
|
3726
|
-
return !e.includeDocsOnly && c.parameters.docsOnly || (o[
|
|
3692
|
+
let l = t[a], c = this.storyFromCSFFile({ storyId: n, csfFile: l });
|
|
3693
|
+
return !e.includeDocsOnly && c.parameters.docsOnly || (o[n] = Object.entries(c).reduce(
|
|
3727
3694
|
(d, [u, p]) => u === "moduleExport" || typeof p == "function" ? d : Array.isArray(p) ? Object.assign(d, { [u]: p.slice().sort() }) :
|
|
3728
3695
|
Object.assign(d, { [u]: p }),
|
|
3729
3696
|
{
|
|
@@ -3743,17 +3710,17 @@ var fn = 1e3, hi = 1e4, ge = class {
|
|
|
3743
3710
|
};
|
|
3744
3711
|
|
|
3745
3712
|
// src/preview-api/modules/store/autoTitle.ts
|
|
3746
|
-
var
|
|
3713
|
+
var an = require("storybook/internal/client-logger");
|
|
3747
3714
|
|
|
3748
3715
|
// ../node_modules/slash/index.js
|
|
3749
|
-
function
|
|
3716
|
+
function at(r) {
|
|
3750
3717
|
return r.startsWith("\\\\?\\") ? r : r.replace(/\\/g, "/");
|
|
3751
3718
|
}
|
|
3752
|
-
|
|
3719
|
+
s(at, "slash");
|
|
3753
3720
|
|
|
3754
3721
|
// src/preview-api/modules/store/autoTitle.ts
|
|
3755
|
-
var
|
|
3756
|
-
var
|
|
3722
|
+
var ln = _($(), 1);
|
|
3723
|
+
var ci = /* @__PURE__ */ s((r) => {
|
|
3757
3724
|
if (r.length === 0)
|
|
3758
3725
|
return r;
|
|
3759
3726
|
let e = r[r.length - 1], t = e?.replace(/(?:[.](?:story|stories))?([.][^.]+)$/i, "");
|
|
@@ -3763,42 +3730,42 @@ var gi = /* @__PURE__ */ n((r) => {
|
|
|
3763
3730
|
return t && o && t.toLowerCase() === o.toLowerCase() ? [...r.slice(0, -2), t] : t && (/^(story|stories)([.][^.]+)$/i.test(e) || /^index$/i.
|
|
3764
3731
|
test(t)) ? r.slice(0, -1) : [...r.slice(0, -1), t];
|
|
3765
3732
|
}, "sanitize");
|
|
3766
|
-
function
|
|
3733
|
+
function sn(r) {
|
|
3767
3734
|
return r.flatMap((e) => e.split("/")).filter(Boolean).join("/");
|
|
3768
3735
|
}
|
|
3769
|
-
|
|
3770
|
-
var
|
|
3771
|
-
let { directory: o, importPathMatcher:
|
|
3772
|
-
typeof r == "number" &&
|
|
3736
|
+
s(sn, "pathJoin");
|
|
3737
|
+
var lt = /* @__PURE__ */ s((r, e, t) => {
|
|
3738
|
+
let { directory: o, importPathMatcher: n, titlePrefix: i = "" } = e || {};
|
|
3739
|
+
typeof r == "number" && an.once.warn(ln.dedent`
|
|
3773
3740
|
CSF Auto-title received a numeric fileName. This typically happens when
|
|
3774
3741
|
webpack is mis-configured in production mode. To force webpack to produce
|
|
3775
3742
|
filenames, set optimization.moduleIds = "named" in your webpack config.
|
|
3776
3743
|
`);
|
|
3777
|
-
let a =
|
|
3778
|
-
if (
|
|
3744
|
+
let a = at(String(r));
|
|
3745
|
+
if (n.exec(a)) {
|
|
3779
3746
|
if (!t) {
|
|
3780
|
-
let l = a.replace(o, ""), c =
|
|
3781
|
-
return c =
|
|
3747
|
+
let l = a.replace(o, ""), c = sn([i, l]).split("/");
|
|
3748
|
+
return c = ci(c), c.join("/");
|
|
3782
3749
|
}
|
|
3783
|
-
return i ?
|
|
3750
|
+
return i ? sn([i, t]) : t;
|
|
3784
3751
|
}
|
|
3785
|
-
}, "userOrAutoTitleFromSpecifier"),
|
|
3752
|
+
}, "userOrAutoTitleFromSpecifier"), cn = /* @__PURE__ */ s((r, e, t) => {
|
|
3786
3753
|
for (let o = 0; o < e.length; o += 1) {
|
|
3787
|
-
let
|
|
3788
|
-
if (
|
|
3789
|
-
return
|
|
3754
|
+
let n = lt(r, e[o], t);
|
|
3755
|
+
if (n)
|
|
3756
|
+
return n;
|
|
3790
3757
|
}
|
|
3791
3758
|
return t || void 0;
|
|
3792
3759
|
}, "userOrAutoTitle");
|
|
3793
3760
|
|
|
3794
3761
|
// src/preview-api/modules/store/sortStories.ts
|
|
3795
|
-
var
|
|
3762
|
+
var un = _($(), 1);
|
|
3796
3763
|
|
|
3797
3764
|
// src/preview-api/modules/store/storySort.ts
|
|
3798
|
-
var
|
|
3765
|
+
var dn = /\s*\/\s*/, pn = /* @__PURE__ */ s((r = {}) => (e, t) => {
|
|
3799
3766
|
if (e.title === t.title && !r.includeNames)
|
|
3800
3767
|
return 0;
|
|
3801
|
-
let o = r.method || "configure",
|
|
3768
|
+
let o = r.method || "configure", n = r.order || [], i = e.title.trim().split(dn), a = t.title.trim().split(dn);
|
|
3802
3769
|
r.includeNames && (i.push(e.name), a.push(t.name));
|
|
3803
3770
|
let l = 0;
|
|
3804
3771
|
for (; i[l] || a[l]; ) {
|
|
@@ -3808,34 +3775,34 @@ var bn = /\s*\/\s*/, Sn = /* @__PURE__ */ n((r = {}) => (e, t) => {
|
|
|
3808
3775
|
return 1;
|
|
3809
3776
|
let c = i[l], d = a[l];
|
|
3810
3777
|
if (c !== d) {
|
|
3811
|
-
let p =
|
|
3812
|
-
return p !== -1 || m !== -1 ? (p === -1 && (h !== -1 ? p = h : p =
|
|
3778
|
+
let p = n.indexOf(c), m = n.indexOf(d), h = n.indexOf("*");
|
|
3779
|
+
return p !== -1 || m !== -1 ? (p === -1 && (h !== -1 ? p = h : p = n.length), m === -1 && (h !== -1 ? m = h : m = n.length), p - m) : o ===
|
|
3813
3780
|
"configure" ? 0 : c.localeCompare(d, r.locales ? r.locales : void 0, {
|
|
3814
3781
|
numeric: !0,
|
|
3815
3782
|
sensitivity: "accent"
|
|
3816
3783
|
});
|
|
3817
3784
|
}
|
|
3818
|
-
let u =
|
|
3819
|
-
u === -1 && (u =
|
|
3785
|
+
let u = n.indexOf(c);
|
|
3786
|
+
u === -1 && (u = n.indexOf("*")), n = u !== -1 && Array.isArray(n[u + 1]) ? n[u + 1] : [], l += 1;
|
|
3820
3787
|
}
|
|
3821
3788
|
return 0;
|
|
3822
3789
|
}, "storySort");
|
|
3823
3790
|
|
|
3824
3791
|
// src/preview-api/modules/store/sortStories.ts
|
|
3825
|
-
var
|
|
3792
|
+
var di = /* @__PURE__ */ s((r, e, t) => {
|
|
3826
3793
|
if (e) {
|
|
3827
3794
|
let o;
|
|
3828
|
-
typeof e == "function" ? o = e : o =
|
|
3795
|
+
typeof e == "function" ? o = e : o = pn(e), r.sort(o);
|
|
3829
3796
|
} else
|
|
3830
3797
|
r.sort(
|
|
3831
|
-
(o,
|
|
3798
|
+
(o, n) => t.indexOf(o.importPath) - t.indexOf(n.importPath)
|
|
3832
3799
|
);
|
|
3833
3800
|
return r;
|
|
3834
|
-
}, "sortStoriesCommon"),
|
|
3801
|
+
}, "sortStoriesCommon"), fn = /* @__PURE__ */ s((r, e, t) => {
|
|
3835
3802
|
try {
|
|
3836
|
-
return
|
|
3803
|
+
return di(r, e, t);
|
|
3837
3804
|
} catch (o) {
|
|
3838
|
-
throw new Error(
|
|
3805
|
+
throw new Error(un.dedent`
|
|
3839
3806
|
Error sorting stories with sort parameter ${e}:
|
|
3840
3807
|
|
|
3841
3808
|
> ${o.message}
|
|
@@ -3848,18 +3815,18 @@ var bi = /* @__PURE__ */ n((r, e, t) => {
|
|
|
3848
3815
|
}, "sortStoriesV7");
|
|
3849
3816
|
|
|
3850
3817
|
// src/preview-api/modules/preview-web/Preview.tsx
|
|
3851
|
-
var
|
|
3852
|
-
|
|
3818
|
+
var $e = require("storybook/internal/client-logger"), F = require("storybook/internal/core-events"), D = require("storybook/internal/preview-errors"),
|
|
3819
|
+
hn = require("@storybook/global");
|
|
3853
3820
|
|
|
3854
3821
|
// src/preview-api/modules/preview-web/render/StoryRender.ts
|
|
3855
|
-
var z = require("storybook/internal/core-events"),
|
|
3822
|
+
var z = require("storybook/internal/core-events"), Cr = require("storybook/internal/preview-errors");
|
|
3856
3823
|
|
|
3857
3824
|
// src/preview-api/modules/preview-web/render/Render.ts
|
|
3858
3825
|
var ae = new Error("prepareAborted");
|
|
3859
3826
|
|
|
3860
3827
|
// src/preview-api/modules/preview-web/render/StoryRender.ts
|
|
3861
|
-
var { AbortController:
|
|
3862
|
-
function
|
|
3828
|
+
var { AbortController: yn } = globalThis;
|
|
3829
|
+
function mn(r) {
|
|
3863
3830
|
try {
|
|
3864
3831
|
let { name: e = "Error", message: t = String(r), stack: o } = r;
|
|
3865
3832
|
return { name: e, message: t, stack: o };
|
|
@@ -3867,13 +3834,13 @@ function wn(r) {
|
|
|
3867
3834
|
return { name: "Error", message: String(r) };
|
|
3868
3835
|
}
|
|
3869
3836
|
}
|
|
3870
|
-
|
|
3837
|
+
s(mn, "serializeError");
|
|
3871
3838
|
var be = class {
|
|
3872
|
-
constructor(e, t, o,
|
|
3839
|
+
constructor(e, t, o, n, i, a, l = { autoplay: !0, forceInitialArgs: !1 }, c) {
|
|
3873
3840
|
this.channel = e;
|
|
3874
3841
|
this.store = t;
|
|
3875
3842
|
this.renderToScreen = o;
|
|
3876
|
-
this.callbacks =
|
|
3843
|
+
this.callbacks = n;
|
|
3877
3844
|
this.id = i;
|
|
3878
3845
|
this.viewMode = a;
|
|
3879
3846
|
this.renderOptions = l;
|
|
@@ -3881,13 +3848,13 @@ var be = class {
|
|
|
3881
3848
|
this.notYetRendered = !0;
|
|
3882
3849
|
this.rerenderEnqueued = !1;
|
|
3883
3850
|
this.disableKeyListeners = !1;
|
|
3884
|
-
this.teardownRender = /* @__PURE__ */
|
|
3851
|
+
this.teardownRender = /* @__PURE__ */ s(() => {
|
|
3885
3852
|
}, "teardownRender");
|
|
3886
3853
|
this.torndown = !1;
|
|
3887
|
-
this.abortController = new
|
|
3854
|
+
this.abortController = new yn(), c && (this.story = c, this.phase = "preparing");
|
|
3888
3855
|
}
|
|
3889
3856
|
static {
|
|
3890
|
-
|
|
3857
|
+
s(this, "StoryRender");
|
|
3891
3858
|
}
|
|
3892
3859
|
async runPhase(e, t, o) {
|
|
3893
3860
|
this.phase = t, this.channel.emit(z.STORY_RENDER_PHASE_CHANGED, { newPhase: this.phase, storyId: this.id }), o && (await o(), this.checkIfAborted(
|
|
@@ -3931,7 +3898,7 @@ var be = class {
|
|
|
3931
3898
|
let { canvasElement: o } = this;
|
|
3932
3899
|
if (!this.story)
|
|
3933
3900
|
throw new Error("cannot render when not prepared");
|
|
3934
|
-
let
|
|
3901
|
+
let n = this.story;
|
|
3935
3902
|
if (!o)
|
|
3936
3903
|
throw new Error("cannot render when canvasElement is unset");
|
|
3937
3904
|
let {
|
|
@@ -3946,9 +3913,9 @@ var be = class {
|
|
|
3946
3913
|
unboundStoryFn: h,
|
|
3947
3914
|
playFunction: x,
|
|
3948
3915
|
runStep: R
|
|
3949
|
-
} =
|
|
3950
|
-
t && !e && (this.cancelRender(), this.abortController = new
|
|
3951
|
-
let y = this.abortController.signal, b = !1, w =
|
|
3916
|
+
} = n;
|
|
3917
|
+
t && !e && (this.cancelRender(), this.abortController = new yn());
|
|
3918
|
+
let y = this.abortController.signal, b = !1, w = n.usesMount;
|
|
3952
3919
|
try {
|
|
3953
3920
|
let f = {
|
|
3954
3921
|
...this.storyContext(),
|
|
@@ -3956,11 +3923,11 @@ var be = class {
|
|
|
3956
3923
|
abortSignal: y,
|
|
3957
3924
|
canvasElement: o,
|
|
3958
3925
|
loaded: {},
|
|
3959
|
-
step: /* @__PURE__ */
|
|
3926
|
+
step: /* @__PURE__ */ s((P, W) => R(P, W, f), "step"),
|
|
3960
3927
|
context: null,
|
|
3961
3928
|
canvas: {},
|
|
3962
3929
|
userEvent: {},
|
|
3963
|
-
renderToCanvas: /* @__PURE__ */
|
|
3930
|
+
renderToCanvas: /* @__PURE__ */ s(async () => {
|
|
3964
3931
|
let P = await this.renderToScreen(g, o);
|
|
3965
3932
|
this.teardownRender = P || (() => {
|
|
3966
3933
|
}), b = !0;
|
|
@@ -3970,11 +3937,11 @@ var be = class {
|
|
|
3970
3937
|
//
|
|
3971
3938
|
// Before assigning it to the context, we resolve the context dependency,
|
|
3972
3939
|
// so that a user can just call it as await mount(...args) in their play function.
|
|
3973
|
-
mount: /* @__PURE__ */
|
|
3940
|
+
mount: /* @__PURE__ */ s(async (...P) => {
|
|
3974
3941
|
this.callbacks.showStoryDuringRender?.();
|
|
3975
3942
|
let W = null;
|
|
3976
3943
|
return await this.runPhase(y, "rendering", async () => {
|
|
3977
|
-
W = await
|
|
3944
|
+
W = await n.mount(f)(...P);
|
|
3978
3945
|
}), w && await this.runPhase(y, "playing"), W;
|
|
3979
3946
|
}, "mount")
|
|
3980
3947
|
};
|
|
@@ -3988,11 +3955,11 @@ var be = class {
|
|
|
3988
3955
|
story: c,
|
|
3989
3956
|
tags: d,
|
|
3990
3957
|
...this.callbacks,
|
|
3991
|
-
showError: /* @__PURE__ */
|
|
3992
|
-
showException: /* @__PURE__ */
|
|
3958
|
+
showError: /* @__PURE__ */ s((P) => (this.phase = "errored", this.callbacks.showError(P)), "showError"),
|
|
3959
|
+
showException: /* @__PURE__ */ s((P) => (this.phase = "errored", this.callbacks.showException(P)), "showException"),
|
|
3993
3960
|
forceRemount: t || this.notYetRendered,
|
|
3994
3961
|
storyContext: f,
|
|
3995
|
-
storyFn: /* @__PURE__ */
|
|
3962
|
+
storyFn: /* @__PURE__ */ s(() => h(f), "storyFn"),
|
|
3996
3963
|
unboundStoryFn: h
|
|
3997
3964
|
};
|
|
3998
3965
|
if (await this.runPhase(y, "loading", async () => {
|
|
@@ -4000,36 +3967,36 @@ var be = class {
|
|
|
4000
3967
|
}), y.aborted)
|
|
4001
3968
|
return;
|
|
4002
3969
|
let A = await p(f);
|
|
4003
|
-
if (this.store.addCleanupCallbacks(
|
|
3970
|
+
if (this.store.addCleanupCallbacks(n, ...A), this.checkIfAborted(y) || (!b && !w && await f.mount(), this.notYetRendered = !1, y.aborted))
|
|
4004
3971
|
return;
|
|
4005
|
-
let S = this.story.parameters?.test?.dangerouslyIgnoreUnhandledErrors === !0, C = /* @__PURE__ */ new Set(), M = /* @__PURE__ */
|
|
3972
|
+
let S = this.story.parameters?.test?.dangerouslyIgnoreUnhandledErrors === !0, C = /* @__PURE__ */ new Set(), M = /* @__PURE__ */ s((P) => {
|
|
4006
3973
|
P.error && C.add(P.error);
|
|
4007
|
-
}, "onError"),
|
|
3974
|
+
}, "onError"), j = /* @__PURE__ */ s((P) => {
|
|
4008
3975
|
P.reason && C.add(P.reason);
|
|
4009
3976
|
}, "onUnhandledRejection");
|
|
4010
3977
|
if (this.renderOptions.autoplay && t && x && this.phase !== "errored") {
|
|
4011
|
-
window.addEventListener("error", M), window.addEventListener("unhandledrejection",
|
|
3978
|
+
window.addEventListener("error", M), window.addEventListener("unhandledrejection", j), this.disableKeyListeners = !0;
|
|
4012
3979
|
try {
|
|
4013
3980
|
if (w ? await x(f) : (f.mount = async () => {
|
|
4014
|
-
throw new
|
|
3981
|
+
throw new Cr.MountMustBeDestructuredError({ playFunction: x.toString() });
|
|
4015
3982
|
}, await this.runPhase(y, "playing", async () => x(f))), !b)
|
|
4016
|
-
throw new
|
|
3983
|
+
throw new Cr.NoStoryMountedError();
|
|
4017
3984
|
this.checkIfAborted(y), !S && C.size > 0 ? await this.runPhase(y, "errored") : await this.runPhase(y, "played");
|
|
4018
3985
|
} catch (P) {
|
|
4019
3986
|
if (this.callbacks.showStoryDuringRender?.(), await this.runPhase(y, "errored", async () => {
|
|
4020
|
-
this.channel.emit(z.PLAY_FUNCTION_THREW_EXCEPTION,
|
|
3987
|
+
this.channel.emit(z.PLAY_FUNCTION_THREW_EXCEPTION, mn(P));
|
|
4021
3988
|
}), this.story.parameters.throwPlayFunctionExceptions !== !1)
|
|
4022
3989
|
throw P;
|
|
4023
3990
|
console.error(P);
|
|
4024
3991
|
}
|
|
4025
3992
|
if (!S && C.size > 0 && this.channel.emit(
|
|
4026
3993
|
z.UNHANDLED_ERRORS_WHILE_PLAYING,
|
|
4027
|
-
Array.from(C).map(
|
|
4028
|
-
), this.disableKeyListeners = !1, window.removeEventListener("unhandledrejection",
|
|
3994
|
+
Array.from(C).map(mn)
|
|
3995
|
+
), this.disableKeyListeners = !1, window.removeEventListener("unhandledrejection", j), window.removeEventListener("error", M), y.aborted)
|
|
4029
3996
|
return;
|
|
4030
3997
|
}
|
|
4031
3998
|
await this.runPhase(y, "completing", async () => {
|
|
4032
|
-
|
|
3999
|
+
Rr() ? this.store.addCleanupCallbacks(n, me()) : await he(y);
|
|
4033
4000
|
}), await this.runPhase(y, "completed", async () => {
|
|
4034
4001
|
this.channel.emit(z.STORY_RENDERED, i);
|
|
4035
4002
|
}), this.phase !== "errored" && await this.runPhase(y, "afterEach", async () => {
|
|
@@ -4098,18 +4065,18 @@ var be = class {
|
|
|
4098
4065
|
};
|
|
4099
4066
|
|
|
4100
4067
|
// src/preview-api/modules/preview-web/Preview.tsx
|
|
4101
|
-
var { fetch:
|
|
4102
|
-
constructor(e, t, o = q.getChannel(),
|
|
4068
|
+
var { fetch: pi } = hn.global, ui = "./index.json", Se = class {
|
|
4069
|
+
constructor(e, t, o = q.getChannel(), n = !0) {
|
|
4103
4070
|
this.importFn = e;
|
|
4104
4071
|
this.getProjectAnnotations = t;
|
|
4105
4072
|
this.channel = o;
|
|
4106
4073
|
this.storyRenders = [];
|
|
4107
4074
|
this.storeInitializationPromise = new Promise((i, a) => {
|
|
4108
4075
|
this.resolveStoreInitializationPromise = i, this.rejectStoreInitializationPromise = a;
|
|
4109
|
-
}),
|
|
4076
|
+
}), n && this.initialize();
|
|
4110
4077
|
}
|
|
4111
4078
|
static {
|
|
4112
|
-
|
|
4079
|
+
s(this, "Preview");
|
|
4113
4080
|
}
|
|
4114
4081
|
// Create a proxy object for `__STORYBOOK_STORY_STORE__` and `__STORYBOOK_PREVIEW__.storyStore`
|
|
4115
4082
|
// That proxies through to the store once ready, and errors beforehand. This means we can set
|
|
@@ -4120,10 +4087,10 @@ var { fetch: Si } = An.global, Ti = "./index.json", Se = class {
|
|
|
4120
4087
|
return new Proxy(
|
|
4121
4088
|
{},
|
|
4122
4089
|
{
|
|
4123
|
-
get: /* @__PURE__ */
|
|
4090
|
+
get: /* @__PURE__ */ s((e, t) => {
|
|
4124
4091
|
if (this.storyStoreValue)
|
|
4125
|
-
return (0,
|
|
4126
|
-
throw new
|
|
4092
|
+
return (0, $e.deprecate)("Accessing the Story Store is deprecated and will be removed in 9.0"), this.storyStoreValue[t];
|
|
4093
|
+
throw new D.StoryStoreAccessedBeforeInitializationError();
|
|
4127
4094
|
}, "get")
|
|
4128
4095
|
}
|
|
4129
4096
|
);
|
|
@@ -4151,7 +4118,7 @@ var { fetch: Si } = An.global, Ti = "./index.json", Se = class {
|
|
|
4151
4118
|
try {
|
|
4152
4119
|
let e = await this.getProjectAnnotations();
|
|
4153
4120
|
if (this.renderToCanvas = e.renderToCanvas, !this.renderToCanvas)
|
|
4154
|
-
throw new
|
|
4121
|
+
throw new D.MissingRenderToCanvasError();
|
|
4155
4122
|
return e;
|
|
4156
4123
|
} catch (e) {
|
|
4157
4124
|
throw this.renderPreviewEntryError("Error reading preview.js:", e), e;
|
|
@@ -4175,10 +4142,10 @@ var { fetch: Si } = An.global, Ti = "./index.json", Se = class {
|
|
|
4175
4142
|
}
|
|
4176
4143
|
}
|
|
4177
4144
|
async getStoryIndexFromServer() {
|
|
4178
|
-
let e = await
|
|
4145
|
+
let e = await pi(ui);
|
|
4179
4146
|
if (e.status === 200)
|
|
4180
4147
|
return e.json();
|
|
4181
|
-
throw new
|
|
4148
|
+
throw new D.StoryIndexFetchError({ text: await e.text() });
|
|
4182
4149
|
}
|
|
4183
4150
|
// If initialization gets as far as the story index, this function runs.
|
|
4184
4151
|
initializeWithStoryIndex(e) {
|
|
@@ -4195,7 +4162,7 @@ var { fetch: Si } = An.global, Ti = "./index.json", Se = class {
|
|
|
4195
4162
|
}
|
|
4196
4163
|
emitGlobals() {
|
|
4197
4164
|
if (!this.storyStoreValue)
|
|
4198
|
-
throw new
|
|
4165
|
+
throw new D.CalledPreviewMethodBeforeInitializationError({ methodName: "emitGlobals" });
|
|
4199
4166
|
let e = {
|
|
4200
4167
|
globals: this.storyStoreValue.userGlobals.get() || {},
|
|
4201
4168
|
globalTypes: this.storyStoreValue.projectAnnotations.globalTypes || {}
|
|
@@ -4234,7 +4201,7 @@ var { fetch: Si } = An.global, Ti = "./index.json", Se = class {
|
|
|
4234
4201
|
storyIndex: t
|
|
4235
4202
|
}) {
|
|
4236
4203
|
if (!this.storyStoreValue)
|
|
4237
|
-
throw new
|
|
4204
|
+
throw new D.CalledPreviewMethodBeforeInitializationError({ methodName: "onStoriesChanged" });
|
|
4238
4205
|
await this.storyStoreValue.onStoriesChanged({ importFn: e, storyIndex: t });
|
|
4239
4206
|
}
|
|
4240
4207
|
async onUpdateGlobals({
|
|
@@ -4242,29 +4209,29 @@ var { fetch: Si } = An.global, Ti = "./index.json", Se = class {
|
|
|
4242
4209
|
currentStory: t
|
|
4243
4210
|
}) {
|
|
4244
4211
|
if (this.storyStoreValue || await this.storeInitializationPromise, !this.storyStoreValue)
|
|
4245
|
-
throw new
|
|
4212
|
+
throw new D.CalledPreviewMethodBeforeInitializationError({ methodName: "onUpdateGlobals" });
|
|
4246
4213
|
if (this.storyStoreValue.userGlobals.update(e), t) {
|
|
4247
|
-
let { initialGlobals: o, storyGlobals:
|
|
4214
|
+
let { initialGlobals: o, storyGlobals: n, userGlobals: i, globals: a } = this.storyStoreValue.getStoryContext(t);
|
|
4248
4215
|
this.channel.emit(F.GLOBALS_UPDATED, {
|
|
4249
4216
|
initialGlobals: o,
|
|
4250
4217
|
userGlobals: i,
|
|
4251
|
-
storyGlobals:
|
|
4218
|
+
storyGlobals: n,
|
|
4252
4219
|
globals: a
|
|
4253
4220
|
});
|
|
4254
4221
|
} else {
|
|
4255
|
-
let { initialGlobals: o, globals:
|
|
4222
|
+
let { initialGlobals: o, globals: n } = this.storyStoreValue.userGlobals;
|
|
4256
4223
|
this.channel.emit(F.GLOBALS_UPDATED, {
|
|
4257
4224
|
initialGlobals: o,
|
|
4258
|
-
userGlobals:
|
|
4225
|
+
userGlobals: n,
|
|
4259
4226
|
storyGlobals: {},
|
|
4260
|
-
globals:
|
|
4227
|
+
globals: n
|
|
4261
4228
|
});
|
|
4262
4229
|
}
|
|
4263
4230
|
await Promise.all(this.storyRenders.map((o) => o.rerender()));
|
|
4264
4231
|
}
|
|
4265
4232
|
async onUpdateArgs({ storyId: e, updatedArgs: t }) {
|
|
4266
4233
|
if (!this.storyStoreValue)
|
|
4267
|
-
throw new
|
|
4234
|
+
throw new D.CalledPreviewMethodBeforeInitializationError({ methodName: "onUpdateArgs" });
|
|
4268
4235
|
this.storyStoreValue.args.update(e, t), await Promise.all(
|
|
4269
4236
|
this.storyRenders.filter((o) => o.id === e && !o.renderOptions.forceInitialArgs).map(
|
|
4270
4237
|
(o) => (
|
|
@@ -4298,13 +4265,13 @@ var { fetch: Si } = An.global, Ti = "./index.json", Se = class {
|
|
|
4298
4265
|
}
|
|
4299
4266
|
async onResetArgs({ storyId: e, argNames: t }) {
|
|
4300
4267
|
if (!this.storyStoreValue)
|
|
4301
|
-
throw new
|
|
4302
|
-
let
|
|
4268
|
+
throw new D.CalledPreviewMethodBeforeInitializationError({ methodName: "onResetArgs" });
|
|
4269
|
+
let n = this.storyRenders.find((l) => l.id === e)?.story || await this.storyStoreValue.loadStory({ storyId: e }), a = (t || [
|
|
4303
4270
|
.../* @__PURE__ */ new Set([
|
|
4304
|
-
...Object.keys(
|
|
4271
|
+
...Object.keys(n.initialArgs),
|
|
4305
4272
|
...Object.keys(this.storyStoreValue.args.get(e))
|
|
4306
4273
|
])
|
|
4307
|
-
]).reduce((l, c) => (l[c] =
|
|
4274
|
+
]).reduce((l, c) => (l[c] = n.initialArgs[c], l), {});
|
|
4308
4275
|
await this.onUpdateArgs({ storyId: e, updatedArgs: a });
|
|
4309
4276
|
}
|
|
4310
4277
|
// ForceReRender does not include a story id, so we simply must
|
|
@@ -4320,9 +4287,9 @@ var { fetch: Si } = An.global, Ti = "./index.json", Se = class {
|
|
|
4320
4287
|
// main to be consistent with the previous behaviour. In the future,
|
|
4321
4288
|
// we will change it to go ahead and load the story, which will end up being
|
|
4322
4289
|
// "instant", although async.
|
|
4323
|
-
renderStoryToElement(e, t, o,
|
|
4290
|
+
renderStoryToElement(e, t, o, n) {
|
|
4324
4291
|
if (!this.renderToCanvas || !this.storyStoreValue)
|
|
4325
|
-
throw new
|
|
4292
|
+
throw new D.CalledPreviewMethodBeforeInitializationError({
|
|
4326
4293
|
methodName: "renderStoryToElement"
|
|
4327
4294
|
});
|
|
4328
4295
|
let i = new be(
|
|
@@ -4332,7 +4299,7 @@ var { fetch: Si } = An.global, Ti = "./index.json", Se = class {
|
|
|
4332
4299
|
o,
|
|
4333
4300
|
e.id,
|
|
4334
4301
|
"docs",
|
|
4335
|
-
|
|
4302
|
+
n,
|
|
4336
4303
|
e
|
|
4337
4304
|
);
|
|
4338
4305
|
return i.renderToElement(t), this.storyRenders.push(i), async () => {
|
|
@@ -4345,65 +4312,65 @@ var { fetch: Si } = An.global, Ti = "./index.json", Se = class {
|
|
|
4345
4312
|
// API
|
|
4346
4313
|
async loadStory({ storyId: e }) {
|
|
4347
4314
|
if (!this.storyStoreValue)
|
|
4348
|
-
throw new
|
|
4315
|
+
throw new D.CalledPreviewMethodBeforeInitializationError({ methodName: "loadStory" });
|
|
4349
4316
|
return this.storyStoreValue.loadStory({ storyId: e });
|
|
4350
4317
|
}
|
|
4351
4318
|
getStoryContext(e, { forceInitialArgs: t = !1 } = {}) {
|
|
4352
4319
|
if (!this.storyStoreValue)
|
|
4353
|
-
throw new
|
|
4320
|
+
throw new D.CalledPreviewMethodBeforeInitializationError({ methodName: "getStoryContext" });
|
|
4354
4321
|
return this.storyStoreValue.getStoryContext(e, { forceInitialArgs: t });
|
|
4355
4322
|
}
|
|
4356
4323
|
async extract(e) {
|
|
4357
4324
|
if (!this.storyStoreValue)
|
|
4358
|
-
throw new
|
|
4325
|
+
throw new D.CalledPreviewMethodBeforeInitializationError({ methodName: "extract" });
|
|
4359
4326
|
if (this.previewEntryError)
|
|
4360
4327
|
throw this.previewEntryError;
|
|
4361
4328
|
return await this.storyStoreValue.cacheAllCSFFiles(), this.storyStoreValue.extract(e);
|
|
4362
4329
|
}
|
|
4363
4330
|
// UTILITIES
|
|
4364
4331
|
renderPreviewEntryError(e, t) {
|
|
4365
|
-
this.previewEntryError = t,
|
|
4332
|
+
this.previewEntryError = t, $e.logger.error(e), $e.logger.error(t), this.channel.emit(F.CONFIG_ERROR, t);
|
|
4366
4333
|
}
|
|
4367
4334
|
};
|
|
4368
4335
|
|
|
4369
4336
|
// src/preview-api/modules/preview-web/PreviewWeb.tsx
|
|
4370
|
-
var
|
|
4337
|
+
var Es = require("@storybook/global");
|
|
4371
4338
|
|
|
4372
4339
|
// src/preview-api/modules/preview-web/PreviewWithSelection.tsx
|
|
4373
|
-
var
|
|
4340
|
+
var Xe = require("storybook/internal/client-logger"), E = require("storybook/internal/core-events"), Y = require("storybook/internal/preview-errors");
|
|
4374
4341
|
|
|
4375
4342
|
// ../node_modules/tiny-invariant/dist/esm/tiny-invariant.js
|
|
4376
|
-
var
|
|
4377
|
-
function
|
|
4343
|
+
var fi = process.env.NODE_ENV === "production", ct = "Invariant failed";
|
|
4344
|
+
function vr(r, e) {
|
|
4378
4345
|
if (!r) {
|
|
4379
|
-
if (
|
|
4380
|
-
throw new Error(
|
|
4381
|
-
var t = typeof e == "function" ? e() : e, o = t ? "".concat(
|
|
4346
|
+
if (fi)
|
|
4347
|
+
throw new Error(ct);
|
|
4348
|
+
var t = typeof e == "function" ? e() : e, o = t ? "".concat(ct, ": ").concat(t) : ct;
|
|
4382
4349
|
throw new Error(o);
|
|
4383
4350
|
}
|
|
4384
4351
|
}
|
|
4385
|
-
|
|
4352
|
+
s(vr, "invariant");
|
|
4386
4353
|
|
|
4387
4354
|
// src/preview-api/modules/preview-web/render/CsfDocsRender.ts
|
|
4388
|
-
var
|
|
4355
|
+
var Sn = require("storybook/internal/core-events");
|
|
4389
4356
|
|
|
4390
4357
|
// src/preview-api/modules/preview-web/docs-context/DocsContext.ts
|
|
4391
|
-
var
|
|
4358
|
+
var gn = require("storybook/internal/csf"), bn = _($(), 1);
|
|
4392
4359
|
var ee = class {
|
|
4393
|
-
constructor(e, t, o,
|
|
4360
|
+
constructor(e, t, o, n) {
|
|
4394
4361
|
this.channel = e;
|
|
4395
4362
|
this.store = t;
|
|
4396
4363
|
this.renderStoryToElement = o;
|
|
4397
|
-
this.storyIdByName = /* @__PURE__ */
|
|
4364
|
+
this.storyIdByName = /* @__PURE__ */ s((e) => {
|
|
4398
4365
|
let t = this.nameToStoryId.get(e);
|
|
4399
4366
|
if (t)
|
|
4400
4367
|
return t;
|
|
4401
4368
|
throw new Error(`No story found with that name: ${e}`);
|
|
4402
4369
|
}, "storyIdByName");
|
|
4403
|
-
this.componentStories = /* @__PURE__ */
|
|
4404
|
-
this.componentStoriesFromCSFFile = /* @__PURE__ */
|
|
4370
|
+
this.componentStories = /* @__PURE__ */ s(() => this.componentStoriesValue, "componentStories");
|
|
4371
|
+
this.componentStoriesFromCSFFile = /* @__PURE__ */ s((e) => this.store.componentStoriesFromCSFFile({ csfFile: e }), "componentStoriesFro\
|
|
4405
4372
|
mCSFFile");
|
|
4406
|
-
this.storyById = /* @__PURE__ */
|
|
4373
|
+
this.storyById = /* @__PURE__ */ s((e) => {
|
|
4407
4374
|
if (!e) {
|
|
4408
4375
|
if (!this.primaryStory)
|
|
4409
4376
|
throw new Error(
|
|
@@ -4416,20 +4383,20 @@ mCSFFile");
|
|
|
4416
4383
|
throw new Error(`Called \`storyById\` for story that was never loaded: ${e}`);
|
|
4417
4384
|
return this.store.storyFromCSFFile({ storyId: e, csfFile: t });
|
|
4418
4385
|
}, "storyById");
|
|
4419
|
-
this.getStoryContext = /* @__PURE__ */
|
|
4386
|
+
this.getStoryContext = /* @__PURE__ */ s((e) => ({
|
|
4420
4387
|
...this.store.getStoryContext(e),
|
|
4421
4388
|
loaded: {},
|
|
4422
4389
|
viewMode: "docs"
|
|
4423
4390
|
}), "getStoryContext");
|
|
4424
|
-
this.loadStory = /* @__PURE__ */
|
|
4391
|
+
this.loadStory = /* @__PURE__ */ s((e) => this.store.loadStory({ storyId: e }), "loadStory");
|
|
4425
4392
|
this.componentStoriesValue = [], this.storyIdToCSFFile = /* @__PURE__ */ new Map(), this.exportToStory = /* @__PURE__ */ new Map(), this.
|
|
4426
4393
|
exportsToCSFFile = /* @__PURE__ */ new Map(), this.nameToStoryId = /* @__PURE__ */ new Map(), this.attachedCSFFiles = /* @__PURE__ */ new Set(),
|
|
4427
|
-
|
|
4394
|
+
n.forEach((i, a) => {
|
|
4428
4395
|
this.referenceCSFFile(i);
|
|
4429
4396
|
});
|
|
4430
4397
|
}
|
|
4431
4398
|
static {
|
|
4432
|
-
|
|
4399
|
+
s(this, "DocsContext");
|
|
4433
4400
|
}
|
|
4434
4401
|
// This docs entry references this CSF file and can synchronously load the stories, as well
|
|
4435
4402
|
// as reference them by module export. If the CSF is part of the "component" stories, they
|
|
@@ -4437,8 +4404,8 @@ mCSFFile");
|
|
|
4437
4404
|
referenceCSFFile(e) {
|
|
4438
4405
|
this.exportsToCSFFile.set(e.moduleExports, e), this.exportsToCSFFile.set(e.moduleExports.default, e), this.store.componentStoriesFromCSFFile(
|
|
4439
4406
|
{ csfFile: e }).forEach((o) => {
|
|
4440
|
-
let
|
|
4441
|
-
this.storyIdToCSFFile.set(
|
|
4407
|
+
let n = e.stories[o.id];
|
|
4408
|
+
this.storyIdToCSFFile.set(n.id, e), this.exportToStory.set(n.moduleExport, o);
|
|
4442
4409
|
});
|
|
4443
4410
|
}
|
|
4444
4411
|
attachCSFFile(e) {
|
|
@@ -4492,20 +4459,20 @@ CSF file?"
|
|
|
4492
4459
|
if (t)
|
|
4493
4460
|
return { type: "meta", csfFile: t };
|
|
4494
4461
|
let o = this.exportToStory.get(
|
|
4495
|
-
(0,
|
|
4462
|
+
(0, gn.isStory)(e) ? e.input : e
|
|
4496
4463
|
);
|
|
4497
4464
|
return o ? { type: "story", story: o } : { type: "component", component: e };
|
|
4498
4465
|
}
|
|
4499
4466
|
resolveOf(e, t = []) {
|
|
4500
4467
|
let o;
|
|
4501
4468
|
if (["component", "meta", "story"].includes(e)) {
|
|
4502
|
-
let
|
|
4503
|
-
o = this.resolveAttachedModuleExportType(
|
|
4469
|
+
let n = e;
|
|
4470
|
+
o = this.resolveAttachedModuleExportType(n);
|
|
4504
4471
|
} else
|
|
4505
4472
|
o = this.resolveModuleExport(e);
|
|
4506
4473
|
if (t.length && !t.includes(o.type)) {
|
|
4507
|
-
let
|
|
4508
|
-
throw new Error(
|
|
4474
|
+
let n = o.type === "component" ? "component or unknown" : o.type;
|
|
4475
|
+
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.
|
|
4509
4476
|
join(
|
|
4510
4477
|
", "
|
|
4511
4478
|
)}.
|
|
@@ -4532,12 +4499,12 @@ CSF file?"
|
|
|
4532
4499
|
};
|
|
4533
4500
|
|
|
4534
4501
|
// src/preview-api/modules/preview-web/render/CsfDocsRender.ts
|
|
4535
|
-
var
|
|
4536
|
-
constructor(e, t, o,
|
|
4502
|
+
var Ye = class {
|
|
4503
|
+
constructor(e, t, o, n) {
|
|
4537
4504
|
this.channel = e;
|
|
4538
4505
|
this.store = t;
|
|
4539
4506
|
this.entry = o;
|
|
4540
|
-
this.callbacks =
|
|
4507
|
+
this.callbacks = n;
|
|
4541
4508
|
this.type = "docs";
|
|
4542
4509
|
this.subtype = "csf";
|
|
4543
4510
|
this.torndown = !1;
|
|
@@ -4546,7 +4513,7 @@ var Ke = class {
|
|
|
4546
4513
|
this.id = o.id;
|
|
4547
4514
|
}
|
|
4548
4515
|
static {
|
|
4549
|
-
|
|
4516
|
+
s(this, "CsfDocsRender");
|
|
4550
4517
|
}
|
|
4551
4518
|
isPreparing() {
|
|
4552
4519
|
return this.preparing;
|
|
@@ -4556,10 +4523,10 @@ var Ke = class {
|
|
|
4556
4523
|
let { entryExports: e, csfFiles: t = [] } = await this.store.loadEntry(this.id);
|
|
4557
4524
|
if (this.torndown)
|
|
4558
4525
|
throw ae;
|
|
4559
|
-
let { importPath: o, title:
|
|
4526
|
+
let { importPath: o, title: n } = this.entry, i = this.store.processCSFFileWithCache(
|
|
4560
4527
|
e,
|
|
4561
4528
|
o,
|
|
4562
|
-
|
|
4529
|
+
n
|
|
4563
4530
|
), a = Object.keys(i.stories)[0];
|
|
4564
4531
|
this.story = this.store.storyFromCSFFile({ storyId: a, csfFile: i }), this.csfFiles = [i, ...t], this.preparing = !1;
|
|
4565
4532
|
}
|
|
@@ -4580,14 +4547,14 @@ var Ke = class {
|
|
|
4580
4547
|
async renderToElement(e, t) {
|
|
4581
4548
|
if (!this.story || !this.csfFiles)
|
|
4582
4549
|
throw new Error("Cannot render docs before preparing");
|
|
4583
|
-
let o = this.docsContext(t), { docs:
|
|
4584
|
-
if (!
|
|
4550
|
+
let o = this.docsContext(t), { docs: n } = this.story.parameters || {};
|
|
4551
|
+
if (!n)
|
|
4585
4552
|
throw new Error(
|
|
4586
4553
|
"Cannot render a story in viewMode=docs if `@storybook/addon-docs` is not installed"
|
|
4587
4554
|
);
|
|
4588
|
-
let i = await
|
|
4555
|
+
let i = await n.renderer(), { render: a } = i, l = /* @__PURE__ */ s(async () => {
|
|
4589
4556
|
try {
|
|
4590
|
-
await a(o,
|
|
4557
|
+
await a(o, n, e), this.channel.emit(Sn.DOCS_RENDERED, this.id);
|
|
4591
4558
|
} catch (c) {
|
|
4592
4559
|
this.callbacks.showException(c);
|
|
4593
4560
|
}
|
|
@@ -4602,13 +4569,13 @@ var Ke = class {
|
|
|
4602
4569
|
};
|
|
4603
4570
|
|
|
4604
4571
|
// src/preview-api/modules/preview-web/render/MdxDocsRender.ts
|
|
4605
|
-
var
|
|
4606
|
-
var
|
|
4607
|
-
constructor(e, t, o,
|
|
4572
|
+
var Tn = require("storybook/internal/core-events");
|
|
4573
|
+
var Ke = class {
|
|
4574
|
+
constructor(e, t, o, n) {
|
|
4608
4575
|
this.channel = e;
|
|
4609
4576
|
this.store = t;
|
|
4610
4577
|
this.entry = o;
|
|
4611
|
-
this.callbacks =
|
|
4578
|
+
this.callbacks = n;
|
|
4612
4579
|
this.type = "docs";
|
|
4613
4580
|
this.subtype = "mdx";
|
|
4614
4581
|
this.torndown = !1;
|
|
@@ -4617,7 +4584,7 @@ var Xe = class {
|
|
|
4617
4584
|
this.id = o.id;
|
|
4618
4585
|
}
|
|
4619
4586
|
static {
|
|
4620
|
-
|
|
4587
|
+
s(this, "MdxDocsRender");
|
|
4621
4588
|
}
|
|
4622
4589
|
isPreparing() {
|
|
4623
4590
|
return this.preparing;
|
|
@@ -4645,14 +4612,14 @@ var Xe = class {
|
|
|
4645
4612
|
async renderToElement(e, t) {
|
|
4646
4613
|
if (!this.exports || !this.csfFiles || !this.store.projectAnnotations)
|
|
4647
4614
|
throw new Error("Cannot render docs before preparing");
|
|
4648
|
-
let o = this.docsContext(t), { docs:
|
|
4649
|
-
if (!
|
|
4615
|
+
let o = this.docsContext(t), { docs: n } = this.store.projectAnnotations.parameters ?? {};
|
|
4616
|
+
if (!n)
|
|
4650
4617
|
throw new Error(
|
|
4651
4618
|
"Cannot render a story in viewMode=docs if `@storybook/addon-docs` is not installed"
|
|
4652
4619
|
);
|
|
4653
|
-
let i = { ...
|
|
4620
|
+
let i = { ...n, page: this.exports.default }, a = await n.renderer(), { render: l } = a, c = /* @__PURE__ */ s(async () => {
|
|
4654
4621
|
try {
|
|
4655
|
-
await l(o, i, e), this.channel.emit(
|
|
4622
|
+
await l(o, i, e), this.channel.emit(Tn.DOCS_RENDERED, this.id);
|
|
4656
4623
|
} catch (d) {
|
|
4657
4624
|
this.callbacks.showException(d);
|
|
4658
4625
|
}
|
|
@@ -4667,43 +4634,43 @@ var Xe = class {
|
|
|
4667
4634
|
};
|
|
4668
4635
|
|
|
4669
4636
|
// src/preview-api/modules/preview-web/PreviewWithSelection.tsx
|
|
4670
|
-
var
|
|
4671
|
-
function
|
|
4637
|
+
var yi = globalThis;
|
|
4638
|
+
function mi(r) {
|
|
4672
4639
|
let e = r.composedPath && r.composedPath()[0] || r.target;
|
|
4673
4640
|
return /input|textarea/i.test(e.tagName) || e.getAttribute("contenteditable") !== null;
|
|
4674
4641
|
}
|
|
4675
|
-
|
|
4676
|
-
var
|
|
4677
|
-
function
|
|
4678
|
-
return r?.includes(
|
|
4642
|
+
s(mi, "focusInInput");
|
|
4643
|
+
var xn = "attached-mdx", hi = "unattached-mdx";
|
|
4644
|
+
function gi({ tags: r }) {
|
|
4645
|
+
return r?.includes(hi) || r?.includes(xn);
|
|
4679
4646
|
}
|
|
4680
|
-
|
|
4681
|
-
function
|
|
4647
|
+
s(gi, "isMdxEntry");
|
|
4648
|
+
function dt(r) {
|
|
4682
4649
|
return r.type === "story";
|
|
4683
4650
|
}
|
|
4684
|
-
|
|
4685
|
-
function
|
|
4651
|
+
s(dt, "isStoryRender");
|
|
4652
|
+
function bi(r) {
|
|
4686
4653
|
return r.type === "docs";
|
|
4687
4654
|
}
|
|
4688
|
-
|
|
4689
|
-
function
|
|
4690
|
-
return
|
|
4655
|
+
s(bi, "isDocsRender");
|
|
4656
|
+
function Si(r) {
|
|
4657
|
+
return bi(r) && r.subtype === "csf";
|
|
4691
4658
|
}
|
|
4692
|
-
|
|
4659
|
+
s(Si, "isCsfDocsRender");
|
|
4693
4660
|
var Te = class extends Se {
|
|
4694
|
-
constructor(t, o,
|
|
4661
|
+
constructor(t, o, n, i) {
|
|
4695
4662
|
super(t, o, void 0, !1);
|
|
4696
4663
|
this.importFn = t;
|
|
4697
4664
|
this.getProjectAnnotations = o;
|
|
4698
|
-
this.selectionStore =
|
|
4665
|
+
this.selectionStore = n;
|
|
4699
4666
|
this.view = i;
|
|
4700
4667
|
this.initialize();
|
|
4701
4668
|
}
|
|
4702
4669
|
static {
|
|
4703
|
-
|
|
4670
|
+
s(this, "PreviewWithSelection");
|
|
4704
4671
|
}
|
|
4705
4672
|
setupListeners() {
|
|
4706
|
-
super.setupListeners(),
|
|
4673
|
+
super.setupListeners(), yi.onkeydown = this.onKeydown.bind(this), this.channel.on(E.SET_CURRENT_STORY, this.onSetCurrentStory.bind(this)),
|
|
4707
4674
|
this.channel.on(E.UPDATE_QUERY_PARAMS, this.onUpdateQueryParams.bind(this)), this.channel.on(E.PRELOAD_ENTRIES, this.onPreloadStories.bind(
|
|
4708
4675
|
this));
|
|
4709
4676
|
}
|
|
@@ -4731,15 +4698,15 @@ var Te = class extends Se {
|
|
|
4731
4698
|
this.renderMissingStory();
|
|
4732
4699
|
return;
|
|
4733
4700
|
}
|
|
4734
|
-
let { storySpecifier: t, args: o } = this.selectionStore.selectionSpecifier,
|
|
4735
|
-
if (!
|
|
4701
|
+
let { storySpecifier: t, args: o } = this.selectionStore.selectionSpecifier, n = this.storyStoreValue.storyIndex.entryFromSpecifier(t);
|
|
4702
|
+
if (!n) {
|
|
4736
4703
|
t === "*" ? this.renderStoryLoadingException(t, new Y.EmptyIndexError()) : this.renderStoryLoadingException(
|
|
4737
4704
|
t,
|
|
4738
4705
|
new Y.NoStoryMatchError({ storySpecifier: t.toString() })
|
|
4739
4706
|
);
|
|
4740
4707
|
return;
|
|
4741
4708
|
}
|
|
4742
|
-
let { id: i, type: a } =
|
|
4709
|
+
let { id: i, type: a } = n;
|
|
4743
4710
|
this.selectionStore.setSelection({ storyId: i, viewMode: a }), this.channel.emit(E.STORY_SPECIFIED, this.selectionStore.selection), this.
|
|
4744
4711
|
channel.emit(E.CURRENT_STORY_WAS_SET, this.selectionStore.selection), await this.renderSelection({ persistedArgs: o });
|
|
4745
4712
|
}
|
|
@@ -4759,10 +4726,10 @@ var Te = class extends Se {
|
|
|
4759
4726
|
selectSpecifiedStory();
|
|
4760
4727
|
}
|
|
4761
4728
|
onKeydown(t) {
|
|
4762
|
-
if (!this.storyRenders.find((o) => o.disableKeyListeners) && !
|
|
4763
|
-
let { altKey: o, ctrlKey:
|
|
4729
|
+
if (!this.storyRenders.find((o) => o.disableKeyListeners) && !mi(t)) {
|
|
4730
|
+
let { altKey: o, ctrlKey: n, metaKey: i, shiftKey: a, key: l, code: c, keyCode: d } = t;
|
|
4764
4731
|
this.channel.emit(E.PREVIEW_KEYDOWN, {
|
|
4765
|
-
event: { altKey: o, ctrlKey:
|
|
4732
|
+
event: { altKey: o, ctrlKey: n, metaKey: i, shiftKey: a, key: l, code: c, keyCode: d }
|
|
4766
4733
|
});
|
|
4767
4734
|
}
|
|
4768
4735
|
}
|
|
@@ -4775,7 +4742,7 @@ var Te = class extends Se {
|
|
|
4775
4742
|
}
|
|
4776
4743
|
async onUpdateGlobals({ globals: t }) {
|
|
4777
4744
|
let o = this.currentRender instanceof be && this.currentRender.story || void 0;
|
|
4778
|
-
super.onUpdateGlobals({ globals: t, currentStory: o }), (this.currentRender instanceof
|
|
4745
|
+
super.onUpdateGlobals({ globals: t, currentStory: o }), (this.currentRender instanceof Ke || this.currentRender instanceof Ye) && await this.
|
|
4779
4746
|
currentRender.rerender?.();
|
|
4780
4747
|
}
|
|
4781
4748
|
async onUpdateArgs({ storyId: t, updatedArgs: o }) {
|
|
@@ -4794,10 +4761,10 @@ var Te = class extends Se {
|
|
|
4794
4761
|
let { renderToCanvas: o } = this;
|
|
4795
4762
|
if (!this.storyStoreValue || !o)
|
|
4796
4763
|
throw new Y.CalledPreviewMethodBeforeInitializationError({ methodName: "renderSelection" });
|
|
4797
|
-
let { selection:
|
|
4798
|
-
if (!
|
|
4764
|
+
let { selection: n } = this.selectionStore;
|
|
4765
|
+
if (!n)
|
|
4799
4766
|
throw new Error("Cannot call renderSelection as no selection was made");
|
|
4800
|
-
let { storyId: i } =
|
|
4767
|
+
let { storyId: i } = n, a;
|
|
4801
4768
|
try {
|
|
4802
4769
|
a = await this.storyStoreValue.storyIdToEntry(i);
|
|
4803
4770
|
} catch (h) {
|
|
@@ -4815,19 +4782,19 @@ var Te = class extends Se {
|
|
|
4815
4782
|
this.mainStoryCallbacks(i),
|
|
4816
4783
|
i,
|
|
4817
4784
|
"story"
|
|
4818
|
-
) :
|
|
4785
|
+
) : gi(a) ? d = new Ke(
|
|
4819
4786
|
this.channel,
|
|
4820
4787
|
this.storyStoreValue,
|
|
4821
4788
|
a,
|
|
4822
4789
|
this.mainStoryCallbacks(i)
|
|
4823
|
-
) : d = new
|
|
4790
|
+
) : d = new Ye(
|
|
4824
4791
|
this.channel,
|
|
4825
4792
|
this.storyStoreValue,
|
|
4826
4793
|
a,
|
|
4827
4794
|
this.mainStoryCallbacks(i)
|
|
4828
4795
|
);
|
|
4829
4796
|
let u = this.currentSelection;
|
|
4830
|
-
this.currentSelection =
|
|
4797
|
+
this.currentSelection = n;
|
|
4831
4798
|
let p = this.currentRender;
|
|
4832
4799
|
this.currentRender = d;
|
|
4833
4800
|
try {
|
|
@@ -4837,12 +4804,12 @@ var Te = class extends Se {
|
|
|
4837
4804
|
return;
|
|
4838
4805
|
}
|
|
4839
4806
|
let m = !l && p && !d.isEqual(p);
|
|
4840
|
-
if (t &&
|
|
4807
|
+
if (t && dt(d) && (vr(!!d.story), this.storyStoreValue.args.updateFromPersisted(d.story, t)), p && !p.torndown && !l && !m && !c) {
|
|
4841
4808
|
this.currentRender = p, this.channel.emit(E.STORY_UNCHANGED, i), this.view.showMain();
|
|
4842
4809
|
return;
|
|
4843
4810
|
}
|
|
4844
|
-
if (p && await this.teardownRender(p, { viewModeChanged: c }), u && (l || c) && this.channel.emit(E.STORY_CHANGED, i),
|
|
4845
|
-
|
|
4811
|
+
if (p && await this.teardownRender(p, { viewModeChanged: c }), u && (l || c) && this.channel.emit(E.STORY_CHANGED, i), dt(d)) {
|
|
4812
|
+
vr(!!d.story);
|
|
4846
4813
|
let {
|
|
4847
4814
|
parameters: h,
|
|
4848
4815
|
initialArgs: x,
|
|
@@ -4867,7 +4834,7 @@ var Te = class extends Se {
|
|
|
4867
4834
|
initialGlobals: x,
|
|
4868
4835
|
storyGlobals: {},
|
|
4869
4836
|
userGlobals: R
|
|
4870
|
-
}),
|
|
4837
|
+
}), Si(d) || d.entry.tags?.includes(xn)) {
|
|
4871
4838
|
if (!d.csfFiles)
|
|
4872
4839
|
throw new Y.MdxFileWithNoCsfReferencesError({ storyId: i });
|
|
4873
4840
|
({ parameters: h } = this.storyStoreValue.preparedMetaFromCSFFile({
|
|
@@ -4879,7 +4846,7 @@ var Te = class extends Se {
|
|
|
4879
4846
|
parameters: h
|
|
4880
4847
|
});
|
|
4881
4848
|
}
|
|
4882
|
-
|
|
4849
|
+
dt(d) ? (vr(!!d.story), this.storyRenders.push(d), this.currentRender.renderToElement(
|
|
4883
4850
|
this.view.prepareForStory(d.story)
|
|
4884
4851
|
)) : this.currentRender.renderToElement(
|
|
4885
4852
|
this.view.prepareForDocs(),
|
|
@@ -4888,15 +4855,15 @@ var Te = class extends Se {
|
|
|
4888
4855
|
);
|
|
4889
4856
|
}
|
|
4890
4857
|
async teardownRender(t, { viewModeChanged: o = !1 } = {}) {
|
|
4891
|
-
this.storyRenders = this.storyRenders.filter((
|
|
4858
|
+
this.storyRenders = this.storyRenders.filter((n) => n !== t), await t?.teardown?.({ viewModeChanged: o });
|
|
4892
4859
|
}
|
|
4893
4860
|
// UTILITIES
|
|
4894
4861
|
mainStoryCallbacks(t) {
|
|
4895
4862
|
return {
|
|
4896
|
-
showStoryDuringRender: /* @__PURE__ */
|
|
4897
|
-
showMain: /* @__PURE__ */
|
|
4898
|
-
showError: /* @__PURE__ */
|
|
4899
|
-
showException: /* @__PURE__ */
|
|
4863
|
+
showStoryDuringRender: /* @__PURE__ */ s(() => this.view.showStoryDuringRender(), "showStoryDuringRender"),
|
|
4864
|
+
showMain: /* @__PURE__ */ s(() => this.view.showMain(), "showMain"),
|
|
4865
|
+
showError: /* @__PURE__ */ s((o) => this.renderError(t, o), "showError"),
|
|
4866
|
+
showException: /* @__PURE__ */ s((o) => this.renderException(t, o), "showException")
|
|
4900
4867
|
};
|
|
4901
4868
|
}
|
|
4902
4869
|
renderPreviewEntryError(t, o) {
|
|
@@ -4906,35 +4873,35 @@ var Te = class extends Se {
|
|
|
4906
4873
|
this.view.showNoPreview(), this.channel.emit(E.STORY_MISSING);
|
|
4907
4874
|
}
|
|
4908
4875
|
renderStoryLoadingException(t, o) {
|
|
4909
|
-
|
|
4876
|
+
Xe.logger.error(o), this.view.showErrorDisplay(o), this.channel.emit(E.STORY_MISSING, t);
|
|
4910
4877
|
}
|
|
4911
4878
|
// renderException is used if we fail to render the story and it is uncaught by the app layer
|
|
4912
4879
|
renderException(t, o) {
|
|
4913
|
-
let { name:
|
|
4914
|
-
this.channel.emit(E.STORY_THREW_EXCEPTION, { name:
|
|
4915
|
-
errored", storyId: t }), this.view.showErrorDisplay(o),
|
|
4880
|
+
let { name: n = "Error", message: i = String(o), stack: a } = o;
|
|
4881
|
+
this.channel.emit(E.STORY_THREW_EXCEPTION, { name: n, message: i, stack: a }), this.channel.emit(E.STORY_RENDER_PHASE_CHANGED, { newPhase: "\
|
|
4882
|
+
errored", storyId: t }), this.view.showErrorDisplay(o), Xe.logger.error(`Error rendering story '${t}':`), Xe.logger.error(o);
|
|
4916
4883
|
}
|
|
4917
4884
|
// renderError is used by the various app layers to inform the user they have done something
|
|
4918
4885
|
// wrong -- for instance returned the wrong thing from a story
|
|
4919
|
-
renderError(t, { title: o, description:
|
|
4920
|
-
|
|
4886
|
+
renderError(t, { title: o, description: n }) {
|
|
4887
|
+
Xe.logger.error(`Error rendering story ${o}: ${n}`), this.channel.emit(E.STORY_ERRORED, { title: o, description: n }), this.channel.emit(
|
|
4921
4888
|
E.STORY_RENDER_PHASE_CHANGED, { newPhase: "errored", storyId: t }), this.view.showErrorDisplay({
|
|
4922
4889
|
message: o,
|
|
4923
|
-
stack:
|
|
4890
|
+
stack: n
|
|
4924
4891
|
});
|
|
4925
4892
|
}
|
|
4926
4893
|
};
|
|
4927
4894
|
|
|
4928
4895
|
// src/preview-api/modules/preview-web/UrlStore.ts
|
|
4929
|
-
var
|
|
4896
|
+
var qn = require("@storybook/global"), Qe = _(Dr(), 1);
|
|
4930
4897
|
|
|
4931
4898
|
// src/preview-api/modules/preview-web/parseArgsParam.ts
|
|
4932
|
-
var
|
|
4933
|
-
var
|
|
4934
|
-
var
|
|
4935
|
-
|
|
4936
|
-
typeof e == "boolean" ? !0 : typeof e == "string" ?
|
|
4937
|
-
r, t)) : N(e) ? Object.entries(e).every(([t, o]) =>
|
|
4899
|
+
var Mn = require("storybook/internal/client-logger");
|
|
4900
|
+
var jn = _(Dr(), 1), _n = _($(), 1);
|
|
4901
|
+
var kn = /^[a-zA-Z0-9 _-]*$/, Nn = /^-?[0-9]+(\.[0-9]+)?$/, Vi = /^#([a-f0-9]{3,4}|[a-f0-9]{6}|[a-f0-9]{8})$/i, Ln = /^(rgba?|hsla?)\(([0-9]{1,3}),\s?([0-9]{1,3})%?,\s?([0-9]{1,3})%?,?\s?([0-9](\.[0-9]{1,2})?)?\)$/i,
|
|
4902
|
+
gt = /* @__PURE__ */ s((r = "", e) => r === null || r === "" || !kn.test(r) ? !1 : e == null || e instanceof Date || typeof e == "number" ||
|
|
4903
|
+
typeof e == "boolean" ? !0 : typeof e == "string" ? kn.test(e) || Nn.test(e) || Vi.test(e) || Ln.test(e) : Array.isArray(e) ? e.every((t) => gt(
|
|
4904
|
+
r, t)) : N(e) ? Object.entries(e).every(([t, o]) => gt(t, o)) : !1, "validateArgs"), Wi = {
|
|
4938
4905
|
delimiter: ";",
|
|
4939
4906
|
// we're parsing a single query param
|
|
4940
4907
|
nesting: !0,
|
|
@@ -4956,17 +4923,17 @@ r, t)) : N(e) ? Object.entries(e).every(([t, o]) => Ct(t, o)) : !1, "validateArg
|
|
|
4956
4923
|
return new Date(r.replaceAll(" ", "+").slice(6, -1));
|
|
4957
4924
|
if (r.startsWith("!hex(") && r.endsWith(")"))
|
|
4958
4925
|
return `#${r.slice(5, -1)}`;
|
|
4959
|
-
let e = r.slice(1).match(
|
|
4926
|
+
let e = r.slice(1).match(Ln);
|
|
4960
4927
|
if (e)
|
|
4961
4928
|
return r.startsWith("!rgba") || r.startsWith("!RGBA") ? `${e[1]}(${e[2]}, ${e[3]}, ${e[4]}, ${e[5]})` : r.startsWith("!hsla") || r.startsWith(
|
|
4962
4929
|
"!HSLA") ? `${e[1]}(${e[2]}, ${e[3]}%, ${e[4]}%, ${e[5]})` : r.startsWith("!rgb") || r.startsWith("!RGB") ? `${e[1]}(${e[2]}, ${e[3]}\
|
|
4963
4930
|
, ${e[4]})` : `${e[1]}(${e[2]}, ${e[3]}%, ${e[4]}%)`;
|
|
4964
4931
|
}
|
|
4965
|
-
return
|
|
4932
|
+
return Nn.test(r) ? Number(r) : r;
|
|
4966
4933
|
}
|
|
4967
|
-
},
|
|
4934
|
+
}, bt = /* @__PURE__ */ s((r) => {
|
|
4968
4935
|
let e = r.split(";").map((t) => t.replace("=", "~").replace(":", "="));
|
|
4969
|
-
return Object.entries((0,
|
|
4936
|
+
return Object.entries((0, jn.parse)(e.join(";"), Wi)).reduce((t, [o, n]) => gt(o, n) ? Object.assign(t, { [o]: n }) : (Mn.once.warn(_n.dedent`
|
|
4970
4937
|
Omitted potentially unsafe URL args.
|
|
4971
4938
|
|
|
4972
4939
|
More info: https://storybook.js.org/docs/writing-stories/args#setting-args-through-the-url
|
|
@@ -4974,87 +4941,87 @@ r, t)) : N(e) ? Object.entries(e).every(([t, o]) => Ct(t, o)) : !1, "validateArg
|
|
|
4974
4941
|
}, "parseArgsParam");
|
|
4975
4942
|
|
|
4976
4943
|
// src/preview-api/modules/preview-web/UrlStore.ts
|
|
4977
|
-
var { history:
|
|
4978
|
-
function
|
|
4944
|
+
var { history: Bn, document: le } = qn.global;
|
|
4945
|
+
function $i(r) {
|
|
4979
4946
|
let e = (r || "").match(/^\/story\/(.+)/);
|
|
4980
4947
|
if (!e)
|
|
4981
4948
|
throw new Error(`Invalid path '${r}', must start with '/story/'`);
|
|
4982
4949
|
return e[1];
|
|
4983
4950
|
}
|
|
4984
|
-
|
|
4985
|
-
var
|
|
4951
|
+
s($i, "pathToId");
|
|
4952
|
+
var zn = /* @__PURE__ */ s(({
|
|
4986
4953
|
selection: r,
|
|
4987
4954
|
extraParams: e
|
|
4988
4955
|
}) => {
|
|
4989
|
-
let t = le?.location.search.slice(1), { path: o, selectedKind:
|
|
4990
|
-
return `?${(0,
|
|
4956
|
+
let t = le?.location.search.slice(1), { path: o, selectedKind: n, selectedStory: i, ...a } = (0, Qe.parse)(t);
|
|
4957
|
+
return `?${(0, Qe.stringify)({
|
|
4991
4958
|
...a,
|
|
4992
4959
|
...e,
|
|
4993
4960
|
...r && { id: r.storyId, viewMode: r.viewMode }
|
|
4994
4961
|
})}`;
|
|
4995
|
-
}, "getQueryString"),
|
|
4962
|
+
}, "getQueryString"), Yi = /* @__PURE__ */ s((r) => {
|
|
4996
4963
|
if (!r)
|
|
4997
4964
|
return;
|
|
4998
|
-
let e =
|
|
4999
|
-
le.title = r.storyId,
|
|
5000
|
-
}, "setPath"),
|
|
4965
|
+
let e = zn({ selection: r }), { hash: t = "" } = le.location;
|
|
4966
|
+
le.title = r.storyId, Bn.replaceState({}, "", `${le.location.pathname}${e}${t}`);
|
|
4967
|
+
}, "setPath"), Ki = /* @__PURE__ */ s((r) => r != null && typeof r == "object" && Array.isArray(r) === !1, "isObject"), Je = /* @__PURE__ */ s(
|
|
5001
4968
|
(r) => {
|
|
5002
4969
|
if (r !== void 0) {
|
|
5003
4970
|
if (typeof r == "string")
|
|
5004
4971
|
return r;
|
|
5005
4972
|
if (Array.isArray(r))
|
|
5006
|
-
return
|
|
5007
|
-
if (
|
|
5008
|
-
return
|
|
4973
|
+
return Je(r[0]);
|
|
4974
|
+
if (Ki(r))
|
|
4975
|
+
return Je(
|
|
5009
4976
|
Object.values(r).filter(Boolean)
|
|
5010
4977
|
);
|
|
5011
4978
|
}
|
|
5012
|
-
}, "getFirstString"),
|
|
4979
|
+
}, "getFirstString"), Xi = /* @__PURE__ */ s(() => {
|
|
5013
4980
|
if (typeof le < "u") {
|
|
5014
|
-
let r = le.location.search.slice(1), e = (0,
|
|
5015
|
-
string" ?
|
|
5016
|
-
(typeof
|
|
5017
|
-
let i =
|
|
4981
|
+
let r = le.location.search.slice(1), e = (0, Qe.parse)(r), t = typeof e.args == "string" ? bt(e.args) : void 0, o = typeof e.globals == "\
|
|
4982
|
+
string" ? bt(e.globals) : void 0, n = Je(e.viewMode);
|
|
4983
|
+
(typeof n != "string" || !n.match(/docs|story/)) && (n = "story");
|
|
4984
|
+
let i = Je(e.path), a = i ? $i(i) : Je(e.id);
|
|
5018
4985
|
if (a)
|
|
5019
|
-
return { storySpecifier: a, args: t, globals: o, viewMode:
|
|
4986
|
+
return { storySpecifier: a, args: t, globals: o, viewMode: n };
|
|
5020
4987
|
}
|
|
5021
4988
|
return null;
|
|
5022
4989
|
}, "getSelectionSpecifierFromPath"), we = class {
|
|
5023
4990
|
static {
|
|
5024
|
-
|
|
4991
|
+
s(this, "UrlStore");
|
|
5025
4992
|
}
|
|
5026
4993
|
constructor() {
|
|
5027
|
-
this.selectionSpecifier =
|
|
4994
|
+
this.selectionSpecifier = Xi();
|
|
5028
4995
|
}
|
|
5029
4996
|
setSelection(e) {
|
|
5030
|
-
this.selection = e,
|
|
4997
|
+
this.selection = e, Yi(this.selection);
|
|
5031
4998
|
}
|
|
5032
4999
|
setQueryParams(e) {
|
|
5033
|
-
let t =
|
|
5034
|
-
|
|
5000
|
+
let t = zn({ extraParams: e }), { hash: o = "" } = le.location;
|
|
5001
|
+
Bn.replaceState({}, "", `${le.location.pathname}${t}${o}`);
|
|
5035
5002
|
}
|
|
5036
5003
|
};
|
|
5037
5004
|
|
|
5038
5005
|
// src/preview-api/modules/preview-web/WebView.ts
|
|
5039
|
-
var
|
|
5040
|
-
var { document:
|
|
5041
|
-
EPARING_STORY", i.PREPARING_DOCS = "PREPARING_DOCS", i.ERROR = "ERROR", i))(
|
|
5006
|
+
var Ss = require("storybook/internal/client-logger"), Ts = require("@storybook/global"), xs = _(hs(), 1), Rs = _(Dr(), 1), ws = _($(), 1);
|
|
5007
|
+
var { document: k } = Ts.global, gs = 100, As = /* @__PURE__ */ ((i) => (i.MAIN = "MAIN", i.NOPREVIEW = "NOPREVIEW", i.PREPARING_STORY = "PR\
|
|
5008
|
+
EPARING_STORY", i.PREPARING_DOCS = "PREPARING_DOCS", i.ERROR = "ERROR", i))(As || {}), Et = {
|
|
5042
5009
|
PREPARING_STORY: "sb-show-preparing-story",
|
|
5043
5010
|
PREPARING_DOCS: "sb-show-preparing-docs",
|
|
5044
5011
|
MAIN: "sb-show-main",
|
|
5045
5012
|
NOPREVIEW: "sb-show-nopreview",
|
|
5046
5013
|
ERROR: "sb-show-errordisplay"
|
|
5047
|
-
},
|
|
5014
|
+
}, Ct = {
|
|
5048
5015
|
centered: "sb-main-centered",
|
|
5049
5016
|
fullscreen: "sb-main-fullscreen",
|
|
5050
5017
|
padded: "sb-main-padded"
|
|
5051
|
-
},
|
|
5018
|
+
}, bs = new xs.default({
|
|
5052
5019
|
escapeXML: !0
|
|
5053
5020
|
}), Ee = class {
|
|
5054
5021
|
constructor() {
|
|
5055
5022
|
this.testing = !1;
|
|
5056
|
-
if (typeof
|
|
5057
|
-
let { __SPECIAL_TEST_PARAMETER__: e } = (0,
|
|
5023
|
+
if (typeof k < "u") {
|
|
5024
|
+
let { __SPECIAL_TEST_PARAMETER__: e } = (0, Rs.parse)(k.location.search.slice(1));
|
|
5058
5025
|
switch (e) {
|
|
5059
5026
|
case "preparing-story": {
|
|
5060
5027
|
this.showPreparingStory(), this.testing = !0;
|
|
@@ -5069,50 +5036,50 @@ EPARING_STORY", i.PREPARING_DOCS = "PREPARING_DOCS", i.ERROR = "ERROR", i))(Ds |
|
|
|
5069
5036
|
}
|
|
5070
5037
|
}
|
|
5071
5038
|
static {
|
|
5072
|
-
|
|
5039
|
+
s(this, "WebView");
|
|
5073
5040
|
}
|
|
5074
5041
|
// Get ready to render a story, returning the element to render to
|
|
5075
5042
|
prepareForStory(e) {
|
|
5076
|
-
return this.showStory(), this.applyLayout(e.parameters.layout),
|
|
5043
|
+
return this.showStory(), this.applyLayout(e.parameters.layout), k.documentElement.scrollTop = 0, k.documentElement.scrollLeft = 0, this.
|
|
5077
5044
|
storyRoot();
|
|
5078
5045
|
}
|
|
5079
5046
|
storyRoot() {
|
|
5080
|
-
return
|
|
5047
|
+
return k.getElementById("storybook-root");
|
|
5081
5048
|
}
|
|
5082
5049
|
prepareForDocs() {
|
|
5083
|
-
return this.showMain(), this.showDocs(), this.applyLayout("fullscreen"),
|
|
5050
|
+
return this.showMain(), this.showDocs(), this.applyLayout("fullscreen"), k.documentElement.scrollTop = 0, k.documentElement.scrollLeft =
|
|
5084
5051
|
0, this.docsRoot();
|
|
5085
5052
|
}
|
|
5086
5053
|
docsRoot() {
|
|
5087
|
-
return
|
|
5054
|
+
return k.getElementById("storybook-docs");
|
|
5088
5055
|
}
|
|
5089
5056
|
applyLayout(e = "padded") {
|
|
5090
5057
|
if (e === "none") {
|
|
5091
|
-
|
|
5058
|
+
k.body.classList.remove(this.currentLayoutClass), this.currentLayoutClass = null;
|
|
5092
5059
|
return;
|
|
5093
5060
|
}
|
|
5094
5061
|
this.checkIfLayoutExists(e);
|
|
5095
|
-
let t =
|
|
5096
|
-
|
|
5062
|
+
let t = Ct[e];
|
|
5063
|
+
k.body.classList.remove(this.currentLayoutClass), k.body.classList.add(t), this.currentLayoutClass = t;
|
|
5097
5064
|
}
|
|
5098
5065
|
checkIfLayoutExists(e) {
|
|
5099
|
-
|
|
5100
|
-
|
|
5066
|
+
Ct[e] || Ss.logger.warn(
|
|
5067
|
+
ws.dedent`
|
|
5101
5068
|
The desired layout: ${e} is not a valid option.
|
|
5102
|
-
The possible options are: ${Object.keys(
|
|
5069
|
+
The possible options are: ${Object.keys(Ct).join(", ")}, none.
|
|
5103
5070
|
`
|
|
5104
5071
|
);
|
|
5105
5072
|
}
|
|
5106
5073
|
showMode(e) {
|
|
5107
|
-
clearTimeout(this.preparingTimeout), Object.keys(
|
|
5108
|
-
t === e ?
|
|
5074
|
+
clearTimeout(this.preparingTimeout), Object.keys(As).forEach((t) => {
|
|
5075
|
+
t === e ? k.body.classList.add(Et[t]) : k.body.classList.remove(Et[t]);
|
|
5109
5076
|
});
|
|
5110
5077
|
}
|
|
5111
5078
|
showErrorDisplay({ message: e = "", stack: t = "" }) {
|
|
5112
|
-
let o = e,
|
|
5079
|
+
let o = e, n = t, i = e.split(`
|
|
5113
5080
|
`);
|
|
5114
|
-
i.length > 1 && ([o] = i,
|
|
5115
|
-
`).replace(/^\n/, "")),
|
|
5081
|
+
i.length > 1 && ([o] = i, n = i.slice(1).join(`
|
|
5082
|
+
`).replace(/^\n/, "")), k.getElementById("error-message").innerHTML = bs.toHtml(o), k.getElementById("error-stack").innerHTML = bs.toHtml(n),
|
|
5116
5083
|
this.showMode("ERROR");
|
|
5117
5084
|
}
|
|
5118
5085
|
showNoPreview() {
|
|
@@ -5122,12 +5089,12 @@ true"));
|
|
|
5122
5089
|
showPreparingStory({ immediate: e = !1 } = {}) {
|
|
5123
5090
|
clearTimeout(this.preparingTimeout), e ? this.showMode("PREPARING_STORY") : this.preparingTimeout = setTimeout(
|
|
5124
5091
|
() => this.showMode("PREPARING_STORY"),
|
|
5125
|
-
|
|
5092
|
+
gs
|
|
5126
5093
|
);
|
|
5127
5094
|
}
|
|
5128
5095
|
showPreparingDocs({ immediate: e = !1 } = {}) {
|
|
5129
5096
|
clearTimeout(this.preparingTimeout), e ? this.showMode("PREPARING_DOCS") : this.preparingTimeout = setTimeout(() => this.showMode("PREPA\
|
|
5130
|
-
RING_DOCS"),
|
|
5097
|
+
RING_DOCS"), gs);
|
|
5131
5098
|
}
|
|
5132
5099
|
showMain() {
|
|
5133
5100
|
this.showMode("MAIN");
|
|
@@ -5139,26 +5106,26 @@ RING_DOCS"), Es);
|
|
|
5139
5106
|
this.docsRoot().setAttribute("hidden", "true"), this.storyRoot().removeAttribute("hidden");
|
|
5140
5107
|
}
|
|
5141
5108
|
showStoryDuringRender() {
|
|
5142
|
-
|
|
5109
|
+
k.body.classList.add(Et.MAIN);
|
|
5143
5110
|
}
|
|
5144
5111
|
};
|
|
5145
5112
|
|
|
5146
5113
|
// src/preview-api/modules/preview-web/PreviewWeb.tsx
|
|
5147
|
-
var
|
|
5114
|
+
var er = class extends Te {
|
|
5148
5115
|
constructor(t, o) {
|
|
5149
5116
|
super(t, o, new we(), new Ee());
|
|
5150
5117
|
this.importFn = t;
|
|
5151
5118
|
this.getProjectAnnotations = o;
|
|
5152
|
-
|
|
5119
|
+
Es.global.__STORYBOOK_PREVIEW__ = this;
|
|
5153
5120
|
}
|
|
5154
5121
|
static {
|
|
5155
|
-
|
|
5122
|
+
s(this, "PreviewWeb");
|
|
5156
5123
|
}
|
|
5157
5124
|
};
|
|
5158
5125
|
|
|
5159
5126
|
// src/preview-api/modules/preview-web/simulate-pageload.ts
|
|
5160
|
-
var
|
|
5161
|
-
var { document: Ce } =
|
|
5127
|
+
var vs = require("@storybook/global");
|
|
5128
|
+
var { document: Ce } = vs.global, Oa = [
|
|
5162
5129
|
"application/javascript",
|
|
5163
5130
|
"application/ecmascript",
|
|
5164
5131
|
"application/x-ecmascript",
|
|
@@ -5177,50 +5144,50 @@ var { document: Ce } = Ms.global, qa = [
|
|
|
5177
5144
|
"text/x-javascript",
|
|
5178
5145
|
// Support modern javascript
|
|
5179
5146
|
"module"
|
|
5180
|
-
],
|
|
5181
|
-
function
|
|
5147
|
+
], Da = "script", Cs = "scripts-root";
|
|
5148
|
+
function rr() {
|
|
5182
5149
|
let r = Ce.createEvent("Event");
|
|
5183
5150
|
r.initEvent("DOMContentLoaded", !0, !0), Ce.dispatchEvent(r);
|
|
5184
5151
|
}
|
|
5185
|
-
|
|
5186
|
-
function
|
|
5152
|
+
s(rr, "simulateDOMContentLoaded");
|
|
5153
|
+
function ka(r, e, t) {
|
|
5187
5154
|
let o = Ce.createElement("script");
|
|
5188
5155
|
o.type = r.type === "module" ? "module" : "text/javascript", r.src ? (o.onload = e, o.onerror = e, o.src = r.src) : o.textContent = r.innerText,
|
|
5189
5156
|
t ? t.appendChild(o) : Ce.head.appendChild(o), r.parentNode.removeChild(r), r.src || e();
|
|
5190
5157
|
}
|
|
5191
|
-
|
|
5192
|
-
function
|
|
5158
|
+
s(ka, "insertScript");
|
|
5159
|
+
function Ps(r, e, t = 0) {
|
|
5193
5160
|
r[t](() => {
|
|
5194
|
-
t++, t === r.length ? e() :
|
|
5161
|
+
t++, t === r.length ? e() : Ps(r, e, t);
|
|
5195
5162
|
});
|
|
5196
5163
|
}
|
|
5197
|
-
|
|
5198
|
-
function
|
|
5199
|
-
let e = Ce.getElementById(
|
|
5200
|
-
e ? e.innerHTML = "" : (e = Ce.createElement("div"), e.id =
|
|
5201
|
-
let t = Array.from(r.querySelectorAll(
|
|
5164
|
+
s(Ps, "insertScriptsSequentially");
|
|
5165
|
+
function vt(r) {
|
|
5166
|
+
let e = Ce.getElementById(Cs);
|
|
5167
|
+
e ? e.innerHTML = "" : (e = Ce.createElement("div"), e.id = Cs, Ce.body.appendChild(e));
|
|
5168
|
+
let t = Array.from(r.querySelectorAll(Da));
|
|
5202
5169
|
if (t.length) {
|
|
5203
5170
|
let o = [];
|
|
5204
|
-
t.forEach((
|
|
5205
|
-
let i =
|
|
5206
|
-
(!i ||
|
|
5207
|
-
}), o.length &&
|
|
5171
|
+
t.forEach((n) => {
|
|
5172
|
+
let i = n.getAttribute("type");
|
|
5173
|
+
(!i || Oa.includes(i)) && o.push((a) => ka(n, a, e));
|
|
5174
|
+
}), o.length && Ps(o, rr, void 0);
|
|
5208
5175
|
} else
|
|
5209
|
-
|
|
5176
|
+
rr();
|
|
5210
5177
|
}
|
|
5211
|
-
|
|
5178
|
+
s(vt, "simulatePageLoad");
|
|
5212
5179
|
|
|
5213
5180
|
// src/docs-tools/shared.ts
|
|
5214
|
-
var
|
|
5215
|
-
var
|
|
5181
|
+
var Fs = "storybook/docs", lu = `${Fs}/panel`;
|
|
5182
|
+
var Is = `${Fs}/snippet-rendered`;
|
|
5216
5183
|
|
|
5217
5184
|
// src/preview-api/modules/preview-web/emitTransformCode.ts
|
|
5218
|
-
async function
|
|
5219
|
-
let t = e.parameters?.docs?.source?.transform, { id: o, unmappedArgs:
|
|
5220
|
-
q.getChannel().emit(
|
|
5185
|
+
async function Pt(r, e) {
|
|
5186
|
+
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;
|
|
5187
|
+
q.getChannel().emit(Is, {
|
|
5221
5188
|
id: o,
|
|
5222
5189
|
source: a,
|
|
5223
|
-
args:
|
|
5190
|
+
args: n
|
|
5224
5191
|
});
|
|
5225
5192
|
}
|
|
5226
|
-
|
|
5193
|
+
s(Pt, "emitTransformCode");
|