@manuscripts/style-guide 0.30.15 → 0.30.19
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 +21 -10
- 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 +13 -7
- package/dist/cjs/components/FileManager/FileSectionItem/FileSectionUploadItem.js +4 -3
- package/dist/cjs/components/FileManager/FileSectionItem/FileTypeIcon.js +2 -1
- package/dist/cjs/components/FileManager/FileSectionItem/ItemActions.js +9 -4
- package/dist/cjs/components/FileManager/FileSectionItem/ProgressBarUploadItem.js +2 -1
- package/dist/cjs/components/FileManager/FileSectionState.js +12 -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 +19 -18
- 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 +51 -1
- 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 +13 -3
- package/dist/es/components/FileManager/FileSectionItem/DragLayer.js +1 -1
- package/dist/es/components/FileManager/FileSectionItem/FileSectionItem.js +10 -5
- package/dist/es/components/FileManager/FileSectionItem/FileSectionUploadItem.js +1 -1
- package/dist/es/components/FileManager/FileSectionItem/ItemActions.js +6 -2
- package/dist/es/components/FileManager/FileSectionState.js +8 -1
- package/dist/es/components/FileManager/SelectDesignationActions.js +7 -8
- package/dist/es/components/PdfPreview.js +4 -4
- package/dist/es/components/TextFieldContainer.js +1 -1
- package/dist/es/components/TextFieldGroupContainer.js +1 -1
- package/dist/es/lib/lw-errors-decoder.js +51 -1
- 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/FileSectionItem/FileSectionItem.d.ts +1 -2
- package/dist/types/components/FileManager/FileSectionItem/FileSectionUploadItem.d.ts +1 -1
- package/dist/types/components/FileManager/FileSectionItem/ItemActions.d.ts +3 -1
- package/dist/types/components/FileManager/FileSectionState.d.ts +2 -0
- 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;
|
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ItemContainer = exports.Item = exports.ActionsIcon = exports.FileSectionItem = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const react_router_dom_1 = require("react-router-dom");
|
|
9
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
10
9
|
const use_dropdown_1 = require("../../../hooks/use-dropdown");
|
|
11
10
|
const Dropdown_1 = require("../../Dropdown");
|
|
@@ -15,13 +14,20 @@ const util_1 = require("../util");
|
|
|
15
14
|
const FileInfo_1 = require("./FileInfo");
|
|
16
15
|
const FileTypeIcon_1 = require("./FileTypeIcon");
|
|
17
16
|
const ItemActions_1 = require("./ItemActions");
|
|
18
|
-
|
|
19
|
-
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)();
|
|
20
19
|
const fileExtension = externalFile.filename.substring(externalFile.filename.lastIndexOf('.') + 1);
|
|
21
20
|
const designation = util_1.namesWithDesignationMap.get(externalFile.designation);
|
|
22
21
|
const isMainManuscript = designation === util_1.Designation.MainManuscript;
|
|
22
|
+
const isSelected = externalFile._id == window.location.hash.substr(1);
|
|
23
23
|
return (react_1.default.createElement(exports.Item, { ref: dragRef, className: className, style: style },
|
|
24
|
-
react_1.default.createElement(exports.ItemContainer, {
|
|
24
|
+
react_1.default.createElement(exports.ItemContainer, { onClick: () => {
|
|
25
|
+
window.location.hash =
|
|
26
|
+
isEditor && !isSelected ? `#${externalFile._id}` : '#';
|
|
27
|
+
if (isSelected) {
|
|
28
|
+
window.location.hash = `#${externalFile._id}`;
|
|
29
|
+
}
|
|
30
|
+
} },
|
|
25
31
|
react_1.default.createElement(FileTypeIcon_1.FileTypeIcon, { withDot: isMainManuscript, fileExtension: fileExtension, alt: externalFile.filename }),
|
|
26
32
|
react_1.default.createElement(FileInfo_1.FileInfo, { fileExtension: fileExtension, showAttachmentName: showAttachmentName, showDesignationActions: showDesignationActions, submissionAttachmentName: externalFile.filename, title: title, designation: designation, description: externalFile.description, handleChangeDesignation: handleChangeDesignation, submissionId: submissionId, dispatch: dispatch })),
|
|
27
33
|
onClose && (react_1.default.createElement(IconCloseButton, { onClick: (e) => {
|
|
@@ -32,8 +38,9 @@ exports.FileSectionItem = ({ submissionId, externalFile, title, showAttachmentNa
|
|
|
32
38
|
handleDownload && handleReplace && submissionId && (react_1.default.createElement(Dropdown_1.DropdownContainer, { ref: wrapperRef },
|
|
33
39
|
react_1.default.createElement(exports.ActionsIcon, { onClick: toggleOpen, type: "button", "aria-label": "Download or Replace", "aria-pressed": isOpen },
|
|
34
40
|
react_1.default.createElement(dots_icon_1.default, null)),
|
|
35
|
-
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 }))))));
|
|
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 }))))));
|
|
36
42
|
};
|
|
43
|
+
exports.FileSectionItem = FileSectionItem;
|
|
37
44
|
const IconCloseButton = styled_components_1.default.button `
|
|
38
45
|
border: none;
|
|
39
46
|
background: transparent;
|
|
@@ -82,10 +89,9 @@ exports.Item = styled_components_1.default.div `
|
|
|
82
89
|
margin-right: 8px;
|
|
83
90
|
}
|
|
84
91
|
`;
|
|
85
|
-
exports.ItemContainer = styled_components_1.default
|
|
92
|
+
exports.ItemContainer = styled_components_1.default.div `
|
|
86
93
|
display: flex;
|
|
87
94
|
min-width: calc(100% - 8px);
|
|
88
95
|
padding-right: 4px;
|
|
89
96
|
box-sizing: border-box;
|
|
90
|
-
text-decoration: none;
|
|
91
97
|
`;
|
|
@@ -10,11 +10,11 @@ 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 },
|
|
17
|
-
react_1.default.createElement(exports.UploadItemContainer,
|
|
17
|
+
react_1.default.createElement(exports.UploadItemContainer, null,
|
|
18
18
|
react_1.default.createElement(FileTypeIcon_1.FileTypeIcon, { withDot: false }),
|
|
19
19
|
react_1.default.createElement(FileInfo_1.FileInfoContainer, null,
|
|
20
20
|
react_1.default.createElement(FileInfo_1.FileNameContainer, null,
|
|
@@ -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;
|
|
@@ -23,16 +23,20 @@ exports.ItemActions = void 0;
|
|
|
23
23
|
const react_1 = __importStar(require("react"));
|
|
24
24
|
const Dropdown_1 = require("../../Dropdown");
|
|
25
25
|
const FileManager_1 = require("../FileManager");
|
|
26
|
+
const FileSectionState_1 = require("../FileSectionState");
|
|
26
27
|
const ItemsAction_1 = require("../ItemsAction");
|
|
27
|
-
|
|
28
|
+
const ItemActions = ({ downloadAttachmentHandler, replaceAttachmentHandler, submissionId, fileName, designation, publicUrl, hideActionList, dispatch, }) => {
|
|
28
29
|
const attachmentDesignation = designation == undefined ? 'undefined' : designation;
|
|
29
|
-
const fileInputRef = react_1.useRef(null);
|
|
30
|
-
const [selectedFile, setSelectedFile] = react_1.useState();
|
|
31
|
-
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);
|
|
32
33
|
const handleChange = (event) => {
|
|
33
34
|
if (event && event.target && event.target.files) {
|
|
34
35
|
const file = event.target.files[0];
|
|
35
36
|
setSelectedFile(file);
|
|
37
|
+
if (dispatch) {
|
|
38
|
+
dispatch(FileSectionState_1.actions.UPLOAD_FILE(file));
|
|
39
|
+
}
|
|
36
40
|
replaceAttachmentHandler(submissionId, fileName, file, attachmentDesignation);
|
|
37
41
|
hideActionList();
|
|
38
42
|
}
|
|
@@ -50,3 +54,4 @@ exports.ItemActions = ({ downloadAttachmentHandler, replaceAttachmentHandler, su
|
|
|
50
54
|
react_1.default.createElement(ItemsAction_1.ActionsItem, { onClick: openFileDialog }, "Replace"),
|
|
51
55
|
react_1.default.createElement("input", { ref: fileInputRef, type: "file", style: { display: 'none' }, onChange: (e) => handleChange(e), value: '' })))));
|
|
52
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";
|
|
@@ -20,9 +21,10 @@ var ActionTypes;
|
|
|
20
21
|
ActionTypes["HANDLE_UPLOAD_ACTION"] = "handleUpload";
|
|
21
22
|
ActionTypes["HANDLE_FINISH_UPLOAD"] = "handleFinishUpload";
|
|
22
23
|
ActionTypes["HANDLE_SUCCESS_MESSAGE"] = "handleSuccessMessage";
|
|
24
|
+
ActionTypes["SHOW_FILE_UPLOADED_ALERT"] = "showFileUploadedAlert";
|
|
23
25
|
ActionTypes["CLOSE_FILE_UPLOADED_ALERT"] = "closeFileUploadedAlert";
|
|
24
26
|
})(ActionTypes || (ActionTypes = {}));
|
|
25
|
-
|
|
27
|
+
const reducer = (state, action) => {
|
|
26
28
|
switch (action.type) {
|
|
27
29
|
case ActionTypes.UPLOAD_FILE: {
|
|
28
30
|
return Object.assign(Object.assign({}, state), { isOpenSelectDesignationPopup: true, uploadedFile: action.uploadFile, selectDesignation: undefined });
|
|
@@ -44,7 +46,10 @@ exports.reducer = (state, action) => {
|
|
|
44
46
|
return Object.assign(Object.assign({}, state), { isOpenSelectDesignationPopup: false });
|
|
45
47
|
}
|
|
46
48
|
case ActionTypes.HANDLE_FINISH_UPLOAD: {
|
|
47
|
-
return Object.assign(Object.assign({}, state), { isUploadFile: false,
|
|
49
|
+
return Object.assign(Object.assign({}, state), { isUploadFile: false, uploadedFile: undefined, selectDesignation: undefined });
|
|
50
|
+
}
|
|
51
|
+
case ActionTypes.SHOW_FILE_UPLOADED_ALERT: {
|
|
52
|
+
return Object.assign(Object.assign({}, state), { isFileUploaded: true });
|
|
48
53
|
}
|
|
49
54
|
case ActionTypes.HANDLE_SUCCESS_MESSAGE: {
|
|
50
55
|
return Object.assign(Object.assign({}, state), { isShowSuccessMessage: true });
|
|
@@ -55,6 +60,7 @@ exports.reducer = (state, action) => {
|
|
|
55
60
|
}
|
|
56
61
|
return state;
|
|
57
62
|
};
|
|
63
|
+
exports.reducer = reducer;
|
|
58
64
|
exports.actions = {
|
|
59
65
|
UPLOAD_FILE: (uploadFile) => ({
|
|
60
66
|
type: ActionTypes.UPLOAD_FILE,
|
|
@@ -80,6 +86,9 @@ exports.actions = {
|
|
|
80
86
|
HANDLE_FINISH_UPLOAD: () => ({
|
|
81
87
|
type: ActionTypes.HANDLE_FINISH_UPLOAD,
|
|
82
88
|
}),
|
|
89
|
+
SHOW_FILE_UPLOADED_ALERT: () => ({
|
|
90
|
+
type: ActionTypes.SHOW_FILE_UPLOADED_ALERT,
|
|
91
|
+
}),
|
|
83
92
|
CLOSE_FILE_UPLOADED_ALERT: () => ({
|
|
84
93
|
type: ActionTypes.CLOSE_FILE_UPLOADED_ALERT,
|
|
85
94
|
}),
|
|
@@ -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};
|