storybook 9.0.0-rc.2 → 9.0.0-rc.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/bin/index.cjs +59 -52
- package/dist/bin/index.js +50 -43
- package/dist/cli/bin/index.cjs +1 -1
- package/dist/cli/bin/index.js +1 -1
- package/dist/common/index.cjs +1255 -1248
- package/dist/common/index.d.ts +7 -0
- package/dist/common/index.js +50 -43
- package/dist/core-server/presets/common-manager.js +1 -1
- package/dist/core-server/presets/common-preset.cjs +20 -17
- package/dist/core-server/presets/common-preset.js +19 -16
- package/dist/csf-tools/index.cjs +542 -535
- package/dist/csf-tools/index.js +531 -524
- package/dist/docs-tools/index.cjs +38 -40
- package/dist/docs-tools/index.d.ts +3 -5
- package/dist/docs-tools/index.js +94 -96
- package/dist/manager/globals-runtime.js +8404 -8382
- package/dist/manager-api/index.cjs +513 -491
- package/dist/manager-api/index.js +474 -453
- package/dist/preview/runtime.js +1 -3
- package/dist/preview-api/index.cjs +407 -410
- package/dist/preview-api/index.js +1 -3
- package/package.json +1 -1
|
@@ -227,17 +227,17 @@ adonlyProperty" || e.type === "JsdocTypeObjectField" || e.type === "JsdocTypeJsd
|
|
|
227
227
|
return e.type === "JsdocTypeKeyValue" ? Z(e) : w(e);
|
|
228
228
|
}
|
|
229
229
|
r(ge, "assertPlainKeyValueOrRootResult");
|
|
230
|
-
function
|
|
230
|
+
function Vt(e) {
|
|
231
231
|
return e.type === "JsdocTypeName" ? e : Z(e);
|
|
232
232
|
}
|
|
233
|
-
r(
|
|
233
|
+
r(Vt, "assertPlainKeyValueOrNameResult");
|
|
234
234
|
function Z(e) {
|
|
235
235
|
if (e.type !== "JsdocTypeKeyValue")
|
|
236
236
|
throw new c(e);
|
|
237
237
|
return e;
|
|
238
238
|
}
|
|
239
239
|
r(Z, "assertPlainKeyValueResult");
|
|
240
|
-
function
|
|
240
|
+
function Lt(e) {
|
|
241
241
|
var t;
|
|
242
242
|
if (e.type === "JsdocTypeVariadic") {
|
|
243
243
|
if (((t = e.element) === null || t === void 0 ? void 0 : t.type) === "JsdocTypeName")
|
|
@@ -248,7 +248,7 @@ adonlyProperty" || e.type === "JsdocTypeObjectField" || e.type === "JsdocTypeJsd
|
|
|
248
248
|
throw new c(e);
|
|
249
249
|
return e;
|
|
250
250
|
}
|
|
251
|
-
r(
|
|
251
|
+
r(Lt, "assertNumberOrVariadicNameResult");
|
|
252
252
|
function xe(e) {
|
|
253
253
|
return e.type === "JsdocTypeIndexSignature" || e.type === "JsdocTypeMappedType";
|
|
254
254
|
}
|
|
@@ -261,7 +261,7 @@ INFIX", e[e.TUPLE = 9] = "TUPLE", e[e.SYMBOL = 10] = "SYMBOL", e[e.OPTIONAL = 11
|
|
|
261
261
|
13] = "KEY_OF_TYPE_OF", e[e.FUNCTION = 14] = "FUNCTION", e[e.ARROW = 15] = "ARROW", e[e.ARRAY_BRACKETS = 16] = "ARRAY_BRACKETS", e[e.GENERIC =
|
|
262
262
|
17] = "GENERIC", e[e.NAME_PATH = 18] = "NAME_PATH", e[e.PARENTHESIS = 19] = "PARENTHESIS", e[e.SPECIAL_TYPES = 20] = "SPECIAL_TYPES";
|
|
263
263
|
})(y || (y = {}));
|
|
264
|
-
class
|
|
264
|
+
class L {
|
|
265
265
|
static {
|
|
266
266
|
r(this, "Parser");
|
|
267
267
|
}
|
|
@@ -544,7 +544,7 @@ INFIX", e[e.TUPLE = 9] = "TUPLE", e[e.SYMBOL = 10] = "SYMBOL", e[e.OPTIONAL = 11
|
|
|
544
544
|
let D, se = !1;
|
|
545
545
|
l.consume(".") ? D = "property" : l.consume("[") ? (D = "property-brackets", se = !0) : l.consume("~") ? D = "inner" : (l.consume("#"),
|
|
546
546
|
D = "instance");
|
|
547
|
-
let st = o !== null ? new
|
|
547
|
+
let st = o !== null ? new L(o, l.lexer, l) : l, k = st.parseIntermediateType(y.NAME_PATH);
|
|
548
548
|
l.acceptLexerState(st);
|
|
549
549
|
let G;
|
|
550
550
|
switch (k.type) {
|
|
@@ -659,7 +659,7 @@ INFIX", e[e.TUPLE = 9] = "TUPLE", e[e.SYMBOL = 10] = "SYMBOL", e[e.OPTIONAL = 11
|
|
|
659
659
|
}
|
|
660
660
|
};
|
|
661
661
|
}
|
|
662
|
-
let d = new
|
|
662
|
+
let d = new L(e, o.lexer, o), h = d.parseInfixIntermediateType(l, y.ALL);
|
|
663
663
|
return o.acceptLexerState(d), w(h);
|
|
664
664
|
}, "parsePrefix")
|
|
665
665
|
});
|
|
@@ -803,7 +803,7 @@ INFIX", e[e.TUPLE = 9] = "TUPLE", e[e.SYMBOL = 10] = "SYMBOL", e[e.OPTIONAL = 11
|
|
|
803
803
|
};
|
|
804
804
|
if (!e.consume(")")) {
|
|
805
805
|
let i = e.parseIntermediateType(y.SYMBOL);
|
|
806
|
-
if (o.element =
|
|
806
|
+
if (o.element = Lt(i), !e.consume(")"))
|
|
807
807
|
throw new Error("Symbol does not end after value");
|
|
808
808
|
}
|
|
809
809
|
return o;
|
|
@@ -841,7 +841,7 @@ INFIX", e[e.TUPLE = 9] = "TUPLE", e[e.SYMBOL = 10] = "SYMBOL", e[e.OPTIONAL = 11
|
|
|
841
841
|
elements: []
|
|
842
842
|
};
|
|
843
843
|
if (!o.consume("}")) {
|
|
844
|
-
let l, f = new
|
|
844
|
+
let l, f = new L(e, o.lexer, o);
|
|
845
845
|
for (; ; ) {
|
|
846
846
|
f.acceptLexerState(o);
|
|
847
847
|
let d = f.parseIntermediateType(y.OBJECT);
|
|
@@ -1131,7 +1131,7 @@ INFIX", e[e.TUPLE = 9] = "TUPLE", e[e.SYMBOL = 10] = "SYMBOL", e[e.OPTIONAL = 11
|
|
|
1131
1131
|
accept: /* @__PURE__ */ r((e) => e === "=>", "accept"),
|
|
1132
1132
|
parseInfix: /* @__PURE__ */ r((e, t) => (e.consume("=>"), {
|
|
1133
1133
|
type: "JsdocTypeFunction",
|
|
1134
|
-
parameters: we(t).map(
|
|
1134
|
+
parameters: we(t).map(Vt),
|
|
1135
1135
|
arrow: !0,
|
|
1136
1136
|
constructor: !1,
|
|
1137
1137
|
parenthesis: !0,
|
|
@@ -1259,11 +1259,11 @@ INFIX", e[e.TUPLE = 9] = "TUPLE", e[e.SYMBOL = 10] = "SYMBOL", e[e.OPTIONAL = 11
|
|
|
1259
1259
|
function tt(e, t) {
|
|
1260
1260
|
switch (t) {
|
|
1261
1261
|
case "closure":
|
|
1262
|
-
return new
|
|
1262
|
+
return new L(Gt, e).parse();
|
|
1263
1263
|
case "jsdoc":
|
|
1264
|
-
return new
|
|
1264
|
+
return new L(Yt, e).parse();
|
|
1265
1265
|
case "typescript":
|
|
1266
|
-
return new
|
|
1266
|
+
return new L(sr, e).parse();
|
|
1267
1267
|
}
|
|
1268
1268
|
}
|
|
1269
1269
|
r(tt, "parse");
|
|
@@ -2009,8 +2009,8 @@ Name" ? t += o.value : o?.type === "JsdocTypeNumber" && (t += o.value.toString()
|
|
|
2009
2009
|
});
|
|
2010
2010
|
|
|
2011
2011
|
// src/docs-tools/index.ts
|
|
2012
|
-
var
|
|
2013
|
-
br(
|
|
2012
|
+
var bn = {};
|
|
2013
|
+
br(bn, {
|
|
2014
2014
|
ADDON_ID: () => Ge,
|
|
2015
2015
|
MAX_DEFAULT_VALUE_SUMMARY_LENGTH: () => tn,
|
|
2016
2016
|
MAX_TYPE_SUMMARY_LENGTH: () => en,
|
|
@@ -2029,8 +2029,7 @@ br(Sn, {
|
|
|
2029
2029
|
getDocgenDescription: () => je,
|
|
2030
2030
|
getDocgenSection: () => Re,
|
|
2031
2031
|
hasDocgen: () => Ae,
|
|
2032
|
-
|
|
2033
|
-
isDefaultValueBlacklisted: () => L,
|
|
2032
|
+
isDefaultValueBlacklisted: () => V,
|
|
2034
2033
|
isTooLongForDefaultValueSummary: () => qe,
|
|
2035
2034
|
isTooLongForTypeSummary: () => me,
|
|
2036
2035
|
isValidDocgenSection: () => Ie,
|
|
@@ -2038,7 +2037,7 @@ br(Sn, {
|
|
|
2038
2037
|
parseJsDoc: () => $e,
|
|
2039
2038
|
str: () => ke
|
|
2040
2039
|
});
|
|
2041
|
-
module.exports = Sr(
|
|
2040
|
+
module.exports = Sr(bn);
|
|
2042
2041
|
|
|
2043
2042
|
// src/docs-tools/argTypes/convert/flow/convert.ts
|
|
2044
2043
|
var pt = require("storybook/internal/preview-errors");
|
|
@@ -2221,10 +2220,10 @@ var ut = /* @__PURE__ */ ((c) => (c.JAVASCRIPT = "JavaScript", c.FLOW = "Flow",
|
|
|
2221
2220
|
|
|
2222
2221
|
// src/docs-tools/argTypes/docgen/utils/defaultValue.ts
|
|
2223
2222
|
var Rr = ["null", "undefined"];
|
|
2224
|
-
function
|
|
2223
|
+
function V(n) {
|
|
2225
2224
|
return Rr.some((s) => s === n);
|
|
2226
2225
|
}
|
|
2227
|
-
r(
|
|
2226
|
+
r(V, "isDefaultValueBlacklisted");
|
|
2228
2227
|
|
|
2229
2228
|
// src/docs-tools/argTypes/docgen/utils/string.ts
|
|
2230
2229
|
var ke = /* @__PURE__ */ r((n) => {
|
|
@@ -2290,7 +2289,7 @@ r(_e, "seedTokens");
|
|
|
2290
2289
|
|
|
2291
2290
|
// ../node_modules/comment-parser/es6/parser/block-parser.js
|
|
2292
2291
|
var jr = /^@\S+/;
|
|
2293
|
-
function
|
|
2292
|
+
function Ve({ fence: n = "```" } = {}) {
|
|
2294
2293
|
let s = Fr(n), a = /* @__PURE__ */ r((p, c) => s(p) ? !c : c, "toggleFence");
|
|
2295
2294
|
return /* @__PURE__ */ r(function(c) {
|
|
2296
2295
|
let u = [[]], m = !1;
|
|
@@ -2299,14 +2298,14 @@ function Le({ fence: n = "```" } = {}) {
|
|
|
2299
2298
|
return u;
|
|
2300
2299
|
}, "parseBlock");
|
|
2301
2300
|
}
|
|
2302
|
-
r(
|
|
2301
|
+
r(Ve, "getParser");
|
|
2303
2302
|
function Fr(n) {
|
|
2304
2303
|
return typeof n == "string" ? (s) => s.split(n).length % 2 === 0 : n;
|
|
2305
2304
|
}
|
|
2306
2305
|
r(Fr, "getFencer");
|
|
2307
2306
|
|
|
2308
2307
|
// ../node_modules/comment-parser/es6/parser/source-parser.js
|
|
2309
|
-
function
|
|
2308
|
+
function Le({ startLine: n = 0, markers: s = v } = {}) {
|
|
2310
2309
|
let a = null, p = n;
|
|
2311
2310
|
return /* @__PURE__ */ r(function(u) {
|
|
2312
2311
|
let m = u, T = _e();
|
|
@@ -2326,7 +2325,7 @@ function Ve({ startLine: n = 0, markers: s = v } = {}) {
|
|
|
2326
2325
|
return null;
|
|
2327
2326
|
}, "parseSource");
|
|
2328
2327
|
}
|
|
2329
|
-
r(
|
|
2328
|
+
r(Le, "getParser");
|
|
2330
2329
|
|
|
2331
2330
|
// ../node_modules/comment-parser/es6/parser/spec-parser.js
|
|
2332
2331
|
function Ue({ tokenizers: n }) {
|
|
@@ -2357,7 +2356,7 @@ r(ie, "tagTokenizer");
|
|
|
2357
2356
|
|
|
2358
2357
|
// ../node_modules/comment-parser/es6/parser/tokenizers/type.js
|
|
2359
2358
|
function pe(n = "compact") {
|
|
2360
|
-
let s =
|
|
2359
|
+
let s = Vr(n);
|
|
2361
2360
|
return (a) => {
|
|
2362
2361
|
let p = 0, c = [];
|
|
2363
2362
|
for (let [T, { tokens: g }] of a.source.entries()) {
|
|
@@ -2386,14 +2385,14 @@ function pe(n = "compact") {
|
|
|
2386
2385
|
}
|
|
2387
2386
|
r(pe, "typeTokenizer");
|
|
2388
2387
|
var _r = /* @__PURE__ */ r((n) => n.trim(), "trim");
|
|
2389
|
-
function
|
|
2388
|
+
function Vr(n) {
|
|
2390
2389
|
return n === "compact" ? (s) => s.map(_r).join("") : n === "preserve" ? (s) => s.join(`
|
|
2391
2390
|
`) : n;
|
|
2392
2391
|
}
|
|
2393
|
-
r(
|
|
2392
|
+
r(Vr, "getJoiner");
|
|
2394
2393
|
|
|
2395
2394
|
// ../node_modules/comment-parser/es6/parser/tokenizers/name.js
|
|
2396
|
-
var
|
|
2395
|
+
var Lr = /* @__PURE__ */ r((n) => n && n.startsWith('"') && n.endsWith('"'), "isQuoted");
|
|
2397
2396
|
function ce() {
|
|
2398
2397
|
let n = /* @__PURE__ */ r((s, { tokens: a }, p) => a.type === "" ? s : p, "typeEnd");
|
|
2399
2398
|
return (s) => {
|
|
@@ -2431,7 +2430,7 @@ function ce() {
|
|
|
2431
2430
|
line: s.source[0].number,
|
|
2432
2431
|
critical: !0
|
|
2433
2432
|
}), s;
|
|
2434
|
-
if (!
|
|
2433
|
+
if (!Lr(g) && /=(?!>)/.test(g))
|
|
2435
2434
|
return s.problems.push({
|
|
2436
2435
|
code: "spec:name:invalid-default",
|
|
2437
2436
|
message: "invalid default value syntax",
|
|
@@ -2481,7 +2480,7 @@ function Ce({ startLine: n = 0, fence: s = "```", spacing: a = "compact", marker
|
|
|
2481
2480
|
] } = {}) {
|
|
2482
2481
|
if (n < 0 || n % 1 > 0)
|
|
2483
2482
|
throw new Error("Invalid startLine");
|
|
2484
|
-
let u =
|
|
2483
|
+
let u = Le({ startLine: n, markers: p }), m = Ve({ fence: s }), T = Ue({ tokenizers: c }), g = Be(a);
|
|
2485
2484
|
return function(P) {
|
|
2486
2485
|
let b = [];
|
|
2487
2486
|
for (let ye of ft(P)) {
|
|
@@ -2529,14 +2528,14 @@ var $r = {
|
|
|
2529
2528
|
end: 0,
|
|
2530
2529
|
lineEnd: 0
|
|
2531
2530
|
};
|
|
2532
|
-
var
|
|
2531
|
+
var Qo = Object.keys($r);
|
|
2533
2532
|
|
|
2534
2533
|
// ../node_modules/comment-parser/es6/index.js
|
|
2535
2534
|
function dt(n, s = {}) {
|
|
2536
2535
|
return Ce(s)(n);
|
|
2537
2536
|
}
|
|
2538
2537
|
r(dt, "parse");
|
|
2539
|
-
var
|
|
2538
|
+
var hs = Me();
|
|
2540
2539
|
|
|
2541
2540
|
// src/docs-tools/argTypes/jsdocParser.ts
|
|
2542
2541
|
var K = Er(gt(), 1);
|
|
@@ -2695,7 +2694,7 @@ var rn = /* @__PURE__ */ r((n) => n.replace(/\\r\\n/g, "\\n"), "normalizeNewline
|
|
|
2695
2694
|
function Pt(n, s) {
|
|
2696
2695
|
if (n != null) {
|
|
2697
2696
|
let { value: a } = n;
|
|
2698
|
-
if (!
|
|
2697
|
+
if (!V(a))
|
|
2699
2698
|
return qe(a) ? J(s?.name, a) : J(a);
|
|
2700
2699
|
}
|
|
2701
2700
|
return null;
|
|
@@ -2758,7 +2757,7 @@ var St = /* @__PURE__ */ r((n, s) => {
|
|
|
2758
2757
|
function Nt({ defaultValue: n }) {
|
|
2759
2758
|
if (n != null) {
|
|
2760
2759
|
let { value: s } = n;
|
|
2761
|
-
if (!
|
|
2760
|
+
if (!V(s))
|
|
2762
2761
|
return J(s);
|
|
2763
2762
|
}
|
|
2764
2763
|
return null;
|
|
@@ -2807,7 +2806,7 @@ r(un, "isStringValued");
|
|
|
2807
2806
|
function mn(n, s) {
|
|
2808
2807
|
if (n != null) {
|
|
2809
2808
|
let { value: a } = n;
|
|
2810
|
-
if (!
|
|
2809
|
+
if (!V(a))
|
|
2811
2810
|
return ln(n) && un(s) ? J(JSON.stringify(a)) : J(a);
|
|
2812
2811
|
}
|
|
2813
2812
|
return null;
|
|
@@ -2924,14 +2923,13 @@ var hn = /* @__PURE__ */ r((n) => {
|
|
|
2924
2923
|
component: s,
|
|
2925
2924
|
argTypes: a,
|
|
2926
2925
|
parameters: { docs: p = {} }
|
|
2927
|
-
} = n, { extractArgTypes: c } = p
|
|
2926
|
+
} = n, { extractArgTypes: c } = p;
|
|
2927
|
+
if (!c || !s)
|
|
2928
|
+
return a;
|
|
2929
|
+
let u = c(s);
|
|
2928
2930
|
return u ? We(u, a) : a;
|
|
2929
2931
|
}, "enhanceArgTypes");
|
|
2930
2932
|
|
|
2931
2933
|
// src/docs-tools/shared.ts
|
|
2932
2934
|
var Ge = "storybook/docs", Jn = `${Ge}/panel`, wn = "docs", Pn = `${Ge}/snippet-rendered`, jt = /* @__PURE__ */ ((p) => (p.AUTO = "auto", p.
|
|
2933
2935
|
CODE = "code", p.DYNAMIC = "dynamic", p))(jt || {});
|
|
2934
|
-
|
|
2935
|
-
// src/docs-tools/hasDocsOrControls.ts
|
|
2936
|
-
var bn = /(addons\/|addon-|addon-essentials\/)(docs|controls)/, En = /* @__PURE__ */ r((n) => n.presetsList?.some((s) => bn.test(s.name)), "\
|
|
2937
|
-
hasDocsOrControls");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StrictArgTypes, Renderer, StoryContextForEnhancers
|
|
1
|
+
import { StrictArgTypes, Renderer, StoryContextForEnhancers } from 'storybook/internal/types';
|
|
2
2
|
import * as storybook_internal_csf from 'storybook/internal/csf';
|
|
3
3
|
|
|
4
4
|
type Component = any;
|
|
@@ -133,7 +133,7 @@ declare function isTooLongForDefaultValueSummary(value: string): boolean;
|
|
|
133
133
|
declare function createSummaryValue(summary?: string, detail?: string): PropSummaryValue;
|
|
134
134
|
declare const normalizeNewlines: (string: string) => string;
|
|
135
135
|
|
|
136
|
-
declare const enhanceArgTypes: <TRenderer extends Renderer>(context: StoryContextForEnhancers<TRenderer>) => storybook_internal_csf.
|
|
136
|
+
declare const enhanceArgTypes: <TRenderer extends Renderer>(context: StoryContextForEnhancers<TRenderer>) => storybook_internal_csf.Parameters;
|
|
137
137
|
|
|
138
138
|
declare const ADDON_ID = "storybook/docs";
|
|
139
139
|
declare const PANEL_ID = "storybook/docs/panel";
|
|
@@ -157,6 +157,4 @@ declare enum SourceType {
|
|
|
157
157
|
DYNAMIC = "dynamic"
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
export { ADDON_ID, type ArgTypesExtractor, type Component, type DocgenFlowType, type DocgenInfo, type DocgenPropDefaultValue, type DocgenPropType, type DocgenType, type DocgenTypeScriptType, type ExtractProps, type ExtractedJsDoc, type ExtractedJsDocParam, type ExtractedJsDocReturns, type ExtractedProp, type JsDocParam, type JsDocParsingOptions, type JsDocParsingResult, type JsDocReturns, type JsDocTags, MAX_DEFAULT_VALUE_SUMMARY_LENGTH, MAX_TYPE_SUMMARY_LENGTH, PANEL_ID, PARAM_KEY, type ParseJsDoc, type PropDef, type PropDefaultValue, type PropSummaryValue, type PropType, type PropsExtractor, SNIPPET_RENDERED, SourceType, TypeSystem, convert, createSummaryValue, enhanceArgTypes, extractComponentDescription, extractComponentProps, extractComponentSectionArray, extractComponentSectionObject, getDocgenDescription, getDocgenSection, hasDocgen, hasDocsOrControls, isDefaultValueBlacklisted, isTooLongForDefaultValueSummary, isTooLongForTypeSummary, isValidDocgenSection, normalizeNewlines, parseJsDoc, str };
|
|
160
|
+
export { ADDON_ID, type ArgTypesExtractor, type Component, type DocgenFlowType, type DocgenInfo, type DocgenPropDefaultValue, type DocgenPropType, type DocgenType, type DocgenTypeScriptType, type ExtractProps, type ExtractedJsDoc, type ExtractedJsDocParam, type ExtractedJsDocReturns, type ExtractedProp, type JsDocParam, type JsDocParsingOptions, type JsDocParsingResult, type JsDocReturns, type JsDocTags, MAX_DEFAULT_VALUE_SUMMARY_LENGTH, MAX_TYPE_SUMMARY_LENGTH, PANEL_ID, PARAM_KEY, type ParseJsDoc, type PropDef, type PropDefaultValue, type PropSummaryValue, type PropType, type PropsExtractor, SNIPPET_RENDERED, SourceType, TypeSystem, convert, createSummaryValue, enhanceArgTypes, extractComponentDescription, extractComponentProps, extractComponentSectionArray, extractComponentSectionObject, getDocgenDescription, getDocgenSection, hasDocgen, isDefaultValueBlacklisted, isTooLongForDefaultValueSummary, isTooLongForTypeSummary, isValidDocgenSection, normalizeNewlines, parseJsDoc, str };
|