@mui/utils 6.1.7 → 6.1.9
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 +99 -0
- package/deepmerge/deepmerge.js +6 -2
- package/esm/deepmerge/deepmerge.js +6 -2
- package/esm/useForkRef/useForkRef.js +17 -0
- package/index.js +1 -1
- package/modern/deepmerge/deepmerge.js +6 -2
- package/modern/index.js +1 -1
- package/modern/useForkRef/useForkRef.js +17 -0
- package/package.json +1 -1
- package/useForkRef/useForkRef.d.ts +16 -0
- package/useForkRef/useForkRef.js +16 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,104 @@
|
|
|
1
1
|
# [Versions](https://mui.com/versions/)
|
|
2
2
|
|
|
3
|
+
## 6.1.9
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v6.1.8..master -->
|
|
6
|
+
|
|
7
|
+
_Nov 27, 2024_
|
|
8
|
+
|
|
9
|
+
A big thanks to the 8 contributors who made this release possible.
|
|
10
|
+
|
|
11
|
+
### `@mui/material@6.1.9`
|
|
12
|
+
|
|
13
|
+
- [Select] Omit `placeholder` from props (#44502) @Juneezee
|
|
14
|
+
- [Grid2] Add container class to `Grid2Classes` (#44562) @sai6855
|
|
15
|
+
|
|
16
|
+
### `@mui/system@6.1.9`
|
|
17
|
+
|
|
18
|
+
- Add ThemeProvider `noSsr` to prevent double rendering (#44451) @siriwatknp
|
|
19
|
+
|
|
20
|
+
### `@mui/codemod@6.1.9`
|
|
21
|
+
|
|
22
|
+
- [codemod] Fix handling of computed `paragraph` props (#44195) @joshkel
|
|
23
|
+
|
|
24
|
+
### `@mui/material-pigment-css@6.1.9`
|
|
25
|
+
|
|
26
|
+
- Make @pigment-css/react as peer dependency (#44498) @brijeshb42
|
|
27
|
+
|
|
28
|
+
### Docs
|
|
29
|
+
|
|
30
|
+
- [material-ui] Add missing required dependencies in dashboard template README (#44476) @mesqueeb
|
|
31
|
+
- [material-ui] Add missing Roboto import to Next.js integration docs (#44462) @StaceyD22
|
|
32
|
+
- [material-ui][Dialog] Fix padding in SimpleDialog demo (#44467) @oliviertassinari
|
|
33
|
+
- Fix template page issues (#44466) @oliviertassinari
|
|
34
|
+
- [examples] Add dark mode example for Material UI + Pigment CSS (#44480) @mnajdova
|
|
35
|
+
|
|
36
|
+
### Core
|
|
37
|
+
|
|
38
|
+
- Remove TODO line in the changelog (#44484) @mnajdova
|
|
39
|
+
- Polish image display (418e888) @oliviertassinari
|
|
40
|
+
- [core-infra] Add no-relative-packages (#44489) @oliviertassinari
|
|
41
|
+
- [docs-infra] Support CSS variables API info (#44559) @mnajdova
|
|
42
|
+
- [docs-infra] Fix display when ad-block triggers (#44567) @oliviertassinari
|
|
43
|
+
- [docs-infra] Improve locator finding using visible option (#44541) @siriwatknp
|
|
44
|
+
- [docs-infra] Correctly flatten the pages tree (#44514) @oliviertassinari
|
|
45
|
+
- [docs-infra] Fix Sponsor design regression (#44515) @oliviertassinari
|
|
46
|
+
- [test] Remove React.ReactElement<any> from describeConformance.tsx (#44318) @sai6855
|
|
47
|
+
- [test] Do not enforce the presence of `ownerState.className` in `describeConformance` (#44479) @flaviendelangle
|
|
48
|
+
|
|
49
|
+
All contributors of this release in alphabetical order: @brijeshb42, @flaviendelangle, @joshkel, @Juneezee, @mesqueeb, @mnajdova, @oliviertassinari, @sai6855, @siriwatknp, @StaceyD22
|
|
50
|
+
|
|
51
|
+
## v6.1.8
|
|
52
|
+
|
|
53
|
+
<!-- generated comparing v6.1.7..master -->
|
|
54
|
+
|
|
55
|
+
_Nov 20, 2024_
|
|
56
|
+
|
|
57
|
+
A big thanks to the 10 contributors who made this release possible.
|
|
58
|
+
|
|
59
|
+
### `@mui/material@6.1.8`
|
|
60
|
+
|
|
61
|
+
- [Autocomplete] Use `ul` element for the listbox (#44422) @DiegoAndai
|
|
62
|
+
- [Grid2] Remove item and zeroMinWidth classes from grid2Classes (#44419) @sai6855
|
|
63
|
+
- [StepIcon] Add SvgIconOwnProps type to StepIcon props (#44337) @sai6855
|
|
64
|
+
- Add generic back to `useMediaQuery` to prevent a breaking change (#44455) @siriwatknp
|
|
65
|
+
- [Tooltip] Deprecate `*Component` and `*Props` for v6 (#44350) @siriwatknp
|
|
66
|
+
|
|
67
|
+
### `@mui/system@6.1.8`
|
|
68
|
+
|
|
69
|
+
- Warn when calling `setMode` without configuring `colorSchemeSelector` (#43783) @siriwatknp
|
|
70
|
+
|
|
71
|
+
### `@mui/styled-engine@6.1.8`
|
|
72
|
+
|
|
73
|
+
- Add back removed internal function (#44421) @mnajdova
|
|
74
|
+
|
|
75
|
+
### `@mui/utils@6.1.8`
|
|
76
|
+
|
|
77
|
+
- Skip deep clone React element (#44400) @siriwatknp
|
|
78
|
+
- Add documentation to `useForkRef` (#44410) @JCQuintas
|
|
79
|
+
|
|
80
|
+
### Docs
|
|
81
|
+
|
|
82
|
+
- [Accordion] Replace hardcoded classes with constants in demos (#44453) @ZeeshanTamboli
|
|
83
|
+
- [material-ui][Autocomplete] Fix virtualization demo (#44382) @DiegoAndai
|
|
84
|
+
- Revert #44388 (#44454) @prakhargupta1
|
|
85
|
+
- Add App starters in related-projects.md (#44315) @oliviertassinari
|
|
86
|
+
- Bring back `*Component` and `*Props` codemods and deprecation messages (#44383) @DiegoAndai
|
|
87
|
+
- [docs] Copyedit Templates page (#44461) @samuelsycamore
|
|
88
|
+
|
|
89
|
+
### Core
|
|
90
|
+
|
|
91
|
+
- Remove `stylis-plugin-rtl-sc` (#44447) @renovate[bot]
|
|
92
|
+
- [test][Autocomplete] Make virtualize regression screenshots deterministic (#44425) @DiegoAndai
|
|
93
|
+
- [blog] Fix reference to subdomain on MUI X v8 alpha zero post (#44416) @joserodolfofreitas
|
|
94
|
+
- [blog] MUI X v8 alpha zero blog post (#44377) @joserodolfofreitas
|
|
95
|
+
- [code-infra] Use vitest-compatible skip in `describeConformance` (#44412) @JCQuintas
|
|
96
|
+
- Keep OpenSSF badge up-to-date (aef2bf2) @oliviertassinari
|
|
97
|
+
- Polish useForkRef docs (#44424) @oliviertassinari
|
|
98
|
+
- [infra] Upgrade Cherry-pick workflow to latest (#44448) @oliviertassinari
|
|
99
|
+
|
|
100
|
+
All contributors of this release in alphabetical order: @DiegoAndai, @JCQuintas, @joserodolfofreitas, @mnajdova, @oliviertassinari, @prakhargupta1, @sai6855, samuelsycamore, @siriwatknp, @ZeeshanTamboli
|
|
101
|
+
|
|
3
102
|
## v6.1.7
|
|
4
103
|
|
|
5
104
|
<!-- generated comparing v6.1.6..master -->
|
package/deepmerge/deepmerge.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.default = deepmerge;
|
|
7
8
|
exports.isPlainObject = isPlainObject;
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
10
|
// https://github.com/sindresorhus/is-plain-obj/blob/main/index.js
|
|
9
11
|
function isPlainObject(item) {
|
|
10
12
|
if (typeof item !== 'object' || item === null) {
|
|
@@ -14,7 +16,7 @@ function isPlainObject(item) {
|
|
|
14
16
|
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in item) && !(Symbol.iterator in item);
|
|
15
17
|
}
|
|
16
18
|
function deepClone(source) {
|
|
17
|
-
if (!isPlainObject(source)) {
|
|
19
|
+
if (/*#__PURE__*/React.isValidElement(source) || !isPlainObject(source)) {
|
|
18
20
|
return source;
|
|
19
21
|
}
|
|
20
22
|
const output = {};
|
|
@@ -31,7 +33,9 @@ function deepmerge(target, source, options = {
|
|
|
31
33
|
} : target;
|
|
32
34
|
if (isPlainObject(target) && isPlainObject(source)) {
|
|
33
35
|
Object.keys(source).forEach(key => {
|
|
34
|
-
if (
|
|
36
|
+
if (/*#__PURE__*/React.isValidElement(source[key])) {
|
|
37
|
+
output[key] = source[key];
|
|
38
|
+
} else if (isPlainObject(source[key]) &&
|
|
35
39
|
// Avoid prototype pollution
|
|
36
40
|
Object.prototype.hasOwnProperty.call(target, key) && isPlainObject(target[key])) {
|
|
37
41
|
// Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
1
3
|
// https://github.com/sindresorhus/is-plain-obj/blob/main/index.js
|
|
2
4
|
export function isPlainObject(item) {
|
|
3
5
|
if (typeof item !== 'object' || item === null) {
|
|
@@ -7,7 +9,7 @@ export function isPlainObject(item) {
|
|
|
7
9
|
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in item) && !(Symbol.iterator in item);
|
|
8
10
|
}
|
|
9
11
|
function deepClone(source) {
|
|
10
|
-
if (!isPlainObject(source)) {
|
|
12
|
+
if (/*#__PURE__*/React.isValidElement(source) || !isPlainObject(source)) {
|
|
11
13
|
return source;
|
|
12
14
|
}
|
|
13
15
|
const output = {};
|
|
@@ -24,7 +26,9 @@ export default function deepmerge(target, source, options = {
|
|
|
24
26
|
} : target;
|
|
25
27
|
if (isPlainObject(target) && isPlainObject(source)) {
|
|
26
28
|
Object.keys(source).forEach(key => {
|
|
27
|
-
if (
|
|
29
|
+
if (/*#__PURE__*/React.isValidElement(source[key])) {
|
|
30
|
+
output[key] = source[key];
|
|
31
|
+
} else if (isPlainObject(source[key]) &&
|
|
28
32
|
// Avoid prototype pollution
|
|
29
33
|
Object.prototype.hasOwnProperty.call(target, key) && isPlainObject(target[key])) {
|
|
30
34
|
// Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.
|
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import setRef from "../setRef/index.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Takes an array of refs and returns a new ref which will apply any modification to all of the refs.
|
|
8
|
+
* This is useful when you want to have the ref used in multiple places.
|
|
9
|
+
*
|
|
10
|
+
* ```tsx
|
|
11
|
+
* const rootRef = React.useRef<Instance>(null);
|
|
12
|
+
* const refFork = useForkRef(rootRef, props.ref);
|
|
13
|
+
*
|
|
14
|
+
* return (
|
|
15
|
+
* <Root {...props} ref={refFork} />
|
|
16
|
+
* );
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @param {Array<React.Ref<Instance> | undefined>} refs The ref array.
|
|
20
|
+
* @returns {React.RefCallback<Instance> | null} The new ref callback.
|
|
21
|
+
*/
|
|
5
22
|
export default function useForkRef(...refs) {
|
|
6
23
|
/**
|
|
7
24
|
* This will create a new function if the refs passed to this hook change and are all defined.
|
package/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
1
3
|
// https://github.com/sindresorhus/is-plain-obj/blob/main/index.js
|
|
2
4
|
export function isPlainObject(item) {
|
|
3
5
|
if (typeof item !== 'object' || item === null) {
|
|
@@ -7,7 +9,7 @@ export function isPlainObject(item) {
|
|
|
7
9
|
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in item) && !(Symbol.iterator in item);
|
|
8
10
|
}
|
|
9
11
|
function deepClone(source) {
|
|
10
|
-
if (!isPlainObject(source)) {
|
|
12
|
+
if (/*#__PURE__*/React.isValidElement(source) || !isPlainObject(source)) {
|
|
11
13
|
return source;
|
|
12
14
|
}
|
|
13
15
|
const output = {};
|
|
@@ -24,7 +26,9 @@ export default function deepmerge(target, source, options = {
|
|
|
24
26
|
} : target;
|
|
25
27
|
if (isPlainObject(target) && isPlainObject(source)) {
|
|
26
28
|
Object.keys(source).forEach(key => {
|
|
27
|
-
if (
|
|
29
|
+
if (/*#__PURE__*/React.isValidElement(source[key])) {
|
|
30
|
+
output[key] = source[key];
|
|
31
|
+
} else if (isPlainObject(source[key]) &&
|
|
28
32
|
// Avoid prototype pollution
|
|
29
33
|
Object.prototype.hasOwnProperty.call(target, key) && isPlainObject(target[key])) {
|
|
30
34
|
// Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.
|
package/modern/index.js
CHANGED
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import setRef from "../setRef/index.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Takes an array of refs and returns a new ref which will apply any modification to all of the refs.
|
|
8
|
+
* This is useful when you want to have the ref used in multiple places.
|
|
9
|
+
*
|
|
10
|
+
* ```tsx
|
|
11
|
+
* const rootRef = React.useRef<Instance>(null);
|
|
12
|
+
* const refFork = useForkRef(rootRef, props.ref);
|
|
13
|
+
*
|
|
14
|
+
* return (
|
|
15
|
+
* <Root {...props} ref={refFork} />
|
|
16
|
+
* );
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @param {Array<React.Ref<Instance> | undefined>} refs The ref array.
|
|
20
|
+
* @returns {React.RefCallback<Instance> | null} The new ref callback.
|
|
21
|
+
*/
|
|
5
22
|
export default function useForkRef(...refs) {
|
|
6
23
|
/**
|
|
7
24
|
* This will create a new function if the refs passed to this hook change and are all defined.
|
package/package.json
CHANGED
|
@@ -1,2 +1,18 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Takes an array of refs and returns a new ref which will apply any modification to all of the refs.
|
|
4
|
+
* This is useful when you want to have the ref used in multiple places.
|
|
5
|
+
*
|
|
6
|
+
* ```tsx
|
|
7
|
+
* const rootRef = React.useRef<Instance>(null);
|
|
8
|
+
* const refFork = useForkRef(rootRef, props.ref);
|
|
9
|
+
*
|
|
10
|
+
* return (
|
|
11
|
+
* <Root {...props} ref={refFork} />
|
|
12
|
+
* );
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @param {Array<React.Ref<Instance> | undefined>} refs The ref array.
|
|
16
|
+
* @returns {React.RefCallback<Instance> | null} The new ref callback.
|
|
17
|
+
*/
|
|
2
18
|
export default function useForkRef<Instance>(...refs: Array<React.Ref<Instance> | undefined>): React.RefCallback<Instance> | null;
|
package/useForkRef/useForkRef.js
CHANGED
|
@@ -9,6 +9,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
exports.default = useForkRef;
|
|
10
10
|
var React = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _setRef = _interopRequireDefault(require("../setRef"));
|
|
12
|
+
/**
|
|
13
|
+
* Takes an array of refs and returns a new ref which will apply any modification to all of the refs.
|
|
14
|
+
* This is useful when you want to have the ref used in multiple places.
|
|
15
|
+
*
|
|
16
|
+
* ```tsx
|
|
17
|
+
* const rootRef = React.useRef<Instance>(null);
|
|
18
|
+
* const refFork = useForkRef(rootRef, props.ref);
|
|
19
|
+
*
|
|
20
|
+
* return (
|
|
21
|
+
* <Root {...props} ref={refFork} />
|
|
22
|
+
* );
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @param {Array<React.Ref<Instance> | undefined>} refs The ref array.
|
|
26
|
+
* @returns {React.RefCallback<Instance> | null} The new ref callback.
|
|
27
|
+
*/
|
|
12
28
|
function useForkRef(...refs) {
|
|
13
29
|
/**
|
|
14
30
|
* This will create a new function if the refs passed to this hook change and are all defined.
|