cozy-viewer 22.0.3 → 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 +14 -0
- package/dist/NoViewer/NoViewer.d.ts +6 -1
- package/dist/Panel/Qualifications/QualificationListItemQualification.js +2 -2
- package/dist/ViewersByFile/TextViewer.d.ts +6 -1
- package/dist/components/Toolbar.d.ts +1 -1
- package/dist/components/ViewerByFile.d.ts +1 -1
- package/dist/hoc/withViewerLocales.d.ts +1 -1
- package/dist/locales/index.d.ts +5 -1
- package/package.json +10 -10
- package/src/NoViewer/__snapshots__/NoViewer.spec.jsx.snap +34 -28
- package/src/Panel/Qualifications/QualificationListItemQualification.jsx +2 -2
- package/src/ViewersByFile/__snapshots__/AudioViewer.spec.jsx.snap +11 -17
- package/src/ViewersByFile/__snapshots__/ShortcutViewer.spec.jsx.snap +18 -16
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
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
|
+
|
|
16
|
+
## [22.0.4](https://github.com/cozy/cozy-libs/compare/cozy-viewer@22.0.3...cozy-viewer@22.0.4) (2025-05-14)
|
|
17
|
+
|
|
18
|
+
**Note:** Version bump only for package cozy-viewer
|
|
19
|
+
|
|
6
20
|
## [22.0.3](https://github.com/cozy/cozy-libs/compare/cozy-viewer@22.0.2...cozy-viewer@22.0.3) (2025-05-07)
|
|
7
21
|
|
|
8
22
|
**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:
|
|
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
|
|
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(
|
|
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:
|
|
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:
|
|
1
|
+
declare const _default: JSX.Element;
|
|
2
2
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const withViewerLocales:
|
|
1
|
+
export const withViewerLocales: Component;
|
package/dist/locales/index.d.ts
CHANGED
|
@@ -2,6 +2,10 @@ export namespace locales {
|
|
|
2
2
|
export { en };
|
|
3
3
|
export { fr };
|
|
4
4
|
}
|
|
5
|
-
export function getViewerI18n():
|
|
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": "
|
|
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.
|
|
34
|
+
"cozy-harvest-lib": "^32.3.13",
|
|
35
35
|
"cozy-intent": "^2.30.0",
|
|
36
36
|
"cozy-logger": "^1.17.0",
|
|
37
|
-
"cozy-sharing": "^25.
|
|
38
|
-
"cozy-ui": "^
|
|
37
|
+
"cozy-sharing": "^25.4.0",
|
|
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.
|
|
60
|
-
"cozy-intent": ">=2.
|
|
61
|
-
"cozy-logger": ">=1.
|
|
62
|
-
"cozy-sharing": ">=25.
|
|
63
|
-
"cozy-ui": ">=
|
|
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": "
|
|
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
|
|
13
|
+
viewBox="0 0 15 17"
|
|
13
14
|
width="160"
|
|
14
15
|
>
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
fill
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
|
61
|
+
viewBox="0 0 15 17"
|
|
58
62
|
width="160"
|
|
59
63
|
>
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
fill
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
|
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
|
-
<
|
|
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
|
|
12
|
+
viewBox="0 0 15 17"
|
|
12
13
|
width="160"
|
|
13
14
|
>
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
fill
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
|
13
|
+
viewBox="0 0 15 17"
|
|
13
14
|
width="160"
|
|
14
15
|
>
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
fill
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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="
|
|
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>
|