@storybook/react 10.6.0-alpha.6 → 10.6.0-alpha.7
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.
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_5mro4fxxrdb from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_5mro4fxxrdb from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_5mro4fxxrdb from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_5mro4fxxrdb.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_5mro4fxxrdb.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_5mro4fxxrdb.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -13112,7 +13112,7 @@ function invariant(condition, message) {
|
|
|
13112
13112
|
throw new Error((typeof message == "function" ? message() : message) ?? "Invariant failed");
|
|
13113
13113
|
}
|
|
13114
13114
|
var memoStore = /* @__PURE__ */ new WeakMap(), asyncMemoStore = /* @__PURE__ */ new WeakMap(), textFileCache = /* @__PURE__ */ new Map(), cached = (fn, opts = {}) => {
|
|
13115
|
-
let
|
|
13115
|
+
let keyOf = opts.key ?? ((...args) => {
|
|
13116
13116
|
try {
|
|
13117
13117
|
return JSON.stringify(args);
|
|
13118
13118
|
} catch {
|
|
@@ -13120,14 +13120,14 @@ var memoStore = /* @__PURE__ */ new WeakMap(), asyncMemoStore = /* @__PURE__ */
|
|
|
13120
13120
|
}
|
|
13121
13121
|
});
|
|
13122
13122
|
return (...args) => {
|
|
13123
|
-
let k =
|
|
13123
|
+
let k = keyOf(...args), name = fn.name || opts.name || "anonymous", store = memoStore.get(fn);
|
|
13124
13124
|
if (store || (store = /* @__PURE__ */ new Map(), memoStore.set(fn, store)), store.has(k))
|
|
13125
13125
|
return logger.verbose(`[cache] hit ${name} key=${k}`), store.get(k);
|
|
13126
13126
|
let start = Date.now(), result = fn(...args), duration = Date.now() - start;
|
|
13127
13127
|
return store.set(k, result), logger.verbose(`[cache] miss ${name} took ${duration}ms key=${k}`), result;
|
|
13128
13128
|
};
|
|
13129
13129
|
}, asyncCache = (fn, opts = {}) => {
|
|
13130
|
-
let
|
|
13130
|
+
let keyOf = opts.key ?? ((...args) => {
|
|
13131
13131
|
try {
|
|
13132
13132
|
return JSON.stringify(args);
|
|
13133
13133
|
} catch {
|
|
@@ -13135,7 +13135,7 @@ var memoStore = /* @__PURE__ */ new WeakMap(), asyncMemoStore = /* @__PURE__ */
|
|
|
13135
13135
|
}
|
|
13136
13136
|
});
|
|
13137
13137
|
return (...args) => {
|
|
13138
|
-
let k =
|
|
13138
|
+
let k = keyOf(...args), name = fn.name || opts.name || "anonymous", store = asyncMemoStore.get(fn);
|
|
13139
13139
|
store || (store = /* @__PURE__ */ new Map(), asyncMemoStore.set(fn, store));
|
|
13140
13140
|
let existing = store.get(k);
|
|
13141
13141
|
if (existing)
|
|
@@ -13639,8 +13639,8 @@ function getJSDocDefault(typescript, prop, checker) {
|
|
|
13639
13639
|
if (tag.name === "default" || tag.name === "defaultValue")
|
|
13640
13640
|
return typescript.displayPartsToString(tag.text) || void 0;
|
|
13641
13641
|
}
|
|
13642
|
-
function extractPropItem(typescript, checker, prop, contextNode, defaultsMap) {
|
|
13643
|
-
let isRequired = !!!(prop.flags & typescript.SymbolFlags.Optional), propType = checker.getTypeOfSymbolAtLocation(prop, contextNode), type = serializeType(typescript, checker, propType, isRequired), description = typescript.displayPartsToString(prop.getDocumentationComment(checker)), parent = getParentType(typescript, prop), declarations = getAllDeclarationParents(typescript, prop), propName = prop.getName(), destructuringDefault = defaultsMap?.get(propName), jsDocDefault = getJSDocDefault(typescript, prop, checker), defaultStr = destructuringDefault ?? jsDocDefault;
|
|
13642
|
+
function extractPropItem(typescript, checker, prop, contextNode, defaultsMap, typeOverride) {
|
|
13643
|
+
let isRequired = !!!(prop.flags & typescript.SymbolFlags.Optional), propType = typeOverride ?? checker.getTypeOfSymbolAtLocation(prop, contextNode), type = serializeType(typescript, checker, propType, isRequired), description = typescript.displayPartsToString(prop.getDocumentationComment(checker)), parent = getParentType(typescript, prop), declarations = getAllDeclarationParents(typescript, prop), propName = prop.getName(), destructuringDefault = defaultsMap?.get(propName), jsDocDefault = getJSDocDefault(typescript, prop, checker), defaultStr = destructuringDefault ?? jsDocDefault;
|
|
13644
13644
|
return {
|
|
13645
13645
|
name: propName,
|
|
13646
13646
|
required: isRequired,
|
|
@@ -13744,7 +13744,14 @@ function serializeComponentDoc(typescript, checker, {
|
|
|
13744
13744
|
for (let prop of allProperties) {
|
|
13745
13745
|
if (excluded.has(prop.getName()))
|
|
13746
13746
|
continue;
|
|
13747
|
-
let
|
|
13747
|
+
let unionProp = isUnionType(propsType) ? checker.getPropertyOfType(propsType, prop.getName()) : void 0, unionPropType = unionProp ? checker.getTypeOfSymbolAtLocation(unionProp, contextNode) : void 0, item = extractPropItem(
|
|
13748
|
+
typescript,
|
|
13749
|
+
checker,
|
|
13750
|
+
prop,
|
|
13751
|
+
contextNode,
|
|
13752
|
+
defaultsMap,
|
|
13753
|
+
unionPropType
|
|
13754
|
+
);
|
|
13748
13755
|
unionForceOptional?.has(prop.getName()) && (item.required = !1), props[prop.getName()] = item;
|
|
13749
13756
|
}
|
|
13750
13757
|
let displayName = (isMemberSelection ? displayNameOverride : void 0) ?? computeDisplayName({
|
|
@@ -15957,41 +15964,49 @@ var delimiter = globalThis.process?.platform === "win32" ? ";" : ":", _platforms
|
|
|
15957
15964
|
// src/componentManifest/generateCodeSnippet.ts
|
|
15958
15965
|
import { types as t2 } from "storybook/internal/babel";
|
|
15959
15966
|
import {
|
|
15960
|
-
|
|
15961
|
-
keyOf,
|
|
15967
|
+
createStoryArgsResolver,
|
|
15962
15968
|
metaObjectPath,
|
|
15963
|
-
mergeArgsRecords,
|
|
15964
|
-
metaArgsRecord,
|
|
15965
15969
|
normalizeStoryDeclaration,
|
|
15966
|
-
resolveRenderFunction
|
|
15967
|
-
storyAssignedArgsPath
|
|
15970
|
+
resolveRenderFunction
|
|
15968
15971
|
} from "storybook/internal/csf-tools";
|
|
15969
|
-
function
|
|
15970
|
-
|
|
15972
|
+
function renderFunctionOf(resolution) {
|
|
15973
|
+
return resolution.kind === "resolved" ? resolution.path : resolution.kind === "unresolved" ? resolution.shadowedRender : void 0;
|
|
15974
|
+
}
|
|
15975
|
+
function getCodeSnippet(csf, storyName, componentName, resolver = createStoryArgsResolver(csf)) {
|
|
15976
|
+
let { args, imports, unresolved } = resolver.resolve(storyName);
|
|
15977
|
+
return {
|
|
15978
|
+
node: buildSnippetNode(csf, storyName, componentName, args, resolver.ctx),
|
|
15979
|
+
imports,
|
|
15980
|
+
unresolved
|
|
15981
|
+
};
|
|
15982
|
+
}
|
|
15983
|
+
function buildSnippetNode(csf, storyName, componentName, merged, ctx) {
|
|
15984
|
+
let storyDeclaration = csf._storyDeclarationPath[storyName];
|
|
15971
15985
|
if (!storyDeclaration) {
|
|
15972
15986
|
let message = "Expected story to be a function or variable declaration";
|
|
15973
15987
|
throw csf._storyPaths[storyName]?.buildCodeFrameError(message) ?? message;
|
|
15974
15988
|
}
|
|
15975
15989
|
let normalizedStory = normalizeStoryDeclaration(storyDeclaration), storyFn;
|
|
15976
15990
|
normalizedStory.type === "fn" && (storyFn = normalizedStory.path);
|
|
15977
|
-
let
|
|
15978
|
-
storyFn || (storyFn = storyRender
|
|
15979
|
-
let
|
|
15980
|
-
...mergeArgsRecords(metaArgs, storyArgs),
|
|
15981
|
-
...storyAssignedArgs
|
|
15982
|
-
}, entries = Object.entries(merged).filter(([k]) => k !== "children"), validEntries = entries.filter(([k, v]) => isValidJsxAttrName(k) && v != null), invalidEntries = entries.filter(([k, v]) => !isValidJsxAttrName(k) && v != null), injectedAttrs = validEntries.map(([k, v]) => toAttr(k, v)).filter((a) => a != null);
|
|
15991
|
+
let storyConfigPath = normalizedStory.type === "config" ? normalizedStory.path : void 0, metaRender = resolveRenderFunction(metaObjectPath(csf), storyDeclaration, ctx), storyRender = resolveRenderFunction(storyConfigPath, storyDeclaration, ctx);
|
|
15992
|
+
storyFn || (storyFn = renderFunctionOf(storyRender) ?? (storyRender.kind === "missing" ? renderFunctionOf(metaRender) : void 0));
|
|
15993
|
+
let entries = Object.entries(merged).filter(([k]) => k !== "children"), validEntries = entries.filter(([k, v]) => isValidJsxAttrName(k) && v != null), invalidEntries = entries.filter(([k, v]) => !isValidJsxAttrName(k) && v != null), injectedAttrs = validEntries.map(([k, v]) => toAttr(k, v)).filter((a) => a != null);
|
|
15983
15994
|
if (storyFn) {
|
|
15984
15995
|
let fn = storyFn.node;
|
|
15985
15996
|
if (t2.isArrowFunctionExpression(fn) && (t2.isJSXElement(fn.body) || t2.isJSXFragment(fn.body))) {
|
|
15986
15997
|
let spreadRes = transformArgsSpreadsInJsx(fn.body, merged), inlineRes = inlineArgsInJsx(spreadRes.node, merged);
|
|
15987
15998
|
if (spreadRes.changed || inlineRes.changed) {
|
|
15988
|
-
let newFn = t2.arrowFunctionExpression(
|
|
15999
|
+
let newFn = t2.arrowFunctionExpression(
|
|
16000
|
+
remainingParams(fn, inlineRes.node),
|
|
16001
|
+
inlineRes.node,
|
|
16002
|
+
fn.async
|
|
16003
|
+
);
|
|
15989
16004
|
return t2.variableDeclaration("const", [
|
|
15990
16005
|
t2.variableDeclarator(t2.identifier(storyName), newFn)
|
|
15991
16006
|
]);
|
|
15992
16007
|
}
|
|
15993
16008
|
}
|
|
15994
|
-
let stmts = t2.isFunctionDeclaration(fn) || t2.isArrowFunctionExpression(fn) && t2.isBlockStatement(fn.body) || t2.isFunctionExpression(fn) && t2.isBlockStatement(fn.body) ? fn.body.body : void 0;
|
|
16009
|
+
let stmts = t2.isFunctionDeclaration(fn) || t2.isObjectMethod(fn) || t2.isArrowFunctionExpression(fn) && t2.isBlockStatement(fn.body) || t2.isFunctionExpression(fn) && t2.isBlockStatement(fn.body) ? fn.body.body : void 0;
|
|
15995
16010
|
if (stmts) {
|
|
15996
16011
|
let changed = !1, newBody = stmts.map((stmt) => {
|
|
15997
16012
|
if (t2.isReturnStatement(stmt) && stmt.argument && (t2.isJSXElement(stmt.argument) || t2.isJSXFragment(stmt.argument))) {
|
|
@@ -16001,21 +16016,22 @@ function getCodeSnippet(csf, storyName, componentName) {
|
|
|
16001
16016
|
}
|
|
16002
16017
|
return stmt;
|
|
16003
16018
|
});
|
|
16004
|
-
if (changed)
|
|
16005
|
-
|
|
16006
|
-
|
|
16007
|
-
[],
|
|
16008
|
-
t2.blockStatement(newBody),
|
|
16009
|
-
fn.generator,
|
|
16010
|
-
fn.async
|
|
16011
|
-
) : t2.variableDeclaration("const", [
|
|
16019
|
+
if (changed) {
|
|
16020
|
+
let body = t2.blockStatement(newBody), params = remainingParams(fn, body);
|
|
16021
|
+
return t2.isFunctionDeclaration(fn) ? t2.functionDeclaration(t2.identifier(storyName), params, body, fn.generator, fn.async) : t2.variableDeclaration("const", [
|
|
16012
16022
|
t2.variableDeclarator(
|
|
16013
16023
|
t2.identifier(storyName),
|
|
16014
|
-
t2.arrowFunctionExpression(
|
|
16024
|
+
t2.arrowFunctionExpression(params, body, fn.async)
|
|
16015
16025
|
)
|
|
16016
16026
|
]);
|
|
16027
|
+
}
|
|
16017
16028
|
}
|
|
16018
|
-
return t2.isFunctionDeclaration(fn) ? t2.functionDeclaration(t2.identifier(storyName), fn.params, fn.body, fn.generator, fn.async) : t2.variableDeclaration("const", [
|
|
16029
|
+
return t2.isFunctionDeclaration(fn) ? t2.functionDeclaration(t2.identifier(storyName), fn.params, fn.body, fn.generator, fn.async) : t2.variableDeclaration("const", [
|
|
16030
|
+
t2.variableDeclarator(
|
|
16031
|
+
t2.identifier(storyName),
|
|
16032
|
+
t2.isObjectMethod(fn) ? t2.arrowFunctionExpression(fn.params, fn.body, fn.async) : fn
|
|
16033
|
+
)
|
|
16034
|
+
]);
|
|
16019
16035
|
}
|
|
16020
16036
|
invariant(componentName, "Could not generate snippet without component name.");
|
|
16021
16037
|
let invalidSpread = buildInvalidSpread(invalidEntries), name = t2.jsxIdentifier(componentName), openingElAttrs = invalidSpread ? [...injectedAttrs, invalidSpread] : injectedAttrs, children = toJsxChildren(merged.children), selfClosing = children.length === 0, arrow = t2.arrowFunctionExpression(
|
|
@@ -16029,6 +16045,15 @@ function getCodeSnippet(csf, storyName, componentName) {
|
|
|
16029
16045
|
);
|
|
16030
16046
|
return t2.variableDeclaration("const", [t2.variableDeclarator(t2.identifier(storyName), arrow)]);
|
|
16031
16047
|
}
|
|
16048
|
+
function remainingParams(fn, body) {
|
|
16049
|
+
return readsArgs(body) ? fn.params : [];
|
|
16050
|
+
}
|
|
16051
|
+
function readsArgs(node) {
|
|
16052
|
+
let named = /* @__PURE__ */ new Set(), reads = !1;
|
|
16053
|
+
return t2.traverseFast(node, (current2) => {
|
|
16054
|
+
t2.isMemberExpression(current2) && !current2.computed && named.add(current2.property), (t2.isObjectProperty(current2) || t2.isObjectMethod(current2)) && !current2.computed && named.add(current2.key), t2.isIdentifier(current2) && current2.name === "args" && !named.has(current2) && (reads = !0);
|
|
16055
|
+
}), reads;
|
|
16056
|
+
}
|
|
16032
16057
|
function buildInvalidSpread(entries) {
|
|
16033
16058
|
if (entries.length === 0)
|
|
16034
16059
|
return null;
|
|
@@ -16344,7 +16369,12 @@ function normalizeFileName(typescript, fileName) {
|
|
|
16344
16369
|
// src/componentManifest/resolveComponents.ts
|
|
16345
16370
|
import { recast } from "storybook/internal/babel";
|
|
16346
16371
|
import { storyNameFromExport } from "storybook/internal/csf";
|
|
16347
|
-
import {
|
|
16372
|
+
import {
|
|
16373
|
+
createStoryArgsResolver as createStoryArgsResolver2,
|
|
16374
|
+
extractStoryJSDocInfo,
|
|
16375
|
+
loadCsf,
|
|
16376
|
+
unresolvedWarning
|
|
16377
|
+
} from "storybook/internal/csf-tools";
|
|
16348
16378
|
|
|
16349
16379
|
// src/componentManifest/getComponentImports.ts
|
|
16350
16380
|
import { dirname as dirname6 } from "node:path";
|
|
@@ -16550,32 +16580,38 @@ async function resolveStoryFileComponents(options) {
|
|
|
16550
16580
|
}));
|
|
16551
16581
|
return { storyPath, storyFile, csf, componentName, allComponents, component, subcomponents };
|
|
16552
16582
|
}
|
|
16553
|
-
function extractStorySnippets(csf, componentName, filterStoryIds) {
|
|
16554
|
-
|
|
16583
|
+
function extractStorySnippets(csf, componentName, filterStoryIds, references) {
|
|
16584
|
+
let imports = [], resolver = createStoryArgsResolver2(csf, references);
|
|
16585
|
+
return { stories: Object.entries(csf._stories).filter(([, story]) => !filterStoryIds || filterStoryIds.has(story.id)).map(([storyExport, story]) => {
|
|
16555
16586
|
let name = story.name ?? storyNameFromExport(storyExport);
|
|
16556
16587
|
try {
|
|
16557
|
-
let { description, summary } = extractStoryJSDocInfo(csf._storyStatements[storyExport]);
|
|
16588
|
+
let { description, summary } = extractStoryJSDocInfo(csf._storyStatements[storyExport]), snippet = getCodeSnippet(csf, storyExport, componentName, resolver);
|
|
16589
|
+
imports.push(...snippet.imports);
|
|
16590
|
+
let warning = unresolvedWarning(snippet.unresolved);
|
|
16558
16591
|
return {
|
|
16559
16592
|
id: story.id,
|
|
16560
16593
|
name,
|
|
16561
|
-
snippet: recast.print(
|
|
16594
|
+
snippet: recast.print(snippet.node).code,
|
|
16562
16595
|
description,
|
|
16563
|
-
summary
|
|
16596
|
+
summary,
|
|
16597
|
+
...warning ? { warning } : {}
|
|
16564
16598
|
};
|
|
16565
16599
|
} catch (e) {
|
|
16566
16600
|
let err = e instanceof Error ? e : new Error(String(e));
|
|
16567
16601
|
return { id: story.id, name, error: { name: err.name, message: err.message } };
|
|
16568
16602
|
}
|
|
16569
|
-
});
|
|
16603
|
+
}), imports };
|
|
16570
16604
|
}
|
|
16571
16605
|
|
|
16572
16606
|
// src/componentManifest/buildReactComponentDocgen.ts
|
|
16573
16607
|
import { getComponentIdFromEntry } from "storybook/internal/common";
|
|
16574
16608
|
import {
|
|
16575
16609
|
buildImportStatements as buildImportStatements2,
|
|
16610
|
+
createStoryReferenceResolver,
|
|
16576
16611
|
extractComponentDescription,
|
|
16577
16612
|
extractDescription
|
|
16578
16613
|
} from "storybook/internal/csf-tools";
|
|
16614
|
+
var openStoryReferences = createStoryReferenceResolver();
|
|
16579
16615
|
function getPackageInfo(componentPath, fallbackPath) {
|
|
16580
16616
|
let nearestPkg = cachedFindUp("package.json", {
|
|
16581
16617
|
cwd: posix.dirname(componentPath ?? fallbackPath)
|
|
@@ -16673,14 +16709,17 @@ function buildStoryDocsFromResolved({
|
|
|
16673
16709
|
allComponents,
|
|
16674
16710
|
filterStoryIds
|
|
16675
16711
|
}) {
|
|
16676
|
-
let id = getComponentIdFromEntry(entry), title = entry.title.split("/").at(-1).replace(/\s+/g, ""), packageName = getPackageInfo(component?.path, storyPath), fallbackImport = getFallbackImport(packageName, componentName),
|
|
16677
|
-
|
|
16712
|
+
let id = getComponentIdFromEntry(entry), title = entry.title.split("/").at(-1).replace(/\s+/g, ""), packageName = getPackageInfo(component?.path, storyPath), fallbackImport = getFallbackImport(packageName, componentName), storyEntries = extractStorySnippets(csf, component?.componentName, filterStoryIds, {
|
|
16713
|
+
filePath: storyPath,
|
|
16714
|
+
...openStoryReferences()
|
|
16715
|
+
}), argRefs = storyEntries.imports.map((ref2) => ({ ...ref2, isPackage: !0 })), imports = buildImportStatements2({ refs: [...allComponents, ...argRefs], packageName }).join(`
|
|
16716
|
+
`).trim() || fallbackImport;
|
|
16678
16717
|
return {
|
|
16679
16718
|
id,
|
|
16680
16719
|
name: componentName ?? title,
|
|
16681
16720
|
path: storyFilePath,
|
|
16682
16721
|
...imports ? { import: imports } : {},
|
|
16683
|
-
stories: Object.fromEntries(storyEntries.map((story) => [story.id, story]))
|
|
16722
|
+
stories: Object.fromEntries(storyEntries.stories.map((story) => [story.id, story]))
|
|
16684
16723
|
};
|
|
16685
16724
|
}
|
|
16686
16725
|
function buildComponentDocgenFromResolved({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_5mro4fxxrdb from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_5mro4fxxrdb from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_5mro4fxxrdb from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_5mro4fxxrdb.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_5mro4fxxrdb.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_5mro4fxxrdb.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
extractArgTypes,
|
|
16
16
|
posix,
|
|
17
17
|
resolveStoryFileComponents
|
|
18
|
-
} from "../_node-chunks/chunk-
|
|
18
|
+
} from "../_node-chunks/chunk-7MQEKIVD.js";
|
|
19
19
|
|
|
20
20
|
// src/docgen/docgen-worker.ts
|
|
21
21
|
import { createLazyDocgenMiddleware } from "storybook/internal/common";
|
package/dist/preset.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_5mro4fxxrdb from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_5mro4fxxrdb from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_5mro4fxxrdb from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_5mro4fxxrdb.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_5mro4fxxrdb.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_5mro4fxxrdb.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
parseWithReactDocgen,
|
|
23
23
|
posix,
|
|
24
24
|
resolveStoryFileComponents
|
|
25
|
-
} from "./_node-chunks/chunk-
|
|
25
|
+
} from "./_node-chunks/chunk-7MQEKIVD.js";
|
|
26
26
|
|
|
27
27
|
// src/preset.ts
|
|
28
28
|
import path2, { join as join3 } from "node:path";
|
|
@@ -466,7 +466,7 @@ var enrichCsf = async (input, options) => {
|
|
|
466
466
|
return;
|
|
467
467
|
let { format: format3 } = await getPrettier(), node, snippet;
|
|
468
468
|
try {
|
|
469
|
-
node = getCodeSnippet(csfSource, key, csfSource._meta?.component);
|
|
469
|
+
node = getCodeSnippet(csfSource, key, csfSource._meta?.component).node;
|
|
470
470
|
} catch (e) {
|
|
471
471
|
if (!(e instanceof Error))
|
|
472
472
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react",
|
|
3
|
-
"version": "10.6.0-alpha.
|
|
3
|
+
"version": "10.6.0-alpha.7",
|
|
4
4
|
"description": "Storybook React renderer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
],
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@storybook/global": "^5.0.0",
|
|
52
|
-
"@storybook/react-dom-shim": "10.6.0-alpha.
|
|
52
|
+
"@storybook/react-dom-shim": "10.6.0-alpha.7",
|
|
53
53
|
"react-docgen": "^8.0.2",
|
|
54
54
|
"react-docgen-typescript": "^2.2.2"
|
|
55
55
|
},
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"@types/react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
83
83
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
84
84
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
85
|
-
"storybook": "^10.6.0-alpha.
|
|
85
|
+
"storybook": "^10.6.0-alpha.7",
|
|
86
86
|
"typescript": ">= 4.9.x"
|
|
87
87
|
},
|
|
88
88
|
"peerDependenciesMeta": {
|