@mui/material-nextjs 5.15.3 → 5.15.5
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 +184 -1
- package/legacy/v13-appRouter/appRouterV13.js +3 -1
- package/legacy/v13-appRouter/index.js +0 -2
- package/legacy/v13-pagesRouter/createCache.js +17 -0
- package/legacy/v13-pagesRouter/index.js +2 -1
- package/legacy/v13-pagesRouter/pagesRouterV13App.js +14 -0
- package/legacy/v13-pagesRouter/{pagesRouterV13.js → pagesRouterV13Document.js} +5 -32
- package/legacy/v14-appRouter/index.js +0 -2
- package/modern/v13-appRouter/appRouterV13.js +3 -1
- package/modern/v13-appRouter/index.js +0 -2
- package/modern/v13-pagesRouter/createCache.js +17 -0
- package/modern/v13-pagesRouter/index.js +2 -1
- package/modern/v13-pagesRouter/pagesRouterV13App.js +14 -0
- package/modern/v13-pagesRouter/{pagesRouterV13.js → pagesRouterV13Document.js} +1 -28
- package/modern/v14-appRouter/index.js +0 -2
- package/node/v13-appRouter/appRouterV13.js +3 -1
- package/node/v13-appRouter/index.js +0 -1
- package/node/v13-pagesRouter/createCache.js +24 -0
- package/node/v13-pagesRouter/index.js +15 -4
- package/node/v13-pagesRouter/pagesRouterV13App.js +23 -0
- package/node/v13-pagesRouter/{pagesRouterV13.js → pagesRouterV13Document.js} +2 -30
- package/node/v14-appRouter/index.js +0 -1
- package/package.json +3 -2
- package/v13-appRouter/appRouterV13.d.ts +8 -4
- package/v13-appRouter/appRouterV13.js +3 -1
- package/v13-appRouter/index.js +0 -2
- package/v13-pagesRouter/createCache.d.ts +1 -0
- package/v13-pagesRouter/createCache.js +17 -0
- package/v13-pagesRouter/index.d.ts +2 -1
- package/v13-pagesRouter/index.js +2 -1
- package/v13-pagesRouter/pagesRouterV13App.d.ts +6 -0
- package/v13-pagesRouter/pagesRouterV13App.js +14 -0
- package/v13-pagesRouter/{pagesRouterV13.d.ts → pagesRouterV13Document.d.ts} +0 -4
- package/v13-pagesRouter/{pagesRouterV13.js → pagesRouterV13Document.js} +1 -28
- package/v14-appRouter/index.js +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,188 @@
|
|
|
1
1
|
# [Versions](https://mui.com/versions/)
|
|
2
2
|
|
|
3
|
+
## v5.15.5
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v5.15.4..master -->
|
|
6
|
+
|
|
7
|
+
_Jan 17, 2024_
|
|
8
|
+
|
|
9
|
+
A big thanks to the 18 contributors who made this release possible. Here are some highlights ✨:
|
|
10
|
+
|
|
11
|
+
- Base UI's CSS class prefix is now `base-` (#40205) @michaldudak
|
|
12
|
+
- Bug fixes, and a lot of improvements to code and docs infra
|
|
13
|
+
|
|
14
|
+
### `@mui/material@5.15.5`
|
|
15
|
+
|
|
16
|
+
- ​<!-- 42 -->[Accordion] Deprecate \*Props props and classes for v6 (#40418) @DiegoAndai
|
|
17
|
+
- ​<!-- 41 -->[Alert] Update TypeScript types to allow color override types to be added to `iconMapping` and `severity` props (#40551) @2metres
|
|
18
|
+
- ​<!-- 27 -->[Dialog] Remove deprecated onBackdropClick from Dialog tests (#40505) @sai6855
|
|
19
|
+
- ​<!-- 26 -->[Divider] Deprecate props and classes for v6 (#40563) @sai6855
|
|
20
|
+
|
|
21
|
+
### `@mui/material-next@6.0.0-alpha.118`
|
|
22
|
+
|
|
23
|
+
- ​<!-- 36 -->[ButtonGroup] Apply MD3 style to `ButtonGroup` (#40124) @lhilgert9
|
|
24
|
+
|
|
25
|
+
### `@mui/base@5.0.0-beta.32`
|
|
26
|
+
|
|
27
|
+
#### Breaking changes
|
|
28
|
+
|
|
29
|
+
- ​<!-- 40 -->Change the CSS class prefix to `base-` (#40205) @michaldudak
|
|
30
|
+
|
|
31
|
+
The class prefix of Base UI components have been changed from `Mui-` to `base-`. This only affects codebases that uses class names verbatim, i.e. not exposed by JS objects such as `buttonClasses`, but as plain strings or in CSS stylesheets (`.MuiButton.root`)
|
|
32
|
+
|
|
33
|
+
To adapt your code to the new pattern:
|
|
34
|
+
|
|
35
|
+
- replace all occurrences of the regex `.Mui([A-Z][A-Za-z]*)-` with `.base-$1-` (so `MuiButton-root` becomes `base-Button-root`, etc.),
|
|
36
|
+
- replace all occurrences of the regex `.Mui-([a-z]*)` with `.base--$1` (so `Mui-disabled` becomes `base--disabled`, etc.).
|
|
37
|
+
|
|
38
|
+
#### Changes
|
|
39
|
+
|
|
40
|
+
- ​<!-- 39 -->[Select] Fix screen-reader CSS to avoid body scrollbar (#40599) @brijeshb42
|
|
41
|
+
- ​<!-- 38 -->[Switch] Add border-box to demos (#40638) @zanivan
|
|
42
|
+
|
|
43
|
+
### `@mui/joy@5.0.0-beta.23`
|
|
44
|
+
|
|
45
|
+
- ​<!-- 11 -->[ModalDialog] Fix ModalDialog layout prop override (#40512) @maakcode
|
|
46
|
+
- ​<!-- 10 -->[RadioGroup] Allow zero number as a value (#40344) @aacevski
|
|
47
|
+
|
|
48
|
+
### `@mui/codemod@5.15.5`
|
|
49
|
+
|
|
50
|
+
- ​<!-- 31 -->Allow `json` files to be transformed (#40536) @ZeeshanTamboli
|
|
51
|
+
|
|
52
|
+
### `@mui/lab@5.0.0-alpha.161`
|
|
53
|
+
|
|
54
|
+
- ​<!-- 09 -->Update `@mui/material` peer dependency version (#40528) @ZeeshanTamboli
|
|
55
|
+
|
|
56
|
+
### `@mui/material-nextjs@5.15.5`
|
|
57
|
+
|
|
58
|
+
- ​<!-- 08 -->Fix release script (#40519) @petrovmiroslav
|
|
59
|
+
- ​<!-- 07 -->Support Nonces in the App Router Provider (#40269) @josh-feldman
|
|
60
|
+
- ​<!-- 06 -->Polish @mui/material-nextjs (#40473) @oliviertassinari
|
|
61
|
+
|
|
62
|
+
### `@mui/system@5.15.5`
|
|
63
|
+
|
|
64
|
+
- ​<!-- 05 -->Fix import path for @mui/system in vite apps (#40490) @brijeshb42
|
|
65
|
+
- ​<!-- 02 -->Fix css vars generation and simplify the code (#40530) @siriwatknp
|
|
66
|
+
- ​<!-- 01 -->Identify zero runtime styled path (#40555) @brijeshb42
|
|
67
|
+
|
|
68
|
+
### Docs
|
|
69
|
+
|
|
70
|
+
- ​<!-- 35 -->[joy-ui][Card] Fix text alignment in horizontal aligned card demo (#40562) @ZeeshanTamboli
|
|
71
|
+
- ​<!-- 25 -->Improve instructions about peer dependencies (#40621) @danilo-leal
|
|
72
|
+
- ​<!-- 24 -->Solve page description length @oliviertassinari
|
|
73
|
+
- ​<!-- 23 -->Fix MUI Treasury links (#40561) @siriwatknp
|
|
74
|
+
- ​<!-- 17 -->[material-ui] Update <ListItem button/> to ListItemButton in demos (#40564) @sai6855
|
|
75
|
+
- ​<!-- 16 -->[material-ui] Revise the Snackbar page (#39298) @danilo-leal
|
|
76
|
+
- ​<!-- 15 -->[material-ui] Sharpen Material 3 copy on demo pages (#40546) @samuelsycamore
|
|
77
|
+
- ​<!-- 14 -->[material-ui] Fix typo on Next.js integration guide (#40538) @zanivan
|
|
78
|
+
- ​<!-- 13 -->[material-ui][Snackbar] Remove unused `State` interface from Consecutive Snackbars demo (#40410)
|
|
79
|
+
@zinoroman
|
|
80
|
+
- ​<!-- 12 -->[website] Resolve broken links reported by `docs:link-check` (#40547) @samuelsycamore
|
|
81
|
+
|
|
82
|
+
### Core
|
|
83
|
+
|
|
84
|
+
- ​<!-- 37 -->[blog] Fix 404 link to MUI Treasury @oliviertassinari
|
|
85
|
+
- ​<!-- 34 -->[code-infra] Add `run` command to deploy docs (#40513) @siriwatknp
|
|
86
|
+
- ​<!-- 32 -->[core] Update the lockfile (#40628) @michaldudak
|
|
87
|
+
- ​<!-- 31 -->[core] Remove dead code and follow standard @oliviertassinari
|
|
88
|
+
- ​<!-- 30 -->[core] Simplify server detection (#40471) @oliviertassinari
|
|
89
|
+
- ​<!-- 29 -->[core] Sync playwright cache between MUI X and Material UI (#40475) @oliviertassinari
|
|
90
|
+
- ​<!-- 28 -->[dependencies] Bump tough-cookie (#40437) @michaldudak
|
|
91
|
+
- ​<!-- 22 -->[docs-infra] Enforce brand name rules (#40525) @oliviertassinari
|
|
92
|
+
- ​<!-- 21 -->[docs-infra] Minimize ad layout shift on mobile (#40582) @oliviertassinari
|
|
93
|
+
- ​<!-- 20 -->[docs-infra] Improve API page deprecation info (#40440) @DiegoAndai
|
|
94
|
+
- ​<!-- 19 -->[docs-infra] Remove old tocs banners (#40537) @oliviertassinari
|
|
95
|
+
- ​<!-- 18 -->[docs-infra] Remove dead code aria-label sponsors (#40526) @oliviertassinari
|
|
96
|
+
- ​<!-- 04 -->[utils] Centralize clamp implementation in utils (#40267) @Kamino0
|
|
97
|
+
- ​<!-- 03 -->[website] Polish the Base UI page demos (#40504) @danilo-leal
|
|
98
|
+
|
|
99
|
+
All contributors of this release in alphabetical order: @2metres, @aacevski, @brijeshb42, @danilo-leal, @DiegoAndai, @josh-feldman, @Kamino0, @lhilgert9, @maakcode, @michaldudak, @oliviertassinari, @petrovmiroslav, @sai6855, @samuelsycamore, @siriwatknp, @zanivan, @ZeeshanTamboli, @zinoroman
|
|
100
|
+
|
|
101
|
+
## 5.15.4
|
|
102
|
+
|
|
103
|
+
<!-- generated comparing v5.15.3..master -->
|
|
104
|
+
|
|
105
|
+
_Jan 10, 2024_
|
|
106
|
+
|
|
107
|
+
A big thanks to the 22 contributors who made this release possible. Here are some highlights:
|
|
108
|
+
|
|
109
|
+
- ✨ 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
|
|
110
|
+
|
|
111
|
+
### `@mui/material@5.15.4`
|
|
112
|
+
|
|
113
|
+
- [TextField][FormLabel][InputLabel][FormControl] Use exact children type to allow React children type augmentation (#38872) @nicegamer7
|
|
114
|
+
- [Select] Add form submission regression test (#40176) @mj12albert
|
|
115
|
+
- [ToggleButtonGroup] Support different elements under it (#40220) @Methuselah96
|
|
116
|
+
- [ClickAwayListener] Fix export of types (#40485) @illume
|
|
117
|
+
|
|
118
|
+
### `@mui/material-nextjs@5.15.4`
|
|
119
|
+
|
|
120
|
+
- Improve build size issue (#40436) @siriwatknp
|
|
121
|
+
|
|
122
|
+
### `@mui/icons-material@5.15.4`
|
|
123
|
+
|
|
124
|
+
- Update the icons (#40365) @michaldudak
|
|
125
|
+
|
|
126
|
+
### `@mui/system@5.15.4`
|
|
127
|
+
|
|
128
|
+
- [zero] Move zero runtime related packages (#40426) @brijeshb42
|
|
129
|
+
- Fix all use of styled(Box) (#40449) @oliviertassinari
|
|
130
|
+
|
|
131
|
+
### `@mui/utils@5.15.4`
|
|
132
|
+
|
|
133
|
+
- Fix `isPlainObject` to work across realm (#39981) @brijeshb42
|
|
134
|
+
|
|
135
|
+
### `@mui/base@5.0.0-beta.31`
|
|
136
|
+
|
|
137
|
+
- [base-ui][NumberInput] Remove inputId and inputRef types from NumberInput component (#40425) @sai6855
|
|
138
|
+
|
|
139
|
+
### `@mui/joy@5.0.0-beta.22`
|
|
140
|
+
|
|
141
|
+
- [Badge] Shouldn't crash when using custom size (#39986) @iamsaumya
|
|
142
|
+
- [ToggleButtonGroup] Add `JoyToggleButtonGroup` to extendTheme's components type export (#40407) @RiceCrisp
|
|
143
|
+
|
|
144
|
+
### Docs
|
|
145
|
+
|
|
146
|
+
- [base-ui] Visual tweaks to the plain CSS theme stylesheet (#40487) @zanivan
|
|
147
|
+
- [base-ui] Add tokens to plain CSS theme stylesheet (#40113) @zanivan
|
|
148
|
+
- [base-ui] Update the overview page (#40412) @danilo-leal
|
|
149
|
+
- [material-ui][Drawer] Resolve flickering when double-clicking on the backdrop to close it (#40343) @aacevski
|
|
150
|
+
- [material-ui] Refactor form submission in FormDialog component (#40470) @sai6855
|
|
151
|
+
- [material-ui] Replace recharts with MUI X charts on the Dashboard template (#40107) @alexfauquette
|
|
152
|
+
- [material-ui] Revise the Alert demo page (#34892) @samuelsycamore
|
|
153
|
+
- [material-ui] Revise the Accordion page (#40284) @anle9650
|
|
154
|
+
- [material-ui] Add docs for complementary Card components (#40346) @anle9650
|
|
155
|
+
- [material-ui] Add Material 3 components page (#40350) @DiegoAndai
|
|
156
|
+
- Fix strange italic style @oliviertassinari
|
|
157
|
+
- Fix references to ESLint @oliviertassinari
|
|
158
|
+
- Fix 301 redirections @oliviertassinari
|
|
159
|
+
- Right-to-left revision and addition to Joy UI (#39158) @danilo-leal
|
|
160
|
+
|
|
161
|
+
### Core
|
|
162
|
+
|
|
163
|
+
- [examples] Use material-nextjs integration package (#40199) @siriwatknp
|
|
164
|
+
- [code-infra] Configure build dependencies in nx (#40482) @michaldudak
|
|
165
|
+
- [code-infra] Don't require noreferrer on target link (#40447) @oliviertassinari
|
|
166
|
+
- [code-infra] Use tsx instead of ts-node (#40428) @michaldudak
|
|
167
|
+
- [code-infra] Add options to docs-api generation to support X code structure (#40111) @alexfauquette
|
|
168
|
+
- [docs-infra] Add types for withDocsInfra (#40301) @oliviertassinari
|
|
169
|
+
- [docs-infra] Fix anchor links in API pages (#40450) @oliviertassinari
|
|
170
|
+
- [docs-infra] Fix API table full-width (#40476) @oliviertassinari
|
|
171
|
+
- [docs-infra] Fix the copy button overlapping with the scrollbar (#40405) @danilo-leal
|
|
172
|
+
- [docs-infra] Remove explicit `mui-x` dependency resolving (#40257) @LukasTy
|
|
173
|
+
- [docs-infra] Update the outlined Demo container dark mode color (#40488) @danilo-leal
|
|
174
|
+
- [core] Lock file maintenance (#34538) @renovate[bot]
|
|
175
|
+
- [core] Remove duplicate devDependencies (#40438) @michaldudak
|
|
176
|
+
- [core] Remove issue emoji @oliviertassinari
|
|
177
|
+
- [core] Move prefetch at the core, will propagate to MUI X @oliviertassinari
|
|
178
|
+
- [core] Change package manager to pnpm (#36287) @Janpot
|
|
179
|
+
- [core][docs] Remove the "Understand MUI packages" page (#39835) @savalaram-redkar
|
|
180
|
+
- [website] Evolve the Developer Advocate role (#40337) @oliviertassinari
|
|
181
|
+
- [website] Fix default social card @oliviertassinari
|
|
182
|
+
- [test] Restore the `t` command (#40430) @michaldudak
|
|
183
|
+
|
|
184
|
+
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
|
|
185
|
+
|
|
3
186
|
## 5.15.3
|
|
4
187
|
|
|
5
188
|
<!-- generated comparing v5.15.2..master -->
|
|
@@ -12480,7 +12663,7 @@ Here are some highlights ✨:
|
|
|
12480
12663
|
|
|
12481
12664
|
- 👩🎨 A first iteration on the new styling solution.
|
|
12482
12665
|
|
|
12483
|
-
You can find a [new version](https://mui.com/components/slider-styled/) of the slider in the lab powered by [
|
|
12666
|
+
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
12667
|
|
|
12485
12668
|
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
12669
|
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import createCache from '@emotion/cache';
|
|
6
|
-
import { useServerInsertedHTML } from 'next/navigation';
|
|
7
6
|
import { CacheProvider as DefaultCacheProvider } from '@emotion/react';
|
|
7
|
+
import { useServerInsertedHTML } from 'next/navigation';
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
10
|
export default function AppRouterCacheProvider(props) {
|
|
@@ -77,6 +77,7 @@ export default function AppRouterCacheProvider(props) {
|
|
|
77
77
|
var name = _ref2.name,
|
|
78
78
|
style = _ref2.style;
|
|
79
79
|
return /*#__PURE__*/_jsx("style", {
|
|
80
|
+
nonce: options == null ? void 0 : options.nonce,
|
|
80
81
|
"data-emotion": "".concat(registry.cache.key, "-global ").concat(name)
|
|
81
82
|
// eslint-disable-next-line react/no-danger
|
|
82
83
|
,
|
|
@@ -85,6 +86,7 @@ export default function AppRouterCacheProvider(props) {
|
|
|
85
86
|
}
|
|
86
87
|
}, name);
|
|
87
88
|
}), styles && /*#__PURE__*/_jsx("style", {
|
|
89
|
+
nonce: options == null ? void 0 : options.nonce,
|
|
88
90
|
"data-emotion": dataEmotionAttribute
|
|
89
91
|
// eslint-disable-next-line react/no-danger
|
|
90
92
|
,
|
|
@@ -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
|
+
}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
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
|
|
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
|
|
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(
|
|
101
|
-
var 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",
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import createCache from '@emotion/cache';
|
|
6
|
-
import { useServerInsertedHTML } from 'next/navigation';
|
|
7
6
|
import { CacheProvider as DefaultCacheProvider } from '@emotion/react';
|
|
7
|
+
import { useServerInsertedHTML } from 'next/navigation';
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
10
|
export default function AppRouterCacheProvider(props) {
|
|
@@ -73,6 +73,7 @@ export default function AppRouterCacheProvider(props) {
|
|
|
73
73
|
name,
|
|
74
74
|
style
|
|
75
75
|
}) => /*#__PURE__*/_jsx("style", {
|
|
76
|
+
nonce: options?.nonce,
|
|
76
77
|
"data-emotion": `${registry.cache.key}-global ${name}`
|
|
77
78
|
// eslint-disable-next-line react/no-danger
|
|
78
79
|
,
|
|
@@ -80,6 +81,7 @@ export default function AppRouterCacheProvider(props) {
|
|
|
80
81
|
__html: style
|
|
81
82
|
}
|
|
82
83
|
}, name)), styles && /*#__PURE__*/_jsx("style", {
|
|
84
|
+
nonce: options?.nonce,
|
|
83
85
|
"data-emotion": dataEmotionAttribute
|
|
84
86
|
// eslint-disable-next-line react/no-danger
|
|
85
87
|
,
|
|
@@ -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
|
+
}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
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
|
*/
|
|
@@ -9,8 +9,8 @@ exports.default = AppRouterCacheProvider;
|
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _cache = _interopRequireDefault(require("@emotion/cache"));
|
|
12
|
-
var _navigation = require("next/navigation");
|
|
13
12
|
var _react2 = require("@emotion/react");
|
|
13
|
+
var _navigation = require("next/navigation");
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
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
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; }
|
|
@@ -81,6 +81,7 @@ function AppRouterCacheProvider(props) {
|
|
|
81
81
|
name,
|
|
82
82
|
style
|
|
83
83
|
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)("style", {
|
|
84
|
+
nonce: options == null ? void 0 : options.nonce,
|
|
84
85
|
"data-emotion": `${registry.cache.key}-global ${name}`
|
|
85
86
|
// eslint-disable-next-line react/no-danger
|
|
86
87
|
,
|
|
@@ -88,6 +89,7 @@ function AppRouterCacheProvider(props) {
|
|
|
88
89
|
__html: style
|
|
89
90
|
}
|
|
90
91
|
}, name)), styles && /*#__PURE__*/(0, _jsxRuntime.jsx)("style", {
|
|
92
|
+
nonce: options == null ? void 0 : options.nonce,
|
|
91
93
|
"data-emotion": dataEmotionAttribute
|
|
92
94
|
// eslint-disable-next-line react/no-danger
|
|
93
95
|
,
|
|
@@ -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
|
+
}
|
|
@@ -3,14 +3,25 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var
|
|
7
|
-
Object.keys(
|
|
6
|
+
var _pagesRouterV13Document = require("./pagesRouterV13Document");
|
|
7
|
+
Object.keys(_pagesRouterV13Document).forEach(function (key) {
|
|
8
8
|
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] ===
|
|
9
|
+
if (key in exports && exports[key] === _pagesRouterV13Document[key]) return;
|
|
10
10
|
Object.defineProperty(exports, key, {
|
|
11
11
|
enumerable: true,
|
|
12
12
|
get: function () {
|
|
13
|
-
return
|
|
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];
|
|
14
25
|
}
|
|
15
26
|
});
|
|
16
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 :
|
|
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 {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/material-nextjs",
|
|
3
|
-
"version": "5.15.
|
|
3
|
+
"version": "5.15.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"description": "Collection of utilities for integration between Material UI and Next.js.",
|
|
@@ -44,7 +44,8 @@
|
|
|
44
44
|
},
|
|
45
45
|
"sideEffects": false,
|
|
46
46
|
"publishConfig": {
|
|
47
|
-
"access": "public"
|
|
47
|
+
"access": "public",
|
|
48
|
+
"directory": "build"
|
|
48
49
|
},
|
|
49
50
|
"engines": {
|
|
50
51
|
"node": ">=12.0.0"
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { EmotionCache, Options as OptionsOfCreateCache } from '@emotion/cache';
|
|
3
3
|
export type AppRouterCacheProviderProps = {
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* These are the options passed to createCache() from 'import createCache from "@emotion/cache"'.
|
|
6
|
+
*/
|
|
5
7
|
options?: Partial<OptionsOfCreateCache> & {
|
|
6
8
|
/**
|
|
7
9
|
* If `true`, the generated styles are wrapped within `@layer mui`.
|
|
8
|
-
* This is useful if you want to override the Material UI's generated styles with different styling solution, like Tailwind, plain CSS etc.
|
|
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.
|
|
9
11
|
*/
|
|
10
12
|
enableCssLayer?: boolean;
|
|
11
13
|
};
|
|
12
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* By default <CacheProvider /> from 'import { CacheProvider } from "@emotion/react"'.
|
|
16
|
+
*/
|
|
13
17
|
CacheProvider?: (props: {
|
|
14
18
|
value: EmotionCache;
|
|
15
19
|
children: React.ReactNode;
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import createCache from '@emotion/cache';
|
|
6
|
-
import { useServerInsertedHTML } from 'next/navigation';
|
|
7
6
|
import { CacheProvider as DefaultCacheProvider } from '@emotion/react';
|
|
7
|
+
import { useServerInsertedHTML } from 'next/navigation';
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
10
|
export default function AppRouterCacheProvider(props) {
|
|
@@ -74,6 +74,7 @@ export default function AppRouterCacheProvider(props) {
|
|
|
74
74
|
name,
|
|
75
75
|
style
|
|
76
76
|
}) => /*#__PURE__*/_jsx("style", {
|
|
77
|
+
nonce: options == null ? void 0 : options.nonce,
|
|
77
78
|
"data-emotion": `${registry.cache.key}-global ${name}`
|
|
78
79
|
// eslint-disable-next-line react/no-danger
|
|
79
80
|
,
|
|
@@ -81,6 +82,7 @@ export default function AppRouterCacheProvider(props) {
|
|
|
81
82
|
__html: style
|
|
82
83
|
}
|
|
83
84
|
}, name)), styles && /*#__PURE__*/_jsx("style", {
|
|
85
|
+
nonce: options == null ? void 0 : options.nonce,
|
|
84
86
|
"data-emotion": dataEmotionAttribute
|
|
85
87
|
// eslint-disable-next-line react/no-danger
|
|
86
88
|
,
|
package/v13-appRouter/index.js
CHANGED
|
@@ -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
|
+
}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './pagesRouterV13Document';
|
|
2
|
+
export * from './pagesRouterV13App';
|
package/v13-pagesRouter/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
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/v14-appRouter/index.js
CHANGED