cozy-viewer 27.0.4 → 27.0.6
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 +8 -0
- package/dist/Footer/DownloadButton.js +2 -2
- package/dist/Footer/ForwardButton.js +2 -2
- package/dist/NoViewer/DownloadButton.js +2 -2
- package/dist/Panel/AI/AIAssistantPanel.js +2 -2
- package/dist/Panel/ActionMenuDesktop.js +2 -2
- package/dist/Panel/ActionMenuMobile.js +2 -2
- package/dist/Panel/ActionMenuWrapper.js +2 -2
- package/dist/Panel/Informations.js +2 -2
- package/dist/Panel/PanelContent.js +2 -2
- package/dist/Panel/Qualification.js +1 -0
- package/dist/Panel/Qualifications/QualificationListItemContact.js +2 -2
- package/dist/Panel/Qualifications/QualificationListItemDate.js +2 -2
- package/dist/Panel/Qualifications/QualificationListItemInformation.js +2 -2
- package/dist/Panel/Qualifications/QualificationListItemOther.js +2 -2
- package/dist/Panel/Qualifications/QualificationListItemQualification.js +2 -2
- package/dist/ViewerContainer.js +2 -2
- package/dist/components/ExpirationAlert.js +2 -2
- package/dist/components/ExpirationAnnotation.js +2 -2
- package/dist/components/SummarizeByAIButton.js +2 -2
- package/dist/components/Toolbar.js +2 -2
- package/dist/helpers.js +1 -1
- package/dist/providers/DemoProvider.js +2 -2
- package/package.json +7 -7
- package/src/Footer/DownloadButton.jsx +2 -2
- package/src/Footer/ForwardButton.jsx +1 -1
- package/src/NoViewer/DownloadButton.jsx +1 -1
- package/src/Panel/AI/AIAssistantPanel.jsx +1 -1
- package/src/Panel/ActionMenuDesktop.jsx +1 -1
- package/src/Panel/ActionMenuMobile.jsx +1 -1
- package/src/Panel/ActionMenuWrapper.jsx +2 -2
- package/src/Panel/Informations.jsx +1 -1
- package/src/Panel/PanelContent.jsx +1 -1
- package/src/Panel/Qualification.jsx +1 -0
- package/src/Panel/Qualifications/QualificationListItemContact.jsx +1 -1
- package/src/Panel/Qualifications/QualificationListItemDate.jsx +1 -1
- package/src/Panel/Qualifications/QualificationListItemInformation.jsx +1 -1
- package/src/Panel/Qualifications/QualificationListItemOther.jsx +1 -1
- package/src/Panel/Qualifications/QualificationListItemQualification.jsx +1 -1
- package/src/ViewerContainer.jsx +7 -7
- package/src/ViewerInformationsWrapper.spec.jsx +0 -2
- package/src/ViewersByFile/PdfMobileViewer.jsx +1 -1
- package/src/ViewersByFile/PdfMobileViewer.spec.jsx +1 -1
- package/src/ViewersByFile/ShortcutViewer.spec.jsx +1 -1
- package/src/components/ExpirationAlert.jsx +1 -1
- package/src/components/ExpirationAnnotation.jsx +1 -1
- package/src/components/SummarizeByAIButton.jsx +1 -1
- package/src/components/Toolbar.jsx +1 -1
- package/src/components/ViewerByFile.jsx +39 -41
- package/src/helpers.js +1 -1
- package/src/hoc/withFileUrl.jsx +1 -1
- package/src/providers/DemoProvider.jsx +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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
|
+
## [27.0.6](https://github.com/cozy/cozy-libs/compare/cozy-viewer@27.0.5...cozy-viewer@27.0.6) (2026-03-16)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package cozy-viewer
|
|
9
|
+
|
|
10
|
+
## [27.0.5](https://github.com/cozy/cozy-libs/compare/cozy-viewer@27.0.4...cozy-viewer@27.0.5) (2026-03-12)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package cozy-viewer
|
|
13
|
+
|
|
6
14
|
## [27.0.4](https://github.com/cozy/cozy-libs/compare/cozy-viewer@27.0.3...cozy-viewer@27.0.4) (2026-03-12)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package cozy-viewer
|
|
@@ -15,8 +15,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
15
15
|
|
|
16
16
|
var _react = _interopRequireDefault(require("react"));
|
|
17
17
|
|
|
18
|
-
var _twakeI18n = require("twake-i18n");
|
|
19
|
-
|
|
20
18
|
var _cozyClient = require("cozy-client");
|
|
21
19
|
|
|
22
20
|
var _Buttons = _interopRequireDefault(require("cozy-ui/transpiled/react/Buttons"));
|
|
@@ -29,6 +27,8 @@ var _Download = _interopRequireDefault(require("cozy-ui/transpiled/react/Icons/D
|
|
|
29
27
|
|
|
30
28
|
var _Alerter = _interopRequireDefault(require("cozy-ui/transpiled/react/deprecated/Alerter"));
|
|
31
29
|
|
|
30
|
+
var _twakeI18n = require("twake-i18n");
|
|
31
|
+
|
|
32
32
|
var DownloadButton = function DownloadButton(_ref) {
|
|
33
33
|
var file = _ref.file,
|
|
34
34
|
variant = _ref.variant;
|
|
@@ -15,8 +15,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
15
15
|
|
|
16
16
|
var _react = _interopRequireDefault(require("react"));
|
|
17
17
|
|
|
18
|
-
var _twakeI18n = require("twake-i18n");
|
|
19
|
-
|
|
20
18
|
var _cozyClient = require("cozy-client");
|
|
21
19
|
|
|
22
20
|
var _sharing = require("cozy-client/dist/models/sharing");
|
|
@@ -35,6 +33,8 @@ var _ShareIos = _interopRequireDefault(require("cozy-ui/transpiled/react/Icons/S
|
|
|
35
33
|
|
|
36
34
|
var _Alerter = _interopRequireDefault(require("cozy-ui/transpiled/react/deprecated/Alerter"));
|
|
37
35
|
|
|
36
|
+
var _twakeI18n = require("twake-i18n");
|
|
37
|
+
|
|
38
38
|
var ForwardIcon = (0, _cozyDeviceHelper.isIOS)() ? _ShareIos.default : _Reply.default;
|
|
39
39
|
|
|
40
40
|
var ForwardButton = function ForwardButton(_ref) {
|
|
@@ -11,8 +11,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
|
|
12
12
|
var _react = _interopRequireDefault(require("react"));
|
|
13
13
|
|
|
14
|
-
var _twakeI18n = require("twake-i18n");
|
|
15
|
-
|
|
16
14
|
var _cozyClient = require("cozy-client");
|
|
17
15
|
|
|
18
16
|
var _file = require("cozy-client/dist/models/file");
|
|
@@ -23,6 +21,8 @@ var _Button = _interopRequireDefault(require("cozy-ui/transpiled/react/deprecate
|
|
|
23
21
|
|
|
24
22
|
var _proptypes = require("cozy-ui-plus/dist/proptypes");
|
|
25
23
|
|
|
24
|
+
var _twakeI18n = require("twake-i18n");
|
|
25
|
+
|
|
26
26
|
var DownloadButton = function DownloadButton(_ref) {
|
|
27
27
|
var client = _ref.client,
|
|
28
28
|
file = _ref.file,
|
|
@@ -23,8 +23,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
23
23
|
|
|
24
24
|
var _reactRouterDom = require("react-router-dom");
|
|
25
25
|
|
|
26
|
-
var _twakeI18n = require("twake-i18n");
|
|
27
|
-
|
|
28
26
|
var _cozyClient = require("cozy-client");
|
|
29
27
|
|
|
30
28
|
var _ai = require("cozy-client/dist/models/ai");
|
|
@@ -57,6 +55,8 @@ var _Typography = _interopRequireDefault(require("cozy-ui/transpiled/react/Typog
|
|
|
57
55
|
|
|
58
56
|
var _Alert = require("cozy-ui/transpiled/react/providers/Alert");
|
|
59
57
|
|
|
58
|
+
var _twakeI18n = require("twake-i18n");
|
|
59
|
+
|
|
60
60
|
var _prompts = require("./prompts");
|
|
61
61
|
|
|
62
62
|
var _helpers = require("../../helpers");
|
|
@@ -11,8 +11,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
|
|
14
|
-
var _twakeI18n = require("twake-i18n");
|
|
15
|
-
|
|
16
14
|
var _Icon = _interopRequireDefault(require("cozy-ui/transpiled/react/Icon"));
|
|
17
15
|
|
|
18
16
|
var _Copy = _interopRequireDefault(require("cozy-ui/transpiled/react/Icons/Copy"));
|
|
@@ -23,6 +21,8 @@ var _Typography = _interopRequireDefault(require("cozy-ui/transpiled/react/Typog
|
|
|
23
21
|
|
|
24
22
|
var _ActionMenu = _interopRequireWildcard(require("cozy-ui/transpiled/react/deprecated/ActionMenu"));
|
|
25
23
|
|
|
24
|
+
var _twakeI18n = require("twake-i18n");
|
|
25
|
+
|
|
26
26
|
var _IntentOpener = _interopRequireDefault(require("../components/IntentOpener"));
|
|
27
27
|
|
|
28
28
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -11,8 +11,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
|
|
12
12
|
var _react = _interopRequireDefault(require("react"));
|
|
13
13
|
|
|
14
|
-
var _twakeI18n = require("twake-i18n");
|
|
15
|
-
|
|
16
14
|
var _BottomSheet = _interopRequireWildcard(require("cozy-ui/transpiled/react/BottomSheet"));
|
|
17
15
|
|
|
18
16
|
var _Icon = _interopRequireDefault(require("cozy-ui/transpiled/react/Icon"));
|
|
@@ -29,6 +27,8 @@ var _ListItemIcon = _interopRequireDefault(require("cozy-ui/transpiled/react/Lis
|
|
|
29
27
|
|
|
30
28
|
var _ListItemText = _interopRequireDefault(require("cozy-ui/transpiled/react/ListItemText"));
|
|
31
29
|
|
|
30
|
+
var _twakeI18n = require("twake-i18n");
|
|
31
|
+
|
|
32
32
|
var _IntentOpener = _interopRequireDefault(require("../components/IntentOpener"));
|
|
33
33
|
|
|
34
34
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -15,12 +15,12 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
15
15
|
|
|
16
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
17
|
|
|
18
|
-
var _twakeI18n = require("twake-i18n");
|
|
19
|
-
|
|
20
18
|
var _Alert = require("cozy-ui/transpiled/react/providers/Alert");
|
|
21
19
|
|
|
22
20
|
var _Breakpoints = _interopRequireDefault(require("cozy-ui/transpiled/react/providers/Breakpoints"));
|
|
23
21
|
|
|
22
|
+
var _twakeI18n = require("twake-i18n");
|
|
23
|
+
|
|
24
24
|
var _ActionMenuDesktop = _interopRequireDefault(require("./ActionMenuDesktop"));
|
|
25
25
|
|
|
26
26
|
var _ActionMenuMobile = _interopRequireDefault(require("./ActionMenuMobile"));
|
|
@@ -15,8 +15,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
15
15
|
|
|
16
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
17
|
|
|
18
|
-
var _twakeI18n = require("twake-i18n");
|
|
19
|
-
|
|
20
18
|
var _cozyClient = require("cozy-client");
|
|
21
19
|
|
|
22
20
|
var _ActionsMenu = _interopRequireDefault(require("cozy-ui/transpiled/react/ActionsMenu"));
|
|
@@ -53,6 +51,8 @@ var _ListItemSecondaryAction = _interopRequireDefault(require("cozy-ui/transpile
|
|
|
53
51
|
|
|
54
52
|
var _ListItemText = _interopRequireDefault(require("cozy-ui/transpiled/react/ListItemText"));
|
|
55
53
|
|
|
54
|
+
var _twakeI18n = require("twake-i18n");
|
|
55
|
+
|
|
56
56
|
var _helpers = require("./helpers");
|
|
57
57
|
|
|
58
58
|
var _withViewerLocales = require("../hoc/withViewerLocales");
|
|
@@ -13,8 +13,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
13
13
|
|
|
14
14
|
var _reactRouterDom = require("react-router-dom");
|
|
15
15
|
|
|
16
|
-
var _twakeI18n = require("twake-i18n");
|
|
17
|
-
|
|
18
16
|
var _cozyFlags = _interopRequireDefault(require("cozy-flags"));
|
|
19
17
|
|
|
20
18
|
var _Icon = _interopRequireDefault(require("cozy-ui/transpiled/react/Icon"));
|
|
@@ -29,6 +27,8 @@ var _Stack = _interopRequireDefault(require("cozy-ui/transpiled/react/Stack"));
|
|
|
29
27
|
|
|
30
28
|
var _Typography = _interopRequireDefault(require("cozy-ui/transpiled/react/Typography"));
|
|
31
29
|
|
|
30
|
+
var _twakeI18n = require("twake-i18n");
|
|
31
|
+
|
|
32
32
|
var _getPanelBlocks = _interopRequireWildcard(require("./getPanelBlocks"));
|
|
33
33
|
|
|
34
34
|
var _withViewerLocales = require("../hoc/withViewerLocales");
|
|
@@ -49,6 +49,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
49
49
|
|
|
50
50
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
51
51
|
|
|
52
|
+
/* eslint-disable react-hooks/refs */
|
|
52
53
|
var ComponentFromMetadataQualificationType = {
|
|
53
54
|
contact: _QualificationListItemContact.default,
|
|
54
55
|
date: _QualificationListItemDate.default,
|
|
@@ -15,8 +15,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
15
15
|
|
|
16
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
17
|
|
|
18
|
-
var _twakeI18n = require("twake-i18n");
|
|
19
|
-
|
|
20
18
|
var _paper = require("cozy-client/dist/models/paper");
|
|
21
19
|
|
|
22
20
|
var _Actions = require("cozy-ui/transpiled/react/ActionsMenu/Actions");
|
|
@@ -39,6 +37,8 @@ var _Spinner = _interopRequireDefault(require("cozy-ui/transpiled/react/Spinner"
|
|
|
39
37
|
|
|
40
38
|
var _Alert = require("cozy-ui/transpiled/react/providers/Alert");
|
|
41
39
|
|
|
40
|
+
var _twakeI18n = require("twake-i18n");
|
|
41
|
+
|
|
42
42
|
var _QualificationListItemText = _interopRequireDefault(require("./QualificationListItemText"));
|
|
43
43
|
|
|
44
44
|
var _IntentOpener = _interopRequireDefault(require("../../components/IntentOpener"));
|
|
@@ -15,8 +15,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
15
15
|
|
|
16
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
17
|
|
|
18
|
-
var _twakeI18n = require("twake-i18n");
|
|
19
|
-
|
|
20
18
|
var _paper = require("cozy-client/dist/models/paper");
|
|
21
19
|
|
|
22
20
|
var _Actions = require("cozy-ui/transpiled/react/ActionsMenu/Actions");
|
|
@@ -41,6 +39,8 @@ var _Typography = _interopRequireDefault(require("cozy-ui/transpiled/react/Typog
|
|
|
41
39
|
|
|
42
40
|
var _Alert = require("cozy-ui/transpiled/react/providers/Alert");
|
|
43
41
|
|
|
42
|
+
var _twakeI18n = require("twake-i18n");
|
|
43
|
+
|
|
44
44
|
var _QualificationListItemText = _interopRequireDefault(require("./QualificationListItemText"));
|
|
45
45
|
|
|
46
46
|
var _ExpirationAnnotation = _interopRequireDefault(require("../../components/ExpirationAnnotation"));
|
|
@@ -15,8 +15,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
15
15
|
|
|
16
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
17
|
|
|
18
|
-
var _twakeI18n = require("twake-i18n");
|
|
19
|
-
|
|
20
18
|
var _paper = require("cozy-client/dist/models/paper");
|
|
21
19
|
|
|
22
20
|
var _Actions = require("cozy-ui/transpiled/react/ActionsMenu/Actions");
|
|
@@ -51,6 +49,8 @@ var _MidEllipsis = _interopRequireDefault(require("cozy-ui/transpiled/react/MidE
|
|
|
51
49
|
|
|
52
50
|
var _Alert = require("cozy-ui/transpiled/react/providers/Alert");
|
|
53
51
|
|
|
52
|
+
var _twakeI18n = require("twake-i18n");
|
|
53
|
+
|
|
54
54
|
var _QualificationListItemText = _interopRequireDefault(require("./QualificationListItemText"));
|
|
55
55
|
|
|
56
56
|
var _IntentOpener = _interopRequireDefault(require("../../components/IntentOpener"));
|
|
@@ -15,8 +15,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
15
15
|
|
|
16
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
17
17
|
|
|
18
|
-
var _twakeI18n = require("twake-i18n");
|
|
19
|
-
|
|
20
18
|
var _paper = require("cozy-client/dist/models/paper");
|
|
21
19
|
|
|
22
20
|
var _Actions = require("cozy-ui/transpiled/react/ActionsMenu/Actions");
|
|
@@ -41,6 +39,8 @@ var _MidEllipsis = _interopRequireDefault(require("cozy-ui/transpiled/react/MidE
|
|
|
41
39
|
|
|
42
40
|
var _Alert = require("cozy-ui/transpiled/react/providers/Alert");
|
|
43
41
|
|
|
42
|
+
var _twakeI18n = require("twake-i18n");
|
|
43
|
+
|
|
44
44
|
var _QualificationListItemText = _interopRequireDefault(require("./QualificationListItemText"));
|
|
45
45
|
|
|
46
46
|
var _IntentOpener = _interopRequireDefault(require("../../components/IntentOpener"));
|
|
@@ -11,8 +11,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
11
11
|
|
|
12
12
|
var _react = _interopRequireDefault(require("react"));
|
|
13
13
|
|
|
14
|
-
var _twakeI18n = require("twake-i18n");
|
|
15
|
-
|
|
16
14
|
var _paper = require("cozy-client/dist/models/paper");
|
|
17
15
|
|
|
18
16
|
var _Icon = _interopRequireDefault(require("cozy-ui/transpiled/react/Icon"));
|
|
@@ -29,6 +27,8 @@ var _MidEllipsis = _interopRequireDefault(require("cozy-ui/transpiled/react/MidE
|
|
|
29
27
|
|
|
30
28
|
var _QualificationIcon = _interopRequireDefault(require("cozy-ui-plus/dist/Qualification/QualificationIcon"));
|
|
31
29
|
|
|
30
|
+
var _twakeI18n = require("twake-i18n");
|
|
31
|
+
|
|
32
32
|
var _helpers = require("../helpers");
|
|
33
33
|
|
|
34
34
|
var QualificationListItemQualification = function QualificationListItemQualification(_ref) {
|
package/dist/ViewerContainer.js
CHANGED
|
@@ -25,8 +25,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
25
25
|
|
|
26
26
|
var _react = _interopRequireWildcard(require("react"));
|
|
27
27
|
|
|
28
|
-
var _twakeI18n = require("twake-i18n");
|
|
29
|
-
|
|
30
28
|
var _cozyClient = require("cozy-client");
|
|
31
29
|
|
|
32
30
|
var _permission = require("cozy-client/dist/models/permission");
|
|
@@ -43,6 +41,8 @@ var _Encrypted = _interopRequireDefault(require("cozy-ui/transpiled/react/provid
|
|
|
43
41
|
|
|
44
42
|
var _proptypes = require("cozy-ui-plus/dist/proptypes");
|
|
45
43
|
|
|
44
|
+
var _twakeI18n = require("twake-i18n");
|
|
45
|
+
|
|
46
46
|
var _Viewer = _interopRequireDefault(require("./Viewer"));
|
|
47
47
|
|
|
48
48
|
var _ViewerInformationsWrapper = _interopRequireDefault(require("./ViewerInformationsWrapper"));
|
|
@@ -17,8 +17,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
17
17
|
|
|
18
18
|
var _react = _interopRequireWildcard(require("react"));
|
|
19
19
|
|
|
20
|
-
var _twakeI18n = require("twake-i18n");
|
|
21
|
-
|
|
22
20
|
var _cozyClient = require("cozy-client");
|
|
23
21
|
|
|
24
22
|
var _paper = require("cozy-client/dist/models/paper");
|
|
@@ -31,6 +29,8 @@ var _Link = _interopRequireDefault(require("cozy-ui/transpiled/react/Link"));
|
|
|
31
29
|
|
|
32
30
|
var _Typography = _interopRequireDefault(require("cozy-ui/transpiled/react/Typography"));
|
|
33
31
|
|
|
32
|
+
var _twakeI18n = require("twake-i18n");
|
|
33
|
+
|
|
34
34
|
var _withViewerLocales = require("../hoc/withViewerLocales");
|
|
35
35
|
|
|
36
36
|
var _ViewerProvider = require("../providers/ViewerProvider");
|
|
@@ -9,12 +9,12 @@ exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
12
|
-
var _twakeI18n = require("twake-i18n");
|
|
13
|
-
|
|
14
12
|
var _cozyClient = require("cozy-client");
|
|
15
13
|
|
|
16
14
|
var _Typography = _interopRequireDefault(require("cozy-ui/transpiled/react/Typography"));
|
|
17
15
|
|
|
16
|
+
var _twakeI18n = require("twake-i18n");
|
|
17
|
+
|
|
18
18
|
var _ViewerProvider = require("../providers/ViewerProvider");
|
|
19
19
|
|
|
20
20
|
var _models$paper = _cozyClient.models.paper,
|
|
@@ -13,8 +13,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
13
13
|
|
|
14
14
|
var _react = _interopRequireDefault(require("react"));
|
|
15
15
|
|
|
16
|
-
var _twakeI18n = require("twake-i18n");
|
|
17
|
-
|
|
18
16
|
var _cozyFlags = _interopRequireDefault(require("cozy-flags"));
|
|
19
17
|
|
|
20
18
|
var _Buttons = _interopRequireDefault(require("cozy-ui/transpiled/react/Buttons"));
|
|
@@ -23,6 +21,8 @@ var _Icon = _interopRequireDefault(require("cozy-ui/transpiled/react/Icon"));
|
|
|
23
21
|
|
|
24
22
|
var _Article = _interopRequireDefault(require("cozy-ui/transpiled/react/Icons/Article"));
|
|
25
23
|
|
|
24
|
+
var _twakeI18n = require("twake-i18n");
|
|
25
|
+
|
|
26
26
|
var _helpers = require("../helpers");
|
|
27
27
|
|
|
28
28
|
var _ViewerProvider = require("../providers/ViewerProvider");
|
|
@@ -15,8 +15,6 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
15
15
|
|
|
16
16
|
var _react = _interopRequireDefault(require("react"));
|
|
17
17
|
|
|
18
|
-
var _twakeI18n = require("twake-i18n");
|
|
19
|
-
|
|
20
18
|
var _cozyClient = require("cozy-client");
|
|
21
19
|
|
|
22
20
|
var _file = require("cozy-client/dist/models/file");
|
|
@@ -45,6 +43,8 @@ var _withBreakpoints = _interopRequireDefault(require("cozy-ui/transpiled/react/
|
|
|
45
43
|
|
|
46
44
|
var _Encrypted = require("cozy-ui/transpiled/react/providers/Encrypted");
|
|
47
45
|
|
|
46
|
+
var _twakeI18n = require("twake-i18n");
|
|
47
|
+
|
|
48
48
|
var _SummarizeByAIButton = _interopRequireDefault(require("./SummarizeByAIButton"));
|
|
49
49
|
|
|
50
50
|
var _ToolbarFilePath = require("./ToolbarFilePath");
|
package/dist/helpers.js
CHANGED
|
@@ -9,8 +9,6 @@ exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
|
|
12
|
-
var _twakeI18n = _interopRequireDefault(require("twake-i18n"));
|
|
13
|
-
|
|
14
12
|
var _cozyClient = require("cozy-client");
|
|
15
13
|
|
|
16
14
|
var _cloudWallpaper = _interopRequireDefault(require("cozy-ui/docs/cloud-wallpaper.jpg"));
|
|
@@ -19,6 +17,8 @@ var _Alert = _interopRequireDefault(require("cozy-ui/transpiled/react/providers/
|
|
|
19
17
|
|
|
20
18
|
var _Breakpoints = require("cozy-ui/transpiled/react/providers/Breakpoints");
|
|
21
19
|
|
|
20
|
+
var _twakeI18n = _interopRequireDefault(require("twake-i18n"));
|
|
21
|
+
|
|
22
22
|
var _ViewerProvider = _interopRequireDefault(require("./ViewerProvider"));
|
|
23
23
|
|
|
24
24
|
var _index = require("../locales/index");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-viewer",
|
|
3
|
-
"version": "27.0.
|
|
3
|
+
"version": "27.0.6",
|
|
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,12 +31,12 @@
|
|
|
31
31
|
"babel-preset-cozy-app": "^2.8.4",
|
|
32
32
|
"cozy-client": "^60.20.0",
|
|
33
33
|
"cozy-device-helper": "2.0.0",
|
|
34
|
-
"cozy-harvest-lib": "^36.1.
|
|
35
|
-
"cozy-intent": "^2.30.
|
|
34
|
+
"cozy-harvest-lib": "^36.1.11",
|
|
35
|
+
"cozy-intent": "^2.30.4",
|
|
36
36
|
"cozy-logger": "^1.17.1",
|
|
37
|
-
"cozy-sharing": "^28.
|
|
37
|
+
"cozy-sharing": "^28.9.1",
|
|
38
38
|
"cozy-ui": "^135.6.0",
|
|
39
|
-
"cozy-ui-plus": "^5.2.
|
|
39
|
+
"cozy-ui-plus": "^5.2.2",
|
|
40
40
|
"identity-obj-proxy": "3.0.0",
|
|
41
41
|
"jest": "27.5.1",
|
|
42
42
|
"jest-canvas-mock": "2.3.1",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"react-router-dom": "^6.14.2",
|
|
47
47
|
"react-test-renderer": "16.12.0",
|
|
48
48
|
"stylus": "0.63.0",
|
|
49
|
-
"twake-i18n": "^0.3.
|
|
49
|
+
"twake-i18n": "^0.3.3",
|
|
50
50
|
"typescript": "5.5.2"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"react-router-dom": ">=6.14.2",
|
|
72
72
|
"twake-i18n": ">=0.3.0"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "81041f18f0134c0ead8f325adc27e6182965c875"
|
|
75
75
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import PropTypes from 'prop-types'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import { useI18n } from 'twake-i18n'
|
|
4
3
|
|
|
5
4
|
import { useClient } from 'cozy-client'
|
|
6
5
|
import Button from 'cozy-ui/transpiled/react/Buttons'
|
|
@@ -8,6 +7,7 @@ import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
|
8
7
|
import IconButton from 'cozy-ui/transpiled/react/IconButton'
|
|
9
8
|
import DownloadIcon from 'cozy-ui/transpiled/react/Icons/Download'
|
|
10
9
|
import Alerter from 'cozy-ui/transpiled/react/deprecated/Alerter'
|
|
10
|
+
import { useI18n } from 'twake-i18n'
|
|
11
11
|
|
|
12
12
|
const DownloadButton = ({ file, variant }) => {
|
|
13
13
|
const client = useClient()
|
|
@@ -19,7 +19,7 @@ const DownloadButton = ({ file, variant }) => {
|
|
|
19
19
|
const handleClick = async () => {
|
|
20
20
|
try {
|
|
21
21
|
await client.collection('io.cozy.files').download(file)
|
|
22
|
-
} catch (
|
|
22
|
+
} catch (_error) {
|
|
23
23
|
Alerter.info('Viewer.error.generic')
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import PropTypes from 'prop-types'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import { useI18n } from 'twake-i18n'
|
|
4
3
|
|
|
5
4
|
import { useClient } from 'cozy-client'
|
|
6
5
|
import { makeSharingLink } from 'cozy-client/dist/models/sharing'
|
|
@@ -11,6 +10,7 @@ import IconButton from 'cozy-ui/transpiled/react/IconButton'
|
|
|
11
10
|
import ReplyIcon from 'cozy-ui/transpiled/react/Icons/Reply'
|
|
12
11
|
import ShareIosIcon from 'cozy-ui/transpiled/react/Icons/ShareIos'
|
|
13
12
|
import Alerter from 'cozy-ui/transpiled/react/deprecated/Alerter'
|
|
13
|
+
import { useI18n } from 'twake-i18n'
|
|
14
14
|
|
|
15
15
|
const ForwardIcon = isIOS() ? ShareIosIcon : ReplyIcon
|
|
16
16
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import PropTypes from 'prop-types'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import { useI18n } from 'twake-i18n'
|
|
4
3
|
|
|
5
4
|
import { withClient } from 'cozy-client'
|
|
6
5
|
import { downloadFile } from 'cozy-client/dist/models/file'
|
|
7
6
|
import { useWebviewIntent } from 'cozy-intent'
|
|
8
7
|
import Button from 'cozy-ui/transpiled/react/deprecated/Button'
|
|
9
8
|
import { FileDoctype } from 'cozy-ui-plus/dist/proptypes'
|
|
9
|
+
import { useI18n } from 'twake-i18n'
|
|
10
10
|
|
|
11
11
|
const DownloadButton = ({ client, file, url }) => {
|
|
12
12
|
const { t } = useI18n()
|
|
@@ -2,7 +2,6 @@ import cx from 'classnames'
|
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import React, { useCallback, useState, useEffect, useRef } from 'react'
|
|
4
4
|
import { useLocation, useNavigate } from 'react-router-dom'
|
|
5
|
-
import { useI18n } from 'twake-i18n'
|
|
6
5
|
|
|
7
6
|
import { useClient } from 'cozy-client'
|
|
8
7
|
import { extractText, chatCompletion } from 'cozy-client/dist/models/ai'
|
|
@@ -20,6 +19,7 @@ import Paper from 'cozy-ui/transpiled/react/Paper'
|
|
|
20
19
|
import Stack from 'cozy-ui/transpiled/react/Stack'
|
|
21
20
|
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
22
21
|
import { useAlert } from 'cozy-ui/transpiled/react/providers/Alert'
|
|
22
|
+
import { useI18n } from 'twake-i18n'
|
|
23
23
|
|
|
24
24
|
import {
|
|
25
25
|
SUMMARY_SYSTEM_PROMPT,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import PropTypes from 'prop-types'
|
|
2
2
|
import React, { forwardRef } from 'react'
|
|
3
|
-
import { useI18n } from 'twake-i18n'
|
|
4
3
|
|
|
5
4
|
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
6
5
|
import Copy from 'cozy-ui/transpiled/react/Icons/Copy'
|
|
@@ -9,6 +8,7 @@ import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
|
9
8
|
import ActionMenu, {
|
|
10
9
|
ActionMenuItem
|
|
11
10
|
} from 'cozy-ui/transpiled/react/deprecated/ActionMenu'
|
|
11
|
+
import { useI18n } from 'twake-i18n'
|
|
12
12
|
|
|
13
13
|
import styles from './styles.styl'
|
|
14
14
|
import IntentOpener from '../components/IntentOpener'
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import PropTypes from 'prop-types'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import { useI18n } from 'twake-i18n'
|
|
4
3
|
|
|
5
4
|
import BottomSheet, {
|
|
6
5
|
BottomSheetItem
|
|
@@ -12,6 +11,7 @@ import List from 'cozy-ui/transpiled/react/List'
|
|
|
12
11
|
import ListItem from 'cozy-ui/transpiled/react/ListItem'
|
|
13
12
|
import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
|
|
14
13
|
import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
|
|
14
|
+
import { useI18n } from 'twake-i18n'
|
|
15
15
|
|
|
16
16
|
import IntentOpener from '../components/IntentOpener'
|
|
17
17
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import PropTypes from 'prop-types'
|
|
2
2
|
import React, { forwardRef } from 'react'
|
|
3
|
-
import { useI18n } from 'twake-i18n'
|
|
4
3
|
|
|
5
4
|
import { useAlert } from 'cozy-ui/transpiled/react/providers/Alert'
|
|
6
5
|
import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints'
|
|
6
|
+
import { useI18n } from 'twake-i18n'
|
|
7
7
|
|
|
8
8
|
import ActionMenuDesktop from './ActionMenuDesktop'
|
|
9
9
|
import ActionMenuMobile from './ActionMenuMobile'
|
|
@@ -33,7 +33,7 @@ const ActionMenuWrapper = forwardRef(
|
|
|
33
33
|
variant: 'filled',
|
|
34
34
|
icon: false
|
|
35
35
|
})
|
|
36
|
-
} catch (
|
|
36
|
+
} catch (_error) {
|
|
37
37
|
showAlert({
|
|
38
38
|
message: t(`Viewer.snackbar.copiedToClipboard.error`),
|
|
39
39
|
severity: 'error',
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import has from 'lodash/has'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import React, { useRef, useState } from 'react'
|
|
4
|
-
import { useI18n } from 'twake-i18n'
|
|
5
4
|
|
|
6
5
|
import { useClient } from 'cozy-client'
|
|
7
6
|
import ActionsMenu from 'cozy-ui/transpiled/react/ActionsMenu'
|
|
@@ -24,6 +23,7 @@ import ListItem from 'cozy-ui/transpiled/react/ListItem'
|
|
|
24
23
|
import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
|
|
25
24
|
import ListItemSecondaryAction from 'cozy-ui/transpiled/react/ListItemSecondaryAction'
|
|
26
25
|
import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
|
|
26
|
+
import { useI18n } from 'twake-i18n'
|
|
27
27
|
|
|
28
28
|
import { makeFormat, makeSize, makeDate, makePath } from './helpers'
|
|
29
29
|
import { withViewerLocales } from '../hoc/withViewerLocales'
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import cx from 'classnames'
|
|
2
2
|
import React from 'react'
|
|
3
3
|
import { useNavigate } from 'react-router-dom'
|
|
4
|
-
import { useI18n } from 'twake-i18n'
|
|
5
4
|
|
|
6
5
|
import flag from 'cozy-flags'
|
|
7
6
|
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
@@ -10,6 +9,7 @@ import CrossMediumIcon from 'cozy-ui/transpiled/react/Icons/CrossMedium'
|
|
|
10
9
|
import Paper from 'cozy-ui/transpiled/react/Paper'
|
|
11
10
|
import Stack from 'cozy-ui/transpiled/react/Stack'
|
|
12
11
|
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
12
|
+
import { useI18n } from 'twake-i18n'
|
|
13
13
|
|
|
14
14
|
import getPanelBlocks, { getPanelBlocksSpecs } from './getPanelBlocks'
|
|
15
15
|
import { withViewerLocales } from '../hoc/withViewerLocales'
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import PropTypes from 'prop-types'
|
|
2
2
|
import React, { forwardRef } from 'react'
|
|
3
|
-
import { useI18n } from 'twake-i18n'
|
|
4
3
|
|
|
5
4
|
import {
|
|
6
5
|
getTranslatedNameForContact,
|
|
@@ -16,6 +15,7 @@ import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
|
|
|
16
15
|
import ListItemSecondaryAction from 'cozy-ui/transpiled/react/ListItemSecondaryAction'
|
|
17
16
|
import Spinner from 'cozy-ui/transpiled/react/Spinner'
|
|
18
17
|
import { useAlert } from 'cozy-ui/transpiled/react/providers/Alert'
|
|
18
|
+
import { useI18n } from 'twake-i18n'
|
|
19
19
|
|
|
20
20
|
import QualificationListItemText from './QualificationListItemText'
|
|
21
21
|
import IntentOpener from '../../components/IntentOpener'
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import PropTypes from 'prop-types'
|
|
2
2
|
import React, { forwardRef } from 'react'
|
|
3
|
-
import { useI18n } from 'twake-i18n'
|
|
4
3
|
|
|
5
4
|
import {
|
|
6
5
|
isExpired,
|
|
@@ -19,6 +18,7 @@ import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
|
|
|
19
18
|
import ListItemSecondaryAction from 'cozy-ui/transpiled/react/ListItemSecondaryAction'
|
|
20
19
|
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
21
20
|
import { useAlert } from 'cozy-ui/transpiled/react/providers/Alert'
|
|
21
|
+
import { useI18n } from 'twake-i18n'
|
|
22
22
|
|
|
23
23
|
import QualificationListItemText from './QualificationListItemText'
|
|
24
24
|
import ExpirationAnnotation from '../../components/ExpirationAnnotation'
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import PropTypes from 'prop-types'
|
|
2
2
|
import React, { forwardRef } from 'react'
|
|
3
|
-
import { useI18n } from 'twake-i18n'
|
|
4
3
|
|
|
5
4
|
import {
|
|
6
5
|
getTranslatedNameForInformationMetadata,
|
|
@@ -23,6 +22,7 @@ import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
|
|
|
23
22
|
import ListItemSecondaryAction from 'cozy-ui/transpiled/react/ListItemSecondaryAction'
|
|
24
23
|
import MidEllipsis from 'cozy-ui/transpiled/react/MidEllipsis'
|
|
25
24
|
import { useAlert } from 'cozy-ui/transpiled/react/providers/Alert'
|
|
25
|
+
import { useI18n } from 'twake-i18n'
|
|
26
26
|
|
|
27
27
|
import QualificationListItemText from './QualificationListItemText'
|
|
28
28
|
import IntentOpener from '../../components/IntentOpener'
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import PropTypes from 'prop-types'
|
|
2
2
|
import React, { forwardRef } from 'react'
|
|
3
|
-
import { useI18n } from 'twake-i18n'
|
|
4
3
|
|
|
5
4
|
import {
|
|
6
5
|
getTranslatedNameForOtherMetadata,
|
|
@@ -17,6 +16,7 @@ import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
|
|
|
17
16
|
import ListItemSecondaryAction from 'cozy-ui/transpiled/react/ListItemSecondaryAction'
|
|
18
17
|
import MidEllipsis from 'cozy-ui/transpiled/react/MidEllipsis'
|
|
19
18
|
import { useAlert } from 'cozy-ui/transpiled/react/providers/Alert'
|
|
19
|
+
import { useI18n } from 'twake-i18n'
|
|
20
20
|
|
|
21
21
|
import QualificationListItemText from './QualificationListItemText'
|
|
22
22
|
import IntentOpener from '../../components/IntentOpener'
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import PropTypes from 'prop-types'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import { useI18n } from 'twake-i18n'
|
|
4
3
|
|
|
5
4
|
import { formatOtherMetadataValue } from 'cozy-client/dist/models/paper'
|
|
6
5
|
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
@@ -10,6 +9,7 @@ import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
|
|
|
10
9
|
import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
|
|
11
10
|
import MidEllipsis from 'cozy-ui/transpiled/react/MidEllipsis'
|
|
12
11
|
import QualificationIcon from 'cozy-ui-plus/dist/Qualification/QualificationIcon'
|
|
12
|
+
import { useI18n } from 'twake-i18n'
|
|
13
13
|
|
|
14
14
|
import { canEditQualification } from '../helpers'
|
|
15
15
|
|
package/src/ViewerContainer.jsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import cx from 'classnames'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import React, { createRef, useState, useEffect } from 'react'
|
|
4
|
-
import { useExtendI18n } from 'twake-i18n'
|
|
5
4
|
|
|
6
5
|
import { useClient } from 'cozy-client'
|
|
7
6
|
import { isDocumentReadOnly } from 'cozy-client/dist/models/permission'
|
|
@@ -12,6 +11,7 @@ import AlertProvider from 'cozy-ui/transpiled/react/providers/Alert'
|
|
|
12
11
|
import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints'
|
|
13
12
|
import EncryptedProvider from 'cozy-ui/transpiled/react/providers/Encrypted'
|
|
14
13
|
import { FileDoctype } from 'cozy-ui-plus/dist/proptypes'
|
|
14
|
+
import { useExtendI18n } from 'twake-i18n'
|
|
15
15
|
|
|
16
16
|
import Viewer from './Viewer'
|
|
17
17
|
import ViewerInformationsWrapper from './ViewerInformationsWrapper'
|
|
@@ -64,12 +64,12 @@ const ViewerContainer = props => {
|
|
|
64
64
|
client
|
|
65
65
|
})
|
|
66
66
|
: allLoaded
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
? !hasWriteAccess(
|
|
68
|
+
hasSharedParent(currentFile.path)
|
|
69
|
+
? currentFile.dir_id
|
|
70
|
+
: currentFile._id
|
|
71
|
+
)
|
|
72
|
+
: true
|
|
73
73
|
|
|
74
74
|
setIsReadOnly(res)
|
|
75
75
|
}
|
|
@@ -7,7 +7,6 @@ import DemoProvider from 'cozy-ui/transpiled/react/providers/DemoProvider'
|
|
|
7
7
|
import ViewerInformationsWrapper from './ViewerInformationsWrapper'
|
|
8
8
|
import ViewerProvider from './providers/ViewerProvider'
|
|
9
9
|
|
|
10
|
-
/* eslint-disable react/display-name */
|
|
11
10
|
jest.mock('./components/Footer', () => ({ children }) => (
|
|
12
11
|
<div data-testid="Footer">{children}</div>
|
|
13
12
|
))
|
|
@@ -20,7 +19,6 @@ jest.mock('./Panel/PanelContent', () => () => (
|
|
|
20
19
|
jest.mock('./Footer/FooterContent', () => () => (
|
|
21
20
|
<div data-testid="FooterContent" />
|
|
22
21
|
))
|
|
23
|
-
/* eslint-enable react/display-name */
|
|
24
22
|
|
|
25
23
|
const setup = ({ validForPanel, disableFooter } = {}) => {
|
|
26
24
|
return render(
|
|
@@ -39,7 +39,7 @@ export const PdfMobileViewer = ({ file, url, t, gestures }) => {
|
|
|
39
39
|
async file => {
|
|
40
40
|
try {
|
|
41
41
|
await downloadFile({ client, file, webviewIntent })
|
|
42
|
-
} catch (
|
|
42
|
+
} catch (_error) {
|
|
43
43
|
showAlert({
|
|
44
44
|
message: t('Viewer.error.generic'),
|
|
45
45
|
severity: 'error',
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { render, waitFor } from '@testing-library/react'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import I18n from 'twake-i18n'
|
|
4
3
|
|
|
5
4
|
import { CozyProvider, createMockClient } from 'cozy-client'
|
|
6
5
|
import logger from 'cozy-logger'
|
|
7
6
|
import EncryptedProvider from 'cozy-ui/transpiled/react/providers/Encrypted'
|
|
7
|
+
import I18n from 'twake-i18n'
|
|
8
8
|
|
|
9
9
|
import { PdfMobileViewer } from './PdfMobileViewer'
|
|
10
10
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { render, waitFor } from '@testing-library/react'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import I18n from 'twake-i18n'
|
|
4
3
|
|
|
5
4
|
import CozyClient, { CozyProvider } from 'cozy-client'
|
|
5
|
+
import I18n from 'twake-i18n'
|
|
6
6
|
|
|
7
7
|
import ShortcutViewer from './ShortcutViewer'
|
|
8
8
|
import en from '../locales/en.json'
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
|
-
import { useI18n } from 'twake-i18n'
|
|
3
2
|
|
|
4
3
|
import { useClient } from 'cozy-client'
|
|
5
4
|
import {
|
|
@@ -12,6 +11,7 @@ import Alert from 'cozy-ui/transpiled/react/Alert'
|
|
|
12
11
|
import Button from 'cozy-ui/transpiled/react/Buttons'
|
|
13
12
|
import Link from 'cozy-ui/transpiled/react/Link'
|
|
14
13
|
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
14
|
+
import { useI18n } from 'twake-i18n'
|
|
15
15
|
|
|
16
16
|
import { withViewerLocales } from '../hoc/withViewerLocales'
|
|
17
17
|
import { useViewer } from '../providers/ViewerProvider'
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import cx from 'classnames'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import React from 'react'
|
|
4
|
-
import { useI18n } from 'twake-i18n'
|
|
5
4
|
|
|
6
5
|
import flag from 'cozy-flags'
|
|
7
6
|
import Button from 'cozy-ui/transpiled/react/Buttons'
|
|
8
7
|
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
9
8
|
import ArticleIcon from 'cozy-ui/transpiled/react/Icons/Article'
|
|
9
|
+
import { useI18n } from 'twake-i18n'
|
|
10
10
|
|
|
11
11
|
import styles from './styles.styl'
|
|
12
12
|
import { isFileSummaryCompatible } from '../helpers'
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import cx from 'classnames'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import React from 'react'
|
|
4
|
-
import { useI18n } from 'twake-i18n'
|
|
5
4
|
|
|
6
5
|
import { useClient } from 'cozy-client'
|
|
7
6
|
import { downloadFile } from 'cozy-client/dist/models/file'
|
|
@@ -22,6 +21,7 @@ import MidEllipsis from 'cozy-ui/transpiled/react/MidEllipsis'
|
|
|
22
21
|
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
23
22
|
import withBreakpoints from 'cozy-ui/transpiled/react/helpers/withBreakpoints'
|
|
24
23
|
import { useEncrypted } from 'cozy-ui/transpiled/react/providers/Encrypted'
|
|
24
|
+
import { useI18n } from 'twake-i18n'
|
|
25
25
|
|
|
26
26
|
import SummarizeByAIButton from './SummarizeByAIButton'
|
|
27
27
|
import { ToolbarFilePath } from './ToolbarFilePath'
|
|
@@ -38,14 +38,14 @@ export const getViewerComponentName = ({
|
|
|
38
38
|
return isBlankPaper(file)
|
|
39
39
|
? BlankPaperViewer
|
|
40
40
|
: isDesktop
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
? PdfJsViewer
|
|
42
|
+
: PdfMobileViewer
|
|
43
43
|
case 'text':
|
|
44
44
|
return isPlainText(file.mime, file.name)
|
|
45
45
|
? TextViewer
|
|
46
46
|
: isOnlyOfficeEnabled
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
? OnlyOfficeViewer
|
|
48
|
+
: NoViewer
|
|
49
49
|
case 'slide':
|
|
50
50
|
return isOnlyOfficeEnabled ? OnlyOfficeViewer : NoViewer
|
|
51
51
|
case 'spreadsheet':
|
|
@@ -55,46 +55,44 @@ export const getViewerComponentName = ({
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
const ViewerByFile = withBreakpoints()(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const onlyOfficeOpener = componentsProps?.OnlyOfficeViewer?.opener
|
|
58
|
+
const ViewerByFile = withBreakpoints()(({
|
|
59
|
+
onClose,
|
|
60
|
+
renderFallbackExtraContent,
|
|
61
|
+
gestures,
|
|
62
|
+
gesturesRef,
|
|
63
|
+
onSwipe,
|
|
64
|
+
breakpoints: { isDesktop },
|
|
65
|
+
componentsProps
|
|
66
|
+
}) => {
|
|
67
|
+
const { file } = useViewer()
|
|
68
|
+
const isOnlyOfficeEnabled = componentsProps?.OnlyOfficeViewer?.isEnabled
|
|
69
|
+
const onlyOfficeOpener = componentsProps?.OnlyOfficeViewer?.opener
|
|
71
70
|
|
|
72
|
-
|
|
71
|
+
const { url } = useEncrypted()
|
|
73
72
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
73
|
+
const ComponentName = useMemo(
|
|
74
|
+
() =>
|
|
75
|
+
getViewerComponentName({
|
|
76
|
+
file,
|
|
77
|
+
isDesktop,
|
|
78
|
+
isOnlyOfficeEnabled
|
|
79
|
+
}),
|
|
80
|
+
[file, isDesktop, isOnlyOfficeEnabled]
|
|
81
|
+
)
|
|
83
82
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
)
|
|
83
|
+
return (
|
|
84
|
+
<ComponentName
|
|
85
|
+
file={file}
|
|
86
|
+
url={url}
|
|
87
|
+
renderFallbackExtraContent={renderFallbackExtraContent}
|
|
88
|
+
gestures={gestures}
|
|
89
|
+
gesturesRef={gesturesRef}
|
|
90
|
+
onlyOfficeOpener={onlyOfficeOpener}
|
|
91
|
+
onSwipe={onSwipe}
|
|
92
|
+
onClose={onClose}
|
|
93
|
+
/>
|
|
94
|
+
)
|
|
95
|
+
})
|
|
98
96
|
|
|
99
97
|
ViewerByFile.propTypes = {
|
|
100
98
|
onClose: PropTypes.func.isRequired,
|
package/src/helpers.js
CHANGED
package/src/hoc/withFileUrl.jsx
CHANGED
|
@@ -57,7 +57,7 @@ const withFileUrl = BaseComponent =>
|
|
|
57
57
|
const downloadUrl = await this.getDownloadLink(file)
|
|
58
58
|
this.clearTimeout()
|
|
59
59
|
this.setState({ downloadUrl, status: LOADED })
|
|
60
|
-
} catch (
|
|
60
|
+
} catch (_err) {
|
|
61
61
|
this.clearTimeout()
|
|
62
62
|
this.setState(state => ({ ...state, status: FAILED }))
|
|
63
63
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { Fragment } from 'react'
|
|
2
|
-
import I18n from 'twake-i18n'
|
|
3
2
|
|
|
4
3
|
import { CozyProvider } from 'cozy-client'
|
|
5
4
|
import CloudWallpaper from 'cozy-ui/docs/cloud-wallpaper.jpg'
|
|
6
5
|
import AlertProvider from 'cozy-ui/transpiled/react/providers/Alert'
|
|
7
6
|
import { BreakpointsProvider } from 'cozy-ui/transpiled/react/providers/Breakpoints'
|
|
7
|
+
import I18n from 'twake-i18n'
|
|
8
8
|
|
|
9
9
|
import ViewerProvider from './ViewerProvider'
|
|
10
10
|
import { locales } from '../locales/index'
|