@mui/material-nextjs 5.15.0

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 (38) hide show
  1. package/CHANGELOG.md +13738 -0
  2. package/LICENSE +21 -0
  3. package/README.md +3 -0
  4. package/legacy/v13-appRouter/appRouterV13.js +101 -0
  5. package/legacy/v13-appRouter/index.js +4 -0
  6. package/legacy/v13-pagesRouter/index.js +1 -0
  7. package/legacy/v13-pagesRouter/pagesRouterV13.js +192 -0
  8. package/legacy/v14-appRouter/index.js +3 -0
  9. package/legacy/v14-pagesRouter/index.js +1 -0
  10. package/modern/v13-appRouter/appRouterV13.js +96 -0
  11. package/modern/v13-appRouter/index.js +4 -0
  12. package/modern/v13-pagesRouter/index.js +1 -0
  13. package/modern/v13-pagesRouter/pagesRouterV13.js +113 -0
  14. package/modern/v14-appRouter/index.js +3 -0
  15. package/modern/v14-pagesRouter/index.js +1 -0
  16. package/node/v13-appRouter/appRouterV13.js +104 -0
  17. package/node/v13-appRouter/index.js +29 -0
  18. package/node/v13-pagesRouter/index.js +16 -0
  19. package/node/v13-pagesRouter/pagesRouterV13.js +125 -0
  20. package/node/v14-appRouter/index.js +17 -0
  21. package/node/v14-pagesRouter/index.js +16 -0
  22. package/package.json +53 -0
  23. package/v13-appRouter/appRouterV13.d.ts +19 -0
  24. package/v13-appRouter/appRouterV13.js +97 -0
  25. package/v13-appRouter/index.d.ts +2 -0
  26. package/v13-appRouter/index.js +4 -0
  27. package/v13-appRouter/package.json +6 -0
  28. package/v13-pagesRouter/index.d.ts +1 -0
  29. package/v13-pagesRouter/index.js +1 -0
  30. package/v13-pagesRouter/package.json +6 -0
  31. package/v13-pagesRouter/pagesRouterV13.d.ts +27 -0
  32. package/v13-pagesRouter/pagesRouterV13.js +114 -0
  33. package/v14-appRouter/index.d.ts +1 -0
  34. package/v14-appRouter/index.js +3 -0
  35. package/v14-appRouter/package.json +6 -0
  36. package/v14-pagesRouter/index.d.ts +1 -0
  37. package/v14-pagesRouter/index.js +1 -0
  38. package/v14-pagesRouter/package.json +6 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Call-Em-All
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # @mui/material-nextjs
2
+
3
+ The official integration of Material-UI with Next.js. For full documentation, visit [Next.js Integration](material-ui/guides/nextjs/) page.
@@ -0,0 +1,101 @@
1
+ 'use client';
2
+
3
+ import _extends from "@babel/runtime/helpers/esm/extends";
4
+ import * as React from 'react';
5
+ import createCache from '@emotion/cache';
6
+ import { useServerInsertedHTML } from 'next/navigation';
7
+ import { CacheProvider as DefaultCacheProvider } from '@emotion/react';
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ import { jsxs as _jsxs } from "react/jsx-runtime";
10
+ export default function AppRouterCacheProvider(props) {
11
+ var options = props.options,
12
+ _props$CacheProvider = props.CacheProvider,
13
+ CacheProvider = _props$CacheProvider === void 0 ? DefaultCacheProvider : _props$CacheProvider,
14
+ children = props.children;
15
+ var _React$useState = React.useState(function () {
16
+ var _options$key;
17
+ var cache = createCache(_extends({}, options, {
18
+ key: (_options$key = options == null ? void 0 : options.key) != null ? _options$key : 'mui'
19
+ }));
20
+ cache.compat = true;
21
+ var prevInsert = cache.insert;
22
+ var inserted = [];
23
+ cache.insert = function () {
24
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
25
+ args[_key] = arguments[_key];
26
+ }
27
+ if (options != null && options.enableCssLayer) {
28
+ args[1].styles = "@layer mui {".concat(args[1].styles, "}");
29
+ }
30
+ var selector = args[0],
31
+ serialized = args[1];
32
+ if (cache.inserted[serialized.name] === undefined) {
33
+ inserted.push({
34
+ name: serialized.name,
35
+ isGlobal: !selector
36
+ });
37
+ }
38
+ return prevInsert.apply(void 0, args);
39
+ };
40
+ var flush = function flush() {
41
+ var prevInserted = inserted;
42
+ inserted = [];
43
+ return prevInserted;
44
+ };
45
+ return {
46
+ cache: cache,
47
+ flush: flush
48
+ };
49
+ }),
50
+ registry = _React$useState[0];
51
+ useServerInsertedHTML(function () {
52
+ var inserted = registry.flush();
53
+ if (inserted.length === 0) {
54
+ return null;
55
+ }
56
+ var styles = '';
57
+ var dataEmotionAttribute = registry.cache.key;
58
+ var globals = [];
59
+ inserted.forEach(function (_ref) {
60
+ var name = _ref.name,
61
+ isGlobal = _ref.isGlobal;
62
+ var style = registry.cache.inserted[name];
63
+ if (typeof style !== 'boolean') {
64
+ if (isGlobal) {
65
+ globals.push({
66
+ name: name,
67
+ style: style
68
+ });
69
+ } else {
70
+ styles += style;
71
+ dataEmotionAttribute += " ".concat(name);
72
+ }
73
+ }
74
+ });
75
+ return /*#__PURE__*/_jsxs(React.Fragment, {
76
+ children: [globals.map(function (_ref2) {
77
+ var name = _ref2.name,
78
+ style = _ref2.style;
79
+ return /*#__PURE__*/_jsx("style", {
80
+ "data-emotion": "".concat(registry.cache.key, "-global ").concat(name)
81
+ // eslint-disable-next-line react/no-danger
82
+ ,
83
+ dangerouslySetInnerHTML: {
84
+ __html: style
85
+ }
86
+ }, name);
87
+ }), styles && /*#__PURE__*/_jsx("style", {
88
+ "data-emotion": dataEmotionAttribute
89
+ // eslint-disable-next-line react/no-danger
90
+ ,
91
+ dangerouslySetInnerHTML: {
92
+ __html: styles
93
+ }
94
+ })]
95
+ });
96
+ });
97
+ return /*#__PURE__*/_jsx(CacheProvider, {
98
+ value: registry.cache,
99
+ children: children
100
+ });
101
+ }
@@ -0,0 +1,4 @@
1
+ 'use client';
2
+
3
+ export { default as AppRouterCacheProvider } from './appRouterV13';
4
+ export * from './appRouterV13';
@@ -0,0 +1 @@
1
+ export * from './pagesRouterV13';
@@ -0,0 +1,192 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
4
+ var _meta;
5
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
6
+ import * as React from 'react';
7
+ import { CacheProvider } from '@emotion/react';
8
+ import createCache from '@emotion/cache';
9
+ import createEmotionServer from '@emotion/server/create-instance';
10
+ import Document from 'next/document';
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
+ 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
+ /**
40
+ * A utility to compose multiple `getInitialProps` functions.
41
+ */
42
+ export function createGetInitialProps(plugins) {
43
+ return /*#__PURE__*/function () {
44
+ var _getInitialProps = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(ctx) {
45
+ var originalRenderPage, initialProps, finalProps;
46
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
47
+ while (1) switch (_context2.prev = _context2.next) {
48
+ case 0:
49
+ originalRenderPage = ctx.renderPage;
50
+ ctx.renderPage = function () {
51
+ return originalRenderPage({
52
+ enhanceApp: function enhanceApp(App) {
53
+ return plugins.reduce(function (result, plugin) {
54
+ return plugin.enhanceApp(result);
55
+ }, App);
56
+ }
57
+ });
58
+ };
59
+ _context2.next = 4;
60
+ return Document.getInitialProps(ctx);
61
+ case 4:
62
+ initialProps = _context2.sent;
63
+ _context2.next = 7;
64
+ return plugins.reduce( /*#__PURE__*/function () {
65
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(result, plugin) {
66
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
67
+ while (1) switch (_context.prev = _context.next) {
68
+ case 0:
69
+ _context.t0 = plugin;
70
+ _context.next = 3;
71
+ return result;
72
+ case 3:
73
+ _context.t1 = _context.sent;
74
+ return _context.abrupt("return", _context.t0.resolveProps.call(_context.t0, _context.t1));
75
+ case 5:
76
+ case "end":
77
+ return _context.stop();
78
+ }
79
+ }, _callee);
80
+ }));
81
+ return function (_x2, _x3) {
82
+ return _ref2.apply(this, arguments);
83
+ };
84
+ }(), Promise.resolve(initialProps));
85
+ case 7:
86
+ finalProps = _context2.sent;
87
+ return _context2.abrupt("return", finalProps);
88
+ case 9:
89
+ case "end":
90
+ return _context2.stop();
91
+ }
92
+ }, _callee2);
93
+ }));
94
+ function getInitialProps(_x) {
95
+ return _getInitialProps.apply(this, arguments);
96
+ }
97
+ return getInitialProps;
98
+ }();
99
+ }
100
+ export function DocumentHeadTags(_ref3) {
101
+ var emotionStyleTags = _ref3.emotionStyleTags;
102
+ return /*#__PURE__*/_jsxs(React.Fragment, {
103
+ children: [_meta || (_meta = /*#__PURE__*/_jsx("meta", {
104
+ name: "emotion-insertion-point",
105
+ content: ""
106
+ })), emotionStyleTags]
107
+ });
108
+ }
109
+
110
+ // `getInitialProps` belongs to `_document` (instead of `_app`),
111
+ // it's compatible with static-site generation (SSG).
112
+ export function documentGetInitialProps(_x4, _x5) {
113
+ return _documentGetInitialProps.apply(this, arguments);
114
+ }
115
+ function _documentGetInitialProps() {
116
+ _documentGetInitialProps = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(ctx, options) {
117
+ var _options$emotionCache, _options$plugins;
118
+ var cache;
119
+ return _regeneratorRuntime.wrap(function _callee4$(_context4) {
120
+ while (1) switch (_context4.prev = _context4.next) {
121
+ case 0:
122
+ // Resolution order
123
+ //
124
+ // On the server:
125
+ // 1. app.getInitialProps
126
+ // 2. page.getInitialProps
127
+ // 3. document.getInitialProps
128
+ // 4. app.render
129
+ // 5. page.render
130
+ // 6. document.render
131
+ //
132
+ // On the server with error:
133
+ // 1. document.getInitialProps
134
+ // 2. app.render
135
+ // 3. page.render
136
+ // 4. document.render
137
+ //
138
+ // On the client
139
+ // 1. app.getInitialProps
140
+ // 2. page.getInitialProps
141
+ // 3. app.render
142
+ // 4. page.render
143
+ // You can consider sharing the same Emotion cache between all the SSR requests to speed up performance.
144
+ // However, be aware that it can have global side effects.
145
+ cache = (_options$emotionCache = options == null ? void 0 : options.emotionCache) != null ? _options$emotionCache : createEmotionCache();
146
+ return _context4.abrupt("return", createGetInitialProps([{
147
+ enhanceApp: function enhanceApp(App) {
148
+ return function EnhanceApp(props) {
149
+ return /*#__PURE__*/_jsx(App, _extends({
150
+ emotionCache: cache
151
+ }, props));
152
+ };
153
+ },
154
+ resolveProps: function () {
155
+ var _resolveProps = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(initialProps) {
156
+ var _createEmotionServer, extractCriticalToChunks, _extractCriticalToChu, styles;
157
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
158
+ while (1) switch (_context3.prev = _context3.next) {
159
+ case 0:
160
+ _createEmotionServer = createEmotionServer(cache), extractCriticalToChunks = _createEmotionServer.extractCriticalToChunks;
161
+ _extractCriticalToChu = extractCriticalToChunks(initialProps.html), styles = _extractCriticalToChu.styles;
162
+ return _context3.abrupt("return", _extends({}, initialProps, {
163
+ emotionStyleTags: styles.map(function (style) {
164
+ return /*#__PURE__*/_jsx("style", {
165
+ "data-emotion": "".concat(style.key, " ").concat(style.ids.join(' ')),
166
+ // eslint-disable-next-line react/no-danger
167
+ dangerouslySetInnerHTML: {
168
+ __html: style.css
169
+ }
170
+ }, style.key);
171
+ })
172
+ }));
173
+ case 3:
174
+ case "end":
175
+ return _context3.stop();
176
+ }
177
+ }, _callee3);
178
+ }));
179
+ function resolveProps(_x6) {
180
+ return _resolveProps.apply(this, arguments);
181
+ }
182
+ return resolveProps;
183
+ }()
184
+ }].concat(_toConsumableArray((_options$plugins = options == null ? void 0 : options.plugins) != null ? _options$plugins : [])))(ctx));
185
+ case 2:
186
+ case "end":
187
+ return _context4.stop();
188
+ }
189
+ }, _callee4);
190
+ }));
191
+ return _documentGetInitialProps.apply(this, arguments);
192
+ }
@@ -0,0 +1,3 @@
1
+ 'use client';
2
+
3
+ export * from '../v13-appRouter';
@@ -0,0 +1 @@
1
+ export * from '../v13-pagesRouter';
@@ -0,0 +1,96 @@
1
+ 'use client';
2
+
3
+ import _extends from "@babel/runtime/helpers/esm/extends";
4
+ import * as React from 'react';
5
+ import createCache from '@emotion/cache';
6
+ import { useServerInsertedHTML } from 'next/navigation';
7
+ import { CacheProvider as DefaultCacheProvider } from '@emotion/react';
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ import { jsxs as _jsxs } from "react/jsx-runtime";
10
+ export default function AppRouterCacheProvider(props) {
11
+ const {
12
+ options,
13
+ CacheProvider = DefaultCacheProvider,
14
+ children
15
+ } = props;
16
+ const [registry] = React.useState(() => {
17
+ const cache = createCache(_extends({}, options, {
18
+ key: options?.key ?? 'mui'
19
+ }));
20
+ cache.compat = true;
21
+ const prevInsert = cache.insert;
22
+ let inserted = [];
23
+ cache.insert = (...args) => {
24
+ if (options?.enableCssLayer) {
25
+ args[1].styles = `@layer mui {${args[1].styles}}`;
26
+ }
27
+ const [selector, serialized] = args;
28
+ if (cache.inserted[serialized.name] === undefined) {
29
+ inserted.push({
30
+ name: serialized.name,
31
+ isGlobal: !selector
32
+ });
33
+ }
34
+ return prevInsert(...args);
35
+ };
36
+ const flush = () => {
37
+ const prevInserted = inserted;
38
+ inserted = [];
39
+ return prevInserted;
40
+ };
41
+ return {
42
+ cache,
43
+ flush
44
+ };
45
+ });
46
+ useServerInsertedHTML(() => {
47
+ const inserted = registry.flush();
48
+ if (inserted.length === 0) {
49
+ return null;
50
+ }
51
+ let styles = '';
52
+ let dataEmotionAttribute = registry.cache.key;
53
+ const globals = [];
54
+ inserted.forEach(({
55
+ name,
56
+ isGlobal
57
+ }) => {
58
+ const style = registry.cache.inserted[name];
59
+ if (typeof style !== 'boolean') {
60
+ if (isGlobal) {
61
+ globals.push({
62
+ name,
63
+ style
64
+ });
65
+ } else {
66
+ styles += style;
67
+ dataEmotionAttribute += ` ${name}`;
68
+ }
69
+ }
70
+ });
71
+ return /*#__PURE__*/_jsxs(React.Fragment, {
72
+ children: [globals.map(({
73
+ name,
74
+ style
75
+ }) => /*#__PURE__*/_jsx("style", {
76
+ "data-emotion": `${registry.cache.key}-global ${name}`
77
+ // eslint-disable-next-line react/no-danger
78
+ ,
79
+ dangerouslySetInnerHTML: {
80
+ __html: style
81
+ }
82
+ }, name)), styles && /*#__PURE__*/_jsx("style", {
83
+ "data-emotion": dataEmotionAttribute
84
+ // eslint-disable-next-line react/no-danger
85
+ ,
86
+ dangerouslySetInnerHTML: {
87
+ __html: styles
88
+ }
89
+ })]
90
+ });
91
+ });
92
+ return /*#__PURE__*/_jsx(CacheProvider, {
93
+ value: registry.cache,
94
+ children: children
95
+ });
96
+ }
@@ -0,0 +1,4 @@
1
+ 'use client';
2
+
3
+ export { default as AppRouterCacheProvider } from './appRouterV13';
4
+ export * from './appRouterV13';
@@ -0,0 +1 @@
1
+ export * from './pagesRouterV13';
@@ -0,0 +1,113 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ var _meta;
3
+ import * as React from 'react';
4
+ import { CacheProvider } from '@emotion/react';
5
+ import createCache from '@emotion/cache';
6
+ import createEmotionServer from '@emotion/server/create-instance';
7
+ import Document from 'next/document';
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ 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
+ /**
37
+ * A utility to compose multiple `getInitialProps` functions.
38
+ */
39
+ export function createGetInitialProps(plugins) {
40
+ return async function getInitialProps(ctx) {
41
+ const originalRenderPage = ctx.renderPage;
42
+ ctx.renderPage = () => originalRenderPage({
43
+ enhanceApp: App => plugins.reduce((result, plugin) => plugin.enhanceApp(result), App)
44
+ });
45
+ const initialProps = await Document.getInitialProps(ctx);
46
+ const finalProps = await plugins.reduce(async (result, plugin) => plugin.resolveProps(await result), Promise.resolve(initialProps));
47
+ return finalProps;
48
+ };
49
+ }
50
+ export function DocumentHeadTags({
51
+ emotionStyleTags
52
+ }) {
53
+ return /*#__PURE__*/_jsxs(React.Fragment, {
54
+ children: [_meta || (_meta = /*#__PURE__*/_jsx("meta", {
55
+ name: "emotion-insertion-point",
56
+ content: ""
57
+ })), emotionStyleTags]
58
+ });
59
+ }
60
+
61
+ // `getInitialProps` belongs to `_document` (instead of `_app`),
62
+ // it's compatible with static-site generation (SSG).
63
+ export async function documentGetInitialProps(ctx, options) {
64
+ // Resolution order
65
+ //
66
+ // On the server:
67
+ // 1. app.getInitialProps
68
+ // 2. page.getInitialProps
69
+ // 3. document.getInitialProps
70
+ // 4. app.render
71
+ // 5. page.render
72
+ // 6. document.render
73
+ //
74
+ // On the server with error:
75
+ // 1. document.getInitialProps
76
+ // 2. app.render
77
+ // 3. page.render
78
+ // 4. document.render
79
+ //
80
+ // On the client
81
+ // 1. app.getInitialProps
82
+ // 2. page.getInitialProps
83
+ // 3. app.render
84
+ // 4. page.render
85
+
86
+ // You can consider sharing the same Emotion cache between all the SSR requests to speed up performance.
87
+ // However, be aware that it can have global side effects.
88
+ const cache = options?.emotionCache ?? createEmotionCache();
89
+ return createGetInitialProps([{
90
+ enhanceApp: App => function EnhanceApp(props) {
91
+ return /*#__PURE__*/_jsx(App, _extends({
92
+ emotionCache: cache
93
+ }, props));
94
+ },
95
+ resolveProps: async initialProps => {
96
+ const {
97
+ extractCriticalToChunks
98
+ } = createEmotionServer(cache);
99
+ const {
100
+ styles
101
+ } = extractCriticalToChunks(initialProps.html);
102
+ return _extends({}, initialProps, {
103
+ emotionStyleTags: styles.map(style => /*#__PURE__*/_jsx("style", {
104
+ "data-emotion": `${style.key} ${style.ids.join(' ')}`,
105
+ // eslint-disable-next-line react/no-danger
106
+ dangerouslySetInnerHTML: {
107
+ __html: style.css
108
+ }
109
+ }, style.key))
110
+ });
111
+ }
112
+ }, ...(options?.plugins ?? [])])(ctx);
113
+ }
@@ -0,0 +1,3 @@
1
+ 'use client';
2
+
3
+ export * from '../v13-appRouter';
@@ -0,0 +1 @@
1
+ export * from '../v13-pagesRouter';
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ 'use client';
3
+
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = AppRouterCacheProvider;
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ var React = _interopRequireWildcard(require("react"));
11
+ var _cache = _interopRequireDefault(require("@emotion/cache"));
12
+ var _navigation = require("next/navigation");
13
+ var _react2 = require("@emotion/react");
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
+ 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); }
16
+ 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; }
17
+ function AppRouterCacheProvider(props) {
18
+ const {
19
+ options,
20
+ CacheProvider = _react2.CacheProvider,
21
+ children
22
+ } = props;
23
+ const [registry] = React.useState(() => {
24
+ var _options$key;
25
+ const cache = (0, _cache.default)((0, _extends2.default)({}, options, {
26
+ key: (_options$key = options == null ? void 0 : options.key) != null ? _options$key : 'mui'
27
+ }));
28
+ cache.compat = true;
29
+ const prevInsert = cache.insert;
30
+ let inserted = [];
31
+ cache.insert = (...args) => {
32
+ if (options != null && options.enableCssLayer) {
33
+ args[1].styles = `@layer mui {${args[1].styles}}`;
34
+ }
35
+ const [selector, serialized] = args;
36
+ if (cache.inserted[serialized.name] === undefined) {
37
+ inserted.push({
38
+ name: serialized.name,
39
+ isGlobal: !selector
40
+ });
41
+ }
42
+ return prevInsert(...args);
43
+ };
44
+ const flush = () => {
45
+ const prevInserted = inserted;
46
+ inserted = [];
47
+ return prevInserted;
48
+ };
49
+ return {
50
+ cache,
51
+ flush
52
+ };
53
+ });
54
+ (0, _navigation.useServerInsertedHTML)(() => {
55
+ const inserted = registry.flush();
56
+ if (inserted.length === 0) {
57
+ return null;
58
+ }
59
+ let styles = '';
60
+ let dataEmotionAttribute = registry.cache.key;
61
+ const globals = [];
62
+ inserted.forEach(({
63
+ name,
64
+ isGlobal
65
+ }) => {
66
+ const style = registry.cache.inserted[name];
67
+ if (typeof style !== 'boolean') {
68
+ if (isGlobal) {
69
+ globals.push({
70
+ name,
71
+ style
72
+ });
73
+ } else {
74
+ styles += style;
75
+ dataEmotionAttribute += ` ${name}`;
76
+ }
77
+ }
78
+ });
79
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(React.Fragment, {
80
+ children: [globals.map(({
81
+ name,
82
+ style
83
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsx)("style", {
84
+ "data-emotion": `${registry.cache.key}-global ${name}`
85
+ // eslint-disable-next-line react/no-danger
86
+ ,
87
+ dangerouslySetInnerHTML: {
88
+ __html: style
89
+ }
90
+ }, name)), styles && /*#__PURE__*/(0, _jsxRuntime.jsx)("style", {
91
+ "data-emotion": dataEmotionAttribute
92
+ // eslint-disable-next-line react/no-danger
93
+ ,
94
+ dangerouslySetInnerHTML: {
95
+ __html: styles
96
+ }
97
+ })]
98
+ });
99
+ });
100
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(CacheProvider, {
101
+ value: registry.cache,
102
+ children: children
103
+ });
104
+ }