@mui/styled-engine 6.2.1 → 6.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,82 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## 6.3.1
4
+
5
+ <!-- generated comparing v6.3.0..master -->
6
+
7
+ _Jan 3, 2025_
8
+
9
+ A big thanks to the 8 contributors who made this release possible.
10
+
11
+ ### `@mui/material@6.3.1`
12
+
13
+ - [Autocomplete] Revert: Fix options list rendering in freeSolo mode (#44858) @ZeeshanTamboli
14
+ - [Tooltip] Warn instead of error when trigger is disabled (#44846) @yash49
15
+ - [TableSortLabel] Add slots and slotProps (#44728) @sai6855
16
+ - [Select] Deprecate composed classes (#44925) @sai6855
17
+
18
+ ### Docs
19
+
20
+ - [material-ui][Accordion] Update `Anatomy` section in Accordion docs (#44849) @ZeeshanTamboli
21
+ - [material-ui][CardActionArea] Added demo in docs of cards for adding props to CardActionArea (#44789) @siddhantantil39
22
+ - [material-ui][Grid2] Add interactive demo for Grid v2 (#44820) @yash49
23
+ - [material-ui][Select] Update docs to reflect the omission of placeholder prop (#44856) @adityaparab
24
+ - [joy-ui] Fix Color mode button on Theme builder (#44864) @komkanit
25
+ - Fix 301 redirections @oliviertassinari
26
+
27
+ ### Core
28
+
29
+ - [examples] Update Next.js examples Next.js and React versions (#44852) @DiegoAndai
30
+ - [code-infra] Prevent wrong nested imports in Base UI (#44426) @oliviertassinari
31
+ - [docs-infra] Add vale coverage for App Router and Page Router (060c55c) @oliviertassinari
32
+ - Sync with other repos (1b9300f) @oliviertassinari
33
+ - Fix docs:build to work in docs folder too (6b923a4) @oliviertassinari
34
+ - Setup React 18 CI tests (#44868) @DiegoAndai
35
+ - Update test to use public API (#44875) @oliviertassinari
36
+
37
+ All contributors of this release in alphabetical order: @adityaparab, @DiegoAndai, @komkanit, @oliviertassinari, @sai6855, @siddhantantil39, @yash49, @ZeeshanTamboli
38
+
39
+ ## 6.3.0
40
+
41
+ <!-- generated comparing v6.2.1..master -->
42
+
43
+ _Dec 23, 2024_
44
+
45
+ A big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
46
+
47
+ - Fix invalid HTML structure in the Accordion component (#44408) @ZeeshanTamboli
48
+ The HTML elements of the Accordion summary have been updated:
49
+ - the root element is now button (previously div).
50
+ - summary content and the icon wrapper are now span (previously div).
51
+ This will only impact you if you used the HTML element as selectors in your styles.
52
+
53
+ ### `@mui/material@6.3.0`
54
+
55
+ - [Accordion] Fix invalid HTML inside heading (#44408) @ZeeshanTamboli
56
+ - [useAutocomplete] Improve TS typing of `groupedOptions` prop (#44657) @lewxdev
57
+ - Prevent `ownerState` propagation for transition slots (#44401) @ZeeshanTamboli
58
+ - [StepContent] Add slots and slotProps (#44742) @sai6855
59
+ - [TablePagination] Add the rest of `slots` and `slotProps`. (#44570) @siriwatknp
60
+
61
+ ### `@mui/system@6.3.0`
62
+
63
+ - Set `before` directly without using prepend for global styles (#44648) @siriwatknp
64
+
65
+ ### Docs
66
+
67
+ - [material-ui] Improve `theme.applyStyles()` docs (#44658) @DiegoAndai
68
+ - [material-ui] Update MD callout (#43958) @aarongarciah
69
+
70
+ ### Core
71
+
72
+ - Remove unnecessary conditional around `.muiName =` (#44071) @Janpot
73
+ - [blog] Material UI: 2024 EOY updates blog post (#44722) @alelthomas
74
+ - Fix quickstart command in pigment docs (#44806) @yash49
75
+ - [docs-infra] Remove Next.js production profiler (#44823) @romgrk
76
+ - [docs-infra] Remove no longer support `optimizeFonts` Next.js option (#44802) @LukasTy
77
+
78
+ All contributors of this release in alphabetical order: @aarongarciah, @alelthomas, @DiegoAndai, @Janpot, @lewxdev, @LukasTy, @romgrk, @sai6855, @siriwatknp, @yash49, @ZeeshanTamboli
79
+
3
80
  ## 6.2.1
4
81
 
5
82
  <!-- generated comparing v6.2.0..master -->
@@ -9,23 +9,11 @@ import { StyleSheet } from '@emotion/sheet';
9
9
  // We might be able to remove this when this issue is fixed:
10
10
  // https://github.com/emotion-js/emotion/issues/2790
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
- const createEmotionCache = options => {
12
+ const createEmotionCache = (options, CustomSheet) => {
13
13
  const cache = createCache(options);
14
14
 
15
- /**
16
- * This is for client-side apps only.
17
- * A custom sheet is required to make the GlobalStyles API work with `prepend: true`.
18
- * This is because the [sheet](https://github.com/emotion-js/emotion/blob/main/packages/react/src/global.js#L94-L99) does not consume the options.
19
- */
20
- class MyStyleSheet extends StyleSheet {
21
- constructor(args) {
22
- super(args);
23
- this.prepend = cache.sheet.prepend;
24
- }
25
- }
26
-
27
15
  // Do the same as https://github.com/emotion-js/emotion/blob/main/packages/cache/src/index.js#L238-L245
28
- cache.sheet = new MyStyleSheet({
16
+ cache.sheet = new CustomSheet({
29
17
  key: cache.key,
30
18
  nonce: cache.sheet.nonce,
31
19
  container: cache.sheet.container,
@@ -35,15 +23,37 @@ const createEmotionCache = options => {
35
23
  });
36
24
  return cache;
37
25
  };
38
-
39
- // prepend: true moves MUI styles to the top of the <head> so they're loaded first.
40
- // It allows developers to easily override MUI styles with other styling solutions, like CSS modules.
41
26
  let cache;
42
27
  if (typeof document === 'object') {
28
+ // Use `insertionPoint` over `prepend`(deprecated) because it can be controlled for GlobalStyles injection order
29
+ // For more information, see https://github.com/mui/material-ui/issues/44597
30
+ let insertionPoint = document.querySelector('[name="emotion-insertion-point"]');
31
+ if (!insertionPoint) {
32
+ insertionPoint = document.createElement('meta');
33
+ insertionPoint.setAttribute('name', 'emotion-insertion-point');
34
+ insertionPoint.setAttribute('content', '');
35
+ const head = document.querySelector('head');
36
+ if (head) {
37
+ head.prepend(insertionPoint);
38
+ }
39
+ }
40
+ /**
41
+ * This is for client-side apps only.
42
+ * A custom sheet is required to make the GlobalStyles API injected above the insertion point.
43
+ * This is because the [sheet](https://github.com/emotion-js/emotion/blob/main/packages/react/src/global.js#L94-L99) does not consume the options.
44
+ */
45
+ class MyStyleSheet extends StyleSheet {
46
+ insert(rule, options) {
47
+ if (this.key && this.key.endsWith('global')) {
48
+ this.before = insertionPoint;
49
+ }
50
+ return super.insert(rule, options);
51
+ }
52
+ }
43
53
  cache = createEmotionCache({
44
54
  key: 'css',
45
- prepend: true
46
- });
55
+ insertionPoint
56
+ }, MyStyleSheet);
47
57
  }
48
58
  export default function StyledEngineProvider(props) {
49
59
  const {
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/styled-engine v6.2.1
2
+ * @mui/styled-engine v6.3.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -9,23 +9,11 @@ import { StyleSheet } from '@emotion/sheet';
9
9
  // We might be able to remove this when this issue is fixed:
10
10
  // https://github.com/emotion-js/emotion/issues/2790
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
- const createEmotionCache = options => {
12
+ const createEmotionCache = (options, CustomSheet) => {
13
13
  const cache = createCache(options);
14
14
 
15
- /**
16
- * This is for client-side apps only.
17
- * A custom sheet is required to make the GlobalStyles API work with `prepend: true`.
18
- * This is because the [sheet](https://github.com/emotion-js/emotion/blob/main/packages/react/src/global.js#L94-L99) does not consume the options.
19
- */
20
- class MyStyleSheet extends StyleSheet {
21
- constructor(args) {
22
- super(args);
23
- this.prepend = cache.sheet.prepend;
24
- }
25
- }
26
-
27
15
  // Do the same as https://github.com/emotion-js/emotion/blob/main/packages/cache/src/index.js#L238-L245
28
- cache.sheet = new MyStyleSheet({
16
+ cache.sheet = new CustomSheet({
29
17
  key: cache.key,
30
18
  nonce: cache.sheet.nonce,
31
19
  container: cache.sheet.container,
@@ -35,15 +23,37 @@ const createEmotionCache = options => {
35
23
  });
36
24
  return cache;
37
25
  };
38
-
39
- // prepend: true moves MUI styles to the top of the <head> so they're loaded first.
40
- // It allows developers to easily override MUI styles with other styling solutions, like CSS modules.
41
26
  let cache;
42
27
  if (typeof document === 'object') {
28
+ // Use `insertionPoint` over `prepend`(deprecated) because it can be controlled for GlobalStyles injection order
29
+ // For more information, see https://github.com/mui/material-ui/issues/44597
30
+ let insertionPoint = document.querySelector('[name="emotion-insertion-point"]');
31
+ if (!insertionPoint) {
32
+ insertionPoint = document.createElement('meta');
33
+ insertionPoint.setAttribute('name', 'emotion-insertion-point');
34
+ insertionPoint.setAttribute('content', '');
35
+ const head = document.querySelector('head');
36
+ if (head) {
37
+ head.prepend(insertionPoint);
38
+ }
39
+ }
40
+ /**
41
+ * This is for client-side apps only.
42
+ * A custom sheet is required to make the GlobalStyles API injected above the insertion point.
43
+ * This is because the [sheet](https://github.com/emotion-js/emotion/blob/main/packages/react/src/global.js#L94-L99) does not consume the options.
44
+ */
45
+ class MyStyleSheet extends StyleSheet {
46
+ insert(rule, options) {
47
+ if (this.key && this.key.endsWith('global')) {
48
+ this.before = insertionPoint;
49
+ }
50
+ return super.insert(rule, options);
51
+ }
52
+ }
43
53
  cache = createEmotionCache({
44
54
  key: 'css',
45
- prepend: true
46
- });
55
+ insertionPoint
56
+ }, MyStyleSheet);
47
57
  }
48
58
  export default function StyledEngineProvider(props) {
49
59
  const {
package/modern/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/styled-engine v6.2.1
2
+ * @mui/styled-engine v6.3.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
@@ -15,23 +15,11 @@ var _sheet = require("@emotion/sheet");
15
15
  var _jsxRuntime = require("react/jsx-runtime");
16
16
  // We might be able to remove this when this issue is fixed:
17
17
  // https://github.com/emotion-js/emotion/issues/2790
18
- const createEmotionCache = options => {
18
+ const createEmotionCache = (options, CustomSheet) => {
19
19
  const cache = (0, _cache.default)(options);
20
20
 
21
- /**
22
- * This is for client-side apps only.
23
- * A custom sheet is required to make the GlobalStyles API work with `prepend: true`.
24
- * This is because the [sheet](https://github.com/emotion-js/emotion/blob/main/packages/react/src/global.js#L94-L99) does not consume the options.
25
- */
26
- class MyStyleSheet extends _sheet.StyleSheet {
27
- constructor(args) {
28
- super(args);
29
- this.prepend = cache.sheet.prepend;
30
- }
31
- }
32
-
33
21
  // Do the same as https://github.com/emotion-js/emotion/blob/main/packages/cache/src/index.js#L238-L245
34
- cache.sheet = new MyStyleSheet({
22
+ cache.sheet = new CustomSheet({
35
23
  key: cache.key,
36
24
  nonce: cache.sheet.nonce,
37
25
  container: cache.sheet.container,
@@ -41,15 +29,37 @@ const createEmotionCache = options => {
41
29
  });
42
30
  return cache;
43
31
  };
44
-
45
- // prepend: true moves MUI styles to the top of the <head> so they're loaded first.
46
- // It allows developers to easily override MUI styles with other styling solutions, like CSS modules.
47
32
  let cache;
48
33
  if (typeof document === 'object') {
34
+ // Use `insertionPoint` over `prepend`(deprecated) because it can be controlled for GlobalStyles injection order
35
+ // For more information, see https://github.com/mui/material-ui/issues/44597
36
+ let insertionPoint = document.querySelector('[name="emotion-insertion-point"]');
37
+ if (!insertionPoint) {
38
+ insertionPoint = document.createElement('meta');
39
+ insertionPoint.setAttribute('name', 'emotion-insertion-point');
40
+ insertionPoint.setAttribute('content', '');
41
+ const head = document.querySelector('head');
42
+ if (head) {
43
+ head.prepend(insertionPoint);
44
+ }
45
+ }
46
+ /**
47
+ * This is for client-side apps only.
48
+ * A custom sheet is required to make the GlobalStyles API injected above the insertion point.
49
+ * This is because the [sheet](https://github.com/emotion-js/emotion/blob/main/packages/react/src/global.js#L94-L99) does not consume the options.
50
+ */
51
+ class MyStyleSheet extends _sheet.StyleSheet {
52
+ insert(rule, options) {
53
+ if (this.key && this.key.endsWith('global')) {
54
+ this.before = insertionPoint;
55
+ }
56
+ return super.insert(rule, options);
57
+ }
58
+ }
49
59
  cache = createEmotionCache({
50
60
  key: 'css',
51
- prepend: true
52
- });
61
+ insertionPoint
62
+ }, MyStyleSheet);
53
63
  }
54
64
  function StyledEngineProvider(props) {
55
65
  const {
package/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @mui/styled-engine v6.2.1
2
+ * @mui/styled-engine v6.3.1
3
3
  *
4
4
  * @license MIT
5
5
  * This source code is licensed under the MIT license found in the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/styled-engine",
3
- "version": "6.2.1",
3
+ "version": "6.3.1",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "styled() API wrapper package for emotion.",