@manuscripts/article-editor 3.4.3-LEAN-4053.2 → 3.4.3-LEAN-3894.0
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/CommentActions.js +11 -7
- package/dist/cjs/components/comments/CommentActions.js.map +1 -1
- package/dist/cjs/components/comments/CommentBody.js +10 -6
- package/dist/cjs/components/comments/CommentBody.js.map +1 -1
- package/dist/cjs/components/comments/CommentCard.js +165 -0
- package/dist/cjs/components/comments/CommentCard.js.map +1 -0
- package/dist/cjs/components/comments/CommentResolveButton.js +1 -1
- package/dist/cjs/components/comments/CommentThread.js +83 -88
- package/dist/cjs/components/comments/CommentThread.js.map +1 -1
- package/dist/cjs/components/comments/CommentsPanel.js +33 -10
- package/dist/cjs/components/comments/CommentsPanel.js.map +1 -1
- package/dist/cjs/components/comments/DeleteCommentConfirmation.js +115 -0
- package/dist/cjs/components/comments/DeleteCommentConfirmation.js.map +1 -0
- package/dist/cjs/components/comments/ReplyBox.js +121 -0
- package/dist/cjs/components/comments/ReplyBox.js.map +1 -0
- package/dist/cjs/lib/change-handlers.js +2 -2
- package/dist/cjs/lib/change-handlers.js.map +1 -1
- package/dist/cjs/lib/comments.js +26 -5
- package/dist/cjs/lib/comments.js.map +1 -1
- package/dist/cjs/lib/node-content-retriever.js +24 -17
- package/dist/cjs/lib/node-content-retriever.js.map +1 -1
- package/dist/es/components/comments/CommentActions.js +11 -7
- package/dist/es/components/comments/CommentActions.js.map +1 -1
- package/dist/es/components/comments/CommentBody.js +11 -7
- package/dist/es/components/comments/CommentBody.js.map +1 -1
- package/dist/es/components/comments/CommentCard.js +135 -0
- package/dist/es/components/comments/CommentCard.js.map +1 -0
- package/dist/es/components/comments/CommentResolveButton.js +1 -1
- package/dist/es/components/comments/CommentThread.js +86 -91
- package/dist/es/components/comments/CommentThread.js.map +1 -1
- package/dist/es/components/comments/CommentsPanel.js +35 -12
- package/dist/es/components/comments/CommentsPanel.js.map +1 -1
- package/dist/es/components/comments/DeleteCommentConfirmation.js +85 -0
- package/dist/es/components/comments/DeleteCommentConfirmation.js.map +1 -0
- package/dist/es/components/comments/ReplyBox.js +91 -0
- package/dist/es/components/comments/ReplyBox.js.map +1 -0
- package/dist/es/lib/change-handlers.js +2 -2
- package/dist/es/lib/change-handlers.js.map +1 -1
- package/dist/es/lib/comments.js +23 -3
- package/dist/es/lib/comments.js.map +1 -1
- package/dist/es/lib/node-content-retriever.js +25 -18
- package/dist/es/lib/node-content-retriever.js.map +1 -1
- package/dist/types/components/comments/CommentCard.d.ts +27 -0
- package/dist/types/components/comments/CommentThread.d.ts +3 -2
- package/dist/types/components/comments/DeleteCommentConfirmation.d.ts +19 -0
- package/dist/types/components/comments/ReplyBox.d.ts +18 -0
- package/dist/types/lib/comments.d.ts +4 -3
- package/dist/types/lib/node-content-retriever.d.ts +6 -2
- package/package.json +4 -4
@@ -0,0 +1,91 @@
|
|
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
|
@@ -0,0 +1 @@
|
|
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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AA,CAAC,mBAAmB;YAC1D,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CACzC,QAAQ,CAAC,OAAO,CAAC,YAAY,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"}
|
@@ -28,14 +28,14 @@ export const handleNodeChange = (suggestion, view, doc, dataTracked) => {
|
|
28
28
|
return {
|
29
29
|
operation,
|
30
30
|
nodeName,
|
31
|
-
content: nodeContentRetriever.getInlineFootnoteContent(
|
31
|
+
content: nodeContentRetriever.getInlineFootnoteContent(doc, node.attrs),
|
32
32
|
};
|
33
33
|
}
|
34
34
|
case schema.nodes.footnote: {
|
35
35
|
return {
|
36
36
|
operation,
|
37
37
|
nodeName,
|
38
|
-
content: nodeContentRetriever.getFootnoteContent(
|
38
|
+
content: nodeContentRetriever.getFootnoteContent(node),
|
39
39
|
};
|
40
40
|
}
|
41
41
|
case schema.nodes.contributor: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"change-handlers.js","sourceRoot":"","sources":["../../../src/lib/change-handlers.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAE1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAA;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AASvC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,UAAsB,EACtB,IAAS,EACT,WAAgB,EACI,EAAE;IACtB,MAAM,cAAc,GAAG,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,CAAA;IACvE,IAAI,QAAQ,CAAA;IACZ,IAAI,cAAc,EAAE;QAClB,MAAM,cAAc,GAAG,SAAS,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,cAAc,EAAE,IAAI,CAAA;QAC5E,QAAQ;YACN,cAAc,KAAK,MAAM,CAAC,KAAK,CAAC,SAAS;gBACvC,CAAC,CAAC,MAAM;gBACR,CAAC,CAAC,cAAc,GAAG,OAAO,CAAA;KAC/B;IAED,OAAO;QACL,SAAS,EAAE,oBAAoB,CAAC,WAAW,CAAC,SAAS,CAAC;QACtD,QAAQ,EAAE,QAAQ,IAAI,UAAU,CAAC,QAAQ,CAAC,IAAI;QAC9C,OAAO,EAAE,UAAU,CAAC,IAAI;KACzB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,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AC,KAAK,CAAC,QAAQ,KAAK,8BAA8B;gBACpD,CAAC,CAAC,YAAY;gBACd,CAAC,CAAC,SAAS,CAAA;YACf,OAAO;gBACL,SAAS;gBACT,QAAQ;gBACR,OAAO,EAAE,oBAAoB,CAAC,oBAAoB,CAAC,IAAI,CAAC;aACzD,CAAA;SACF;QACD,KAAK,MAAM,CAAC,KAAK,CAAC,IAAI;YACpB,OAAO;gBACL,SAAS;gBACT,QAAQ;gBACR,OAAO,EAAE,qCAAqC,oBAAoB,CAAC,oBAAoB,CACrF,IAAI,CACL,SAAS;aACX,CAAA;QACH;YACE,OAAO;gBACL,SAAS;gBACT,QAAQ;gBACR,OAAO,EAAE,oBAAoB,CAAC,kBAAkB,CAAC,IAAI,CAAC;aACvD,CAAA;KACJ;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAgB,EAAE;IACnD,OAAO;QACL,SAAS,EAAE,EAAE;QACb,QAAQ,EAAE,EAAE;QACZ,OAAO,EAAE,iBAAiB;KAC3B,CAAA;AACH,CAAC,CAAA"}
|
package/dist/es/lib/comments.js
CHANGED
@@ -1,3 +1,15 @@
|
|
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 { isReply } from '@manuscripts/body-editor';
|
1
13
|
export const getAuthorID = (comment) => {
|
2
14
|
const contributions = comment.node.attrs.contributions;
|
3
15
|
if (!contributions?.length) {
|
@@ -5,11 +17,14 @@ export const getAuthorID = (comment) => {
|
|
5
17
|
}
|
6
18
|
return contributions[0].profileID;
|
7
19
|
};
|
8
|
-
export const
|
9
|
-
return comments
|
20
|
+
export const buildThreads = (comments, newCommentID) => {
|
21
|
+
return comments
|
22
|
+
.filter((c) => !isReply(c)) // Filter out replies
|
23
|
+
.map((c) => ({
|
10
24
|
comment: c,
|
11
25
|
isNew: newCommentID === c.node.attrs.id,
|
12
|
-
|
26
|
+
replies: comments.filter((reply) => reply.node.attrs.target === c.node.attrs.id // Find replies for each comment
|
27
|
+
),
|
13
28
|
}));
|
14
29
|
};
|
15
30
|
export const buildAuthorName = (user) => {
|
@@ -20,4 +35,9 @@ export const buildAuthorName = (user) => {
|
|
20
35
|
.filter(Boolean)
|
21
36
|
.join(' ');
|
22
37
|
};
|
38
|
+
export const commentsByTime = (a, b) => {
|
39
|
+
const aTimestamp = a.node.attrs.contributions?.[0].timestamp || 0;
|
40
|
+
const bTimestamp = b.node.attrs.contributions?.[0].timestamp || 0;
|
41
|
+
return aTimestamp - bTimestamp;
|
42
|
+
};
|
23
43
|
//# sourceMappingURL=comments.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"comments.js","sourceRoot":"","sources":["../../../src/lib/comments.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"comments.js","sourceRoot":"","sources":["../../../src/lib/comments.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAW,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAS3D,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,OAAgB,EAAE,EAAE;IAC9C,MAAM,aAAa,GAAG,OAAO,CAAC,IAAI,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AM,UAAU,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,CAAA;IACjE,OAAO,UAAU,GAAG,UAAU,CAAA;AAChC,CAAC,CAAA"}
|
@@ -9,7 +9,7 @@
|
|
9
9
|
*
|
10
10
|
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
|
11
11
|
*/
|
12
|
-
import { bibliographyPluginKey,
|
12
|
+
import { bibliographyPluginKey, footnotesPluginKey, metadata, objectsPluginKey, } from '@manuscripts/body-editor';
|
13
13
|
import { isElementNodeType, isSectionNodeType, schema, } from '@manuscripts/transform';
|
14
14
|
import domPurify from 'dompurify';
|
15
15
|
export class NodeTextContentRetriever {
|
@@ -87,30 +87,37 @@ export class NodeTextContentRetriever {
|
|
87
87
|
const target = pluginState?.get(node.attrs.id);
|
88
88
|
return target?.label || '';
|
89
89
|
}
|
90
|
+
/**
|
91
|
+
* Finds a footnote node by its ID.
|
92
|
+
*/
|
93
|
+
findFootnoteById(doc, id) {
|
94
|
+
let footnoteNode = null;
|
95
|
+
doc.descendants((node) => {
|
96
|
+
if (node.type === schema.nodes.footnote && node.attrs.id === id) {
|
97
|
+
footnoteNode = node;
|
98
|
+
return false;
|
99
|
+
}
|
100
|
+
return !footnoteNode;
|
101
|
+
});
|
102
|
+
return footnoteNode;
|
103
|
+
}
|
90
104
|
/**
|
91
105
|
* Retrieves the inline footnote content.
|
92
106
|
*/
|
93
|
-
getInlineFootnoteContent(
|
94
|
-
const
|
95
|
-
|
96
|
-
|
97
|
-
}
|
98
|
-
//@ts-ignore
|
99
|
-
const footnote = findNodeByID(state.doc, rid).node;
|
100
|
-
if (!footnote) {
|
101
|
-
return '';
|
102
|
-
}
|
103
|
-
const label = getFootnoteLabel(state, footnote);
|
104
|
-
const text = footnote.textContent ?? '';
|
105
|
-
return `<sup class="footnote-decoration">${label}</sup>${text}`;
|
107
|
+
getInlineFootnoteContent(doc, attrs) {
|
108
|
+
const footnote = attrs.rids && attrs.rids.length > 0
|
109
|
+
? this.findFootnoteById(doc, attrs.rids[0])
|
110
|
+
: null;
|
111
|
+
return `<sup class="footnote-decoration">${attrs.contents || ''}</sup>${footnote ? footnote.textContent : ''}`;
|
106
112
|
}
|
107
113
|
/**
|
108
114
|
* Retrieves the text content of a footnote node with decoration.
|
109
115
|
*/
|
110
|
-
getFootnoteContent(
|
111
|
-
const
|
112
|
-
const
|
113
|
-
|
116
|
+
getFootnoteContent(node) {
|
117
|
+
const footnotesPlugin = footnotesPluginKey.get(this.state);
|
118
|
+
const pluginState = footnotesPlugin?.getState(this.state);
|
119
|
+
const decorationText = pluginState?.labels.get(node.attrs.id) || '';
|
120
|
+
return `<sup class="footnote-decoration">${decorationText}</sup>${node.textContent || this.getNodeTextContent(node)}`;
|
114
121
|
}
|
115
122
|
}
|
116
123
|
//# sourceMappingURL=node-content-retriever.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"node-content-retriever.js","sourceRoot":"","sources":["../../../src/lib/node-content-retriever.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAEL,qBAAqB,EACrB,
|
1
|
+
{"version":3,"file":"node-content-retriever.js","sourceRoot":"","sources":["../../../src/lib/node-content-retriever.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAEL,qBAAqB,EACrB,kBAAkB,EAClB,QAAQ,EACR,gBAAgB,GACjB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EAGjB,MAAM,GACP,MAAM,wBAAwB,CAAA;AAC/B,OAAO,SAAS,MAAM,WAAW,CAAA;AACjC,MAAM,OAAO,wBAAwB;IAGnC,YAAY,KAA4B;QACtC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;IAED;;OAEG;IACI,kBAAkB,CAAC,IAAoB;QAC5C,IAAI,WA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K,CAAC,CAAA;QACzD,MAAM,cAAc,GAAG,WAAW,EAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,CAAA;QACnE,OAAO,oCAAoC,cAAc,SACvD,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAClD,EAAE,CAAA;IACJ,CAAC;CACF"}
|
@@ -0,0 +1,27 @@
|
|
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 {};
|
@@ -11,12 +11,13 @@
|
|
11
11
|
*/
|
12
12
|
import { CommentAttrs } from '@manuscripts/body-editor';
|
13
13
|
import React from 'react';
|
14
|
-
import {
|
14
|
+
import { Thread } from '../../lib/comments';
|
15
15
|
export interface CommentThreadProps {
|
16
|
-
|
16
|
+
thread: Thread;
|
17
17
|
isSelected: boolean;
|
18
18
|
onSelect: () => void;
|
19
19
|
onSave: (comment: CommentAttrs) => void;
|
20
20
|
onDelete: (id: string) => void;
|
21
|
+
insertCommentReply: (target: string, contents: string) => void;
|
21
22
|
}
|
22
23
|
export declare const CommentThread: React.ForwardRefExoticComponent<CommentThreadProps & React.RefAttributes<HTMLDivElement>>;
|
@@ -0,0 +1,19 @@
|
|
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 {};
|
@@ -0,0 +1,18 @@
|
|
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 {};
|
@@ -11,11 +11,12 @@
|
|
11
11
|
*/
|
12
12
|
import { Comment } from '@manuscripts/body-editor';
|
13
13
|
import { UserProfile } from '@manuscripts/json-schema';
|
14
|
-
export type
|
14
|
+
export type Thread = {
|
15
15
|
comment: Comment;
|
16
16
|
isNew: boolean;
|
17
|
-
|
17
|
+
replies: Comment[];
|
18
18
|
};
|
19
19
|
export declare const getAuthorID: (comment: Comment) => string | undefined;
|
20
|
-
export declare const
|
20
|
+
export declare const buildThreads: (comments: Comment[], newCommentID?: string) => Thread[];
|
21
21
|
export declare const buildAuthorName: (user: UserProfile | undefined) => string;
|
22
|
+
export declare const commentsByTime: (a: Comment, b: Comment) => number;
|
@@ -22,12 +22,16 @@ export declare class NodeTextContentRetriever {
|
|
22
22
|
* Retrieves the label of a figure node.
|
23
23
|
*/
|
24
24
|
getFigureLabel(node: ManuscriptNode): string;
|
25
|
+
/**
|
26
|
+
* Finds a footnote node by its ID.
|
27
|
+
*/
|
28
|
+
private findFootnoteById;
|
25
29
|
/**
|
26
30
|
* Retrieves the inline footnote content.
|
27
31
|
*/
|
28
|
-
getInlineFootnoteContent(
|
32
|
+
getInlineFootnoteContent(doc: ManuscriptNode, attrs: Record<any, any>): string;
|
29
33
|
/**
|
30
34
|
* Retrieves the text content of a footnote node with decoration.
|
31
35
|
*/
|
32
|
-
getFootnoteContent(
|
36
|
+
getFootnoteContent(node: ManuscriptNode): string;
|
33
37
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@manuscripts/article-editor",
|
3
|
-
"version": "3.4.3-LEAN-
|
3
|
+
"version": "3.4.3-LEAN-3894.0",
|
4
4
|
"license": "CPAL-1.0",
|
5
5
|
"description": "React components for editing and viewing manuscripts",
|
6
6
|
"repository": "github:Atypon-OpenSource/manuscripts-article-editor",
|
@@ -35,12 +35,12 @@
|
|
35
35
|
"@fontsource/lato": "^4.5.10",
|
36
36
|
"@fontsource/pt-sans": "^4.5.11",
|
37
37
|
"@fontsource/pt-serif": "^4.5.11",
|
38
|
-
"@manuscripts/body-editor": "2.5.3-LEAN-
|
38
|
+
"@manuscripts/body-editor": "2.5.3-LEAN-3894.0",
|
39
39
|
"@manuscripts/json-schema": "2.2.11",
|
40
40
|
"@manuscripts/library": "1.3.11",
|
41
41
|
"@manuscripts/style-guide": "2.0.21",
|
42
|
-
"@manuscripts/track-changes-plugin": "1.8.
|
43
|
-
"@manuscripts/transform": "3.0.
|
42
|
+
"@manuscripts/track-changes-plugin": "1.8.0",
|
43
|
+
"@manuscripts/transform": "3.0.9",
|
44
44
|
"@popperjs/core": "^2.11.8",
|
45
45
|
"@reach/tabs": "^0.18.0",
|
46
46
|
"@types/use-sync-external-store": "^0.0.6",
|