@automattic/jetpack-components 0.64.0 → 0.64.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,17 @@
2
2
 
3
3
  ### This is a list detailing changes for the Jetpack RNA Components package releases.
4
4
 
5
+ ## [0.64.2] - 2024-12-10
6
+ ### Fixed
7
+ - Fix ToggleControl's help text indent to align with label text. [#40510]
8
+
9
+ ## [0.64.1] - 2024-12-09
10
+ ### Removed
11
+ - Remove bulk action support from the ThreatsDataViews component. [#40483]
12
+
13
+ ### Fixed
14
+ - Fixed threat type values and labels. [#40467]
15
+
5
16
  ## [0.64.0] - 2024-12-04
6
17
  ### Changed
7
18
  - Changed text domain from 'jetpack' to 'jetpack-components'. [#40368]
@@ -1236,6 +1247,8 @@
1236
1247
  ### Changed
1237
1248
  - Update node version requirement to 14.16.1
1238
1249
 
1250
+ [0.64.2]: https://github.com/Automattic/jetpack-components/compare/0.64.1...0.64.2
1251
+ [0.64.1]: https://github.com/Automattic/jetpack-components/compare/0.64.0...0.64.1
1239
1252
  [0.64.0]: https://github.com/Automattic/jetpack-components/compare/0.63.0...0.64.0
1240
1253
  [0.63.0]: https://github.com/Automattic/jetpack-components/compare/0.62.0...0.63.0
1241
1254
  [0.62.0]: https://github.com/Automattic/jetpack-components/compare/0.61.0...0.62.0
@@ -17,10 +17,9 @@ export function tooltipsPlugin( periods ) {
17
17
  /**
18
18
  * Initializes the tooltips plugin.
19
19
  *
20
- * @param {uPlot} u - The uPlot instance.
21
- * @param {object} _opts - Options for the uPlot instance.
20
+ * @param {uPlot} u - The uPlot instance.
22
21
  */
23
- function init( u: uPlot, _opts: object ) {
22
+ function init( u: uPlot ) {
24
23
  container.classList.add( 'jb-score-tooltips-container' );
25
24
  if ( ! reactDom ) {
26
25
  reactDom = ReactDOM.createRoot( reactRoot );
@@ -68,7 +68,7 @@ const NumberSlider: React.FC< NumberSliderProps > = ( {
68
68
  min={ minValue }
69
69
  step={ step }
70
70
  renderThumb={ renderThumbCallback } // eslint-disable-line react/jsx-no-bind
71
- onChange={ onChange } // eslint-disable-line react/jsx-no-bind
71
+ onChange={ onChange }
72
72
  onBeforeChange={ onBeforeChangeCallback } // eslint-disable-line react/jsx-no-bind
73
73
  onAfterChange={ onAfterChangeCallback } // eslint-disable-line react/jsx-no-bind
74
74
  />
@@ -1,15 +1,15 @@
1
1
  import { __, sprintf } from '@wordpress/i18n';
2
2
  import { Icon, check, closeSmall } from '@wordpress/icons';
3
3
  import clsx from 'clsx';
4
- import {
4
+ import React, {
5
5
  createContext,
6
6
  useContext,
7
7
  Children,
8
8
  cloneElement,
9
9
  PropsWithChildren,
10
10
  ReactElement,
11
+ CSSProperties,
11
12
  } from 'react';
12
- import React, { CSSProperties } from 'react';
13
13
  import IconTooltip from '../icon-tooltip';
14
14
  import useBreakpointMatch from '../layout/use-breakpoint-match';
15
15
  import TermsOfService from '../terms-of-service';
@@ -15,8 +15,8 @@ export const THREAT_STATUSES: { value: string; label: string; variant?: 'success
15
15
  ];
16
16
 
17
17
  export const THREAT_TYPES = [
18
- { value: 'plugin', label: __( 'Plugin', 'jetpack-components' ) },
19
- { value: 'theme', label: __( 'Theme', 'jetpack-components' ) },
18
+ { value: 'plugins', label: __( 'Plugin', 'jetpack-components' ) },
19
+ { value: 'themes', label: __( 'Theme', 'jetpack-components' ) },
20
20
  { value: 'core', label: __( 'WordPress', 'jetpack-components' ) },
21
21
  { value: 'file', label: __( 'File', 'jetpack-components' ) },
22
22
  ];
@@ -168,12 +168,12 @@ export default function ThreatsDataViews( {
168
168
  // Extensions (Themes and Plugins)
169
169
  if ( threat.extension ) {
170
170
  switch ( threat.extension.type ) {
171
- case 'theme':
171
+ case 'themes':
172
172
  if ( ! acc.themes.find( ( { value } ) => value === threat.extension.slug ) ) {
173
173
  acc.themes.push( { value: threat.extension.slug, label: threat.extension.name } );
174
174
  }
175
175
  break;
176
- case 'plugin':
176
+ case 'plugins':
177
177
  if ( ! acc.plugins.find( ( { value } ) => value === threat.extension.slug ) ) {
178
178
  acc.plugins.push( { value: threat.extension.slug, label: threat.extension.name } );
179
179
  }
@@ -280,7 +280,18 @@ export default function ThreatsDataViews( {
280
280
  label: __( 'Type', 'jetpack-components' ),
281
281
  elements: THREAT_TYPES,
282
282
  getValue( { item }: { item: Threat } ) {
283
- return getThreatType( item ) ?? '';
283
+ switch ( getThreatType( item ) ) {
284
+ case 'core':
285
+ return __( 'WordPress', 'jetpack-components' );
286
+ case 'plugins':
287
+ return __( 'Plugin', 'jetpack-components' );
288
+ case 'themes':
289
+ return __( 'Theme', 'jetpack-components' );
290
+ case 'file':
291
+ return __( 'File', 'jetpack-components' );
292
+ default:
293
+ return __( 'Unknown', 'jetpack-components' );
294
+ }
284
295
  },
285
296
  },
286
297
  {
@@ -428,7 +439,6 @@ export default function ThreatsDataViews( {
428
439
  id: THREAT_ACTION_FIX,
429
440
  label: __( 'Auto-fix', 'jetpack-components' ),
430
441
  isPrimary: true,
431
- supportsBulk: true,
432
442
  callback: onFixThreats,
433
443
  isEligible( item ) {
434
444
  if ( ! onFixThreats ) {
@@ -4,6 +4,7 @@
4
4
  /// @link https://github.com/WordPress/gutenberg/tree/trunk/packages/components/src/form-toggle
5
5
  .toggle {
6
6
  --base-width: 8px;
7
+ --track-width: calc( var(--base-width) * 6 );
7
8
 
8
9
  &.is-small {
9
10
  --base-width: 6px;
@@ -24,7 +25,7 @@
24
25
  }
25
26
 
26
27
  .components-form-toggle__track {
27
- width: calc( var(--base-width) * 6 );
28
+ width: var( --track-width );
28
29
  height: calc( var(--base-width) * 3 );
29
30
  border-radius: 12px;
30
31
  border-width: 2px;
@@ -41,6 +42,10 @@
41
42
  transform: translateX( calc( var(--base-width) * 3 ) );
42
43
  }
43
44
  }
45
+
46
+ .components-toggle-control__help {
47
+ margin-inline-start: calc( var( --track-width ) + var( --spacing-base ) );
48
+ }
44
49
  }
45
50
  }
46
51
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/jetpack-components",
3
- "version": "0.64.0",
3
+ "version": "0.64.2",
4
4
  "description": "Jetpack Components Package",
5
5
  "author": "Automattic",
6
6
  "license": "GPL-2.0-or-later",
@@ -15,8 +15,8 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@automattic/format-currency": "1.0.1",
18
- "@automattic/jetpack-boost-score-api": "^0.1.48",
19
- "@automattic/jetpack-scan": "^0.5.0",
18
+ "@automattic/jetpack-boost-score-api": "^0.1.49",
19
+ "@automattic/jetpack-scan": "^0.5.1",
20
20
  "@babel/runtime": "^7",
21
21
  "@wordpress/browserslist-config": "6.13.0",
22
22
  "@wordpress/components": "28.13.0",
@@ -32,7 +32,7 @@
32
32
  "prop-types": "^15.7.2",
33
33
  "qrcode.react": "3.1.0",
34
34
  "react-slider": "2.0.5",
35
- "social-logos": "^3.1.13",
35
+ "social-logos": "^3.1.14",
36
36
  "uplot": "1.6.31",
37
37
  "uplot-react": "1.1.4"
38
38
  },