@storybook/react 11.0.0-rc.1 → 11.0.0-rc.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.
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  parseWithReactDocgen
3
- } from "./chunk-N7TOZR54.js";
3
+ } from "./chunk-RIMY5QBX.js";
4
4
  import {
5
5
  cachedReadFileSync
6
- } from "./chunk-CJ2XYAXX.js";
6
+ } from "./chunk-M3SEC5XW.js";
7
7
  import {
8
8
  extractArgTypes
9
9
  } from "./chunk-SC3QXTHH.js";
@@ -3,8 +3,8 @@ import {
3
3
  getReactDocgen,
4
4
  getReactDocgenImporter,
5
5
  parseWithReactDocgen
6
- } from "./chunk-N7TOZR54.js";
7
- import "./chunk-CJ2XYAXX.js";
6
+ } from "./chunk-RIMY5QBX.js";
7
+ import "./chunk-M3SEC5XW.js";
8
8
  import "./chunk-QKPKKS4R.js";
9
9
  import "./chunk-PQZIOGBY.js";
10
10
  export {
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  buildDocgenPayloads
3
- } from "../_node-chunks/chunk-LZBEMUVF.js";
3
+ } from "../_node-chunks/chunk-4UV6B7T7.js";
4
4
  import {
5
5
  ComponentMetaManager,
6
6
  loadDocgenTypeScript
7
- } from "../_node-chunks/chunk-2I5WCK5H.js";
7
+ } from "../_node-chunks/chunk-XMHC3CJ5.js";
8
8
  import "../_node-chunks/chunk-MYBSMCSW.js";
9
- import "../_node-chunks/chunk-CJ2XYAXX.js";
9
+ import "../_node-chunks/chunk-M3SEC5XW.js";
10
10
  import "../_node-chunks/chunk-SC3QXTHH.js";
11
11
  import "../_node-chunks/chunk-QKPKKS4R.js";
12
12
  import "../_node-chunks/chunk-PQZIOGBY.js";
@@ -21,7 +21,11 @@ var createDocgenProvider = ({
21
21
  } = {}) => createLazyDocgenMiddleware({
22
22
  createManager: async () => {
23
23
  try {
24
- return new ComponentMetaManager(await loadDocgenTypeScript(typeScriptSpecifier));
24
+ return new ComponentMetaManager(
25
+ await loadDocgenTypeScript(typeScriptSpecifier),
26
+ void 0,
27
+ { keepParsedFilesOnRecycle: !0 }
28
+ );
25
29
  } catch (err) {
26
30
  logger.warn(`React docgen is unavailable. ${err instanceof Error ? err.message : err}`);
27
31
  return;
@@ -0,0 +1,2 @@
1
+ import "../_browser-chunks/chunk-KI7YBTX7.js";
2
+ import "../_browser-chunks/chunk-UAWMPV5J.js";
@@ -2,7 +2,8 @@ import {
2
2
  applyDecorators,
3
3
  decorators,
4
4
  parameters
5
- } from "./_browser-chunks/chunk-XQNZ5YRO.js";
5
+ } from "./_browser-chunks/chunk-GBFPEOJZ.js";
6
+ import "./_browser-chunks/chunk-KI7YBTX7.js";
6
7
  import "./_browser-chunks/chunk-DDIRQRCA.js";
7
8
  import "./_browser-chunks/chunk-B3FR4PBN.js";
8
9
  import "./_browser-chunks/chunk-UAWMPV5J.js";
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __definePreview
3
- } from "./_browser-chunks/chunk-RHGZ5MD3.js";
3
+ } from "./_browser-chunks/chunk-LI5LRSL3.js";
4
4
  import {
5
5
  entry_preview_exports,
6
6
  renderToCanvas
@@ -8,7 +8,8 @@ import {
8
8
  import {
9
9
  entry_preview_argtypes_exports
10
10
  } from "./_browser-chunks/chunk-WWHCZJWM.js";
11
- import "./_browser-chunks/chunk-XQNZ5YRO.js";
11
+ import "./_browser-chunks/chunk-GBFPEOJZ.js";
12
+ import "./_browser-chunks/chunk-KI7YBTX7.js";
12
13
  import "./_browser-chunks/chunk-DDIRQRCA.js";
13
14
  import "./_browser-chunks/chunk-B3FR4PBN.js";
14
15
  import "./_browser-chunks/chunk-UAWMPV5J.js";
package/dist/preset.js CHANGED
@@ -3,28 +3,28 @@ import {
3
3
  } from "./_node-chunks/chunk-HRHJMJC7.js";
4
4
  import {
5
5
  getSharedComponentMetaManager
6
- } from "./_node-chunks/chunk-ITCF7APG.js";
6
+ } from "./_node-chunks/chunk-RNO52GGS.js";
7
7
  import {
8
8
  buildReactComponentDocgenFromResolved,
9
9
  buildStoryDocsFromResolved,
10
10
  getCodeSnippet,
11
11
  invalidateParser,
12
- isAbsolute,
13
- join,
14
- posix,
15
12
  resolveStoryFileComponents
16
- } from "./_node-chunks/chunk-2I5WCK5H.js";
13
+ } from "./_node-chunks/chunk-XMHC3CJ5.js";
17
14
  import {
18
15
  REACT_DOCGEN_TYPESCRIPT_APIS
19
16
  } from "./_node-chunks/chunk-MYBSMCSW.js";
20
17
  import {
21
- invalidateCache
22
- } from "./_node-chunks/chunk-CJ2XYAXX.js";
18
+ invalidateCache,
19
+ isAbsolute,
20
+ join,
21
+ posix
22
+ } from "./_node-chunks/chunk-M3SEC5XW.js";
23
23
  import "./_node-chunks/chunk-PQZIOGBY.js";
