@manuscripts/style-guide 0.31.28 → 0.31.30
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/Comments/CommentBody.js +2 -2
- package/dist/cjs/components/Comments/CommentWrapper.js +1 -1
- package/dist/cjs/components/EditorHeader/EditorHeader.js +1 -1
- package/dist/es/components/Comments/CommentBody.js +2 -2
- package/dist/es/components/Comments/CommentWrapper.js +1 -1
- package/dist/es/components/EditorHeader/EditorHeader.js +1 -1
- package/dist/types/components/Comments/CommentBody.d.ts +1 -0
- package/package.json +1 -1
|
@@ -31,7 +31,7 @@ const react_tooltip_1 = __importDefault(require("react-tooltip"));
|
|
|
31
31
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
32
32
|
const Button_1 = require("../Button");
|
|
33
33
|
const Form_1 = require("../Form");
|
|
34
|
-
exports.CommentBody = react_1.default.memo(({ createKeyword, comment, getCollaborator, getKeyword, listCollaborators, listKeywords, saveComment, deleteComment, isReply, isNew, handleCreateReply, setIsEditing, scrollIntoHighlight, isEditing, }) => {
|
|
34
|
+
exports.CommentBody = react_1.default.memo(({ createKeyword, comment, getCollaborator, getKeyword, listCollaborators, listKeywords, saveComment, deleteComment, isReply, isNew, handleCreateReply, setIsEditing, scrollIntoHighlight, isEditing, isProdNote, }) => {
|
|
35
35
|
(0, react_1.useEffect)(() => {
|
|
36
36
|
if (isNew) {
|
|
37
37
|
setIsEditing(true);
|
|
@@ -59,7 +59,7 @@ exports.CommentBody = react_1.default.memo(({ createKeyword, comment, getCollabo
|
|
|
59
59
|
react_1.default.createElement(StyledCommentViewer, { value: comment.contents, getCollaborator: getCollaborator, getKeyword: getKeyword })),
|
|
60
60
|
!isReply && (react_1.default.createElement(CommentFooter, null,
|
|
61
61
|
react_1.default.createElement("span", null,
|
|
62
|
-
react_1.default.createElement(ActionButton, { "data-tip": true, "data-for": `reply-${comment._id}`, onClick: () => handleCreateReply(comment._id), "aria-label": 'reply', className: "reply-button note-actions" },
|
|
62
|
+
react_1.default.createElement(ActionButton, { hidden: !isProdNote, "data-tip": true, "data-for": `reply-${comment._id}`, onClick: () => handleCreateReply(comment._id), "aria-label": 'reply', className: "reply-button note-actions" },
|
|
63
63
|
react_1.default.createElement(AnnotationReply_1.default, null))),
|
|
64
64
|
react_1.default.createElement(react_tooltip_1.default, { id: `reply-${comment._id}`, place: "bottom", effect: "solid", offset: { top: 10 }, className: "tooltip" }, "Reply")))))));
|
|
65
65
|
});
|
|
@@ -85,7 +85,7 @@ const CommentWrapper = ({ createKeyword, comment, can, currentUserId, getCollabo
|
|
|
85
85
|
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 }))),
|
|
86
86
|
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 })),
|
|
87
87
|
children,
|
|
88
|
-
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 })));
|
|
88
|
+
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, isProdNote: isProdNote })));
|
|
89
89
|
};
|
|
90
90
|
exports.CommentWrapper = CommentWrapper;
|
|
91
91
|
const Note = styled_components_1.default.div `
|
|
@@ -74,7 +74,7 @@ const EditorHeader = ({ handleSnapshot, submission, hasPendingSuggestions, userR
|
|
|
74
74
|
]);
|
|
75
75
|
const onTransitionClick = (0, react_1.useCallback)((event) => {
|
|
76
76
|
toggleConfirmationDialog(true);
|
|
77
|
-
setSelectedTransitionIndex(event.target.value);
|
|
77
|
+
setSelectedTransitionIndex(event.target.value || event.target.parentNode.value);
|
|
78
78
|
}, [setSelectedTransitionIndex, toggleConfirmationDialog]);
|
|
79
79
|
const onCancelClick = (0, react_1.useCallback)(() => {
|
|
80
80
|
toggleConfirmationDialog(false);
|
|
@@ -6,7 +6,7 @@ import ReactTooltip from 'react-tooltip';
|
|
|
6
6
|
import styled from 'styled-components';
|
|
7
7
|
import { ButtonGroup, PrimaryButton, SecondaryButton } from '../Button';
|
|
8
8
|
import { FormError } from '../Form';
|
|
9
|
-
export const CommentBody = React.memo(({ createKeyword, comment, getCollaborator, getKeyword, listCollaborators, listKeywords, saveComment, deleteComment, isReply, isNew, handleCreateReply, setIsEditing, scrollIntoHighlight, isEditing, }) => {
|
|
9
|
+
export const CommentBody = React.memo(({ createKeyword, comment, getCollaborator, getKeyword, listCollaborators, listKeywords, saveComment, deleteComment, isReply, isNew, handleCreateReply, setIsEditing, scrollIntoHighlight, isEditing, isProdNote, }) => {
|
|
10
10
|
useEffect(() => {
|
|
11
11
|
if (isNew) {
|
|
12
12
|
setIsEditing(true);
|
|
@@ -34,7 +34,7 @@ export const CommentBody = React.memo(({ createKeyword, comment, getCollaborator
|
|
|
34
34
|
React.createElement(StyledCommentViewer, { value: comment.contents, getCollaborator: getCollaborator, getKeyword: getKeyword })),
|
|
35
35
|
!isReply && (React.createElement(CommentFooter, null,
|
|
36
36
|
React.createElement("span", null,
|
|
37
|
-
React.createElement(ActionButton, { "data-tip": true, "data-for": `reply-${comment._id}`, onClick: () => handleCreateReply(comment._id), "aria-label": 'reply', className: "reply-button note-actions" },
|
|
37
|
+
React.createElement(ActionButton, { hidden: !isProdNote, "data-tip": true, "data-for": `reply-${comment._id}`, onClick: () => handleCreateReply(comment._id), "aria-label": 'reply', className: "reply-button note-actions" },
|
|
38
38
|
React.createElement(AnnotationReply, null))),
|
|
39
39
|
React.createElement(ReactTooltip, { id: `reply-${comment._id}`, place: "bottom", effect: "solid", offset: { top: 10 }, className: "tooltip" }, "Reply")))))));
|
|
40
40
|
});
|
|
@@ -60,7 +60,7 @@ export const CommentWrapper = ({ createKeyword, comment, can, currentUserId, get
|
|
|
60
60
|
React.createElement(NoteTitle, { type: "button", onMouseDown: onTitleMouseDown, onKeyDown: onTitleKeyDown }, comment.contributions && (React.createElement(CommentUser, { contributions: comment.contributions, getCollaboratorById: getCollaborator, displayName: comment.displayName, createdAt: isSavedComment(comment) ? comment.createdAt * 1000 : undefined }))),
|
|
61
61
|
React.createElement(CommentActions, { id: comment._id, isOwnComment: isOwnComment, can: can, target: comment.target, isResolved: comment.resolved, handleSetResolved: handleSetResolved, deleteComment: deleteComment, setIsEditing: setIsEditing, isProdNote: isProdNote })),
|
|
62
62
|
children,
|
|
63
|
-
React.createElement(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 })));
|
|
63
|
+
React.createElement(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, isProdNote: isProdNote })));
|
|
64
64
|
};
|
|
65
65
|
const Note = styled.div `
|
|
66
66
|
& .note-actions {
|
|
@@ -49,7 +49,7 @@ export const EditorHeader = ({ handleSnapshot, submission, hasPendingSuggestions
|
|
|
49
49
|
]);
|
|
50
50
|
const onTransitionClick = useCallback((event) => {
|
|
51
51
|
toggleConfirmationDialog(true);
|
|
52
|
-
setSelectedTransitionIndex(event.target.value);
|
|
52
|
+
setSelectedTransitionIndex(event.target.value || event.target.parentNode.value);
|
|
53
53
|
}, [setSelectedTransitionIndex, toggleConfirmationDialog]);
|
|
54
54
|
const onCancelClick = useCallback(() => {
|
|
55
55
|
toggleConfirmationDialog(false);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manuscripts/style-guide",
|
|
3
3
|
"description": "Shared components for Manuscripts applications",
|
|
4
|
-
"version": "0.31.
|
|
4
|
+
"version": "0.31.30",
|
|
5
5
|
"repository": "gitlab:atypon-opensource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|