@storybook/nextjs 9.2.0-alpha.2 → 10.0.0-beta.0

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 (86) hide show
  1. package/README.md +3 -1
  2. package/dist/_browser-chunks/chunk-I5RFHXDS.js +40 -0
  3. package/dist/_browser-chunks/chunk-JOMP7DUK.js +261 -0
  4. package/dist/_browser-chunks/chunk-L5NVL7MD.js +37 -0
  5. package/dist/_browser-chunks/react-18-G7Q4PNHD.js +71 -0
  6. package/dist/_node-chunks/chunk-24UYJEDD.js +74 -0
  7. package/dist/_node-chunks/chunk-EZEBG77A.js +88 -0
  8. package/dist/_node-chunks/chunk-WCSGFZKZ.js +17 -0
  9. package/dist/_node-chunks/chunk-YMVPQWBH.js +167 -0
  10. package/dist/_node-chunks/configureNextFont-HBRWHAUG.js +36 -0
  11. package/dist/_node-chunks/loader-KXTZ5PJ5.js +51 -0
  12. package/dist/_node-chunks/loader-Z4IXWF5M.js +64 -0
  13. package/dist/_node-chunks/utils-4LRBHVQD.js +31 -0
  14. package/dist/_node-chunks/webpack-6HAXGE7X.js +38 -0
  15. package/dist/_node-chunks/webpack-AGNCA7HZ.js +77 -0
  16. package/dist/_node-chunks/webpack-CXSD35E6.js +30 -0
  17. package/dist/_node-chunks/webpack-EWT6TRQB.js +26 -0
  18. package/dist/_node-chunks/webpack-K2R3GUFU.js +29 -0
  19. package/dist/_node-chunks/webpack-PD7PIB6X.js +43 -0
  20. package/dist/_node-chunks/webpack-QFTZE3CE.js +27 -0
  21. package/dist/_node-chunks/webpack-SWQY6JJY.js +107 -0
  22. package/dist/compatibility/draft-mode.compat.js +7 -1
  23. package/dist/export-mocks/cache/index.d.ts +309 -1
  24. package/dist/export-mocks/cache/index.js +22 -1
  25. package/dist/export-mocks/headers/index.d.ts +309 -1
  26. package/dist/export-mocks/headers/index.js +77 -1
  27. package/dist/export-mocks/index.js +20 -1
  28. package/dist/export-mocks/navigation/index.d.ts +8 -1
  29. package/dist/export-mocks/navigation/index.js +88 -1
  30. package/dist/export-mocks/router/index.d.ts +2 -2
  31. package/dist/export-mocks/router/index.js +97 -1
  32. package/dist/font/webpack/loader/storybook-nextjs-font-loader.js +201 -14
  33. package/dist/image-context.js +8 -1
  34. package/dist/images/next-image.js +35 -1
  35. package/dist/images/next-legacy-image.js +21 -1
  36. package/dist/index.d.ts +53 -8
  37. package/dist/index.js +20237 -45
  38. package/dist/next-image-loader-stub.js +33 -1
  39. package/dist/node/index.d.ts +27 -6
  40. package/dist/node/index.js +23 -1
  41. package/dist/preset.js +830 -1
  42. package/dist/preview.d.ts +3 -18
  43. package/dist/preview.d.tsx +18 -0
  44. package/dist/preview.js +11 -1
  45. package/dist/rsc/server-only.js +7 -1
  46. package/dist/swc/next-swc-loader-patch.js +136 -1
  47. package/package.json +41 -122
  48. package/preset.js +1 -1
  49. package/template/cli/js/Configure.mdx +11 -11
  50. package/template/cli/ts/Configure.mdx +11 -11
  51. package/dist/chunk-2TZKD6A5.mjs +0 -20
  52. package/dist/chunk-ETFXNGLC.mjs +0 -3
  53. package/dist/chunk-L66KIASX.mjs +0 -3
  54. package/dist/chunk-NQ32RFK2.mjs +0 -6
  55. package/dist/compatibility/draft-mode.compat.d.ts +0 -1
  56. package/dist/compatibility/draft-mode.compat.mjs +0 -2
  57. package/dist/export-mocks/cache/index.mjs +0 -10
  58. package/dist/export-mocks/headers/index.mjs +0 -12
  59. package/dist/export-mocks/index.d.ts +0 -7
  60. package/dist/export-mocks/index.mjs +0 -11
  61. package/dist/export-mocks/navigation/index.mjs +0 -11
  62. package/dist/export-mocks/router/index.mjs +0 -10
  63. package/dist/font/webpack/loader/storybook-nextjs-font-loader.d.ts +0 -3
  64. package/dist/font/webpack/loader/storybook-nextjs-font-loader.mjs +0 -56
  65. package/dist/image-context.d.ts +0 -13
  66. package/dist/image-context.mjs +0 -6
  67. package/dist/images/decorator.d.ts +0 -6
  68. package/dist/images/decorator.js +0 -1
  69. package/dist/images/decorator.mjs +0 -2
  70. package/dist/images/next-image.d.ts +0 -28
  71. package/dist/images/next-image.mjs +0 -9
  72. package/dist/images/next-legacy-image.d.ts +0 -6
  73. package/dist/images/next-legacy-image.mjs +0 -9
  74. package/dist/index.d-ff220430.d.ts +0 -310
  75. package/dist/index.mjs +0 -58
  76. package/dist/next-image-loader-stub.d.ts +0 -10
  77. package/dist/next-image-loader-stub.mjs +0 -7
  78. package/dist/node/index.mjs +0 -5
  79. package/dist/preset.d.ts +0 -14
  80. package/dist/preview.mjs +0 -3
  81. package/dist/react-18-WSPZ3BUV.mjs +0 -7
  82. package/dist/rsc/server-only.d.ts +0 -3
  83. package/dist/rsc/server-only.mjs +0 -5
  84. package/dist/swc/next-swc-loader-patch.d.ts +0 -21
  85. package/dist/swc/next-swc-loader-patch.mjs +0 -8
  86. package/dist/types-f6ea2c09.d.ts +0 -54
