@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,21 @@
|
|
|
1
|
-
|
|
1
|
+
import {
|
|
2
|
+
defaultLoader
|
|
3
|
+
} from "../_browser-chunks/chunk-I5RFHXDS.js";
|
|
4
|
+
import {
|
|
5
|
+
__name
|
|
6
|
+
} from "../_browser-chunks/chunk-L5NVL7MD.js";
|
|
7
|
+
|
|
8
|
+
// src/images/next-legacy-image.tsx
|
|
9
|
+
import React from "react";
|
|
10
|
+
import { ImageContext as ImageContextValue } from "@storybook/nextjs/image-context";
|
|
11
|
+
import OriginalNextLegacyImage from "sb-original/next/legacy/image";
|
|
12
|
+
var ImageContext = ImageContextValue;
|
|
13
|
+
function NextLegacyImage({ loader, ...props }) {
|
|
14
|
+
const imageParameters = React.useContext(ImageContext);
|
|
15
|
+
return React.createElement(OriginalNextLegacyImage, { ...imageParameters, ...props, loader: loader ?? defaultLoader });
|
|
16
|
+
}
|
|
17
|
+
__name(NextLegacyImage, "NextLegacyImage");
|
|
18
|
+
var next_legacy_image_default = NextLegacyImage;
|
|
19
|
+
export {
|
|
20
|
+
next_legacy_image_default as default
|
|
21
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,58 @@
|
|
|
1
1
|
import { PreviewAddon, InferTypes, AddonTypes } from 'storybook/internal/csf';
|
|
2
|
-
import { NamedOrDefaultProjectAnnotations, NormalizedProjectAnnotations, Args, StoryAnnotationsOrFn, ProjectAnnotations, ComposedStoryFn, Store_CSFExports, StoriesWithPartialProps } from 'storybook/internal/types';
|
|
2
|
+
import { CompatibleString, NamedOrDefaultProjectAnnotations, NormalizedProjectAnnotations, Args, StoryAnnotationsOrFn, ProjectAnnotations, ComposedStoryFn, Store_CSFExports, StoriesWithPartialProps } from 'storybook/internal/types';
|
|
3
3
|
import { ReactRenderer, Meta, ReactTypes, ReactPreview } from '@storybook/react';
|
|
4
4
|
export * from '@storybook/react';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import '
|
|
8
|
-
import '
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
import { BuilderOptions, StorybookConfigWebpack, TypescriptOptions } from '@storybook/builder-webpack5';
|
|
6
|
+
import { ReactOptions, StorybookConfig as StorybookConfig$1, TypescriptOptions as TypescriptOptions$1 } from '@storybook/preset-react-webpack';
|
|
7
|
+
import * as NextImage from 'next/image';
|
|
8
|
+
import { NextRouter } from 'next/router';
|
|
9
|
+
|
|
10
|
+
type FrameworkName = CompatibleString<'@storybook/nextjs'>;
|
|
11
|
+
type BuilderName = CompatibleString<'@storybook/builder-webpack5'>;
|
|
12
|
+
type FrameworkOptions = ReactOptions & {
|
|
13
|
+
nextConfigPath?: string;
|
|
14
|
+
image?: Partial<NextImage.ImageProps>;
|
|
15
|
+
builder?: BuilderOptions;
|
|
16
|
+
};
|
|
17
|
+
type StorybookConfigFramework = {
|
|
18
|
+
framework: FrameworkName | {
|
|
19
|
+
name: FrameworkName;
|
|
20
|
+
options: FrameworkOptions;
|
|
21
|
+
};
|
|
22
|
+
core?: StorybookConfig$1['core'] & {
|
|
23
|
+
builder?: BuilderName | {
|
|
24
|
+
name: BuilderName;
|
|
25
|
+
options: BuilderOptions;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
typescript?: Partial<TypescriptOptions & TypescriptOptions$1> & StorybookConfig$1['typescript'];
|
|
29
|
+
};
|
|
30
|
+
/** The interface for Storybook configuration in `main.ts` files. */
|
|
31
|
+
type StorybookConfig = Omit<StorybookConfig$1, keyof StorybookConfigWebpack | keyof StorybookConfigFramework> & StorybookConfigWebpack & StorybookConfigFramework;
|
|
32
|
+
interface NextJsParameters {
|
|
33
|
+
/**
|
|
34
|
+
* Next.js framework configuration
|
|
35
|
+
*
|
|
36
|
+
* @see https://storybook.js.org/docs/get-started/frameworks/nextjs
|
|
37
|
+
*/
|
|
38
|
+
nextjs?: {
|
|
39
|
+
/**
|
|
40
|
+
* Enable App Directory features If your story imports components that use next/navigation, you
|
|
41
|
+
* need to set this parameter to true
|
|
42
|
+
*/
|
|
43
|
+
appDirectory?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Next.js navigation configuration when using `next/navigation`. Please note that it can only
|
|
46
|
+
* be used in components/pages in the app directory.
|
|
47
|
+
*/
|
|
48
|
+
navigation?: Partial<NextRouter>;
|
|
49
|
+
/** Next.js router configuration */
|
|
50
|
+
router?: Partial<NextRouter>;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
interface NextJsTypes {
|
|
54
|
+
parameters: NextJsParameters;
|
|
55
|
+
}
|
|
11
56
|
|
|
12
57
|
/**
|
|
13
58
|
* Function that sets the globalConfig of your storybook. The global config is the preview module of
|
|
@@ -93,4 +138,4 @@ declare function definePreview<Addons extends PreviewAddon<never>[]>(preview: {
|
|
|
93
138
|
interface NextPreview<T extends AddonTypes> extends ReactPreview<NextJsTypes & T> {
|
|
94
139
|
}
|
|
95
140
|
|
|
96
|
-
export { NextJsTypes, composeStories, composeStory, definePreview, setProjectAnnotations };
|
|
141
|
+
export { type FrameworkOptions, type NextJsParameters, type NextJsTypes, type StorybookConfig, composeStories, composeStory, definePreview, setProjectAnnotations };
|