@mui/material-nextjs 5.15.3 → 5.15.4

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 (65) hide show
  1. package/{CHANGELOG.md → build/CHANGELOG.md} +86 -1
  2. package/build/README.md +3 -0
  3. package/build/legacy/v13-pagesRouter/createCache.js +17 -0
  4. package/build/legacy/v13-pagesRouter/index.js +2 -0
  5. package/build/legacy/v13-pagesRouter/pagesRouterV13App.js +14 -0
  6. package/{legacy/v13-pagesRouter/pagesRouterV13.js → build/legacy/v13-pagesRouter/pagesRouterV13Document.js} +5 -32
  7. package/build/modern/v13-pagesRouter/createCache.js +17 -0
  8. package/build/modern/v13-pagesRouter/index.js +2 -0
  9. package/build/modern/v13-pagesRouter/pagesRouterV13App.js +14 -0
  10. package/{modern/v13-pagesRouter/pagesRouterV13.js → build/modern/v13-pagesRouter/pagesRouterV13Document.js} +1 -28
  11. package/build/node/v13-pagesRouter/createCache.js +24 -0
  12. package/build/node/v13-pagesRouter/index.js +27 -0
  13. package/build/node/v13-pagesRouter/pagesRouterV13App.js +23 -0
  14. package/{node/v13-pagesRouter/pagesRouterV13.js → build/node/v13-pagesRouter/pagesRouterV13Document.js} +2 -30
  15. package/build/package.json +52 -0
  16. package/build/v13-pagesRouter/createCache.d.ts +1 -0
  17. package/build/v13-pagesRouter/createCache.js +17 -0
  18. package/build/v13-pagesRouter/index.d.ts +2 -0
  19. package/build/v13-pagesRouter/index.js +2 -0
  20. package/build/v13-pagesRouter/pagesRouterV13App.d.ts +6 -0
  21. package/build/v13-pagesRouter/pagesRouterV13App.js +14 -0
  22. package/{v13-pagesRouter/pagesRouterV13.d.ts → build/v13-pagesRouter/pagesRouterV13Document.d.ts} +0 -4
  23. package/{v13-pagesRouter/pagesRouterV13.js → build/v13-pagesRouter/pagesRouterV13Document.js} +1 -28
  24. package/package.json +22 -1
  25. package/src/v13-appRouter/appRouterV13.tsx +102 -0
  26. package/src/v13-appRouter/index.ts +3 -0
  27. package/src/v13-pagesRouter/createCache.ts +19 -0
  28. package/src/v13-pagesRouter/index.ts +2 -0
  29. package/src/v13-pagesRouter/pagesRouterV13App.tsx +16 -0
  30. package/src/v13-pagesRouter/pagesRouterV13Document.tsx +115 -0
  31. package/src/v14-appRouter/index.ts +2 -0
  32. package/src/v14-pagesRouter/index.ts +1 -0
  33. package/tsconfig.build.json +15 -0
  34. package/tsconfig.build.tsbuildinfo +1 -0
  35. package/tsconfig.json +7 -0
  36. package/legacy/v13-pagesRouter/index.js +0 -1
  37. package/modern/v13-pagesRouter/index.js +0 -1
  38. package/node/v13-pagesRouter/index.js +0 -16
  39. package/v13-pagesRouter/index.d.ts +0 -1
  40. package/v13-pagesRouter/index.js +0 -1
  41. /package/{LICENSE → build/LICENSE} +0 -0
  42. /package/{legacy → build/legacy}/v13-appRouter/appRouterV13.js +0 -0
  43. /package/{legacy → build/legacy}/v13-appRouter/index.js +0 -0
  44. /package/{legacy → build/legacy}/v14-appRouter/index.js +0 -0
  45. /package/{legacy → build/legacy}/v14-pagesRouter/index.js +0 -0
  46. /package/{modern → build/modern}/v13-appRouter/appRouterV13.js +0 -0
  47. /package/{modern → build/modern}/v13-appRouter/index.js +0 -0
  48. /package/{modern → build/modern}/v14-appRouter/index.js +0 -0
  49. /package/{modern → build/modern}/v14-pagesRouter/index.js +0 -0
  50. /package/{node → build/node}/v13-appRouter/appRouterV13.js +0 -0
  51. /package/{node → build/node}/v13-appRouter/index.js +0 -0
  52. /package/{node → build/node}/v14-appRouter/index.js +0 -0
  53. /package/{node → build/node}/v14-pagesRouter/index.js +0 -0
  54. /package/{v13-appRouter → build/v13-appRouter}/appRouterV13.d.ts +0 -0
  55. /package/{v13-appRouter → build/v13-appRouter}/appRouterV13.js +0 -0
  56. /package/{v13-appRouter → build/v13-appRouter}/index.d.ts +0 -0
  57. /package/{v13-appRouter → build/v13-appRouter}/index.js +0 -0
  58. /package/{v13-appRouter → build/v13-appRouter}/package.json +0 -0
  59. /package/{v13-pagesRouter → build/v13-pagesRouter}/package.json +0 -0
  60. /package/{v14-appRouter → build/v14-appRouter}/index.d.ts +0 -0
  61. /package/{v14-appRouter → build/v14-appRouter}/index.js +0 -0
  62. /package/{v14-appRouter → build/v14-appRouter}/package.json +0 -0
  63. /package/{v14-pagesRouter → build/v14-pagesRouter}/index.d.ts +0 -0
  64. /package/{v14-pagesRouter → build/v14-pagesRouter}/index.js +0 -0
  65. /package/{v14-pagesRouter → build/v14-pagesRouter}/package.json +0 -0