24
24
 
25
25
  // src/preset.ts
26
26
  import path2, { join as join3 } from "node:path";
27
- import { fileURLToPath as fileURLToPath3 } from "node:url";
27
+ import { fileURLToPath as fileURLToPath4 } from "node:url";
28
28
  import {
29
29
  getProjectRoot,
30
30
  getTypeScriptSpecifierForDocgen as getTypeScriptSpecifierForDocgen3,
@@ -280,6 +280,7 @@ var experimental_docgenProvider = async (existing = [], options) => {
280
280
  };
281
281
 
282
282
  // src/docgen/story-docs-preset.ts
283
+ import { fileURLToPath as fileURLToPath3 } from "node:url";
283
284
  import { STORY_FILE_TEST_REGEXP, getStoryImportPathFromEntry as getStoryImportPathFromEntry3 } from "storybook/internal/common";
284
285
 
285
286
  // src/docgen/build-story-docs.ts
@@ -318,14 +319,18 @@ var experimental_storyDocsProvider = async (nextStoryDocs, options) => {
318
319
  "typescript",
319
320
  {}
320
321
  ) ?? Promise.resolve({});
321
- return async (input) => {
322
- let storyImportPath = getStoryImportPathFromEntry3(input.entry);
323
- if (!storyImportPath || !STORY_FILE_TEST_REGEXP.test(storyImportPath))
324
- return nextStoryDocs(input);
325
- let ours = await buildStoryDocsPayload(input, {
326
- typescriptOptions: await typescriptOptionsPromise
327
- });
328
- return ours ? { ...await nextStoryDocs(input), ...ours } : nextStoryDocs(input);
322
+ return {
323
+ ...nextStoryDocs,
324
+ extract: async (input) => {
325
+ let storyImportPath = getStoryImportPathFromEntry3(input.entry);
326
+ if (!storyImportPath || !STORY_FILE_TEST_REGEXP.test(storyImportPath))
327
+ return nextStoryDocs.extract(input);
328
+ let ours = await buildStoryDocsPayload(input, {
329
+ typescriptOptions: await typescriptOptionsPromise
330
+ });
331
+ return ours ? { ...await nextStoryDocs.extract(input), ...ours } : nextStoryDocs.extract(input);
332
+ },
333
+ printHole: fileURLToPath3(import.meta.resolve("@storybook/react/internal/register-print-hole"))
329
334
  };
330
335
  };
331
336
 
@@ -345,12 +350,12 @@ var isDocgenProviderEnabled = async (_existing, options) => {
345
350
  options.presets.apply("features", {}, options)
346
351
  ]), docsEnabled = Object.keys(docsConfig).length > 0, experimentalRSC = features2?.experimentalRSC;
347
352
  return [].concat(input).concat([
348
- fileURLToPath3(import.meta.resolve("@storybook/react/entry-preview")),
349
- fileURLToPath3(import.meta.resolve("@storybook/react/entry-preview-argtypes"))
353
+ fileURLToPath4(import.meta.resolve("@storybook/react/entry-preview")),
354
+ fileURLToPath4(import.meta.resolve("@storybook/react/entry-preview-argtypes"))
350
355
  ]).concat(
351
- docsEnabled ? [fileURLToPath3(import.meta.resolve("@storybook/react/entry-preview-docs"))] : []
356
+ docsEnabled ? [fileURLToPath4(import.meta.resolve("@storybook/react/entry-preview-docs"))] : []
352
357
  ).concat(
353
- experimentalRSC ? [fileURLToPath3(import.meta.resolve("@storybook/react/entry-preview-rsc"))] : []
358
+ experimentalRSC ? [fileURLToPath4(import.meta.resolve("@storybook/react/entry-preview-rsc"))] : []
354
359
  );
