cozy-viewer 26.4.2 → 26.5.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 CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [26.5.0](https://github.com/cozy/cozy-libs/compare/cozy-viewer@26.4.2...cozy-viewer@26.5.0) (2026-01-16)
7
+
8
+ ### Features
9
+
10
+ - Display antivirus popover on hover ([078dc88](https://github.com/cozy/cozy-libs/commit/078dc88281776c88ad9794882f865b7b46ae9aa1))
11
+
6
12
  ## [26.4.2](https://github.com/cozy/cozy-libs/compare/cozy-viewer@26.4.1...cozy-viewer@26.4.2) (2026-01-15)
7
13
 
8
14
  **Note:** Version bump only for package cozy-viewer
@@ -52,11 +52,11 @@ var Antivirus = function Antivirus(_ref) {
52
52
  anchorEl = _useState2[0],
53
53
  setAnchorEl = _useState2[1];
54
54
 
55
- var handleInfoClick = function handleInfoClick(event) {
55
+ var handlePopoverOpen = function handlePopoverOpen(event) {
56
56
  setAnchorEl(event.currentTarget);
57
57
  };
58
58
 
59
- var handleClose = function handleClose() {
59
+ var handlePopoverClose = function handlePopoverClose() {
60
60
  setAnchorEl(null);
61
61
  };
62
62
 
@@ -77,20 +77,28 @@ var Antivirus = function Antivirus(_ref) {
77
77
  })), /*#__PURE__*/_react.default.createElement(_ListItemText.default, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
78
78
  color: isError ? 'error' : 'default'
79
79
  }, text)), /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
80
- onClick: handleInfoClick,
81
- size: "small"
80
+ onClick: handlePopoverOpen,
81
+ onFocus: handlePopoverOpen,
82
+ onBlur: handlePopoverClose,
83
+ onMouseEnter: handlePopoverOpen,
84
+ onMouseLeave: handlePopoverClose,
85
+ size: "small",
86
+ "aria-label": t('Viewer.panel.antivirus.info.title'),
87
+ "aria-describedby": open ? 'antivirus-popover' : undefined
82
88
  }, /*#__PURE__*/_react.default.createElement(_Icon.default, {
83
89
  icon: _InfoOutlined.default
84
90
  })))), /*#__PURE__*/_react.default.createElement(_Popover.default, {
91
+ id: "antivirus-popover",
85
92
  open: open,
86
93
  anchorEl: anchorEl,
87
- onClose: handleClose,
94
+ onClose: handlePopoverClose,
88
95
  anchorOrigin: {
89
96
  vertical: 'bottom',
90
97
  horizontal: 'right'
91
98
  }
92
99
  }, /*#__PURE__*/_react.default.createElement("div", {
93
- className: "u-p-1 u-flex u-maw-5"
100
+ className: "u-p-1 u-flex u-maw-5",
101
+ onMouseLeave: handlePopoverClose
94
102
  }, /*#__PURE__*/_react.default.createElement("div", {
95
103
  className: "u-mr-half u-flex-shrink-0"
96
104
  }, /*#__PURE__*/_react.default.createElement(_Icon.default, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-viewer",
3
- "version": "26.4.2",
3
+ "version": "26.5.0",
4
4
  "description": "Cozy-Viewer provides a component to show files in a viewer.",
5
5
  "main": "dist/index.js",
6
6
  "license": "MIT",
@@ -31,7 +31,7 @@
31
31
  "babel-preset-cozy-app": "^2.8.2",
32
32
  "cozy-client": "^60.20.0",
33
33
  "cozy-device-helper": "2.0.0",
34
- "cozy-harvest-lib": "^36.0.18",
34
+ "cozy-harvest-lib": "^36.0.19",
35
35
  "cozy-intent": "^2.30.1",
36
36
  "cozy-logger": "^1.17.0",
37
37
  "cozy-sharing": "^28.2.1",
@@ -70,5 +70,5 @@
70
70
  "react-router-dom": ">=6.14.2",
71
71
  "twake-i18n": ">=0.3.0"
72
72
  },
73
- "gitHead": "053df29f6dfe606ecadd3f6668f0461bb1bd6021"
73
+ "gitHead": "ee1700c312f7e94eb4f3ab8f017e7db149cbff49"
74
74
  }
@@ -19,11 +19,11 @@ import { withViewerLocales } from '../hoc/withViewerLocales'
19
19
  const Antivirus = ({ file, t }) => {
20
20
  const [anchorEl, setAnchorEl] = useState(null)
21
21
 
22
- const handleInfoClick = event => {
22
+ const handlePopoverOpen = event => {
23
23
  setAnchorEl(event.currentTarget)
24
24
  }
25
25
 
26
- const handleClose = () => {
26
+ const handlePopoverClose = () => {
27
27
  setAnchorEl(null)
28
28
  }
29
29
 
@@ -44,21 +44,31 @@ const Antivirus = ({ file, t }) => {
44
44
  <Typography color={isError ? 'error' : 'default'}>{text}</Typography>
45
45
  </ListItemText>
46
46
  <ListItemIcon>
47
- <IconButton onClick={handleInfoClick} size="small">
47
+ <IconButton
48
+ onClick={handlePopoverOpen}
49
+ onFocus={handlePopoverOpen}
50
+ onBlur={handlePopoverClose}
51
+ onMouseEnter={handlePopoverOpen}
52
+ onMouseLeave={handlePopoverClose}
53
+ size="small"
54
+ aria-label={t('Viewer.panel.antivirus.info.title')}
55
+ aria-describedby={open ? 'antivirus-popover' : undefined}
56
+ >
48
57
  <Icon icon={InfoIcon} />
49
58
  </IconButton>
50
59
  </ListItemIcon>
51
60
  </ListItem>
52
61
  <Popover
62
+ id="antivirus-popover"
53
63
  open={open}
54
64
  anchorEl={anchorEl}
55
- onClose={handleClose}
65
+ onClose={handlePopoverClose}
56
66
  anchorOrigin={{
57
67
  vertical: 'bottom',
58
68
  horizontal: 'right'
59
69
  }}
60
70
  >
61
- <div className="u-p-1 u-flex u-maw-5">
71
+ <div className="u-p-1 u-flex u-maw-5" onMouseLeave={handlePopoverClose}>
62
72
  <div className="u-mr-half u-flex-shrink-0">
63
73
  <Icon icon={ShieldIcon} color="var(--primaryColor)" />
64
74
  </div>