@manuscripts/article-editor 3.4.3-LEAN-3894.0 → 3.4.3-LEAN-4053.3

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.
Files changed (49) hide show
  1. package/dist/cjs/components/comments/CommentActions.js +7 -11
  2. package/dist/cjs/components/comments/CommentActions.js.map +1 -1
  3. package/dist/cjs/components/comments/CommentBody.js +6 -10
  4. package/dist/cjs/components/comments/CommentBody.js.map +1 -1
  5. package/dist/cjs/components/comments/CommentResolveButton.js +1 -1
  6. package/dist/cjs/components/comments/CommentThread.js +88 -83
  7. package/dist/cjs/components/comments/CommentThread.js.map +1 -1
  8. package/dist/cjs/components/comments/CommentsPanel.js +10 -33
  9. package/dist/cjs/components/comments/CommentsPanel.js.map +1 -1
  10. package/dist/cjs/lib/change-handlers.js +2 -2
  11. package/dist/cjs/lib/change-handlers.js.map +1 -1
  12. package/dist/cjs/lib/comments.js +5 -26
  13. package/dist/cjs/lib/comments.js.map +1 -1
  14. package/dist/cjs/lib/node-content-retriever.js +17 -24
  15. package/dist/cjs/lib/node-content-retriever.js.map +1 -1
  16. package/dist/es/components/comments/CommentActions.js +7 -11
  17. package/dist/es/components/comments/CommentActions.js.map +1 -1
  18. package/dist/es/components/comments/CommentBody.js +7 -11
  19. package/dist/es/components/comments/CommentBody.js.map +1 -1
  20. package/dist/es/components/comments/CommentResolveButton.js +1 -1
  21. package/dist/es/components/comments/CommentThread.js +91 -86
  22. package/dist/es/components/comments/CommentThread.js.map +1 -1
  23. package/dist/es/components/comments/CommentsPanel.js +12 -35
  24. package/dist/es/components/comments/CommentsPanel.js.map +1 -1
  25. package/dist/es/lib/change-handlers.js +2 -2
  26. package/dist/es/lib/change-handlers.js.map +1 -1
  27. package/dist/es/lib/comments.js +3 -23
  28. package/dist/es/lib/comments.js.map +1 -1
  29. package/dist/es/lib/node-content-retriever.js +18 -25
  30. package/dist/es/lib/node-content-retriever.js.map +1 -1
  31. package/dist/types/components/comments/CommentThread.d.ts +2 -3
  32. package/dist/types/lib/comments.d.ts +3 -4
  33. package/dist/types/lib/node-content-retriever.d.ts +2 -6
  34. package/package.json +5 -5
  35. package/dist/cjs/components/comments/CommentCard.js +0 -165
  36. package/dist/cjs/components/comments/CommentCard.js.map +0 -1
  37. package/dist/cjs/components/comments/DeleteCommentConfirmation.js +0 -115
  38. package/dist/cjs/components/comments/DeleteCommentConfirmation.js.map +0 -1
  39. package/dist/cjs/components/comments/ReplyBox.js +0 -121
  40. package/dist/cjs/components/comments/ReplyBox.js.map +0 -1
  41. package/dist/es/components/comments/CommentCard.js +0 -135
  42. package/dist/es/components/comments/CommentCard.js.map +0 -1
  43. package/dist/es/components/comments/DeleteCommentConfirmation.js +0 -85
  44. package/dist/es/components/comments/DeleteCommentConfirmation.js.map +0 -1
  45. package/dist/es/components/comments/ReplyBox.js +0 -91
  46. package/dist/es/components/comments/ReplyBox.js.map +0 -1
  47. package/dist/types/components/comments/CommentCard.d.ts +0 -27
  48. package/dist/types/components/comments/DeleteCommentConfirmation.d.ts +0 -19
  49. package/dist/types/components/comments/ReplyBox.d.ts +0 -18