355
360
  }, resolvedReact = async (existing) => {
356
361
  try {
@@ -379,7 +384,7 @@ async function internal_getArgTypesData(_input, options) {
379
384
  return null;
380
385
  let absoluteComponentFilePath = path2.isAbsolute(componentFilePath) ? componentFilePath : join3(getProjectRoot(), componentFilePath);
381
386
  if ((await presets?.apply("features", {}))?.docgenServer) {
382
- let { extractArgTypesFromComponentFile } = await import("./_node-chunks/extractArgTypesFromComponentFile-BBV3XDO4.js");
387
+ let { extractArgTypesFromComponentFile } = await import("./_node-chunks/extractArgTypesFromComponentFile-UJJRVMGW.js");
383
388
  return extractArgTypesFromComponentFile({
384
389
  componentFilePath: absoluteComponentFilePath,
385
390
  componentExportName,
@@ -405,7 +410,7 @@ async function internal_getArgTypesData(_input, options) {
405
410
  reactDocgenTypescriptOptions
406
411
  });
407
412
  } else {
408
- let { extractArgTypesFromDocgen } = await import("./_node-chunks/extractReactDocgenInfo-L44YP4OM.js");
413
+ let { extractArgTypesFromDocgen } = await import("./_node-chunks/extractReactDocgenInfo-Z5DJORGO.js");
409
414
  argTypesData = extractArgTypesFromDocgen({
410
415
  componentFilePath: absoluteComponentFilePath,
411
416
  componentExportName
package/dist/preview.js CHANGED
@@ -1,9 +1,10 @@
1
1
  import {
2
2
  __definePreview
3
- } from "./_browser-chunks/chunk-RHGZ5MD3.js";
3
+ } from "./_browser-chunks/chunk-LI5LRSL3.js";
4
4
  import "./_browser-chunks/chunk-MB4PPIXP.js";
5
5
  import "./_browser-chunks/chunk-WWHCZJWM.js";
6
- import "./_browser-chunks/chunk-XQNZ5YRO.js";
6
+ import "./_browser-chunks/chunk-GBFPEOJZ.js";
7
+ import "./_browser-chunks/chunk-KI7YBTX7.js";
7
8
  import "./_browser-chunks/chunk-DDIRQRCA.js";
8
9
  import "./_browser-chunks/chunk-B3FR4PBN.js";
9
10
  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-rc.1",
3
+ "version": "11.0.0-rc.3",
4
4
  "description": "Storybook React renderer",
5
5
  "keywords": [
6
6
  "storybook"
@@ -36,6 +36,7 @@
36
36
  "default": "./dist/builder-docgen.js"
37
37
  },
38
38
  "./internal/docgen-worker": "./dist/docgen/docgen-worker.js",
39
+ "./internal/register-print-hole": "./dist/docs/register-print-hole.js",
39
40
  "./package.json": "./package.json",
40
41
  "./preset": "./dist/preset.js",
41
42
  "./preview": {
@@ -53,7 +54,7 @@
53
54
  "!src/**/*"
54
55
  ],
55
56
  "devDependencies": {
56
- "@storybook/component-meta-typescript": "11.0.0-rc.1",
57
+ "@storybook/component-meta-typescript": "11.0.0-rc.3",
57
58
  "@types/babel-plugin-react-docgen": "^4.2.3",
58
59
  "@types/escodegen": "^0.0.6",
59
60
  "@types/estree": "^1.0.6",
@@ -87,7 +88,7 @@
87
88
  "react-docgen": "^8.0.2",
88
89
  "react-docgen-typescript": "^2.2.2",
89
90
  "react-dom": "^18.0.0 || ^19.0.0",
90
- "storybook": "^11.0.0-rc.1",
91
+ "storybook": "^11.0.0-rc.3",
91
92
  "typescript": "^5.9.0 || ^6.0.0 || ^7.0.0"
92
93
  },
93
94
  "peerDependenciesMeta": {
@@ -1,5 +1,3 @@
1
- import React from 'react';
2
-
3
1
  import './button.css';
4
2
 
5
3
  /**
@@ -1,5 +1,3 @@
1
- import React from 'react';
2
-
3
1
  import { Button } from './Button';
4
2
  import './header.css';
5
3
 
@@ -1,5 +1,3 @@
1
- import React from 'react';
2
-
3
1
  import './button.css';
4
2
 
5
3
  export interface ButtonProps {
@@ -1,5 +1,3 @@
1
- import React from 'react';
2
-
3
1
  import { Button } from './Button';
4
2
  import './header.css';
5
3