cozy-viewer 29.0.7 → 30.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/jest.config.js +0 -1
- package/package.json +7 -7
- package/src/NoViewer/__snapshots__/NoViewer.spec.jsx.snap +42 -4
- package/src/ViewersByFile/__snapshots__/AudioViewer.spec.jsx.snap +15 -2
- package/src/ViewersByFile/__snapshots__/ShortcutViewer.spec.jsx.snap +28 -4
- package/test/__mocks__/twake-icons.js +0 -23
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
|
+
# [30.0.0](https://github.com/cozy/cozy-libs/compare/cozy-viewer@29.0.8...cozy-viewer@30.0.0) (2026-06-25)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- Ugrade twake-icons in libs and remove test mock ([46178bc](https://github.com/cozy/cozy-libs/commit/46178bcfff73fb8486b6a5209a14e306b497371b))
|
|
11
|
+
|
|
12
|
+
### BREAKING CHANGES
|
|
13
|
+
|
|
14
|
+
- You must have `@linagora/twake-icons >=2.6.6`
|
|
15
|
+
|
|
16
|
+
## [29.0.8](https://github.com/cozy/cozy-libs/compare/cozy-viewer@29.0.7...cozy-viewer@29.0.8) (2026-06-25)
|
|
17
|
+
|
|
18
|
+
**Note:** Version bump only for package cozy-viewer
|
|
19
|
+
|
|
6
20
|
## [29.0.7](https://github.com/cozy/cozy-libs/compare/cozy-viewer@29.0.6...cozy-viewer@29.0.7) (2026-06-25)
|
|
7
21
|
|
|
8
22
|
**Note:** Version bump only for package cozy-viewer
|
package/jest.config.js
CHANGED
|
@@ -10,7 +10,6 @@ module.exports = {
|
|
|
10
10
|
'\\.(png|gif|jpe?g|svg)$': '<rootDir>/test/__mocks__/fileMock.js',
|
|
11
11
|
'\\.styl$': 'identity-obj-proxy',
|
|
12
12
|
'react-pdf/dist/esm/entry.webpack': 'react-pdf',
|
|
13
|
-
'^@linagora/twake-icons$': '<rootDir>/test/__mocks__/twake-icons.js',
|
|
14
13
|
'^cozy-client/src/(.*)$': '<rootDir>/node_modules/cozy-client/dist/$1',
|
|
15
14
|
'^cozy-client$': '<rootDir>/node_modules/cozy-client/dist/index',
|
|
16
15
|
'^cozy-client/dist/(.*)$': '<rootDir>/node_modules/cozy-client/dist/$1',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-viewer",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "30.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",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@babel/cli": "7.16.8",
|
|
26
26
|
"@babel/core": "7.16.12",
|
|
27
|
-
"@linagora/twake-icons": "^2.6.
|
|
27
|
+
"@linagora/twake-icons": "^2.6.6",
|
|
28
28
|
"@testing-library/jest-dom": "5.17.0",
|
|
29
29
|
"@testing-library/react": "12.1.5",
|
|
30
30
|
"@testing-library/react-hooks": "8.0.1",
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"babel-preset-cozy-app": "^2.8.4",
|
|
33
33
|
"cozy-client": "^60.20.0",
|
|
34
34
|
"cozy-device-helper": "2.0.0",
|
|
35
|
-
"cozy-harvest-lib": "^
|
|
35
|
+
"cozy-harvest-lib": "^39.0.0",
|
|
36
36
|
"cozy-intent": "^2.31.1",
|
|
37
37
|
"cozy-logger": "^1.18.1",
|
|
38
|
-
"cozy-sharing": "^
|
|
38
|
+
"cozy-sharing": "^35.0.0",
|
|
39
39
|
"cozy-ui": "^138.1.0",
|
|
40
|
-
"cozy-ui-plus": "^
|
|
40
|
+
"cozy-ui-plus": "^10.0.0",
|
|
41
41
|
"identity-obj-proxy": "3.0.0",
|
|
42
42
|
"jest": "30.3.0",
|
|
43
43
|
"jest-canvas-mock": "2.3.1",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"react-pdf": "^5.7.2"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@linagora/twake-icons": ">=2.6.
|
|
61
|
+
"@linagora/twake-icons": ">=2.6.6",
|
|
62
62
|
"cozy-client": ">=57.0.0",
|
|
63
63
|
"cozy-device-helper": ">=2.0.0",
|
|
64
64
|
"cozy-flags": ">=4.8.1",
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"react-router-dom": ">=6.14.2",
|
|
74
74
|
"twake-i18n": ">=0.3.0"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "113feef92df29d2b6fe30bad984d3f5a70659b6f"
|
|
77
77
|
}
|
|
@@ -7,10 +7,29 @@ exports[`NoViewer should render the viewer 1`] = `
|
|
|
7
7
|
data-testid="no-viewer"
|
|
8
8
|
>
|
|
9
9
|
<svg
|
|
10
|
-
|
|
10
|
+
class="twake-icon"
|
|
11
|
+
fill="none"
|
|
11
12
|
height="140"
|
|
13
|
+
viewBox="0 0 15 17"
|
|
12
14
|
width="160"
|
|
13
|
-
|
|
15
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
16
|
+
>
|
|
17
|
+
<path
|
|
18
|
+
d="M3.52 1.2h5.834l4.966 4.966V13.6a2.8 2.8 0 0 1-2.8 2.8h-8a2.8 2.8 0 0 1-2.8-2.8V4a2.8 2.8 0 0 1 2.8-2.8Z"
|
|
19
|
+
fill="#e8edf3"
|
|
20
|
+
stroke="#4f5b69"
|
|
21
|
+
stroke-width="0.8"
|
|
22
|
+
/>
|
|
23
|
+
<path
|
|
24
|
+
d="M14.72 6.2 9.32.8v2.793c0 1.44 1.128 2.607 2.52 2.607z"
|
|
25
|
+
fill="#4f5b69"
|
|
26
|
+
/>
|
|
27
|
+
<path
|
|
28
|
+
d="M4.695 14.05v-1.476L9.278 8a.8.8 0 0 1 .23-.148.72.72 0 0 1 .534 0 .6.6 0 0 1 .226.156l.477.486q.104.097.152.226a.75.75 0 0 1 0 .525.65.65 0 0 1-.152.23L6.171 14.05zm5.07-4.583.486-.486-.487-.487-.486.487z"
|
|
29
|
+
fill="#4f5b69"
|
|
30
|
+
fill-opacity="0.72"
|
|
31
|
+
/>
|
|
32
|
+
</svg>
|
|
14
33
|
<p
|
|
15
34
|
class="viewer-filename"
|
|
16
35
|
>
|
|
@@ -37,10 +56,29 @@ exports[`NoViewer should render the viewer with specific extra content 1`] = `
|
|
|
37
56
|
data-testid="no-viewer"
|
|
38
57
|
>
|
|
39
58
|
<svg
|
|
40
|
-
|
|
59
|
+
class="twake-icon"
|
|
60
|
+
fill="none"
|
|
41
61
|
height="140"
|
|
62
|
+
viewBox="0 0 15 17"
|
|
42
63
|
width="160"
|
|
43
|
-
|
|
64
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
65
|
+
>
|
|
66
|
+
<path
|
|
67
|
+
d="M3.52 1.2h5.834l4.966 4.966V13.6a2.8 2.8 0 0 1-2.8 2.8h-8a2.8 2.8 0 0 1-2.8-2.8V4a2.8 2.8 0 0 1 2.8-2.8Z"
|
|
68
|
+
fill="#e8edf3"
|
|
69
|
+
stroke="#4f5b69"
|
|
70
|
+
stroke-width="0.8"
|
|
71
|
+
/>
|
|
72
|
+
<path
|
|
73
|
+
d="M14.72 6.2 9.32.8v2.793c0 1.44 1.128 2.607 2.52 2.607z"
|
|
74
|
+
fill="#4f5b69"
|
|
75
|
+
/>
|
|
76
|
+
<path
|
|
77
|
+
d="M4.695 14.05v-1.476L9.278 8a.8.8 0 0 1 .23-.148.72.72 0 0 1 .534 0 .6.6 0 0 1 .226.156l.477.486q.104.097.152.226a.75.75 0 0 1 0 .525.65.65 0 0 1-.152.23L6.171 14.05zm5.07-4.583.486-.486-.487-.487-.486.487z"
|
|
78
|
+
fill="#4f5b69"
|
|
79
|
+
fill-opacity="0.72"
|
|
80
|
+
/>
|
|
81
|
+
</svg>
|
|
44
82
|
<p
|
|
45
83
|
class="viewer-filename"
|
|
46
84
|
>
|
|
@@ -6,10 +6,23 @@ exports[`AudioViewer should render a spinner then the audio viewer 1`] = `
|
|
|
6
6
|
class="viewer-audioviewer"
|
|
7
7
|
>
|
|
8
8
|
<svg
|
|
9
|
-
|
|
9
|
+
class="twake-icon"
|
|
10
|
+
fill="none"
|
|
10
11
|
height="140"
|
|
12
|
+
viewBox="0 0 15 17"
|
|
11
13
|
width="160"
|
|
12
|
-
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
>
|
|
16
|
+
<path
|
|
17
|
+
d="M3.52 1.3h5.792l4.908 4.907V13.6a2.7 2.7 0 0 1-2.7 2.7h-8a2.7 2.7 0 0 1-2.7-2.7V4a2.7 2.7 0 0 1 2.7-2.7Z"
|
|
18
|
+
fill="#f5fdfd"
|
|
19
|
+
stroke="#0dcbcf"
|
|
20
|
+
/>
|
|
21
|
+
<path
|
|
22
|
+
d="M14.72 6.2 9.32.8v2.793c0 1.44 1.128 2.607 2.52 2.607zm-8.4 5.933c0 .92-.746 1.667-1.667 1.667a.8.8 0 0 1-.588-.245.8.8 0 0 1-.245-.588V10.05q0-.781.297-1.463.297-.683.802-1.188a3.8 3.8 0 0 1 1.187-.802A3.6 3.6 0 0 1 7.57 6.3q.781 0 1.463.297t1.188.802q.505.506.802 1.188t.297 1.463v2.917a.8.8 0 0 1-.245.588.8.8 0 0 1-.588.245c-.92 0-1.667-.746-1.667-1.667V11.3c0-.46.373-.833.833-.833h.417c.23 0 .417-.187.417-.417q0-1.218-.85-2.068-.848-.849-2.067-.849t-2.068.85q-.849.848-.849 2.067c0 .23.187.417.417.417h.417c.46 0 .833.373.833.833z"
|
|
23
|
+
fill="#0dcbcf"
|
|
24
|
+
/>
|
|
25
|
+
</svg>
|
|
13
26
|
<p
|
|
14
27
|
class="viewer-filename"
|
|
15
28
|
>
|
|
@@ -7,10 +7,29 @@ exports[`Shortcutviewer renders the component 1`] = `
|
|
|
7
7
|
data-testid="no-viewer"
|
|
8
8
|
>
|
|
9
9
|
<svg
|
|
10
|
-
|
|
10
|
+
class="twake-icon"
|
|
11
|
+
fill="none"
|
|
11
12
|
height="140"
|
|
13
|
+
viewBox="0 0 15 17"
|
|
12
14
|
width="160"
|
|
13
|
-
|
|
15
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
16
|
+
>
|
|
17
|
+
<path
|
|
18
|
+
d="M3.52 1.2h5.834l4.966 4.966V13.6a2.8 2.8 0 0 1-2.8 2.8h-8a2.8 2.8 0 0 1-2.8-2.8V4a2.8 2.8 0 0 1 2.8-2.8Z"
|
|
19
|
+
fill="#e8edf3"
|
|
20
|
+
stroke="#4f5b69"
|
|
21
|
+
stroke-width="0.8"
|
|
22
|
+
/>
|
|
23
|
+
<path
|
|
24
|
+
d="M14.72 6.2 9.32.8v2.793c0 1.44 1.128 2.607 2.52 2.607z"
|
|
25
|
+
fill="#4f5b69"
|
|
26
|
+
/>
|
|
27
|
+
<path
|
|
28
|
+
d="M4.695 14.05v-1.476L9.278 8a.8.8 0 0 1 .23-.148.72.72 0 0 1 .534 0 .6.6 0 0 1 .226.156l.477.486q.104.097.152.226a.75.75 0 0 1 0 .525.65.65 0 0 1-.152.23L6.171 14.05zm5.07-4.583.486-.486-.487-.487-.486.487z"
|
|
29
|
+
fill="#4f5b69"
|
|
30
|
+
fill-opacity="0.72"
|
|
31
|
+
/>
|
|
32
|
+
</svg>
|
|
14
33
|
<p
|
|
15
34
|
class="viewer-filename"
|
|
16
35
|
/>
|
|
@@ -23,11 +42,16 @@ exports[`Shortcutviewer renders the component 1`] = `
|
|
|
23
42
|
<svg
|
|
24
43
|
aria-hidden="true"
|
|
25
44
|
class="styles__icon___23x3R"
|
|
26
|
-
data-mock-icon="Openwith"
|
|
27
45
|
focusable="false"
|
|
28
46
|
height="16"
|
|
47
|
+
viewBox="0 0 16 16"
|
|
29
48
|
width="16"
|
|
30
|
-
|
|
49
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
50
|
+
>
|
|
51
|
+
<path
|
|
52
|
+
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.778zM9.778 0v1.778h3.19l-8.737 8.738 1.253 1.253 8.738-8.738v3.191H16V0z"
|
|
53
|
+
/>
|
|
54
|
+
</svg>
|
|
31
55
|
<span>
|
|
32
56
|
Viewer.goto
|
|
33
57
|
</span>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
const React = require('react')
|
|
2
|
-
|
|
3
|
-
const Icon = ({ icon, iconRef, ...props }) =>
|
|
4
|
-
React.createElement('svg', { 'data-icon': true, ...props })
|
|
5
|
-
|
|
6
|
-
const Sprite = () => null
|
|
7
|
-
|
|
8
|
-
const getFileTypeIcon = () =>
|
|
9
|
-
function FileTypeIcon() {
|
|
10
|
-
return React.createElement('svg', { 'data-filetypeicon': true })
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const proxyHandler = {
|
|
14
|
-
get: function (target, prop) {
|
|
15
|
-
if (prop in target) return target[prop]
|
|
16
|
-
if (prop === 'default') return target.Icon
|
|
17
|
-
return function IconMock({ iconRef, ...props }) {
|
|
18
|
-
return React.createElement('svg', { 'data-mock-icon': prop, ...props })
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
module.exports = new Proxy({ Icon, Sprite, getFileTypeIcon }, proxyHandler)
|