@automattic/jetpack-components 1.4.15 → 1.4.16
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 +10 -0
- package/build/components/button/index.d.ts +1 -1
- package/build/components/layout/container/style.module.scss +2 -2
- package/build/components/navigator-modal/index.js +14 -3
- package/components/button/index.tsx +1 -1
- package/components/layout/container/style.module.scss +2 -2
- package/components/navigator-modal/index.tsx +19 -4
- package/package.json +19 -19
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
### This is a list detailing changes for the Jetpack RNA Components package releases.
|
|
4
4
|
|
|
5
|
+
## [1.4.16] - 2026-02-26
|
|
6
|
+
### Changed
|
|
7
|
+
- Container: Adjust maximum width to 1040px. [#47308]
|
|
8
|
+
- Update package dependencies. [#47285] [#47300] [#47309]
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- Button: Loosen `ref` type from `HTMLInputElement` to `HTMLElement`. [#47300]
|
|
12
|
+
- NavigatorModal: Guard against WordPress Modal dismisser mechanism to prevent the modal from being closed when an external modal (e.g. Image Studio) opens. [#47180]
|
|
13
|
+
|
|
5
14
|
## [1.4.15] - 2026-02-23
|
|
6
15
|
### Changed
|
|
7
16
|
- Update dependencies.
|
|
@@ -1663,6 +1672,7 @@
|
|
|
1663
1672
|
### Changed
|
|
1664
1673
|
- Update node version requirement to 14.16.1
|
|
1665
1674
|
|
|
1675
|
+
[1.4.16]: https://github.com/Automattic/jetpack-components/compare/1.4.15...1.4.16
|
|
1666
1676
|
[1.4.15]: https://github.com/Automattic/jetpack-components/compare/1.4.14...1.4.15
|
|
1667
1677
|
[1.4.14]: https://github.com/Automattic/jetpack-components/compare/1.4.13...1.4.14
|
|
1668
1678
|
[1.4.13]: https://github.com/Automattic/jetpack-components/compare/1.4.12...1.4.13
|
|
@@ -5,5 +5,5 @@ import type { ButtonProps } from './types.ts';
|
|
|
5
5
|
* @param {ButtonProps} props - Component Props
|
|
6
6
|
* @return {ReactNode} Rendered button
|
|
7
7
|
*/
|
|
8
|
-
declare const Button: import("react").ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & import("react").RefAttributes<
|
|
8
|
+
declare const Button: import("react").ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
9
9
|
export default Button;
|
|
@@ -8,11 +8,12 @@
|
|
|
8
8
|
@include breakpoints.media(#{$size}) using ($columns) {
|
|
9
9
|
padding: 0 #{$padding};
|
|
10
10
|
grid-template-columns: repeat(#{$columns}, minmax(0, 1fr));
|
|
11
|
+
max-width: calc(var(--max-container-width) + 2 * #{$padding});
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
.container {
|
|
15
|
-
--max-container-width:
|
|
16
|
+
--max-container-width: 1040px;
|
|
16
17
|
// vertical spacing
|
|
17
18
|
--vertical-gutter: 24px;
|
|
18
19
|
// horizontal spacing
|
|
@@ -20,7 +21,6 @@
|
|
|
20
21
|
|
|
21
22
|
display: grid;
|
|
22
23
|
column-gap: var(--vertical-gutter);
|
|
23
|
-
max-width: var(--max-container-width);
|
|
24
24
|
margin: 0 auto;
|
|
25
25
|
width: 100%;
|
|
26
26
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Modal, Navigator } from '@wordpress/components';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
-
import { useContext } from 'react';
|
|
4
|
+
import { useCallback, useContext } from 'react';
|
|
5
5
|
import { NavigatorModalContext } from "./context.js";
|
|
6
6
|
import { Screen } from "./screen.js";
|
|
7
7
|
import './styles.scss';
|
|
@@ -13,8 +13,19 @@ import './styles.scss';
|
|
|
13
13
|
* @return Component
|
|
14
14
|
*/
|
|
15
15
|
function InternalNavigatorModal({ children, className, ...props }) {
|
|
16
|
-
const
|
|
17
|
-
|
|
16
|
+
const { onClose, initialPath } = useContext(NavigatorModalContext);
|
|
17
|
+
// WordPress Modal's dismisser mechanism (ModalContext) calls onRequestClose()
|
|
18
|
+
// without arguments when another non-nested Modal mounts. We guard against
|
|
19
|
+
// this so that external modals (e.g. Image Studio) don't destroy this one.
|
|
20
|
+
// User-initiated closes (Escape, close button) always pass an event.
|
|
21
|
+
// The NavigatorModal's own Header/Footer close buttons call context.onClose
|
|
22
|
+
// directly and are unaffected by this guard.
|
|
23
|
+
const onRequestClose = useCallback((event) => {
|
|
24
|
+
if (event) {
|
|
25
|
+
onClose?.();
|
|
26
|
+
}
|
|
27
|
+
}, [onClose]);
|
|
28
|
+
return (_jsx(Modal, { __experimentalHideHeader: true, onRequestClose: onRequestClose, className: clsx('jp-navigator-modal', className), ...props, children: _jsx(Navigator, { initialPath: initialPath, className: "jp-navigator-modal__navigator", children: children }) }));
|
|
18
29
|
}
|
|
19
30
|
/**
|
|
20
31
|
* Renders a modal with navigator capabilities.
|
|
@@ -12,7 +12,7 @@ import type { ButtonProps } from './types.ts';
|
|
|
12
12
|
* @param {ButtonProps} props - Component Props
|
|
13
13
|
* @return {ReactNode} Rendered button
|
|
14
14
|
*/
|
|
15
|
-
const Button = forwardRef<
|
|
15
|
+
const Button = forwardRef< HTMLElement, ButtonProps >( ( props, ref ) => {
|
|
16
16
|
const {
|
|
17
17
|
children,
|
|
18
18
|
variant = 'primary',
|
|
@@ -8,11 +8,12 @@
|
|
|
8
8
|
@include breakpoints.media(#{$size}) using ($columns) {
|
|
9
9
|
padding: 0 #{$padding};
|
|
10
10
|
grid-template-columns: repeat(#{$columns}, minmax(0, 1fr));
|
|
11
|
+
max-width: calc(var(--max-container-width) + 2 * #{$padding});
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
.container {
|
|
15
|
-
--max-container-width:
|
|
16
|
+
--max-container-width: 1040px;
|
|
16
17
|
// vertical spacing
|
|
17
18
|
--vertical-gutter: 24px;
|
|
18
19
|
// horizontal spacing
|
|
@@ -20,7 +21,6 @@
|
|
|
20
21
|
|
|
21
22
|
display: grid;
|
|
22
23
|
column-gap: var(--vertical-gutter);
|
|
23
|
-
max-width: var(--max-container-width);
|
|
24
24
|
margin: 0 auto;
|
|
25
25
|
width: 100%;
|
|
26
26
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Modal, Navigator } from '@wordpress/components';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import { useContext } from 'react';
|
|
3
|
+
import { useCallback, useContext } from 'react';
|
|
4
4
|
import { NavigatorModalContext } from './context.ts';
|
|
5
5
|
import { Screen } from './screen.tsx';
|
|
6
6
|
import './styles.scss';
|
|
@@ -23,16 +23,31 @@ function InternalNavigatorModal( {
|
|
|
23
23
|
className,
|
|
24
24
|
...props
|
|
25
25
|
}: Omit< ModalProps, 'onRequestClose' > ) {
|
|
26
|
-
const
|
|
26
|
+
const { onClose, initialPath } = useContext( NavigatorModalContext );
|
|
27
|
+
|
|
28
|
+
// WordPress Modal's dismisser mechanism (ModalContext) calls onRequestClose()
|
|
29
|
+
// without arguments when another non-nested Modal mounts. We guard against
|
|
30
|
+
// this so that external modals (e.g. Image Studio) don't destroy this one.
|
|
31
|
+
// User-initiated closes (Escape, close button) always pass an event.
|
|
32
|
+
// The NavigatorModal's own Header/Footer close buttons call context.onClose
|
|
33
|
+
// directly and are unaffected by this guard.
|
|
34
|
+
const onRequestClose = useCallback(
|
|
35
|
+
( event?: React.SyntheticEvent ) => {
|
|
36
|
+
if ( event ) {
|
|
37
|
+
onClose?.();
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
[ onClose ]
|
|
41
|
+
);
|
|
27
42
|
|
|
28
43
|
return (
|
|
29
44
|
<Modal
|
|
30
45
|
__experimentalHideHeader
|
|
31
|
-
onRequestClose={
|
|
46
|
+
onRequestClose={ onRequestClose }
|
|
32
47
|
className={ clsx( 'jp-navigator-modal', className ) }
|
|
33
48
|
{ ...props }
|
|
34
49
|
>
|
|
35
|
-
<Navigator initialPath={
|
|
50
|
+
<Navigator initialPath={ initialPath } className="jp-navigator-modal__navigator">
|
|
36
51
|
{ children }
|
|
37
52
|
</Navigator>
|
|
38
53
|
</Modal>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automattic/jetpack-components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.16",
|
|
4
4
|
"description": "Jetpack Components Package",
|
|
5
5
|
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/components/#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -45,47 +45,47 @@
|
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@automattic/format-currency": "1.0.1",
|
|
48
|
-
"@automattic/jetpack-api": "^1.0.
|
|
49
|
-
"@automattic/jetpack-boost-score-api": "^1.0.
|
|
50
|
-
"@automattic/jetpack-script-data": "^0.
|
|
48
|
+
"@automattic/jetpack-api": "^1.0.18",
|
|
49
|
+
"@automattic/jetpack-boost-score-api": "^1.0.31",
|
|
50
|
+
"@automattic/jetpack-script-data": "^0.6.0",
|
|
51
51
|
"@automattic/number-formatters": "^1.1.0",
|
|
52
52
|
"@babel/runtime": "^7",
|
|
53
|
-
"@wordpress/browserslist-config": "6.
|
|
54
|
-
"@wordpress/components": "32.
|
|
55
|
-
"@wordpress/compose": "7.
|
|
56
|
-
"@wordpress/data": "10.
|
|
57
|
-
"@wordpress/date": "5.
|
|
58
|
-
"@wordpress/element": "6.
|
|
59
|
-
"@wordpress/i18n": "6.
|
|
60
|
-
"@wordpress/icons": "11.
|
|
61
|
-
"@wordpress/notices": "5.
|
|
53
|
+
"@wordpress/browserslist-config": "6.40.0",
|
|
54
|
+
"@wordpress/components": "32.2.0",
|
|
55
|
+
"@wordpress/compose": "7.40.0",
|
|
56
|
+
"@wordpress/data": "10.40.0",
|
|
57
|
+
"@wordpress/date": "5.40.0",
|
|
58
|
+
"@wordpress/element": "6.40.0",
|
|
59
|
+
"@wordpress/i18n": "6.13.0",
|
|
60
|
+
"@wordpress/icons": "11.7.0",
|
|
61
|
+
"@wordpress/notices": "5.40.0",
|
|
62
62
|
"clsx": "2.1.1",
|
|
63
63
|
"prop-types": "^15.7.2",
|
|
64
64
|
"qrcode.react": "4.2.0",
|
|
65
65
|
"react-slider": "2.0.5",
|
|
66
|
-
"social-logos": "^3.3.
|
|
66
|
+
"social-logos": "^3.3.10",
|
|
67
67
|
"uplot": "1.6.31",
|
|
68
68
|
"uplot-react": "1.1.4"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@automattic/jetpack-base-styles": "^1.0.
|
|
71
|
+
"@automattic/jetpack-base-styles": "^1.0.18",
|
|
72
72
|
"@babel/core": "7.29.0",
|
|
73
73
|
"@babel/preset-react": "7.28.5",
|
|
74
74
|
"@jest/globals": "30.2.0",
|
|
75
|
-
"@storybook/addon-docs": "10.2.
|
|
76
|
-
"@storybook/react": "10.2.
|
|
75
|
+
"@storybook/addon-docs": "10.2.11",
|
|
76
|
+
"@storybook/react": "10.2.11",
|
|
77
77
|
"@testing-library/dom": "10.4.1",
|
|
78
78
|
"@testing-library/react": "16.3.0",
|
|
79
79
|
"@testing-library/user-event": "14.6.1",
|
|
80
80
|
"@types/jest": "30.0.0",
|
|
81
|
-
"@types/react": "18.3.
|
|
81
|
+
"@types/react": "18.3.28",
|
|
82
82
|
"@types/react-dom": "18.3.7",
|
|
83
83
|
"@types/react-slider": "1.3.6",
|
|
84
84
|
"jest": "30.2.0",
|
|
85
85
|
"react": "18.3.1",
|
|
86
86
|
"react-dom": "18.3.1",
|
|
87
87
|
"require-from-string": "2.0.2",
|
|
88
|
-
"storybook": "10.2.
|
|
88
|
+
"storybook": "10.2.11",
|
|
89
89
|
"ts-dedent": "2.2.0",
|
|
90
90
|
"typescript": "5.9.3",
|
|
91
91
|
"webpack": "5.105.2",
|