@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
|
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
37
|
exports.ButtonGroup = exports.SecondaryIconButton = exports.RoundIconButton = exports.IconButton = exports.ToggleButtonAlt = exports.ToggleButton = exports.IconTextButton = exports.TertiaryButton = exports.PrimaryButton = exports.SecondaryButton = void 0;
|
|
38
38
|
const styled_components_1 = __importStar(require("styled-components"));
|
|
39
|
-
const dangerBtnStyles = styled_components_1.css `
|
|
39
|
+
const dangerBtnStyles = (0, styled_components_1.css) `
|
|
40
40
|
${(props) => btnColors(props.theme.colors.button.error.color.default, props.theme.colors.button.error.background.default, props.theme.colors.button.error.border.default, true)}
|
|
41
41
|
|
|
42
42
|
&:not([disabled]):hover, &:not([disabled]):focus {
|
|
@@ -47,18 +47,18 @@ const dangerBtnStyles = styled_components_1.css `
|
|
|
47
47
|
${(props) => btnColors(props.theme.colors.button.error.color.active, props.theme.colors.button.error.background.active, props.theme.colors.button.error.border.active)}
|
|
48
48
|
}
|
|
49
49
|
`;
|
|
50
|
-
const disabledBtnStyles = styled_components_1.css `
|
|
50
|
+
const disabledBtnStyles = (0, styled_components_1.css) `
|
|
51
51
|
cursor: default;
|
|
52
52
|
background-color: ${(props) => props.theme.colors.background.tertiary} !important;
|
|
53
53
|
border-color: ${(props) => props.theme.colors.border.secondary} !important;
|
|
54
54
|
color: ${(props) => props.theme.colors.text.onDark} !important;
|
|
55
55
|
`;
|
|
56
|
-
const miniBtnStyles = styled_components_1.css `
|
|
56
|
+
const miniBtnStyles = (0, styled_components_1.css) `
|
|
57
57
|
padding: 3px 16px;
|
|
58
58
|
margin: 0 ${(props) => props.theme.grid.unit}px;
|
|
59
59
|
line-height: 1;
|
|
60
60
|
`;
|
|
61
|
-
const btnStyles = styled_components_1.css `
|
|
61
|
+
const btnStyles = (0, styled_components_1.css) `
|
|
62
62
|
align-items: center;
|
|
63
63
|
background: transparent;
|
|
64
64
|
border: 1px solid transparent;
|
|
@@ -99,7 +99,7 @@ const ButtonTemplate = styled_components_1.default.button.attrs((props) => ({
|
|
|
99
99
|
})) `
|
|
100
100
|
${btnStyles}
|
|
101
101
|
`;
|
|
102
|
-
exports.SecondaryButton = styled_components_1.default(ButtonTemplate) `
|
|
102
|
+
exports.SecondaryButton = (0, styled_components_1.default)(ButtonTemplate) `
|
|
103
103
|
${(props) => btnColors(props.theme.colors.button.secondary.color.default, props.theme.colors.button.secondary.background.default, props.theme.colors.button.secondary.border.default, false)}
|
|
104
104
|
|
|
105
105
|
&:not([disabled]):hover, &:not([disabled]):focus {
|
|
@@ -110,7 +110,7 @@ exports.SecondaryButton = styled_components_1.default(ButtonTemplate) `
|
|
|
110
110
|
${(props) => btnColors(props.theme.colors.button.secondary.color.active, props.theme.colors.button.secondary.background.active, props.theme.colors.button.secondary.border.active, false)}
|
|
111
111
|
}
|
|
112
112
|
`;
|
|
113
|
-
exports.PrimaryButton = styled_components_1.default(ButtonTemplate) `
|
|
113
|
+
exports.PrimaryButton = (0, styled_components_1.default)(ButtonTemplate) `
|
|
114
114
|
${(props) => btnColors(props.theme.colors.button.primary.color.default, props.theme.colors.button.primary.background.default, props.theme.colors.button.primary.border.default, false)}
|
|
115
115
|
|
|
116
116
|
&:not([disabled]):hover, &:not([disabled]):focus {
|
|
@@ -121,7 +121,7 @@ exports.PrimaryButton = styled_components_1.default(ButtonTemplate) `
|
|
|
121
121
|
${(props) => btnColors(props.theme.colors.button.primary.color.active, props.theme.colors.button.primary.background.active, props.theme.colors.button.primary.border.active, false)}
|
|
122
122
|
}
|
|
123
123
|
`;
|
|
124
|
-
exports.TertiaryButton = styled_components_1.default(ButtonTemplate) `
|
|
124
|
+
exports.TertiaryButton = (0, styled_components_1.default)(ButtonTemplate) `
|
|
125
125
|
${(props) => btnColors(props.theme.colors.button.default.color.default, props.theme.colors.button.default.background.default, props.theme.colors.button.default.border.default, false)}
|
|
126
126
|
|
|
127
127
|
&:not([disabled]):hover, &:not([disabled]):focus {
|
|
@@ -132,7 +132,7 @@ exports.TertiaryButton = styled_components_1.default(ButtonTemplate) `
|
|
|
132
132
|
${(props) => btnColors(props.theme.colors.button.default.color.active, props.theme.colors.button.default.background.active, props.theme.colors.button.default.border.active, false)}
|
|
133
133
|
}
|
|
134
134
|
`;
|
|
135
|
-
exports.IconTextButton = styled_components_1.default(ButtonTemplate) `
|
|
135
|
+
exports.IconTextButton = (0, styled_components_1.default)(ButtonTemplate) `
|
|
136
136
|
border: none;
|
|
137
137
|
color: ${(props) => props.theme.colors.text.primary};
|
|
138
138
|
padding: 0;
|
|
@@ -143,7 +143,7 @@ exports.IconTextButton = styled_components_1.default(ButtonTemplate) `
|
|
|
143
143
|
margin-right: ${(props) => props.theme.grid.unit * 3}px;
|
|
144
144
|
}
|
|
145
145
|
`;
|
|
146
|
-
exports.ToggleButton = styled_components_1.default(ButtonTemplate) `
|
|
146
|
+
exports.ToggleButton = (0, styled_components_1.default)(ButtonTemplate) `
|
|
147
147
|
color: ${(props) => props.theme.colors.text.primary};
|
|
148
148
|
background-color: ${(props) => props.selected ? props.theme.colors.background.fifth : 'transparent'};
|
|
149
149
|
border-color: ${(props) => props.selected
|
|
@@ -181,7 +181,7 @@ exports.ToggleButton = styled_components_1.default(ButtonTemplate) `
|
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
`;
|
|
184
|
-
exports.ToggleButtonAlt = styled_components_1.default(ButtonTemplate) `
|
|
184
|
+
exports.ToggleButtonAlt = (0, styled_components_1.default)(ButtonTemplate) `
|
|
185
185
|
color: ${(props) => props.theme.colors.text.primary};
|
|
186
186
|
border-color: transparent;
|
|
187
187
|
border: none;
|
|
@@ -197,7 +197,7 @@ exports.ToggleButtonAlt = styled_components_1.default(ButtonTemplate) `
|
|
|
197
197
|
border-color: ${(props) => props.theme.colors.border.info};
|
|
198
198
|
}
|
|
199
199
|
`;
|
|
200
|
-
const svgColors = styled_components_1.css `
|
|
200
|
+
const svgColors = (0, styled_components_1.css) `
|
|
201
201
|
svg {
|
|
202
202
|
g[stroke] {
|
|
203
203
|
stroke: currentColor;
|
|
@@ -218,14 +218,14 @@ const svgColors = styled_components_1.css `
|
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
`;
|
|
221
|
-
const IconButtonTemplate = styled_components_1.default(ButtonTemplate) `
|
|
221
|
+
const IconButtonTemplate = (0, styled_components_1.default)(ButtonTemplate) `
|
|
222
222
|
padding: 0;
|
|
223
223
|
height: ${(props) => props.size || 40}px;
|
|
224
224
|
width: ${(props) => props.size || 40}px;
|
|
225
225
|
|
|
226
226
|
${(props) => !props.defaultColor && svgColors}
|
|
227
227
|
`;
|
|
228
|
-
exports.IconButton = styled_components_1.default(IconButtonTemplate) `
|
|
228
|
+
exports.IconButton = (0, styled_components_1.default)(IconButtonTemplate) `
|
|
229
229
|
${(props) => btnColors(props.theme.colors.text.primary, props.theme.colors.button.default.background.default, props.theme.colors.button.default.border.default, false)}
|
|
230
230
|
|
|
231
231
|
&:not([disabled]):hover, &:not([disabled]):focus {
|
|
@@ -236,7 +236,7 @@ exports.IconButton = styled_components_1.default(IconButtonTemplate) `
|
|
|
236
236
|
${(props) => btnColors(props.theme.colors.brand.default, 'transparent', 'transparent', false)}
|
|
237
237
|
}
|
|
238
238
|
`;
|
|
239
|
-
exports.RoundIconButton = styled_components_1.default(exports.IconButton).attrs((props) => ({
|
|
239
|
+
exports.RoundIconButton = (0, styled_components_1.default)(exports.IconButton).attrs((props) => ({
|
|
240
240
|
defaultColor: true,
|
|
241
241
|
})) `
|
|
242
242
|
background: ${(props) => props.theme.colors.background.primary};
|
|
@@ -263,7 +263,7 @@ exports.RoundIconButton = styled_components_1.default(exports.IconButton).attrs(
|
|
|
263
263
|
vertical-align: middle;
|
|
264
264
|
}
|
|
265
265
|
`;
|
|
266
|
-
exports.SecondaryIconButton = styled_components_1.default(exports.IconButton) `
|
|
266
|
+
exports.SecondaryIconButton = (0, styled_components_1.default)(exports.IconButton) `
|
|
267
267
|
${(props) => btnColors(props.theme.colors.text.secondary, props.theme.colors.background.primary, 'transparent', false)}
|
|
268
268
|
|
|
269
269
|
&:not([disabled]):hover, &:not([disabled]):focus {
|
|
@@ -22,9 +22,10 @@ exports.ColorField = void 0;
|
|
|
22
22
|
const react_1 = __importDefault(require("react"));
|
|
23
23
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
24
24
|
const ColorSelector_1 = require("./ColorSelector");
|
|
25
|
-
|
|
25
|
+
const ColorField = ({ options, value, handleChange, }) => (react_1.default.createElement(Container, null,
|
|
26
26
|
options.map((color) => (react_1.default.createElement(ItemButton, { key: color.value, type: "button", color: color.value, isActive: value === color.value, onClick: () => handleChange(color.value) }))),
|
|
27
27
|
react_1.default.createElement(ColorSelector_1.ColorSelector, { handleChange: handleChange })));
|
|
28
|
+
exports.ColorField = ColorField;
|
|
28
29
|
const Container = styled_components_1.default.div `
|
|
29
30
|
display: flex;
|
|
30
31
|
flex-wrap: wrap;
|
|
@@ -43,22 +43,22 @@ const react_color_1 = require("react-color");
|
|
|
43
43
|
const react_popper_1 = require("react-popper");
|
|
44
44
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
45
45
|
const Button_1 = require("../Button");
|
|
46
|
-
|
|
47
|
-
const [open, setOpen] = react_1.useState(false);
|
|
48
|
-
const [color, setColor] = react_1.useState('#ffffff');
|
|
49
|
-
const toggleOpen = react_1.useCallback(() => {
|
|
46
|
+
const ColorSelector = ({ handleChange }) => {
|
|
47
|
+
const [open, setOpen] = (0, react_1.useState)(false);
|
|
48
|
+
const [color, setColor] = (0, react_1.useState)('#ffffff');
|
|
49
|
+
const toggleOpen = (0, react_1.useCallback)(() => {
|
|
50
50
|
setOpen((open) => !open);
|
|
51
51
|
}, [setOpen]);
|
|
52
|
-
const handleSave = react_1.useCallback(() => {
|
|
52
|
+
const handleSave = (0, react_1.useCallback)(() => {
|
|
53
53
|
if (color) {
|
|
54
54
|
handleChange(color);
|
|
55
55
|
}
|
|
56
56
|
setOpen(false);
|
|
57
57
|
}, [color, handleChange, setOpen]);
|
|
58
|
-
const handleColorChange = react_1.useCallback((color) => {
|
|
58
|
+
const handleColorChange = (0, react_1.useCallback)((color) => {
|
|
59
59
|
setColor(color.hex);
|
|
60
60
|
}, [setColor]);
|
|
61
|
-
const handleCancel = react_1.useCallback(() => {
|
|
61
|
+
const handleCancel = (0, react_1.useCallback)(() => {
|
|
62
62
|
setOpen(false);
|
|
63
63
|
}, [setOpen]);
|
|
64
64
|
return (react_1.default.createElement(react_popper_1.Manager, null,
|
|
@@ -70,6 +70,7 @@ exports.ColorSelector = ({ handleChange }) => {
|
|
|
70
70
|
react_1.default.createElement(Button_1.PrimaryButton, { mini: true, onClick: handleSave }, "Add color"),
|
|
71
71
|
react_1.default.createElement(Button_1.SecondaryButton, { mini: true, onClick: handleCancel }, "Cancel")))))))));
|
|
72
72
|
};
|
|
73
|
+
exports.ColorSelector = ColorSelector;
|
|
73
74
|
const Actions = styled_components_1.default.div `
|
|
74
75
|
display: flex;
|
|
75
76
|
justify-content: center;
|
|
@@ -45,23 +45,19 @@ const Button_1 = require("../Button");
|
|
|
45
45
|
const Dropdown_1 = require("../Dropdown");
|
|
46
46
|
const dots_icon_1 = __importDefault(require("../icons/dots-icon"));
|
|
47
47
|
const ResolveButton_1 = require("./ResolveButton");
|
|
48
|
-
|
|
49
|
-
const { isOpen, toggleOpen, wrapperRef } = use_dropdown_1.useDropdown();
|
|
50
|
-
const handleRequestEdit = react_1.useCallback(() => {
|
|
48
|
+
const CommentActions = ({ id, target, can, isResolved, handleSetResolved, deleteComment, setIsEditing, isOwnComment, isProdNote, }) => {
|
|
49
|
+
const { isOpen, toggleOpen, wrapperRef } = (0, use_dropdown_1.useDropdown)();
|
|
50
|
+
const handleRequestEdit = (0, react_1.useCallback)(() => {
|
|
51
51
|
setIsEditing(true);
|
|
52
52
|
}, [setIsEditing]);
|
|
53
|
-
const handleRequestDelete = react_1.useCallback(() => deleteComment(id, target), [
|
|
54
|
-
|
|
55
|
-
id,
|
|
56
|
-
target,
|
|
57
|
-
]);
|
|
58
|
-
const canResolve = react_1.useMemo(() => {
|
|
53
|
+
const handleRequestDelete = (0, react_1.useCallback)(() => deleteComment(id, target), [deleteComment, id, target]);
|
|
54
|
+
const canResolve = (0, react_1.useMemo)(() => {
|
|
59
55
|
if (!isProdNote) {
|
|
60
56
|
return ((isOwnComment && (can === null || can === void 0 ? void 0 : can.resolveOwnComment)) || (can === null || can === void 0 ? void 0 : can.resolveOthersComment));
|
|
61
57
|
}
|
|
62
58
|
return can === null || can === void 0 ? void 0 : can.handleNotes;
|
|
63
59
|
}, [isProdNote, isOwnComment, can]);
|
|
64
|
-
const canHandle = react_1.useMemo(() => {
|
|
60
|
+
const canHandle = (0, react_1.useMemo)(() => {
|
|
65
61
|
if (!isProdNote) {
|
|
66
62
|
return ((isOwnComment && (can === null || can === void 0 ? void 0 : can.handleOwnComments)) || (can === null || can === void 0 ? void 0 : can.handleOthersComments));
|
|
67
63
|
}
|
|
@@ -76,17 +72,18 @@ exports.CommentActions = ({ id, target, can, isResolved, handleSetResolved, dele
|
|
|
76
72
|
react_1.default.createElement(ActionButton, { onClick: handleRequestEdit }, "Edit"),
|
|
77
73
|
react_1.default.createElement(ActionButton, { onClick: handleRequestDelete }, "Delete")))))));
|
|
78
74
|
};
|
|
75
|
+
exports.CommentActions = CommentActions;
|
|
79
76
|
const Container = styled_components_1.default.div `
|
|
80
77
|
display: flex;
|
|
81
78
|
align-items: center;
|
|
82
79
|
height: ${(props) => props.theme.grid.unit * 6}px;
|
|
83
80
|
`;
|
|
84
|
-
const ActionButton = styled_components_1.default(Button_1.IconTextButton) `
|
|
81
|
+
const ActionButton = (0, styled_components_1.default)(Button_1.IconTextButton) `
|
|
85
82
|
display: inline-block;
|
|
86
83
|
text-align: left;
|
|
87
84
|
padding-left: ${(props) => props.theme.grid.unit * 4}px;
|
|
88
85
|
`;
|
|
89
|
-
const ActionDropdownButton = styled_components_1.default(Dropdown_1.DropdownButton) `
|
|
86
|
+
const ActionDropdownButton = (0, styled_components_1.default)(Dropdown_1.DropdownButton) `
|
|
90
87
|
&:not([disabled]):focus {
|
|
91
88
|
circle {
|
|
92
89
|
fill: ${(props) => props.theme.colors.brand.medium};
|
|
@@ -32,7 +32,7 @@ const styled_components_1 = __importDefault(require("styled-components"));
|
|
|
32
32
|
const Button_1 = require("../Button");
|
|
33
33
|
const Form_1 = require("../Form");
|
|
34
34
|
exports.CommentBody = react_1.default.memo(({ createKeyword, comment, getCollaborator, getKeyword, listCollaborators, listKeywords, saveComment, deleteComment, isReply, isNew, handleCreateReply, setIsEditing, scrollIntoHighlight, isEditing, }) => {
|
|
35
|
-
react_1.useEffect(() => {
|
|
35
|
+
(0, react_1.useEffect)(() => {
|
|
36
36
|
if (isNew) {
|
|
37
37
|
setIsEditing(true);
|
|
38
38
|
}
|
|
@@ -71,7 +71,7 @@ const CommentFooter = styled_components_1.default.div `
|
|
|
71
71
|
justify-content: flex-end;
|
|
72
72
|
height: ${(props) => props.theme.grid.unit * 6}px;
|
|
73
73
|
`;
|
|
74
|
-
const EditingCommentFooter = styled_components_1.default(CommentFooter) `
|
|
74
|
+
const EditingCommentFooter = (0, styled_components_1.default)(CommentFooter) `
|
|
75
75
|
justify-content: flex-end;
|
|
76
76
|
padding: ${(props) => props.theme.grid.unit * 2}px
|
|
77
77
|
${(props) => props.theme.grid.unit * 4}px 0;
|
|
@@ -90,7 +90,7 @@ const CommentContent = styled_components_1.default.div `
|
|
|
90
90
|
cursor: pointer;
|
|
91
91
|
padding: 0 ${(props) => props.theme.grid.unit * 4}px;
|
|
92
92
|
`;
|
|
93
|
-
const StyledCommentField = styled_components_1.default(comment_editor_1.CommentField) `
|
|
93
|
+
const StyledCommentField = (0, styled_components_1.default)(comment_editor_1.CommentField) `
|
|
94
94
|
flex: 1;
|
|
95
95
|
|
|
96
96
|
& .ProseMirror {
|
|
@@ -145,7 +145,7 @@ const StyledCommentField = styled_components_1.default(comment_editor_1.CommentF
|
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
`;
|
|
148
|
-
const StyledCommentViewer = styled_components_1.default(comment_editor_1.Comment) `
|
|
148
|
+
const StyledCommentViewer = (0, styled_components_1.default)(comment_editor_1.Comment) `
|
|
149
149
|
flex: 1;
|
|
150
150
|
|
|
151
151
|
& .ProseMirror {
|
|
@@ -175,7 +175,7 @@ const StyledCommentViewer = styled_components_1.default(comment_editor_1.Comment
|
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
`;
|
|
178
|
-
const Actions = styled_components_1.default(Button_1.ButtonGroup) `
|
|
178
|
+
const Actions = (0, styled_components_1.default)(Button_1.ButtonGroup) `
|
|
179
179
|
& button:not(:last-of-type) {
|
|
180
180
|
margin-right: 4px;
|
|
181
181
|
}
|
|
@@ -38,7 +38,7 @@ exports.CommentTarget = void 0;
|
|
|
38
38
|
const react_1 = __importStar(require("react"));
|
|
39
39
|
exports.CommentTarget = react_1.default.memo(({ isSelected, children }) => {
|
|
40
40
|
const threadRef = react_1.default.createRef();
|
|
41
|
-
react_1.useEffect(() => {
|
|
41
|
+
(0, react_1.useEffect)(() => {
|
|
42
42
|
if (threadRef.current && isSelected) {
|
|
43
43
|
threadRef.current.scrollIntoView({
|
|
44
44
|
behavior: 'smooth',
|
|
@@ -34,7 +34,7 @@ const CommentUserName = styled_components_1.default.div `
|
|
|
34
34
|
overflow: hidden;
|
|
35
35
|
text-overflow: ellipsis;
|
|
36
36
|
`;
|
|
37
|
-
const DateText = styled_components_1.default(CommentUserName) `
|
|
37
|
+
const DateText = (0, styled_components_1.default)(CommentUserName) `
|
|
38
38
|
font-size: ${(props) => props.theme.font.size.small};
|
|
39
39
|
line-height: ${(props) => props.theme.font.lineHeight.normal};
|
|
40
40
|
font-weight: ${(props) => props.theme.font.weight.normal};
|
|
@@ -45,7 +45,7 @@ const Header = styled_components_1.default.div `
|
|
|
45
45
|
flex-direction: column;
|
|
46
46
|
font-size: ${(props) => props.theme.font.size.normal};
|
|
47
47
|
`;
|
|
48
|
-
|
|
48
|
+
const CommentUser = ({ contributions, getCollaboratorById, displayName, createdAt }) => {
|
|
49
49
|
if (!contributions || !contributions.length) {
|
|
50
50
|
return (react_1.default.createElement(CommentUserContainer, null,
|
|
51
51
|
react_1.default.createElement(Header, null,
|
|
@@ -73,3 +73,4 @@ exports.CommentUser = ({ contributions, getCollaboratorById, displayName, create
|
|
|
73
73
|
react_1.default.createElement(DateText, null,
|
|
74
74
|
react_1.default.createElement(ManuscriptNoteList_1.LightRelativeDate, { createdAt: createdAt })))));
|
|
75
75
|
};
|
|
76
|
+
exports.CommentUser = CommentUser;
|
|
@@ -47,43 +47,45 @@ const CommentUser_1 = require("./CommentUser");
|
|
|
47
47
|
const isOwn = (comment, userId) => {
|
|
48
48
|
var _a;
|
|
49
49
|
return comment.contributions
|
|
50
|
-
? (_a = comment.contributions) === null || _a === void 0 ? void 0 : _a.some((c) => c.profileID === userId)
|
|
50
|
+
? (_a = comment.contributions) === null || _a === void 0 ? void 0 : _a.some((c) => c.profileID === userId)
|
|
51
|
+
: false;
|
|
51
52
|
};
|
|
52
|
-
|
|
53
|
-
const [isEditing, setIsEditing] = react_1.useState();
|
|
54
|
-
const threadRef = react_1.useRef(null);
|
|
55
|
-
react_1.useEffect(() => {
|
|
53
|
+
const CommentWrapper = ({ createKeyword, comment, can, currentUserId, getCollaborator, getKeyword, listCollaborators, listKeywords, saveComment, deleteComment, isReply, isNew, handleCreateReply, handleSetResolved, isProdNote, isSelected, handleRequestSelect, scrollIntoHighlight, children, }) => {
|
|
54
|
+
const [isEditing, setIsEditing] = (0, react_1.useState)();
|
|
55
|
+
const threadRef = (0, react_1.useRef)(null);
|
|
56
|
+
(0, react_1.useEffect)(() => {
|
|
56
57
|
if (isNew) {
|
|
57
58
|
setIsEditing(true);
|
|
58
59
|
if (threadRef.current) {
|
|
59
|
-
setTimeout(() => {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
setTimeout(() => {
|
|
61
|
+
var _a;
|
|
62
|
+
return (_a = threadRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
|
|
63
|
+
block: 'nearest',
|
|
64
|
+
inline: 'nearest',
|
|
65
|
+
});
|
|
66
|
+
}, 100);
|
|
63
67
|
}
|
|
64
68
|
}
|
|
65
69
|
}, [isNew]);
|
|
66
|
-
const onTitleMouseDown = react_1.useCallback((e) => {
|
|
70
|
+
const onTitleMouseDown = (0, react_1.useCallback)((e) => {
|
|
67
71
|
e.preventDefault();
|
|
68
72
|
handleRequestSelect && handleRequestSelect();
|
|
69
73
|
}, [handleRequestSelect]);
|
|
70
|
-
const onTitleKeyDown = react_1.useCallback((e) => {
|
|
74
|
+
const onTitleKeyDown = (0, react_1.useCallback)((e) => {
|
|
71
75
|
if ([' ', 'Enter'].includes(e.key)) {
|
|
72
76
|
e.preventDefault();
|
|
73
77
|
handleRequestSelect && handleRequestSelect();
|
|
74
78
|
}
|
|
75
79
|
}, [handleRequestSelect]);
|
|
76
|
-
const isOwnComment = react_1.useMemo(() => isOwn(comment, currentUserId), [
|
|
77
|
-
comment,
|
|
78
|
-
currentUserId,
|
|
79
|
-
]);
|
|
80
|
+
const isOwnComment = (0, react_1.useMemo)(() => isOwn(comment, currentUserId), [comment, currentUserId]);
|
|
80
81
|
return (react_1.default.createElement(Note, { ref: threadRef, isSelected: isSelected },
|
|
81
82
|
react_1.default.createElement(NoteHeader, null,
|
|
82
|
-
react_1.default.createElement(NoteTitle, { type: "button", onMouseDown: onTitleMouseDown, onKeyDown: onTitleKeyDown }, comment.contributions && (react_1.default.createElement(CommentUser_1.CommentUser, { contributions: comment.contributions, getCollaboratorById: getCollaborator, displayName: comment.displayName, createdAt: comments_1.isSavedComment(comment) ? comment.createdAt * 1000 : undefined }))),
|
|
83
|
+
react_1.default.createElement(NoteTitle, { type: "button", onMouseDown: onTitleMouseDown, onKeyDown: onTitleKeyDown }, comment.contributions && (react_1.default.createElement(CommentUser_1.CommentUser, { contributions: comment.contributions, getCollaboratorById: getCollaborator, displayName: comment.displayName, createdAt: (0, comments_1.isSavedComment)(comment) ? comment.createdAt * 1000 : undefined }))),
|
|
83
84
|
react_1.default.createElement(CommentActions_1.CommentActions, { id: comment._id, isOwnComment: isOwnComment, can: can, target: comment.target, isResolved: comment.resolved, handleSetResolved: handleSetResolved, deleteComment: deleteComment, setIsEditing: setIsEditing, isProdNote: isProdNote })),
|
|
84
85
|
children,
|
|
85
86
|
react_1.default.createElement(CommentBody_1.CommentBody, { createKeyword: createKeyword, comment: comment, deleteComment: deleteComment, getCollaborator: getCollaborator, getKeyword: getKeyword, listCollaborators: listCollaborators, listKeywords: listKeywords, isReply: isReply, saveComment: saveComment, handleCreateReply: handleCreateReply, scrollIntoHighlight: scrollIntoHighlight, isNew: isNew, setIsEditing: setIsEditing, isEditing: isEditing })));
|
|
86
87
|
};
|
|
88
|
+
exports.CommentWrapper = CommentWrapper;
|
|
87
89
|
const Note = styled_components_1.default.div `
|
|
88
90
|
& .note-actions {
|
|
89
91
|
opacity: 0;
|
|
@@ -24,19 +24,20 @@ const react_tooltip_1 = __importDefault(require("react-tooltip"));
|
|
|
24
24
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
25
25
|
const Button_1 = require("../Button");
|
|
26
26
|
const tick_mark_1 = __importDefault(require("../icons/tick-mark"));
|
|
27
|
-
|
|
27
|
+
const ResolveButton = ({ id, resolved, resolvedCallback }) => {
|
|
28
28
|
return (react_1.default.createElement(Container, null,
|
|
29
29
|
react_1.default.createElement(Button, { resolved: resolved, "data-tip": true, "data-for": id, onClick: resolvedCallback },
|
|
30
30
|
react_1.default.createElement(tick_mark_1.default, { color: '#353535' })),
|
|
31
31
|
react_1.default.createElement(react_tooltip_1.default, { id: id, place: "bottom", effect: "solid", offset: { top: 10 }, className: "tooltip" }, (resolved && 'Unresolve') || 'Resolve')));
|
|
32
32
|
};
|
|
33
|
+
exports.ResolveButton = ResolveButton;
|
|
33
34
|
const Container = styled_components_1.default.div `
|
|
34
35
|
display: flex;
|
|
35
36
|
justify-content: space-between;
|
|
36
37
|
align-items: center;
|
|
37
38
|
margin-right: ${(props) => props.theme.grid.unit};
|
|
38
39
|
`;
|
|
39
|
-
const Button = styled_components_1.default(Button_1.IconTextButton) `
|
|
40
|
+
const Button = (0, styled_components_1.default)(Button_1.IconTextButton) `
|
|
40
41
|
width: 24px;
|
|
41
42
|
height: 24px;
|
|
42
43
|
box-sizing: border-box;
|
|
@@ -72,10 +72,10 @@ const HeaderContainer = styled_components_1.default.div `
|
|
|
72
72
|
${(props) => props.theme.font.family.sans};
|
|
73
73
|
line-height: 1.5;
|
|
74
74
|
`;
|
|
75
|
-
const ButtonsContainer = styled_components_1.default(Button_1.ButtonGroup) `
|
|
75
|
+
const ButtonsContainer = (0, styled_components_1.default)(Button_1.ButtonGroup) `
|
|
76
76
|
padding-top: ${(props) => props.theme.grid.unit * 5}px;
|
|
77
77
|
`;
|
|
78
|
-
const ConfirmationTextField = styled_components_1.default(TextField_1.TextField) `
|
|
78
|
+
const ConfirmationTextField = (0, styled_components_1.default)(TextField_1.TextField) `
|
|
79
79
|
margin-top: ${(props) => props.theme.grid.unit * 4}px;
|
|
80
80
|
margin-bottom: ${(props) => props.theme.grid.unit * 8}px;
|
|
81
81
|
`;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.ConfirmationPopUp = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const Dialog_1 = require("../Dialog");
|
|
9
|
-
|
|
9
|
+
const ConfirmationPopUp = ({ popupHeader, popUpMessage, isOpen, handleClose, handleMove }) => {
|
|
10
10
|
return (react_1.default.createElement(Dialog_1.Dialog, { isOpen: isOpen, category: Dialog_1.Category.confirmation, header: popupHeader, message: popUpMessage, actions: {
|
|
11
11
|
primary: {
|
|
12
12
|
action: handleMove,
|
|
@@ -18,3 +18,4 @@ exports.ConfirmationPopUp = ({ popupHeader, popUpMessage, isOpen, handleClose, h
|
|
|
18
18
|
},
|
|
19
19
|
} }));
|
|
20
20
|
};
|
|
21
|
+
exports.ConfirmationPopUp = ConfirmationPopUp;
|
|
@@ -7,12 +7,13 @@ exports.DragItemArea = void 0;
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const drag_drop_file_icon_1 = __importDefault(require("../icons/drag-drop-file-icon"));
|
|
10
|
-
|
|
10
|
+
const DragItemArea = ({ text }) => {
|
|
11
11
|
return (react_1.default.createElement(Container, null,
|
|
12
12
|
react_1.default.createElement("div", null,
|
|
13
13
|
react_1.default.createElement(drag_drop_file_icon_1.default, null)),
|
|
14
14
|
text));
|
|
15
15
|
};
|
|
16
|
+
exports.DragItemArea = DragItemArea;
|
|
16
17
|
const Container = styled_components_1.default.div `
|
|
17
18
|
display: flex;
|
|
18
19
|
flex-direction: column;
|
|
@@ -44,23 +44,20 @@ const FileSectionState_1 = require("./FileSectionState");
|
|
|
44
44
|
const FilesSection_1 = require("./FilesSection");
|
|
45
45
|
const TooltipDiv_1 = require("./TooltipDiv");
|
|
46
46
|
const util_1 = require("./util");
|
|
47
|
-
exports.PermissionsContext = react_1.createContext(null);
|
|
48
|
-
|
|
49
|
-
const [state, dispatch] = react_1.useReducer(FileSectionState_1.reducer, FileSectionState_1.getInitialState());
|
|
50
|
-
const handleReplaceFile = react_1.useCallback((submissionId, name, file, typeId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
47
|
+
exports.PermissionsContext = (0, react_1.createContext)(null);
|
|
48
|
+
const FileManager = ({ submissionId, externalFiles, enableDragAndDrop, can, handleUpload, handleDownload, handleReplace, handleChangeDesignation, }) => {
|
|
49
|
+
const [state, dispatch] = (0, react_1.useReducer)(FileSectionState_1.reducer, (0, FileSectionState_1.getInitialState)());
|
|
50
|
+
const handleReplaceFile = (0, react_1.useCallback)((submissionId, name, file, typeId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
51
51
|
dispatch(FileSectionState_1.actions.HANDLE_UPLOAD_ACTION());
|
|
52
52
|
dispatch(FileSectionState_1.actions.SELECT_DESIGNATION(util_1.namesWithDesignationMap.get(typeId) || util_1.Designation.Document));
|
|
53
53
|
const res = yield handleReplace(submissionId, name, file, typeId);
|
|
54
54
|
if (res) {
|
|
55
55
|
dispatch(FileSectionState_1.actions.SHOW_FILE_UPLOADED_ALERT());
|
|
56
|
-
dispatch(FileSectionState_1.actions.HANDLE_FINISH_UPLOAD());
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
dispatch(FileSectionState_1.actions.HANDLE_FINISH_UPLOAD());
|
|
60
56
|
}
|
|
57
|
+
dispatch(FileSectionState_1.actions.HANDLE_FINISH_UPLOAD());
|
|
61
58
|
return res;
|
|
62
59
|
}), [handleReplace]);
|
|
63
|
-
const handleUploadFile = react_1.useCallback((submissionId, file, designation) => __awaiter(void 0, void 0, void 0, function* () {
|
|
60
|
+
const handleUploadFile = (0, react_1.useCallback)((submissionId, file, designation) => __awaiter(void 0, void 0, void 0, function* () {
|
|
64
61
|
try {
|
|
65
62
|
dispatch(FileSectionState_1.actions.HANDLE_UPLOAD_ACTION());
|
|
66
63
|
if (util_1.namesWithDesignationMap.get(designation) == util_1.Designation.Supplementary) {
|
|
@@ -69,11 +66,8 @@ exports.FileManager = ({ submissionId, externalFiles, enableDragAndDrop, can, ha
|
|
|
69
66
|
const res = yield handleUpload(submissionId, file, designation);
|
|
70
67
|
if (res) {
|
|
71
68
|
dispatch(FileSectionState_1.actions.SHOW_FILE_UPLOADED_ALERT());
|
|
72
|
-
dispatch(FileSectionState_1.actions.HANDLE_FINISH_UPLOAD());
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
dispatch(FileSectionState_1.actions.HANDLE_FINISH_UPLOAD());
|
|
76
69
|
}
|
|
70
|
+
dispatch(FileSectionState_1.actions.HANDLE_FINISH_UPLOAD());
|
|
77
71
|
return res;
|
|
78
72
|
}
|
|
79
73
|
catch (e) {
|
|
@@ -81,7 +75,7 @@ exports.FileManager = ({ submissionId, externalFiles, enableDragAndDrop, can, ha
|
|
|
81
75
|
return false;
|
|
82
76
|
}
|
|
83
77
|
}), [handleUpload]);
|
|
84
|
-
const handleChangeDesignationFile = react_1.useCallback((submissionId, typeId, name) => __awaiter(void 0, void 0, void 0, function* () {
|
|
78
|
+
const handleChangeDesignationFile = (0, react_1.useCallback)((submissionId, typeId, name) => __awaiter(void 0, void 0, void 0, function* () {
|
|
85
79
|
try {
|
|
86
80
|
const res = yield handleChangeDesignation(submissionId, typeId, name);
|
|
87
81
|
if (res) {
|
|
@@ -94,7 +88,7 @@ exports.FileManager = ({ submissionId, externalFiles, enableDragAndDrop, can, ha
|
|
|
94
88
|
return false;
|
|
95
89
|
}
|
|
96
90
|
}), [handleChangeDesignation]);
|
|
97
|
-
const handleDownloadFile = react_1.useCallback((publicUrl) => {
|
|
91
|
+
const handleDownloadFile = (0, react_1.useCallback)((publicUrl) => {
|
|
98
92
|
return handleDownload(publicUrl);
|
|
99
93
|
}, [handleDownload]);
|
|
100
94
|
const getFileSectionExternalFile = (fileSection) => {
|
|
@@ -105,7 +99,7 @@ exports.FileManager = ({ submissionId, externalFiles, enableDragAndDrop, can, ha
|
|
|
105
99
|
return (designation !== undefined &&
|
|
106
100
|
util_1.designationWithFileSectionsMap.get(designation) === fileSection);
|
|
107
101
|
});
|
|
108
|
-
const itemsDataWithTitle = util_1.generateExternalFilesTitles(util_1.sortExternalFiles(itemsData), fileSection);
|
|
102
|
+
const itemsDataWithTitle = (0, util_1.generateExternalFilesTitles)((0, util_1.sortExternalFiles)(itemsData), fileSection);
|
|
109
103
|
const filesItems = itemsDataWithTitle.map((element) => {
|
|
110
104
|
const itemProps = {
|
|
111
105
|
submissionId: submissionId,
|
|
@@ -162,3 +156,4 @@ exports.FileManager = ({ submissionId, externalFiles, enableDragAndDrop, can, ha
|
|
|
162
156
|
state.successMessage !== '' &&
|
|
163
157
|
handleSuccessMessage()));
|
|
164
158
|
};
|
|
159
|
+
exports.FileManager = FileManager;
|
|
@@ -29,9 +29,9 @@ const BottomArrowIcon_1 = __importDefault(require("../../icons/BottomArrowIcon")
|
|
|
29
29
|
const ConfirmationPopUp_1 = require("../ConfirmationPopUp");
|
|
30
30
|
const util_1 = require("../util");
|
|
31
31
|
const DesignationActionsList_1 = require("./DesignationActionsList");
|
|
32
|
-
|
|
33
|
-
const [isActionsShown, setIsActionsShown] = react_1.useState(false);
|
|
34
|
-
const [confirmationPopUpData, setConfirmationPopUpData] = react_1.useState({
|
|
32
|
+
const DesignationActions = ({ designation, fileExtension, handleChangeDesignation, submissionId, fileName, dispatch, }) => {
|
|
33
|
+
const [isActionsShown, setIsActionsShown] = (0, react_1.useState)(false);
|
|
34
|
+
const [confirmationPopUpData, setConfirmationPopUpData] = (0, react_1.useState)({
|
|
35
35
|
isConfirmationPopUpOpen: false,
|
|
36
36
|
confirmationPopUpMessage: '',
|
|
37
37
|
confirmationPopUpHeader: '',
|
|
@@ -46,7 +46,7 @@ exports.DesignationActions = ({ designation, fileExtension, handleChangeDesignat
|
|
|
46
46
|
setIsActionsShown(false);
|
|
47
47
|
};
|
|
48
48
|
if (designation && fileExtension) {
|
|
49
|
-
const designationActionsList = util_1.getDesignationActionsList(designation, fileExtension);
|
|
49
|
+
const designationActionsList = (0, util_1.getDesignationActionsList)(designation, fileExtension);
|
|
50
50
|
if (!designationActionsList.length) {
|
|
51
51
|
return null;
|
|
52
52
|
}
|
|
@@ -87,6 +87,7 @@ exports.DesignationActions = ({ designation, fileExtension, handleChangeDesignat
|
|
|
87
87
|
return null;
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
|
+
exports.DesignationActions = DesignationActions;
|
|
90
91
|
const SecondaryActionsContainer = styled_components_1.default.button `
|
|
91
92
|
display: flex;
|
|
92
93
|
align-items: center;
|
|
@@ -8,17 +8,17 @@ const react_1 = __importDefault(require("react"));
|
|
|
8
8
|
const FileSectionState_1 = require("../FileSectionState");
|
|
9
9
|
const ItemsAction_1 = require("../ItemsAction");
|
|
10
10
|
const util_1 = require("../util");
|
|
11
|
-
|
|
11
|
+
const DesignationActionsList = ({ handleChangeDesignation, designationActionsList, submissionId, fileName, designation, dispatch, handleOpenConfirmationPopup, }) => {
|
|
12
12
|
const handleChangeOtherFilesTabDesignation = (designation, isMoveInOtherFileSection, confirmationPopupHeader, confirmationPopupMessage, successMoveMessage) => {
|
|
13
13
|
if (isMoveInOtherFileSection) {
|
|
14
14
|
if (dispatch) {
|
|
15
|
-
dispatch(FileSectionState_1.actions.MOVE_FILE(submissionId, util_1.getDesignationName(designation), fileName, successMoveMessage));
|
|
16
|
-
handleOpenConfirmationPopup(confirmationPopupHeader, confirmationPopupMessage, util_1.getDesignationName(designation));
|
|
15
|
+
dispatch(FileSectionState_1.actions.MOVE_FILE(submissionId, (0, util_1.getDesignationName)(designation), fileName, successMoveMessage));
|
|
16
|
+
handleOpenConfirmationPopup(confirmationPopupHeader, confirmationPopupMessage, (0, util_1.getDesignationName)(designation));
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
else {
|
|
20
20
|
handleChangeDesignation &&
|
|
21
|
-
handleChangeDesignation(submissionId, util_1.getDesignationName(designation), fileName);
|
|
21
|
+
handleChangeDesignation(submissionId, (0, util_1.getDesignationName)(designation), fileName);
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
const isSupplementaryActionIncluded = designationActionsList.indexOf(util_1.Designation.Supplementary) !== -1;
|
|
@@ -51,3 +51,4 @@ exports.DesignationActionsList = ({ handleChangeDesignation, designationActionsL
|
|
|
51
51
|
handleChangeOtherFilesTabDesignation(util_1.Designation.Supplementary, isMoveToOtherFileSection, 'Are you sure you want to move this file to "Supplementary"?', 'The file will be removed from the "Other" and added to "Supplementary".', 'File successfully moved to Supplementary files');
|
|
52
52
|
} }, util_1.designationWithReadableNamesMap.get(util_1.Designation.Supplementary))))));
|
|
53
53
|
};
|
|
54
|
+
exports.DesignationActionsList = DesignationActionsList;
|
|
@@ -40,15 +40,15 @@ function getItemStyles(initialOffset, currentOffset) {
|
|
|
40
40
|
WebkitTransform: transform,
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
const { itemType, isDragging, item, initialOffset, currentOffset
|
|
43
|
+
const DragLayer = () => {
|
|
44
|
+
const { itemType, isDragging, item, initialOffset, currentOffset } = (0, react_dnd_1.useDragLayer)((monitor) => ({
|
|
45
45
|
item: monitor.getItem(),
|
|
46
46
|
itemType: monitor.getItemType(),
|
|
47
47
|
initialOffset: monitor.getInitialSourceClientOffset(),
|
|
48
48
|
currentOffset: monitor.getSourceClientOffset(),
|
|
49
49
|
isDragging: monitor.isDragging(),
|
|
50
50
|
}));
|
|
51
|
-
const renderItem = react_1.useCallback(() => {
|
|
51
|
+
const renderItem = (0, react_1.useCallback)(() => {
|
|
52
52
|
switch (itemType) {
|
|
53
53
|
case 'FileSectionItem':
|
|
54
54
|
return (react_1.default.createElement(CustomFileSectionItem, { title: item.title, externalFile: item.externalFile, showAttachmentName: item.showAttachmentName, withDot: item.withDot, showSecondaryActions: false, showDesignationActions: false, style: { width: item.width } }));
|
|
@@ -62,6 +62,7 @@ exports.DragLayer = () => {
|
|
|
62
62
|
return (react_1.default.createElement(Container, null,
|
|
63
63
|
react_1.default.createElement("div", { style: getItemStyles(initialOffset, currentOffset) }, renderItem())));
|
|
64
64
|
};
|
|
65
|
+
exports.DragLayer = DragLayer;
|
|
65
66
|
const Container = styled_components_1.default.div `
|
|
66
67
|
position: fixed;
|
|
67
68
|
pointer-events: none;
|
|
@@ -71,7 +72,7 @@ const Container = styled_components_1.default.div `
|
|
|
71
72
|
width: 100%;
|
|
72
73
|
height: 100%;
|
|
73
74
|
`;
|
|
74
|
-
const CustomFileSectionItem = react_1.default.memo(styled_components_1.default(FileSectionItem_1.FileSectionItem) `
|
|
75
|
+
const CustomFileSectionItem = react_1.default.memo((0, styled_components_1.default)(FileSectionItem_1.FileSectionItem) `
|
|
75
76
|
padding: 16px 32px;
|
|
76
77
|
background: #f2fbfc;
|
|
77
78
|
border: 1px solid #bce7f6;
|