@automattic/jetpack-components 3.1.0 → 3.1.2

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,6 +2,15 @@
2
2
 
3
3
  ### This is a list detailing changes for the Jetpack RNA Components package releases.
4
4
 
5
+ ## [3.1.2] - 2026-09-23
6
+ ### Fixed
7
+ - DiffViewer: Fix some inefficient regular expressions. [#52582]
8
+ - Footer: Hide Products and Help links when My Jetpack is unavailable. [#52557]
9
+
10
+ ## [3.1.1] - 2026-09-21
11
+ ### Changed
12
+ - Update dependencies.
13
+
5
14
  ## [3.1.0] - 2026-09-18
6
15
  ### Added
7
16
  - IconTooltip: Add a `popoverClassName` prop to style the popover when it renders outside its wrapper. [#52465]
@@ -1946,6 +1955,8 @@
1946
1955
  ### Changed
1947
1956
  - Update node version requirement to 14.16.1
1948
1957
 
1958
+ [3.1.2]: https://github.com/Automattic/jetpack-components/compare/3.1.1...3.1.2
1959
+ [3.1.1]: https://github.com/Automattic/jetpack-components/compare/3.1.0...3.1.1
1949
1960
  [3.1.0]: https://github.com/Automattic/jetpack-components/compare/3.0.3...3.1.0
1950
1961
  [3.0.3]: https://github.com/Automattic/jetpack-components/compare/3.0.2...3.0.3
1951
1962
  [3.0.2]: https://github.com/Automattic/jetpack-components/compare/3.0.1...3.0.2
@@ -24,9 +24,9 @@ export default function parsePatch(uniDiff) {
24
24
  break;
25
25
  }
26
26
  // Diff index
27
- const header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line);
27
+ const header = /^(?:Index:|diff(?: -r \w+)+)\s+/.exec(line);
28
28
  if (header) {
29
- index.index = header[1];
29
+ index.index = line.substring(header[0].length).trim();
30
30
  }
31
31
  i++;
32
32
  }
@@ -63,7 +63,7 @@ export default function parsePatch(uniDiff) {
63
63
  * @param {object[]} index.hunks - hunks
64
64
  */
65
65
  function parseFileHeader(index) {
66
- const fileHeader = /^(---|\+\+\+)\s+(.*)\r?$/.exec(diffstr[i]);
66
+ const fileHeader = /^(---|\+\+\+)\s+(\S.*|)\r?$/.exec(diffstr[i]);
67
67
  if (fileHeader) {
68
68
  const keyPrefix = fileHeader[1] === '---' ? 'old' : 'new';
69
69
  const data = fileHeader[2].split('\t', 2);
@@ -15,7 +15,9 @@ import JetpackLogo from '../jetpack-logo/index.js';
15
15
  */
16
16
  const JetpackFooter = ({ className, menu, ...otherProps }) => {
17
17
  let items = [];
18
- if (!isWpcomPlatformSite() && !window?.JetpackNetworkAdminData) {
18
+ if (getScriptData()?.myJetpack?.isAvailable === true &&
19
+ !isWpcomPlatformSite() &&
20
+ !window?.JetpackNetworkAdminData) {
19
21
  // Published by My Jetpack, whose products tab can be renamed Features.
20
22
  const productsSection = getScriptData()?.myJetpack?.productsSection;
21
23
  items = [
@@ -46,10 +46,10 @@ export default function parsePatch( uniDiff: string ) {
46
46
  }
47
47
 
48
48
  // Diff index
49
- const header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec( line );
49
+ const header = /^(?:Index:|diff(?: -r \w+)+)\s+/.exec( line );
50
50
 
51
51
  if ( header ) {
52
- index.index = header[ 1 ];
52
+ index.index = line.substring( header[ 0 ].length ).trim();
53
53
  }
54
54
 
55
55
  i++;
@@ -93,7 +93,7 @@ export default function parsePatch( uniDiff: string ) {
93
93
  * @param {object[]} index.hunks - hunks
94
94
  */
95
95
  function parseFileHeader( index: Index ) {
96
- const fileHeader = /^(---|\+\+\+)\s+(.*)\r?$/.exec( diffstr[ i ] );
96
+ const fileHeader = /^(---|\+\+\+)\s+(\S.*|)\r?$/.exec( diffstr[ i ] );
97
97
 
98
98
  if ( fileHeader ) {
99
99
  const keyPrefix = fileHeader[ 1 ] === '---' ? 'old' : 'new';
@@ -2,6 +2,8 @@
2
2
 
3
3
  Component that renders Jetpack Admin Footer.
4
4
 
5
+ The default Products (or Features) and Help links appear only when My Jetpack reports that its admin page is available to the current user. They are also hidden on WordPress.com platform sites and in network admin. Additional links supplied through `menu` are still rendered when the default links are hidden.
6
+
5
7
  ## How to use
6
8
 
7
9
  Note that most of the time you would just use `admin-page` component, which includes the footer. If you must use footer independently, basic usage is:
@@ -27,7 +27,11 @@ declare global {
27
27
  const JetpackFooter: FC< JetpackFooterProps > = ( { className, menu, ...otherProps } ) => {
28
28
  let items: JetpackFooterMenuItem[] = [];
29
29
 
30
- if ( ! isWpcomPlatformSite() && ! window?.JetpackNetworkAdminData ) {
30
+ if (
31
+ getScriptData()?.myJetpack?.isAvailable === true &&
32
+ ! isWpcomPlatformSite() &&
33
+ ! window?.JetpackNetworkAdminData
34
+ ) {
31
35
  // Published by My Jetpack, whose products tab can be renamed Features.
32
36
  const productsSection = getScriptData()?.myJetpack?.productsSection;
33
37
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/jetpack-components",
3
- "version": "3.1.0",
3
+ "version": "3.1.2",
4
4
  "description": "Jetpack Components Package",
5
5
  "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/components/#readme",
6
6
  "bugs": {
@@ -72,10 +72,9 @@
72
72
  "extends @wordpress/browserslist-config"
73
73
  ],
74
74
  "dependencies": {
75
- "@automattic/format-currency": "1.0.1",
76
- "@automattic/jetpack-api": "^1.0.35",
77
- "@automattic/jetpack-boost-score-api": "^1.0.60",
78
- "@automattic/jetpack-script-data": "^0.6.7",
75
+ "@automattic/jetpack-api": "^2.0.0",
76
+ "@automattic/jetpack-boost-score-api": "^1.1.0",
77
+ "@automattic/jetpack-script-data": "^0.6.8",
79
78
  "@automattic/number-formatters": "^1.2.9",
80
79
  "@babel/runtime": "^7",
81
80
  "@gravatar-com/hovercards": "0.16.0",
@@ -100,7 +99,7 @@
100
99
  "uplot-react": "1.1.4"
101
100
  },
102
101
  "devDependencies": {
103
- "@automattic/jetpack-base-styles": "^1.2.13",
102
+ "@automattic/jetpack-base-styles": "^1.2.14",
104
103
  "@babel/core": "7.29.7",
105
104
  "@jest/globals": "30.5.1",
106
105
  "@storybook/addon-docs": "10.4.6",