vite-plugin-storybook-nextjs 0.0.7 → 0.0.9

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.
@@ -1,4 +1,4 @@
1
- import * as next_dist_compiled_react from 'next/dist/compiled/react';
1
+ import * as React from 'next/dist/compiled/react';
2
2
  import { ImageProps, StaticImageData } from 'next/image';
3
3
  import { ImageProps as ImageProps$1 } from 'next/legacy/image';
4
4
 
@@ -6,7 +6,7 @@ interface StaticRequire {
6
6
  default: StaticImageData;
7
7
  }
8
8
  declare type StaticImport = StaticRequire | StaticImageData;
9
- declare const ImageContext: next_dist_compiled_react.Context<Partial<Omit<ImageProps, "src"> & {
9
+ declare const ImageContext: React.Context<Partial<Omit<ImageProps, "src"> & {
10
10
  src: string | StaticImport;
11
11
  }> & Omit<ImageProps$1, "src">>;
12
12
 
@@ -1,8 +1,8 @@
1
1
  import * as next_dist_shared_lib_get_img_props from 'next/dist/shared/lib/get-img-props';
2
2
  import * as _NextImage from 'next/image';
3
- import React__default from 'react';
3
+ import React__default from 'next/dist/compiled/react';
4
4
 
5
- declare const MockedNextImage: React__default.ForwardRefExoticComponent<Omit<React__default.DetailedHTMLProps<React__default.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "height" | "width" | "loading" | "ref" | "alt" | "src" | "srcSet"> & {
5
+ declare const MockedNextImage: React__default.ForwardRefExoticComponent<Omit<React__default.DetailedHTMLProps<React__default.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "src" | "width" | "height" | "loading" | "ref" | "alt" | "srcSet"> & {
6
6
  src: string | next_dist_shared_lib_get_img_props.StaticImport;
7
7
  alt: string;
8
8
  width?: number | `${number}` | undefined;
@@ -1,7 +1,7 @@
1
1
  import * as NextImageNamespace from 'next/image';
2
2
  import { defaultLoader } from 'sb-original/default-loader';
3
3
  import { ImageContext } from 'sb-original/image-context';
4
- import React from 'react';
4
+ import React from 'next/dist/compiled/react';
5
5
 
6
6
  // src/plugins/next-image/alias/next-image.tsx
7
7
  var OriginalNextImage = NextImageNamespace.default;
@@ -1,5 +1,5 @@
1
+ import React__default from 'next/dist/compiled/react';
1
2
  import * as _NextLegacyImage from 'next/legacy/image';
2
- import React__default from 'react';
3
3
 
4
4
  declare function NextLegacyImage({ loader, ...props }: _NextLegacyImage.ImageProps): React__default.JSX.Element;
5
5
 
@@ -1,7 +1,7 @@
1
1
  import OriginalNextLegacyImage from 'next/legacy/image';
2
2
  import { defaultLoader } from 'sb-original/default-loader';
3
3
  import { ImageContext } from 'sb-original/image-context';
4
- import React from 'react';
4
+ import React from 'next/dist/compiled/react';
5
5
 
6
6
  // src/plugins/next-image/alias/next-legacy-image.tsx
7
7
  function NextLegacyImage({ loader, ...props }) {
@@ -1,8 +1,8 @@
1
1
  import * as vitest from 'vitest';
2
- import { unstable_cache } from 'next/dist/server/web/spec-extension/unstable-cache';
3
- export { unstable_cache } from 'next/dist/server/web/spec-extension/unstable-cache';
4
- import { unstable_noStore } from 'next/dist/server/web/spec-extension/unstable-no-store';
5
- export { unstable_noStore } from 'next/dist/server/web/spec-extension/unstable-no-store';
2
+ import { unstable_cache } from 'next/dist/server/web/spec-extension/unstable-cache.js';
3
+ export { unstable_cache } from 'next/dist/server/web/spec-extension/unstable-cache.js';
4
+ import { unstable_noStore } from 'next/dist/server/web/spec-extension/unstable-no-store.js';
5
+ export { unstable_noStore } from 'next/dist/server/web/spec-extension/unstable-no-store.js';
6
6
 
7
7
  declare const revalidatePath: vitest.Mock<any, any>;
8
8
  declare const revalidateTag: vitest.Mock<any, any>;
@@ -1,8 +1,8 @@
1
1
  import { fn } from '@storybook/test';
2
- import { unstable_cache } from 'next/dist/server/web/spec-extension/unstable-cache';
3
- export { unstable_cache } from 'next/dist/server/web/spec-extension/unstable-cache';
4
- import { unstable_noStore } from 'next/dist/server/web/spec-extension/unstable-no-store';
5
- export { unstable_noStore } from 'next/dist/server/web/spec-extension/unstable-no-store';
2
+ import { unstable_cache } from 'next/dist/server/web/spec-extension/unstable-cache.js';
3
+ export { unstable_cache } from 'next/dist/server/web/spec-extension/unstable-cache.js';
4
+ import { unstable_noStore } from 'next/dist/server/web/spec-extension/unstable-no-store.js';
5
+ export { unstable_noStore } from 'next/dist/server/web/spec-extension/unstable-no-store.js';
6
6
 
7
7
  // src/plugins/next-mocks/alias/cache/index.ts
8
8
  var revalidatePath = fn().mockName("next/cache::revalidatePath");
@@ -1,10 +1,10 @@
1
1
  import * as vitest from 'vitest';
2
2
  import * as next_dist_compiled__edge_runtime_cookies from 'next/dist/compiled/@edge-runtime/cookies';
3
- import { RequestCookies } from 'next/dist/compiled/@edge-runtime/cookies';
3
+ import { RequestCookies } from 'next/dist/compiled/@edge-runtime/cookies/index.js';
4
4
 
5
5
  declare class RequestCookiesMock extends RequestCookies {
6
6
  get: vitest.Mock<[name: string] | [next_dist_compiled__edge_runtime_cookies.RequestCookie], next_dist_compiled__edge_runtime_cookies.RequestCookie | undefined>;
7
- getAll: vitest.Mock<[] | [next_dist_compiled__edge_runtime_cookies.RequestCookie] | [name: string], next_dist_compiled__edge_runtime_cookies.RequestCookie[]>;
7
+ getAll: vitest.Mock<[next_dist_compiled__edge_runtime_cookies.RequestCookie] | [name: string] | [], next_dist_compiled__edge_runtime_cookies.RequestCookie[]>;
8
8
  has: vitest.Mock<[name: string], boolean>;
9
9
  set: vitest.Mock<[key: string, value: string] | [options: next_dist_compiled__edge_runtime_cookies.RequestCookie], this>;
10
10
  delete: vitest.Mock<[names: string | string[]], boolean | boolean[]>;
@@ -1,6 +1,6 @@
1
1
  import { headers } from '@storybook/nextjs/headers.mock';
2
2
  import { fn } from '@storybook/test';
3
- import { RequestCookies } from 'next/dist/compiled/@edge-runtime/cookies';
3
+ import { RequestCookies } from 'next/dist/compiled/@edge-runtime/cookies/index.js';
4
4
 
5
5
  // src/plugins/next-mocks/alias/headers/cookies.ts
6
6
  var RequestCookiesMock = class extends RequestCookies {
@@ -1,5 +1,5 @@
1
1
  import * as vitest from 'vitest';
2
- import { HeadersAdapter } from 'next/dist/server/web/spec-extension/adapters/headers';
2
+ import { HeadersAdapter } from 'next/dist/server/web/spec-extension/adapters/headers.js';
3
3
 
4
4
  declare class HeadersAdapterMock extends HeadersAdapter {
5
5
  constructor();
@@ -1,5 +1,5 @@
1
1
  import { fn } from '@storybook/test';
2
- import { HeadersAdapter } from 'next/dist/server/web/spec-extension/adapters/headers';
2
+ import { HeadersAdapter } from 'next/dist/server/web/spec-extension/adapters/headers.js';
3
3
 
4
4
  // src/plugins/next-mocks/alias/headers/headers.ts
5
5
  var HeadersAdapterMock = class extends HeadersAdapter {
@@ -2,8 +2,9 @@ import * as vitest from 'vitest';
2
2
  import * as next_dist_client_components_draft_mode from 'next/dist/client/components/draft-mode';
3
3
  export { headers } from './headers.js';
4
4
  export { cookies } from './cookies.js';
5
- import 'next/dist/server/web/spec-extension/adapters/headers';
5
+ import 'next/dist/server/web/spec-extension/adapters/headers.js';
6
6
  import 'next/dist/compiled/@edge-runtime/cookies';
7
+ import 'next/dist/compiled/@edge-runtime/cookies/index.js';
7
8
 
8
9
  declare const draftMode: vitest.Mock<[], next_dist_client_components_draft_mode.DraftMode>;
9
10
 
@@ -1,8 +1,8 @@
1
1
  import { fn } from '@storybook/test';
2
- import * as originalHeaders from 'next/dist/client/components/headers';
3
- import { HeadersAdapter } from 'next/dist/server/web/spec-extension/adapters/headers';
2
+ import * as originalHeaders from 'next/dist/client/components/headers.js';
3
+ import { HeadersAdapter } from 'next/dist/server/web/spec-extension/adapters/headers.js';
4
4
  import { headers as headers$1 } from '@storybook/nextjs/headers.mock';
5
- import { RequestCookies } from 'next/dist/compiled/@edge-runtime/cookies';
5
+ import { RequestCookies } from 'next/dist/compiled/@edge-runtime/cookies/index.js';
6
6
 
7
7
  // src/plugins/next-mocks/alias/headers/index.ts
8
8
  var HeadersAdapterMock = class extends HeadersAdapter {
@@ -1,7 +1,7 @@
1
- import * as React from 'react';
1
+ import * as react from 'react';
2
2
  import * as next_dist_shared_lib_app_router_context_shared_runtime from 'next/dist/shared/lib/app-router-context.shared-runtime';
3
3
  import { Mock } from '@storybook/test';
4
- import * as actual from 'next/dist/client/components/navigation';
4
+ import * as actual from 'next/dist/client/components/navigation.js';
5
5
  export * from 'next/dist/client/components/navigation';
6
6
 
7
7
  declare const createNavigation: (overrides?: Record<string, (...params: unknown[]) => unknown>) => {
@@ -28,7 +28,7 @@ declare const usePathname: Mock<[], string>;
28
28
  declare const useSelectedLayoutSegment: Mock<[parallelRouteKey?: string | undefined], string | null>;
29
29
  declare const useSelectedLayoutSegments: Mock<[parallelRouteKey?: string | undefined], string[]>;
30
30
  declare const useRouter: Mock<[], next_dist_shared_lib_app_router_context_shared_runtime.AppRouterInstance>;
31
- declare const useServerInsertedHTML: Mock<[callback: () => React.ReactNode], void>;
31
+ declare const useServerInsertedHTML: Mock<[callback: () => react.ReactNode], void>;
32
32
  declare const notFound: Mock<[], never>;
33
33
  interface Params {
34
34
  [key: string]: string | string[];
@@ -1,9 +1,9 @@
1
1
  import { fn } from '@storybook/test';
2
- import * as actual from 'next/dist/client/components/navigation';
3
- export * from 'next/dist/client/components/navigation';
4
- import { getRedirectError } from 'next/dist/client/components/redirect';
5
- import { RedirectStatusCode } from 'next/dist/client/components/redirect-status-code';
2
+ import * as actual from 'next/dist/client/components/navigation.js';
3
+ import { RedirectStatusCode } from 'next/dist/client/components/redirect-status-code.js';
4
+ import { getRedirectError } from 'next/dist/client/components/redirect.js';
6
5
  import { NextjsRouterMocksNotAvailable } from 'storybook/internal/preview-errors';
6
+ export * from 'next/dist/client/components/navigation';
7
7
 
8
8
  // src/plugins/next-mocks/alias/navigation/index.ts
9
9
  var navigationAPI;
@@ -1,12 +1,12 @@
1
- import * as React from 'react';
1
+ import * as react from 'react';
2
2
  import * as next_dist_client_with_router from 'next/dist/client/with-router';
3
3
  import * as next_types from 'next/types';
4
4
  import { Mock } from '@storybook/test';
5
- import * as originalRouter from 'next/dist/client/router';
6
- import originalRouter__default from 'next/dist/client/router';
5
+ import * as originalRouter from 'next/dist/client/router.js';
6
+ import originalRouter__default from 'next/dist/client/router.js';
7
+ export { default } from 'next/dist/client/router.js';
8
+ import { NextRouter } from 'next/router.js';
7
9
  export * from 'next/dist/client/router';
8
- export { default } from 'next/dist/client/router';
9
- import { NextRouter } from 'next/router';
10
10
 
11
11
  /**
12
12
  * Creates a next/router router API mock. Used internally.
@@ -40,6 +40,6 @@ declare const getRouter: () => {
40
40
  };
41
41
 
42
42
  declare const useRouter: Mock<[], originalRouter.NextRouter>;
43
- declare const withRouter: Mock<[ComposedComponent: next_types.NextComponentType<next_types.NextPageContext, any, next_dist_client_with_router.WithRouterProps>], React.ComponentType<next_dist_client_with_router.ExcludeRouterProps<next_dist_client_with_router.WithRouterProps>>>;
43
+ declare const withRouter: Mock<[ComposedComponent: next_types.NextComponentType<next_types.NextPageContext, any, next_dist_client_with_router.WithRouterProps>], react.ComponentType<next_dist_client_with_router.ExcludeRouterProps<next_dist_client_with_router.WithRouterProps>>>;
44
44
 
45
45
  export { createRouter, getRouter, useRouter, withRouter };
@@ -1,8 +1,8 @@
1
1
  import { fn } from '@storybook/test';
2
- import * as singletonRouter from 'next/dist/client/router';
3
- import singletonRouter__default from 'next/dist/client/router';
4
- export * from 'next/dist/client/router';
2
+ import * as singletonRouter from 'next/dist/client/router.js';
3
+ import singletonRouter__default from 'next/dist/client/router.js';
5
4
  import { NextjsRouterMocksNotAvailable } from 'storybook/internal/preview-errors';
5
+ export * from 'next/dist/client/router';
6
6
 
7
7
  // src/plugins/next-mocks/alias/router/index.ts
8
8
  var defaultRouterState = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-storybook-nextjs",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "vite-plugin",