@automattic/jetpack-scan 1.0.1 → 1.1.0
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 +13 -0
- package/build/components/threat-modal/index.d.ts +2 -1
- package/build/types/threats.d.ts +4 -0
- package/package.json +19 -20
- package/src/components/threat-fixer-button/index.tsx +2 -1
- package/src/components/threat-fixer-button/styles.module.scss +1 -1
- package/src/components/threat-modal/index.tsx +2 -1
- package/src/components/threat-modal/styles.module.scss +17 -17
- package/src/components/threat-modal/threat-fix-details.tsx +1 -1
- package/src/components/threat-severity-badge/styles.module.scss +7 -7
- package/src/components/threats-data-views/styles.module.scss +7 -7
- package/src/types/threats.ts +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.1.0] - 2025-07-30
|
|
9
|
+
### Added
|
|
10
|
+
- Add UI confirmation via text box when deleting an extension via delete-fixer so that the user is fully aware that it may break their site. [#44521]
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- Update dependencies. [#44214]
|
|
14
|
+
|
|
15
|
+
## [1.0.2] - 2025-07-03
|
|
16
|
+
### Changed
|
|
17
|
+
- Update package dependencies. [#44148]
|
|
18
|
+
|
|
8
19
|
## [1.0.1] - 2025-06-05
|
|
9
20
|
### Changed
|
|
10
21
|
- Update package dependencies. [#43766]
|
|
@@ -132,6 +143,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
132
143
|
### Removed
|
|
133
144
|
- Updated dependencies. [#39754]
|
|
134
145
|
|
|
146
|
+
[1.1.0]: https://github.com/Automattic/jetpack-scan/compare/v1.0.2...v1.1.0
|
|
147
|
+
[1.0.2]: https://github.com/Automattic/jetpack-scan/compare/v1.0.1...v1.0.2
|
|
135
148
|
[1.0.1]: https://github.com/Automattic/jetpack-scan/compare/v1.0.0...v1.0.1
|
|
136
149
|
[1.0.0]: https://github.com/Automattic/jetpack-scan/compare/v0.5.9...v1.0.0
|
|
137
150
|
[0.5.9]: https://github.com/Automattic/jetpack-scan/compare/v0.5.8...v0.5.9
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Modal } from '@wordpress/components';
|
|
2
2
|
import { type Threat } from '@automattic/jetpack-scan';
|
|
3
|
+
import type { ComponentProps } from 'react';
|
|
3
4
|
interface ThreatModalContextType {
|
|
4
5
|
closeModal: () => void;
|
|
5
6
|
threat: Threat;
|
|
@@ -47,5 +48,5 @@ export default function ThreatModal({ threat, isUserConnected, hasConnectedOwner
|
|
|
47
48
|
handleFixThreatClick?: (threats: Threat[]) => void;
|
|
48
49
|
handleIgnoreThreatClick?: (threats: Threat[]) => void;
|
|
49
50
|
handleUnignoreThreatClick?: (threats: Threat[]) => void;
|
|
50
|
-
} &
|
|
51
|
+
} & ComponentProps<typeof Modal>): JSX.Element;
|
|
51
52
|
export {};
|
package/build/types/threats.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"private": false,
|
|
3
3
|
"name": "@automattic/jetpack-scan",
|
|
4
|
-
"version": "1.0
|
|
4
|
+
"version": "1.1.0",
|
|
5
5
|
"description": "A JS client for consuming Jetpack Scan services",
|
|
6
6
|
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/scan/#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -24,16 +24,15 @@
|
|
|
24
24
|
},
|
|
25
25
|
"type": "module",
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@storybook/addon-
|
|
28
|
-
"@storybook/
|
|
29
|
-
"@storybook/react": "8.6.7",
|
|
27
|
+
"@storybook/addon-docs": "9.0.15",
|
|
28
|
+
"@storybook/react": "9.0.15",
|
|
30
29
|
"@testing-library/dom": "10.4.0",
|
|
31
|
-
"@testing-library/react": "16.
|
|
32
|
-
"@types/jest": "
|
|
30
|
+
"@testing-library/react": "16.3.0",
|
|
31
|
+
"@types/jest": "30.0.0",
|
|
33
32
|
"@types/react": "18.3.23",
|
|
34
|
-
"jest": "
|
|
35
|
-
"jest-environment-jsdom": "
|
|
36
|
-
"storybook": "
|
|
33
|
+
"jest": "30.0.4",
|
|
34
|
+
"jest-environment-jsdom": "30.0.4",
|
|
35
|
+
"storybook": "9.0.15",
|
|
37
36
|
"typescript": "5.8.3"
|
|
38
37
|
},
|
|
39
38
|
"exports": {
|
|
@@ -45,23 +44,23 @@
|
|
|
45
44
|
"main": "./build/index.js",
|
|
46
45
|
"types": "./build/index.d.ts",
|
|
47
46
|
"dependencies": {
|
|
48
|
-
"@automattic/jetpack-api": "^1.0.
|
|
49
|
-
"@automattic/jetpack-base-styles": "^1.0.
|
|
50
|
-
"@automattic/jetpack-components": "^1.1.
|
|
51
|
-
"@wordpress/api-fetch": "7.
|
|
52
|
-
"@wordpress/components": "29.
|
|
47
|
+
"@automattic/jetpack-api": "^1.0.5",
|
|
48
|
+
"@automattic/jetpack-base-styles": "^1.0.6",
|
|
49
|
+
"@automattic/jetpack-components": "^1.1.16",
|
|
50
|
+
"@wordpress/api-fetch": "7.26.0",
|
|
51
|
+
"@wordpress/components": "29.12.0",
|
|
53
52
|
"@wordpress/dataviews": "4.17.0",
|
|
54
|
-
"@wordpress/date": "5.
|
|
55
|
-
"@wordpress/element": "6.
|
|
56
|
-
"@wordpress/i18n": "5.
|
|
57
|
-
"@wordpress/icons": "10.
|
|
58
|
-
"@wordpress/url": "4.
|
|
53
|
+
"@wordpress/date": "5.26.0",
|
|
54
|
+
"@wordpress/element": "6.26.0",
|
|
55
|
+
"@wordpress/i18n": "5.26.0",
|
|
56
|
+
"@wordpress/icons": "10.26.0",
|
|
57
|
+
"@wordpress/url": "4.26.0",
|
|
59
58
|
"debug": "4.4.1",
|
|
60
59
|
"react": "^18.2.0",
|
|
61
60
|
"react-dom": "^18.2.0"
|
|
62
61
|
},
|
|
63
62
|
"peerDependencies": {
|
|
64
|
-
"@wordpress/i18n": "5.
|
|
63
|
+
"@wordpress/i18n": "5.26.0",
|
|
65
64
|
"react": "^18.2.0",
|
|
66
65
|
"react-dom": "^18.2.0"
|
|
67
66
|
}
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
getFixerDescription,
|
|
10
10
|
} from '@automattic/jetpack-scan';
|
|
11
11
|
import styles from './styles.module.scss';
|
|
12
|
+
import type { MouseEvent } from 'react';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Threat Fixer Button component.
|
|
@@ -66,7 +67,7 @@ export default function ThreatFixerButton( {
|
|
|
66
67
|
}, [ threat, fixerState.error ] );
|
|
67
68
|
|
|
68
69
|
const handleClick = useCallback(
|
|
69
|
-
( event:
|
|
70
|
+
( event: MouseEvent ) => {
|
|
70
71
|
event.stopPropagation();
|
|
71
72
|
onClick( [ threat ] );
|
|
72
73
|
},
|
|
@@ -5,6 +5,7 @@ import { type Threat } from '@automattic/jetpack-scan';
|
|
|
5
5
|
import ThreatSeverityBadge from '../threat-severity-badge/index.tsx';
|
|
6
6
|
import styles from './styles.module.scss';
|
|
7
7
|
import ThreatFixConfirmation from './threat-fix-confirmation.tsx';
|
|
8
|
+
import type { ComponentProps } from 'react';
|
|
8
9
|
|
|
9
10
|
interface ThreatModalContextType {
|
|
10
11
|
closeModal: () => void;
|
|
@@ -69,7 +70,7 @@ export default function ThreatModal( {
|
|
|
69
70
|
handleFixThreatClick?: ( threats: Threat[] ) => void;
|
|
70
71
|
handleIgnoreThreatClick?: ( threats: Threat[] ) => void;
|
|
71
72
|
handleUnignoreThreatClick?: ( threats: Threat[] ) => void;
|
|
72
|
-
} &
|
|
73
|
+
} & ComponentProps< typeof Modal > ): JSX.Element {
|
|
73
74
|
const userConnectionNeeded = ! isUserConnected || ! hasConnectedOwner;
|
|
74
75
|
const siteCredentialsNeeded = ! credentials || credentials.length === 0;
|
|
75
76
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
.threat-details {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
|
-
gap: calc(
|
|
4
|
+
gap: calc(var(--spacing-base) * 3); // 24px
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
.section {
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
10
|
-
gap: calc(
|
|
10
|
+
gap: calc(var(--spacing-base) * 2); // 16px
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.section .section__toggle {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
&__content {
|
|
21
21
|
display: flex;
|
|
22
|
-
gap: calc(
|
|
22
|
+
gap: calc(var(--spacing-base) / 2); // 4px
|
|
23
23
|
align-items: center;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -27,35 +27,35 @@
|
|
|
27
27
|
.title {
|
|
28
28
|
display: flex;
|
|
29
29
|
align-items: center;
|
|
30
|
-
gap: calc(
|
|
30
|
+
gap: calc(var(--spacing-base) * 1.5); // 12px
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
.filename {
|
|
34
|
-
background-color: var(
|
|
35
|
-
padding: calc(
|
|
34
|
+
background-color: var(--jp-gray-0);
|
|
35
|
+
padding: calc(var(--spacing-base) * 3); // 24px
|
|
36
36
|
overflow-x: auto;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
.modal-footer {
|
|
40
|
-
padding-top: calc(
|
|
41
|
-
border-top: 1px solid var(
|
|
40
|
+
padding-top: calc(var(--spacing-base) * 3); // 24px
|
|
41
|
+
border-top: 1px solid var(--jp-gray-5);
|
|
42
42
|
|
|
43
43
|
.threat-actions {
|
|
44
44
|
display: flex;
|
|
45
45
|
justify-content: flex-end;
|
|
46
|
-
gap: calc(
|
|
47
|
-
}
|
|
46
|
+
gap: calc(var(--spacing-base) * 2); // 16px;
|
|
47
|
+
}
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
.fixer-notice {
|
|
51
|
-
padding-bottom: calc(
|
|
51
|
+
padding-bottom: calc(var(--spacing-base) * 3); // 24px
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
.notice {
|
|
55
55
|
|
|
56
56
|
&__title {
|
|
57
57
|
display: flex;
|
|
58
|
-
gap: calc(
|
|
58
|
+
gap: calc(var(--spacing-base) / 2); // 4px
|
|
59
59
|
|
|
60
60
|
p {
|
|
61
61
|
font-weight: 700;
|
|
@@ -64,19 +64,19 @@
|
|
|
64
64
|
|
|
65
65
|
&__actions {
|
|
66
66
|
display: flex;
|
|
67
|
-
gap: calc(
|
|
67
|
+
gap: calc(var(--spacing-base) * 2); // 16px;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
&__action {
|
|
71
|
-
margin-top: calc(
|
|
71
|
+
margin-top: calc(var(--spacing-base) * 2); // 16px;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
svg.spinner {
|
|
76
|
-
color: var(
|
|
76
|
+
color: var(--jp-black);
|
|
77
77
|
height: 20px;
|
|
78
78
|
width: 20px;
|
|
79
|
-
margin-left: calc(
|
|
79
|
+
margin-left: calc(var(--spacing-base) / 2); // 4px;
|
|
80
80
|
margin-right: 6px;
|
|
81
81
|
|
|
82
|
-
}
|
|
82
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ContextualUpgradeTrigger, Text } from '@automattic/jetpack-components';
|
|
2
2
|
import { __, sprintf } from '@wordpress/i18n';
|
|
3
|
-
import
|
|
3
|
+
import { useMemo, useContext } from 'react';
|
|
4
4
|
import { getFixerDescription } from '@automattic/jetpack-scan';
|
|
5
5
|
import { ThreatModalContext } from './index.tsx';
|
|
6
6
|
import styles from './styles.module.scss';
|
|
@@ -5,23 +5,23 @@
|
|
|
5
5
|
font-style: normal;
|
|
6
6
|
font-weight: 600;
|
|
7
7
|
line-height: 16px;
|
|
8
|
-
padding: calc(
|
|
8
|
+
padding: calc(var(--spacing-base) / 2); // 4px
|
|
9
9
|
position: relative;
|
|
10
10
|
text-align: center;
|
|
11
11
|
width: 60px;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
.is-critical {
|
|
15
|
-
background: var(
|
|
16
|
-
color: var(
|
|
15
|
+
background: var(--jp-red-5);
|
|
16
|
+
color: var(--jp-red-60);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.is-high {
|
|
20
|
-
background: var(
|
|
21
|
-
color: var(
|
|
20
|
+
background: var(--jp-yellow-5);
|
|
21
|
+
color: var(--jp-yellow-60);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
.is-low {
|
|
25
|
-
background: var(
|
|
26
|
-
color: var(
|
|
25
|
+
background: var(--jp-gray-0);
|
|
26
|
+
color: var(--jp-gray-50);
|
|
27
27
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
@import
|
|
1
|
+
@import "@wordpress/dataviews/build-style/style.css";
|
|
2
2
|
|
|
3
3
|
.threat__title {
|
|
4
|
-
color: var(
|
|
4
|
+
color: var(--jp-gray-80);
|
|
5
5
|
font-weight: 510;
|
|
6
6
|
white-space: initial;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.threat__description {
|
|
10
|
-
color: var(
|
|
10
|
+
color: var(--jp-gray-80);
|
|
11
11
|
font-size: 12px;
|
|
12
12
|
white-space: initial;
|
|
13
13
|
}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.threat__fixedOn {
|
|
21
|
-
color: var(
|
|
21
|
+
color: var(--jp-green-70);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
.threat__media {
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
display: flex;
|
|
28
28
|
align-items: center;
|
|
29
29
|
justify-content: center;
|
|
30
|
-
background-color: #
|
|
31
|
-
border-color: #
|
|
30
|
+
background-color: #edffee;
|
|
31
|
+
border-color: #edffee;
|
|
32
32
|
|
|
33
33
|
svg {
|
|
34
|
-
fill: var(
|
|
34
|
+
fill: var(--jp-black);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
|