@automattic/jetpack-components 1.12.3 → 1.12.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 CHANGED
@@ -2,13 +2,21 @@
2
2
 
3
3
  ### This is a list detailing changes for the Jetpack RNA Components package releases.
4
4
 
5
+ ## [1.12.5] - 2026-06-08
6
+ ### Fixed
7
+ - NavigatorModal: Keep the modal open when the control inside opens an external WP Modal. [#49389]
8
+
9
+ ## [1.12.4] - 2026-06-08
10
+ ### Changed
11
+ - Internal updates.
12
+
5
13
  ## [1.12.3] - 2026-06-03
6
14
  ### Changed
7
15
  - Internal updates.
8
16
 
9
17
  ## [1.12.2] - 2026-06-02
10
18
  ### Changed
11
- - AdminPage: expand the Hello Dolly normalize rule (was a single `background-color`) to cover the full visual treatment (italic, gray text, white background, right-aligned, hidden under 660px) so individual plugins don't need their own per-page overrides. No position/offsets are set so per-page `position: absolute` overrides (e.g. My Jetpack) keep working. [#48472]
19
+ - AdminPage: Expand the Hello Dolly normalize rule to cover the full visual treatment (italic, gray text, white background, right-aligned, hidden under 660px). [#48472]
12
20
 
13
21
  ### Fixed
14
22
  - Pricing table: render feature tooltips as a portal so they are no longer hidden behind the admin sidebar [#49318]
@@ -1824,6 +1832,8 @@
1824
1832
  ### Changed
1825
1833
  - Update node version requirement to 14.16.1
1826
1834
 
1835
+ [1.12.5]: https://github.com/Automattic/jetpack-components/compare/1.12.4...1.12.5
1836
+ [1.12.4]: https://github.com/Automattic/jetpack-components/compare/1.12.3...1.12.4
1827
1837
  [1.12.3]: https://github.com/Automattic/jetpack-components/compare/1.12.2...1.12.3
1828
1838
  [1.12.2]: https://github.com/Automattic/jetpack-components/compare/1.12.1...1.12.2
1829
1839
  [1.12.1]: https://github.com/Automattic/jetpack-components/compare/1.12.0...1.12.1
@@ -16,16 +16,27 @@ function InternalNavigatorModal({ children, className, ...props }) {
16
16
  const { onClose, initialPath } = useContext(NavigatorModalContext);
17
17
  const overlayRef = useRef(null);
18
18
  const isUserInteracting = useRef(false);
19
- // Track pointer interaction on the overlay so we can distinguish
20
- // user-initiated overlay clicks from the WP Modal dismisser mechanism,
21
- // which also calls onRequestClose() without an event argument.
19
+ /*
20
+ * Track pointer interaction on the overlay so we can distinguish
21
+ * user-initiated overlay (backdrop) clicks from the WP Modal dismisser
22
+ * mechanism, which also calls onRequestClose() without an event argument.
23
+ *
24
+ * Only a pointerdown on the overlay element itself counts as a backdrop
25
+ * interaction — mirroring WP Modal's own `event.target === event.currentTarget`
26
+ * check. Without this target guard, a pointerdown on any control inside the
27
+ * modal (e.g. the "Generate image" button) would bubble up and set the flag,
28
+ * so when that control opens an external Modal (Image Studio) the resulting
29
+ * dismisser call would be misread as an overlay click and wrongly close us.
30
+ */
22
31
  useEffect(() => {
23
32
  const overlay = overlayRef.current;
24
33
  if (!overlay) {
25
34
  return;
26
35
  }
27
- const handler = () => {
28
- isUserInteracting.current = true;
36
+ const handler = (event) => {
37
+ if (event.target === overlay) {
38
+ isUserInteracting.current = true;
39
+ }
29
40
  };
30
41
  overlay.addEventListener('pointerdown', handler);
31
42
  return () => overlay.removeEventListener('pointerdown', handler);
@@ -27,16 +27,27 @@ function InternalNavigatorModal( {
27
27
  const overlayRef = useRef< HTMLDivElement >( null );
28
28
  const isUserInteracting = useRef( false );
29
29
 
30
- // Track pointer interaction on the overlay so we can distinguish
31
- // user-initiated overlay clicks from the WP Modal dismisser mechanism,
32
- // which also calls onRequestClose() without an event argument.
30
+ /*
31
+ * Track pointer interaction on the overlay so we can distinguish
32
+ * user-initiated overlay (backdrop) clicks from the WP Modal dismisser
33
+ * mechanism, which also calls onRequestClose() without an event argument.
34
+ *
35
+ * Only a pointerdown on the overlay element itself counts as a backdrop
36
+ * interaction — mirroring WP Modal's own `event.target === event.currentTarget`
37
+ * check. Without this target guard, a pointerdown on any control inside the
38
+ * modal (e.g. the "Generate image" button) would bubble up and set the flag,
39
+ * so when that control opens an external Modal (Image Studio) the resulting
40
+ * dismisser call would be misread as an overlay click and wrongly close us.
41
+ */
33
42
  useEffect( () => {
34
43
  const overlay = overlayRef.current;
35
44
  if ( ! overlay ) {
36
45
  return;
37
46
  }
38
- const handler = () => {
39
- isUserInteracting.current = true;
47
+ const handler = ( event: PointerEvent ) => {
48
+ if ( event.target === overlay ) {
49
+ isUserInteracting.current = true;
50
+ }
40
51
  };
41
52
  overlay.addEventListener( 'pointerdown', handler );
42
53
  return () => overlay.removeEventListener( 'pointerdown', handler );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/jetpack-components",
3
- "version": "1.12.3",
3
+ "version": "1.12.5",
4
4
  "description": "Jetpack Components Package",
5
5
  "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/components/#readme",
6
6
  "bugs": {
@@ -73,10 +73,10 @@
73
73
  ],
74
74
  "dependencies": {
75
75
  "@automattic/format-currency": "1.0.1",
76
- "@automattic/jetpack-api": "^1.0.27",
77
- "@automattic/jetpack-boost-score-api": "^1.0.45",
76
+ "@automattic/jetpack-api": "^1.0.28",
77
+ "@automattic/jetpack-boost-score-api": "^1.0.46",
78
78
  "@automattic/jetpack-script-data": "^0.6.4",
79
- "@automattic/number-formatters": "^1.2.1",
79
+ "@automattic/number-formatters": "^1.2.2",
80
80
  "@babel/runtime": "^7",
81
81
  "@gravatar-com/hovercards": "0.16.0",
82
82
  "@wordpress/admin-ui": "2.1.0",