@storybook/react 11.0.0-beta.1 → 11.0.0-beta.3
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/_browser-chunks/{chunk-2TQVKMJE.js → chunk-EA5DV32Q.js} +36 -1
- package/dist/_browser-chunks/{chunk-6MBKXM7O.js → chunk-U7XUEUFQ.js} +2 -2
- package/dist/_browser-chunks/{chunk-LGSTPTL6.js → chunk-WWHCZJWM.js} +10 -9
- package/dist/_node-chunks/{chunk-GQOGANUK.js → chunk-23AJ2HMB.js} +11 -13
- package/dist/_node-chunks/{chunk-YNIH7TZQ.js → chunk-DYAQFVW4.js} +8 -8
- package/dist/_node-chunks/chunk-IHFW4SZ5.js +18 -0
- package/dist/_node-chunks/{chunk-FUHORIY7.js → chunk-J7MJPACM.js} +9 -9
- package/dist/_node-chunks/{chunk-RVHW3VEA.js → chunk-MA6UOA7T.js} +6 -6
- package/dist/_node-chunks/{chunk-FCIBS77S.js → chunk-OICUDNLP.js} +7 -7
- package/dist/_node-chunks/{chunk-37XDLJI5.js → chunk-WCSAV7ZK.js} +18 -17
- package/dist/_node-chunks/{chunk-IYZUDUNZ.js → chunk-YAHZ47OQ.js} +7 -7
- package/dist/_node-chunks/{chunk-U53ZMSA3.js → chunk-YSSTGZG6.js} +1716 -515
- package/dist/_node-chunks/{chunk-PPFRYFMF.js → chunk-ZQMXVWN3.js} +16 -8
- package/dist/_node-chunks/{extractArgTypesFromComponentFile-EQEZZAHL.js → extractArgTypesFromComponentFile-U3IU4PU3.js} +17 -15
- package/dist/_node-chunks/{extractReactDocgenInfo-COAPYCG6.js → extractReactDocgenInfo-XQKB6M4O.js} +11 -11
- package/dist/_node-chunks/{extractReactTypescriptDocgenInfo-7FFDIBEA.js → extractReactTypescriptDocgenInfo-X3XIYU7H.js} +9 -9
- package/dist/_node-chunks/reactDocgen-US7O3JSK.js +26 -0
- package/dist/builder-docgen.d.ts +2 -2
- package/dist/builder-docgen.js +9 -8
- package/dist/docgen/docgen-worker.js +22 -18
- package/dist/entry-preview-argtypes.js +1 -1
- package/dist/entry-preview-docs.js +1 -1
- package/dist/index.js +3 -3
- package/dist/preset.js +35 -25
- package/dist/preview.js +3 -3
- package/package.json +5 -3
- package/dist/_node-chunks/reactDocgen-6ZJPM2YE.js +0 -26
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_f25fxbi8k7f from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_f25fxbi8k7f from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_f25fxbi8k7f from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_f25fxbi8k7f.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_f25fxbi8k7f.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_f25fxbi8k7f.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
REACT_DOCGEN_TYPESCRIPT_APIS
|
|
14
|
+
} from "./chunk-IHFW4SZ5.js";
|
|
12
15
|
|
|
13
16
|
// src/builder-docgen.ts
|
|
14
17
|
import {
|
|
@@ -19,7 +22,11 @@ import {
|
|
|
19
22
|
var REACT_BUILDER_DOCGEN_PACKAGES = {
|
|
20
23
|
"react-docgen": "^8.0.2",
|
|
21
24
|
"react-docgen-typescript": "^2.2.2",
|
|
22
|
-
|
|
25
|
+
// TEMPORARY(ts-7.1): 0.7 only. 0.9 accepts TypeScript `>=7.1.0-0`; npm resolves optional peers when
|
|
26
|
+
// it checks for conflicts, picks a 7.1 prerelease, and fails to install a project without its own
|
|
27
|
+
// `typescript`. Once TypeScript 7.1.0 is stable, allow 0.8 and 0.9 again and drop `@^0.7.0` from the
|
|
28
|
+
// docs and MIGRATION.md.
|
|
29
|
+
"@joshwooding/vite-plugin-react-docgen-typescript": "^0.7.0",
|
|
23
30
|
"@storybook/react-docgen-typescript-plugin": "1.0.6--canary.9.0c3f3b7.0"
|
|
24
31
|
};
|
|
25
32
|
function getReactBuilderDocgenPackages(reactDocgen, builder) {
|
|
@@ -45,7 +52,8 @@ async function prepareReactBuilderDocgen({
|
|
|
45
52
|
builderDocgen: `typescript.reactDocgen: '${reactDocgen}'`,
|
|
46
53
|
disableBuilderDocgen: "typescript.reactDocgen: false",
|
|
47
54
|
documentation: "https://storybook.js.org/docs/api/main-config/main-config-typescript#reactdocgen",
|
|
48
|
-
note: mode !== reactDocgen ? "`react-docgen-typescript` needs the TypeScript compiler API, which your `typescript` package does not have, so builder docgen uses `react-docgen` instead." : void 0
|
|
55
|
+
note: mode !== reactDocgen ? "`react-docgen-typescript` needs the TypeScript compiler API, which your `typescript` package does not have, so builder docgen uses `react-docgen` instead." : void 0,
|
|
56
|
+
apis: REACT_DOCGEN_TYPESCRIPT_APIS
|
|
49
57
|
})).length > 0 ? void 0 : mode;
|
|
50
58
|
}
|
|
51
59
|
|
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_f25fxbi8k7f from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_f25fxbi8k7f from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_f25fxbi8k7f from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_f25fxbi8k7f.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_f25fxbi8k7f.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_f25fxbi8k7f.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
getSharedComponentMetaManager
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-23AJ2HMB.js";
|
|
15
15
|
import {
|
|
16
16
|
extractArgTypesFromComponentMeta
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-DYAQFVW4.js";
|
|
18
|
+
import "./chunk-YSSTGZG6.js";
|
|
19
|
+
import "./chunk-IHFW4SZ5.js";
|
|
20
|
+
import "./chunk-YAHZ47OQ.js";
|
|
21
|
+
import "./chunk-WCSAV7ZK.js";
|
|
22
|
+
import "./chunk-OICUDNLP.js";
|
|
23
|
+
import "./chunk-MA6UOA7T.js";
|
|
23
24
|
|
|
24
25
|
// src/docgen/extractArgTypesFromComponentFile.ts
|
|
25
26
|
async function extractArgTypesFromComponentFile({
|
|
26
27
|
componentFilePath,
|
|
27
|
-
componentExportName = "default"
|
|
28
|
+
componentExportName = "default",
|
|
29
|
+
typeScriptSpecifier
|
|
28
30
|
}) {
|
|
29
|
-
let manager = await getSharedComponentMetaManager();
|
|
31
|
+
let manager = await getSharedComponentMetaManager(typeScriptSpecifier);
|
|
30
32
|
if (!manager)
|
|
31
33
|
return null;
|
|
32
34
|
let component = {
|
package/dist/_node-chunks/{extractReactDocgenInfo-COAPYCG6.js → extractReactDocgenInfo-XQKB6M4O.js}
RENAMED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_f25fxbi8k7f from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_f25fxbi8k7f from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_f25fxbi8k7f from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_f25fxbi8k7f.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_f25fxbi8k7f.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_f25fxbi8k7f.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
parseWithReactDocgen
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-J7MJPACM.js";
|
|
15
15
|
import {
|
|
16
16
|
cachedReadFileSync
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-YAHZ47OQ.js";
|
|
18
18
|
import {
|
|
19
19
|
extractArgTypes
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-WCSAV7ZK.js";
|
|
21
|
+
import "./chunk-OICUDNLP.js";
|
|
22
|
+
import "./chunk-MA6UOA7T.js";
|
|
23
23
|
|
|
24
24
|
// src/componentManifest/reactDocgen/extractReactDocgenInfo.ts
|
|
25
25
|
import { logger } from "storybook/internal/node-logger";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_f25fxbi8k7f from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_f25fxbi8k7f from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_f25fxbi8k7f from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_f25fxbi8k7f.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_f25fxbi8k7f.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_f25fxbi8k7f.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
extractArgTypes
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-WCSAV7ZK.js";
|
|
15
|
+
import "./chunk-OICUDNLP.js";
|
|
16
|
+
import "./chunk-MA6UOA7T.js";
|
|
17
17
|
|
|
18
18
|
// src/componentManifest/reactDocgen/extractReactTypescriptDocgenInfo.ts
|
|
19
19
|
import { logger } from "storybook/internal/node-logger";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_f25fxbi8k7f from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_f25fxbi8k7f from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_f25fxbi8k7f from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_f25fxbi8k7f.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_f25fxbi8k7f.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_f25fxbi8k7f.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
getMatchingDocgen,
|
|
14
|
+
getReactDocgen,
|
|
15
|
+
getReactDocgenImporter,
|
|
16
|
+
parseWithReactDocgen
|
|
17
|
+
} from "./chunk-J7MJPACM.js";
|
|
18
|
+
import "./chunk-YAHZ47OQ.js";
|
|
19
|
+
import "./chunk-OICUDNLP.js";
|
|
20
|
+
import "./chunk-MA6UOA7T.js";
|
|
21
|
+
export {
|
|
22
|
+
getMatchingDocgen,
|
|
23
|
+
getReactDocgen,
|
|
24
|
+
getReactDocgenImporter,
|
|
25
|
+
parseWithReactDocgen
|
|
26
|
+
};
|
package/dist/builder-docgen.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ type ReactDocgenConfig = 'react-docgen' | 'react-docgen-typescript' | false;
|
|
|
13
13
|
declare const REACT_BUILDER_DOCGEN_PACKAGES: {
|
|
14
14
|
readonly 'react-docgen': '^8.0.2';
|
|
15
15
|
readonly 'react-docgen-typescript': '^2.2.2';
|
|
16
|
-
readonly '@joshwooding/vite-plugin-react-docgen-typescript': '^0.7.0
|
|
16
|
+
readonly '@joshwooding/vite-plugin-react-docgen-typescript': '^0.7.0';
|
|
17
17
|
readonly '@storybook/react-docgen-typescript-plugin': '1.0.6--canary.9.0c3f3b7.0';
|
|
18
18
|
};
|
|
19
19
|
type ReactBuilderDocgenPackage = keyof typeof REACT_BUILDER_DOCGEN_PACKAGES;
|
|
@@ -45,7 +45,7 @@ declare function prepareReactBuilderDocgen({
|
|
|
45
45
|
reactDocgen: Exclude<ReactDocgenConfig, false>;
|
|
46
46
|
builder: 'vite' | 'webpack'; /** Resolve from the framework package, which declares the packages as optional peers. */
|
|
47
47
|
resolve: (specifier: string) => string;
|
|
48
|
-
options: Pick<Options, 'configDir'>;
|
|
48
|
+
options: Pick<Options, 'configDir' | 'presets'>;
|
|
49
49
|
}): Promise<Exclude<ReactDocgenConfig, false> | undefined>;
|
|
50
50
|
//#endregion
|
|
51
51
|
export { REACT_BUILDER_DOCGEN_PACKAGES, ReactBuilderDocgenPackage, getReactBuilderDocgenPackages, isReactBuilderDocgenPackageInstalled, prepareReactBuilderDocgen };
|
package/dist/builder-docgen.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_f25fxbi8k7f from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_f25fxbi8k7f from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_f25fxbi8k7f from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_f25fxbi8k7f.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_f25fxbi8k7f.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_f25fxbi8k7f.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -14,8 +14,9 @@ import {
|
|
|
14
14
|
getReactBuilderDocgenPackages,
|
|
15
15
|
isReactBuilderDocgenPackageInstalled,
|
|
16
16
|
prepareReactBuilderDocgen
|
|
17
|
-
} from "./_node-chunks/chunk-
|
|
18
|
-
import "./_node-chunks/chunk-
|
|
17
|
+
} from "./_node-chunks/chunk-ZQMXVWN3.js";
|
|
18
|
+
import "./_node-chunks/chunk-IHFW4SZ5.js";
|
|
19
|
+
import "./_node-chunks/chunk-MA6UOA7T.js";
|
|
19
20
|
export {
|
|
20
21
|
REACT_BUILDER_DOCGEN_PACKAGES,
|
|
21
22
|
getReactBuilderDocgenPackages,
|
|
@@ -1,34 +1,38 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_f25fxbi8k7f from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_f25fxbi8k7f from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_f25fxbi8k7f from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_f25fxbi8k7f.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_f25fxbi8k7f.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_f25fxbi8k7f.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
buildDocgenPayload
|
|
14
|
-
} from "../_node-chunks/chunk-
|
|
14
|
+
} from "../_node-chunks/chunk-DYAQFVW4.js";
|
|
15
15
|
import {
|
|
16
|
-
ComponentMetaManager
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import "../_node-chunks/chunk-
|
|
20
|
-
import "../_node-chunks/chunk-
|
|
21
|
-
import "../_node-chunks/chunk-
|
|
16
|
+
ComponentMetaManager,
|
|
17
|
+
loadDocgenTypeScript
|
|
18
|
+
} from "../_node-chunks/chunk-YSSTGZG6.js";
|
|
19
|
+
import "../_node-chunks/chunk-IHFW4SZ5.js";
|
|
20
|
+
import "../_node-chunks/chunk-YAHZ47OQ.js";
|
|
21
|
+
import "../_node-chunks/chunk-WCSAV7ZK.js";
|
|
22
|
+
import "../_node-chunks/chunk-OICUDNLP.js";
|
|
23
|
+
import "../_node-chunks/chunk-MA6UOA7T.js";
|
|
22
24
|
|
|
23
25
|
// src/docgen/docgen-worker.ts
|
|
24
|
-
import {
|
|
26
|
+
import {
|
|
27
|
+
createLazyDocgenMiddleware
|
|
28
|
+
} from "storybook/internal/common";
|
|
25
29
|
import { logger } from "storybook/internal/node-logger";
|
|
26
|
-
var createDocgenProvider = (
|
|
30
|
+
var createDocgenProvider = ({
|
|
31
|
+
typeScriptSpecifier
|
|
32
|
+
} = {}) => createLazyDocgenMiddleware({
|
|
27
33
|
createManager: async () => {
|
|
28
34
|
try {
|
|
29
|
-
return new ComponentMetaManager(
|
|
30
|
-
await loadTypeScriptCompilerApi(() => import("typescript"))
|
|
31
|
-
);
|
|
35
|
+
return new ComponentMetaManager(await loadDocgenTypeScript(typeScriptSpecifier));
|
|
32
36
|
} catch (err) {
|
|
33
37
|
logger.warn(`React docgen is unavailable. ${err instanceof Error ? err.message : err}`);
|
|
34
38
|
return;
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
applyDecorators,
|
|
3
3
|
decorators,
|
|
4
4
|
parameters
|
|
5
|
-
} from "./_browser-chunks/chunk-
|
|
5
|
+
} from "./_browser-chunks/chunk-EA5DV32Q.js";
|
|
6
6
|
import "./_browser-chunks/chunk-DDIRQRCA.js";
|
|
7
7
|
import "./_browser-chunks/chunk-B3FR4PBN.js";
|
|
8
8
|
import "./_browser-chunks/chunk-UAWMPV5J.js";
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__definePreview
|
|
3
|
-
} from "./_browser-chunks/chunk-
|
|
3
|
+
} from "./_browser-chunks/chunk-U7XUEUFQ.js";
|
|
4
4
|
import {
|
|
5
5
|
entry_preview_exports,
|
|
6
6
|
renderToCanvas
|
|
7
7
|
} from "./_browser-chunks/chunk-I62VTYU3.js";
|
|
8
8
|
import {
|
|
9
9
|
entry_preview_argtypes_exports
|
|
10
|
-
} from "./_browser-chunks/chunk-
|
|
11
|
-
import "./_browser-chunks/chunk-
|
|
10
|
+
} from "./_browser-chunks/chunk-WWHCZJWM.js";
|
|
11
|
+
import "./_browser-chunks/chunk-EA5DV32Q.js";
|
|
12
12
|
import "./_browser-chunks/chunk-DDIRQRCA.js";
|
|
13
13
|
import "./_browser-chunks/chunk-B3FR4PBN.js";
|
|
14
14
|
import "./_browser-chunks/chunk-UAWMPV5J.js";
|
package/dist/preset.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_f25fxbi8k7f from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_f25fxbi8k7f from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_f25fxbi8k7f from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_f25fxbi8k7f.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_f25fxbi8k7f.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_f25fxbi8k7f.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
REACT_BUILDER_DOCGEN_PACKAGES
|
|
14
|
-
} from "./_node-chunks/chunk-
|
|
14
|
+
} from "./_node-chunks/chunk-ZQMXVWN3.js";
|
|
15
15
|
import {
|
|
16
16
|
getSharedComponentMetaManager
|
|
17
|
-
} from "./_node-chunks/chunk-
|
|
17
|
+
} from "./_node-chunks/chunk-23AJ2HMB.js";
|
|
18
18
|
import {
|
|
19
19
|
buildReactComponentDocgenFromResolved,
|
|
20
20
|
buildStoryDocsFromResolved,
|
|
@@ -24,17 +24,21 @@ import {
|
|
|
24
24
|
join,
|
|
25
25
|
posix,
|
|
26
26
|
resolveStoryFileComponents
|
|
27
|
-
} from "./_node-chunks/chunk-
|
|
27
|
+
} from "./_node-chunks/chunk-YSSTGZG6.js";
|
|
28
|
+
import {
|
|
29
|
+
REACT_DOCGEN_TYPESCRIPT_APIS
|
|
30
|
+
} from "./_node-chunks/chunk-IHFW4SZ5.js";
|
|
28
31
|
import {
|
|
29
32
|
invalidateCache
|
|
30
|
-
} from "./_node-chunks/chunk-
|
|
31
|
-
import "./_node-chunks/chunk-
|
|
33
|
+
} from "./_node-chunks/chunk-YAHZ47OQ.js";
|
|
34
|
+
import "./_node-chunks/chunk-MA6UOA7T.js";
|
|
32
35
|
|
|
33
36
|
// src/preset.ts
|
|
34
37
|
import path2, { join as join3 } from "node:path";
|
|
35
38
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
36
39
|
import {
|
|
37
40
|
getProjectRoot,
|
|
41
|
+
getTypeScriptSpecifierForDocgen as getTypeScriptSpecifierForDocgen3,
|
|
38
42
|
isModuleNotFoundError,
|
|
39
43
|
isTypeScriptReadyForDocgen
|
|
40
44
|
} from "storybook/internal/common";
|
|
@@ -279,6 +283,7 @@ var reactResolveAlias = ({ react, reactDom }) => ({
|
|
|
279
283
|
// src/componentManifest/generator.ts
|
|
280
284
|
import {
|
|
281
285
|
getStoryImportPathFromEntry,
|
|
286
|
+
getTypeScriptSpecifierForDocgen,
|
|
282
287
|
selectComponentEntriesByComponentId
|
|
283
288
|
} from "storybook/internal/common";
|
|
284
289
|
var manifests = async (existingManifests = {}, options) => {
|
|
@@ -294,7 +299,7 @@ var manifests = async (existingManifests = {}, options) => {
|
|
|
294
299
|
};
|
|
295
300
|
let docgenEngine = features2?.experimentalReactComponentMeta ? "react-component-meta" : typescriptOptions.reactDocgen || "react-docgen";
|
|
296
301
|
invalidateCache(), invalidateParser();
|
|
297
|
-
let startTime = performance.now(), manager = docgenEngine === "react-component-meta" ? await getSharedComponentMetaManager() : void 0, entriesByUniqueComponent = [
|
|
302
|
+
let startTime = performance.now(), manager = docgenEngine === "react-component-meta" ? await getSharedComponentMetaManager(await getTypeScriptSpecifierForDocgen(options)) : void 0, entriesByUniqueComponent = [
|
|
298
303
|
...selectComponentEntriesByComponentId(manifestEntries).values()
|
|
299
304
|
], resolvedEntries = await Promise.all(
|
|
300
305
|
entriesByUniqueComponent.map(async (entry) => {
|
|
@@ -372,7 +377,7 @@ var enrichCsf = async (input, options) => {
|
|
|
372
377
|
return;
|
|
373
378
|
let { format: format3 } = await getPrettier(), code, snippet;
|
|
374
379
|
try {
|
|
375
|
-
code = getCodeSnippet(csfSource, key, csfSource._meta?.component).
|
|
380
|
+
code = getCodeSnippet(csfSource, key, csfSource._meta?.component).snippet;
|
|
376
381
|
} catch (e) {
|
|
377
382
|
if (!(e instanceof Error))
|
|
378
383
|
return;
|
|
@@ -400,12 +405,14 @@ var enrichCsf = async (input, options) => {
|
|
|
400
405
|
|
|
401
406
|
// src/docgen/preset.ts
|
|
402
407
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
{
|
|
406
|
-
moduleSpecifier: fileURLToPath2(import.meta.resolve("@storybook/react/internal/docgen-worker"))
|
|
407
|
-
|
|
408
|
-
|
|
408
|
+
import { getTypeScriptSpecifierForDocgen as getTypeScriptSpecifierForDocgen2 } from "storybook/internal/common";
|
|
409
|
+
var experimental_docgenProvider = async (existing = [], options) => {
|
|
410
|
+
let descriptor = {
|
|
411
|
+
moduleSpecifier: fileURLToPath2(import.meta.resolve("@storybook/react/internal/docgen-worker")),
|
|
412
|
+
options: { typeScriptSpecifier: await getTypeScriptSpecifierForDocgen2(options) }
|
|
413
|
+
};
|
|
414
|
+
return [...existing, descriptor];
|
|
415
|
+
};
|
|
409
416
|
|
|
410
417
|
// src/docgen/story-docs-preset.ts
|
|
411
418
|
import { STORY_FILE_TEST_REGEXP, getStoryImportPathFromEntry as getStoryImportPathFromEntry3 } from "storybook/internal/common";
|
|
@@ -435,7 +442,8 @@ async function buildStoryDocsPayload(input, context) {
|
|
|
435
442
|
csf,
|
|
436
443
|
componentName,
|
|
437
444
|
component,
|
|
438
|
-
allComponents
|
|
445
|
+
allComponents,
|
|
446
|
+
withTemplate: !0
|
|
439
447
|
});
|
|
440
448
|
}
|
|
441
449
|
|
|
@@ -460,6 +468,7 @@ var experimental_storyDocsProvider = async (nextStoryDocs, options) => {
|
|
|
460
468
|
var isDocgenProviderEnabled = async (_existing, options) => {
|
|
461
469
|
let { reactDocgen } = await options.presets?.apply("typescript", {}) ?? {};
|
|
462
470
|
return isTypeScriptReadyForDocgen((specifier) => import.meta.resolve(specifier), options, {
|
|
471
|
+
apis: REACT_DOCGEN_TYPESCRIPT_APIS,
|
|
463
472
|
builderDocgenFallback: reactDocgen === !1 ? void 0 : { packageName: "react-docgen", range: REACT_BUILDER_DOCGEN_PACKAGES["react-docgen"] }
|
|
464
473
|
});
|
|
465
474
|
}, features = async (existing) => ({
|
|
@@ -500,15 +509,16 @@ async function webpack(config = {}, options) {
|
|
|
500
509
|
return target ? aliasReactInWebpack(config, target) : config;
|
|
501
510
|
}
|
|
502
511
|
async function internal_getArgTypesData(_input, options) {
|
|
503
|
-
let { componentFilePath, componentExportName, presets } = options ?? {};
|
|
512
|
+
let { componentFilePath, componentExportName, presets, configDir } = options ?? {};
|
|
504
513
|
if (!componentFilePath)
|
|
505
514
|
return null;
|
|
506
515
|
let absoluteComponentFilePath = path2.isAbsolute(componentFilePath) ? componentFilePath : join3(getProjectRoot(), componentFilePath);
|
|
507
516
|
if ((await presets?.apply("features", {}))?.docgenServer) {
|
|
508
|
-
let { extractArgTypesFromComponentFile } = await import("./_node-chunks/extractArgTypesFromComponentFile-
|
|
517
|
+
let { extractArgTypesFromComponentFile } = await import("./_node-chunks/extractArgTypesFromComponentFile-U3IU4PU3.js");
|
|
509
518
|
return extractArgTypesFromComponentFile({
|
|
510
519
|
componentFilePath: absoluteComponentFilePath,
|
|
511
|
-
componentExportName
|
|
520
|
+
componentExportName,
|
|
521
|
+
typeScriptSpecifier: configDir && presets ? await getTypeScriptSpecifierForDocgen3({ configDir, presets }) : void 0
|
|
512
522
|
});
|
|
513
523
|
}
|
|
514
524
|
let typescriptOptions = {};
|
|
@@ -523,14 +533,14 @@ async function internal_getArgTypesData(_input, options) {
|
|
|
523
533
|
let argTypesData;
|
|
524
534
|
try {
|
|
525
535
|
if (reactDocgen === "react-docgen-typescript") {
|
|
526
|
-
let { extractArgTypesFromDocgenTypescript } = await import("./_node-chunks/extractReactTypescriptDocgenInfo-
|
|
536
|
+
let { extractArgTypesFromDocgenTypescript } = await import("./_node-chunks/extractReactTypescriptDocgenInfo-X3XIYU7H.js");
|
|
527
537
|
argTypesData = await extractArgTypesFromDocgenTypescript({
|
|
528
538
|
componentFilePath: absoluteComponentFilePath,
|
|
529
539
|
componentExportName,
|
|
530
540
|
reactDocgenTypescriptOptions
|
|
531
541
|
});
|
|
532
542
|
} else {
|
|
533
|
-
let { extractArgTypesFromDocgen } = await import("./_node-chunks/extractReactDocgenInfo-
|
|
543
|
+
let { extractArgTypesFromDocgen } = await import("./_node-chunks/extractReactDocgenInfo-XQKB6M4O.js");
|
|
534
544
|
argTypesData = extractArgTypesFromDocgen({
|
|
535
545
|
componentFilePath: absoluteComponentFilePath,
|
|
536
546
|
componentExportName
|
package/dist/preview.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__definePreview
|
|
3
|
-
} from "./_browser-chunks/chunk-
|
|
3
|
+
} from "./_browser-chunks/chunk-U7XUEUFQ.js";
|
|
4
4
|
import "./_browser-chunks/chunk-I62VTYU3.js";
|
|
5
|
-
import "./_browser-chunks/chunk-
|
|
6
|
-
import "./_browser-chunks/chunk-
|
|
5
|
+
import "./_browser-chunks/chunk-WWHCZJWM.js";
|
|
6
|
+
import "./_browser-chunks/chunk-EA5DV32Q.js";
|
|
7
7
|
import "./_browser-chunks/chunk-DDIRQRCA.js";
|
|
8
8
|
import "./_browser-chunks/chunk-B3FR4PBN.js";
|
|
9
9
|
import "./_browser-chunks/chunk-UAWMPV5J.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react",
|
|
3
|
-
"version": "11.0.0-beta.
|
|
3
|
+
"version": "11.0.0-beta.3",
|
|
4
4
|
"description": "Storybook React renderer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"@storybook/global": "^5.0.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
+
"@storybook/component-meta-typescript": "11.0.0-beta.3",
|
|
59
60
|
"@types/babel-plugin-react-docgen": "^4.2.3",
|
|
60
61
|
"@types/escodegen": "^0.0.6",
|
|
61
62
|
"@types/estree": "^1.0.6",
|
|
@@ -79,7 +80,8 @@
|
|
|
79
80
|
"react-element-to-jsx-string": "patch:react-element-to-jsx-string@npm%3A@7rulnik/react-element-to-jsx-string@15.0.1#~/.yarn/patches/@7rulnik-react-element-to-jsx-string-npm-15.0.1-e53b67c4b3.patch",
|
|
80
81
|
"require-from-string": "^2.0.2",
|
|
81
82
|
"ts-dedent": "^2.2.0",
|
|
82
|
-
"type-fest": "^5.6.0"
|
|
83
|
+
"type-fest": "^5.6.0",
|
|
84
|
+
"typescript-native": "npm:typescript@7.1.0-beta"
|
|
83
85
|
},
|
|
84
86
|
"peerDependencies": {
|
|
85
87
|
"@types/react": "^18.0.0 || ^19.0.0",
|
|
@@ -88,7 +90,7 @@
|
|
|
88
90
|
"react-docgen": "^8.0.2",
|
|
89
91
|
"react-docgen-typescript": "^2.2.2",
|
|
90
92
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
91
|
-
"storybook": "^11.0.0-beta.
|
|
93
|
+
"storybook": "^11.0.0-beta.3",
|
|
92
94
|
"typescript": "^5.9.0 || ^6.0.0 || ^7.0.0"
|
|
93
95
|
},
|
|
94
96
|
"peerDependenciesMeta": {
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_19uq4gz0tcr from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_19uq4gz0tcr from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_19uq4gz0tcr from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_19uq4gz0tcr.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_19uq4gz0tcr.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_19uq4gz0tcr.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
|
-
import {
|
|
13
|
-
getMatchingDocgen,
|
|
14
|
-
getReactDocgen,
|
|
15
|
-
getReactDocgenImporter,
|
|
16
|
-
parseWithReactDocgen
|
|
17
|
-
} from "./chunk-FUHORIY7.js";
|
|
18
|
-
import "./chunk-IYZUDUNZ.js";
|
|
19
|
-
import "./chunk-FCIBS77S.js";
|
|
20
|
-
import "./chunk-RVHW3VEA.js";
|
|
21
|
-
export {
|
|
22
|
-
getMatchingDocgen,
|
|
23
|
-
getReactDocgen,
|
|
24
|
-
getReactDocgenImporter,
|
|
25
|
-
parseWithReactDocgen
|
|
26
|
-
};
|