@@ -1 +1,33 @@
1
- "use strict";var import_image_size=require("image-size"),import_loader_utils=require("loader-utils"),nextImageLoaderStub=async function(content){let{filename,nextConfig}=this.getOptions(),opts={context:this.rootContext,content},outputPath=(0,import_loader_utils.interpolateName)(this,filename.replace("[ext]",".[ext]"),opts);if(this.emitFile(outputPath,content),nextConfig.images?.disableStaticImages)return`const src = '${outputPath}'; export default src;`;let{width,height}=(0,import_image_size.imageSize)(content);return`export default ${JSON.stringify({src:outputPath,height,width,blurDataURL:outputPath})};`};nextImageLoaderStub.raw=!0;module.exports=nextImageLoaderStub;
1
+ import {
2
+ __name
3
+ } from "./_browser-chunks/chunk-L5NVL7MD.js";
4
+
5
+ // src/next-image-loader-stub.ts
6
+ import { imageSize } from "image-size";
7
+ import { interpolateName } from "loader-utils";
8
+ var nextImageLoaderStub = /* @__PURE__ */ __name(async function NextImageLoader(content) {
9
+ const { filename, nextConfig } = this.getOptions();
10
+ const opts = {
11
+ context: this.rootContext,
12
+ content
13
+ };
14
+ const outputPath = interpolateName(this, filename.replace("[ext]", ".[ext]"), opts);
15
+ this.emitFile(outputPath, content);
16
+ if (nextConfig.images?.disableStaticImages) {
17
+ return `const src = '${outputPath}'; export default src;`;
18
+ }
19
+ const { width, height } = imageSize(content);
20
+ return `export default ${JSON.stringify({
21
+ src: outputPath,
22
+ height,
23
+ width,
24
+ blurDataURL: outputPath
25
+ })};`;
26
+ }, "NextImageLoader");
27
+ nextImageLoaderStub.raw = true;
28
+ var next_image_loader_stub_default = nextImageLoaderStub;
29
+ var raw = true;
30
+ export {
31
+ next_image_loader_stub_default as default,
32
+ raw
33
+ };
@@ -1,9 +1,30 @@
1
- import { S as StorybookConfig } from '../types-f6ea2c09.js';
2
- import 'storybook/internal/types';
3
- import '@storybook/builder-webpack5';
4
- import '@storybook/preset-react-webpack';
5
- import 'next/image';
6
- import 'next/router';
1
+ import { CompatibleString } from 'storybook/internal/types';
2
+ import { StorybookConfigWebpack, BuilderOptions, TypescriptOptions } from '@storybook/builder-webpack5';
3
+ import { StorybookConfig as StorybookConfig$1, ReactOptions, TypescriptOptions as TypescriptOptions$1 } from '@storybook/preset-react-webpack';
4
+ import * as NextImage from 'next/image';
5
+
6
+ type FrameworkName = CompatibleString<'@storybook/nextjs'>;
7
+ type BuilderName = CompatibleString<'@storybook/builder-webpack5'>;
8
+ type FrameworkOptions = ReactOptions & {
9
+ nextConfigPath?: string;
10
+ image?: Partial<NextImage.ImageProps>;
11
+ builder?: BuilderOptions;
12
+ };
13
+ type StorybookConfigFramework = {
14
+ framework: FrameworkName | {
15
+ name: FrameworkName;
16
+ options: FrameworkOptions;
17
+ };
18
+ core?: StorybookConfig$1['core'] & {
19
+ builder?: BuilderName | {
20
+ name: BuilderName;
21
+ options: BuilderOptions;
22
+ };
23
+ };
24
+ typescript?: Partial<TypescriptOptions & TypescriptOptions$1> & StorybookConfig$1['typescript'];
25
+ };
26
+ /** The interface for Storybook configuration in `main.ts` files. */
27
+ type StorybookConfig = Omit<StorybookConfig$1, keyof StorybookConfigWebpack | keyof StorybookConfigFramework> & StorybookConfigWebpack & StorybookConfigFramework;
7
28
 
8
29
  declare function defineMain(config: StorybookConfig): StorybookConfig;
9
30
 
@@ -1 +1,23 @@
1
- "use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var node_exports={};__export(node_exports,{defineMain:()=>defineMain});module.exports=__toCommonJS(node_exports);function defineMain(config){return config}0&&(module.exports={defineMain});
1
+ import CJS_COMPAT_NODE_URL_e3twfmexlgl from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_e3twfmexlgl from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_e3twfmexlgl from "node:module";
4
+
5
+ var __filename = CJS_COMPAT_NODE_URL_e3twfmexlgl.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_e3twfmexlgl.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_e3twfmexlgl.createRequire(import.meta.url);
8
+
9
+ // ------------------------------------------------------------
10
+ // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
+ // ------------------------------------------------------------
12
+ import {
13
+ __name
14
+ } from "../_node-chunks/chunk-WCSGFZKZ.js";
15
+
16
+ // src/node/index.ts
17
+ function defineMain(config) {
18
+ return config;
19
+ }
20
+ __name(defineMain, "defineMain");
21
+ export {
22
+ defineMain
23
+ };