@manuscripts/article-editor 1.15.13-LEAN-3524.0 → 1.16.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 +59 -0
- package/dist/cjs/components/comments/CommentActions.js.map +1 -0
- package/dist/cjs/components/comments/CommentBody.js +97 -0
- package/dist/cjs/components/comments/CommentBody.js.map +1 -0
- package/dist/cjs/components/comments/CommentResolveButton.js +56 -0
- package/dist/cjs/components/comments/CommentResolveButton.js.map +1 -0
- package/dist/cjs/components/comments/CommentThread.js +122 -0
- package/dist/cjs/components/comments/CommentThread.js.map +1 -0
- package/dist/cjs/components/comments/CommentsPanel.js +137 -0
- package/dist/cjs/components/comments/CommentsPanel.js.map +1 -0
- package/dist/cjs/components/{projects/CommentListPatterns.js → comments/CommentsPlaceholder.js} +15 -83
- package/dist/cjs/components/comments/CommentsPlaceholder.js.map +1 -0
- package/dist/cjs/components/projects/Inspector.js +17 -20
- package/dist/cjs/components/projects/Inspector.js.map +1 -1
- package/dist/cjs/config.js +0 -1
- package/dist/cjs/config.js.map +1 -1
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/lib/comments.js +29 -0
- package/dist/cjs/lib/comments.js.map +1 -0
- package/dist/cjs/lib/user.js +2 -2
- package/dist/cjs/lib/user.js.map +1 -1
- package/dist/cjs/postgres-data/buildData.js +0 -1
- package/dist/cjs/postgres-data/buildData.js.map +1 -1
- package/dist/cjs/store/Store.js.map +1 -1
- package/dist/es/components/comments/CommentActions.js +52 -0
- package/dist/es/components/comments/CommentActions.js.map +1 -0
- package/dist/es/components/comments/CommentBody.js +67 -0
- package/dist/es/components/comments/CommentBody.js.map +1 -0
- package/dist/es/components/comments/CommentResolveButton.js +49 -0
- package/dist/es/components/comments/CommentResolveButton.js.map +1 -0
- package/dist/es/components/comments/CommentThread.js +93 -0
- package/dist/es/components/comments/CommentThread.js.map +1 -0
- package/dist/es/components/comments/CommentsPanel.js +107 -0
- package/dist/es/components/comments/CommentsPanel.js.map +1 -0
- package/dist/es/components/{projects/CommentListPatterns.js → comments/CommentsPlaceholder.js} +9 -53
- package/dist/es/components/comments/CommentsPlaceholder.js.map +1 -0
- package/dist/es/components/projects/Inspector.js +18 -21
- package/dist/es/components/projects/Inspector.js.map +1 -1
- package/dist/es/config.js +0 -1
- package/dist/es/config.js.map +1 -1
- package/dist/es/index.js +5 -5
- package/dist/es/index.js.map +1 -1
- package/dist/es/lib/comments.js +23 -0
- package/dist/es/lib/comments.js.map +1 -0
- package/dist/es/lib/user.js +2 -2
- package/dist/es/lib/user.js.map +1 -1
- package/dist/es/postgres-data/buildData.js +0 -1
- package/dist/es/postgres-data/buildData.js.map +1 -1
- package/dist/es/store/Store.js.map +1 -1
- package/dist/types/components/comments/CommentActions.d.ts +24 -0
- package/dist/types/components/comments/CommentBody.d.ts +21 -0
- package/dist/types/components/comments/CommentResolveButton.d.ts +18 -0
- package/dist/types/components/comments/CommentThread.d.ts +22 -0
- package/dist/types/components/comments/CommentsPanel.d.ts +2 -0
- package/dist/types/components/{projects/CommentList.d.ts → comments/CommentsPlaceholder.d.ts} +3 -2
- package/dist/types/config.d.ts +0 -1
- package/dist/types/{hooks/use-comment-manager.d.ts → lib/comments.d.ts} +10 -20
- package/dist/types/lib/user.d.ts +3 -6
- package/dist/types/store/Store.d.ts +3 -4
- package/package.json +3 -3
- package/dist/cjs/components/projects/CommentList.js +0 -144
- package/dist/cjs/components/projects/CommentList.js.map +0 -1
- package/dist/cjs/components/projects/CommentListPatterns.js.map +0 -1
- package/dist/cjs/components/projects/CommentsTab.js +0 -41
- package/dist/cjs/components/projects/CommentsTab.js.map +0 -1
- package/dist/cjs/hooks/use-comment-manager.js +0 -103
- package/dist/cjs/hooks/use-comment-manager.js.map +0 -1
- package/dist/es/components/projects/CommentList.js +0 -114
- package/dist/es/components/projects/CommentList.js.map +0 -1
- package/dist/es/components/projects/CommentListPatterns.js.map +0 -1
- package/dist/es/components/projects/CommentsTab.js +0 -34
- package/dist/es/components/projects/CommentsTab.js.map +0 -1
- package/dist/es/hooks/use-comment-manager.js +0 -99
- package/dist/es/hooks/use-comment-manager.js.map +0 -1
- package/dist/types/components/projects/CommentListPatterns.d.ts +0 -34
- package/dist/types/components/projects/CommentsTab.d.ts +0 -7
|
@@ -1,114 +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) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
-
*/
|
|
12
|
-
import { commentsKey, isNodeComment, setCommentSelection, } from '@manuscripts/body-editor';
|
|
13
|
-
import { CommentTarget, CommentWrapper, NoteBodyContainer, ReplyBodyContainer, usePermissions, } from '@manuscripts/style-guide';
|
|
14
|
-
import { buildKeyword } from '@manuscripts/transform';
|
|
15
|
-
import { NodeSelection, TextSelection } from 'prosemirror-state';
|
|
16
|
-
import React, { useCallback, useState } from 'react';
|
|
17
|
-
import styled from 'styled-components';
|
|
18
|
-
import { default as useCommentOperation, useCommentLabel, } from '../../hooks/use-comment-manager';
|
|
19
|
-
import { useStore } from '../../store';
|
|
20
|
-
import * as Pattern from './CommentListPatterns';
|
|
21
|
-
import { HighlightedText } from './HighlightedText';
|
|
22
|
-
const scrollIntoView = (element) => {
|
|
23
|
-
const rect = element.getBoundingClientRect();
|
|
24
|
-
if (rect.bottom > window.innerHeight || rect.top < 150) {
|
|
25
|
-
element.scrollIntoView();
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
export const CommentList = () => {
|
|
29
|
-
const [{ editor, selectedCommentKey, newCommentID, user, collaborators, collaboratorsById, keywords, saveTrackModel, },] = useStore((store) => ({
|
|
30
|
-
editor: store.editor,
|
|
31
|
-
selectedCommentKey: store.selectedCommentKey,
|
|
32
|
-
user: store.user,
|
|
33
|
-
collaborators: store.collaborators || new Map(),
|
|
34
|
-
collaboratorsById: store.collaboratorsById,
|
|
35
|
-
//removed from the store but left here to limit scope of changes.
|
|
36
|
-
keywords: new Map(),
|
|
37
|
-
manuscriptID: store.manuscriptID,
|
|
38
|
-
saveTrackModel: store.saveTrackModel,
|
|
39
|
-
newCommentID: store.newCommentID,
|
|
40
|
-
}));
|
|
41
|
-
const { state, view } = editor;
|
|
42
|
-
const selectedRef = useCallback((n) => {
|
|
43
|
-
if (n !== null) {
|
|
44
|
-
scrollIntoView(n);
|
|
45
|
-
}
|
|
46
|
-
}, []);
|
|
47
|
-
const getComment = (id) => {
|
|
48
|
-
if (!id) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
const com = commentsKey.getState(state);
|
|
52
|
-
return com?.comments.get(id);
|
|
53
|
-
};
|
|
54
|
-
const setSelectedCommentID = (id) => {
|
|
55
|
-
const comment = getComment(id);
|
|
56
|
-
if (!comment || !view) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
const tr = state.tr;
|
|
60
|
-
setCommentSelection(tr, comment.key, id, false);
|
|
61
|
-
if (isNodeComment(comment)) {
|
|
62
|
-
tr.setSelection(NodeSelection.create(state.doc, comment.target.pos));
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
const range = comment.range;
|
|
66
|
-
const from = range.pos;
|
|
67
|
-
const to = from + range.size;
|
|
68
|
-
tr.setSelection(TextSelection.create(state.doc, from, to));
|
|
69
|
-
}
|
|
70
|
-
tr.scrollIntoView();
|
|
71
|
-
view.focus();
|
|
72
|
-
view.dispatch(tr);
|
|
73
|
-
};
|
|
74
|
-
const createKeyword = useCallback((name) => saveTrackModel(buildKeyword(name)), [saveTrackModel]);
|
|
75
|
-
const [commentFilter, setCommentFilter] = useState(Pattern.CommentFilter.ALL);
|
|
76
|
-
const { comments, saveComment, setResolved, createReply, deleteComment } = useCommentOperation();
|
|
77
|
-
const commentsLabels = useCommentLabel();
|
|
78
|
-
const onFocusOut = (id, content) => {
|
|
79
|
-
if (newCommentID === id && content.length < 1) {
|
|
80
|
-
deleteComment(id);
|
|
81
|
-
}
|
|
82
|
-
return true;
|
|
83
|
-
};
|
|
84
|
-
const isSelected = (comment) => {
|
|
85
|
-
const com = commentsKey.getState(state);
|
|
86
|
-
return selectedCommentKey === com?.comments.get(comment._id)?.key;
|
|
87
|
-
};
|
|
88
|
-
const can = usePermissions();
|
|
89
|
-
if (!comments.length) {
|
|
90
|
-
return React.createElement(Pattern.EmptyCommentsListPlaceholder, null);
|
|
91
|
-
}
|
|
92
|
-
return (React.createElement(React.Fragment, null,
|
|
93
|
-
React.createElement(Pattern.SeeResolvedCheckbox, { isEmpty: !comments.length, commentFilter: commentFilter, setCommentFilter: setCommentFilter }),
|
|
94
|
-
React.createElement(Container, { className: 'comments-group' }, comments.map(([target, commentData]) => {
|
|
95
|
-
// TODO: move this into a child component?
|
|
96
|
-
const selectedNoteData = commentFilter === Pattern.CommentFilter.ALL
|
|
97
|
-
? commentData
|
|
98
|
-
: commentData.filter((note) => !note.comment.resolved);
|
|
99
|
-
return (React.createElement(CommentTarget, { key: target, isSelected: false }, selectedNoteData.map(({ comment, children }) => (React.createElement(Pattern.Thread, { key: comment._id },
|
|
100
|
-
React.createElement(NoteBodyContainer, { id: `${comment._id}-card`, isSelected: isSelected(comment), ref: isSelected(comment) ? selectedRef : null, isNew: comment._id === newCommentID },
|
|
101
|
-
React.createElement(CommentWrapper, { comment: comment, createKeyword: createKeyword, deleteComment: deleteComment, getCollaborator: (id) => collaboratorsById?.get(id), getKeyword: (id) => keywords.get(id), listCollaborators: () => Array.from(collaborators.values()), listKeywords: () => [], saveComment: saveComment, scrollIntoHighlight: () => setSelectedCommentID(comment._id), onFocusOut: onFocusOut, handleCreateReply: createReply, can: can, currentUserId: user._id, handleSetResolved: () => setResolved(comment), isNew: comment._id === newCommentID },
|
|
102
|
-
React.createElement(HighlightedText, { state: state, commentsLabels: commentsLabels, comment: comment, onClick: () => setSelectedCommentID(comment._id) }))),
|
|
103
|
-
children.map((comment) => (React.createElement(ReplyBodyContainer, { key: comment._id },
|
|
104
|
-
React.createElement(CommentWrapper, { comment: comment, createKeyword: createKeyword, deleteComment: deleteComment, getCollaborator: (id) => collaboratorsById?.get(id), getKeyword: (key) => keywords.get(key), isReply: true, listCollaborators: () => Array.from(collaborators.values()), listKeywords: () => [], saveComment: saveComment, handleCreateReply: createReply, can: can, currentUserId: user._id, isNew: comment._id === newCommentID })))))))));
|
|
105
|
-
}))));
|
|
106
|
-
};
|
|
107
|
-
const Container = styled(Pattern.Container) `
|
|
108
|
-
.selected-comment {
|
|
109
|
-
border: 1px solid ${(props) => props.theme.colors.border.primary};
|
|
110
|
-
border-left: 4px solid ${(props) => props.theme.colors.border.primary};
|
|
111
|
-
background: ${(props) => props.theme.colors.background.selected};
|
|
112
|
-
}
|
|
113
|
-
`;
|
|
114
|
-
//# sourceMappingURL=CommentList.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CommentList.js","sourceRoot":"","sources":["../../../../src/components/projects/CommentList.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAEL,WAAW,EAEX,aAAa,EACb,mBAAmB,GACpB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EACL,aAAa,EA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AAiB,EAAE,GAAG,EAAE,CACtB,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,EAEpC,YAAY,EAAE,GAAG,EAAE,CAAC,EAAE,EACtB,WAAW,EAAE,WAAW,EACxB,iBAAiB,EAAE,WAAW,EAC9B,GAAG,EAAE,GAAG,EACR,aAAa,EAAE,IAAI,CAAC,GAAG,EACvB,KAAK,EAAE,OAAO,CAAC,GAAG,KAAK,YAAY,GACnC,CACiB,CACtB,CAAC,CACa,CAClB,CAAC,CACY,CACjB,CAAA;QACH,CAAC,CAAC,CACQ,CACG,CAClB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;;wBAEnB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO;6BACvC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO;kBACvD,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,QAAQ;;CAElE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CommentListPatterns.js","sourceRoot":"","sources":["../../../../src/components/projects/CommentListPatterns.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACvE,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAGlC,CAAA;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAA;;CAE/B,CAAA;AAED,MAAM,CAAC,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O,EAAC,aAAa,EACrB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B;IAElC,8BAAM,KAAK,EAAC,KAAK,EAAC,MAAM,EAAC,KAAK,EAAC,IAAI,EAAC,yBAAyB,GAAG;IAChE;QACE,iCACE,EAAE,EAAC,mBAAmB,EACtB,mBAAmB,EAAC,mBAAmB,EACvC,KAAK,EAAC,GAAG,EACT,MAAM,EAAC,GAAG;YAEV,6BAAK,SAAS,EAAC,kBAAkB,EAAC,SAAS,EAAC,mBAAmB,GAAG,CAC1D;QACV,+BACE,EAAE,EAAC,iBAAiB,EACpB,KAAK,EAAC,KAAK,EACX,MAAM,EAAC,KAAK,EACZ,SAAS,EAAC,w8hCAAw8hC,GACl9hC,CACG,CACH,CACP,CAAA"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { InspectorSection, ManuscriptNoteList, usePermissions, } from '@manuscripts/style-guide';
|
|
2
|
-
import { buildKeyword } from '@manuscripts/transform';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
|
-
import config from '../../config';
|
|
6
|
-
import { useStore } from '../../store';
|
|
7
|
-
import { CommentList } from './CommentList';
|
|
8
|
-
export const CommentsTab = ({ selected, editor }) => {
|
|
9
|
-
const [{ notes, user, collaborators, collaboratorsById, keywords, saveTrackModel, // saveTrackModel is only to be used for the models that are ProseMirror representable
|
|
10
|
-
deleteModel, },] = useStore((store) => ({
|
|
11
|
-
notes: store.notes,
|
|
12
|
-
user: store.user,
|
|
13
|
-
collaborators: store.collaborators || new Map(),
|
|
14
|
-
collaboratorsById: store.collaboratorsById,
|
|
15
|
-
keywords: new Map(),
|
|
16
|
-
saveTrackModel: store.saveTrackModel,
|
|
17
|
-
deleteModel: store.deleteModel,
|
|
18
|
-
}));
|
|
19
|
-
const createKeyword = (name) => saveTrackModel(buildKeyword(name));
|
|
20
|
-
const getCollaboratorById = (id) => collaboratorsById && collaboratorsById.get(id);
|
|
21
|
-
const getKeyword = (id) => keywords.get(id);
|
|
22
|
-
const listCollaborators = () => Array.from(collaborators.values());
|
|
23
|
-
const listKeywords = () => Array.from(keywords.values());
|
|
24
|
-
const can = usePermissions();
|
|
25
|
-
return (React.createElement(CommentsContainer, null,
|
|
26
|
-
config.features.commenting && (React.createElement(InspectorSection, { title: 'Comments', contentStyles: { margin: '0 25px 24px 0' } },
|
|
27
|
-
React.createElement(CommentList, null))),
|
|
28
|
-
config.features.productionNotes && (React.createElement(InspectorSection, { title: 'Notes', contentStyles: { margin: '0 25px 24px 0' } },
|
|
29
|
-
React.createElement(ManuscriptNoteList, { createKeyword: createKeyword, notes: notes || [], can: can, currentUserId: user?._id, getKeyword: getKeyword, listKeywords: listKeywords, selected: selected || null, getCollaboratorById: getCollaboratorById, listCollaborators: listCollaborators, saveModel: saveTrackModel, deleteModel: deleteModel, noteSource: 'EDITOR' })))));
|
|
30
|
-
};
|
|
31
|
-
const CommentsContainer = styled.div `
|
|
32
|
-
margin-top: ${(props) => props.theme.grid.unit * 4}px;
|
|
33
|
-
`;
|
|
34
|
-
//# sourceMappingURL=CommentsTab.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CommentsTab.js","sourceRoot":"","sources":["../../../../src/components/projects/CommentsTab.tsx"],"names":[],"mappings":"AAYA,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,GACf,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,YAAY,EAAY,MAAM,wBAAwB,CAAA;AAE/D,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,MAAM,MAAM,cAAc,CAAA;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,MAAM,CAAC,MAAM,WAAW,GAGnB,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE;I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E;YAE1C,oBAAC,WAAW,OAAG,CACE,CACpB;QACA,MAAM,CAAC,QAAQ,CAAC,eAAe,IAAI,CAClC,oBAAC,gBAAgB,IACf,KAAK,EAAE,OAAO,EACd,aAAa,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE;YAE1C,oBAAC,kBAAkB,IACjB,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAE,KAAK,IAAI,EAAE,EAClB,GAAG,EAAE,GAAG,EACR,aAAa,EAAE,IAAI,EAAE,GAAG,EACxB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAG,QAAqB,IAAI,IAAI,EACxC,mBAAmB,EAAE,mBAAmB,EACxC,iBAAiB,EAAE,iBAAiB,EACpC,SAAS,EAAE,cAAc,EACzB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,QAAQ,GACpB,CACe,CACpB,CACiB,CACrB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA;gBACpB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;CACnD,CAAA"}
|
|
@@ -1,99 +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) 2023 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
-
*/
|
|
12
|
-
import { ObjectTypes, } from '@manuscripts/json-schema';
|
|
13
|
-
import { buildCommentTree, } from '@manuscripts/style-guide';
|
|
14
|
-
import { getModelsByType } from '@manuscripts/transform';
|
|
15
|
-
import { useCallback, useMemo } from 'react';
|
|
16
|
-
import { useStore } from '../store';
|
|
17
|
-
/**
|
|
18
|
-
* Return CRUD callbacks for the comment_list
|
|
19
|
-
*/
|
|
20
|
-
export default () => {
|
|
21
|
-
const [{ doc, modelMap, saveModel, deleteModel }] = useStore((store) => ({
|
|
22
|
-
view: store.view,
|
|
23
|
-
doc: store.doc,
|
|
24
|
-
modelMap: store.trackModelMap,
|
|
25
|
-
saveModel: store.saveTrackModel,
|
|
26
|
-
deleteModel: store.deleteTrackModel,
|
|
27
|
-
}));
|
|
28
|
-
/**
|
|
29
|
-
* Combined new comment(unsaved) with the saved comment.
|
|
30
|
-
* and add replies for each comment, we do that in *buildCommentTree*
|
|
31
|
-
*/
|
|
32
|
-
const items = useMemo(() => {
|
|
33
|
-
const models = getModelsByType(modelMap, ObjectTypes.CommentAnnotation);
|
|
34
|
-
const tree = buildCommentTree(doc, models);
|
|
35
|
-
return Array.from(tree.entries());
|
|
36
|
-
}, [modelMap, doc]);
|
|
37
|
-
const saveComment = useCallback(async (comment) => {
|
|
38
|
-
await saveModel(comment);
|
|
39
|
-
return comment;
|
|
40
|
-
}, [saveModel]);
|
|
41
|
-
const setResolved = useCallback(async (comment) => await saveModel({
|
|
42
|
-
...comment,
|
|
43
|
-
resolved: !comment.resolved,
|
|
44
|
-
}), [saveModel]);
|
|
45
|
-
const createReply = useCallback((targetId) => {
|
|
46
|
-
// TODO:: create empty comment replay
|
|
47
|
-
}, []);
|
|
48
|
-
const deleteComment = useCallback((id) => {
|
|
49
|
-
deleteModel(id);
|
|
50
|
-
}, [deleteModel]);
|
|
51
|
-
return {
|
|
52
|
-
comments: items,
|
|
53
|
-
saveComment,
|
|
54
|
-
setResolved,
|
|
55
|
-
createReply,
|
|
56
|
-
deleteComment,
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* Return labels of block comment as we don't store them in DB, will build them based on:
|
|
61
|
-
* * element order for(figure, table) like **figure 1**
|
|
62
|
-
* * content of the element like citation
|
|
63
|
-
* * content one of it's children like section will use it's title(TODO)
|
|
64
|
-
*/
|
|
65
|
-
export const useCommentLabel = () => {
|
|
66
|
-
const [{ doc, modelMap }] = useStore((store) => ({
|
|
67
|
-
doc: store.doc,
|
|
68
|
-
modelMap: store.modelMap,
|
|
69
|
-
}));
|
|
70
|
-
return useMemo(() => {
|
|
71
|
-
const labelsMap = new Map();
|
|
72
|
-
let graphicalAbstractFigureId = undefined;
|
|
73
|
-
doc.descendants((node) => {
|
|
74
|
-
if (node.type.name === 'citation') {
|
|
75
|
-
labelsMap.set(node.attrs['rid'], node.attrs.contents.trim());
|
|
76
|
-
}
|
|
77
|
-
if (node.attrs['category'] === 'MPSectionCategory:abstract-graphical') {
|
|
78
|
-
node.forEach((node) => {
|
|
79
|
-
if (node.type.name === 'figure_element') {
|
|
80
|
-
graphicalAbstractFigureId = node.attrs['id'];
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
const setLabels = (label, elements, excludedElementId) => elements
|
|
86
|
-
.filter((element) => element !== excludedElementId)
|
|
87
|
-
.map((element, index) => labelsMap.set(element, `${label} ${++index}`));
|
|
88
|
-
const elementsOrders = getModelsByType(modelMap, ObjectTypes.ElementsOrder);
|
|
89
|
-
elementsOrders.map(({ elementType, elements }) => {
|
|
90
|
-
if (elementType === ObjectTypes.TableElement ||
|
|
91
|
-
elementType === ObjectTypes.FigureElement) {
|
|
92
|
-
const label = (elementType === ObjectTypes.FigureElement && 'Figure') || 'Table';
|
|
93
|
-
setLabels(label, elements, graphicalAbstractFigureId);
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
return labelsMap;
|
|
97
|
-
}, [doc, modelMap]);
|
|
98
|
-
};
|
|
99
|
-
//# sourceMappingURL=use-comment-manager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-comment-manager.js","sourceRoot":"","sources":["../../../src/hooks/use-comment-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAGL,WAAW,GACZ,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,gBAAgB,GAGjB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC;;GAEG;AACH,eAAe,GAAG,EAAE;IAClB,MAAM,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACvE,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,QAAQ,EAAE,KAAK,CAAC,aAAa;QAC7B,SAAS,EAAE,KAAK,CAAC,cAAc;QAC/B,WAAW,EAAE,KAAK,CAAC,gBAAgB;KACpC,CAAC,CAAC,CAAA;IAEH;;;OAGG;IACH,MAAM,KAAK,GAAG,OAAO,CAAiC,GAAG,EAAE;QACzD,MAAM,MAAM,GAAG,eAAe,CAC5B,QAAQ,EACR,WAAW,CAAC,iBAAiB,CAC9B,CAAA;QACD,MAAM,IAAI,GAAG,gBAAgB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;QAC1C,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC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,EAAE,yBAAyB,CAAC,CAAA;aACtD;QACH,CAAC,CAAC,CAAA;QAEF,OAAO,SAAS,CAAA;IAClB,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAA;AACrB,CAAC,CAAA"}
|
|
@@ -1,34 +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) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
-
*/
|
|
12
|
-
import React from 'react';
|
|
13
|
-
export declare const Container: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
14
|
-
export declare const Thread: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
15
|
-
export declare const Reply: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
16
|
-
export declare const PlaceholderContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
17
|
-
export declare const PlaceholderMessage: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
18
|
-
export declare const ActionHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
19
|
-
export declare const LabelText: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
20
|
-
export declare const Checkbox: import("styled-components").StyledComponent<"label", import("styled-components").DefaultTheme, {
|
|
21
|
-
disabled?: boolean | undefined;
|
|
22
|
-
}, never>;
|
|
23
|
-
export declare enum CommentFilter {
|
|
24
|
-
ALL = 0,
|
|
25
|
-
UNRESOLVED = 1
|
|
26
|
-
}
|
|
27
|
-
interface SeeResolvedCheckboxProps {
|
|
28
|
-
isEmpty: boolean;
|
|
29
|
-
commentFilter: CommentFilter;
|
|
30
|
-
setCommentFilter: (filter: CommentFilter) => void;
|
|
31
|
-
}
|
|
32
|
-
export declare const SeeResolvedCheckbox: React.FC<SeeResolvedCheckboxProps>;
|
|
33
|
-
export declare const EmptyCommentsListPlaceholder: React.FC;
|
|
34
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ContentNodeWithPos } from 'prosemirror-utils';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { useCreateEditor } from '../../hooks/use-create-editor';
|
|
4
|
-
export declare const CommentsTab: React.FC<{
|
|
5
|
-
selected?: ContentNodeWithPos | null;
|
|
6
|
-
editor: ReturnType<typeof useCreateEditor>;
|
|
7
|
-
}>;
|