cozy-viewer 8.0.0 → 8.0.2
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 +16 -0
- package/dist/Footer/BottomSheetContent.js +2 -2
- package/dist/Footer/DownloadButton.js +21 -23
- package/dist/Footer/FooterActionButtons.js +2 -2
- package/dist/Footer/FooterContent.js +2 -2
- package/dist/Footer/ForwardButton.js +59 -61
- package/dist/Footer/ForwardOrDownloadButton.js +2 -2
- package/dist/Footer/Sharing.js +2 -2
- package/dist/Footer/helpers.js +86 -98
- package/dist/NoViewer/DownloadButton.js +1 -3
- package/dist/NoViewer/FileIcon.js +1 -2
- package/dist/NoViewer/NoViewer.js +2 -2
- package/dist/Panel/ActionMenuDesktop.js +2 -2
- package/dist/Panel/ActionMenuMobile.js +2 -2
- package/dist/Panel/ActionMenuWrapper.js +34 -36
- package/dist/Panel/Informations.js +1 -3
- package/dist/Panel/PanelContent.js +1 -3
- package/dist/Panel/Qualification.js +4 -6
- package/dist/Panel/QualificationListItemContact.js +2 -2
- package/dist/Panel/QualificationListItemDate.js +2 -2
- package/dist/Panel/QualificationListItemInformation.js +2 -2
- package/dist/Panel/QualificationListItemOther.js +2 -2
- package/dist/Panel/QualificationListItemQualification.js +2 -2
- package/dist/Panel/QualificationListItemText.js +2 -2
- package/dist/Panel/Sharing.js +1 -3
- package/dist/Panel/Summary.js +21 -25
- package/dist/Panel/SummaryDialog.js +15 -19
- package/dist/Panel/getPanelBlocks.js +2 -5
- package/dist/Panel/helpers.js +6 -16
- package/dist/Viewer.js +2 -2
- package/dist/ViewerContainer.js +2 -2
- package/dist/ViewerExposer.js +1 -2
- package/dist/ViewerInformationsWrapper.js +2 -2
- package/dist/ViewerWithCustomPanelAndFooter.js +1 -2
- package/dist/ViewersByFile/AudioViewer.js +1 -3
- package/dist/ViewersByFile/BlankPaperViewer.js +3 -5
- package/dist/ViewersByFile/ImageViewer.js +1 -2
- package/dist/ViewersByFile/NoNetworkViewer.js +1 -3
- package/dist/ViewersByFile/OnlyOfficeViewer.js +1 -3
- package/dist/ViewersByFile/PdfJsViewer.js +5 -11
- package/dist/ViewersByFile/PdfMobileViewer.js +29 -34
- package/dist/ViewersByFile/ShortcutViewer.js +1 -3
- package/dist/ViewersByFile/TextViewer.js +63 -70
- package/dist/ViewersByFile/VideoViewer.js +1 -3
- package/dist/components/ExpirationAlert.js +15 -19
- package/dist/components/ExpirationAnnotation.js +2 -2
- package/dist/components/Footer.js +1 -2
- package/dist/components/InformationPanel.js +3 -4
- package/dist/components/Navigation.js +2 -2
- package/dist/components/PdfToolbarButton.js +2 -2
- package/dist/components/PrintButton.js +34 -36
- package/dist/components/Toolbar.js +1 -3
- package/dist/components/ToolbarButtons.js +2 -2
- package/dist/components/ToolbarFilePath.js +2 -4
- package/dist/components/ViewerByFile.js +7 -8
- package/dist/components/ViewerControls.js +4 -7
- package/dist/components/ViewerSpinner.js +1 -3
- package/dist/helpers.js +11 -27
- package/dist/hoc/withFileUrl.js +47 -50
- package/dist/hoc/withViewerLocales.js +1 -2
- package/dist/hooks/useReferencedContactName.js +1 -2
- package/dist/index.js +1 -2
- package/dist/locales/index.js +2 -3
- package/dist/proptypes.js +2 -3
- package/dist/providers/ActionMenuProvider.js +2 -5
- package/dist/providers/DemoProvider.js +1 -2
- package/dist/queries.js +3 -7
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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
|
+
## [8.0.2](https://github.com/cozy/cozy-libs/compare/cozy-viewer@8.0.1...cozy-viewer@8.0.2) (2024-12-06)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package cozy-viewer
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [8.0.1](https://github.com/cozy/cozy-libs/compare/cozy-viewer@8.0.0...cozy-viewer@8.0.1) (2024-12-06)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package cozy-viewer
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
# [8.0.0](https://github.com/cozy/cozy-libs/compare/cozy-viewer@7.0.2...cozy-viewer@8.0.0) (2024-12-05)
|
|
7
23
|
|
|
8
24
|
|
|
@@ -46,27 +46,25 @@ var DownloadButton = function DownloadButton(_ref) {
|
|
|
46
46
|
var handleClick = /*#__PURE__*/function () {
|
|
47
47
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
48
48
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
49
|
-
while (1) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return _context.stop();
|
|
69
|
-
}
|
|
49
|
+
while (1) switch (_context.prev = _context.next) {
|
|
50
|
+
case 0:
|
|
51
|
+
_context.prev = 0;
|
|
52
|
+
_context.next = 3;
|
|
53
|
+
return client.collection('io.cozy.files').download(file);
|
|
54
|
+
|
|
55
|
+
case 3:
|
|
56
|
+
_context.next = 8;
|
|
57
|
+
break;
|
|
58
|
+
|
|
59
|
+
case 5:
|
|
60
|
+
_context.prev = 5;
|
|
61
|
+
_context.t0 = _context["catch"](0);
|
|
62
|
+
|
|
63
|
+
_Alerter.default.info('Viewer.error.generic');
|
|
64
|
+
|
|
65
|
+
case 8:
|
|
66
|
+
case "end":
|
|
67
|
+
return _context.stop();
|
|
70
68
|
}
|
|
71
69
|
}, _callee, null, [[0, 5]]);
|
|
72
70
|
}));
|
|
@@ -109,5 +107,5 @@ DownloadButton.propTypes = {
|
|
|
109
107
|
DownloadButton.defaultProptypes = {
|
|
110
108
|
variant: 'default'
|
|
111
109
|
};
|
|
112
|
-
|
|
113
|
-
exports.default =
|
|
110
|
+
|
|
111
|
+
var _default = exports.default = DownloadButton;
|
|
@@ -29,5 +29,5 @@ FooterActionButtons.propTypes = {
|
|
|
29
29
|
children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.arrayOf(_propTypes.default.node)]),
|
|
30
30
|
file: _propTypes.default.object
|
|
31
31
|
};
|
|
32
|
-
|
|
33
|
-
exports.default =
|
|
32
|
+
|
|
33
|
+
var _default = exports.default = FooterActionButtons;
|
|
@@ -100,5 +100,5 @@ FooterContent.propTypes = {
|
|
|
100
100
|
isPublic: _propTypes.default.bool,
|
|
101
101
|
children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.arrayOf(_propTypes.default.node)])
|
|
102
102
|
};
|
|
103
|
-
|
|
104
|
-
exports.default =
|
|
103
|
+
|
|
104
|
+
var _default = exports.default = FooterContent;
|
|
@@ -65,66 +65,64 @@ var ForwardButton = function ForwardButton(_ref) {
|
|
|
65
65
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(file) {
|
|
66
66
|
var url, shareData;
|
|
67
67
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
68
|
-
while (1) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
_context.next = 11;
|
|
73
|
-
break;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
_context.prev = 1;
|
|
77
|
-
_context.next = 4;
|
|
78
|
-
return (0, _helpers.exportFilesNative)(client, [file]);
|
|
79
|
-
|
|
80
|
-
case 4:
|
|
81
|
-
_context.next = 9;
|
|
68
|
+
while (1) switch (_context.prev = _context.next) {
|
|
69
|
+
case 0:
|
|
70
|
+
if (!(0, _cozyDeviceHelper.isMobileApp)()) {
|
|
71
|
+
_context.next = 11;
|
|
82
72
|
break;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
_context.prev = 1;
|
|
76
|
+
_context.next = 4;
|
|
77
|
+
return (0, _helpers.exportFilesNative)(client, [file]);
|
|
78
|
+
|
|
79
|
+
case 4:
|
|
80
|
+
_context.next = 9;
|
|
81
|
+
break;
|
|
82
|
+
|
|
83
|
+
case 6:
|
|
84
|
+
_context.prev = 6;
|
|
85
|
+
_context.t0 = _context["catch"](1);
|
|
86
|
+
|
|
87
|
+
_Alerter.default.info("Viewer.error.".concat(_context.t0), {
|
|
88
|
+
fileMime: file.mime
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
case 9:
|
|
92
|
+
_context.next = 22;
|
|
93
|
+
break;
|
|
94
|
+
|
|
95
|
+
case 11:
|
|
96
|
+
_context.prev = 11;
|
|
97
|
+
_context.next = 14;
|
|
98
|
+
return (0, _sharing.getSharingLink)(client, [file.id]);
|
|
99
|
+
|
|
100
|
+
case 14:
|
|
101
|
+
url = _context.sent;
|
|
102
|
+
shareData = {
|
|
103
|
+
title: t('Viewer.share.title', {
|
|
104
|
+
name: file.name
|
|
105
|
+
}),
|
|
106
|
+
text: t('Viewer.share.text', {
|
|
107
|
+
name: file.name
|
|
108
|
+
}),
|
|
109
|
+
url: url
|
|
110
|
+
};
|
|
111
|
+
navigator.share(shareData);
|
|
112
|
+
_context.next = 22;
|
|
113
|
+
break;
|
|
114
|
+
|
|
115
|
+
case 19:
|
|
116
|
+
_context.prev = 19;
|
|
117
|
+
_context.t1 = _context["catch"](11);
|
|
118
|
+
|
|
119
|
+
_Alerter.default.error('Viewer.share.error', {
|
|
120
|
+
error: _context.t1
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
case 22:
|
|
124
|
+
case "end":
|
|
125
|
+
return _context.stop();
|
|
128
126
|
}
|
|
129
127
|
}, _callee, null, [[1, 6], [11, 19]]);
|
|
130
128
|
}));
|
|
@@ -173,5 +171,5 @@ ForwardButton.propTypes = {
|
|
|
173
171
|
ForwardButton.defaultProptypes = {
|
|
174
172
|
variant: 'default'
|
|
175
173
|
};
|
|
176
|
-
|
|
177
|
-
exports.default =
|
|
174
|
+
|
|
175
|
+
var _default = exports.default = ForwardButton;
|
|
@@ -38,5 +38,5 @@ var ForwardOrDownloadButton = function ForwardOrDownloadButton(_ref) {
|
|
|
38
38
|
ForwardOrDownloadButton.propTypes = {
|
|
39
39
|
file: _propTypes.default.object
|
|
40
40
|
};
|
|
41
|
-
|
|
42
|
-
exports.default =
|
|
41
|
+
|
|
42
|
+
var _default = exports.default = ForwardOrDownloadButton;
|
package/dist/Footer/Sharing.js
CHANGED
package/dist/Footer/helpers.js
CHANGED
|
@@ -19,16 +19,14 @@ var _cozyDeviceHelper = require("cozy-device-helper");
|
|
|
19
19
|
|
|
20
20
|
var _Alerter = _interopRequireDefault(require("cozy-ui/transpiled/react/deprecated/Alerter"));
|
|
21
21
|
|
|
22
|
-
var shouldBeForwardButton = function shouldBeForwardButton(client) {
|
|
22
|
+
var shouldBeForwardButton = exports.shouldBeForwardButton = function shouldBeForwardButton(client) {
|
|
23
23
|
var _client$appMetadata;
|
|
24
24
|
|
|
25
|
-
var isDrive = (client === null || client === void 0
|
|
25
|
+
var isDrive = (client === null || client === void 0 || (_client$appMetadata = client.appMetadata) === null || _client$appMetadata === void 0 ? void 0 : _client$appMetadata.slug) === 'drive';
|
|
26
26
|
if ((0, _cozyDeviceHelper.isMobileApp)() || navigator.share && !isDrive) return true;
|
|
27
27
|
return false;
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
exports.shouldBeForwardButton = shouldBeForwardButton;
|
|
31
|
-
|
|
32
30
|
var isMissingFileError = function isMissingFileError(error) {
|
|
33
31
|
return error.status === 404;
|
|
34
32
|
};
|
|
@@ -45,96 +43,92 @@ var downloadFileError = function downloadFileError(error) {
|
|
|
45
43
|
*/
|
|
46
44
|
|
|
47
45
|
|
|
48
|
-
var exportFilesNative = /*#__PURE__*/function () {
|
|
46
|
+
var exportFilesNative = exports.exportFilesNative = /*#__PURE__*/function () {
|
|
49
47
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(client, files, filename) {
|
|
50
48
|
var downloadAllFiles, urls;
|
|
51
49
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
52
|
-
while (1) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
var
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
50
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
51
|
+
case 0:
|
|
52
|
+
downloadAllFiles = files.map( /*#__PURE__*/function () {
|
|
53
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(file) {
|
|
54
|
+
var response, blob, filenameToUse, localFile;
|
|
55
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
56
|
+
while (1) switch (_context.prev = _context.next) {
|
|
57
|
+
case 0:
|
|
58
|
+
_context.next = 2;
|
|
59
|
+
return client.collection('io.cozy.files').fetchFileContentById(file.id);
|
|
60
|
+
|
|
61
|
+
case 2:
|
|
62
|
+
response = _context.sent;
|
|
63
|
+
_context.next = 5;
|
|
64
|
+
return response.blob();
|
|
65
|
+
|
|
66
|
+
case 5:
|
|
67
|
+
blob = _context.sent;
|
|
68
|
+
filenameToUse = filename ? filename : file.name;
|
|
69
|
+
_context.next = 9;
|
|
70
|
+
return (0, _fsnative.saveFileWithCordova)(blob, filenameToUse);
|
|
71
|
+
|
|
72
|
+
case 9:
|
|
73
|
+
localFile = _context.sent;
|
|
74
|
+
return _context.abrupt("return", localFile.nativeURL);
|
|
75
|
+
|
|
76
|
+
case 11:
|
|
77
|
+
case "end":
|
|
78
|
+
return _context.stop();
|
|
79
|
+
}
|
|
80
|
+
}, _callee);
|
|
81
|
+
}));
|
|
82
|
+
|
|
83
|
+
return function (_x4) {
|
|
84
|
+
return _ref2.apply(this, arguments);
|
|
85
|
+
};
|
|
86
|
+
}());
|
|
87
|
+
_context2.prev = 1;
|
|
88
|
+
|
|
89
|
+
_Alerter.default.info('Viewer.alert.preparing', {
|
|
90
|
+
duration: Math.min(downloadAllFiles.length * 2000, 6000)
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
_context2.next = 5;
|
|
94
|
+
return Promise.all(downloadAllFiles);
|
|
95
|
+
|
|
96
|
+
case 5:
|
|
97
|
+
urls = _context2.sent;
|
|
98
|
+
|
|
99
|
+
if (urls.length === 1 && (0, _cozyDeviceHelper.isIOS)()) {
|
|
100
|
+
// TODO
|
|
101
|
+
// It seems that files: is not well supported on iOS. url seems to work well
|
|
102
|
+
// at with one file. Need to check when severals
|
|
103
|
+
window.plugins.socialsharing.shareWithOptions({
|
|
104
|
+
url: urls[0]
|
|
105
|
+
}, function (result) {
|
|
106
|
+
if (result.completed === true) {
|
|
107
|
+
_Alerter.default.success('Viewer.share.success');
|
|
108
|
+
}
|
|
109
|
+
}, function (error) {
|
|
110
|
+
throw error;
|
|
111
|
+
});
|
|
112
|
+
} else {
|
|
113
|
+
window.plugins.socialsharing.shareWithOptions({
|
|
114
|
+
files: urls
|
|
115
|
+
}, null, function (error) {
|
|
116
|
+
throw error;
|
|
96
117
|
});
|
|
118
|
+
}
|
|
97
119
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}, function (result) {
|
|
111
|
-
if (result.completed === true) {
|
|
112
|
-
_Alerter.default.success('Viewer.share.success');
|
|
113
|
-
}
|
|
114
|
-
}, function (error) {
|
|
115
|
-
throw error;
|
|
116
|
-
});
|
|
117
|
-
} else {
|
|
118
|
-
window.plugins.socialsharing.shareWithOptions({
|
|
119
|
-
files: urls
|
|
120
|
-
}, null, function (error) {
|
|
121
|
-
throw error;
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
_context2.next = 12;
|
|
126
|
-
break;
|
|
127
|
-
|
|
128
|
-
case 9:
|
|
129
|
-
_context2.prev = 9;
|
|
130
|
-
_context2.t0 = _context2["catch"](1);
|
|
131
|
-
|
|
132
|
-
_Alerter.default.error(downloadFileError(_context2.t0));
|
|
133
|
-
|
|
134
|
-
case 12:
|
|
135
|
-
case "end":
|
|
136
|
-
return _context2.stop();
|
|
137
|
-
}
|
|
120
|
+
_context2.next = 12;
|
|
121
|
+
break;
|
|
122
|
+
|
|
123
|
+
case 9:
|
|
124
|
+
_context2.prev = 9;
|
|
125
|
+
_context2.t0 = _context2["catch"](1);
|
|
126
|
+
|
|
127
|
+
_Alerter.default.error(downloadFileError(_context2.t0));
|
|
128
|
+
|
|
129
|
+
case 12:
|
|
130
|
+
case "end":
|
|
131
|
+
return _context2.stop();
|
|
138
132
|
}
|
|
139
133
|
}, _callee2, null, [[1, 9]]);
|
|
140
134
|
}));
|
|
@@ -144,9 +138,7 @@ var exportFilesNative = /*#__PURE__*/function () {
|
|
|
144
138
|
};
|
|
145
139
|
}();
|
|
146
140
|
|
|
147
|
-
exports.
|
|
148
|
-
|
|
149
|
-
var mapToAllChildren = function mapToAllChildren(children, cb) {
|
|
141
|
+
var mapToAllChildren = exports.mapToAllChildren = function mapToAllChildren(children, cb) {
|
|
150
142
|
return _react.Children.map(children, function (child) {
|
|
151
143
|
if (! /*#__PURE__*/(0, _react.isValidElement)(child)) return child;
|
|
152
144
|
var grandchildren = child.props.children;
|
|
@@ -161,9 +153,7 @@ var mapToAllChildren = function mapToAllChildren(children, cb) {
|
|
|
161
153
|
});
|
|
162
154
|
};
|
|
163
155
|
|
|
164
|
-
exports.
|
|
165
|
-
|
|
166
|
-
var extractChildrenCompByName = function extractChildrenCompByName(_ref3) {
|
|
156
|
+
var extractChildrenCompByName = exports.extractChildrenCompByName = function extractChildrenCompByName(_ref3) {
|
|
167
157
|
var children = _ref3.children,
|
|
168
158
|
file = _ref3.file,
|
|
169
159
|
name = _ref3.name;
|
|
@@ -174,6 +164,4 @@ var extractChildrenCompByName = function extractChildrenCompByName(_ref3) {
|
|
|
174
164
|
file: file
|
|
175
165
|
}) : null;
|
|
176
166
|
return ChildrenCompWithFile;
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
exports.extractChildrenCompByName = extractChildrenCompByName;
|
|
167
|
+
};
|
|
@@ -67,40 +67,38 @@ var ActionMenuWrapper = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
|
|
|
67
67
|
var handleCopy = /*#__PURE__*/function () {
|
|
68
68
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
69
69
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
70
|
-
while (1) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
return _context.stop();
|
|
103
|
-
}
|
|
70
|
+
while (1) switch (_context.prev = _context.next) {
|
|
71
|
+
case 0:
|
|
72
|
+
_context.prev = 0;
|
|
73
|
+
_context.next = 3;
|
|
74
|
+
return navigator.clipboard.writeText(value);
|
|
75
|
+
|
|
76
|
+
case 3:
|
|
77
|
+
showAlert({
|
|
78
|
+
message: t("Viewer.snackbar.copiedToClipboard.success"),
|
|
79
|
+
severity: 'success',
|
|
80
|
+
variant: 'filled',
|
|
81
|
+
icon: false
|
|
82
|
+
});
|
|
83
|
+
_context.next = 9;
|
|
84
|
+
break;
|
|
85
|
+
|
|
86
|
+
case 6:
|
|
87
|
+
_context.prev = 6;
|
|
88
|
+
_context.t0 = _context["catch"](0);
|
|
89
|
+
showAlert({
|
|
90
|
+
message: t("Viewer.snackbar.copiedToClipboard.error"),
|
|
91
|
+
severity: 'error',
|
|
92
|
+
variant: 'filled',
|
|
93
|
+
icon: false
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
case 9:
|
|
97
|
+
onClose();
|
|
98
|
+
|
|
99
|
+
case 10:
|
|
100
|
+
case "end":
|
|
101
|
+
return _context.stop();
|
|
104
102
|
}
|
|
105
103
|
}, _callee, null, [[0, 6]]);
|
|
106
104
|
}));
|
|
@@ -151,5 +149,5 @@ ActionMenuWrapper.propTypes = {
|
|
|
151
149
|
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number])
|
|
152
150
|
})
|
|
153
151
|
};
|
|
154
|
-
|
|
155
|
-
exports.default =
|
|
152
|
+
|
|
153
|
+
var _default = exports.default = ActionMenuWrapper;
|
|
@@ -158,6 +158,4 @@ Informations.propTypes = {
|
|
|
158
158
|
t: _propTypes.default.func
|
|
159
159
|
};
|
|
160
160
|
|
|
161
|
-
var _default = (0, _withViewerLocales.withViewerLocales)(Informations);
|
|
162
|
-
|
|
163
|
-
exports.default = _default;
|
|
161
|
+
var _default = exports.default = (0, _withViewerLocales.withViewerLocales)(Informations);
|
|
@@ -63,6 +63,4 @@ PanelContent.propTypes = {
|
|
|
63
63
|
isPublic: _propTypes.default.bool
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
-
var _default = (0, _withViewerLocales.withViewerLocales)(PanelContent);
|
|
67
|
-
|
|
68
|
-
exports.default = _default;
|
|
66
|
+
var _default = exports.default = (0, _withViewerLocales.withViewerLocales)(PanelContent);
|
|
@@ -54,7 +54,7 @@ var ComponentFromMetadataQualificationType = {
|
|
|
54
54
|
var isExpirationAlertHidden = function isExpirationAlertHidden(file) {
|
|
55
55
|
var _file$metadata$hideEx, _file$metadata;
|
|
56
56
|
|
|
57
|
-
return (_file$metadata$hideEx = file === null || file === void 0
|
|
57
|
+
return (_file$metadata$hideEx = file === null || file === void 0 || (_file$metadata = file.metadata) === null || _file$metadata === void 0 ? void 0 : _file$metadata.hideExpirationAlert) !== null && _file$metadata$hideEx !== void 0 ? _file$metadata$hideEx : false;
|
|
58
58
|
};
|
|
59
59
|
|
|
60
60
|
var Qualification = function Qualification(_ref) {
|
|
@@ -103,9 +103,9 @@ var Qualification = function Qualification(_ref) {
|
|
|
103
103
|
};
|
|
104
104
|
|
|
105
105
|
var formattedMetadataQualification = (0, _react.useMemo)(function () {
|
|
106
|
-
var _file$bills
|
|
106
|
+
var _file$bills;
|
|
107
107
|
|
|
108
|
-
var relatedBills = (_file$bills = file.bills) === null || _file$bills === void 0
|
|
108
|
+
var relatedBills = (_file$bills = file.bills) === null || _file$bills === void 0 || (_file$bills = _file$bills.data) === null || _file$bills === void 0 ? void 0 : _file$bills[0];
|
|
109
109
|
var formattedMetadataQualification = (0, _paper.formatMetadataQualification)(metadata).sort(function (a, b) {
|
|
110
110
|
return a.name === 'qualification' ? -1 : b.name === 'qualification' ? 1 : 0;
|
|
111
111
|
}); // move "qualification" metadata in first position
|
|
@@ -172,6 +172,4 @@ Qualification.propTypes = {
|
|
|
172
172
|
file: _propTypes.default.object.isRequired
|
|
173
173
|
};
|
|
174
174
|
|
|
175
|
-
var _default = (0, _withViewerLocales.withViewerLocales)(Qualification);
|
|
176
|
-
|
|
177
|
-
exports.default = _default;
|
|
175
|
+
var _default = exports.default = (0, _withViewerLocales.withViewerLocales)(Qualification);
|