@storybook/nextjs-vite 9.2.0-alpha.3 → 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.
- package/README.md +3 -1
- package/dist/_browser-chunks/chunk-2RWWBM6A.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-IHKOVONR.js +54 -0
- package/dist/_node-chunks/dist-YEP22NZU.js +7476 -0
- package/dist/_node-chunks/jiti-4UV67MCQ.js +32362 -0
- package/dist/export-mocks/cache/index.d.ts +308 -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/navigation/index.js +81 -1
- package/dist/export-mocks/router/index.d.ts +2 -2
- package/dist/export-mocks/router/index.js +97 -1
- package/dist/index.d.ts +51 -7
- package/dist/index.js +22153 -45
- package/dist/node/index.d.ts +25 -5
- package/dist/node/index.js +23 -1
- package/dist/preset.js +714 -580
- package/dist/preview.d.ts +3 -19
- package/dist/preview.d.tsx +19 -0
- package/dist/preview.js +11 -1
- package/dist/vite-plugin/index.d.ts +1 -3
- package/dist/vite-plugin/index.js +21 -1
- package/package.json +35 -83
- package/preset.js +1 -1
- package/template/cli/js/Configure.mdx +11 -11
- package/template/cli/ts/Configure.mdx +11 -11
- package/dist/chunk-GKRSUUNG.mjs +0 -6
- package/dist/chunk-J3BB7LEU.mjs +0 -20
- package/dist/chunk-XP5HYGXS.mjs +0 -3
- package/dist/export-mocks/cache/index.mjs +0 -6
- package/dist/export-mocks/headers/index.mjs +0 -12
- package/dist/export-mocks/navigation/index.mjs +0 -11
- package/dist/export-mocks/router/index.mjs +0 -10
- package/dist/images/decorator.d.ts +0 -6
- package/dist/images/decorator.js +0 -1
- package/dist/images/decorator.mjs +0 -2
- package/dist/index.d-ff220430.d.ts +0 -310
- package/dist/index.mjs +0 -57
- package/dist/node/index.mjs +0 -5
- package/dist/preset.d.ts +0 -9
- package/dist/preview.mjs +0 -3
- package/dist/react-18-IGIL3GJQ.mjs +0 -7
- package/dist/types-d044381e.d.ts +0 -52
- package/dist/vite-plugin/index.mjs +0 -6
package/dist/node/index.mjs
DELETED
package/dist/preset.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { PresetProperty } from 'storybook/internal/types';
|
|
2
|
-
import { StorybookConfigVite } from '@storybook/builder-vite';
|
|
3
|
-
|
|
4
|
-
declare const core: PresetProperty<'core'>;
|
|
5
|
-
declare const previewAnnotations: PresetProperty<'previewAnnotations'>;
|
|
6
|
-
declare const optimizeViteDeps: string[];
|
|
7
|
-
declare const viteFinal: StorybookConfigVite['viteFinal'];
|
|
8
|
-
|
|
9
|
-
export { core, optimizeViteDeps, previewAnnotations, viteFinal };
|
package/dist/preview.mjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import './chunk-XP5HYGXS.mjs';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import * as ReactDOM from 'react-dom/client';
|
|
4
|
-
|
|
5
|
-
var nodes=new Map;function getIsReactActEnvironment(){return globalThis.IS_REACT_ACT_ENVIRONMENT}var WithCallback=({callback,children})=>{let once=React.useRef();return React.useLayoutEffect(()=>{once.current!==callback&&(once.current=callback,callback());},[callback]),children};typeof Promise.withResolvers>"u"&&(Promise.withResolvers=()=>{let resolve=null,reject=null;return {promise:new Promise((res,rej)=>{resolve=res,reject=rej;}),resolve,reject}});var renderElement=async(node,el,rootOptions)=>{let root=await getReactRoot(el,rootOptions);if(getIsReactActEnvironment()){root.render(node);return}let{promise,resolve}=Promise.withResolvers();return root.render(React.createElement(WithCallback,{callback:resolve},node)),promise},unmountElement=(el,shouldUseNewRootApi)=>{let root=nodes.get(el);root&&(root.unmount(),nodes.delete(el));},getReactRoot=async(el,rootOptions)=>{let root=nodes.get(el);return root||(root=ReactDOM.createRoot(el,rootOptions),nodes.set(el,root)),root};
|
|
6
|
-
|
|
7
|
-
export { renderElement, unmountElement };
|
package/dist/types-d044381e.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { CompatibleString } from 'storybook/internal/types';
|
|
2
|
-
import { BuilderOptions } from '@storybook/builder-vite';
|
|
3
|
-
import { StorybookConfig as StorybookConfig$1 } from '@storybook/react-vite';
|
|
4
|
-
import { NextRouter } from 'next/router';
|
|
5
|
-
|
|
6
|
-
type FrameworkName = CompatibleString<'@storybook/nextjs-vite'>;
|
|
7
|
-
type BuilderName = CompatibleString<'@storybook/builder-vite'>;
|
|
8
|
-
type FrameworkOptions = {
|
|
9
|
-
/** The path to the Next.js configuration file. */
|
|
10
|
-
nextConfigPath?: string;
|
|
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
|
-
};
|
|
25
|
-
/** The interface for Storybook configuration in `main.ts` files. */
|
|
26
|
-
type StorybookConfig = Omit<StorybookConfig$1, keyof StorybookConfigFramework> & StorybookConfigFramework;
|
|
27
|
-
interface NextJsParameters {
|
|
28
|
-
/**
|
|
29
|
-
* Next.js framework configuration
|
|
30
|
-
*
|
|
31
|
-
* @see https://storybook.js.org/docs/get-started/frameworks/nextjs
|
|
32
|
-
*/
|
|
33
|
-
nextjs?: {
|
|
34
|
-
/**
|
|
35
|
-
* Enable App Directory features If your story imports components that use next/navigation, you
|
|
36
|
-
* need to set this parameter to true
|
|
37
|
-
*/
|
|
38
|
-
appDirectory?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Next.js navigation configuration when using `next/navigation`. Please note that it can only
|
|
41
|
-
* be used in components/pages in the app directory.
|
|
42
|
-
*/
|
|
43
|
-
navigation?: Partial<NextRouter>;
|
|
44
|
-
/** Next.js router configuration */
|
|
45
|
-
router?: Partial<NextRouter>;
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
interface NextJsTypes {
|
|
49
|
-
parameters: NextJsParameters;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export { FrameworkOptions as F, NextJsTypes as N, StorybookConfig as S, NextJsParameters as a };
|