@automattic/jetpack-components 3.1.1 → 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 +6 -0
- package/build/components/diff-viewer/parse-patch.js +3 -3
- package/build/components/jetpack-footer/index.js +3 -1
- package/components/diff-viewer/parse-patch.ts +3 -3
- package/components/jetpack-footer/README.md +2 -0
- package/components/jetpack-footer/index.tsx +5 -1
- package/package.json +4 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
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
|
+
|
|
5
10
|
## [3.1.1] - 2026-09-21
|
|
6
11
|
### Changed
|
|
7
12
|
- Update dependencies.
|
|
@@ -1950,6 +1955,7 @@
|
|
|
1950
1955
|
### Changed
|
|
1951
1956
|
- Update node version requirement to 14.16.1
|
|
1952
1957
|
|
|
1958
|
+
[3.1.2]: https://github.com/Automattic/jetpack-components/compare/3.1.1...3.1.2
|
|
1953
1959
|
[3.1.1]: https://github.com/Automattic/jetpack-components/compare/3.1.0...3.1.1
|
|
1954
1960
|
[3.1.0]: https://github.com/Automattic/jetpack-components/compare/3.0.3...3.1.0
|
|
1955
1961
|
[3.0.3]: https://github.com/Automattic/jetpack-components/compare/3.0.2...3.0.3
|
|
@@ -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
|
|
27
|
+
const header = /^(?:Index:|diff(?: -r \w+)+)\s+/.exec(line);
|
|
28
28
|
if (header) {
|
|
29
|
-
index.index = header[
|
|
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+(
|
|
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 (
|
|
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
|
|
49
|
+
const header = /^(?:Index:|diff(?: -r \w+)+)\s+/.exec( line );
|
|
50
50
|
|
|
51
51
|
if ( header ) {
|
|
52
|
-
index.index = header[
|
|
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+(
|
|
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 (
|
|
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.
|
|
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/
|
|
76
|
-
"@automattic/jetpack-api": "^1.0
|
|
77
|
-
"@automattic/jetpack-
|
|
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",
|