@@ -1,5 +1,90 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 5.15.4
4
+
5
+ <!-- generated comparing v5.15.3..master -->
6
+
7
+ _Jan 10, 2024_
8
+
9
+ A big thanks to the 22 contributors who made this release possible. Here are some highlights:
10
+
11
+ - ✨ Material UI's [ToggleButtonGroup](https://mui.com/material-ui/react-toggle-button/) now supports non-button element as a child (e.g., showing a Tooltip on a disabled ToggleButton) (#40220) @Methuselah96
12
+
13
+ ### `@mui/material@5.15.4`
14
+
15
+ - [TextField][FormLabel][InputLabel][FormControl] Use exact children type to allow React children type augmentation (#38872) @nicegamer7
16
+ - [Select] Add form submission regression test (#40176) @mj12albert
17
+ - [ToggleButtonGroup] Support different elements under it (#40220) @Methuselah96
18
+ - [ClickAwayListener] Fix export of types (#40485) @illume
19
+
20
+ ### `@mui/material-nextjs@5.15.4`
21
+
22
+ - Improve build size issue (#40436) @siriwatknp
23
+
24
+ ### `@mui/icons-material@5.15.4`
25
+
26
+ - Update the icons (#40365) @michaldudak
27
+
28
+ ### `@mui/system@5.15.4`
29
+
30
+ - [zero] Move zero runtime related packages (#40426) @brijeshb42
31
+ - Fix all use of styled(Box) (#40449) @oliviertassinari
32
+
33
+ ### `@mui/utils@5.15.4`
34
+
35
+ - Fix `isPlainObject` to work across realm (#39981) @brijeshb42
36
+
37
+ ### `@mui/base@5.0.0-beta.31`
38
+
39
+ - [base-ui][NumberInput] Remove inputId and inputRef types from NumberInput component (#40425) @sai6855
40
+
41
+ ### `@mui/joy@5.0.0-beta.22`
42
+
43
+ - [Badge] Shouldn't crash when using custom size (#39986) @iamsaumya
44
+ - [ToggleButtonGroup] Add `JoyToggleButtonGroup` to extendTheme's components type export (#40407) @RiceCrisp
45
+
46
+ ### Docs
47
+
48
+ - [base-ui] Visual tweaks to the plain CSS theme stylesheet (#40487) @zanivan
49
+ - [base-ui] Add tokens to plain CSS theme stylesheet (#40113) @zanivan
50
+ - [base-ui] Update the overview page (#40412) @danilo-leal
51
+ - [material-ui][Drawer] Resolve flickering when double-clicking on the backdrop to close it (#40343) @aacevski
52
+ - [material-ui] Refactor form submission in FormDialog component (#40470) @sai6855
53
+ - [material-ui] Replace recharts with MUI X charts on the Dashboard template (#40107) @alexfauquette
54
+ - [material-ui] Revise the Alert demo page (#34892) @samuelsycamore
55
+ - [material-ui] Revise the Accordion page (#40284) @anle9650
56
+ - [material-ui] Add docs for complementary Card components (#40346) @anle9650
57
+ - [material-ui] Add Material 3 components page (#40350) @DiegoAndai
58
+ - Fix strange italic style @oliviertassinari
59
+ - Fix references to ESLint @oliviertassinari
60
+ - Fix 301 redirections @oliviertassinari
61
+ - Right-to-left revision and addition to Joy UI (#39158) @danilo-leal
62
+
63
+ ### Core
64
+
65
+ - [examples] Use material-nextjs integration package (#40199) @siriwatknp
66
+ - [code-infra] Configure build dependencies in nx (#40482) @michaldudak
67
+ - [code-infra] Don't require noreferrer on target link (#40447) @oliviertassinari
68
+ - [code-infra] Use tsx instead of ts-node (#40428) @michaldudak
69
+ - [code-infra] Add options to docs-api generation to support X code structure (#40111) @alexfauquette
70
+ - [docs-infra] Add types for withDocsInfra (#40301) @oliviertassinari
71
+ - [docs-infra] Fix anchor links in API pages (#40450) @oliviertassinari
72
+ - [docs-infra] Fix API table full-width (#40476) @oliviertassinari
73
+ - [docs-infra] Fix the copy button overlapping with the scrollbar (#40405) @danilo-leal
74
+ - [docs-infra] Remove explicit `mui-x` dependency resolving (#40257) @LukasTy
75
+ - [docs-infra] Update the outlined Demo container dark mode color (#40488) @danilo-leal
76
+ - [core] Lock file maintenance (#34538) @renovate[bot]
77
+ - [core] Remove duplicate devDependencies (#40438) @michaldudak
78
+ - [core] Remove issue emoji @oliviertassinari
79
+ - [core] Move prefetch at the core, will propagate to MUI X @oliviertassinari
80
+ - [core] Change package manager to pnpm (#36287) @Janpot
81
+ - [core][docs] Remove the "Understand MUI packages" page (#39835) @savalaram-redkar
82
+ - [website] Evolve the Developer Advocate role (#40337) @oliviertassinari
83
+ - [website] Fix default social card @oliviertassinari
84
+ - [test] Restore the `t` command (#40430) @michaldudak
85
+
86
+ All contributors of this release in alphabetical order: @aacevski, @alexfauquette, @anle9650, @brijeshb42, @danilo-leal, @DiegoAndai, @iamsaumya, @illume, @Janpot, @LukasTy, @Methuselah96, @michaldudak, @mj12albert, @nicegamer7, @oliviertassinari, @renovate[bot], @RiceCrisp, @sai6855, @samuelsycamore, @savalaram-redkar, @siriwatknp, @zanivan
87
+
3
88
  ## 5.15.3
4
89
 
5
90
  <!-- generated comparing v5.15.2..master -->
@@ -12480,7 +12565,7 @@ Here are some highlights ✨:
12480
12565
 
12481
12566
  - 👩‍🎨 A first iteration on the new styling solution.
12482
12567
 
12483
- You can find a [new version](https://mui.com/components/slider-styled/) of the slider in the lab powered by [emotion](https://emotion.sh/).
12568
+ You can find a [new version](https://mui.com/components/slider-styled/) of the slider in the lab powered by [Emotion](https://emotion.sh/).
12484
12569
 
12485
12570
  In the event that you are already using styled-components in your application, you can swap emotion for styled-components 💅. Check [this CodeSandbox](https://codesandbox.io/p/sandbox/sliderstyled-with-styled-components-forked-olc27?file=/package.json) for a demo. It relies on aliases to prevent any bundle size overhead.
12486
12571
 
@@ -0,0 +1,3 @@
1
+ # @mui/material-nextjs
2
+
3
+ The official Material UI integration with Next.js. For the full documentation, visit [Next.js integration](https://mui.com/material-ui/guides/nextjs/) page.
@@ -0,0 +1,17 @@
1
+ import createCache from '@emotion/cache';
2
+ var isBrowser = typeof document !== 'undefined';
3
+
4
+ // On the client side, Create a meta tag at the top of the <head> and set it as insertionPoint.
5
+ // This assures that MUI styles are loaded first.
6
+ // It allows developers to easily override MUI styles with other styling solutions, like CSS modules.
7
+ export default function createEmotionCache() {
8
+ var insertionPoint;
9
+ if (isBrowser) {
10
+ var emotionInsertionPoint = document.querySelector('meta[name="emotion-insertion-point"]');
11
+ insertionPoint = emotionInsertionPoint != null ? emotionInsertionPoint : undefined;
12
+ }
13
+ return createCache({
14
+ key: 'mui',
15
+ insertionPoint: insertionPoint
16
+ });
17
+ }
@@ -0,0 +1,2 @@
1
+ export * from './pagesRouterV13Document';
2
+ export * from './pagesRouterV13App';
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ import { CacheProvider } from '@emotion/react';
3
+ import createEmotionCache from './createCache';
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ var defaultEmotionCache = createEmotionCache();
6
+ export function AppCacheProvider(_ref) {
7
+ var _ref$emotionCache = _ref.emotionCache,
8
+ emotionCache = _ref$emotionCache === void 0 ? defaultEmotionCache : _ref$emotionCache,
9
+ children = _ref.children;
10
+ return /*#__PURE__*/_jsx(CacheProvider, {
11
+ value: emotionCache,
12
+ children: children
13
+ });
14
+ }
@@ -4,38 +4,11 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
4
4
  var _meta;
5
5
  import _regeneratorRuntime from "@babel/runtime/regenerator";
6
6
  import * as React from 'react';
7
- import { CacheProvider } from '@emotion/react';
8
- import createCache from '@emotion/cache';
9
7
  import createEmotionServer from '@emotion/server/create-instance';
10
8
  import Document from 'next/document';
9
+ import createEmotionCache from './createCache';
11
10
  import { jsx as _jsx } from "react/jsx-runtime";
12
11
  import { jsxs as _jsxs } from "react/jsx-runtime";
13
- var isBrowser = typeof document !== 'undefined';
14
-
15
- // On the client side, Create a meta tag at the top of the <head> and set it as insertionPoint.
16
- // This assures that MUI styles are loaded first.
17
- // It allows developers to easily override MUI styles with other styling solutions, like CSS modules.
18
- function createEmotionCache() {
19
- var insertionPoint;
20
- if (isBrowser) {
21
- var emotionInsertionPoint = document.querySelector('meta[name="emotion-insertion-point"]');
22
- insertionPoint = emotionInsertionPoint != null ? emotionInsertionPoint : undefined;
23
- }
24
- return createCache({
25
- key: 'mui',
26
- insertionPoint: insertionPoint
27
- });
28
- }
29
- var defaultEmotionCache = createEmotionCache();
30
- export function AppCacheProvider(_ref) {
31
- var _ref$emotionCache = _ref.emotionCache,
32
- emotionCache = _ref$emotionCache === void 0 ? defaultEmotionCache : _ref$emotionCache,
33
- children = _ref.children;
34
- return /*#__PURE__*/_jsx(CacheProvider, {
35
- value: emotionCache,
36
- children: children
37
- });
38
- }
39
12
  /**
40
13
  * A utility to compose multiple `getInitialProps` functions.
41
14
  */
@@ -62,7 +35,7 @@ export function createGetInitialProps(plugins) {
62
35
  initialProps = _context2.sent;
63
36
  _context2.next = 7;
64
37
  return plugins.reduce( /*#__PURE__*/function () {
65
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(result, plugin) {
38
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(result, plugin) {
66
39
  return _regeneratorRuntime.wrap(function _callee$(_context) {
67
40
  while (1) switch (_context.prev = _context.next) {
68
41
  case 0:
@@ -79,7 +52,7 @@ export function createGetInitialProps(plugins) {
79
52
  }, _callee);
80
53
  }));
81
54
  return function (_x2, _x3) {
82
- return _ref2.apply(this, arguments);
55
+ return _ref.apply(this, arguments);
83
56
  };
84
57
  }(), Promise.resolve(initialProps));
85
58
  case 7:
@@ -97,8 +70,8 @@ export function createGetInitialProps(plugins) {
97
70
  return getInitialProps;
98
71
  }();
99
72
  }
100
- export function DocumentHeadTags(_ref3) {
101
- var emotionStyleTags = _ref3.emotionStyleTags;
73
+ export function DocumentHeadTags(_ref2) {
74
+ var emotionStyleTags = _ref2.emotionStyleTags;
102
75
  return /*#__PURE__*/_jsxs(React.Fragment, {
103
76
  children: [_meta || (_meta = /*#__PURE__*/_jsx("meta", {
104
77
  name: "emotion-insertion-point",
@@ -0,0 +1,17 @@
1
+ import createCache from '@emotion/cache';
2
+ const isBrowser = typeof document !== 'undefined';
3
+
4
+ // On the client side, Create a meta tag at the top of the <head> and set it as insertionPoint.
5
+ // This assures that MUI styles are loaded first.
6
+ // It allows developers to easily override MUI styles with other styling solutions, like CSS modules.
7
+ export default function createEmotionCache() {
8
+ let insertionPoint;
9
+ if (isBrowser) {
10
+ const emotionInsertionPoint = document.querySelector('meta[name="emotion-insertion-point"]');
11
+ insertionPoint = emotionInsertionPoint ?? undefined;
12
+ }
13
+ return createCache({
14
+ key: 'mui',
15
+ insertionPoint
16
+ });
17
+ }
@@ -0,0 +1,2 @@
1
+ export * from './pagesRouterV13Document';
2
+ export * from './pagesRouterV13App';
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ import { CacheProvider } from '@emotion/react';
3
+ import createEmotionCache from './createCache';
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
+ }
@@ -1,38 +1,11 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  var _meta;
3
3
  import * as React from 'react';
4
- import { CacheProvider } from '@emotion/react';
5
- import createCache from '@emotion/cache';
6
4
  import createEmotionServer from '@emotion/server/create-instance';
7
5
  import Document from 'next/document';
6
+ import createEmotionCache from './createCache';
8
7
  import { jsx as _jsx } from "react/jsx-runtime";
9
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
10
- const isBrowser = typeof document !== 'undefined';
11
-
12
- // On the client side, Create a meta tag at the top of the <head> and set it as insertionPoint.
13
- // This assures that MUI styles are loaded first.
14
- // It allows developers to easily override MUI styles with other styling solutions, like CSS modules.
15
- function createEmotionCache() {
16
- let insertionPoint;
17
- if (isBrowser) {
18
- const emotionInsertionPoint = document.querySelector('meta[name="emotion-insertion-point"]');
19
- insertionPoint = emotionInsertionPoint ?? undefined;
20
- }
21
- return createCache({
22
- key: 'mui',
23
- insertionPoint
24
- });
25
- }
26
- const defaultEmotionCache = createEmotionCache();
27
- export function AppCacheProvider({
28
- emotionCache = defaultEmotionCache,
29
- children
30
- }) {
31
- return /*#__PURE__*/_jsx(CacheProvider, {
32
- value: emotionCache,
33
- children: children
34
- });
35
- }
36
9
  /**
37
10
  * A utility to compose multiple `getInitialProps` functions.
38
11
  */
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = createEmotionCache;
8
+ var _cache = _interopRequireDefault(require("@emotion/cache"));
9
+ const isBrowser = typeof document !== 'undefined';
10
+
11
+ // On the client side, Create a meta tag at the top of the <head> and set it as insertionPoint.
12
+ // This assures that MUI styles are loaded first.
13
+ // It allows developers to easily override MUI styles with other styling solutions, like CSS modules.
14
+ function createEmotionCache() {
15
+ let insertionPoint;
16
+ if (isBrowser) {
17
+ const emotionInsertionPoint = document.querySelector('meta[name="emotion-insertion-point"]');
18
+ insertionPoint = emotionInsertionPoint != null ? emotionInsertionPoint : undefined;
19
+ }
20
+ return (0, _cache.default)({
21
+ key: 'mui',
22
+ insertionPoint
23
+ });
24
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _pagesRouterV13Document = require("./pagesRouterV13Document");
7
+ Object.keys(_pagesRouterV13Document).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _pagesRouterV13Document[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _pagesRouterV13Document[key];
14
+ }
15
+ });
16
+ });
17
+ var _pagesRouterV13App = require("./pagesRouterV13App");
18
+ Object.keys(_pagesRouterV13App).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _pagesRouterV13App[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _pagesRouterV13App[key];
25
+ }
26
+ });
27
+ });
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.AppCacheProvider = AppCacheProvider;
8
+ var React = _interopRequireWildcard(require("react"));
9
+ var _react2 = require("@emotion/react");
10
+ var _createCache = _interopRequireDefault(require("./createCache"));
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
13
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
+ const defaultEmotionCache = (0, _createCache.default)();
15
+ function AppCacheProvider({
16
+ emotionCache = defaultEmotionCache,
17
+ children
18
+ }) {
19
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.CacheProvider, {
20
+ value: emotionCache,
21
+ children: children
22
+ });
23
+ }
@@ -4,46 +4,18 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.AppCacheProvider = AppCacheProvider;
8
7
  exports.DocumentHeadTags = DocumentHeadTags;
9
8
  exports.createGetInitialProps = createGetInitialProps;
10
9
  exports.documentGetInitialProps = documentGetInitialProps;
11
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
12
11
  var React = _interopRequireWildcard(require("react"));
13
- var _react2 = require("@emotion/react");
14
- var _cache = _interopRequireDefault(require("@emotion/cache"));
15
12
  var _createInstance = _interopRequireDefault(require("@emotion/server/create-instance"));
16
13
  var _document = _interopRequireDefault(require("next/document"));
14
+ var _createCache = _interopRequireDefault(require("./createCache"));
17
15
  var _jsxRuntime = require("react/jsx-runtime");
18
16
  var _meta;
19
17
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
20
18
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
21
- const isBrowser = typeof document !== 'undefined';
22
-
23
- // On the client side, Create a meta tag at the top of the <head> and set it as insertionPoint.
24
- // This assures that MUI styles are loaded first.
25
- // It allows developers to easily override MUI styles with other styling solutions, like CSS modules.
26
- function createEmotionCache() {
27
- let insertionPoint;
28
- if (isBrowser) {
29
- const emotionInsertionPoint = document.querySelector('meta[name="emotion-insertion-point"]');
30
- insertionPoint = emotionInsertionPoint != null ? emotionInsertionPoint : undefined;
31
- }
32
- return (0, _cache.default)({
33
- key: 'mui',
34
- insertionPoint
35
- });
36
- }
37
- const defaultEmotionCache = createEmotionCache();
38
- function AppCacheProvider({
39
- emotionCache = defaultEmotionCache,
40
- children
41
- }) {
42
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.CacheProvider, {
43
- value: emotionCache,
44
- children: children
45
- });
46
- }
47
19
  /**
48
20
  * A utility to compose multiple `getInitialProps` functions.
49
21
  */
@@ -97,7 +69,7 @@ async function documentGetInitialProps(ctx, options) {
97
69
 
98
70
  // You can consider sharing the same Emotion cache between all the SSR requests to speed up performance.
99
71
  // However, be aware that it can have global side effects.
100
- const cache = (_options$emotionCache = options == null ? void 0 : options.emotionCache) != null ? _options$emotionCache : createEmotionCache();
72
+ const cache = (_options$emotionCache = options == null ? void 0 : options.emotionCache) != null ? _options$emotionCache : (0, _createCache.default)();
101
73
  // The createEmotionServer has to be called directly after the cache creation due to the side effect of cache.compat = true,
102
74
  // otherwise the <style> tag will not come with the HTML string from the server.
103
75
  const {
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@mui/material-nextjs",
3
+ "version": "5.15.4",
4
+ "private": false,
5
+ "author": "MUI Team",
6
+ "description": "Collection of utilities for integration between Material UI and Next.js.",
7
+ "keywords": [
8
+ "react",
9
+ "next",
10
+ "material-ui"
11
+ ],
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/mui/material-ui.git",
15
+ "directory": "packages/mui-material-nextjs"
16
+ },
17
+ "license": "MIT",
18
+ "bugs": {
19
+ "url": "https://github.com/mui/material-ui/issues"
20
+ },
21
+ "homepage": "https://mui.com/material-ui/guides/nextjs/",
22
+ "funding": {
23
+ "type": "opencollective",
24
+ "url": "https://opencollective.com/mui-org"
25
+ },
26
+ "peerDependencies": {
27
+ "@emotion/cache": "^11.11.0",
28
+ "@emotion/server": "^11.11.0",
29
+ "@mui/material": "^5.0.0",
30
+ "@types/react": "^17.0.0 || ^18.0.0",
31
+ "next": "^13.0.0 || ^14.0.0",
32
+ "react": "^17.0.0 || ^18.0.0"
33
+ },
34
+ "peerDependenciesMeta": {
35
+ "@types/react": {
36
+ "optional": true
37
+ },
38
+ "@emotion/cache": {
39
+ "optional": true
40
+ },
41
+ "@emotion/server": {
42
+ "optional": true
43
+ }
44
+ },
45
+ "sideEffects": false,
46
+ "publishConfig": {
47
+ "access": "public"
48
+ },
49
+ "engines": {
50
+ "node": ">=12.0.0"
51
+ }
52
+ }
@@ -0,0 +1 @@
1
+ export default function createEmotionCache(): import("@emotion/cache").EmotionCache;
@@ -0,0 +1,17 @@
1
+ import createCache from '@emotion/cache';
2
+ const isBrowser = typeof document !== 'undefined';
3
+
4
+ // On the client side, Create a meta tag at the top of the <head> and set it as insertionPoint.
5
+ // This assures that MUI styles are loaded first.
6
+ // It allows developers to easily override MUI styles with other styling solutions, like CSS modules.
7
+ export default function createEmotionCache() {
8
+ let insertionPoint;
9
+ if (isBrowser) {
10
+ const emotionInsertionPoint = document.querySelector('meta[name="emotion-insertion-point"]');
11
+ insertionPoint = emotionInsertionPoint != null ? emotionInsertionPoint : undefined;
12
+ }
13
+ return createCache({
14
+ key: 'mui',
15
+ insertionPoint
16
+ });
17
+ }
@@ -0,0 +1,2 @@
1
+ export * from './pagesRouterV13Document';
2
+ export * from './pagesRouterV13App';
@@ -0,0 +1,2 @@
1
+ export * from './pagesRouterV13Document';
2
+ export * from './pagesRouterV13App';
@@ -0,0 +1,6 @@
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({ emotionCache, children, }: 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';
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
+ }
@@ -2,10 +2,6 @@ import * as React from 'react';
2
2
  import { AppType } from 'next/app';
3
3
  import { EmotionCache } from '@emotion/react';
4
4
  import { DocumentContext, DocumentInitialProps } from 'next/document';
5
- interface EmotionCacheProviderProps {
6
- emotionCache?: EmotionCache;
7
- }
8
- export declare function AppCacheProvider({ emotionCache, children, }: React.PropsWithChildren<EmotionCacheProviderProps>): React.JSX.Element;
9
5
  interface Plugin {
10
6
  enhanceApp: (App: React.ComponentType<React.ComponentProps<AppType>>) => (props: any) => JSX.Element;
11
7
  resolveProps: (initialProps: DocumentInitialProps) => Promise<DocumentInitialProps>;
@@ -1,38 +1,11 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  var _meta;
3
3
  import * as React from 'react';
4
- import { CacheProvider } from '@emotion/react';
5
- import createCache from '@emotion/cache';
6
4
  import createEmotionServer from '@emotion/server/create-instance';
7
5
  import Document from 'next/document';
6
+ import createEmotionCache from './createCache';
8
7
  import { jsx as _jsx } from "react/jsx-runtime";
9
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
10
- const isBrowser = typeof document !== 'undefined';
11
-
12
- // On the client side, Create a meta tag at the top of the <head> and set it as insertionPoint.
13
- // This assures that MUI styles are loaded first.
14
- // It allows developers to easily override MUI styles with other styling solutions, like CSS modules.
15
- function createEmotionCache() {
16
- let insertionPoint;
17
- if (isBrowser) {
18
- const emotionInsertionPoint = document.querySelector('meta[name="emotion-insertion-point"]');
19
- insertionPoint = emotionInsertionPoint != null ? emotionInsertionPoint : undefined;
20
- }
21
- return createCache({
22
- key: 'mui',
23
- insertionPoint
24
- });
25
- }
26
- const defaultEmotionCache = createEmotionCache();
27
- export function AppCacheProvider({
28
- emotionCache = defaultEmotionCache,
29
- children
30
- }) {
31
- return /*#__PURE__*/_jsx(CacheProvider, {
32
- value: emotionCache,
33
- children: children
34
- });
35
- }
36
9
  /**
37
10
  * A utility to compose multiple `getInitialProps` functions.
38
11
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/material-nextjs",
3
- "version": "5.15.3",
3
+ "version": "5.15.4",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "Collection of utilities for integration between Material UI and Next.js.",
@@ -23,6 +23,14 @@
23
23
  "type": "opencollective",
24
24
  "url": "https://opencollective.com/mui-org"
25
25
  },
26
+ "devDependencies": {
27
+ "@emotion/cache": "^11.11.0",
28
+ "@emotion/react": "^11.11.3",
29
+ "@emotion/server": "^11.11.0",
30
+ "@types/react": "^18.2.46",
31
+ "next": "13.4.19",
32
+ "react": "^18.2.0"
33
+ },
26
34
  "peerDependencies": {
27
35
  "@emotion/cache": "^11.11.0",
28
36
  "@emotion/server": "^11.11.0",
@@ -48,5 +56,18 @@
48
56
  },
49
57
  "engines": {
50
58
  "node": ">=12.0.0"
59
+ },
60
+ "scripts": {
61
+ "build": "pnpm build:legacy && pnpm build:modern && pnpm build:node && pnpm build:stable && pnpm build:types && pnpm build:copy-files",
62
+ "build:legacy": "node ../../scripts/build.mjs legacy",
63
+ "build:modern": "node ../../scripts/build.mjs modern",
64
+ "build:node": "node ../../scripts/build.mjs node",
65
+ "build:stable": "node ../../scripts/build.mjs stable",
66
+ "build:copy-files": "node ../../scripts/copyFiles.mjs",
67
+ "build:types": "node ../../scripts/buildTypes.mjs",
68
+ "prebuild": "rimraf build tsconfig.build.tsbuildinfo",
69
+ "release": "pnpm build && npm publish build",
70
+ "test": "cd ../../ && cross-env NODE_ENV=test mocha 'packages/mui-utils/**/*.test.{js,ts,tsx}'",
71
+ "typescript": "tsc -p tsconfig.json"
51
72
  }
52
73
  }