@mui/material-nextjs
Advanced tools
Comparing version 6.0.0-dev.240424162023-9968b4889d to 6.0.0
'use client'; | ||
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import * as React from 'react'; | ||
@@ -21,5 +20,6 @@ import createCache from '@emotion/cache'; | ||
const [registry] = React.useState(() => { | ||
const cache = createCache(_extends({}, options, { | ||
const cache = createCache({ | ||
...options, | ||
key: options?.key ?? 'mui' | ||
})); | ||
}); | ||
cache.compat = true; | ||
@@ -65,3 +65,3 @@ const prevInsert = cache.insert; | ||
const style = registry.cache.inserted[name]; | ||
if (typeof style !== 'boolean') { | ||
if (typeof style === 'string') { | ||
if (isGlobal) { | ||
@@ -68,0 +68,0 @@ globals.push({ |
@@ -1,2 +0,2 @@ | ||
export { default as AppRouterCacheProvider } from './appRouterV13'; | ||
export * from './appRouterV13'; | ||
export { default as AppRouterCacheProvider } from "./appRouterV13.js"; | ||
export * from "./appRouterV13.js"; |
@@ -1,2 +0,2 @@ | ||
export * from './pagesRouterV13Document'; | ||
export * from './pagesRouterV13App'; | ||
export * from "./pagesRouterV13Document.js"; | ||
export * from "./pagesRouterV13App.js"; |
import * as React from 'react'; | ||
import { CacheProvider } from '@emotion/react'; | ||
import createEmotionCache from './createCache'; | ||
import createEmotionCache from "./createCache.js"; | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
@@ -5,0 +5,0 @@ const defaultEmotionCache = createEmotionCache(); |
@@ -1,2 +0,1 @@ | ||
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
var _meta; | ||
@@ -6,3 +5,3 @@ import * as React from 'react'; | ||
import Document from 'next/document'; | ||
import createEmotionCache from './createCache'; | ||
import createEmotionCache from "./createCache.js"; | ||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; | ||
@@ -67,5 +66,6 @@ /** | ||
enhanceApp: App => function EnhanceApp(props) { | ||
return /*#__PURE__*/_jsx(App, _extends({ | ||
emotionCache: cache | ||
}, props)); | ||
return /*#__PURE__*/_jsx(App, { | ||
emotionCache: cache, | ||
...props | ||
}); | ||
}, | ||
@@ -76,3 +76,4 @@ resolveProps: async initialProps => { | ||
} = extractCriticalToChunks(initialProps.html); | ||
return _extends({}, initialProps, { | ||
return { | ||
...initialProps, | ||
emotionStyleTags: styles.map(style => /*#__PURE__*/_jsx("style", { | ||
@@ -85,5 +86,5 @@ "data-emotion": `${style.key} ${style.ids.join(' ')}`, | ||
}, style.key)) | ||
}); | ||
}; | ||
} | ||
}, ...(options?.plugins ?? [])])(ctx); | ||
} |
@@ -1,1 +0,1 @@ | ||
export * from '../v13-appRouter'; | ||
export * from "../v13-appRouter/index.js"; |
@@ -1,1 +0,1 @@ | ||
export * from '../v13-pagesRouter'; | ||
export * from "../v13-pagesRouter/index.js"; |
@@ -9,3 +9,2 @@ "use strict"; | ||
exports.default = AppRouterCacheProvider; | ||
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); | ||
var React = _interopRequireWildcard(require("react")); | ||
@@ -30,6 +29,6 @@ var _cache = _interopRequireDefault(require("@emotion/cache")); | ||
const [registry] = React.useState(() => { | ||
var _options$key; | ||
const cache = (0, _cache.default)((0, _extends2.default)({}, options, { | ||
key: (_options$key = options == null ? void 0 : options.key) != null ? _options$key : 'mui' | ||
})); | ||
const cache = (0, _cache.default)({ | ||
...options, | ||
key: options?.key ?? 'mui' | ||
}); | ||
cache.compat = true; | ||
@@ -40,3 +39,3 @@ const prevInsert = cache.insert; | ||
cache.insert = (...args) => { | ||
if (options != null && options.enableCssLayer) { | ||
if (options?.enableCssLayer) { | ||
args[1].styles = `@layer mui {${args[1].styles}}`; | ||
@@ -76,3 +75,3 @@ } | ||
const style = registry.cache.inserted[name]; | ||
if (typeof style !== 'boolean') { | ||
if (typeof style === 'string') { | ||
if (isGlobal) { | ||
@@ -94,3 +93,3 @@ globals.push({ | ||
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)("style", { | ||
nonce: options == null ? void 0 : options.nonce, | ||
nonce: options?.nonce, | ||
"data-emotion": `${registry.cache.key}-global ${name}` | ||
@@ -103,3 +102,3 @@ // eslint-disable-next-line react/no-danger | ||
}, name)), styles && /*#__PURE__*/(0, _jsxRuntime.jsx)("style", { | ||
nonce: options == null ? void 0 : options.nonce, | ||
nonce: options?.nonce, | ||
"data-emotion": dataEmotionAttribute | ||
@@ -106,0 +105,0 @@ // eslint-disable-next-line react/no-danger |
@@ -18,3 +18,3 @@ "use strict"; | ||
const emotionInsertionPoint = document.querySelector('meta[name="emotion-insertion-point"]'); | ||
insertionPoint = emotionInsertionPoint != null ? emotionInsertionPoint : undefined; | ||
insertionPoint = emotionInsertionPoint ?? undefined; | ||
} | ||
@@ -21,0 +21,0 @@ return (0, _cache.default)({ |
@@ -10,3 +10,2 @@ "use strict"; | ||
exports.documentGetInitialProps = documentGetInitialProps; | ||
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); | ||
var React = _interopRequireWildcard(require("react")); | ||
@@ -46,3 +45,2 @@ var _createInstance = _interopRequireDefault(require("@emotion/server/create-instance")); | ||
async function documentGetInitialProps(ctx, options) { | ||
var _options$emotionCache, _options$plugins; | ||
// Resolution order | ||
@@ -72,3 +70,3 @@ // | ||
// However, be aware that it can have global side effects. | ||
const cache = (_options$emotionCache = options == null ? void 0 : options.emotionCache) != null ? _options$emotionCache : (0, _createCache.default)(); | ||
const cache = options?.emotionCache ?? (0, _createCache.default)(); | ||
// The createEmotionServer has to be called directly after the cache creation due to the side effect of cache.compat = true, | ||
@@ -81,5 +79,6 @@ // otherwise the <style> tag will not come with the HTML string from the server. | ||
enhanceApp: App => function EnhanceApp(props) { | ||
return /*#__PURE__*/(0, _jsxRuntime.jsx)(App, (0, _extends2.default)({ | ||
emotionCache: cache | ||
}, props)); | ||
return /*#__PURE__*/(0, _jsxRuntime.jsx)(App, { | ||
emotionCache: cache, | ||
...props | ||
}); | ||
}, | ||
@@ -90,3 +89,4 @@ resolveProps: async initialProps => { | ||
} = extractCriticalToChunks(initialProps.html); | ||
return (0, _extends2.default)({}, initialProps, { | ||
return { | ||
...initialProps, | ||
emotionStyleTags: styles.map(style => /*#__PURE__*/(0, _jsxRuntime.jsx)("style", { | ||
@@ -99,5 +99,5 @@ "data-emotion": `${style.key} ${style.ids.join(' ')}`, | ||
}, style.key)) | ||
}); | ||
}; | ||
} | ||
}, ...((_options$plugins = options == null ? void 0 : options.plugins) != null ? _options$plugins : [])])(ctx); | ||
}, ...(options?.plugins ?? [])])(ctx); | ||
} |
{ | ||
"name": "@mui/material-nextjs", | ||
"version": "6.0.0-dev.240424162023-9968b4889d", | ||
"version": "6.0.0", | ||
"private": false, | ||
@@ -27,11 +27,11 @@ "author": "MUI Team", | ||
"dependencies": { | ||
"@babel/runtime": "^7.24.4" | ||
"@babel/runtime": "^7.25.0" | ||
}, | ||
"peerDependencies": { | ||
"@emotion/cache": "^11.11.0", | ||
"@emotion/react": "^11.11.4", | ||
"@emotion/server": "^11.11.0", | ||
"@types/react": "^17.0.0 || ^18.0.0", | ||
"@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", | ||
"next": "^13.0.0 || ^14.0.0", | ||
"react": "^17.0.0 || ^18.0.0", | ||
"@mui/material": "^6.0.0-dev.240424162023-9968b4889d" | ||
"react": "^17.0.0 || ^18.0.0 || ^19.0.0" | ||
}, | ||
@@ -55,4 +55,4 @@ "peerDependenciesMeta": { | ||
"engines": { | ||
"node": ">=12.0.0" | ||
"node": ">=14.0.0" | ||
} | ||
} |
'use client'; | ||
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import * as React from 'react'; | ||
@@ -21,5 +20,6 @@ import createCache from '@emotion/cache'; | ||
const [registry] = React.useState(() => { | ||
const cache = createCache(_extends({}, options, { | ||
const cache = createCache({ | ||
...options, | ||
key: options?.key ?? 'mui' | ||
})); | ||
}); | ||
cache.compat = true; | ||
@@ -65,3 +65,3 @@ const prevInsert = cache.insert; | ||
const style = registry.cache.inserted[name]; | ||
if (typeof style !== 'boolean') { | ||
if (typeof style === 'string') { | ||
if (isGlobal) { | ||
@@ -68,0 +68,0 @@ globals.push({ |
@@ -1,2 +0,2 @@ | ||
export { default as AppRouterCacheProvider } from './appRouterV13'; | ||
export * from './appRouterV13'; | ||
export { default as AppRouterCacheProvider } from "./appRouterV13.js"; | ||
export * from "./appRouterV13.js"; |
@@ -1,2 +0,2 @@ | ||
export * from './pagesRouterV13Document'; | ||
export * from './pagesRouterV13App'; | ||
export * from "./pagesRouterV13Document.js"; | ||
export * from "./pagesRouterV13App.js"; |
import * as React from 'react'; | ||
import { CacheProvider } from '@emotion/react'; | ||
import createEmotionCache from './createCache'; | ||
import createEmotionCache from "./createCache.js"; | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
@@ -5,0 +5,0 @@ const defaultEmotionCache = createEmotionCache(); |
@@ -6,3 +6,3 @@ import * as React from 'react'; | ||
interface Plugin { | ||
enhanceApp: (App: React.ComponentType<React.ComponentProps<AppType>>) => (props: any) => JSX.Element; | ||
enhanceApp: (App: React.ComponentType<React.ComponentProps<AppType>>) => (props: any) => React.JSX.Element; | ||
resolveProps: (initialProps: DocumentInitialProps) => Promise<DocumentInitialProps>; | ||
@@ -15,3 +15,3 @@ } | ||
export interface DocumentHeadTagsProps { | ||
emotionStyleTags: React.ReactElement[]; | ||
emotionStyleTags: React.ReactElement<any>[]; | ||
} | ||
@@ -23,4 +23,4 @@ export declare function DocumentHeadTags(props: DocumentHeadTagsProps): React.JSX.Element; | ||
}): Promise<import("next/dist/shared/lib/utils").RenderPageResult & { | ||
styles?: React.ReactFragment | JSX.Element | React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | undefined; | ||
styles?: React.ReactElement[] | React.ReactFragment | JSX.Element; | ||
} & DocumentHeadTagsProps>; | ||
export {}; |
@@ -1,2 +0,1 @@ | ||
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
var _meta; | ||
@@ -6,3 +5,3 @@ import * as React from 'react'; | ||
import Document from 'next/document'; | ||
import createEmotionCache from './createCache'; | ||
import createEmotionCache from "./createCache.js"; | ||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; | ||
@@ -67,5 +66,6 @@ /** | ||
enhanceApp: App => function EnhanceApp(props) { | ||
return /*#__PURE__*/_jsx(App, _extends({ | ||
emotionCache: cache | ||
}, props)); | ||
return /*#__PURE__*/_jsx(App, { | ||
emotionCache: cache, | ||
...props | ||
}); | ||
}, | ||
@@ -76,3 +76,4 @@ resolveProps: async initialProps => { | ||
} = extractCriticalToChunks(initialProps.html); | ||
return _extends({}, initialProps, { | ||
return { | ||
...initialProps, | ||
emotionStyleTags: styles.map(style => /*#__PURE__*/_jsx("style", { | ||
@@ -85,5 +86,5 @@ "data-emotion": `${style.key} ${style.ids.join(' ')}`, | ||
}, style.key)) | ||
}); | ||
}; | ||
} | ||
}, ...(options?.plugins ?? [])])(ctx); | ||
} |
@@ -1,1 +0,1 @@ | ||
export * from '../v13-appRouter'; | ||
export * from "../v13-appRouter/index.js"; |
@@ -1,1 +0,1 @@ | ||
export * from '../v13-pagesRouter'; | ||
export * from "../v13-pagesRouter/index.js"; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
889026
817
0
0
+ Added@babel/code-frame@7.24.7(transitive)
+ Added@babel/generator@7.25.6(transitive)
+ Added@babel/helper-module-imports@7.24.7(transitive)
+ Added@babel/helper-string-parser@7.24.8(transitive)
+ Added@babel/helper-validator-identifier@7.24.7(transitive)
+ Added@babel/highlight@7.24.7(transitive)
+ Added@babel/parser@7.25.6(transitive)
+ Added@babel/template@7.25.0(transitive)
+ Added@babel/traverse@7.25.6(transitive)
+ Added@babel/types@7.25.6(transitive)
+ Added@emotion/babel-plugin@11.12.0(transitive)
+ Added@emotion/hash@0.9.2(transitive)
+ Added@emotion/react@11.13.3(transitive)
+ Added@emotion/serialize@1.3.1(transitive)
+ Added@emotion/unitless@0.10.0(transitive)
+ Added@emotion/use-insertion-effect-with-fallbacks@1.1.0(transitive)
+ Added@jridgewell/gen-mapping@0.3.5(transitive)
+ Added@jridgewell/resolve-uri@3.1.2(transitive)
+ Added@jridgewell/set-array@1.2.1(transitive)
+ Added@jridgewell/sourcemap-codec@1.5.0(transitive)
+ Added@jridgewell/trace-mapping@0.3.25(transitive)
+ Added@types/parse-json@4.0.2(transitive)
+ Addedansi-styles@3.2.1(transitive)
+ Addedbabel-plugin-macros@3.1.0(transitive)
+ Addedcallsites@3.1.0(transitive)
+ Addedchalk@2.4.2(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedconvert-source-map@1.9.0(transitive)
+ Addedcosmiconfig@7.1.0(transitive)
+ Addeddebug@4.3.7(transitive)
+ Addederror-ex@1.3.2(transitive)
+ Addedescape-string-regexp@1.0.54.0.0(transitive)
+ Addedfind-root@1.1.0(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedglobals@11.12.0(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhoist-non-react-statics@3.3.2(transitive)
+ Addedimport-fresh@3.3.0(transitive)
+ Addedis-arrayish@0.2.1(transitive)
+ Addedis-core-module@2.15.1(transitive)
+ Addedjsesc@2.5.2(transitive)
+ Addedjson-parse-even-better-errors@2.3.1(transitive)
+ Addedlines-and-columns@1.2.4(transitive)
+ Addedms@2.1.3(transitive)
+ Addedparent-module@1.0.1(transitive)
+ Addedparse-json@5.2.0(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedpath-type@4.0.0(transitive)
+ Addedresolve@1.22.8(transitive)
+ Addedresolve-from@4.0.0(transitive)
+ Addedsource-map@0.5.7(transitive)
+ Addedsupports-color@5.5.0(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedto-fast-properties@2.0.0(transitive)
+ Addedyaml@1.10.2(transitive)
- Removed@mui/core-downloads-tracker@6.1.0(transitive)
- Removed@mui/material@6.1.0(transitive)
- Removed@mui/private-theming@6.1.0(transitive)
- Removed@mui/styled-engine@6.1.0(transitive)
- Removed@mui/system@6.1.0(transitive)
- Removed@mui/types@7.2.16(transitive)
- Removed@mui/utils@6.1.0(transitive)
- Removed@popperjs/core@2.11.8(transitive)
- Removed@types/react-transition-group@4.4.11(transitive)
- Removedclsx@2.1.1(transitive)
- Removeddom-helpers@5.2.1(transitive)
- Removedprop-types@15.8.1(transitive)
- Removedreact-is@18.3.1(transitive)
- Removedreact-transition-group@4.4.5(transitive)
Updated@babel/runtime@^7.25.0