@storybook/nextjs 9.2.0-alpha.3 → 10.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.
- package/README.md +3 -1
- package/dist/_browser-chunks/chunk-I5RFHXDS.js +40 -0
- package/dist/_browser-chunks/chunk-JOMP7DUK.js +261 -0
- package/dist/_browser-chunks/chunk-L5NVL7MD.js +37 -0
- package/dist/_browser-chunks/react-18-G7Q4PNHD.js +71 -0
- package/dist/_node-chunks/chunk-254AWWVV.js +95 -0
- package/dist/_node-chunks/chunk-4Q3WLK5D.js +167 -0
- package/dist/_node-chunks/chunk-DF7TGUJT.js +17 -0
- package/dist/_node-chunks/chunk-N47GZ6ZF.js +74 -0
- package/dist/_node-chunks/configureNextFont-YCA4Y2MY.js +36 -0
- package/dist/_node-chunks/loader-BMOR26K7.js +64 -0
- package/dist/_node-chunks/loader-W6JNOWKU.js +51 -0
- package/dist/_node-chunks/utils-TOBNY3XG.js +31 -0
- package/dist/_node-chunks/webpack-422IPQRP.js +38 -0
- package/dist/_node-chunks/webpack-7CTFG24J.js +107 -0
- package/dist/_node-chunks/webpack-AGJ2TY75.js +29 -0
- package/dist/_node-chunks/webpack-E2SJEFJM.js +27 -0
- package/dist/_node-chunks/webpack-GIA2WMBH.js +77 -0
- package/dist/_node-chunks/webpack-MCDIAAFL.js +43 -0
- package/dist/_node-chunks/webpack-UPXNFNSK.js +26 -0
- package/dist/_node-chunks/webpack-WWJ5TQDG.js +30 -0
- package/dist/compatibility/draft-mode.compat.js +7 -1
- package/dist/export-mocks/cache/index.d.ts +309 -1
- package/dist/export-mocks/cache/index.js +22 -1
- package/dist/export-mocks/headers/index.d.ts +309 -1
- package/dist/export-mocks/headers/index.js +77 -1
- package/dist/export-mocks/index.js +20 -1
- package/dist/export-mocks/navigation/index.js +88 -1
- package/dist/export-mocks/router/index.d.ts +2 -2
- package/dist/export-mocks/router/index.js +97 -1
- package/dist/font/webpack/loader/storybook-nextjs-font-loader.js +201 -14
- package/dist/image-context.js +8 -1
- package/dist/images/next-image.js +35 -1
- package/dist/images/next-legacy-image.js +21 -1
- package/dist/index.d.ts +53 -8
- package/dist/index.js +20237 -45
- package/dist/next-image-loader-stub.js +33 -1
- package/dist/node/index.d.ts +27 -6
- package/dist/node/index.js +23 -1
- package/dist/preset.js +830 -1
- package/dist/preview.d.ts +3 -18
- package/dist/preview.d.tsx +18 -0
- package/dist/preview.js +11 -1
- package/dist/rsc/server-only.js +7 -1
- package/dist/swc/next-swc-loader-patch.js +136 -1
- package/package.json +41 -122
- package/preset.js +1 -1
- package/template/cli/js/Configure.mdx +11 -11
- package/template/cli/ts/Configure.mdx +11 -11
- package/dist/chunk-2TZKD6A5.mjs +0 -20
- package/dist/chunk-ETFXNGLC.mjs +0 -3
- package/dist/chunk-L66KIASX.mjs +0 -3
- package/dist/chunk-NQ32RFK2.mjs +0 -6
- package/dist/compatibility/draft-mode.compat.d.ts +0 -1
- package/dist/compatibility/draft-mode.compat.mjs +0 -2
- package/dist/export-mocks/cache/index.mjs +0 -10
- package/dist/export-mocks/headers/index.mjs +0 -12
- package/dist/export-mocks/index.d.ts +0 -7
- package/dist/export-mocks/index.mjs +0 -11
- package/dist/export-mocks/navigation/index.mjs +0 -11
- package/dist/export-mocks/router/index.mjs +0 -10
- package/dist/font/webpack/loader/storybook-nextjs-font-loader.d.ts +0 -3
- package/dist/font/webpack/loader/storybook-nextjs-font-loader.mjs +0 -56
- package/dist/image-context.d.ts +0 -13
- package/dist/image-context.mjs +0 -6
- package/dist/images/decorator.d.ts +0 -6
- package/dist/images/decorator.js +0 -1
- package/dist/images/decorator.mjs +0 -2
- package/dist/images/next-image.d.ts +0 -28
- package/dist/images/next-image.mjs +0 -9
- package/dist/images/next-legacy-image.d.ts +0 -6
- package/dist/images/next-legacy-image.mjs +0 -9
- package/dist/index.d-ff220430.d.ts +0 -310
- package/dist/index.mjs +0 -58
- package/dist/next-image-loader-stub.d.ts +0 -10
- package/dist/next-image-loader-stub.mjs +0 -7
- package/dist/node/index.mjs +0 -5
- package/dist/preset.d.ts +0 -14
- package/dist/preview.mjs +0 -3
- package/dist/react-18-WSPZ3BUV.mjs +0 -7
- package/dist/rsc/server-only.d.ts +0 -3
- package/dist/rsc/server-only.mjs +0 -5
- package/dist/swc/next-swc-loader-patch.d.ts +0 -21
- package/dist/swc/next-swc-loader-patch.mjs +0 -8
- package/dist/types-f6ea2c09.d.ts +0 -54
|
@@ -1 +1,33 @@
|
|
|
1
|
-
|
|
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
|
+
};
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,9 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import 'storybook/
|
|
3
|
-
import '@storybook/
|
|
4
|
-
import '
|
|
5
|
-
|
|
6
|
-
|
|
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
|
|
package/dist/node/index.js
CHANGED
|
@@ -1 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
import CJS_COMPAT_NODE_URL_nafzxsaqn from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_nafzxsaqn from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_nafzxsaqn from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_nafzxsaqn.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_nafzxsaqn.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_nafzxsaqn.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-DF7TGUJT.js";
|
|
15
|
+
|
|
16
|
+
// src/node/index.ts
|
|
17
|
+
function defineMain(config) {
|
|
18
|
+
return config;
|
|
19
|
+
}
|
|
20
|
+
__name(defineMain, "defineMain");
|
|
21
|
+
export {
|
|
22
|
+
defineMain
|
|
23
|
+
};
|