@manuscripts/style-guide 0.30.17 → 0.30.21
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/dist/cjs/components/AffiliationsEditor/AffiliationsEditor.js +3 -3
- package/dist/cjs/components/AffiliationsEditor/AffiliationsEditorItem.js +7 -6
- package/dist/cjs/components/AffiliationsEditor/AffiliationsEditorProfile.js +3 -3
- package/dist/cjs/components/AffiliationsEditor/AffiliationsEditorView.js +10 -40
- package/dist/cjs/components/AffiliationsEditor/styles.js +2 -1
- package/dist/cjs/components/AffiliationsList.js +3 -2
- package/dist/cjs/components/AlertMessage.js +9 -9
- package/dist/cjs/components/AuthorForm/AuthorForm.js +2 -1
- package/dist/cjs/components/AuthorForm/ContributorRolesSelect.js +6 -6
- package/dist/cjs/components/AuthorForm/RemoveAuthorButton.js +1 -1
- package/dist/cjs/components/AuthorForm/index.js +0 -1
- package/dist/cjs/components/AuthorName.js +2 -2
- package/dist/cjs/components/AuthorsContainer.js +4 -3
- package/dist/cjs/components/AuthorsDND/AuthorsDND.js +39 -17
- package/dist/cjs/components/AuthorsDND/DraggableAuthorItem.js +6 -25
- package/dist/cjs/components/AuthorsDND/index.js +5 -10
- package/dist/cjs/components/AuthorsList/Author.js +3 -2
- package/dist/cjs/components/AuthorsList/AuthorsList.js +3 -2
- package/dist/cjs/components/Avatar.js +5 -4
- package/dist/cjs/components/Button.js +15 -15
- package/dist/cjs/components/ColorField/ColorField.js +2 -1
- package/dist/cjs/components/ColorField/ColorSelector.js +8 -7
- package/dist/cjs/components/Comments/CommentActions.js +9 -12
- package/dist/cjs/components/Comments/CommentBody.js +5 -5
- package/dist/cjs/components/Comments/CommentTarget.js +1 -1
- package/dist/cjs/components/Comments/CommentUser.js +3 -2
- package/dist/cjs/components/Comments/CommentWrapper.js +18 -16
- package/dist/cjs/components/Comments/ResolveButton.js +3 -2
- package/dist/cjs/components/Dialog.js +2 -2
- package/dist/cjs/components/FileManager/ConfirmationPopUp.js +2 -1
- package/dist/cjs/components/FileManager/DragItemArea.js +2 -1
- package/dist/cjs/components/FileManager/FileManager.js +11 -16
- package/dist/cjs/components/FileManager/FileSectionItem/DesignationActions.js +5 -4
- package/dist/cjs/components/FileManager/FileSectionItem/DesignationActionsList.js +5 -4
- package/dist/cjs/components/FileManager/FileSectionItem/DragLayer.js +5 -4
- package/dist/cjs/components/FileManager/FileSectionItem/DraggableFileSectionItem.js +8 -7
- package/dist/cjs/components/FileManager/FileSectionItem/FileInfo.js +3 -2
- package/dist/cjs/components/FileManager/FileSectionItem/FileSectionItem.js +3 -2
- package/dist/cjs/components/FileManager/FileSectionItem/FileSectionUploadItem.js +3 -2
- package/dist/cjs/components/FileManager/FileSectionItem/FileTypeIcon.js +2 -1
- package/dist/cjs/components/FileManager/FileSectionItem/ItemActions.js +5 -4
- package/dist/cjs/components/FileManager/FileSectionItem/ProgressBarUploadItem.js +2 -1
- package/dist/cjs/components/FileManager/FileSectionState.js +5 -3
- package/dist/cjs/components/FileManager/FilesSection.js +4 -3
- package/dist/cjs/components/FileManager/SelectDesignationActions.js +11 -11
- package/dist/cjs/components/FileManager/SelectDialogDesignation.js +3 -2
- package/dist/cjs/components/FileManager/UploadFileArea.js +11 -10
- package/dist/cjs/components/FileManager/util.js +15 -8
- package/dist/cjs/components/Form.js +1 -1
- package/dist/cjs/components/Inspector.js +7 -7
- package/dist/cjs/components/InspectorSection.js +5 -4
- package/dist/cjs/components/ManuscriptNoteList.js +17 -17
- package/dist/cjs/components/PdfPreview.js +13 -13
- package/dist/cjs/components/RadioButton.js +2 -1
- package/dist/cjs/components/RelativeDate.js +3 -2
- package/dist/cjs/components/SaveStatus.js +2 -1
- package/dist/cjs/components/SimpleModal.js +3 -2
- package/dist/cjs/components/StyledModal.js +3 -2
- package/dist/cjs/components/SubmissionInspector/BaseInformation.js +51 -24
- package/dist/cjs/components/SubmissionInspector/Button.js +2 -2
- package/dist/cjs/components/SubmissionInspector/Progress.js +6 -5
- package/dist/cjs/components/SubmissionInspector/Text.js +2 -2
- package/dist/cjs/components/TextField.js +3 -2
- package/dist/cjs/components/TextFieldContainer.js +2 -1
- package/dist/cjs/components/TextFieldError.js +2 -1
- package/dist/cjs/components/TextFieldGroupContainer.js +2 -1
- package/dist/cjs/components/Tip.js +7 -6
- package/dist/cjs/components/icons/back-arrow.js +2 -1
- package/dist/cjs/hooks/use-dropdown.js +6 -5
- package/dist/cjs/lib/authors.js +24 -15
- package/dist/cjs/lib/capabilities.js +13 -8
- package/dist/cjs/lib/comments.js +9 -5
- package/dist/cjs/lib/lw-errors-decoder.js +55 -0
- package/dist/cjs/lib/name.js +2 -1
- package/dist/es/components/AffiliationsEditor/AffiliationsEditorView.js +6 -36
- package/dist/es/components/AuthorForm/ContributorRolesSelect.js +1 -2
- package/dist/es/components/AuthorForm/index.js +0 -1
- package/dist/es/components/AuthorsDND/AuthorsDND.js +20 -16
- package/dist/es/components/AuthorsDND/DraggableAuthorItem.js +2 -2
- package/dist/es/components/AuthorsDND/index.js +1 -1
- package/dist/es/components/Comments/CommentActions.js +1 -5
- package/dist/es/components/Comments/CommentWrapper.js +10 -9
- package/dist/es/components/FileManager/FileManager.js +2 -8
- package/dist/es/components/FileManager/FileSectionItem/DragLayer.js +1 -1
- package/dist/es/components/FileManager/FileSectionState.js +1 -1
- package/dist/es/components/FileManager/SelectDesignationActions.js +7 -8
- package/dist/es/components/PdfPreview.js +4 -4
- package/dist/es/components/SubmissionInspector/BaseInformation.js +33 -7
- package/dist/es/components/TextFieldContainer.js +1 -1
- package/dist/es/components/TextFieldGroupContainer.js +1 -1
- package/dist/es/lib/lw-errors-decoder.js +55 -0
- package/dist/types/components/AffiliationsEditor/AffiliationsEditorView.d.ts +4 -7
- package/dist/types/components/AffiliationsEditor/styles.d.ts +2 -2
- package/dist/types/components/AlertMessage.d.ts +1 -1
- package/dist/types/components/AuthorForm/index.d.ts +0 -1
- package/dist/types/components/AuthorsDND/AuthorsDND.d.ts +2 -2
- package/dist/types/components/AuthorsDND/DraggableAuthorItem.d.ts +15 -5
- package/dist/types/components/AuthorsDND/index.d.ts +1 -1
- package/dist/types/components/Button.d.ts +9 -9
- package/dist/types/components/FileManager/util.d.ts +0 -1
- package/dist/types/components/Form.d.ts +1 -1
- package/dist/types/components/InspectorSection.d.ts +1 -1
- package/dist/types/components/PdfPreview.d.ts +1 -1
- package/dist/types/components/SimpleModal.d.ts +1 -1
- package/dist/types/components/SubmissionInspector/Button.d.ts +1 -1
- package/dist/types/components/icons/add-author.d.ts +0 -1
- package/dist/types/components/icons/add-icon-active.d.ts +0 -1
- package/dist/types/components/icons/add-icon-inverted.d.ts +0 -1
- package/dist/types/components/icons/back-arrow.d.ts +0 -1
- package/dist/types/components/icons/bookmark.d.ts +0 -1
- package/dist/types/components/icons/google.d.ts +0 -1
- package/dist/types/components/icons/orcid.d.ts +0 -1
- package/dist/types/components/icons/project-notification.d.ts +0 -1
- package/dist/types/components/icons/project.d.ts +0 -1
- package/dist/types/components/icons/projects-list.d.ts +0 -1
- package/dist/types/components/icons/search.d.ts +0 -1
- package/dist/types/components/icons/tick-mark.d.ts +0 -1
- package/dist/types/components/icons/user.d.ts +0 -1
- package/dist/types/lib/comments.d.ts +2 -2
- package/package.json +5 -5
- package/dist/cjs/components/AuthorForm/AffiliationsSelect.js +0 -55
- package/dist/es/components/AuthorForm/AffiliationsSelect.js +0 -49
- package/dist/types/components/AuthorForm/AffiliationsSelect.d.ts +0 -29
|
@@ -37,10 +37,10 @@ const draggingItemStyle = {
|
|
|
37
37
|
opacity: 0,
|
|
38
38
|
height: 0,
|
|
39
39
|
};
|
|
40
|
-
|
|
41
|
-
const [draggingItemWidth, setDraggingItemWidth] = react_1.useState('100%');
|
|
42
|
-
const itemPlaceholderRef = react_1.useRef();
|
|
43
|
-
const [{ isDragging }, dragRef, preview] = react_dnd_1.useDrag({
|
|
40
|
+
const DraggableFileSectionItem = (props) => {
|
|
41
|
+
const [draggingItemWidth, setDraggingItemWidth] = (0, react_1.useState)('100%');
|
|
42
|
+
const itemPlaceholderRef = (0, react_1.useRef)();
|
|
43
|
+
const [{ isDragging }, dragRef, preview] = (0, react_dnd_1.useDrag)({
|
|
44
44
|
item: {
|
|
45
45
|
id: props.title,
|
|
46
46
|
title: props.title,
|
|
@@ -53,17 +53,18 @@ exports.DraggableFileSectionItem = (props) => {
|
|
|
53
53
|
isDragging: monitor.isDragging(),
|
|
54
54
|
}),
|
|
55
55
|
});
|
|
56
|
-
react_1.useEffect(() => {
|
|
56
|
+
(0, react_1.useEffect)(() => {
|
|
57
57
|
if (itemPlaceholderRef && itemPlaceholderRef.current) {
|
|
58
58
|
setDraggingItemWidth(itemPlaceholderRef.current.offsetWidth + 'px');
|
|
59
59
|
}
|
|
60
60
|
}, []);
|
|
61
|
-
react_1.useEffect(() => {
|
|
62
|
-
preview(react_dnd_html5_backend_1.getEmptyImage());
|
|
61
|
+
(0, react_1.useEffect)(() => {
|
|
62
|
+
preview((0, react_dnd_html5_backend_1.getEmptyImage)());
|
|
63
63
|
}, [preview]);
|
|
64
64
|
return (react_1.default.createElement(ItemDraggingPlaceholderContainer, { style: isDragging ? itemPlaceHolderDraggingStyle : {}, ref: itemPlaceholderRef },
|
|
65
65
|
react_1.default.createElement(FileSectionItem_1.FileSectionItem, Object.assign({ style: isDragging ? draggingItemStyle : {}, dragRef: dragRef }, props))));
|
|
66
66
|
};
|
|
67
|
+
exports.DraggableFileSectionItem = DraggableFileSectionItem;
|
|
67
68
|
const ItemDraggingPlaceholderContainer = styled_components_1.default.div `
|
|
68
69
|
background: ${(props) => props.theme.colors.background.primary};
|
|
69
70
|
width: 100%;
|
|
@@ -27,9 +27,9 @@ const react_1 = __importStar(require("react"));
|
|
|
27
27
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
28
28
|
const FileManager_1 = require("../FileManager");
|
|
29
29
|
const DesignationActions_1 = require("./DesignationActions");
|
|
30
|
-
|
|
30
|
+
const FileInfo = ({ showAttachmentName, showDesignationActions, title, submissionAttachmentName, fileExtension, designation, description, handleChangeDesignation, submissionId, dispatch, }) => {
|
|
31
31
|
const fileName = submissionAttachmentName.substring(0, submissionAttachmentName.lastIndexOf('.'));
|
|
32
|
-
const can = react_1.useContext(FileManager_1.PermissionsContext);
|
|
32
|
+
const can = (0, react_1.useContext)(FileManager_1.PermissionsContext);
|
|
33
33
|
return (react_1.default.createElement(exports.FileInfoContainer, null,
|
|
34
34
|
(can === null || can === void 0 ? void 0 : can.changeDesignation) &&
|
|
35
35
|
showDesignationActions &&
|
|
@@ -46,6 +46,7 @@ exports.FileInfo = ({ showAttachmentName, showDesignationActions, title, submiss
|
|
|
46
46
|
fileExtension)))),
|
|
47
47
|
description && react_1.default.createElement(FileDescription, null, description)));
|
|
48
48
|
};
|
|
49
|
+
exports.FileInfo = FileInfo;
|
|
49
50
|
exports.FileInfoContainer = styled_components_1.default.div `
|
|
50
51
|
margin-left: 8px;
|
|
51
52
|
overflow: hidden;
|
|
@@ -14,8 +14,8 @@ const util_1 = require("../util");
|
|
|
14
14
|
const FileInfo_1 = require("./FileInfo");
|
|
15
15
|
const FileTypeIcon_1 = require("./FileTypeIcon");
|
|
16
16
|
const ItemActions_1 = require("./ItemActions");
|
|
17
|
-
|
|
18
|
-
const { isOpen, toggleOpen, wrapperRef } = use_dropdown_1.useDropdown();
|
|
17
|
+
const FileSectionItem = ({ submissionId, externalFile, title, showAttachmentName = false, showDesignationActions = false, handleDownload, handleReplace, handleChangeDesignation, dispatch, dragRef, className, style, onClose, isEditor, }) => {
|
|
18
|
+
const { isOpen, toggleOpen, wrapperRef } = (0, use_dropdown_1.useDropdown)();
|
|
19
19
|
const fileExtension = externalFile.filename.substring(externalFile.filename.lastIndexOf('.') + 1);
|
|
20
20
|
const designation = util_1.namesWithDesignationMap.get(externalFile.designation);
|
|
21
21
|
const isMainManuscript = designation === util_1.Designation.MainManuscript;
|
|
@@ -40,6 +40,7 @@ exports.FileSectionItem = ({ submissionId, externalFile, title, showAttachmentNa
|
|
|
40
40
|
react_1.default.createElement(dots_icon_1.default, null)),
|
|
41
41
|
isOpen && (react_1.default.createElement(ItemActions_1.ItemActions, { replaceAttachmentHandler: handleReplace, downloadAttachmentHandler: handleDownload, submissionId: submissionId, fileName: externalFile.filename, designation: externalFile.designation, publicUrl: externalFile.publicUrl, hideActionList: toggleOpen, dispatch: dispatch }))))));
|
|
42
42
|
};
|
|
43
|
+
exports.FileSectionItem = FileSectionItem;
|
|
43
44
|
const IconCloseButton = styled_components_1.default.button `
|
|
44
45
|
border: none;
|
|
45
46
|
background: transparent;
|
|
@@ -10,7 +10,7 @@ const FileInfo_1 = require("./FileInfo");
|
|
|
10
10
|
const FileSectionItem_1 = require("./FileSectionItem");
|
|
11
11
|
const FileTypeIcon_1 = require("./FileTypeIcon");
|
|
12
12
|
const ProgressBarUploadItem_1 = require("./ProgressBarUploadItem");
|
|
13
|
-
|
|
13
|
+
const FileSectionUploadItem = ({ fileName, isLoading, submissionId, dragRef, className, style, }) => {
|
|
14
14
|
const fileExtension = fileName.substring(fileName.lastIndexOf('.') + 1);
|
|
15
15
|
fileName = fileName.substring(0, fileName.lastIndexOf('.'));
|
|
16
16
|
return (react_1.default.createElement(FileSectionItem_1.Item, { ref: dragRef, className: className, style: style },
|
|
@@ -24,7 +24,8 @@ exports.FileSectionUploadItem = ({ fileName, isLoading, submissionId, dragRef, c
|
|
|
24
24
|
fileExtension)),
|
|
25
25
|
isLoading && react_1.default.createElement(ProgressBarUploadItem_1.ProgressBarUploadItem, null)))));
|
|
26
26
|
};
|
|
27
|
-
exports.
|
|
27
|
+
exports.FileSectionUploadItem = FileSectionUploadItem;
|
|
28
|
+
exports.UploadItemContainer = (0, styled_components_1.default)(FileSectionItem_1.ItemContainer) `
|
|
28
29
|
min-width: calc(100% - 16px);
|
|
29
30
|
`;
|
|
30
31
|
exports.ProgressBar = styled_components_1.default.div `
|
|
@@ -10,7 +10,7 @@ const styled_components_1 = __importDefault(require("styled-components"));
|
|
|
10
10
|
const unknown_format_file_icon_1 = __importDefault(require("../../icons/unknown-format-file-icon"));
|
|
11
11
|
const TooltipDiv_1 = require("../TooltipDiv");
|
|
12
12
|
const util_1 = require("../util");
|
|
13
|
-
|
|
13
|
+
const FileTypeIcon = ({ withDot, fileExtension, alt }) => {
|
|
14
14
|
let fileIcon = react_1.default.createElement(unknown_format_file_icon_1.default, null);
|
|
15
15
|
if (fileExtension) {
|
|
16
16
|
const fileType = util_1.extensionsWithFileTypesMap.get(fileExtension.toLowerCase());
|
|
@@ -23,6 +23,7 @@ exports.FileTypeIcon = ({ withDot, fileExtension, alt }) => {
|
|
|
23
23
|
react_1.default.createElement("div", null, "Main manuscript. Only one file per submission"))),
|
|
24
24
|
fileIcon));
|
|
25
25
|
};
|
|
26
|
+
exports.FileTypeIcon = FileTypeIcon;
|
|
26
27
|
const Container = styled_components_1.default.div `
|
|
27
28
|
width: 40px;
|
|
28
29
|
min-width: 40px;
|
|
@@ -25,11 +25,11 @@ const Dropdown_1 = require("../../Dropdown");
|
|
|
25
25
|
const FileManager_1 = require("../FileManager");
|
|
26
26
|
const FileSectionState_1 = require("../FileSectionState");
|
|
27
27
|
const ItemsAction_1 = require("../ItemsAction");
|
|
28
|
-
|
|
28
|
+
const ItemActions = ({ downloadAttachmentHandler, replaceAttachmentHandler, submissionId, fileName, designation, publicUrl, hideActionList, dispatch, }) => {
|
|
29
29
|
const attachmentDesignation = designation == undefined ? 'undefined' : designation;
|
|
30
|
-
const fileInputRef = react_1.useRef(null);
|
|
31
|
-
const [selectedFile, setSelectedFile] = react_1.useState();
|
|
32
|
-
const can = react_1.useContext(FileManager_1.PermissionsContext);
|
|
30
|
+
const fileInputRef = (0, react_1.useRef)(null);
|
|
31
|
+
const [selectedFile, setSelectedFile] = (0, react_1.useState)();
|
|
32
|
+
const can = (0, react_1.useContext)(FileManager_1.PermissionsContext);
|
|
33
33
|
const handleChange = (event) => {
|
|
34
34
|
if (event && event.target && event.target.files) {
|
|
35
35
|
const file = event.target.files[0];
|
|
@@ -54,3 +54,4 @@ exports.ItemActions = ({ downloadAttachmentHandler, replaceAttachmentHandler, su
|
|
|
54
54
|
react_1.default.createElement(ItemsAction_1.ActionsItem, { onClick: openFileDialog }, "Replace"),
|
|
55
55
|
react_1.default.createElement("input", { ref: fileInputRef, type: "file", style: { display: 'none' }, onChange: (e) => handleChange(e), value: '' })))));
|
|
56
56
|
};
|
|
57
|
+
exports.ItemActions = ItemActions;
|
|
@@ -6,11 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.Bar = exports.LinearProgress = exports.ProgressBarUploadItem = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
-
|
|
9
|
+
const ProgressBarUploadItem = () => {
|
|
10
10
|
return (react_1.default.createElement(exports.LinearProgress, null,
|
|
11
11
|
react_1.default.createElement(exports.Bar, { className: "bar1" }),
|
|
12
12
|
react_1.default.createElement(exports.Bar, { className: "bar2" })));
|
|
13
13
|
};
|
|
14
|
+
exports.ProgressBarUploadItem = ProgressBarUploadItem;
|
|
14
15
|
exports.LinearProgress = styled_components_1.default.div `
|
|
15
16
|
background: ${(props) => props.theme.colors.background.tertiary};
|
|
16
17
|
opacity: 0.7;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.actions = exports.reducer = exports.getInitialState = void 0;
|
|
4
|
-
|
|
4
|
+
const getInitialState = () => ({
|
|
5
5
|
uploadedFile: undefined,
|
|
6
6
|
isUploadFile: false,
|
|
7
7
|
isFileUploaded: false,
|
|
@@ -11,6 +11,7 @@ exports.getInitialState = () => ({
|
|
|
11
11
|
selectDesignation: undefined,
|
|
12
12
|
isOpenSelectDesignationPopup: false,
|
|
13
13
|
});
|
|
14
|
+
exports.getInitialState = getInitialState;
|
|
14
15
|
var ActionTypes;
|
|
15
16
|
(function (ActionTypes) {
|
|
16
17
|
ActionTypes["UPLOAD_FILE"] = "UploadFile";
|
|
@@ -23,7 +24,7 @@ var ActionTypes;
|
|
|
23
24
|
ActionTypes["SHOW_FILE_UPLOADED_ALERT"] = "showFileUploadedAlert";
|
|
24
25
|
ActionTypes["CLOSE_FILE_UPLOADED_ALERT"] = "closeFileUploadedAlert";
|
|
25
26
|
})(ActionTypes || (ActionTypes = {}));
|
|
26
|
-
|
|
27
|
+
const reducer = (state, action) => {
|
|
27
28
|
switch (action.type) {
|
|
28
29
|
case ActionTypes.UPLOAD_FILE: {
|
|
29
30
|
return Object.assign(Object.assign({}, state), { isOpenSelectDesignationPopup: true, uploadedFile: action.uploadFile, selectDesignation: undefined });
|
|
@@ -59,6 +60,7 @@ exports.reducer = (state, action) => {
|
|
|
59
60
|
}
|
|
60
61
|
return state;
|
|
61
62
|
};
|
|
63
|
+
exports.reducer = reducer;
|
|
62
64
|
exports.actions = {
|
|
63
65
|
UPLOAD_FILE: (uploadFile) => ({
|
|
64
66
|
type: ActionTypes.UPLOAD_FILE,
|
|
@@ -85,7 +87,7 @@ exports.actions = {
|
|
|
85
87
|
type: ActionTypes.HANDLE_FINISH_UPLOAD,
|
|
86
88
|
}),
|
|
87
89
|
SHOW_FILE_UPLOADED_ALERT: () => ({
|
|
88
|
-
type: ActionTypes.
|
|
90
|
+
type: ActionTypes.SHOW_FILE_UPLOADED_ALERT,
|
|
89
91
|
}),
|
|
90
92
|
CLOSE_FILE_UPLOADED_ALERT: () => ({
|
|
91
93
|
type: ActionTypes.CLOSE_FILE_UPLOADED_ALERT,
|
|
@@ -29,7 +29,7 @@ const FileSectionState_1 = require("./FileSectionState");
|
|
|
29
29
|
const SelectDialogDesignation_1 = require("./SelectDialogDesignation");
|
|
30
30
|
const UploadFileArea_1 = require("./UploadFileArea");
|
|
31
31
|
const util_1 = require("./util");
|
|
32
|
-
|
|
32
|
+
const FilesSection = ({ submissionId, enableDragAndDrop, handleUpload, fileSection, filesItem, dispatch, state, }) => {
|
|
33
33
|
let uploadedFileExtension = '';
|
|
34
34
|
if (state.uploadedFile) {
|
|
35
35
|
uploadedFileExtension = state.uploadedFile.name.substring(state.uploadedFile.name.lastIndexOf('.') + 1);
|
|
@@ -40,9 +40,9 @@ exports.FilesSection = ({ submissionId, enableDragAndDrop, handleUpload, fileSec
|
|
|
40
40
|
dispatch(FileSectionState_1.actions.HANDLE_UPLOAD_ACTION());
|
|
41
41
|
state.uploadedFile &&
|
|
42
42
|
state.selectDesignation !== undefined &&
|
|
43
|
-
handleUpload(submissionId, state.uploadedFile, util_1.getDesignationName(state.selectDesignation));
|
|
43
|
+
handleUpload(submissionId, state.uploadedFile, (0, util_1.getDesignationName)(state.selectDesignation));
|
|
44
44
|
};
|
|
45
|
-
const can = react_1.useContext(FileManager_1.PermissionsContext);
|
|
45
|
+
const can = (0, react_1.useContext)(FileManager_1.PermissionsContext);
|
|
46
46
|
return (react_1.default.createElement("div", null,
|
|
47
47
|
(can === null || can === void 0 ? void 0 : can.uploadFile) && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
48
48
|
(isOtherFileTab || isSupplementFilesTab) && (react_1.default.createElement(UploadFileArea_1.UploadFileArea, { handleUploadFile: handleUpload, fileSection: fileSection, submissionId: submissionId, dispatch: dispatch })),
|
|
@@ -63,3 +63,4 @@ exports.FilesSection = ({ submissionId, enableDragAndDrop, handleUpload, fileSec
|
|
|
63
63
|
? 'Drag the items to place them in the text'
|
|
64
64
|
: 'Drag the items to place in the Supplements section or in the text' }))));
|
|
65
65
|
};
|
|
66
|
+
exports.FilesSection = FilesSection;
|
|
@@ -30,29 +30,29 @@ const BottomArrowIcon_1 = __importDefault(require("../icons/BottomArrowIcon"));
|
|
|
30
30
|
const FileManager_1 = require("./FileManager");
|
|
31
31
|
const FileSectionState_1 = require("./FileSectionState");
|
|
32
32
|
const util_1 = require("./util");
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const can = react_1.useContext(FileManager_1.PermissionsContext);
|
|
40
|
-
const handleInputChange = (
|
|
41
|
-
if (
|
|
42
|
-
const selectedDesignation = value;
|
|
33
|
+
const DropdownIndicator = () => (react_1.default.createElement(SelectDesignationContainer, null,
|
|
34
|
+
react_1.default.createElement(BottomArrowIcon_1.default, null)));
|
|
35
|
+
const reactSelectComponents = {
|
|
36
|
+
IndicatorsContainer: DropdownIndicator,
|
|
37
|
+
};
|
|
38
|
+
const SelectDesignationActions = ({ fileExtension, fileSection, dispatch }) => {
|
|
39
|
+
const can = (0, react_1.useContext)(FileManager_1.PermissionsContext);
|
|
40
|
+
const handleInputChange = (selectedDesignation) => {
|
|
41
|
+
if (selectedDesignation) {
|
|
43
42
|
if (selectedDesignation && 'value' in selectedDesignation) {
|
|
44
43
|
dispatch(FileSectionState_1.actions.SELECT_DESIGNATION(selectedDesignation.value));
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
46
|
};
|
|
48
47
|
if (fileExtension) {
|
|
49
|
-
const designationActionsList = util_1.getUploadFileDesignationList(fileExtension, fileSection, can);
|
|
48
|
+
const designationActionsList = (0, util_1.getUploadFileDesignationList)(fileExtension, fileSection, can);
|
|
50
49
|
return (react_1.default.createElement(creatable_1.default, { closeMenuOnSelect: true, options: designationActionsList, onChange: handleInputChange, placeholder: "Select Designation", components: reactSelectComponents }));
|
|
51
50
|
}
|
|
52
51
|
else {
|
|
53
52
|
return null;
|
|
54
53
|
}
|
|
55
54
|
};
|
|
55
|
+
exports.SelectDesignationActions = SelectDesignationActions;
|
|
56
56
|
const SelectDesignationContainer = styled_components_1.default.div `
|
|
57
57
|
padding-right: 12px;
|
|
58
58
|
display: flex;
|
|
@@ -8,7 +8,7 @@ const react_1 = __importDefault(require("react"));
|
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const Dialog_1 = require("../Dialog");
|
|
10
10
|
const SelectDesignationActions_1 = require("./SelectDesignationActions");
|
|
11
|
-
|
|
11
|
+
const SelectDialogDesignation = ({ isOpen, fileExtension, fileSection, handleCancel, uploadFileHandler, dispatch, }) => {
|
|
12
12
|
return (react_1.default.createElement(DesignationDialog, { isOpen: isOpen, category: Dialog_1.Category.confirmation, header: "Choose designation", message: "Please choose the designation for the file", actions: {
|
|
13
13
|
primary: {
|
|
14
14
|
action: uploadFileHandler,
|
|
@@ -21,7 +21,8 @@ exports.SelectDialogDesignation = ({ isOpen, fileExtension, fileSection, handleC
|
|
|
21
21
|
} },
|
|
22
22
|
react_1.default.createElement(SelectDesignationActions_1.SelectDesignationActions, { fileExtension: fileExtension, fileSection: fileSection, dispatch: dispatch })));
|
|
23
23
|
};
|
|
24
|
-
|
|
24
|
+
exports.SelectDialogDesignation = SelectDialogDesignation;
|
|
25
|
+
const DesignationDialog = (0, styled_components_1.default)(Dialog_1.Dialog) `
|
|
25
26
|
& ${Dialog_1.ModalBody} {
|
|
26
27
|
overflow: visible;
|
|
27
28
|
}
|
|
@@ -26,9 +26,9 @@ const react_dnd_html5_backend_1 = require("react-dnd-html5-backend");
|
|
|
26
26
|
const styled_components_1 = __importStar(require("styled-components"));
|
|
27
27
|
const FileSectionState_1 = require("./FileSectionState");
|
|
28
28
|
const util_1 = require("./util");
|
|
29
|
-
|
|
30
|
-
const [selectedFile, setSelectedFile] = react_1.useState();
|
|
31
|
-
const fileInputRef = react_1.useRef(null);
|
|
29
|
+
const UploadFileArea = ({ handleUploadFile, fileSection, submissionId, dispatch }) => {
|
|
30
|
+
const [selectedFile, setSelectedFile] = (0, react_1.useState)();
|
|
31
|
+
const fileInputRef = (0, react_1.useRef)(null);
|
|
32
32
|
const isSupplementFilesTab = fileSection === util_1.FileSectionType.Supplements;
|
|
33
33
|
const openFileDialog = () => {
|
|
34
34
|
if (fileInputRef && fileInputRef.current) {
|
|
@@ -41,17 +41,17 @@ exports.UploadFileArea = ({ handleUploadFile, fileSection, submissionId, dispatc
|
|
|
41
41
|
setSelectedFile(file);
|
|
42
42
|
dispatch(FileSectionState_1.actions.UPLOAD_FILE(file));
|
|
43
43
|
if (file && isSupplementFilesTab) {
|
|
44
|
-
handleUploadFile(submissionId, file, util_1.getDesignationName(util_1.Designation.Supplementary));
|
|
44
|
+
handleUploadFile(submissionId, file, (0, util_1.getDesignationName)(util_1.Designation.Supplementary));
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
-
const handleFileDrop = react_1.useCallback((monitor) => {
|
|
48
|
+
const handleFileDrop = (0, react_1.useCallback)((monitor) => {
|
|
49
49
|
if (monitor) {
|
|
50
50
|
const file = monitor.getItem().files[0];
|
|
51
51
|
setSelectedFile(file);
|
|
52
52
|
dispatch(FileSectionState_1.actions.UPLOAD_FILE(file));
|
|
53
53
|
if (selectedFile && isSupplementFilesTab) {
|
|
54
|
-
handleUploadFile(submissionId, selectedFile, util_1.getDesignationName(util_1.Designation.Supplementary));
|
|
54
|
+
handleUploadFile(submissionId, selectedFile, (0, util_1.getDesignationName)(util_1.Designation.Supplementary));
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
}, [
|
|
@@ -61,7 +61,7 @@ exports.UploadFileArea = ({ handleUploadFile, fileSection, submissionId, dispatc
|
|
|
61
61
|
selectedFile,
|
|
62
62
|
submissionId,
|
|
63
63
|
]);
|
|
64
|
-
const [{ canDrop, isOver }, dropRef] = react_dnd_1.useDrop({
|
|
64
|
+
const [{ canDrop, isOver }, dropRef] = (0, react_dnd_1.useDrop)({
|
|
65
65
|
accept: [react_dnd_html5_backend_1.NativeTypes.FILE],
|
|
66
66
|
drop(item, monitor) {
|
|
67
67
|
handleFileDrop(monitor);
|
|
@@ -76,7 +76,8 @@ exports.UploadFileArea = ({ handleUploadFile, fileSection, submissionId, dispatc
|
|
|
76
76
|
react_1.default.createElement("input", { ref: fileInputRef, type: "file", style: { display: 'none' }, onChange: (e) => handleChange(e), value: '' }),
|
|
77
77
|
"Drag or click to upload a new file"));
|
|
78
78
|
};
|
|
79
|
-
|
|
79
|
+
exports.UploadFileArea = UploadFileArea;
|
|
80
|
+
const activeBoxStyle = (0, styled_components_1.css) `
|
|
80
81
|
background: #f2fbfc;
|
|
81
82
|
border: 1px dashed #bce7f6;
|
|
82
83
|
`;
|
|
@@ -97,8 +98,8 @@ const Container = styled_components_1.default.div `
|
|
|
97
98
|
margin-bottom: 7px;
|
|
98
99
|
margin-top: 16px;
|
|
99
100
|
${(props) => props.active
|
|
100
|
-
? styled_components_1.css `
|
|
101
|
+
? (0, styled_components_1.css) `
|
|
101
102
|
${activeBoxStyle}
|
|
102
103
|
`
|
|
103
|
-
: styled_components_1.css ``}
|
|
104
|
+
: (0, styled_components_1.css) ``}
|
|
104
105
|
`;
|
|
@@ -343,7 +343,7 @@ exports.fileTypesWithIconMap = new Map([
|
|
|
343
343
|
[FileType.Image, react_1.default.createElement(figure_icon_1.default, { key: FileType.Image })],
|
|
344
344
|
[undefined, react_1.default.createElement(unknown_format_file_icon_1.default, { key: undefined })],
|
|
345
345
|
]);
|
|
346
|
-
|
|
346
|
+
const generateExternalFilesTitles = (externalFiles, fileSectionType) => {
|
|
347
347
|
const titleCountersMap = new Map();
|
|
348
348
|
const externalFilesWithTitlesMap = new Map();
|
|
349
349
|
externalFiles.forEach((element) => {
|
|
@@ -374,14 +374,16 @@ exports.generateExternalFilesTitles = (externalFiles, fileSectionType) => {
|
|
|
374
374
|
}));
|
|
375
375
|
return result;
|
|
376
376
|
};
|
|
377
|
-
exports.
|
|
377
|
+
exports.generateExternalFilesTitles = generateExternalFilesTitles;
|
|
378
|
+
const sortExternalFiles = (externalFile) => externalFile
|
|
378
379
|
.sort((a, b) => Number(a.createdAt) - Number(b.createdAt))
|
|
379
380
|
.sort((a, b) => b.designation === 'main-manuscript'
|
|
380
381
|
? 1
|
|
381
382
|
: a.designation === 'main-manuscript'
|
|
382
383
|
? -1
|
|
383
384
|
: 0);
|
|
384
|
-
exports.
|
|
385
|
+
exports.sortExternalFiles = sortExternalFiles;
|
|
386
|
+
const getDesignationActionsList = (designation, fileExtension) => {
|
|
385
387
|
const allowedDesignationsToTransition = exports.designationWithAllowedDesignationsToTransitionMap.get(designation);
|
|
386
388
|
if (allowedDesignationsToTransition) {
|
|
387
389
|
if (designation === Designation.Supplementary ||
|
|
@@ -405,7 +407,8 @@ exports.getDesignationActionsList = (designation, fileExtension) => {
|
|
|
405
407
|
return [];
|
|
406
408
|
}
|
|
407
409
|
};
|
|
408
|
-
exports.
|
|
410
|
+
exports.getDesignationActionsList = getDesignationActionsList;
|
|
411
|
+
const getDesignationName = (designation) => {
|
|
409
412
|
let result = undefined;
|
|
410
413
|
exports.namesWithDesignationMap.forEach((value, key, map) => {
|
|
411
414
|
if (value === designation) {
|
|
@@ -417,7 +420,8 @@ exports.getDesignationName = (designation) => {
|
|
|
417
420
|
}
|
|
418
421
|
return result;
|
|
419
422
|
};
|
|
420
|
-
exports.
|
|
423
|
+
exports.getDesignationName = getDesignationName;
|
|
424
|
+
const getDesignationByFileSection = (fileSectionType) => {
|
|
421
425
|
const result = new Array();
|
|
422
426
|
exports.designationWithFileSectionsMap.forEach((value, key, map) => {
|
|
423
427
|
if (value === fileSectionType) {
|
|
@@ -426,7 +430,8 @@ exports.getDesignationByFileSection = (fileSectionType) => {
|
|
|
426
430
|
});
|
|
427
431
|
return result;
|
|
428
432
|
};
|
|
429
|
-
exports.
|
|
433
|
+
exports.getDesignationByFileSection = getDesignationByFileSection;
|
|
434
|
+
const getUploadFileDesignationList = (fileExtension, fileSectionType, can) => {
|
|
430
435
|
const result = new Array();
|
|
431
436
|
const checkDesignation = (value) => {
|
|
432
437
|
if (value === Designation.MainManuscript && !(can === null || can === void 0 ? void 0 : can.setMainManuscript)) {
|
|
@@ -448,7 +453,7 @@ exports.getUploadFileDesignationList = (fileExtension, fileSectionType, can) =>
|
|
|
448
453
|
}
|
|
449
454
|
};
|
|
450
455
|
if (typeof fileSectionType === 'number') {
|
|
451
|
-
const allowedDesignationByFileSection = exports.getDesignationByFileSection(fileSectionType);
|
|
456
|
+
const allowedDesignationByFileSection = (0, exports.getDesignationByFileSection)(fileSectionType);
|
|
452
457
|
allowedDesignationByFileSection.forEach(checkDesignation);
|
|
453
458
|
}
|
|
454
459
|
else if (Array.isArray(fileSectionType)) {
|
|
@@ -460,6 +465,7 @@ exports.getUploadFileDesignationList = (fileExtension, fileSectionType, can) =>
|
|
|
460
465
|
}
|
|
461
466
|
return result;
|
|
462
467
|
};
|
|
468
|
+
exports.getUploadFileDesignationList = getUploadFileDesignationList;
|
|
463
469
|
exports.droppableSections = [
|
|
464
470
|
FileSectionType.Supplements,
|
|
465
471
|
FileSectionType.OtherFile,
|
|
@@ -468,6 +474,7 @@ const isOfDesignation = (file, designation) => {
|
|
|
468
474
|
const formats = exports.designationWithAllowedMediaTypesMap.get(designation);
|
|
469
475
|
return !!(formats === null || formats === void 0 ? void 0 : formats.find((type) => file.MIME.indexOf('/' + type) >= 0));
|
|
470
476
|
};
|
|
471
|
-
|
|
477
|
+
const isFigure = (file) => {
|
|
472
478
|
return isOfDesignation(file, Designation.Figure);
|
|
473
479
|
};
|
|
480
|
+
exports.isFigure = isFigure;
|
|
@@ -21,7 +21,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
21
21
|
exports.FormError = exports.FormActions = exports.FormHeader = exports.CenteredForm = void 0;
|
|
22
22
|
const formik_1 = require("formik");
|
|
23
23
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
24
|
-
exports.CenteredForm = styled_components_1.default(formik_1.Form) `
|
|
24
|
+
exports.CenteredForm = (0, styled_components_1.default)(formik_1.Form) `
|
|
25
25
|
width: 100%;
|
|
26
26
|
max-width: 450px;
|
|
27
27
|
`;
|
|
@@ -31,13 +31,13 @@ exports.InspectorContainer = styled_components_1.default.div `
|
|
|
31
31
|
height: 100%;
|
|
32
32
|
overflow: hidden;
|
|
33
33
|
`;
|
|
34
|
-
exports.InspectorTabs = styled_components_1.default(tabs_1.Tabs) `
|
|
34
|
+
exports.InspectorTabs = (0, styled_components_1.default)(tabs_1.Tabs) `
|
|
35
35
|
display: flex;
|
|
36
36
|
flex-direction: column;
|
|
37
37
|
height: 100%;
|
|
38
38
|
overflow: hidden;
|
|
39
39
|
`;
|
|
40
|
-
exports.InspectorTabList = styled_components_1.default(tabs_1.TabList) `
|
|
40
|
+
exports.InspectorTabList = (0, styled_components_1.default)(tabs_1.TabList) `
|
|
41
41
|
&& {
|
|
42
42
|
background: none;
|
|
43
43
|
justify-content: center;
|
|
@@ -46,24 +46,24 @@ exports.InspectorTabList = styled_components_1.default(tabs_1.TabList) `
|
|
|
46
46
|
flex-shrink: 0;
|
|
47
47
|
}
|
|
48
48
|
`;
|
|
49
|
-
exports.InspectorPanelTabList = styled_components_1.default(exports.InspectorTabList) `
|
|
49
|
+
exports.InspectorPanelTabList = (0, styled_components_1.default)(exports.InspectorTabList) `
|
|
50
50
|
margin-bottom: ${(props) => props.theme.grid.unit * 4}px;
|
|
51
51
|
`;
|
|
52
|
-
exports.InspectorTabPanels = styled_components_1.default(tabs_1.TabPanels) `
|
|
52
|
+
exports.InspectorTabPanels = (0, styled_components_1.default)(tabs_1.TabPanels) `
|
|
53
53
|
flex: 1;
|
|
54
54
|
overflow-y: auto;
|
|
55
55
|
`;
|
|
56
|
-
exports.PaddedInspectorTabPanels = styled_components_1.default(exports.InspectorTabPanels) `
|
|
56
|
+
exports.PaddedInspectorTabPanels = (0, styled_components_1.default)(exports.InspectorTabPanels) `
|
|
57
57
|
padding-bottom: 64px; // allow space for chat button
|
|
58
58
|
`;
|
|
59
|
-
exports.InspectorTabPanel = styled_components_1.default(tabs_1.TabPanel) `
|
|
59
|
+
exports.InspectorTabPanel = (0, styled_components_1.default)(tabs_1.TabPanel) `
|
|
60
60
|
font-size: ${(props) => props.theme.font.size.normal};
|
|
61
61
|
color: ${(props) => props.theme.colors.text.secondary};
|
|
62
62
|
&:focus {
|
|
63
63
|
outline: none;
|
|
64
64
|
}
|
|
65
65
|
`;
|
|
66
|
-
exports.InspectorTab = styled_components_1.default(tabs_1.Tab) `
|
|
66
|
+
exports.InspectorTab = (0, styled_components_1.default)(tabs_1.Tab) `
|
|
67
67
|
&& {
|
|
68
68
|
background: none;
|
|
69
69
|
padding: ${(props) => props.theme.grid.unit * 2}px;
|
|
@@ -60,7 +60,7 @@ const HeadingText = styled_components_1.default.div `
|
|
|
60
60
|
color: ${(props) => props.theme.colors.text.primary};
|
|
61
61
|
flex: 1;
|
|
62
62
|
`;
|
|
63
|
-
exports.ExpanderButton = styled_components_1.default(Button_1.IconButton).attrs((props) => ({
|
|
63
|
+
exports.ExpanderButton = (0, styled_components_1.default)(Button_1.IconButton).attrs((props) => ({
|
|
64
64
|
size: 20,
|
|
65
65
|
defaultColor: true,
|
|
66
66
|
})) `
|
|
@@ -78,7 +78,7 @@ exports.ExpanderButton = styled_components_1.default(Button_1.IconButton).attrs(
|
|
|
78
78
|
stroke: ${(props) => props.theme.colors.border.secondary};
|
|
79
79
|
}
|
|
80
80
|
`;
|
|
81
|
-
exports.Subheading = styled_components_1.default(HeadingText) `
|
|
81
|
+
exports.Subheading = (0, styled_components_1.default)(HeadingText) `
|
|
82
82
|
font-size: ${(props) => props.theme.font.size.normal};
|
|
83
83
|
font-weight: ${(props) => props.theme.font.weight.normal};
|
|
84
84
|
margin-bottom: ${(props) => props.theme.grid.unit * 3}px;
|
|
@@ -90,8 +90,8 @@ exports.Subheading = styled_components_1.default(HeadingText) `
|
|
|
90
90
|
exports.Field = styled_components_1.default.div `
|
|
91
91
|
margin-bottom: ${(props) => props.theme.grid.unit * 4}px;
|
|
92
92
|
`;
|
|
93
|
-
|
|
94
|
-
const [expanded, setExpanded] = react_1.useState(true);
|
|
93
|
+
const InspectorSection = ({ title, contentStyles, children, }) => {
|
|
94
|
+
const [expanded, setExpanded] = (0, react_1.useState)(true);
|
|
95
95
|
return (react_1.default.createElement(Section, null,
|
|
96
96
|
react_1.default.createElement(Line, null),
|
|
97
97
|
react_1.default.createElement(Heading, { onClick: () => setExpanded(!expanded), marginBottom: (!(expanded && children) && '40px') || undefined },
|
|
@@ -102,6 +102,7 @@ exports.InspectorSection = ({ title, contentStyles, children, }) => {
|
|
|
102
102
|
react_1.default.createElement(ArrowDownBlue_1.default, null))),
|
|
103
103
|
expanded && children && react_1.default.createElement("div", { style: contentStyles }, children)));
|
|
104
104
|
};
|
|
105
|
+
exports.InspectorSection = InspectorSection;
|
|
105
106
|
const Line = styled_components_1.default.hr `
|
|
106
107
|
flex: 1;
|
|
107
108
|
border: 1px solid ${(props) => props.theme.colors.border.tertiary};
|
|
@@ -45,15 +45,15 @@ const CommentTarget_1 = require("./Comments/CommentTarget");
|
|
|
45
45
|
const CommentWrapper_1 = require("./Comments/CommentWrapper");
|
|
46
46
|
const RelativeDate_1 = require("./RelativeDate");
|
|
47
47
|
exports.ManuscriptNoteList = react_1.default.memo(({ createKeyword, deleteModel, getCollaboratorById, currentUserId, displayName, getKeyword, listCollaborators, listKeywords, notes, noteSource, saveModel, selected, can, }) => {
|
|
48
|
-
const [newComment, setNewComment] = react_1.useState();
|
|
49
|
-
const [selectResolved, setSelectResolved] = react_1.useState(false);
|
|
50
|
-
const [noteTarget, setNoteTarget] = react_1.useState();
|
|
51
|
-
react_1.useEffect(() => {
|
|
48
|
+
const [newComment, setNewComment] = (0, react_1.useState)();
|
|
49
|
+
const [selectResolved, setSelectResolved] = (0, react_1.useState)(false);
|
|
50
|
+
const [noteTarget, setNoteTarget] = (0, react_1.useState)();
|
|
51
|
+
(0, react_1.useEffect)(() => {
|
|
52
52
|
if (noteTarget && !newComment) {
|
|
53
|
-
const newComment = manuscript_transform_1.buildNote(noteTarget, noteSource);
|
|
53
|
+
const newComment = (0, manuscript_transform_1.buildNote)(noteTarget, noteSource);
|
|
54
54
|
newComment.displayName = displayName;
|
|
55
55
|
if (currentUserId) {
|
|
56
|
-
const contribution = manuscript_transform_1.buildContribution(currentUserId);
|
|
56
|
+
const contribution = (0, manuscript_transform_1.buildContribution)(currentUserId);
|
|
57
57
|
newComment.contributions = [contribution];
|
|
58
58
|
}
|
|
59
59
|
else {
|
|
@@ -62,20 +62,20 @@ exports.ManuscriptNoteList = react_1.default.memo(({ createKeyword, deleteModel,
|
|
|
62
62
|
setNewComment(newComment);
|
|
63
63
|
}
|
|
64
64
|
}, [noteTarget, currentUserId, displayName, newComment, noteSource]);
|
|
65
|
-
const items = react_1.useMemo(() => {
|
|
65
|
+
const items = (0, react_1.useMemo)(() => {
|
|
66
66
|
const combinedComments = [...notes];
|
|
67
67
|
if (newComment) {
|
|
68
68
|
combinedComments.push(newComment);
|
|
69
69
|
}
|
|
70
|
-
const commentsTreeMap = comments_1.buildNoteTree(combinedComments);
|
|
70
|
+
const commentsTreeMap = (0, comments_1.buildNoteTree)(combinedComments);
|
|
71
71
|
return Array.from(commentsTreeMap.entries());
|
|
72
72
|
}, [notes, newComment]);
|
|
73
|
-
const handleAddNewNote = react_1.useCallback((event) => {
|
|
73
|
+
const handleAddNewNote = (0, react_1.useCallback)((event) => {
|
|
74
74
|
event.preventDefault();
|
|
75
|
-
setNoteTarget(manuscripts_json_schema_1.ObjectTypes.ManuscriptNote + ':' + uuid_1.v4().toUpperCase());
|
|
75
|
+
setNoteTarget(manuscripts_json_schema_1.ObjectTypes.ManuscriptNote + ':' + (0, uuid_1.v4)().toUpperCase());
|
|
76
76
|
setSelectResolved(false);
|
|
77
77
|
}, [setNoteTarget]);
|
|
78
|
-
const deleteNote = react_1.useCallback((id) => {
|
|
78
|
+
const deleteNote = (0, react_1.useCallback)((id) => {
|
|
79
79
|
return deleteModel(id).finally(() => {
|
|
80
80
|
if (newComment && newComment._id === id) {
|
|
81
81
|
setNoteTarget(undefined);
|
|
@@ -83,7 +83,7 @@ exports.ManuscriptNoteList = react_1.default.memo(({ createKeyword, deleteModel,
|
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
}, [deleteModel, newComment, setNoteTarget]);
|
|
86
|
-
const saveNote = react_1.useCallback((note) => {
|
|
86
|
+
const saveNote = (0, react_1.useCallback)((note) => {
|
|
87
87
|
return saveModel(note).then((note) => {
|
|
88
88
|
if (newComment && newComment._id === note._id) {
|
|
89
89
|
setNoteTarget(undefined);
|
|
@@ -92,10 +92,10 @@ exports.ManuscriptNoteList = react_1.default.memo(({ createKeyword, deleteModel,
|
|
|
92
92
|
return note;
|
|
93
93
|
});
|
|
94
94
|
}, [newComment, setNoteTarget, saveModel]);
|
|
95
|
-
const isNew = react_1.useCallback((note) => {
|
|
95
|
+
const isNew = (0, react_1.useCallback)((note) => {
|
|
96
96
|
return newComment ? newComment._id === note._id : false;
|
|
97
97
|
}, [newComment]);
|
|
98
|
-
const handleOnSelectChange = react_1.useCallback((e) => setSelectResolved(e.target.checked), []);
|
|
98
|
+
const handleOnSelectChange = (0, react_1.useCallback)((e) => setSelectResolved(e.target.checked), []);
|
|
99
99
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
100
100
|
react_1.default.createElement(ActionHeader, { withAddButton: can.createNotes },
|
|
101
101
|
can.createNotes && (react_1.default.createElement(AddNoteButton, { onClick: handleAddNewNote },
|
|
@@ -121,7 +121,7 @@ exports.ManuscriptNoteList = react_1.default.memo(({ createKeyword, deleteModel,
|
|
|
121
121
|
react_1.default.createElement(CommentWrapper_1.CommentWrapper, { createKeyword: createKeyword, comment: note, deleteComment: deleteNote, getCollaborator: getCollaboratorById, getKeyword: getKeyword, isReply: true, listCollaborators: listCollaborators, listKeywords: listKeywords, saveComment: saveNote, handleCreateReply: setNoteTarget, isNew: isNew(note), isProdNote: true, can: can })))))))));
|
|
122
122
|
})))));
|
|
123
123
|
});
|
|
124
|
-
const AddNoteButton = styled_components_1.default(Button_1.IconTextButton) `
|
|
124
|
+
const AddNoteButton = (0, styled_components_1.default)(Button_1.IconTextButton) `
|
|
125
125
|
svg {
|
|
126
126
|
margin: 0 0 0 ${(props) => props.theme.grid.unit * 4}px;
|
|
127
127
|
path {
|
|
@@ -164,7 +164,7 @@ exports.ReplyBodyContainer = styled_components_1.default.div `
|
|
|
164
164
|
border: 1px solid ${(props) => props.theme.colors.border.secondary};
|
|
165
165
|
border-top: none;
|
|
166
166
|
`;
|
|
167
|
-
exports.LightRelativeDate = styled_components_1.default(RelativeDate_1.RelativeDate) `
|
|
167
|
+
exports.LightRelativeDate = (0, styled_components_1.default)(RelativeDate_1.RelativeDate) `
|
|
168
168
|
font-size: ${(props) => props.theme.font.size.small};
|
|
169
169
|
color: ${(props) => props.theme.colors.text.secondary};
|
|
170
170
|
letter-spacing: -0.2px;
|
|
@@ -182,7 +182,7 @@ exports.LabelText = styled_components_1.default.div `
|
|
|
182
182
|
line-height: 24px;
|
|
183
183
|
margin: 0 !important;
|
|
184
184
|
`;
|
|
185
|
-
const Checkbox = styled_components_1.default(Checkbox_1.CheckboxLabel) `
|
|
185
|
+
const Checkbox = (0, styled_components_1.default)(Checkbox_1.CheckboxLabel) `
|
|
186
186
|
div {
|
|
187
187
|
color: ${(props) => props.theme.colors.text.primary};
|
|
188
188
|
}
|