@storybook/nextjs-vite 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.
Files changed (46) hide show
  1. package/README.md +3 -1
  2. package/dist/_browser-chunks/chunk-2RWWBM6A.js +261 -0
  3. package/dist/_browser-chunks/chunk-L5NVL7MD.js +37 -0
  4. package/dist/_browser-chunks/react-18-G7Q4PNHD.js +71 -0
  5. package/dist/_node-chunks/chunk-IRJBSU6R.js +54 -0
  6. package/dist/_node-chunks/dist-DJQHMCL2.js +7476 -0
  7. package/dist/_node-chunks/jiti-B65Y7N6M.js +32362 -0
  8. package/dist/export-mocks/cache/index.d.ts +308 -1
  9. package/dist/export-mocks/cache/index.js +22 -1
  10. package/dist/export-mocks/headers/index.d.ts +309 -1
  11. package/dist/export-mocks/headers/index.js +77 -1
  12. package/dist/export-mocks/navigation/index.js +81 -1
  13. package/dist/export-mocks/router/index.d.ts +2 -2
  14. package/dist/export-mocks/router/index.js +97 -1
  15. package/dist/index.d.ts +51 -7
  16. package/dist/index.js +22153 -45
  17. package/dist/node/index.d.ts +25 -5
  18. package/dist/node/index.js +23 -1
  19. package/dist/preset.js +714 -580
  20. package/dist/preview.d.ts +3 -19
  21. package/dist/preview.d.tsx +19 -0
  22. package/dist/preview.js +11 -1
  23. package/dist/vite-plugin/index.d.ts +1 -3
  24. package/dist/vite-plugin/index.js +21 -1
  25. package/package.json +35 -83
  26. package/preset.js +1 -1
  27. package/template/cli/js/Configure.mdx +11 -11
  28. package/template/cli/ts/Configure.mdx +11 -11
  29. package/dist/chunk-GKRSUUNG.mjs +0 -6
  30. package/dist/chunk-J3BB7LEU.mjs +0 -20
  31. package/dist/chunk-XP5HYGXS.mjs +0 -3
  32. package/dist/export-mocks/cache/index.mjs +0 -6
  33. package/dist/export-mocks/headers/index.mjs +0 -12
  34. package/dist/export-mocks/navigation/index.mjs +0 -11
  35. package/dist/export-mocks/router/index.mjs +0 -10
  36. package/dist/images/decorator.d.ts +0 -6
  37. package/dist/images/decorator.js +0 -1
  38. package/dist/images/decorator.mjs +0 -2
  39. package/dist/index.d-ff220430.d.ts +0 -310
  40. package/dist/index.mjs +0 -57
  41. package/dist/node/index.mjs +0 -5
  42. package/dist/preset.d.ts +0 -9
  43. package/dist/preview.mjs +0 -3
  44. package/dist/react-18-IGIL3GJQ.mjs +0 -7
  45. package/dist/types-d044381e.d.ts +0 -52
  46. package/dist/vite-plugin/index.mjs +0 -6
@@ -1,5 +0,0 @@
1
- import '../chunk-XP5HYGXS.mjs';
2
-
3
- function defineMain(config){return config}
4
-
5
- export { defineMain };
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,3 +0,0 @@
1
- export { decorators, loaders, parameters } from './chunk-J3BB7LEU.mjs';
2
- import './chunk-GKRSUUNG.mjs';
3
- import './chunk-XP5HYGXS.mjs';
@@ -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 };
@@ -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 };
@@ -1,6 +0,0 @@
1
- import '../chunk-XP5HYGXS.mjs';
2
- import vitePluginStorybookNextJs from 'vite-plugin-storybook-nextjs';
3
-
4
- var storybookNextJsPlugin=vitePluginStorybookNextJs;
5
-
6
- export { storybookNextJsPlugin };