@automattic/jetpack-components 0.58.0 → 0.58.1

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,13 @@
2
2
 
3
3
  ### This is a list detailing changes for the Jetpack RNA Components package releases.
4
4
 
5
+ ## [0.58.1] - 2024-11-04
6
+ ### Added
7
+ - Enable test coverage. [#39961]
8
+
9
+ ### Fixed
10
+ - Fix tooltip behavior. [#39879]
11
+
5
12
  ## [0.58.0] - 2024-10-15
6
13
  ### Added
7
14
  - Add DiffViewer component [#39672]
@@ -1195,6 +1202,7 @@
1195
1202
  ### Changed
1196
1203
  - Update node version requirement to 14.16.1
1197
1204
 
1205
+ [0.58.1]: https://github.com/Automattic/jetpack-components/compare/0.58.0...0.58.1
1198
1206
  [0.58.0]: https://github.com/Automattic/jetpack-components/compare/0.57.0...0.58.0
1199
1207
  [0.57.0]: https://github.com/Automattic/jetpack-components/compare/0.56.3...0.57.0
1200
1208
  [0.56.3]: https://github.com/Automattic/jetpack-components/compare/0.56.2...0.56.3
@@ -5,6 +5,17 @@ $white: #ffffff;
5
5
  .jb-score-tooltips-container {
6
6
  width: 100%;
7
7
  position: relative;
8
+ pointer-events: none;
9
+
10
+ }
11
+
12
+ .jb-score-tooltip-react-root {
13
+ position: absolute;
14
+ bottom: -20px;
15
+ translate: -50% calc( 100% - 20px );
16
+ z-index: 1000;
17
+ pointer-events: auto;
18
+ user-select: text;
8
19
  }
9
20
 
10
21
  .jb-score-tooltip {
@@ -17,6 +28,11 @@ $white: #ffffff;
17
28
  width: 20em;
18
29
  position: relative;
19
30
  box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);
31
+ display: none;
32
+
33
+ .visible &, &:hover {
34
+ display: block;
35
+ }
20
36
 
21
37
  hr {
22
38
  border-top: 1px solid $grey;
@@ -25,35 +25,26 @@ export function tooltipsPlugin( periods ) {
25
25
  if ( ! reactDom ) {
26
26
  reactDom = ReactDOM.createRoot( reactRoot );
27
27
  }
28
- reactRoot.style.position = 'absolute';
29
- reactRoot.style.bottom = -20 + 'px';
30
- reactRoot.style.translate = '-50% calc( 100% - 20px )';
31
- reactRoot.style.zIndex = '1000';
28
+ reactRoot.classList.add( 'jb-score-tooltip-react-root' );
32
29
 
33
30
  container.appendChild( reactRoot );
34
31
 
35
32
  u.over.appendChild( container );
36
33
 
37
- /**
38
- * Hides all tooltips.
39
- */
40
- function hideTips() {
41
- reactRoot.style.display = 'none';
42
- }
34
+ u.over.addEventListener( 'mouseenter', () => {
35
+ container.classList.add( 'visible' );
36
+ } );
43
37
 
44
- /**
45
- * Shows all tooltips.
46
- */
47
- function showTips() {
48
- reactRoot.style.display = null;
49
- }
38
+ u.over.addEventListener( 'mouseleave', () => {
39
+ container.classList.remove( 'visible' );
40
+ } );
50
41
 
51
- container.addEventListener( 'mouseleave', () => {
52
- hideTips();
42
+ reactRoot.addEventListener( 'mouseenter', () => {
43
+ reactRoot.classList.add( 'visible' );
53
44
  } );
54
45
 
55
- container.addEventListener( 'mouseenter', () => {
56
- showTips();
46
+ reactRoot.addEventListener( 'mouseleave', () => {
47
+ reactRoot.classList.remove( 'visible' );
57
48
  } );
58
49
  }
59
50
 
@@ -62,7 +53,7 @@ export function tooltipsPlugin( periods ) {
62
53
  * @param {uPlot} u - The uPlot instance.
63
54
  */
64
55
  function setSize( u: uPlot ) {
65
- container.style.height = u.over.clientHeight + 'px';
56
+ container.style.paddingTop = u.over.clientHeight + 'px';
66
57
  }
67
58
 
68
59
  /**
@@ -75,6 +66,10 @@ export function tooltipsPlugin( periods ) {
75
66
 
76
67
  const period = periods[ idx ];
77
68
 
69
+ if ( ! period ) {
70
+ return;
71
+ }
72
+
78
73
  // Timestamp of the cursor position
79
74
  const timestamp = u.data[ 0 ][ idx ];
80
75
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/jetpack-components",
3
- "version": "0.58.0",
3
+ "version": "0.58.1",
4
4
  "description": "Jetpack Components Package",
5
5
  "author": "Automattic",
6
6
  "license": "GPL-2.0-or-later",
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@automattic/format-currency": "1.0.1",
18
- "@automattic/jetpack-boost-score-api": "^0.1.42",
18
+ "@automattic/jetpack-boost-score-api": "^0.1.44",
19
19
  "@babel/runtime": "^7",
20
20
  "@wordpress/browserslist-config": "6.9.0",
21
21
  "@wordpress/components": "28.9.0",
@@ -30,7 +30,7 @@
30
30
  "prop-types": "^15.7.2",
31
31
  "qrcode.react": "3.1.0",
32
32
  "react-slider": "2.0.5",
33
- "social-logos": "^3.1.9",
33
+ "social-logos": "^3.1.10",
34
34
  "uplot": "1.6.31",
35
35
  "uplot-react": "1.1.4"
36
36
  },
@@ -80,6 +80,7 @@
80
80
  "scripts": {
81
81
  "build": "pnpm run compile-ts",
82
82
  "compile-ts": "tsc --pretty",
83
- "test": "NODE_OPTIONS=--experimental-vm-modules jest"
83
+ "test": "NODE_OPTIONS=--experimental-vm-modules jest",
84
+ "test-coverage": "pnpm run test --coverage"
84
85
  }
85
86
  }