storybook 9.0.0-beta.4 → 9.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/server/base-preview-head.html +2 -1
- package/dist/babel/index.cjs +15060 -14974
- package/dist/babel/index.d.ts +37 -18
- package/dist/babel/index.js +15097 -15011
- package/dist/bin/index.cjs +44 -44
- package/dist/bin/index.js +44 -44
- package/dist/builder-manager/index.cjs +104 -99
- package/dist/builder-manager/index.js +103 -98
- package/dist/cli/bin/index.cjs +1 -1
- package/dist/cli/bin/index.js +1 -1
- package/dist/cli/index.cjs +19438 -19340
- package/dist/cli/index.js +19449 -19351
- package/dist/common/index.cjs +4997 -4925
- package/dist/common/index.js +5088 -5012
- package/dist/components/index.cjs +4581 -4419
- package/dist/components/index.d.ts +12 -12
- package/dist/components/index.js +3847 -3681
- package/dist/core-server/index.cjs +6358 -6274
- package/dist/core-server/index.js +6406 -6318
- package/dist/core-server/presets/common-manager.js +3863 -3468
- package/dist/core-server/presets/common-preset.cjs +2302 -2236
- package/dist/core-server/presets/common-preset.js +2389 -2319
- package/dist/docs-tools/index.cjs +484 -464
- package/dist/docs-tools/index.js +502 -482
- package/dist/highlight/index.cjs +19 -18
- package/dist/highlight/index.d.ts +4 -5
- package/dist/highlight/index.js +3 -2
- package/dist/highlight/preview.cjs +311 -307
- package/dist/highlight/preview.js +293 -289
- package/dist/instrumenter/index.cjs +561 -559
- package/dist/instrumenter/index.js +1551 -1498
- package/dist/manager/globals-module-info.cjs +1 -0
- package/dist/manager/globals-module-info.js +1 -0
- package/dist/manager/globals-runtime.js +19639 -19374
- package/dist/manager/runtime.js +4372 -4133
- package/dist/manager-api/index.cjs +2375 -2319
- package/dist/manager-api/index.js +1722 -1666
- package/dist/node-logger/index.cjs +25 -25
- package/dist/node-logger/index.js +25 -25
- package/dist/preview/runtime.js +12774 -12699
- package/dist/preview-api/index.cjs +1113 -1094
- package/dist/preview-api/index.js +1161 -1142
- package/dist/router/index.cjs +1366 -1347
- package/dist/router/index.js +594 -575
- package/dist/server-errors.cjs +6 -6
- package/dist/server-errors.js +6 -6
- package/dist/telemetry/index.cjs +696 -691
- package/dist/telemetry/index.js +764 -759
- package/dist/test/index.cjs +69 -70
- package/dist/test/index.d.ts +1216 -74
- package/dist/test/index.js +128 -130
- package/dist/test/preview.cjs +16 -16
- package/dist/test/preview.js +15 -15
- package/dist/theming/create.cjs +16 -17
- package/dist/theming/create.js +346 -228
- package/dist/theming/index.cjs +16 -17
- package/dist/theming/index.js +948 -839
- package/package.json +4 -12
|
@@ -81,7 +81,7 @@ function Se(e, i) {
|
|
|
81
81
|
function Pe(e, i, t, r) {
|
|
82
82
|
var a = arguments.length, n = a < 3 ? i : r === null ? r = Object.getOwnPropertyDescriptor(i, t) : r, s;
|
|
83
83
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") n = Reflect.decorate(e, i, t, r);
|
|
84
|
-
else for (var
|
|
84
|
+
else for (var l = e.length - 1; l >= 0; l--) (s = e[l]) && (n = (a < 3 ? s(n) : a > 3 ? s(i, t, n) : s(i, t)) || n);
|
|
85
85
|
return a > 3 && n && Object.defineProperty(i, t, n), n;
|
|
86
86
|
}
|
|
87
87
|
function Te(e, i) {
|
|
@@ -95,8 +95,8 @@ function Re(e, i, t, r, a, n) {
|
|
|
95
95
|
return v;
|
|
96
96
|
}
|
|
97
97
|
o(s, "accept");
|
|
98
|
-
for (var
|
|
99
|
-
(
|
|
98
|
+
for (var l = r.kind, p = l === "getter" ? "get" : l === "setter" ? "set" : "value", c = !i && e ? r.static ? e : e.prototype : null, u = i ||
|
|
99
|
+
(c ? Object.getOwnPropertyDescriptor(c, r.name) : {}), d, x = !1, g = t.length - 1; g >= 0; g--) {
|
|
100
100
|
var m = {};
|
|
101
101
|
for (var f in r) m[f] = f === "access" ? {} : r[f];
|
|
102
102
|
for (var f in r.access) m.access[f] = r.access[f];
|
|
@@ -104,14 +104,14 @@ function Re(e, i, t, r, a, n) {
|
|
|
104
104
|
if (x) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
105
105
|
n.push(s(v || null));
|
|
106
106
|
};
|
|
107
|
-
var y = (0, t[g])(
|
|
108
|
-
if (
|
|
107
|
+
var y = (0, t[g])(l === "accessor" ? { get: u.get, set: u.set } : u[p], m);
|
|
108
|
+
if (l === "accessor") {
|
|
109
109
|
if (y === void 0) continue;
|
|
110
110
|
if (y === null || typeof y != "object") throw new TypeError("Object expected");
|
|
111
111
|
(d = s(y.get)) && (u.get = d), (d = s(y.set)) && (u.set = d), (d = s(y.init)) && a.unshift(d);
|
|
112
|
-
} else (d = s(y)) && (
|
|
112
|
+
} else (d = s(y)) && (l === "field" ? a.unshift(d) : u[p] = d);
|
|
113
113
|
}
|
|
114
|
-
|
|
114
|
+
c && Object.defineProperty(c, r.name, u), x = !0;
|
|
115
115
|
}
|
|
116
116
|
function Fe(e, i, t) {
|
|
117
117
|
for (var r = arguments.length > 2, a = 0; a < i.length; a++)
|
|
@@ -135,26 +135,26 @@ function Ae(e, i, t, r) {
|
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
137
|
return o(a, "adopt"), new (t || (t = Promise))(function(n, s) {
|
|
138
|
-
function
|
|
138
|
+
function l(u) {
|
|
139
139
|
try {
|
|
140
|
-
|
|
140
|
+
c(r.next(u));
|
|
141
141
|
} catch (d) {
|
|
142
142
|
s(d);
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
o(
|
|
145
|
+
o(l, "fulfilled");
|
|
146
146
|
function p(u) {
|
|
147
147
|
try {
|
|
148
|
-
|
|
148
|
+
c(r.throw(u));
|
|
149
149
|
} catch (d) {
|
|
150
150
|
s(d);
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
o(p, "rejected");
|
|
154
|
-
function
|
|
155
|
-
u.done ? n(u.value) : a(u.value).then(
|
|
154
|
+
function c(u) {
|
|
155
|
+
u.done ? n(u.value) : a(u.value).then(l, p);
|
|
156
156
|
}
|
|
157
|
-
o(
|
|
157
|
+
o(c, "step"), c((r = r.apply(e, i || [])).next());
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
160
|
function Ne(e, i) {
|
|
@@ -162,60 +162,60 @@ function Ne(e, i) {
|
|
|
162
162
|
if (n[0] & 1) throw n[1];
|
|
163
163
|
return n[1];
|
|
164
164
|
}, "sent"), trys: [], ops: [] }, r, a, n, s = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
|
|
165
|
-
return s.next =
|
|
165
|
+
return s.next = l(0), s.throw = l(1), s.return = l(2), typeof Symbol == "function" && (s[Symbol.iterator] = function() {
|
|
166
166
|
return this;
|
|
167
167
|
}), s;
|
|
168
|
-
function c
|
|
168
|
+
function l(c) {
|
|
169
169
|
return function(u) {
|
|
170
|
-
return p([
|
|
170
|
+
return p([c, u]);
|
|
171
171
|
};
|
|
172
172
|
}
|
|
173
|
-
function p(
|
|
173
|
+
function p(c) {
|
|
174
174
|
if (r) throw new TypeError("Generator is already executing.");
|
|
175
|
-
for (; s && (s = 0,
|
|
176
|
-
if (r = 1, a && (n =
|
|
175
|
+
for (; s && (s = 0, c[0] && (t = 0)), t; ) try {
|
|
176
|
+
if (r = 1, a && (n = c[0] & 2 ? a.return : c[0] ? a.throw || ((n = a.return) && n.call(a), 0) : a.next) && !(n = n.call(a, c[1])).done)
|
|
177
177
|
return n;
|
|
178
|
-
switch (a = 0, n && (
|
|
178
|
+
switch (a = 0, n && (c = [c[0] & 2, n.value]), c[0]) {
|
|
179
179
|
case 0:
|
|
180
180
|
case 1:
|
|
181
|
-
n =
|
|
181
|
+
n = c;
|
|
182
182
|
break;
|
|
183
183
|
case 4:
|
|
184
|
-
return t.label++, { value:
|
|
184
|
+
return t.label++, { value: c[1], done: !1 };
|
|
185
185
|
case 5:
|
|
186
|
-
t.label++, a =
|
|
186
|
+
t.label++, a = c[1], c = [0];
|
|
187
187
|
continue;
|
|
188
188
|
case 7:
|
|
189
|
-
|
|
189
|
+
c = t.ops.pop(), t.trys.pop();
|
|
190
190
|
continue;
|
|
191
191
|
default:
|
|
192
|
-
if (n = t.trys, !(n = n.length > 0 && n[n.length - 1]) && (
|
|
192
|
+
if (n = t.trys, !(n = n.length > 0 && n[n.length - 1]) && (c[0] === 6 || c[0] === 2)) {
|
|
193
193
|
t = 0;
|
|
194
194
|
continue;
|
|
195
195
|
}
|
|
196
|
-
if (
|
|
197
|
-
t.label =
|
|
196
|
+
if (c[0] === 3 && (!n || c[1] > n[0] && c[1] < n[3])) {
|
|
197
|
+
t.label = c[1];
|
|
198
198
|
break;
|
|
199
199
|
}
|
|
200
|
-
if (
|
|
201
|
-
t.label = n[1], n =
|
|
200
|
+
if (c[0] === 6 && t.label < n[1]) {
|
|
201
|
+
t.label = n[1], n = c;
|
|
202
202
|
break;
|
|
203
203
|
}
|
|
204
204
|
if (n && t.label < n[2]) {
|
|
205
|
-
t.label = n[2], t.ops.push(
|
|
205
|
+
t.label = n[2], t.ops.push(c);
|
|
206
206
|
break;
|
|
207
207
|
}
|
|
208
208
|
n[2] && t.ops.pop(), t.trys.pop();
|
|
209
209
|
continue;
|
|
210
210
|
}
|
|
211
|
-
|
|
211
|
+
c = i.call(e, t);
|
|
212
212
|
} catch (u) {
|
|
213
|
-
|
|
213
|
+
c = [6, u], a = 0;
|
|
214
214
|
} finally {
|
|
215
215
|
r = n = 0;
|
|
216
216
|
}
|
|
217
|
-
if (
|
|
218
|
-
return { value:
|
|
217
|
+
if (c[0] & 5) throw c[1];
|
|
218
|
+
return { value: c[0] ? c[1] : void 0, done: !0 };
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
function De(e, i) {
|
|
@@ -237,8 +237,8 @@ function ce(e, i) {
|
|
|
237
237
|
var r = t.call(e), a, n = [], s;
|
|
238
238
|
try {
|
|
239
239
|
for (; (i === void 0 || i-- > 0) && !(a = r.next()).done; ) n.push(a.value);
|
|
240
|
-
} catch (
|
|
241
|
-
s = { error:
|
|
240
|
+
} catch (l) {
|
|
241
|
+
s = { error: l };
|
|
242
242
|
} finally {
|
|
243
243
|
try {
|
|
244
244
|
a && !a.done && (t = r.return) && t.call(r);
|
|
@@ -256,7 +256,7 @@ function Ie() {
|
|
|
256
256
|
function Me() {
|
|
257
257
|
for (var e = 0, i = 0, t = arguments.length; i < t; i++) e += arguments[i].length;
|
|
258
258
|
for (var r = Array(e), a = 0, i = 0; i < t; i++)
|
|
259
|
-
for (var n = arguments[i], s = 0,
|
|
259
|
+
for (var n = arguments[i], s = 0, l = n.length; s < l; s++, a++)
|
|
260
260
|
r[a] = n[s];
|
|
261
261
|
return r;
|
|
262
262
|
}
|
|
@@ -271,7 +271,7 @@ function C(e) {
|
|
|
271
271
|
function qe(e, i, t) {
|
|
272
272
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
273
273
|
var r = t.apply(e, i || []), a, n = [];
|
|
274
|
-
return a = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype),
|
|
274
|
+
return a = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), l("next"), l("throw"), l("return", s), a[Symbol.
|
|
275
275
|
asyncIterator] = function() {
|
|
276
276
|
return this;
|
|
277
277
|
}, a;
|
|
@@ -280,7 +280,7 @@ function qe(e, i, t) {
|
|
|
280
280
|
return Promise.resolve(m).then(g, d);
|
|
281
281
|
};
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function l(g, m) {
|
|
284
284
|
r[g] && (a[g] = function(f) {
|
|
285
285
|
return new Promise(function(y, v) {
|
|
286
286
|
n.push([g, f, y, v]) > 1 || p(g, f);
|
|
@@ -289,12 +289,12 @@ function qe(e, i, t) {
|
|
|
289
289
|
}
|
|
290
290
|
function p(g, m) {
|
|
291
291
|
try {
|
|
292
|
-
|
|
292
|
+
c(r[g](m));
|
|
293
293
|
} catch (f) {
|
|
294
294
|
x(n[0][3], f);
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
|
-
function
|
|
297
|
+
function c(g) {
|
|
298
298
|
g.value instanceof C ? Promise.resolve(g.value.v).then(u, d) : x(n[0][2], g);
|
|
299
299
|
}
|
|
300
300
|
function u(g) {
|
|
@@ -329,14 +329,14 @@ function We(e) {
|
|
|
329
329
|
}, t);
|
|
330
330
|
function r(n) {
|
|
331
331
|
t[n] = e[n] && function(s) {
|
|
332
|
-
return new Promise(function(
|
|
333
|
-
s = e[n](s), a(
|
|
332
|
+
return new Promise(function(l, p) {
|
|
333
|
+
s = e[n](s), a(l, p, s.done, s.value);
|
|
334
334
|
});
|
|
335
335
|
};
|
|
336
336
|
}
|
|
337
|
-
function a(n, s,
|
|
338
|
-
Promise.resolve(p).then(function(
|
|
339
|
-
n({ value:
|
|
337
|
+
function a(n, s, l, p) {
|
|
338
|
+
Promise.resolve(p).then(function(c) {
|
|
339
|
+
n({ value: c, done: l });
|
|
340
340
|
}, s);
|
|
341
341
|
}
|
|
342
342
|
}
|
|
@@ -585,19 +585,19 @@ sx", ".mjs", ".cjs", ".js", ".css", ".json"];
|
|
|
585
585
|
return {
|
|
586
586
|
name: "@yarnpkg/esbuild-plugin-pnp",
|
|
587
587
|
setup(n) {
|
|
588
|
-
var s,
|
|
588
|
+
var s, l;
|
|
589
589
|
let { findPnpApi: p } = require("module");
|
|
590
590
|
if (typeof p > "u")
|
|
591
591
|
return;
|
|
592
|
-
let
|
|
593
|
-
void 0 ?
|
|
592
|
+
let c = oi((s = n.initialOptions.external) !== null && s !== void 0 ? s : []), u = (l = n.initialOptions.platform) !== null && l !==
|
|
593
|
+
void 0 ? l : "browser", d = u === "node", x = new Set(n.initialOptions.conditions);
|
|
594
594
|
x.add("default"), (u === "browser" || u === "node") && x.add(u);
|
|
595
595
|
let g = new Set(x);
|
|
596
596
|
g.add("import");
|
|
597
597
|
let m = new Set(x);
|
|
598
598
|
m.add("require"), n.onResolve({ filter: t }, (f) => {
|
|
599
599
|
var y, v;
|
|
600
|
-
if (si(f.path,
|
|
600
|
+
if (si(f.path, c))
|
|
601
601
|
return { external: !0 };
|
|
602
602
|
let _ = x;
|
|
603
603
|
f.kind === "dynamic-import" || f.kind === "import-statement" ? _ = g : (f.kind === "require-call" || f.kind === "require-resolve") &&
|
|
@@ -659,12 +659,13 @@ function mi(e) {
|
|
|
659
659
|
if (i == null) return;
|
|
660
660
|
let t = e._parsedUrl;
|
|
661
661
|
if (t && t.raw === i) return t;
|
|
662
|
-
let r = i, a = "", n;
|
|
662
|
+
let r = i, a = "", n, s;
|
|
663
663
|
if (i.length > 1) {
|
|
664
|
-
let
|
|
665
|
-
|
|
664
|
+
let l = i.indexOf("#", 1);
|
|
665
|
+
l !== -1 && (s = i.substring(l), r = i.substring(0, l)), l = r.indexOf("?", 1), l !== -1 && (a = r.substring(l), r = r.substring(0, l), a.
|
|
666
|
+
length > 1 && (n = nt.parse(a.substring(1))));
|
|
666
667
|
}
|
|
667
|
-
return e._parsedUrl = { pathname: r, search: a, query: n, raw: i };
|
|
668
|
+
return e._parsedUrl = { pathname: r, search: a, query: n, hash: s, raw: i };
|
|
668
669
|
}
|
|
669
670
|
var nt, st = U(() => {
|
|
670
671
|
nt = F(require("node:querystring"), 1);
|
|
@@ -838,6 +839,7 @@ var lt, pt = U(() => {
|
|
|
838
839
|
jsonml: "application/jsonml+json",
|
|
839
840
|
jsx: "text/jsx",
|
|
840
841
|
jt: "model/jt",
|
|
842
|
+
jxl: "image/jxl",
|
|
841
843
|
jxr: "image/jxr",
|
|
842
844
|
jxra: "image/jxra",
|
|
843
845
|
jxrs: "image/jxrs",
|
|
@@ -858,6 +860,8 @@ var lt, pt = U(() => {
|
|
|
858
860
|
m1v: "video/mpeg",
|
|
859
861
|
m21: "application/mp21",
|
|
860
862
|
m2a: "audio/mpeg",
|
|
863
|
+
m2t: "video/mp2t",
|
|
864
|
+
m2ts: "video/mp2t",
|
|
861
865
|
m2v: "video/mpeg",
|
|
862
866
|
m3a: "audio/mpeg",
|
|
863
867
|
m4a: "audio/mp4",
|
|
@@ -918,6 +922,7 @@ var lt, pt = U(() => {
|
|
|
918
922
|
msm: "application/octet-stream",
|
|
919
923
|
msp: "application/octet-stream",
|
|
920
924
|
mtl: "model/mtl",
|
|
925
|
+
mts: "video/mp2t",
|
|
921
926
|
musd: "application/mmt-usd+xml",
|
|
922
927
|
mxf: "application/mxf",
|
|
923
928
|
mxmf: "audio/mobile-xmf",
|
|
@@ -1147,11 +1152,11 @@ var dt = z((_r, ft) => {
|
|
|
1147
1152
|
}
|
|
1148
1153
|
o(bi, "viaCache");
|
|
1149
1154
|
function _i(e, i, t, r) {
|
|
1150
|
-
let a = 0, n = mt(t, r), s,
|
|
1155
|
+
let a = 0, n = mt(t, r), s, l, p, c;
|
|
1151
1156
|
for (; a < n.length; a++)
|
|
1152
1157
|
if (s = di(fi(e, p = n[a])), s.startsWith(e) && pe.existsSync(s)) {
|
|
1153
|
-
if (
|
|
1154
|
-
return
|
|
1158
|
+
if (l = pe.statSync(s), l.isDirectory()) continue;
|
|
1159
|
+
return c = ut(p, l, i), c["Cache-Control"] = i ? "no-cache" : "no-store", { abs: s, stats: l, headers: c };
|
|
1155
1160
|
}
|
|
1156
1161
|
}
|
|
1157
1162
|
o(_i, "viaLocal");
|
|
@@ -1160,19 +1165,19 @@ var dt = z((_r, ft) => {
|
|
|
1160
1165
|
}
|
|
1161
1166
|
o(ji, "is404");
|
|
1162
1167
|
function Oi(e, i, t, r, a) {
|
|
1163
|
-
let n = 200, s,
|
|
1168
|
+
let n = 200, s, l = {};
|
|
1164
1169
|
a = { ...a };
|
|
1165
1170
|
for (let p in a)
|
|
1166
1171
|
s = i.getHeader(p), s && (a[p] = s);
|
|
1167
1172
|
if ((s = i.getHeader("content-type")) && (a["Content-Type"] = s), e.headers.range) {
|
|
1168
1173
|
n = 206;
|
|
1169
|
-
let [p,
|
|
1174
|
+
let [p, c] = e.headers.range.replace("bytes=", "").split("-"), u = l.end = parseInt(c, 10) || r.size - 1, d = l.start = parseInt(p, 10) ||
|
|
1170
1175
|
0;
|
|
1171
1176
|
if (u >= r.size && (u = r.size - 1), d >= r.size)
|
|
1172
1177
|
return i.setHeader("Content-Range", `bytes */${r.size}`), i.statusCode = 416, i.end();
|
|
1173
1178
|
a["Content-Range"] = `bytes ${d}-${u}/${r.size}`, a["Content-Length"] = u - d + 1, a["Accept-Ranges"] = "bytes";
|
|
1174
1179
|
}
|
|
1175
|
-
i.writeHead(n, a), pe.createReadStream(t,
|
|
1180
|
+
i.writeHead(n, a), pe.createReadStream(t, l).pipe(i);
|
|
1176
1181
|
}
|
|
1177
1182
|
o(Oi, "send");
|
|
1178
1183
|
var Ei = {
|
|
@@ -1193,7 +1198,7 @@ var dt = z((_r, ft) => {
|
|
|
1193
1198
|
ft.exports = function(e, i = {}) {
|
|
1194
1199
|
e = gi(e || ".");
|
|
1195
1200
|
let t = i.onNoMatch || ji, r = i.setHeaders || vi, a = i.extensions || ["html", "htm"], n = i.gzip && a.map((m) => `${m}.gz`).concat("gz"),
|
|
1196
|
-
s = i.brotli && a.map((m) => `${m}.br`).concat("br"),
|
|
1201
|
+
s = i.brotli && a.map((m) => `${m}.br`).concat("br"), l = {}, p = "/", c = !!i.etag, u = !!i.single;
|
|
1197
1202
|
if (typeof i.single == "string") {
|
|
1198
1203
|
let m = i.single.lastIndexOf(".");
|
|
1199
1204
|
p += ~m ? i.single.substring(0, m) : i.single;
|
|
@@ -1208,10 +1213,10 @@ var dt = z((_r, ft) => {
|
|
|
1208
1213
|
if (!/\.well-known[\\+\/]/.test(m)) {
|
|
1209
1214
|
if (!i.dotfiles && /(^\.|[\\+|\/+]\.)/.test(m)) return;
|
|
1210
1215
|
}
|
|
1211
|
-
let v = ut(m, y,
|
|
1212
|
-
x && (v["Cache-Control"] = x),
|
|
1216
|
+
let v = ut(m, y, c);
|
|
1217
|
+
x && (v["Cache-Control"] = x), l["/" + m.normalize().replace(/\\+/g, "/")] = { abs: f, stats: y, headers: v };
|
|
1213
1218
|
});
|
|
1214
|
-
let g = i.dev ? _i.bind(0, e,
|
|
1219
|
+
let g = i.dev ? _i.bind(0, e, c) : bi.bind(0, l);
|
|
1215
1220
|
return function(m, f, y) {
|
|
1216
1221
|
let v = [""], _ = hi(m).pathname, O = m.headers["accept-encoding"] || "";
|
|
1217
1222
|
if (n && O.includes("gzip") && v.unshift(...n), s && /(br|brotli)/i.test(O) && v.unshift(...s), v.push(...a), _.indexOf("%") !== -1)
|
|
@@ -1221,7 +1226,7 @@ var dt = z((_r, ft) => {
|
|
|
1221
1226
|
}
|
|
1222
1227
|
let w = g(_, v) || u && !wi(_, d) && g(p, v);
|
|
1223
1228
|
if (!w) return y ? y() : t(m, f);
|
|
1224
|
-
if (
|
|
1229
|
+
if (c && m.headers["if-none-match"] === w.headers.ETag)
|
|
1225
1230
|
return f.writeHead(304), f.end();
|
|
1226
1231
|
(n || s) && f.setHeader("Vary", "Accept-Encoding"), r(f, _, w.stats), Oi(m, f, w.abs, w.stats, w.headers);
|
|
1227
1232
|
};
|
|
@@ -1396,8 +1401,8 @@ var Pt = z((h) => {
|
|
|
1396
1401
|
h.localsName = Et;
|
|
1397
1402
|
h.promiseImpl = new Function("return this;")().Promise;
|
|
1398
1403
|
h.resolveInclude = function(e, i, t) {
|
|
1399
|
-
var r = W.dirname, a = W.extname, n = W.resolve, s = n(t ? i : r(i), e),
|
|
1400
|
-
return
|
|
1404
|
+
var r = W.dirname, a = W.extname, n = W.resolve, s = n(t ? i : r(i), e), l = a(e);
|
|
1405
|
+
return l || (s += ".ejs"), s;
|
|
1401
1406
|
};
|
|
1402
1407
|
function bt(e, i) {
|
|
1403
1408
|
var t;
|
|
@@ -1471,13 +1476,13 @@ var Pt = z((h) => {
|
|
|
1471
1476
|
o(Wi, "includeFile");
|
|
1472
1477
|
function jt(e, i, t, r, a) {
|
|
1473
1478
|
var n = i.split(`
|
|
1474
|
-
`), s = Math.max(r - 3, 0),
|
|
1479
|
+
`), s = Math.max(r - 3, 0), l = Math.min(n.length, r + 3), p = a(t), c = n.slice(s, l).map(function(u, d) {
|
|
1475
1480
|
var x = d + s + 1;
|
|
1476
1481
|
return (x == r ? " >> " : " ") + x + "| " + u;
|
|
1477
1482
|
}).join(`
|
|
1478
1483
|
`);
|
|
1479
1484
|
throw e.path = p, e.message = (p || "ejs") + ":" + r + `
|
|
1480
|
-
` +
|
|
1485
|
+
` + c + `
|
|
1481
1486
|
|
|
1482
1487
|
` + e.message, e;
|
|
1483
1488
|
}
|
|
@@ -1530,7 +1535,7 @@ ns"], n && b.shallowCopy(r, n)), b.shallowCopyFromList(r, a, zi)), r.filename =
|
|
|
1530
1535
|
return e = e.replace(/%/g, i).replace(/</g, t).replace(/>/g, r), new RegExp(e);
|
|
1531
1536
|
}, "createRegex"),
|
|
1532
1537
|
compile: /* @__PURE__ */ o(function() {
|
|
1533
|
-
var e, i, t = this.opts, r = "", a = "", n = t.escapeFunction, s,
|
|
1538
|
+
var e, i, t = this.opts, r = "", a = "", n = t.escapeFunction, s, l = t.filename ? JSON.stringify(t.filename) : "undefined";
|
|
1534
1539
|
if (!this.source) {
|
|
1535
1540
|
if (this.generateSource(), r += ` var __output = "";
|
|
1536
1541
|
function __append(s) { if (s !== undefined && s !== null) __output += s }
|
|
@@ -1544,11 +1549,11 @@ ns"], n && b.shallowCopy(r, n)), b.shallowCopyFromList(r, a, zi)), r.filename =
|
|
|
1544
1549
|
throw new Error("localsName is not a valid JS identifier.");
|
|
1545
1550
|
if (t.destructuredLocals && t.destructuredLocals.length) {
|
|
1546
1551
|
for (var p = " var __locals = (" + t.localsName + ` || {}),
|
|
1547
|
-
`,
|
|
1548
|
-
var u = t.destructuredLocals[
|
|
1552
|
+
`, c = 0; c < t.destructuredLocals.length; c++) {
|
|
1553
|
+
var u = t.destructuredLocals[c];
|
|
1549
1554
|
if (!ue.test(u))
|
|
1550
|
-
throw new Error("destructuredLocals[" +
|
|
1551
|
-
|
|
1555
|
+
throw new Error("destructuredLocals[" + c + "] is not a valid JS identifier.");
|
|
1556
|
+
c > 0 && (p += `,
|
|
1552
1557
|
`), p += u + " = __locals." + u;
|
|
1553
1558
|
}
|
|
1554
1559
|
r += p + `;
|
|
@@ -1561,7 +1566,7 @@ ns"], n && b.shallowCopy(r, n)), b.shallowCopyFromList(r, a, zi)), r.filename =
|
|
|
1561
1566
|
}
|
|
1562
1567
|
t.compileDebug ? e = `var __line = 1
|
|
1563
1568
|
, __lines = ` + JSON.stringify(this.templateText) + `
|
|
1564
|
-
, __filename = ` +
|
|
1569
|
+
, __filename = ` + l + `;
|
|
1565
1570
|
try {
|
|
1566
1571
|
` + this.source + `} catch (e) {
|
|
1567
1572
|
rethrow(e, __lines, __filename, __line, escapeFn);
|
|
@@ -1570,7 +1575,7 @@ try {
|
|
|
1570
1575
|
` + e, t.compileDebug && (e = "rethrow = rethrow || " + jt.toString() + `;
|
|
1571
1576
|
` + e)), t.strict && (e = `"use strict";
|
|
1572
1577
|
` + e), t.debug && console.log(e), t.compileDebug && t.filename && (e = e + `
|
|
1573
|
-
//# sourceURL=` +
|
|
1578
|
+
//# sourceURL=` + l + `
|
|
1574
1579
|
`);
|
|
1575
1580
|
try {
|
|
1576
1581
|
if (t.async)
|
|
@@ -1618,9 +1623,9 @@ try {
|
|
|
1618
1623
|
e.rmWhitespace && (this.templateText = this.templateText.replace(/[\r\n]+/g, `
|
|
1619
1624
|
`).replace(/^\s+|\s+$/gm, "")), this.templateText = this.templateText.replace(/[ \t]*<%_/gm, "<%_").replace(/_%>[ \t]*/gm, "_%>");
|
|
1620
1625
|
var i = this, t = this.parseTemplateText(), r = this.opts.delimiter, a = this.opts.openDelimiter, n = this.opts.closeDelimiter;
|
|
1621
|
-
t && t.length && t.forEach(function(s,
|
|
1626
|
+
t && t.length && t.forEach(function(s, l) {
|
|
1622
1627
|
var p;
|
|
1623
|
-
if (s.indexOf(a + r) === 0 && s.indexOf(a + r + r) !== 0 && (p = t[
|
|
1628
|
+
if (s.indexOf(a + r) === 0 && s.indexOf(a + r + r) !== 0 && (p = t[l + 2], !(p == r + n || p == "-" + r + n || p == "_" + r + n)))
|
|
1624
1629
|
throw new Error('Could not find matching close tag for "' + s + '".');
|
|
1625
1630
|
i.scanLine(s);
|
|
1626
1631
|
});
|
|
@@ -1809,7 +1814,7 @@ latePath"), Ft = /* @__PURE__ */ o(async (e) => {
|
|
|
1809
1814
|
let i = await de(e);
|
|
1810
1815
|
return (0, Tt.readFile)(i, { encoding: "utf8" });
|
|
1811
1816
|
}, "readTemplate");
|
|
1812
|
-
var ge = /* @__PURE__ */ o(async (e, i, t, r, a, n, s,
|
|
1817
|
+
var ge = /* @__PURE__ */ o(async (e, i, t, r, a, n, s, l, p, c, u, { versionCheck: d, previewUrl: x, configType: g, ignorePreview: m }, f) => {
|
|
1813
1818
|
let y = await i, v = await e, _ = Object.entries(f).reduce(
|
|
1814
1819
|
(O, [w, E]) => ({ ...O, [w]: JSON.stringify(E) }),
|
|
1815
1820
|
{}
|
|
@@ -1820,9 +1825,9 @@ var ge = /* @__PURE__ */ o(async (e, i, t, r, a, n, s, c, p, l, u, { versionChec
|
|
|
1820
1825
|
favicon: await t,
|
|
1821
1826
|
globals: {
|
|
1822
1827
|
FEATURES: JSON.stringify(await s, null, 2),
|
|
1823
|
-
REFS: JSON.stringify(await
|
|
1828
|
+
REFS: JSON.stringify(await l, null, 2),
|
|
1824
1829
|
LOGLEVEL: JSON.stringify(await p, null, 2),
|
|
1825
|
-
DOCS_OPTIONS: JSON.stringify(await
|
|
1830
|
+
DOCS_OPTIONS: JSON.stringify(await c, null, 2),
|
|
1826
1831
|
CONFIG_TYPE: JSON.stringify(await g, null, 2),
|
|
1827
1832
|
// These two need to be double stringified because the UI expects a string
|
|
1828
1833
|
VERSIONCHECK: JSON.stringify(JSON.stringify(d), null, 2),
|
|
@@ -1839,8 +1844,8 @@ var ge = /* @__PURE__ */ o(async (e, i, t, r, a, n, s, c, p, l, u, { versionChec
|
|
|
1839
1844
|
// src/builder-manager/utils/data.ts
|
|
1840
1845
|
var xe = /* @__PURE__ */ o(async (e) => {
|
|
1841
1846
|
let i = (0, Lt.getRefs)(e), t = e.presets.apply("favicon").then((x) => (0, kt.basename)(x)), r = e.presets.apply("features"), a = e.presets.
|
|
1842
|
-
apply("logLevel"), n = e.presets.apply("title"), s = e.presets.apply("docs", {}),
|
|
1843
|
-
|
|
1847
|
+
apply("logLevel"), n = e.presets.apply("title"), s = e.presets.apply("docs", {}), l = e.presets.apply("tags", {}), p = Ft("template.ejs"),
|
|
1848
|
+
c = e.presets.apply("managerHead"), [u, d] = await Promise.all([
|
|
1844
1849
|
//
|
|
1845
1850
|
ye.get(),
|
|
1846
1851
|
he(e)
|
|
@@ -1851,12 +1856,12 @@ var xe = /* @__PURE__ */ o(async (e) => {
|
|
|
1851
1856
|
title: n,
|
|
1852
1857
|
docsOptions: s,
|
|
1853
1858
|
template: p,
|
|
1854
|
-
customHead:
|
|
1859
|
+
customHead: c,
|
|
1855
1860
|
instance: u,
|
|
1856
1861
|
config: d,
|
|
1857
1862
|
logLevel: a,
|
|
1858
1863
|
favicon: t,
|
|
1859
|
-
tagsOptions:
|
|
1864
|
+
tagsOptions: l
|
|
1860
1865
|
};
|
|
1861
1866
|
}, "getData");
|
|
1862
1867
|
|
|
@@ -1873,12 +1878,12 @@ o(H, "slash");
|
|
|
1873
1878
|
async function ve(e, i) {
|
|
1874
1879
|
let t = await Promise.all(
|
|
1875
1880
|
i?.map(async (n) => {
|
|
1876
|
-
let { location: s, url:
|
|
1881
|
+
let { location: s, url: l } = Bi(n, e);
|
|
1877
1882
|
if (!(0, Ct.existsSync)(s)) {
|
|
1878
1883
|
let p = (0, N.dirname)(s);
|
|
1879
1884
|
await (0, ee.mkdir)(p, { recursive: !0 });
|
|
1880
1885
|
}
|
|
1881
|
-
return await (0, ee.writeFile)(s, n.contents),
|
|
1886
|
+
return await (0, ee.writeFile)(s, n.contents), l;
|
|
1882
1887
|
}) || []
|
|
1883
1888
|
), r = t.filter((n) => n.endsWith(".js"));
|
|
1884
1889
|
return { cssFiles: t.filter((n) => n.endsWith(".css")), jsFiles: r };
|
|
@@ -1920,13 +1925,13 @@ async function qt(e, i) {
|
|
|
1920
1925
|
let { name: a, dir: n } = (0, R.parse)(t), s = (0, zt.resolvePathInStorybookCache)("sb-manager", i);
|
|
1921
1926
|
if (!s)
|
|
1922
1927
|
throw new Error("Could not create/find cache directory");
|
|
1923
|
-
let
|
|
1928
|
+
let l = (0, R.relative)(process.cwd(), n), p = (0, R.join)(
|
|
1924
1929
|
s,
|
|
1925
|
-
Gi((0, R.join)(`${It(
|
|
1930
|
+
Gi((0, R.join)(`${It(l)}-${r}`, `${It(a)}-bundle.js`))
|
|
1926
1931
|
);
|
|
1927
1932
|
if (!(0, Mt.existsSync)(p)) {
|
|
1928
|
-
let
|
|
1929
|
-
await (0, te.mkdir)(
|
|
1933
|
+
let c = (0, R.dirname)(p);
|
|
1934
|
+
await (0, te.mkdir)(c, { recursive: !0 });
|
|
1930
1935
|
}
|
|
1931
1936
|
return await (0, te.writeFile)(p, `import '${H(t).replaceAll(/'/g, "\\'")}';`), p;
|
|
1932
1937
|
})
|
|
@@ -2023,9 +2028,9 @@ var Ui = /^\/($|\?)/, D, I, he = /* @__PURE__ */ o(async (e) => {
|
|
|
2023
2028
|
config: a,
|
|
2024
2029
|
favicon: n,
|
|
2025
2030
|
customHead: s,
|
|
2026
|
-
features:
|
|
2031
|
+
features: l,
|
|
2027
2032
|
instance: p,
|
|
2028
|
-
refs:
|
|
2033
|
+
refs: c,
|
|
2029
2034
|
template: u,
|
|
2030
2035
|
title: d,
|
|
2031
2036
|
logLevel: x,
|
|
@@ -2067,8 +2072,8 @@ var Ui = /^\/($|\?)/, D, I, he = /* @__PURE__ */ o(async (e) => {
|
|
|
2067
2072
|
s,
|
|
2068
2073
|
v,
|
|
2069
2074
|
_,
|
|
2070
|
-
c,
|
|
2071
2075
|
l,
|
|
2076
|
+
c,
|
|
2072
2077
|
x,
|
|
2073
2078
|
g,
|
|
2074
2079
|
m,
|
|
@@ -2095,9 +2100,9 @@ var Ui = /^\/($|\?)/, D, I, he = /* @__PURE__ */ o(async (e) => {
|
|
|
2095
2100
|
customHead: a,
|
|
2096
2101
|
favicon: n,
|
|
2097
2102
|
features: s,
|
|
2098
|
-
instance:
|
|
2103
|
+
instance: l,
|
|
2099
2104
|
refs: p,
|
|
2100
|
-
template:
|
|
2105
|
+
template: c,
|
|
2101
2106
|
title: u,
|
|
2102
2107
|
logLevel: d,
|
|
2103
2108
|
docsOptions: x,
|
|
@@ -2106,7 +2111,7 @@ var Ui = /^\/($|\?)/, D, I, he = /* @__PURE__ */ o(async (e) => {
|
|
|
2106
2111
|
yield;
|
|
2107
2112
|
let m = r.outdir, f = (0, P.join)((0, P.dirname)(require.resolve("storybook/package.json")), "dist", "manager"), y = (0, P.join)(t.outputDir,
|
|
2108
2113
|
"sb-manager");
|
|
2109
|
-
D = await
|
|
2114
|
+
D = await l({
|
|
2110
2115
|
...r,
|
|
2111
2116
|
minify: !0
|
|
2112
2117
|
}), yield;
|
|
@@ -2119,7 +2124,7 @@ var Ui = /^\/($|\?)/, D, I, he = /* @__PURE__ */ o(async (e) => {
|
|
|
2119
2124
|
}), { cssFiles: _, jsFiles: O } = await ve(m, D?.outputFiles), w = await we(t);
|
|
2120
2125
|
yield;
|
|
2121
2126
|
let E = await ge(
|
|
2122
|
-
|
|
2127
|
+
c,
|
|
2123
2128
|
u,
|
|
2124
2129
|
n,
|
|
2125
2130
|
a,
|