cozy-viewer 22.0.4 → 23.0.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,16 @@
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
+ # [23.0.0](https://github.com/cozy/cozy-libs/compare/cozy-viewer@22.0.4...cozy-viewer@23.0.0) (2025-06-12)
7
+
8
+ ### Features
9
+
10
+ - Upgrade cozy-ui ([4884fc2](https://github.com/cozy/cozy-libs/commit/4884fc28f8339b6e2b283585e6d0d5b3aaf2beb1))
11
+
12
+ ### BREAKING CHANGES
13
+
14
+ - You must have `cozy-ui >= 126.0.0`, `cozy-harvest-lib >=32.2.12`, `cozy-intent >= 2.30.0`, `cozy-logger >= 1.17.0`, `cozy-sharing >= 25.4.0`
15
+
6
16
  ## [22.0.4](https://github.com/cozy/cozy-libs/compare/cozy-viewer@22.0.3...cozy-viewer@22.0.4) (2025-05-14)
7
17
 
8
18
  **Note:** Version bump only for package cozy-viewer
@@ -6,7 +6,12 @@ declare function NoViewer({ file, url, renderFallbackExtraContent }: {
6
6
  }): JSX.Element;
7
7
  declare namespace NoViewer {
8
8
  namespace propTypes {
9
- let file: any;
9
+ let file: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
10
+ _id: PropTypes.Requireable<string>;
11
+ class: PropTypes.Requireable<string>;
12
+ mime: PropTypes.Requireable<string>;
13
+ name: PropTypes.Requireable<string>;
14
+ }>>>;
10
15
  let renderFallbackExtraContent: PropTypes.Requireable<(...args: any[]) => any>;
11
16
  let url: PropTypes.Requireable<string>;
12
17
  }
@@ -25,7 +25,7 @@ var _ListItemText = _interopRequireDefault(require("cozy-ui/transpiled/react/Lis
25
25
 
26
26
  var _MidEllipsis = _interopRequireDefault(require("cozy-ui/transpiled/react/MidEllipsis"));
27
27
 
28
- var _QualificationIconStack = _interopRequireDefault(require("cozy-ui/transpiled/react/QualificationIconStack"));
28
+ var _QualificationIcon = _interopRequireDefault(require("cozy-ui/transpiled/react/QualificationIcon"));
29
29
 
30
30
  var _I18n = require("cozy-ui/transpiled/react/providers/I18n");
31
31
 
@@ -49,7 +49,7 @@ var QualificationListItemQualification = function QualificationListItemQualifica
49
49
  divider: true,
50
50
  button: (0, _helpers.canEditQualification)(file, isReadOnly),
51
51
  onClick: (0, _helpers.canEditQualification)(file, isReadOnly) ? onClick : undefined
52
- }, /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement(_QualificationIconStack.default, {
52
+ }, /*#__PURE__*/_react.default.createElement(_ListItemIcon.default, null, /*#__PURE__*/_react.default.createElement(_QualificationIcon.default, {
53
53
  qualification: value
54
54
  })), /*#__PURE__*/_react.default.createElement(_ListItemText.default, {
55
55
  primary: /*#__PURE__*/_react.default.createElement(_MidEllipsis.default, {
@@ -18,7 +18,12 @@ export namespace TextViewer {
18
18
  namespace propTypes {
19
19
  let client: PropTypes.Validator<object>;
20
20
  let url: PropTypes.Validator<string>;
21
- let file: any;
21
+ let file: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
22
+ _id: PropTypes.Requireable<string>;
23
+ class: PropTypes.Requireable<string>;
24
+ mime: PropTypes.Requireable<string>;
25
+ name: PropTypes.Requireable<string>;
26
+ }>>>;
22
27
  let renderFallbackExtraContent: PropTypes.Requireable<(...args: any[]) => any>;
23
28
  }
24
29
  }
@@ -1,2 +1,2 @@
1
- declare const _default: any;
1
+ declare const _default: JSX.Element;
2
2
  export default _default;
@@ -4,4 +4,4 @@ export function getViewerComponentName({ file, isDesktop, isOnlyOfficeEnabled }:
4
4
  isOnlyOfficeEnabled: any;
5
5
  }): any;
6
6
  export default ViewerByFile;
7
- declare const ViewerByFile: any;
7
+ declare const ViewerByFile: JSX.Element;
@@ -1 +1 @@
1
- export const withViewerLocales: any;
1
+ export const withViewerLocales: Component;
@@ -2,6 +2,10 @@ export namespace locales {
2
2
  export { en };
3
3
  export { fr };
4
4
  }
5
- export function getViewerI18n(): any;
5
+ export function getViewerI18n(): {
6
+ t: any;
7
+ f: (date: any, formatStr: any, opts?: {}) => string | undefined;
8
+ lang: any;
9
+ };
6
10
  import en from './en.json';
7
11
  import fr from './fr.json';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-viewer",
3
- "version": "22.0.4",
3
+ "version": "23.0.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,11 +31,11 @@
31
31
  "babel-preset-cozy-app": "^2.8.1",
32
32
  "cozy-client": "^57.0.0",
33
33
  "cozy-device-helper": "2.0.0",
34
- "cozy-harvest-lib": "^32.3.12",
34
+ "cozy-harvest-lib": "^32.3.13",
35
35
  "cozy-intent": "^2.30.0",
36
36
  "cozy-logger": "^1.17.0",
37
37
  "cozy-sharing": "^25.4.0",
38
- "cozy-ui": "^121.1.1",
38
+ "cozy-ui": "^126.0.0",
39
39
  "identity-obj-proxy": "3.0.0",
40
40
  "jest": "26.6.3",
41
41
  "jest-canvas-mock": "2.3.1",
@@ -56,13 +56,13 @@
56
56
  "peerDependencies": {
57
57
  "cozy-client": ">=57.0.0",
58
58
  "cozy-device-helper": ">=2.0.0",
59
- "cozy-harvest-lib": ">=32.2.5",
60
- "cozy-intent": ">=2.29.1",
61
- "cozy-logger": ">=1.9.0",
62
- "cozy-sharing": ">=25.1.1",
63
- "cozy-ui": ">=121.1.1",
59
+ "cozy-harvest-lib": ">=32.2.12",
60
+ "cozy-intent": ">=2.30.0",
61
+ "cozy-logger": ">=1.17.0",
62
+ "cozy-sharing": ">=25.4.0",
63
+ "cozy-ui": ">=126.0.0",
64
64
  "react": ">=16.12.0",
65
65
  "react-dom": ">=16.12.0"
66
66
  },
67
- "gitHead": "2d27645288f99baf8de1a8e6fce88ef8dc9be01b"
67
+ "gitHead": "79ea09f96e44cdf1ea0aae3d12865c41835b3ef0"
68
68
  }
@@ -8,23 +8,26 @@ exports[`NoViewer should render the viewer 1`] = `
8
8
  >
9
9
  <svg
10
10
  class="styles__icon___23x3R"
11
+ fill="none"
11
12
  height="140"
12
- viewBox="0 0 32 32"
13
+ viewBox="0 0 15 17"
13
14
  width="160"
14
15
  >
15
- <g
16
- fill="none"
17
- fill-rule="evenodd"
18
- >
19
- <path
20
- d="M3 2.002C3 .896 3.89 0 4.997 0H22l7 7v22.996A2 2 0 0127.003 32H4.997A1.995 1.995 0 013 29.998V2.002z"
21
- fill="#D1D5DB"
22
- />
23
- <path
24
- d="M21.5 0c-.276 0-.5.23-.5.5V8h7.5c.276 0 .5-.232.5-.5V7l-7-7h-.5z"
25
- fill="#A3ACB8"
26
- />
27
- </g>
16
+ <path
17
+ d="M3.52 1.2h5.834l4.966 4.966V13.6a2.8 2.8 0 01-2.8 2.8h-8a2.8 2.8 0 01-2.8-2.8V4a2.8 2.8 0 012.8-2.8z"
18
+ fill="#E8EDF3"
19
+ stroke="#4F5B69"
20
+ stroke-width="0.8"
21
+ />
22
+ <path
23
+ d="M14.72 6.2L9.32.8v2.793c0 1.44 1.128 2.607 2.52 2.607h2.88z"
24
+ fill="#4F5B69"
25
+ />
26
+ <path
27
+ d="M4.695 14.05v-1.476L9.278 8a.78.78 0 01.23-.148.718.718 0 01.534 0 .61.61 0 01.226.156l.477.486c.07.064.12.14.152.226a.753.753 0 010 .525.65.65 0 01-.152.23L6.171 14.05H4.695zm5.07-4.583l.486-.486-.487-.487-.486.487.486.486z"
28
+ fill="#4F5B69"
29
+ fill-opacity="0.72"
30
+ />
28
31
  </svg>
29
32
  <p
30
33
  class="viewer-filename"
@@ -53,23 +56,26 @@ exports[`NoViewer should render the viewer with specific extra content 1`] = `
53
56
  >
54
57
  <svg
55
58
  class="styles__icon___23x3R"
59
+ fill="none"
56
60
  height="140"
57
- viewBox="0 0 32 32"
61
+ viewBox="0 0 15 17"
58
62
  width="160"
59
63
  >
60
- <g
61
- fill="none"
62
- fill-rule="evenodd"
63
- >
64
- <path
65
- d="M3 2.002C3 .896 3.89 0 4.997 0H22l7 7v22.996A2 2 0 0127.003 32H4.997A1.995 1.995 0 013 29.998V2.002z"
66
- fill="#D1D5DB"
67
- />
68
- <path
69
- d="M21.5 0c-.276 0-.5.23-.5.5V8h7.5c.276 0 .5-.232.5-.5V7l-7-7h-.5z"
70
- fill="#A3ACB8"
71
- />
72
- </g>
64
+ <path
65
+ d="M3.52 1.2h5.834l4.966 4.966V13.6a2.8 2.8 0 01-2.8 2.8h-8a2.8 2.8 0 01-2.8-2.8V4a2.8 2.8 0 012.8-2.8z"
66
+ fill="#E8EDF3"
67
+ stroke="#4F5B69"
68
+ stroke-width="0.8"
69
+ />
70
+ <path
71
+ d="M14.72 6.2L9.32.8v2.793c0 1.44 1.128 2.607 2.52 2.607h2.88z"
72
+ fill="#4F5B69"
73
+ />
74
+ <path
75
+ d="M4.695 14.05v-1.476L9.278 8a.78.78 0 01.23-.148.718.718 0 01.534 0 .61.61 0 01.226.156l.477.486c.07.064.12.14.152.226a.753.753 0 010 .525.65.65 0 01-.152.23L6.171 14.05H4.695zm5.07-4.583l.486-.486-.487-.487-.486.487.486.486z"
76
+ fill="#4F5B69"
77
+ fill-opacity="0.72"
78
+ />
73
79
  </svg>
74
80
  <p
75
81
  class="viewer-filename"
@@ -8,7 +8,7 @@ import ListItem from 'cozy-ui/transpiled/react/ListItem'
8
8
  import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
9
9
  import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
10
10
  import MidEllipsis from 'cozy-ui/transpiled/react/MidEllipsis'
11
- import QualificationIconStack from 'cozy-ui/transpiled/react/QualificationIconStack'
11
+ import QualificationIcon from 'cozy-ui/transpiled/react/QualificationIcon'
12
12
  import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
13
13
 
14
14
  import { canEditQualification } from '../helpers'
@@ -30,7 +30,7 @@ const QualificationListItemQualification = ({ file, isReadOnly, onClick }) => {
30
30
  onClick={canEditQualification(file, isReadOnly) ? onClick : undefined}
31
31
  >
32
32
  <ListItemIcon>
33
- <QualificationIconStack qualification={value} />
33
+ <QualificationIcon qualification={value} />
34
34
  </ListItemIcon>
35
35
  <ListItemText
36
36
  primary={<MidEllipsis text={formattedValue} />}
@@ -7,26 +7,20 @@ exports[`AudioViewer should render a spinner then the audio viewer 1`] = `
7
7
  >
8
8
  <svg
9
9
  class="styles__icon___23x3R"
10
+ fill="none"
10
11
  height="140"
11
- viewBox="0 0 32 32"
12
+ viewBox="0 0 15 17"
12
13
  width="160"
13
14
  >
14
- <g
15
- fill="none"
16
- fill-rule="evenodd"
17
- transform="translate(1 1)"
18
- >
19
- <rect
20
- fill="#ACF6F7"
21
- height="30"
22
- rx="2"
23
- width="30"
24
- />
25
- <path
26
- d="M8 19.998a2 2 0 00-.002 4H9c1.657 0 3-1.35 3-2.997v-7.679a.63.63 0 01.492-.601l6.016-1.129c.272-.05.492.124.492.418v5.478c0 .282-.215.51-.49.51H17c-1.105 0-2 .904-2 1.997v-.179a2 2 0 001.998 1.997H18c1.657 0 3-1.349 3-2.993V7c0-.554-.445-.921-.976-.825L10.976 7.82C10.437 7.918 10 8.454 10 9v10.498c0 .276-.215.5-.49.5H8z"
27
- fill="#0CCBD0"
28
- />
29
- </g>
15
+ <path
16
+ d="M3.52 1.3h5.792l4.908 4.907V13.6a2.7 2.7 0 01-2.7 2.7h-8a2.7 2.7 0 01-2.7-2.7V4a2.7 2.7 0 012.7-2.7z"
17
+ fill="#F5FDFD"
18
+ stroke="#0DCBCF"
19
+ />
20
+ <path
21
+ d="M14.72 6.2L9.32.8v2.793c0 1.44 1.128 2.607 2.52 2.607h2.88zm-8.4 5.933c0 .92-.746 1.667-1.667 1.667a.802.802 0 01-.588-.245.803.803 0 01-.245-.588V10.05c0-.52.099-1.009.297-1.463.198-.455.465-.851.802-1.188a3.812 3.812 0 011.187-.802A3.628 3.628 0 017.57 6.3c.52 0 1.009.099 1.463.297.455.198.851.465 1.188.802.337.337.604.733.802 1.188.198.454.297.942.297 1.463v2.917a.802.802 0 01-.245.588.802.802 0 01-.588.245c-.92 0-1.667-.746-1.667-1.667V11.3c0-.46.373-.833.833-.833h.417c.23 0 .417-.187.417-.417 0-.812-.283-1.502-.85-2.068-.565-.566-1.255-.849-2.067-.849-.813 0-1.502.283-2.068.85-.566.565-.849 1.255-.849 2.067 0 .23.187.417.417.417h.417c.46 0 .833.373.833.833v.833z"
22
+ fill="#0DCBCF"
23
+ />
30
24
  </svg>
31
25
  <p
32
26
  class="viewer-filename"
@@ -8,23 +8,26 @@ exports[`Shortcutviewer renders the component 1`] = `
8
8
  >
9
9
  <svg
10
10
  class="styles__icon___23x3R"
11
+ fill="none"
11
12
  height="140"
12
- viewBox="0 0 32 32"
13
+ viewBox="0 0 15 17"
13
14
  width="160"
14
15
  >
15
- <g
16
- fill="none"
17
- fill-rule="evenodd"
18
- >
19
- <path
20
- d="M3 2.002C3 .896 3.89 0 4.997 0H22l7 7v22.996A2 2 0 0127.003 32H4.997A1.995 1.995 0 013 29.998V2.002z"
21
- fill="#D1D5DB"
22
- />
23
- <path
24
- d="M21.5 0c-.276 0-.5.23-.5.5V8h7.5c.276 0 .5-.232.5-.5V7l-7-7h-.5z"
25
- fill="#A3ACB8"
26
- />
27
- </g>
16
+ <path
17
+ d="M3.52 1.2h5.834l4.966 4.966V13.6a2.8 2.8 0 01-2.8 2.8h-8a2.8 2.8 0 01-2.8-2.8V4a2.8 2.8 0 012.8-2.8z"
18
+ fill="#E8EDF3"
19
+ stroke="#4F5B69"
20
+ stroke-width="0.8"
21
+ />
22
+ <path
23
+ d="M14.72 6.2L9.32.8v2.793c0 1.44 1.128 2.607 2.52 2.607h2.88z"
24
+ fill="#4F5B69"
25
+ />
26
+ <path
27
+ d="M4.695 14.05v-1.476L9.278 8a.78.78 0 01.23-.148.718.718 0 01.534 0 .61.61 0 01.226.156l.477.486c.07.064.12.14.152.226a.753.753 0 010 .525.65.65 0 01-.152.23L6.171 14.05H4.695zm5.07-4.583l.486-.486-.487-.487-.486.487.486.486z"
28
+ fill="#4F5B69"
29
+ fill-opacity="0.72"
30
+ />
28
31
  </svg>
29
32
  <p
30
33
  class="viewer-filename"
@@ -44,8 +47,7 @@ exports[`Shortcutviewer renders the component 1`] = `
44
47
  width="16"
45
48
  >
46
49
  <path
47
- d="M9 0v2h3.5L6 8.5 7.5 10 14 3.5V7h2V1.003A.996.996 0 0014.997 0H9zM7 2V0H1.003A1 1 0 000 1v14c0 .552.445 1 1 1h14c.552 0 1-.438 1-1.003V9h-2v5H2V2h5z"
48
- fill-rule="evenodd"
50
+ d="M14.222 14.222H1.778V1.778H8V0H1.778C.79 0 0 .8 0 1.778v12.444C0 15.2.791 16 1.778 16h12.444C15.2 16 16 15.2 16 14.222V8h-1.778v6.222zM9.778 0v1.778h3.19l-8.737 8.738 1.253 1.253 8.738-8.738v3.191H16V0H9.778z"
49
51
  />
50
52
  </svg>
51
53
  <span>