@storybook/react 11.0.0-beta.0 → 11.0.0-beta.1

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.
Files changed (32) hide show
  1. package/dist/_browser-chunks/{chunk-7QIM3PHH.js → chunk-6MBKXM7O.js} +1 -1
  2. package/dist/_browser-chunks/{chunk-EZD3TIPB.js → chunk-I62VTYU3.js} +17 -4
  3. package/dist/_node-chunks/{chunk-27VFNEPI.js → chunk-37XDLJI5.js} +6788 -15249
  4. package/dist/_node-chunks/chunk-FCIBS77S.js +61 -0
  5. package/dist/_node-chunks/chunk-FUHORIY7.js +1395 -0
  6. package/dist/_node-chunks/chunk-GQOGANUK.js +35 -0
  7. package/dist/_node-chunks/chunk-IYZUDUNZ.js +1674 -0
  8. package/dist/_node-chunks/chunk-PPFRYFMF.js +57 -0
  9. package/dist/_node-chunks/chunk-RVHW3VEA.js +63 -0
  10. package/dist/_node-chunks/chunk-U53ZMSA3.js +5442 -0
  11. package/dist/_node-chunks/chunk-YNIH7TZQ.js +93 -0
  12. package/dist/_node-chunks/extractArgTypesFromComponentFile-EQEZZAHL.js +42 -0
  13. package/dist/_node-chunks/extractReactDocgenInfo-COAPYCG6.js +59 -0
  14. package/dist/_node-chunks/extractReactTypescriptDocgenInfo-7FFDIBEA.js +105 -0
  15. package/dist/_node-chunks/reactDocgen-6ZJPM2YE.js +26 -0
  16. package/dist/builder-docgen.d.ts +51 -0
  17. package/dist/builder-docgen.js +24 -0
  18. package/dist/{chunk-DwM7QKaD.d.ts → chunk-6b3AvPEC.d.ts} +66 -1
  19. package/dist/docgen/docgen-worker.js +15 -83
  20. package/dist/entry-preview.js +1 -1
  21. package/dist/index.d.ts +2 -2
  22. package/dist/index.js +2 -2
  23. package/dist/preset.js +59 -1353
  24. package/dist/preview.d.ts +1 -1
  25. package/dist/preview.js +2 -2
  26. package/package.json +18 -5
  27. package/template/cli/js/Button.stories.js +11 -10
  28. package/template/cli/js/Header.stories.js +6 -5
  29. package/template/cli/js/Page.stories.js +6 -5
  30. package/template/cli/ts/Button.stories.ts +11 -14
  31. package/template/cli/ts/Header.stories.ts +6 -9
  32. package/template/cli/ts/Page.stories.ts +6 -9
@@ -0,0 +1,57 @@
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
+
13
+ // src/builder-docgen.ts
14
+ import {
15
+ checkBuilderDocgenPackages,
16
+ getTypeScriptForDocgenError,
17
+ isPackageInstalledInRange
18
+ } from "storybook/internal/common";
19
+ var REACT_BUILDER_DOCGEN_PACKAGES = {
20
+ "react-docgen": "^8.0.2",
21
+ "react-docgen-typescript": "^2.2.2",
22
+ "@joshwooding/vite-plugin-react-docgen-typescript": "^0.7.0 || ^0.8.0 || ^0.9.0",
23
+ "@storybook/react-docgen-typescript-plugin": "1.0.6--canary.9.0c3f3b7.0"
24
+ };
25
+ function getReactBuilderDocgenPackages(reactDocgen, builder) {
26
+ return reactDocgen === "react-docgen" ? ["react-docgen"] : reactDocgen === "react-docgen-typescript" ? [
27
+ builder === "vite" ? "@joshwooding/vite-plugin-react-docgen-typescript" : "@storybook/react-docgen-typescript-plugin",
28
+ "react-docgen-typescript"
29
+ ] : [];
30
+ }
31
+ var isReactBuilderDocgenPackageInstalled = (resolve, packageName) => isPackageInstalledInRange(resolve, packageName, REACT_BUILDER_DOCGEN_PACKAGES[packageName]);
32
+ async function prepareReactBuilderDocgen({
33
+ reactDocgen,
34
+ builder,
35
+ resolve,
36
+ options
37
+ }) {
38
+ let mode = reactDocgen === "react-docgen-typescript" && getTypeScriptForDocgenError(resolve) ? "react-docgen" : reactDocgen, packages = getReactBuilderDocgenPackages(mode, builder);
39
+ return (await checkBuilderDocgenPackages({
40
+ packages: Object.fromEntries(
41
+ packages.map((name) => [name, REACT_BUILDER_DOCGEN_PACKAGES[name]])
42
+ ),
43
+ resolve,
44
+ options,
45
+ builderDocgen: `typescript.reactDocgen: '${reactDocgen}'`,
46
+ disableBuilderDocgen: "typescript.reactDocgen: false",
47
+ 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
49
+ })).length > 0 ? void 0 : mode;
50
+ }
51
+
52
+ export {
53
+ REACT_BUILDER_DOCGEN_PACKAGES,
54
+ getReactBuilderDocgenPackages,
55
+ isReactBuilderDocgenPackageInstalled,
56
+ prepareReactBuilderDocgen
57
+ };
@@ -0,0 +1,63 @@
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
+ var __create = Object.create;
13
+ var __defProp = Object.defineProperty;
14
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
15
+ var __getOwnPropNames = Object.getOwnPropertyNames;
16
+ var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
17
+ var __require = /* @__PURE__ */ ((x) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(x, {
18
+ get: (a, b) => (typeof require < "u" ? require : a)[b]
19
+ }) : x)(function(x) {
20
+ if (typeof require < "u") return require.apply(this, arguments);
21
+ throw Error('Dynamic require of "' + x + '" is not supported');
22
+ });
23
+ var __esm = (fn, res, err) => function() {
24
+ if (err) throw err[0];
25
+ try {
26
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
27
+ } catch (e) {
28
+ throw err = [e], e;
29
+ }
30
+ };
31
+ var __commonJS = (cb, mod) => function() {
32
+ try {
33
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
34
+ } catch (e) {
35
+ throw mod = 0, e;
36
+ }
37
+ };
38
+ var __export = (target, all) => {
39
+ for (var name in all)
40
+ __defProp(target, name, { get: all[name], enumerable: !0 });
41
+ }, __copyProps = (to, from, except, desc) => {
42
+ if (from && typeof from == "object" || typeof from == "function")
43
+ for (let key of __getOwnPropNames(from))
44
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
45
+ return to;
46
+ };
47
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
48
+ // If the importer is in node compatibility mode or this is not an ESM
49
+ // file that has been converted to a CommonJS file using a Babel-
50
+ // compatible transform (i.e. "__esModule" has not been set), then set
51
+ // "default" to the CommonJS "module.exports" for node compatibility.
52
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
53
+ mod
54
+ )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
55
+
56
+ export {
57
+ __require,
58
+ __esm,
59
+ __commonJS,
60
+ __export,
61
+ __toESM,
62
+ __toCommonJS
63
+ };