@mui/material-nextjs 6.4.3 → 7.0.0-alpha.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/CHANGELOG.md +70 -2227
- package/esm/package.json +1 -0
- package/esm/v13-appRouter/appRouterV13.d.ts +27 -0
- package/{node → esm}/v13-appRouter/appRouterV13.js +13 -20
- package/esm/v13-appRouter/index.d.ts +2 -0
- package/esm/v13-appRouter/index.js +2 -0
- package/esm/v13-pagesRouter/createCache.d.ts +1 -0
- package/{node → esm}/v13-pagesRouter/createCache.js +3 -10
- package/esm/v13-pagesRouter/index.d.ts +2 -0
- package/esm/v13-pagesRouter/index.js +2 -0
- package/esm/v13-pagesRouter/nextDocument.cjs +1 -0
- package/esm/v13-pagesRouter/nextDocument.d.cts +2 -0
- package/esm/v13-pagesRouter/pagesRouterV13App.d.ts +9 -0
- package/esm/v13-pagesRouter/pagesRouterV13App.js +14 -0
- package/esm/v13-pagesRouter/pagesRouterV13Document.d.ts +23 -0
- package/{node → esm}/v13-pagesRouter/pagesRouterV13Document.js +16 -25
- package/esm/v14-appRouter/index.d.ts +1 -0
- package/esm/v14-appRouter/index.js +1 -0
- package/esm/v14-pagesRouter/index.d.ts +1 -0
- package/esm/v14-pagesRouter/index.js +1 -0
- package/esm/v15-appRouter/index.d.ts +1 -0
- package/esm/v15-appRouter/index.js +1 -0
- package/esm/v15-pagesRouter/index.d.ts +1 -0
- package/esm/v15-pagesRouter/index.js +1 -0
- package/modern/package.json +1 -0
- package/modern/v13-appRouter/appRouterV13.d.ts +27 -0
- package/modern/v13-appRouter/index.d.ts +2 -0
- package/modern/v13-pagesRouter/createCache.d.ts +1 -0
- package/modern/v13-pagesRouter/index.d.ts +2 -0
- package/modern/v13-pagesRouter/nextDocument.cjs +1 -0
- package/modern/v13-pagesRouter/pagesRouterV13App.d.ts +9 -0
- package/modern/v13-pagesRouter/pagesRouterV13Document.d.ts +23 -0
- package/modern/v13-pagesRouter/pagesRouterV13Document.js +2 -1
- package/modern/v14-appRouter/index.d.ts +1 -0
- package/modern/v14-pagesRouter/index.d.ts +1 -0
- package/modern/v15-appRouter/index.d.ts +1 -0
- package/modern/v15-pagesRouter/index.d.ts +1 -0
- package/package.json +32 -2
- package/tsconfig.build.tsbuildinfo +1 -0
- package/v13-appRouter/appRouterV13.d.ts +16 -16
- package/v13-appRouter/appRouterV13.js +20 -13
- package/v13-appRouter/index.d.ts +2 -2
- package/v13-appRouter/index.js +27 -2
- package/v13-pagesRouter/createCache.d.ts +1 -1
- package/v13-pagesRouter/createCache.js +10 -3
- package/v13-pagesRouter/index.d.ts +2 -2
- package/v13-pagesRouter/index.js +27 -2
- package/v13-pagesRouter/nextDocument.cjs +1 -0
- package/v13-pagesRouter/pagesRouterV13App.d.ts +5 -2
- package/v13-pagesRouter/pagesRouterV13App.js +15 -7
- package/v13-pagesRouter/pagesRouterV13Document.d.ts +8 -8
- package/v13-pagesRouter/pagesRouterV13Document.js +25 -14
- package/v14-appRouter/index.d.ts +1 -1
- package/v14-appRouter/index.js +16 -1
- package/v14-pagesRouter/index.d.ts +1 -1
- package/v14-pagesRouter/index.js +16 -1
- package/v15-appRouter/index.d.ts +1 -1
- package/v15-appRouter/index.js +16 -1
- package/v15-pagesRouter/index.d.ts +1 -1
- package/v15-pagesRouter/index.js +16 -1
- package/node/v13-appRouter/index.js +0 -27
- package/node/v13-pagesRouter/index.js +0 -27
- package/node/v13-pagesRouter/pagesRouterV13App.js +0 -22
- package/node/v14-appRouter/index.js +0 -16
- package/node/v14-pagesRouter/index.js +0 -16
- package/node/v15-appRouter/index.js +0 -16
- package/node/v15-pagesRouter/index.js +0 -16
- package/v13-appRouter/package.json +0 -6
- package/v13-pagesRouter/package.json +0 -6
- package/v14-appRouter/package.json +0 -6
- package/v14-pagesRouter/package.json +0 -6
- package/v15-appRouter/package.json +0 -6
- package/v15-pagesRouter/package.json +0 -6
package/esm/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module","sideEffects":false}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { EmotionCache, Options as OptionsOfCreateCache } from '@emotion/cache';
|
|
3
|
+
export type AppRouterCacheProviderProps = {
|
|
4
|
+
/**
|
|
5
|
+
* These are the options passed to createCache() from 'import createCache from "@emotion/cache"'.
|
|
6
|
+
*/
|
|
7
|
+
options?: Partial<OptionsOfCreateCache> & {
|
|
8
|
+
/**
|
|
9
|
+
* If `true`, the generated styles are wrapped within `@layer mui`.
|
|
10
|
+
* This is useful if you want to override the Material UI's generated styles with different styling solution, like Tailwind CSS, plain CSS etc.
|
|
11
|
+
*/
|
|
12
|
+
enableCssLayer?: boolean;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* By default <CacheProvider /> from 'import { CacheProvider } from "@emotion/react"'.
|
|
16
|
+
*/
|
|
17
|
+
CacheProvider?: React.ElementType<{
|
|
18
|
+
value: EmotionCache;
|
|
19
|
+
}>;
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Emotion works OK without this provider but it's recommended to use this provider to improve performance.
|
|
24
|
+
* Without it, Emotion will generate a new <style> tag during SSR for every component.
|
|
25
|
+
* See https://github.com/mui/material-ui/issues/26561#issuecomment-855286153 for why it's a problem.
|
|
26
|
+
*/
|
|
27
|
+
export default function AppRouterCacheProvider(props: AppRouterCacheProviderProps): React.JSX.Element;
|
|
@@ -1,30 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
'use client';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
exports.default = AppRouterCacheProvider;
|
|
10
|
-
var React = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _cache = _interopRequireDefault(require("@emotion/cache"));
|
|
12
|
-
var _react2 = require("@emotion/react");
|
|
13
|
-
var _navigation = require("next/navigation");
|
|
14
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import createCache from '@emotion/cache';
|
|
5
|
+
import { CacheProvider as DefaultCacheProvider } from '@emotion/react';
|
|
6
|
+
import { useServerInsertedHTML } from 'next/navigation';
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
8
|
/**
|
|
16
9
|
* Emotion works OK without this provider but it's recommended to use this provider to improve performance.
|
|
17
10
|
* Without it, Emotion will generate a new <style> tag during SSR for every component.
|
|
18
11
|
* See https://github.com/mui/material-ui/issues/26561#issuecomment-855286153 for why it's a problem.
|
|
19
12
|
*/
|
|
20
|
-
function AppRouterCacheProvider(props) {
|
|
13
|
+
export default function AppRouterCacheProvider(props) {
|
|
21
14
|
const {
|
|
22
15
|
options,
|
|
23
|
-
CacheProvider =
|
|
16
|
+
CacheProvider = DefaultCacheProvider,
|
|
24
17
|
children
|
|
25
18
|
} = props;
|
|
26
19
|
const [registry] = React.useState(() => {
|
|
27
|
-
const cache = (
|
|
20
|
+
const cache = createCache({
|
|
28
21
|
...options,
|
|
29
22
|
key: options?.key ?? 'mui'
|
|
30
23
|
});
|
|
@@ -55,7 +48,7 @@ function AppRouterCacheProvider(props) {
|
|
|
55
48
|
flush
|
|
56
49
|
};
|
|
57
50
|
});
|
|
58
|
-
|
|
51
|
+
useServerInsertedHTML(() => {
|
|
59
52
|
const inserted = registry.flush();
|
|
60
53
|
if (inserted.length === 0) {
|
|
61
54
|
return null;
|
|
@@ -80,11 +73,11 @@ function AppRouterCacheProvider(props) {
|
|
|
80
73
|
}
|
|
81
74
|
}
|
|
82
75
|
});
|
|
83
|
-
return /*#__PURE__*/(
|
|
76
|
+
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
84
77
|
children: [globals.map(({
|
|
85
78
|
name,
|
|
86
79
|
style
|
|
87
|
-
}) => /*#__PURE__*/(
|
|
80
|
+
}) => /*#__PURE__*/_jsx("style", {
|
|
88
81
|
nonce: options?.nonce,
|
|
89
82
|
"data-emotion": `${registry.cache.key}-global ${name}`
|
|
90
83
|
// eslint-disable-next-line react/no-danger
|
|
@@ -92,7 +85,7 @@ function AppRouterCacheProvider(props) {
|
|
|
92
85
|
dangerouslySetInnerHTML: {
|
|
93
86
|
__html: style
|
|
94
87
|
}
|
|
95
|
-
}, name)), styles && /*#__PURE__*/(
|
|
88
|
+
}, name)), styles && /*#__PURE__*/_jsx("style", {
|
|
96
89
|
nonce: options?.nonce,
|
|
97
90
|
"data-emotion": dataEmotionAttribute
|
|
98
91
|
// eslint-disable-next-line react/no-danger
|
|
@@ -103,7 +96,7 @@ function AppRouterCacheProvider(props) {
|
|
|
103
96
|
})]
|
|
104
97
|
});
|
|
105
98
|
});
|
|
106
|
-
return /*#__PURE__*/(
|
|
99
|
+
return /*#__PURE__*/_jsx(CacheProvider, {
|
|
107
100
|
value: registry.cache,
|
|
108
101
|
children: children
|
|
109
102
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function createEmotionCache(): import("@emotion/cache").EmotionCache;
|
|
@@ -1,23 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = createEmotionCache;
|
|
8
|
-
var _cache = _interopRequireDefault(require("@emotion/cache"));
|
|
1
|
+
import createCache from '@emotion/cache';
|
|
9
2
|
const isBrowser = typeof document !== 'undefined';
|
|
10
3
|
|
|
11
4
|
// On the client side, Create a meta tag at the top of the <head> and set it as insertionPoint.
|
|
12
5
|
// This assures that MUI styles are loaded first.
|
|
13
6
|
// It allows developers to easily override MUI styles with other styling solutions, like CSS modules.
|
|
14
|
-
function createEmotionCache() {
|
|
7
|
+
export default function createEmotionCache() {
|
|
15
8
|
let insertionPoint;
|
|
16
9
|
if (isBrowser) {
|
|
17
10
|
const emotionInsertionPoint = document.querySelector('meta[name="emotion-insertion-point"]');
|
|
18
11
|
insertionPoint = emotionInsertionPoint ?? undefined;
|
|
19
12
|
}
|
|
20
|
-
return (
|
|
13
|
+
return createCache({
|
|
21
14
|
key: 'mui',
|
|
22
15
|
insertionPoint
|
|
23
16
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('next/document');
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { EmotionCache } from '@emotion/react';
|
|
3
|
+
export interface EmotionCacheProviderProps {
|
|
4
|
+
emotionCache?: EmotionCache;
|
|
5
|
+
}
|
|
6
|
+
export declare function AppCacheProvider({
|
|
7
|
+
emotionCache,
|
|
8
|
+
children
|
|
9
|
+
}: React.PropsWithChildren<EmotionCacheProviderProps>): React.JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CacheProvider } from '@emotion/react';
|
|
3
|
+
import createEmotionCache from "./createCache.js";
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
const defaultEmotionCache = createEmotionCache();
|
|
6
|
+
export function AppCacheProvider({
|
|
7
|
+
emotionCache = defaultEmotionCache,
|
|
8
|
+
children
|
|
9
|
+
}) {
|
|
10
|
+
return /*#__PURE__*/_jsx(CacheProvider, {
|
|
11
|
+
value: emotionCache,
|
|
12
|
+
children: children
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { AppType } from 'next/app';
|
|
3
|
+
import { EmotionCache } from '@emotion/react';
|
|
4
|
+
import type { DocumentContext, DocumentInitialProps } from 'next/document';
|
|
5
|
+
interface Plugin {
|
|
6
|
+
enhanceApp: (App: React.ComponentType<React.ComponentProps<AppType>>) => (props: any) => React.JSX.Element;
|
|
7
|
+
resolveProps: (initialProps: DocumentInitialProps) => Promise<DocumentInitialProps>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A utility to compose multiple `getInitialProps` functions.
|
|
11
|
+
*/
|
|
12
|
+
export declare function createGetInitialProps(plugins: Plugin[]): (ctx: DocumentContext) => Promise<DocumentInitialProps>;
|
|
13
|
+
export interface DocumentHeadTagsProps {
|
|
14
|
+
emotionStyleTags: React.ReactElement<unknown>[];
|
|
15
|
+
}
|
|
16
|
+
export declare function DocumentHeadTags(props: DocumentHeadTagsProps): React.JSX.Element;
|
|
17
|
+
export declare function documentGetInitialProps(ctx: DocumentContext, options?: {
|
|
18
|
+
emotionCache?: EmotionCache;
|
|
19
|
+
plugins?: Plugin[];
|
|
20
|
+
}): Promise<import("next/dist/shared/lib/utils").RenderPageResult & {
|
|
21
|
+
styles?: React.ReactElement[] | Iterable<React.ReactNode> | React.JSX.Element;
|
|
22
|
+
} & DocumentHeadTagsProps>;
|
|
23
|
+
export {};
|
|
@@ -1,36 +1,27 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.DocumentHeadTags = DocumentHeadTags;
|
|
9
|
-
exports.createGetInitialProps = createGetInitialProps;
|
|
10
|
-
exports.documentGetInitialProps = documentGetInitialProps;
|
|
11
|
-
var React = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _createInstance = _interopRequireDefault(require("@emotion/server/create-instance"));
|
|
13
|
-
var _document = _interopRequireDefault(require("next/document"));
|
|
14
|
-
var _createCache = _interopRequireDefault(require("./createCache"));
|
|
15
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
1
|
var _meta;
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import createEmotionServer from '@emotion/server/create-instance';
|
|
4
|
+
import nextDocument from "./nextDocument.cjs";
|
|
5
|
+
import createEmotionCache from "./createCache.js";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const Document = nextDocument.default || nextDocument;
|
|
17
8
|
/**
|
|
18
9
|
* A utility to compose multiple `getInitialProps` functions.
|
|
19
10
|
*/
|
|
20
|
-
function createGetInitialProps(plugins) {
|
|
11
|
+
export function createGetInitialProps(plugins) {
|
|
21
12
|
return async function getInitialProps(ctx) {
|
|
22
13
|
const originalRenderPage = ctx.renderPage;
|
|
23
14
|
ctx.renderPage = () => originalRenderPage({
|
|
24
15
|
enhanceApp: App => plugins.reduce((result, plugin) => plugin.enhanceApp(result), App)
|
|
25
16
|
});
|
|
26
|
-
const initialProps = await
|
|
17
|
+
const initialProps = await Document.getInitialProps(ctx);
|
|
27
18
|
const finalProps = await plugins.reduce(async (result, plugin) => plugin.resolveProps(await result), Promise.resolve(initialProps));
|
|
28
19
|
return finalProps;
|
|
29
20
|
};
|
|
30
21
|
}
|
|
31
|
-
function DocumentHeadTags(props) {
|
|
32
|
-
return /*#__PURE__*/(
|
|
33
|
-
children: [_meta || (_meta = /*#__PURE__*/(
|
|
22
|
+
export function DocumentHeadTags(props) {
|
|
23
|
+
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
24
|
+
children: [_meta || (_meta = /*#__PURE__*/_jsx("meta", {
|
|
34
25
|
name: "emotion-insertion-point",
|
|
35
26
|
content: ""
|
|
36
27
|
})), props.emotionStyleTags]
|
|
@@ -39,7 +30,7 @@ function DocumentHeadTags(props) {
|
|
|
39
30
|
|
|
40
31
|
// `getInitialProps` belongs to `_document` (instead of `_app`),
|
|
41
32
|
// it's compatible with static-site generation (SSG).
|
|
42
|
-
async function documentGetInitialProps(ctx, options) {
|
|
33
|
+
export async function documentGetInitialProps(ctx, options) {
|
|
43
34
|
// Resolution order
|
|
44
35
|
//
|
|
45
36
|
// On the server:
|
|
@@ -64,15 +55,15 @@ async function documentGetInitialProps(ctx, options) {
|
|
|
64
55
|
|
|
65
56
|
// You can consider sharing the same Emotion cache between all the SSR requests to speed up performance.
|
|
66
57
|
// However, be aware that it can have global side effects.
|
|
67
|
-
const cache = options?.emotionCache ?? (
|
|
58
|
+
const cache = options?.emotionCache ?? createEmotionCache();
|
|
68
59
|
// The createEmotionServer has to be called directly after the cache creation due to the side effect of cache.compat = true,
|
|
69
60
|
// otherwise the <style> tag will not come with the HTML string from the server.
|
|
70
61
|
const {
|
|
71
62
|
extractCriticalToChunks
|
|
72
|
-
} = (
|
|
63
|
+
} = createEmotionServer(cache);
|
|
73
64
|
return createGetInitialProps([{
|
|
74
65
|
enhanceApp: App => function EnhanceApp(props) {
|
|
75
|
-
return /*#__PURE__*/(
|
|
66
|
+
return /*#__PURE__*/_jsx(App, {
|
|
76
67
|
emotionCache: cache,
|
|
77
68
|
...props
|
|
78
69
|
});
|
|
@@ -83,7 +74,7 @@ async function documentGetInitialProps(ctx, options) {
|
|
|
83
74
|
} = extractCriticalToChunks(initialProps.html);
|
|
84
75
|
return {
|
|
85
76
|
...initialProps,
|
|
86
|
-
emotionStyleTags: styles.map(style => /*#__PURE__*/(
|
|
77
|
+
emotionStyleTags: styles.map(style => /*#__PURE__*/_jsx("style", {
|
|
87
78
|
"data-emotion": `${style.key} ${style.ids.join(' ')}`,
|
|
88
79
|
// eslint-disable-next-line react/no-danger
|
|
89
80
|
dangerouslySetInnerHTML: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../v13-appRouter/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../v13-appRouter/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../v13-pagesRouter/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../v13-pagesRouter/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../v13-appRouter/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../v13-appRouter/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../v13-pagesRouter/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../v13-pagesRouter/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module","sideEffects":false}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { EmotionCache, Options as OptionsOfCreateCache } from '@emotion/cache';
|
|
3
|
+
export type AppRouterCacheProviderProps = {
|
|
4
|
+
/**
|
|
5
|
+
* These are the options passed to createCache() from 'import createCache from "@emotion/cache"'.
|
|
6
|
+
*/
|
|
7
|
+
options?: Partial<OptionsOfCreateCache> & {
|
|
8
|
+
/**
|
|
9
|
+
* If `true`, the generated styles are wrapped within `@layer mui`.
|
|
10
|
+
* This is useful if you want to override the Material UI's generated styles with different styling solution, like Tailwind CSS, plain CSS etc.
|
|
11
|
+
*/
|
|
12
|
+
enableCssLayer?: boolean;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* By default <CacheProvider /> from 'import { CacheProvider } from "@emotion/react"'.
|
|
16
|
+
*/
|
|
17
|
+
CacheProvider?: React.ElementType<{
|
|
18
|
+
value: EmotionCache;
|
|
19
|
+
}>;
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Emotion works OK without this provider but it's recommended to use this provider to improve performance.
|
|
24
|
+
* Without it, Emotion will generate a new <style> tag during SSR for every component.
|
|
25
|
+
* See https://github.com/mui/material-ui/issues/26561#issuecomment-855286153 for why it's a problem.
|
|
26
|
+
*/
|
|
27
|
+
export default function AppRouterCacheProvider(props: AppRouterCacheProviderProps): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function createEmotionCache(): import("@emotion/cache").EmotionCache;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('next/document');
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { EmotionCache } from '@emotion/react';
|
|
3
|
+
export interface EmotionCacheProviderProps {
|
|
4
|
+
emotionCache?: EmotionCache;
|
|
5
|
+
}
|
|
6
|
+
export declare function AppCacheProvider({
|
|
7
|
+
emotionCache,
|
|
8
|
+
children
|
|
9
|
+
}: React.PropsWithChildren<EmotionCacheProviderProps>): React.JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { AppType } from 'next/app';
|
|
3
|
+
import { EmotionCache } from '@emotion/react';
|
|
4
|
+
import type { DocumentContext, DocumentInitialProps } from 'next/document';
|
|
5
|
+
interface Plugin {
|
|
6
|
+
enhanceApp: (App: React.ComponentType<React.ComponentProps<AppType>>) => (props: any) => React.JSX.Element;
|
|
7
|
+
resolveProps: (initialProps: DocumentInitialProps) => Promise<DocumentInitialProps>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A utility to compose multiple `getInitialProps` functions.
|
|
11
|
+
*/
|
|
12
|
+
export declare function createGetInitialProps(plugins: Plugin[]): (ctx: DocumentContext) => Promise<DocumentInitialProps>;
|
|
13
|
+
export interface DocumentHeadTagsProps {
|
|
14
|
+
emotionStyleTags: React.ReactElement<unknown>[];
|
|
15
|
+
}
|
|
16
|
+
export declare function DocumentHeadTags(props: DocumentHeadTagsProps): React.JSX.Element;
|
|
17
|
+
export declare function documentGetInitialProps(ctx: DocumentContext, options?: {
|
|
18
|
+
emotionCache?: EmotionCache;
|
|
19
|
+
plugins?: Plugin[];
|
|
20
|
+
}): Promise<import("next/dist/shared/lib/utils").RenderPageResult & {
|
|
21
|
+
styles?: React.ReactElement[] | Iterable<React.ReactNode> | React.JSX.Element;
|
|
22
|
+
} & DocumentHeadTagsProps>;
|
|
23
|
+
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
var _meta;
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import createEmotionServer from '@emotion/server/create-instance';
|
|
4
|
-
import
|
|
4
|
+
import nextDocument from "./nextDocument.cjs";
|
|
5
5
|
import createEmotionCache from "./createCache.js";
|
|
6
6
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const Document = nextDocument.default || nextDocument;
|
|
7
8
|
/**
|
|
8
9
|
* A utility to compose multiple `getInitialProps` functions.
|
|
9
10
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../v13-appRouter/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../v13-pagesRouter/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../v13-appRouter/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../v13-pagesRouter/index.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/material-nextjs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-alpha.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"description": "Collection of utilities for integration between Material UI and Next.js.",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"url": "https://opencollective.com/mui-org"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@babel/runtime": "^7.26.
|
|
27
|
+
"@babel/runtime": "^7.26.7"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@emotion/cache": "^11.11.0",
|
|
@@ -52,5 +52,35 @@
|
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
|
54
54
|
"node": ">=14.0.0"
|
|
55
|
+
},
|
|
56
|
+
"exports": {
|
|
57
|
+
"./*": {
|
|
58
|
+
"require": {
|
|
59
|
+
"types": "./*/index.d.ts",
|
|
60
|
+
"default": "./*/index.js"
|
|
61
|
+
},
|
|
62
|
+
"import": {
|
|
63
|
+
"types": "./esm/*/index.d.ts",
|
|
64
|
+
"default": "./esm/*/index.js"
|
|
65
|
+
},
|
|
66
|
+
"mui-modern": {
|
|
67
|
+
"types": "./modern/*/index.d.ts",
|
|
68
|
+
"default": "./modern/*/index.js"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"./v13-pagesRouter": {
|
|
72
|
+
"require": {
|
|
73
|
+
"types": "./v13-pagesRouter/index.d.ts",
|
|
74
|
+
"default": "./v13-pagesRouter/index.js"
|
|
75
|
+
},
|
|
76
|
+
"import": {
|
|
77
|
+
"types": "./esm/v13-pagesRouter/index.d.ts",
|
|
78
|
+
"default": "./esm/v13-pagesRouter/index.js"
|
|
79
|
+
},
|
|
80
|
+
"mui-modern": {
|
|
81
|
+
"types": "./modern/v13-pagesRouter/index.d.ts",
|
|
82
|
+
"default": "./modern/v13-pagesRouter/index.js"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
55
85
|
}
|
|
56
86
|
}
|