@@ -1,135 +0,0 @@
1
- import { AvatarIcon, RelativeDate, SystemUserAvatarIcon, usePermissions, } from '@manuscripts/style-guide';
2
- import React, { useState } from 'react';
3
- import styled from 'styled-components';
4
- import { buildAuthorName, getAuthorID } from '../../lib/comments';
5
- import { useStore } from '../../store';
6
- import { CommentActions } from './CommentActions';
7
- import { CommentBody } from './CommentBody';
8
- import { DeleteCommentConfirmation } from './DeleteCommentConfirmation';
9
- const CommentHeader = styled.div `
10
- display: flex;
11
- justify-content: space-between;
12
- margin-bottom: 8px;
13
- `;
14
- const CommentMetadata = styled.div `
15
- display: flex;
16
- align-items: center;
17
- padding-right: 8px;
18
- `;
19
- const AuthorContainer = styled.div `
20
- display: flex;
21
- color: #353535;
22
- font-weight: 400;
23
- max-width: 200px;
24
- white-space: nowrap;
25
- overflow: hidden;
26
- flex-grow: 1;
27
- text-overflow: ellipsis;
28
- margin-right: 8px;
29
-
30
- svg {
31
- padding-right: 10px;
32
- flex-shrink: 0;
33
- }
34
- `;
35
- const CommentTarget = styled.div `
36
- font-size: 14px;
37
- color: #353535;
38
- background-color: #ffeebf;
39
- padding: 4px 8px;
40
- margin-top: 16px;
41
- margin-bottom: 16px;
42
- `;
43
- const Timestamp = styled(RelativeDate) `
44
- font-size: 12px;
45
- line-height: 16px;
46
- font-weight: 400;
47
- color: #6e6e6e;
48
- white-space: nowrap;
49
- padding-right: 8px;
50
- `;
51
- const RepliesCount = styled.div `
52
- border-radius: 50%;
53
- width: 12px;
54
- height: 12px;
55
- color: #ffffff;
56
- background-color: #1a9bc7;
57
- text-align: center;
58
- font-size: 9px;
59
- `;
60
- const Card = styled.div `
61
- position: relative;
62
- `;
63
- export const CommentCard = ({ comment, isReply, numOfReplies, isNew, isEndOfThread, editingCommentId, setEditingCommentId, onSave, onDelete, onSelect, }) => {
64
- const can = usePermissions();
65
- const [{ user, collaboratorsById }] = useStore((state) => ({
66
- user: state.user,
67
- collaboratorsById: state.collaboratorsById,
68
- }));
69
- const authorID = getAuthorID(comment);
70
- const authorName = authorID
71
- ? buildAuthorName(collaboratorsById.get(authorID))
72
- : '';
73
- const timestamp = comment.node.attrs.contributions?.[0].timestamp;
74
- const isOwn = authorID === user._id;
75
- const isResolveEnabled = isOwn
76
- ? can.resolveOwnComment
77
- : can.resolveOthersComment;
78
- const isActionsEnabled = isOwn
79
- ? can.handleOwnComments
80
- : can.handleOthersComments;
81
- const commentID = comment.node.attrs.id;
82
- const [showDeleteConfirmation, setShowDeleteConfirmation] = useState(false);
83
- const handleEdit = () => {
84
- setEditingCommentId(commentID);
85
- onSelect();
86
- };
87
- const handleSave = (contents) => {
88
- onSave({
89
- ...comment.node.attrs,
90
- contents,
91
- });
92
- setEditingCommentId(null);
93
- };
94
- const handleCancel = () => {
95
- setEditingCommentId(null);
96
- if (isNew) {
97
- onDelete(commentID);
98
- }
99
- };
100
- const handleToggleResolve = () => {
101
- onSave({
102
- ...comment.node.attrs,
103
- resolved: !comment.node.attrs.resolved,
104
- });
105
- };
106
- const handleDelete = () => {
107
- setShowDeleteConfirmation(true);
108
- onSelect();
109
- };
110
- const confirmDelete = () => {
111
- onDelete(commentID);
112
- setShowDeleteConfirmation(false);
113
- };
114
- const cancelDelete = () => {
115
- setShowDeleteConfirmation(false);
116
- };
117
- return (React.createElement(Card, null,
118
- React.createElement(CommentHeader, { "data-cy": "comment-header" },
119
- React.createElement(CommentMetadata, null,
120
- React.createElement(AuthorContainer, null, authorName ? (React.createElement(React.Fragment, null,
121
- React.createElement(AvatarIcon, { width: 20, height: 20 }),
122
- React.createElement(React.Fragment, null, authorName))) : (!isReply && (React.createElement(React.Fragment, null,
123
- React.createElement(SystemUserAvatarIcon, { width: 20, height: 20 }),
124
- React.createElement(React.Fragment, null, "System"))))),
125
- timestamp && React.createElement(Timestamp, { date: timestamp * 1000 }),
126
- numOfReplies !== 0 && React.createElement(RepliesCount, null,
127
- " ",
128
- numOfReplies,
129
- " ")),
130
- React.createElement(CommentActions, { comment: comment, isResolveEnabled: isResolveEnabled && !isReply, isActionsEnabled: isActionsEnabled && isEndOfThread, onDelete: handleDelete, onEdit: handleEdit, toggleResolve: handleToggleResolve })),
131
- comment.node.attrs.originalText && (React.createElement(CommentTarget, null, comment.node.attrs.originalText)),
132
- React.createElement(CommentBody, { comment: comment, isEditing: editingCommentId === commentID, onSave: handleSave, onCancel: handleCancel, onSelect: onSelect }),
133
- showDeleteConfirmation && (React.createElement(DeleteCommentConfirmation, { isReply: isReply, onCancel: cancelDelete, onConfirm: confirmDelete }))));
134
- };
135
- //# sourceMappingURL=CommentCard.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CommentCard.js","sourceRoot":"","sources":["../../../../src/components/comments/CommentCard.tsx"],"names":[],"mappings":"AAYA,OAAO,EACL,UAAU,EACV,YAAY,EACZ,oBAAoB,EACpB,cAAc,GACf,MAAM,0BAA0B,CAAA;A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BAAgB,EAAE,gBAAgB,IAAI,aAAa,EACnD,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,UAAU,EAClB,aAAa,EAAE,mBAAmB,GAClC,CACY;QACf,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,IAAI,CAClC,oBAAC,aAAa,QAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAiB,CACjE;QACD,oBAAC,WAAW,IACV,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,gBAAgB,KAAK,SAAS,EACzC,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,QAAQ,GAClB;QACD,sBAAsB,IAAI,CACzB,oBAAC,yBAAyB,IACxB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,aAAa,GACxB,CACH,CACI,CACR,CAAA;AACH,CAAC,CAAA"}
@@ -1,85 +0,0 @@
1
- /*!
2
- * The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
3
- *
4
- * Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
5
- *
6
- * The Original Code is manuscripts-frontend.
7
- *
8
- * The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
9
- *
10
- * All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
11
- */
12
- import { AttentionOrangeIcon, ButtonGroup, PrimaryButton, SecondaryButton, } from '@manuscripts/style-guide';
13
- import React, { useEffect, useRef } from 'react';
14
- import styled from 'styled-components';
15
- const MessageContainer = styled.div `
16
- display: flex;
17
- align-items: center;
18
- flex-grow: 1;
19
-
20
- svg {
21
- padding-left: 14px;
22
- }
23
- `;
24
- const CancelButton = styled(SecondaryButton) `
25
- padding: 4px ${(props) => props.theme.grid.unit * 3}px;
26
- font-size: 14px;
27
- `;
28
- const DeleteButton = styled(PrimaryButton) `
29
- padding: 4px ${(props) => props.theme.grid.unit * 3}px;
30
- margin-right: 16px;
31
- font-size: 14px;
32
- `;
33
- const Message = styled.div `
34
- font-weight: 700;
35
- color: #000;
36
- font-size: 14px;
37
- line-height: 16px;
38
- margin: 0 8px;
39
- `;
40
- const DeleteConfirmation = styled.div `
41
- border-top: 1px solid #e2e2e2;
42
- border-bottom: 1px solid #e2e2e2;
43
- box-shadow: 0px 4px 9px 0px rgba(0, 0, 0, 0.3);
44
- position: absolute;
45
- top: -9px;
46
- left: ${(props) => (props.isReply ? '-24px' : '-8px')};
47
- right: -8px;
48
- bottom: -16px;
49
- opacity: 0.95;
50
- display: flex;
51
- align-items: center;
52
- justify-content: center;
53
- background: #fafafa;
54
- z-index: 10;
55
- `;
56
- const Buttons = styled(ButtonGroup) `
57
- & button:not(:last-of-type) {
58
- margin-right: 4px;
59
- }
60
- `;
61
- export const DeleteCommentConfirmation = ({ isReply, onCancel, onConfirm }) => {
62
- const deleteConfirmationRef = useRef(null);
63
- useEffect(() => {
64
- const handleClickOutside = (e) => {
65
- if (e.target &&
66
- deleteConfirmationRef.current &&
67
- !deleteConfirmationRef.current.contains(e.target) &&
68
- !e.target.closest('.delete-button')) {
69
- onCancel();
70
- }
71
- };
72
- document.addEventListener('click', handleClickOutside);
73
- return () => {
74
- document.removeEventListener('click', handleClickOutside);
75
- };
76
- }, []); // eslint-disable-line react-hooks/exhaustive-deps
77
- return (React.createElement(DeleteConfirmation, { isReply: isReply, ref: deleteConfirmationRef },
78
- React.createElement(MessageContainer, null,
79
- React.createElement(AttentionOrangeIcon, null),
80
- React.createElement(Message, null, "Delete this comment?")),
81
- React.createElement(Buttons, null,
82
- React.createElement(CancelButton, { onClick: onCancel }, "Cancel"),
83
- React.createElement(DeleteButton, { onClick: onConfirm }, "Delete"))));
84
- };
85
- //# sourceMappingURL=DeleteCommentConfirmation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DeleteCommentConfirmation.js","sourceRoot":"","sources":["../../../../src/components/comments/DeleteCommentConfirmation.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,aAAa,EACb,eAAe,GAChB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAChD,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;CAQlC,CAAA;AAED,MAAM,YAAY,GAAG,MAAM,CAAC,eAAe,CAAC,CAAA;iBAC3B,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;;CAEpD,CAAA;AACD,MAAM,YAAY,GAAG,MAAM,CAAC,aAAa,CAAC,CAAA;iBACzB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;;;CAGpD,CAAA;AACD,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;CAMzB,CAAA;AAED,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAuB;;;;;;UAMlD,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;;;;;;;;;CAStD,CAAA;AAED,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,CAAC,CAAA;;;;CAIlC,CAAA;AAQD,MAAM,CAAC,MAAM,yBAAyB,GAElC,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE;IACvC,MAAM,qBAAqB,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;IAE1D,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,kBAAkB,GAAG,CAAC,CAAa,EAAE,EAAE;YAC3C,IACE,CAAC,CAAC,MAAM;gBACR,qBAAqB,CAAC,OAAO;gBAC7B,CAAC,qBAAqB,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAqB,CAAC;gBAChE,CAAE,CAAC,CAAC,MAAsB,CAAC,OAAO,CAAC,gBAAgB,CAAC,EACpD;gBACA,QAAQ,EAAE,CAAA;aACX;QACH,CAAC,CAAA;QACD,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAA;QACtD,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,mBAAmB,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAA;QAC3D,CAAC,CAAA;IACH,CAAC,EAAE,EAAE,CAAC,CAAA,CAAC,kDAAkD;IAEzD,OAAO,CACL,oBAAC,kBAAkB,IAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,qBAAqB;QAC9D,oBAAC,gBAAgB;YACf,oBAAC,mBAAmB,OAAG;YACvB,oBAAC,OAAO,+BAA+B,CACtB;QACnB,oBAAC,OAAO;YACN,oBAAC,YAAY,IAAC,OAAO,EAAE,QAAQ,aAAuB;YACtD,oBAAC,YAAY,IAAC,OAAO,EAAE,SAAS,aAAuB,CAC/C,CACS,CACtB,CAAA;AACH,CAAC,CAAA"}
@@ -1,91 +0,0 @@
1
- /*!
2
- * The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
3
- *
4
- * Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
5
- *
6
- * The Original Code is manuscripts-frontend.
7
- *
8
- * The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
9
- *
10
- * All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
11
- */
12
- import { ButtonGroup, PrimaryButton, TertiaryButton, } from '@manuscripts/style-guide';
13
- import React, { useMemo, useRef, useState } from 'react';
14
- import styled from 'styled-components';
15
- export const ReplyBox = ({ insertCommentReply, commentID, }) => {
16
- const [isTextBoxFocused, setIsTextBoxFocused] = useState(false);
17
- const [value, setValue] = useState('');
18
- const replyRef = useRef(null);
19
- const handleFocus = () => setIsTextBoxFocused(true);
20
- const reply = () => {
21
- if (replyRef.current) {
22
- insertCommentReply(commentID, replyRef.current.value);
23
- setValue('');
24
- replyRef.current.value = '';
25
- replyRef.current.style.height = '30px'; // Reset the height
26
- }
27
- };
28
- const handleCancel = () => {
29
- setIsTextBoxFocused(false);
30
- setValue('');
31
- if (replyRef.current) {
32
- replyRef.current.value = '';
33
- replyRef.current.style.height = '30px'; // Reset the height
34
- }
35
- };
36
- const disableSaveButton = useMemo(() => !value.length, [value]);
37
- const onTextChange = (e) => {
38
- setValue(e.target.value);
39
- if (replyRef.current) {
40
- replyRef.current.style.height = '30px'; // Reset the height
41
- replyRef.current.style.height = `${Math.min(replyRef.current.scrollHeight, 55)}px`; // Set the height based on content
42
- }
43
- };
44
- return (React.createElement(React.Fragment, null,
45
- React.createElement(TextBox, { "data-cy": "reply", placeholder: "Reply...", ref: replyRef, onChange: onTextChange, onFocus: handleFocus }),
46
- isTextBoxFocused && (React.createElement(Actions, { "data-cy": "reply-actions" },
47
- React.createElement(TertiaryButton, { onClick: handleCancel }, "Cancel"),
48
- React.createElement(PrimaryButton, { onClick: reply, disabled: disableSaveButton }, "Reply")))));
49
- };
50
- const TextBox = styled.textarea `
51
- cursor: text;
52
- font-family: ${(props) => props.theme.font.family.sans};
53
- color: ${(props) => props.theme.colors.text.primary};
54
- margin: ${(props) => props.theme.grid.unit * 2}px 0;
55
- resize: none;
56
-
57
- width: 100%;
58
-
59
- height: 30px;
60
- max-height: 55px;
61
-
62
- outline: 0;
63
- border: 1px solid #e2e2e2;
64
- border-radius: 6px;
65
-
66
- &:focus {
67
- background: #f2fbfc;
68
- border: 1px solid #bce7f6;
69
- border-radius: 6px;
70
- }
71
-
72
- box-sizing: border-box;
73
- padding: 3px 16px 3px 16px;
74
- font-style: normal;
75
- font-weight: 400;
76
- font-size: 14px;
77
- line-height: 24px;
78
- overflow: hidden;
79
- `;
80
- const Actions = styled(ButtonGroup) `
81
- & button:not(:last-of-type) {
82
- margin-right: 4px;
83
- }
84
- & ${TertiaryButton} {
85
- &:hover {
86
- background-color: inherit !important;
87
- border-color: transparent !important;
88
- }
89
- }
90
- `;
91
- //# sourceMappingURL=ReplyBox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReplyBox.js","sourceRoot":"","sources":["../../../../src/components/comments/ReplyBox.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,WAAW,EACX,aAAa,EACb,cAAc,GACf,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,EAAe,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACrE,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAOtC,MAAM,CAAC,MAAM,QAAQ,GAA4B,CAAC,EAChD,kBAAkB,EAClB,SAAS,GACV,EAAE,EAAE;IACH,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC/D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAA;IACtC,MAAM,QAAQ,GAAG,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Y,EAC7B,EAAE,CACH,IAAI,CAAA,CAAC,kCAAkC;SACzC;IACH,CAAC,CAAA;IAED,OAAO,CACL;QACE,oBAAC,OAAO,eACE,OAAO,EACf,WAAW,EAAC,UAAU,EACtB,GAAG,EAAE,QAAQ,EACb,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,WAAW,GACpB;QACD,gBAAgB,IAAI,CACnB,oBAAC,OAAO,eAAS,eAAe;YAC9B,oBAAC,cAAc,IAAC,OAAO,EAAE,YAAY,aAAyB;YAC9D,oBAAC,aAAa,IAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,iBAAiB,YAE1C,CACR,CACX,CACA,CACJ,CAAA;AACH,CAAC,CAAA;AACD,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAA;;iBAEd,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI;WAC7C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO;YACzC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;CAyB/C,CAAA;AAED,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,CAAC,CAAA;;;;MAI7B,cAAc;;;;;;CAMnB,CAAA"}
@@ -1,27 +0,0 @@
1
- /*!
2
- * The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
3
- *
4
- * Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
5
- *
6
- * The Original Code is manuscripts-frontend.
7
- *
8
- * The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
9
- *
10
- * All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
11
- */
12
- import { Comment, CommentAttrs } from '@manuscripts/body-editor';
13
- import React from 'react';
14
- interface CommentCardProps {
15
- comment: Comment;
16
- isReply: boolean;
17
- numOfReplies: number;
18
- isNew: boolean;
19
- isEndOfThread: boolean;
20
- editingCommentId: string | null;
21
- setEditingCommentId: (id: string | null) => void;
22
- onSave: (comment: CommentAttrs) => void;
23
- onDelete: (id: string) => void;
24
- onSelect: () => void;
25
- }
26
- export declare const CommentCard: React.FC<CommentCardProps>;
27
- export {};
@@ -1,19 +0,0 @@
1
- /*!
2
- * The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
3
- *
4
- * Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
5
- *
6
- * The Original Code is manuscripts-frontend.
7
- *
8
- * The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
9
- *
10
- * All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
11
- */
12
- import React from 'react';
13
- interface DeleteCommentConfirmationProps {
14
- isReply: boolean;
15
- onCancel: () => void;
16
- onConfirm: () => void;
17
- }
18
- export declare const DeleteCommentConfirmation: React.FC<DeleteCommentConfirmationProps>;
19
- export {};
@@ -1,18 +0,0 @@
1
- /*!
2
- * The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
3
- *
4
- * Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
5
- *
6
- * The Original Code is manuscripts-frontend.
7
- *
8
- * The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
9
- *
10
- * All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
11
- */
12
- import React from 'react';
13
- interface ReplyBoxProps {
14
- insertCommentReply: (target: string, contents: string) => void;
15
- commentID: string;
16
- }
17
- export declare const ReplyBox: React.FC<ReplyBoxProps>;
18
- export {};