@manuscripts/style-guide 1.12.16 → 1.13.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/RelativeDate.js +16 -4
- package/dist/cjs/index.js +0 -2
- package/dist/es/components/RelativeDate.js +16 -4
- package/dist/es/index.js +0 -2
- package/dist/types/components/RelativeDate.d.ts +4 -3
- package/dist/types/index.d.ts +0 -2
- package/package.json +1 -1
- package/dist/cjs/components/Comments/CommentActions.js +0 -98
- package/dist/cjs/components/Comments/CommentBody.js +0 -160
- package/dist/cjs/components/Comments/CommentTarget.js +0 -55
- package/dist/cjs/components/Comments/CommentUser.js +0 -76
- package/dist/cjs/components/Comments/CommentWrapper.js +0 -118
- package/dist/cjs/components/Comments/ResolveButton.js +0 -66
- package/dist/cjs/components/Comments/index.js +0 -21
- package/dist/cjs/components/ManuscriptNoteList.js +0 -210
- package/dist/es/components/Comments/CommentActions.js +0 -68
- package/dist/es/components/Comments/CommentBody.js +0 -131
- package/dist/es/components/Comments/CommentTarget.js +0 -29
- package/dist/es/components/Comments/CommentUser.js +0 -69
- package/dist/es/components/Comments/CommentWrapper.js +0 -88
- package/dist/es/components/Comments/ResolveButton.js +0 -59
- package/dist/es/components/Comments/index.js +0 -5
- package/dist/es/components/ManuscriptNoteList.js +0 -181
- package/dist/types/components/Comments/CommentActions.d.ts +0 -28
- package/dist/types/components/Comments/CommentBody.d.ts +0 -39
- package/dist/types/components/Comments/CommentTarget.d.ts +0 -21
- package/dist/types/components/Comments/CommentUser.d.ts +0 -23
- package/dist/types/components/Comments/CommentWrapper.d.ts +0 -26
- package/dist/types/components/Comments/ResolveButton.d.ts +0 -21
- package/dist/types/components/Comments/index.d.ts +0 -5
- package/dist/types/components/ManuscriptNoteList.d.ts +0 -45
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2020 Atypon Systems LLC
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
17
|
-
import styled from 'styled-components';
|
|
18
|
-
import { isSavedComment } from '../../lib/comments';
|
|
19
|
-
import { CommentActions } from './CommentActions';
|
|
20
|
-
import { CommentBody } from './CommentBody';
|
|
21
|
-
import { CommentUser } from './CommentUser';
|
|
22
|
-
const isOwn = (comment, userId) => {
|
|
23
|
-
var _a;
|
|
24
|
-
return comment.contributions
|
|
25
|
-
? (_a = comment.contributions) === null || _a === void 0 ? void 0 : _a.some((c) => c.profileID === userId)
|
|
26
|
-
: false;
|
|
27
|
-
};
|
|
28
|
-
export const CommentWrapper = ({ createKeyword, comment, can, currentUserId, getCollaborator, getKeyword, listCollaborators, listKeywords, saveComment, deleteComment, isReply, isNew, handleCreateReply, handleSetResolved, isProdNote, isSelected, handleRequestSelect, scrollIntoHighlight, onFocusOut, children, }) => {
|
|
29
|
-
const [isEditing, setIsEditing] = useState();
|
|
30
|
-
const threadRef = useRef(null);
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
if (isNew || isSelected) {
|
|
33
|
-
{
|
|
34
|
-
isNew && setIsEditing(true);
|
|
35
|
-
}
|
|
36
|
-
if (threadRef.current) {
|
|
37
|
-
setTimeout(() => {
|
|
38
|
-
var _a;
|
|
39
|
-
return (_a = threadRef.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
|
|
40
|
-
block: 'nearest',
|
|
41
|
-
inline: 'nearest',
|
|
42
|
-
});
|
|
43
|
-
}, 100);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}, [isNew, isSelected]);
|
|
47
|
-
const onTitleMouseDown = useCallback((e) => {
|
|
48
|
-
e.preventDefault();
|
|
49
|
-
handleRequestSelect && handleRequestSelect();
|
|
50
|
-
}, [handleRequestSelect]);
|
|
51
|
-
const onTitleKeyDown = useCallback((e) => {
|
|
52
|
-
if ([' ', 'Enter'].includes(e.key)) {
|
|
53
|
-
e.preventDefault();
|
|
54
|
-
handleRequestSelect && handleRequestSelect();
|
|
55
|
-
}
|
|
56
|
-
}, [handleRequestSelect]);
|
|
57
|
-
const isOwnComment = useMemo(() => isOwn(comment, currentUserId), [comment, currentUserId]);
|
|
58
|
-
return (React.createElement(Note, { "data-cy": "note", ref: threadRef, isSelected: isSelected },
|
|
59
|
-
React.createElement(NoteHeader, { "data-cy": "note-header" },
|
|
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
|
-
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
|
-
children,
|
|
63
|
-
React.createElement(CommentBody, { createKeyword: createKeyword, onFocusOut: onFocusOut, 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
|
-
};
|
|
65
|
-
const Note = styled.div `
|
|
66
|
-
& .note-actions {
|
|
67
|
-
opacity: 0;
|
|
68
|
-
${({ isSelected }) => isSelected && 'opacity: 1'}
|
|
69
|
-
transition: 0.1s ease-in-out opacity;
|
|
70
|
-
}
|
|
71
|
-
&:hover .note-actions {
|
|
72
|
-
opacity: 1;
|
|
73
|
-
}
|
|
74
|
-
`;
|
|
75
|
-
const NoteTitle = styled.button `
|
|
76
|
-
border: none;
|
|
77
|
-
background: transparent;
|
|
78
|
-
padding: 0;
|
|
79
|
-
text-align: left;
|
|
80
|
-
`;
|
|
81
|
-
const NoteHeader = styled.div `
|
|
82
|
-
display: flex;
|
|
83
|
-
justify-content: space-between;
|
|
84
|
-
align-items: center;
|
|
85
|
-
font-size: ${(props) => props.theme.font.size.normal};
|
|
86
|
-
margin-bottom: 16px;
|
|
87
|
-
padding: 0 16px;
|
|
88
|
-
`;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2021 Atypon Systems LLC
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import React from 'react';
|
|
17
|
-
import styled from 'styled-components';
|
|
18
|
-
import { CommentResolveIcon } from '../icons';
|
|
19
|
-
import { Tooltip } from '../Tooltip';
|
|
20
|
-
export const ResolveButton = ({ id, resolved, resolvedCallback }) => {
|
|
21
|
-
return (React.createElement(Container, null,
|
|
22
|
-
React.createElement(Button, { className: resolved ? 'resolved' : '', "data-tooltip-id": id, onClick: resolvedCallback },
|
|
23
|
-
React.createElement(CommentResolveIcon, null)),
|
|
24
|
-
React.createElement(Tooltip, { id: id, place: "bottom" }, (resolved && 'Unresolve') || 'Resolve')));
|
|
25
|
-
};
|
|
26
|
-
const Container = styled.div `
|
|
27
|
-
display: flex;
|
|
28
|
-
justify-content: space-between;
|
|
29
|
-
align-items: center;
|
|
30
|
-
margin-right: ${(props) => props.theme.grid.unit};
|
|
31
|
-
`;
|
|
32
|
-
const Button = styled.button `
|
|
33
|
-
display: flex;
|
|
34
|
-
align-items: center;
|
|
35
|
-
width: 24px;
|
|
36
|
-
height: 24px;
|
|
37
|
-
border-radius: 12px;
|
|
38
|
-
border: none;
|
|
39
|
-
background: #ffffff;
|
|
40
|
-
padding: 0;
|
|
41
|
-
cursor: pointer;
|
|
42
|
-
|
|
43
|
-
&.resolved {
|
|
44
|
-
background: #f2fbfc;
|
|
45
|
-
border: 1px solid #bce7f6;
|
|
46
|
-
path {
|
|
47
|
-
fill: #1a9bc7;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
&:not([disabled]):hover,
|
|
52
|
-
&:not([disabled]):active {
|
|
53
|
-
path {
|
|
54
|
-
fill: #1a9bc7;
|
|
55
|
-
}
|
|
56
|
-
background: #f2fbfc;
|
|
57
|
-
border: 1px solid #c9c9c9;
|
|
58
|
-
}
|
|
59
|
-
`;
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2020 Atypon Systems LLC
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
import { ObjectTypes, } from '@manuscripts/json-schema';
|
|
26
|
-
import { buildContribution, buildNote } from '@manuscripts/transform';
|
|
27
|
-
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
28
|
-
import styled from 'styled-components';
|
|
29
|
-
import { v4 as uuid } from 'uuid';
|
|
30
|
-
import { buildNoteTree, } from '../lib/comments';
|
|
31
|
-
import { IconTextButton } from './Button';
|
|
32
|
-
import { CheckboxField, CheckboxLabel } from './Checkbox';
|
|
33
|
-
import { CommentTarget } from './Comments/CommentTarget';
|
|
34
|
-
import { CommentWrapper } from './Comments/CommentWrapper';
|
|
35
|
-
import { AddIcon } from './icons';
|
|
36
|
-
import { RelativeDate } from './RelativeDate';
|
|
37
|
-
export const ManuscriptNoteList = React.memo(({ createKeyword, deleteModel, getCollaboratorById, currentUserId, displayName, getKeyword, listCollaborators, listKeywords, notes, noteSource, saveModel, selected, can, }) => {
|
|
38
|
-
const [newComment, setNewComment] = useState();
|
|
39
|
-
const [selectResolved, setSelectResolved] = useState(false);
|
|
40
|
-
const [noteTarget, setNoteTarget] = useState();
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
if (noteTarget && !newComment) {
|
|
43
|
-
const newComment = buildNote(noteTarget, noteSource);
|
|
44
|
-
newComment.displayName = displayName;
|
|
45
|
-
if (currentUserId) {
|
|
46
|
-
const contribution = buildContribution(currentUserId);
|
|
47
|
-
newComment.contributions = [contribution];
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
newComment.contributions = [];
|
|
51
|
-
}
|
|
52
|
-
setNewComment(newComment);
|
|
53
|
-
}
|
|
54
|
-
}, [noteTarget, currentUserId, displayName, newComment, noteSource]);
|
|
55
|
-
const items = useMemo(() => {
|
|
56
|
-
const combinedComments = [...notes];
|
|
57
|
-
if (newComment) {
|
|
58
|
-
combinedComments.push(newComment);
|
|
59
|
-
}
|
|
60
|
-
const commentsTreeMap = buildNoteTree(combinedComments);
|
|
61
|
-
return Array.from(commentsTreeMap.entries());
|
|
62
|
-
}, [notes, newComment]);
|
|
63
|
-
const handleAddNewNote = useCallback((event) => {
|
|
64
|
-
event.preventDefault();
|
|
65
|
-
setNoteTarget(ObjectTypes.ManuscriptNote + ':' + uuid().toUpperCase());
|
|
66
|
-
setSelectResolved(false);
|
|
67
|
-
}, [setNoteTarget]);
|
|
68
|
-
const deleteNote = useCallback((id) => {
|
|
69
|
-
return deleteModel(id).finally(() => {
|
|
70
|
-
if (newComment && newComment._id === id) {
|
|
71
|
-
setNoteTarget(undefined);
|
|
72
|
-
setNewComment(undefined);
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}, [deleteModel, newComment, setNoteTarget]);
|
|
76
|
-
const saveNote = useCallback((note) => {
|
|
77
|
-
return saveModel(note).then((note) => {
|
|
78
|
-
if (newComment && newComment._id === note._id) {
|
|
79
|
-
setNoteTarget(undefined);
|
|
80
|
-
setNewComment(undefined);
|
|
81
|
-
}
|
|
82
|
-
return note;
|
|
83
|
-
});
|
|
84
|
-
}, [newComment, setNoteTarget, saveModel]);
|
|
85
|
-
const isNew = useCallback((note) => {
|
|
86
|
-
return newComment ? newComment._id === note._id : false;
|
|
87
|
-
}, [newComment]);
|
|
88
|
-
const handleOnSelectChange = useCallback((e) => setSelectResolved(e.target.checked), []);
|
|
89
|
-
return (React.createElement(React.Fragment, null,
|
|
90
|
-
React.createElement(ActionHeader, { withAddButton: can.createNotes },
|
|
91
|
-
can.createNotes && (React.createElement(AddNoteButton, { onClick: handleAddNewNote },
|
|
92
|
-
"Add ",
|
|
93
|
-
React.createElement(AddIcon, null))),
|
|
94
|
-
items.length > 0 && (React.createElement(Checkbox, null,
|
|
95
|
-
React.createElement(CheckboxField, { checked: selectResolved, onChange: handleOnSelectChange }),
|
|
96
|
-
React.createElement(LabelText, null, "See resolved")))),
|
|
97
|
-
items.length >= 0 && (React.createElement(NoteListContainer, { "data-cy": "notes-list" }, items.map(([target, noteData]) => {
|
|
98
|
-
const isSelected = (selected &&
|
|
99
|
-
(selected.node.attrs.id === target ||
|
|
100
|
-
selected.node.attrs.rid === target)) ||
|
|
101
|
-
false;
|
|
102
|
-
const selectedNoteData = selectResolved
|
|
103
|
-
? noteData
|
|
104
|
-
: noteData.filter((note) => !note.comment.resolved);
|
|
105
|
-
return (React.createElement(CommentTarget, { key: target, isSelected: isSelected }, selectedNoteData.map(({ comment, children }) => (React.createElement(NoteThread, { key: comment._id },
|
|
106
|
-
React.createElement(NoteBodyContainer, { isSelected: isSelected, isNew: isNew(comment) },
|
|
107
|
-
React.createElement(CommentWrapper, { createKeyword: createKeyword, comment: comment, deleteComment: deleteNote, handleSetResolved: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
108
|
-
return yield saveModel(Object.assign(Object.assign({}, comment), { resolved: !comment.resolved }));
|
|
109
|
-
}), getCollaborator: getCollaboratorById, getKeyword: getKeyword, listCollaborators: listCollaborators, listKeywords: listKeywords, saveComment: saveNote, handleCreateReply: setNoteTarget, isNew: isNew(comment), isSelected: isSelected, isProdNote: true, can: can })),
|
|
110
|
-
children.map((note) => (React.createElement(ReplyBodyContainer, { key: note._id },
|
|
111
|
-
React.createElement(CommentWrapper, { createKeyword: createKeyword, comment: note, deleteComment: deleteNote, getCollaborator: getCollaboratorById, getKeyword: getKeyword, isReply: true, listCollaborators: listCollaborators, listKeywords: listKeywords, saveComment: saveNote, handleCreateReply: setNoteTarget, isNew: isNew(note), isProdNote: true, can: can })))))))));
|
|
112
|
-
})))));
|
|
113
|
-
});
|
|
114
|
-
const AddNoteButton = styled(IconTextButton) `
|
|
115
|
-
svg {
|
|
116
|
-
margin: 0 0 0 ${(props) => props.theme.grid.unit * 4}px;
|
|
117
|
-
path {
|
|
118
|
-
fill: ${(props) => props.theme.colors.text.secondary};
|
|
119
|
-
stroke: ${(props) => props.theme.colors.text.secondary};
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
font-size: ${(props) => props.theme.font.size.normal};
|
|
123
|
-
`;
|
|
124
|
-
const NoteListContainer = styled.div `
|
|
125
|
-
flex: 1;
|
|
126
|
-
overflow-y: auto;
|
|
127
|
-
`;
|
|
128
|
-
export const NoteBodyContainer = styled.div `
|
|
129
|
-
padding: ${(props) => props.theme.grid.unit * 4}px 0
|
|
130
|
-
${(props) => props.theme.grid.unit * 2}px;
|
|
131
|
-
background: ${(props) => props.theme.colors.background.primary};
|
|
132
|
-
|
|
133
|
-
${(props) => borderStyle(props.theme.colors.border.secondary)};
|
|
134
|
-
${(props) => (props.isNew || props.isSelected) &&
|
|
135
|
-
borderStyle(props.theme.colors.border.primary)}
|
|
136
|
-
${(props) => props.isSelected &&
|
|
137
|
-
`background: ${props.theme.colors.background.selected};`}
|
|
138
|
-
|
|
139
|
-
.tooltip {
|
|
140
|
-
border-radius: 6px;
|
|
141
|
-
padding: 8px;
|
|
142
|
-
text-align: center;
|
|
143
|
-
}
|
|
144
|
-
`;
|
|
145
|
-
const borderStyle = (color) => `
|
|
146
|
-
${'border: 1px solid ' + color};
|
|
147
|
-
${'border-left: 4px solid ' + color};
|
|
148
|
-
`;
|
|
149
|
-
const NoteThread = styled.div `
|
|
150
|
-
margin: ${(props) => props.theme.grid.unit * 4}px 0;
|
|
151
|
-
`;
|
|
152
|
-
export const ReplyBodyContainer = styled.div `
|
|
153
|
-
padding: ${(props) => props.theme.grid.unit * 4}px 0
|
|
154
|
-
${(props) => props.theme.grid.unit * 2}px;
|
|
155
|
-
margin-left: ${(props) => props.theme.grid.unit * 8}px;
|
|
156
|
-
border: 1px solid ${(props) => props.theme.colors.border.secondary};
|
|
157
|
-
border-top: none;
|
|
158
|
-
`;
|
|
159
|
-
export const LightRelativeDate = styled(RelativeDate) `
|
|
160
|
-
font-size: ${(props) => props.theme.font.size.small};
|
|
161
|
-
color: ${(props) => props.theme.colors.text.secondary};
|
|
162
|
-
letter-spacing: -0.2px;
|
|
163
|
-
`;
|
|
164
|
-
const ActionHeader = styled.div `
|
|
165
|
-
display: flex;
|
|
166
|
-
align-items: center;
|
|
167
|
-
justify-content: ${(props) => (props.withAddButton && 'space-between') || 'flex-end'};
|
|
168
|
-
padding-left: ${(props) => props.theme.grid.unit * 8}px;
|
|
169
|
-
`;
|
|
170
|
-
export const LabelText = styled.div `
|
|
171
|
-
font-family: ${(props) => props.theme.font.family.sans};
|
|
172
|
-
color: ${(props) => props.theme.colors.text.primary};
|
|
173
|
-
font-size: 14px;
|
|
174
|
-
line-height: 24px;
|
|
175
|
-
margin: 0 !important;
|
|
176
|
-
`;
|
|
177
|
-
const Checkbox = styled(CheckboxLabel) `
|
|
178
|
-
div {
|
|
179
|
-
color: ${(props) => props.theme.colors.text.primary};
|
|
180
|
-
}
|
|
181
|
-
`;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2020 Atypon Systems LLC
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import React, { Dispatch, SetStateAction } from 'react';
|
|
17
|
-
import { Capabilities } from '../../lib/capabilities';
|
|
18
|
-
export declare const CommentActions: React.FC<{
|
|
19
|
-
id: string;
|
|
20
|
-
target: string;
|
|
21
|
-
can?: Capabilities;
|
|
22
|
-
isResolved?: boolean;
|
|
23
|
-
isOwnComment: boolean;
|
|
24
|
-
handleSetResolved?: () => void;
|
|
25
|
-
deleteComment: (id: string, target?: string) => void;
|
|
26
|
-
setIsEditing: Dispatch<SetStateAction<boolean | undefined>>;
|
|
27
|
-
isProdNote?: boolean;
|
|
28
|
-
}>;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2020 Atypon Systems LLC
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { Keyword, UserProfile } from '@manuscripts/json-schema';
|
|
17
|
-
import React, { Dispatch, SetStateAction } from 'react';
|
|
18
|
-
import { CommentType, UnsavedComment } from '../../lib/comments';
|
|
19
|
-
export interface CommentBodyProps {
|
|
20
|
-
createKeyword: (name: string) => Promise<Keyword>;
|
|
21
|
-
deleteComment: (id: string, target?: string) => void;
|
|
22
|
-
getCollaborator: (id: string) => UserProfile | undefined;
|
|
23
|
-
getKeyword: (id: string) => Keyword | undefined;
|
|
24
|
-
isNew: boolean;
|
|
25
|
-
isReply?: boolean;
|
|
26
|
-
listCollaborators: () => UserProfile[];
|
|
27
|
-
listKeywords: () => Keyword[];
|
|
28
|
-
comment: CommentType | UnsavedComment;
|
|
29
|
-
saveComment: (comment: CommentType | UnsavedComment) => Promise<CommentType>;
|
|
30
|
-
handleCreateReply: (id: string) => void;
|
|
31
|
-
scrollIntoHighlight?: (comment: CommentType | UnsavedComment) => void;
|
|
32
|
-
onFocusOut?: (id: string, content: string) => boolean;
|
|
33
|
-
}
|
|
34
|
-
export declare const CommentBody: React.FC<CommentBodyProps & {
|
|
35
|
-
setIsEditing: Dispatch<SetStateAction<boolean | undefined>>;
|
|
36
|
-
isEditing?: boolean;
|
|
37
|
-
isDeleting?: boolean;
|
|
38
|
-
isProdNote?: boolean;
|
|
39
|
-
}>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2020 Atypon Systems LLC
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import React from 'react';
|
|
17
|
-
interface Props {
|
|
18
|
-
isSelected: boolean;
|
|
19
|
-
}
|
|
20
|
-
export declare const CommentTarget: React.FC<Props>;
|
|
21
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2020 Atypon Systems LLC
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { Contribution, UserProfile } from '@manuscripts/json-schema';
|
|
17
|
-
import React from 'react';
|
|
18
|
-
export declare const CommentUser: React.FC<{
|
|
19
|
-
contributions?: Contribution[];
|
|
20
|
-
getCollaboratorById: (id: string) => UserProfile | undefined;
|
|
21
|
-
displayName?: string;
|
|
22
|
-
createdAt?: number;
|
|
23
|
-
}>;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2020 Atypon Systems LLC
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import React from 'react';
|
|
17
|
-
import { Capabilities } from '../../lib/capabilities';
|
|
18
|
-
import { CommentBodyProps } from './CommentBody';
|
|
19
|
-
export declare const CommentWrapper: React.FC<CommentBodyProps & {
|
|
20
|
-
handleSetResolved?: () => void;
|
|
21
|
-
isSelected?: boolean;
|
|
22
|
-
handleRequestSelect?: () => void;
|
|
23
|
-
can?: Capabilities;
|
|
24
|
-
currentUserId?: string;
|
|
25
|
-
isProdNote?: boolean;
|
|
26
|
-
}>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2021 Atypon Systems LLC
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import React from 'react';
|
|
17
|
-
export declare const ResolveButton: React.FC<{
|
|
18
|
-
id: string;
|
|
19
|
-
resolved: boolean | undefined;
|
|
20
|
-
resolvedCallback: () => void;
|
|
21
|
-
}>;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* © 2020 Atypon Systems LLC
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { Keyword, ManuscriptNote, UserProfile } from '@manuscripts/json-schema';
|
|
17
|
-
import { Selected } from '@manuscripts/transform';
|
|
18
|
-
import React from 'react';
|
|
19
|
-
import { Capabilities } from '../lib/capabilities';
|
|
20
|
-
interface Props {
|
|
21
|
-
createKeyword: (name: string) => Promise<Keyword>;
|
|
22
|
-
deleteModel: (id: string) => Promise<string>;
|
|
23
|
-
getCollaboratorById: (id: string) => UserProfile | undefined;
|
|
24
|
-
currentUserId?: string;
|
|
25
|
-
displayName?: string;
|
|
26
|
-
getKeyword: (id: string) => Keyword | undefined;
|
|
27
|
-
listCollaborators: () => UserProfile[];
|
|
28
|
-
listKeywords: () => Keyword[];
|
|
29
|
-
notes: ManuscriptNote[];
|
|
30
|
-
noteSource: 'EMAIL' | 'EDITOR' | 'DASHBOARD';
|
|
31
|
-
saveModel: (model: ManuscriptNote) => Promise<ManuscriptNote>;
|
|
32
|
-
selected: Selected | null;
|
|
33
|
-
can: Capabilities;
|
|
34
|
-
}
|
|
35
|
-
export declare const ManuscriptNoteList: React.FC<Props>;
|
|
36
|
-
export declare const NoteBodyContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
37
|
-
isSelected: boolean;
|
|
38
|
-
isNew: boolean;
|
|
39
|
-
}, never>;
|
|
40
|
-
export declare const ReplyBodyContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
41
|
-
export declare const LightRelativeDate: import("styled-components").StyledComponent<React.FC<{
|
|
42
|
-
createdAt?: number | undefined;
|
|
43
|
-
}>, import("styled-components").DefaultTheme, {}, never>;
|
|
44
|
-
export declare const LabelText: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
45
|
-
export {};
|