@manuscripts/body-editor 2.6.37 → 2.6.38-LEAN-4186.2
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/commands.js +26 -4
- package/dist/cjs/components/authors/AuthorActions.js +25 -41
- package/dist/cjs/components/authors/AuthorDetailsForm.js +30 -11
- package/dist/cjs/components/authors/AuthorList.js +11 -2
- package/dist/cjs/components/authors/AuthorsModal.js +122 -17
- package/dist/cjs/components/authors/DeleteAuthorConfirmationDialog.js +17 -4
- package/dist/cjs/components/authors/DraggableAuthor.js +62 -15
- package/dist/cjs/components/authors/RequiredFieldConfirmationDialog.js +39 -0
- package/dist/cjs/components/authors/SaveAuthorConfirmationDialog.js +19 -1
- package/dist/cjs/menus.js +7 -1
- package/dist/cjs/plugins/cross-references.js +1 -1
- package/dist/cjs/versions.js +1 -1
- package/dist/cjs/views/contributors.js +42 -15
- package/dist/es/commands.js +24 -3
- package/dist/es/components/authors/AuthorActions.js +26 -19
- package/dist/es/components/authors/AuthorDetailsForm.js +30 -11
- package/dist/es/components/authors/AuthorList.js +11 -2
- package/dist/es/components/authors/AuthorsModal.js +123 -18
- package/dist/es/components/authors/DeleteAuthorConfirmationDialog.js +18 -5
- package/dist/es/components/authors/DraggableAuthor.js +64 -16
- package/dist/es/components/authors/RequiredFieldConfirmationDialog.js +32 -0
- package/dist/es/components/authors/SaveAuthorConfirmationDialog.js +20 -2
- package/dist/es/menus.js +8 -2
- package/dist/es/plugins/cross-references.js +1 -1
- package/dist/es/versions.js +1 -1
- package/dist/es/views/contributors.js +43 -16
- package/dist/types/commands.d.ts +1 -0
- package/dist/types/components/authors/AuthorActions.d.ts +4 -3
- package/dist/types/components/authors/AuthorDetailsForm.d.ts +1 -0
- package/dist/types/components/authors/AuthorList.d.ts +2 -0
- package/dist/types/components/authors/AuthorsModal.d.ts +1 -0
- package/dist/types/components/authors/DeleteAuthorConfirmationDialog.d.ts +0 -2
- package/dist/types/components/authors/DraggableAuthor.d.ts +2 -0
- package/dist/types/components/authors/RequiredFieldConfirmationDialog.d.ts +7 -0
- package/dist/types/versions.d.ts +1 -1
- package/dist/types/views/contributors.d.ts +3 -2
- package/package.json +2 -2
- package/styles/AdvancedEditor.css +31 -2
- package/styles/Editor.css +15 -0
|
@@ -13,23 +13,22 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { Avatar, CorrespondingAuthorIcon,
|
|
17
|
-
import React, { useRef, useState } from 'react';
|
|
16
|
+
import { Avatar, CorrespondingAuthorIcon, CrclTickAnimation, DeleteIcon, DraggableIcon, Tooltip, } from '@manuscripts/style-guide';
|
|
17
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
18
18
|
import { useDrag, useDrop } from 'react-dnd';
|
|
19
19
|
import styled from 'styled-components';
|
|
20
20
|
import { authorLabel } from '../../lib/authors';
|
|
21
21
|
import { getDropSide } from '../../lib/dnd';
|
|
22
22
|
const AuthorContainer = styled.div `
|
|
23
|
-
padding: ${(props) => props.theme.grid.unit * 2}px
|
|
23
|
+
padding: ${(props) => props.theme.grid.unit * 2}px 0
|
|
24
|
+
${(props) => props.theme.grid.unit * 2}px;
|
|
24
25
|
display: flex;
|
|
25
26
|
justify-content: space-between;
|
|
26
27
|
align-items: center;
|
|
27
|
-
cursor: pointer;
|
|
28
28
|
transition: background-color 0.25s;
|
|
29
29
|
border: 1px solid transparent;
|
|
30
30
|
border-left: 0;
|
|
31
31
|
border-right: 0;
|
|
32
|
-
|
|
33
32
|
&:hover,
|
|
34
33
|
&.active {
|
|
35
34
|
background: ${(props) => props.theme.colors.background.fifth};
|
|
@@ -40,20 +39,31 @@ const AuthorContainer = styled.div `
|
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
&.dragging {
|
|
43
|
-
|
|
42
|
+
opacity: 1;
|
|
43
|
+
cursor: grabbing;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&.dragging * {
|
|
47
|
+
opacity: 0;
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
&.drop-before {
|
|
51
|
+
cursor: grabbing;
|
|
47
52
|
border-top-color: ${(props) => props.theme.colors.brand.dark};
|
|
48
53
|
}
|
|
49
54
|
|
|
50
55
|
&.drop-after {
|
|
56
|
+
cursor: grabbing;
|
|
51
57
|
border-bottom-color: ${(props) => props.theme.colors.brand.dark};
|
|
52
58
|
}
|
|
53
59
|
`;
|
|
54
60
|
const AvatarContainer = styled.div `
|
|
55
61
|
display: inline-flex;
|
|
56
62
|
position: relative;
|
|
63
|
+
align-items: center;
|
|
64
|
+
`;
|
|
65
|
+
const Box = styled.div `
|
|
66
|
+
margin-left: 14px;
|
|
57
67
|
`;
|
|
58
68
|
const AuthorBadge = styled.div `
|
|
59
69
|
display: inline-flex;
|
|
@@ -74,21 +84,40 @@ const AuthorName = styled.div `
|
|
|
74
84
|
margin-left: 12px;
|
|
75
85
|
flex: 1;
|
|
76
86
|
`;
|
|
77
|
-
const DragHandle = styled(
|
|
87
|
+
const DragHandle = styled(DraggableIcon) `
|
|
78
88
|
cursor: move;
|
|
89
|
+
margin-left: -4px;
|
|
90
|
+
margin-right: -12px;
|
|
79
91
|
`;
|
|
80
|
-
|
|
92
|
+
const RemoveButton = styled.div `
|
|
93
|
+
display: flex;
|
|
94
|
+
align-items: center;
|
|
95
|
+
margin-right: 8px;
|
|
96
|
+
svg {
|
|
97
|
+
cursor: pointer;
|
|
98
|
+
}
|
|
99
|
+
.icon_element {
|
|
100
|
+
fill: #6e6e6e;
|
|
101
|
+
}
|
|
102
|
+
`;
|
|
103
|
+
const StyledCrclTickAnimation = styled(CrclTickAnimation) `
|
|
104
|
+
margin-left: 12px;
|
|
105
|
+
`;
|
|
106
|
+
export const DraggableAuthor = React.memo(({ author, isSelected, onClick, onDelete, moveAuthor, showSuccessIcon }) => {
|
|
81
107
|
const [dropSide, setDropSide] = useState();
|
|
82
108
|
const ref = useRef(null);
|
|
83
|
-
const [{ isDragging }, dragRef] = useDrag({
|
|
109
|
+
const [{ isDragging }, dragRef, preview] = useDrag({
|
|
84
110
|
type: 'author',
|
|
85
111
|
item: {
|
|
86
112
|
author,
|
|
87
113
|
},
|
|
88
|
-
collect: (monitor) =>
|
|
89
|
-
|
|
90
|
-
|
|
114
|
+
collect: (monitor) => {
|
|
115
|
+
return {
|
|
116
|
+
isDragging: monitor.isDragging(),
|
|
117
|
+
};
|
|
118
|
+
},
|
|
91
119
|
});
|
|
120
|
+
preview(ref);
|
|
92
121
|
const [{ isOver }, dropRef] = useDrop({
|
|
93
122
|
accept: 'author',
|
|
94
123
|
hover: (item, monitor) => {
|
|
@@ -122,12 +151,31 @@ export const DraggableAuthor = ({ author, isSelected, onClick, moveAuthor, }) =>
|
|
|
122
151
|
}
|
|
123
152
|
if (isSelected) {
|
|
124
153
|
classes.push('active');
|
|
154
|
+
if (ref.current) {
|
|
155
|
+
ref.current.scrollIntoView({
|
|
156
|
+
behavior: 'smooth',
|
|
157
|
+
block: 'center',
|
|
158
|
+
});
|
|
159
|
+
}
|
|
125
160
|
}
|
|
126
|
-
|
|
161
|
+
useEffect(() => {
|
|
162
|
+
if (isDragging || isOver) {
|
|
163
|
+
document.body.style.cursor = 'grabbing';
|
|
164
|
+
}
|
|
165
|
+
return () => {
|
|
166
|
+
document.body.style.cursor = 'default';
|
|
167
|
+
};
|
|
168
|
+
}, [isDragging, isOver]);
|
|
169
|
+
return (React.createElement(AuthorContainer, { ref: ref, className: classes.join(' '), onClick: onClick, "data-cy": "author-item", style: { cursor: isDragging ? 'grabbing' : 'default' } },
|
|
127
170
|
React.createElement(AvatarContainer, { "data-cy": "author-avatar" },
|
|
128
|
-
React.createElement(
|
|
171
|
+
isSelected && React.createElement(DragHandle, null),
|
|
172
|
+
React.createElement(Box, null,
|
|
173
|
+
showSuccessIcon && React.createElement(StyledCrclTickAnimation, { size: 36 }),
|
|
174
|
+
React.createElement(Avatar, { size: 36, color: '#6e6e6e', opacity: showSuccessIcon ? 0.05 : 1 })),
|
|
129
175
|
React.createElement(AuthorNotes, { "data-cy": "author-notes" }, author.isCorresponding && (React.createElement(AuthorBadge, null,
|
|
130
176
|
React.createElement(CorrespondingAuthorIcon, null))))),
|
|
131
177
|
React.createElement(AuthorName, { "data-cy": "author-name" }, authorLabel(author)),
|
|
132
|
-
isSelected && React.createElement(
|
|
133
|
-
}
|
|
178
|
+
isSelected && (React.createElement(RemoveButton, { onClick: () => onDelete(), "data-tooltip-id": 'delete-button-tooltip' },
|
|
179
|
+
React.createElement(DeleteIcon, { fill: '#6E6E6E' }),
|
|
180
|
+
React.createElement(Tooltip, { id: 'delete-button-tooltip', place: "bottom" }, 'Delete')))));
|
|
181
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { AttentionOrangeIcon, Category, Dialog } from '@manuscripts/style-guide';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
const StyledIcon = styled(AttentionOrangeIcon) `
|
|
5
|
+
margin-right: 8px;
|
|
6
|
+
`;
|
|
7
|
+
const MessageBox = styled.div `
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
min-height: 90px;
|
|
12
|
+
`;
|
|
13
|
+
const Header = () => (React.createElement(React.Fragment, null,
|
|
14
|
+
React.createElement(StyledIcon, null),
|
|
15
|
+
" Empty required field"));
|
|
16
|
+
const Message = () => {
|
|
17
|
+
return (React.createElement(MessageBox, null,
|
|
18
|
+
React.createElement("div", null, "A required filed has been left empty. If you discard, any updates will not be saved!"),
|
|
19
|
+
React.createElement("div", null, "Would you like to discard or continue editing?")));
|
|
20
|
+
};
|
|
21
|
+
export const RequiredFieldConfirmationDialog = ({ isOpen, onSave, onCancel }) => {
|
|
22
|
+
return (React.createElement(Dialog, { isOpen: isOpen, category: Category.confirmation, header: React.createElement(Header, null), message: React.createElement(Message, null), actions: {
|
|
23
|
+
secondary: {
|
|
24
|
+
action: onCancel,
|
|
25
|
+
title: 'Discard',
|
|
26
|
+
},
|
|
27
|
+
primary: {
|
|
28
|
+
action: onSave,
|
|
29
|
+
title: 'Continue editing',
|
|
30
|
+
},
|
|
31
|
+
} }));
|
|
32
|
+
};
|
|
@@ -1,7 +1,25 @@
|
|
|
1
|
-
import { Category, Dialog } from '@manuscripts/style-guide';
|
|
1
|
+
import { AttentionOrangeIcon, Category, Dialog } from '@manuscripts/style-guide';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
const StyledIcon = styled(AttentionOrangeIcon) `
|
|
5
|
+
margin-right: 8px;
|
|
6
|
+
`;
|
|
7
|
+
const MessageBox = styled.div `
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
min-height: 72px;
|
|
12
|
+
`;
|
|
13
|
+
const Header = () => (React.createElement(React.Fragment, null,
|
|
14
|
+
React.createElement(StyledIcon, null),
|
|
15
|
+
" Unsaved changes"));
|
|
16
|
+
const Message = () => {
|
|
17
|
+
return (React.createElement(MessageBox, null,
|
|
18
|
+
React.createElement("div", null, "You've made changes but not saved them!"),
|
|
19
|
+
React.createElement("div", null, "Would you like to save or discard your changes?")));
|
|
20
|
+
};
|
|
3
21
|
export const SaveAuthorConfirmationDialog = ({ isOpen, onSave, onCancel }) => {
|
|
4
|
-
return (React.createElement(Dialog, { isOpen: isOpen, category: Category.confirmation, header:
|
|
22
|
+
return (React.createElement(Dialog, { isOpen: isOpen, category: Category.confirmation, header: React.createElement(Header, null), message: React.createElement(Message, null), actions: {
|
|
5
23
|
secondary: {
|
|
6
24
|
action: onCancel,
|
|
7
25
|
title: 'Discard',
|
package/dist/es/menus.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import { getGroupCateogries, schema, } from '@manuscripts/transform';
|
|
17
17
|
import { toggleMark } from 'prosemirror-commands';
|
|
18
18
|
import { redo, undo } from 'prosemirror-history';
|
|
19
|
-
import { addInlineComment, blockActive, canInsert, insertAbstract, insertBackmatterSection, insertBlock, insertBoxElement, insertContributors, insertCrossReference, insertGraphicalAbstract, insertInlineCitation, insertInlineEquation, insertInlineFootnote, insertKeywords, insertLink, insertList, insertSection, markActive, } from './commands';
|
|
19
|
+
import { addInlineComment, blockActive, canInsert, insertAbstract, insertAffiliation, insertBackmatterSection, insertBlock, insertBoxElement, insertContributors, insertCrossReference, insertGraphicalAbstract, insertInlineCitation, insertInlineEquation, insertInlineFootnote, insertKeywords, insertLink, insertList, insertSection, markActive, } from './commands';
|
|
20
20
|
import { openInsertTableDialog } from './components/toolbar/InsertTableDialog';
|
|
21
21
|
import { ListMenuItem } from './components/toolbar/ListMenuItem';
|
|
22
22
|
import { deleteClosestParentElement, findClosestParentElementNodeName, } from './lib/hierarchy';
|
|
@@ -101,10 +101,16 @@ export const getEditorMenus = (editor) => {
|
|
|
101
101
|
},
|
|
102
102
|
{
|
|
103
103
|
id: 'insert-contributors',
|
|
104
|
-
label: 'Authors
|
|
104
|
+
label: 'Authors',
|
|
105
105
|
isEnabled: isCommandValid(insertContributors),
|
|
106
106
|
run: doCommand(insertContributors),
|
|
107
107
|
},
|
|
108
|
+
{
|
|
109
|
+
id: 'insert-contributors',
|
|
110
|
+
label: 'Affiliations',
|
|
111
|
+
isEnabled: isCommandValid(insertAffiliation),
|
|
112
|
+
run: doCommand(insertAffiliation),
|
|
113
|
+
},
|
|
108
114
|
{
|
|
109
115
|
id: 'insert-keywords',
|
|
110
116
|
label: 'Keywords',
|
package/dist/es/versions.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '2.6.
|
|
1
|
+
export const VERSION = '2.6.38-LEAN-4186.2';
|
|
2
2
|
export const MATHJAX_VERSION = '3.2.2';
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { ContextMenu
|
|
16
|
+
import { ContextMenu } from '@manuscripts/style-guide';
|
|
17
17
|
import { schema } from '@manuscripts/transform';
|
|
18
18
|
import { NodeSelection } from 'prosemirror-state';
|
|
19
19
|
import { AuthorsModal, } from '../components/authors/AuthorsModal';
|
|
@@ -109,16 +109,25 @@ export class ContributorsView extends BlockView {
|
|
|
109
109
|
this.dom = document.createElement('div');
|
|
110
110
|
this.dom.classList.add('block-container', `block-${this.node.type.name}`);
|
|
111
111
|
};
|
|
112
|
-
this.
|
|
112
|
+
this.authorContextMenu = () => {
|
|
113
113
|
const can = this.props.getCapabilities();
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
114
|
+
const componentProps = {
|
|
115
|
+
actions: [],
|
|
116
|
+
};
|
|
117
|
+
if (can.editArticle) {
|
|
118
|
+
componentProps.actions.push({
|
|
119
|
+
label: 'New Author',
|
|
120
|
+
action: () => this.handleEdit('', true),
|
|
121
|
+
icon: 'AddOutline',
|
|
122
|
+
});
|
|
123
|
+
componentProps.actions.push({
|
|
124
|
+
label: 'Edit',
|
|
125
|
+
action: () => this.handleEdit(''),
|
|
126
|
+
icon: 'Edit',
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
this.contextMenu = ReactSubView(this.props, ContextMenu, componentProps, this.node, this.getPos, this.view, 'context-menu');
|
|
130
|
+
return this.contextMenu;
|
|
122
131
|
};
|
|
123
132
|
this.createLegend = () => {
|
|
124
133
|
const state = affiliationsKey.getState(this.view.state);
|
|
@@ -178,7 +187,7 @@ export class ContributorsView extends BlockView {
|
|
|
178
187
|
this.contextMenu = ReactSubView(this.props, ContextMenu, componentProps, this.node, this.getPos, this.view, 'context-menu');
|
|
179
188
|
this.props.popper.show(element, this.contextMenu, 'right-start');
|
|
180
189
|
};
|
|
181
|
-
this.handleEdit = (id) => {
|
|
190
|
+
this.handleEdit = (id, addNew) => {
|
|
182
191
|
var _a;
|
|
183
192
|
this.props.popper.destroy();
|
|
184
193
|
const contributors = findChildrenAttrsByType(this.view, schema.nodes.contributor);
|
|
@@ -191,6 +200,7 @@ export class ContributorsView extends BlockView {
|
|
|
191
200
|
onSaveAuthor: this.handleSaveAuthor,
|
|
192
201
|
onDeleteAuthor: this.handleDeleteAuthor,
|
|
193
202
|
onSaveAffiliation: this.handleSaveAffiliation,
|
|
203
|
+
addNewAuthor: addNew,
|
|
194
204
|
};
|
|
195
205
|
(_a = this.popper) === null || _a === void 0 ? void 0 : _a.remove();
|
|
196
206
|
this.popper = ReactSubView(this.props, AuthorsModal, componentProps, this.node, this.getPos, this.view);
|
|
@@ -220,11 +230,29 @@ export class ContributorsView extends BlockView {
|
|
|
220
230
|
this.view.dispatch(tr.insert(parent.pos + 1, node));
|
|
221
231
|
};
|
|
222
232
|
this.insertAffiliationNode = (attrs) => {
|
|
223
|
-
const
|
|
224
|
-
const
|
|
225
|
-
const
|
|
226
|
-
|
|
233
|
+
const { view } = this;
|
|
234
|
+
const { dispatch } = view;
|
|
235
|
+
const affiliationsNodeType = schema.nodes.affiliations;
|
|
236
|
+
const contributorsNodeType = schema.nodes.contributors;
|
|
237
|
+
const affiliationNodeType = schema.nodes.affiliation;
|
|
238
|
+
let affiliations = findChildByType(view, affiliationsNodeType);
|
|
239
|
+
if (!affiliations) {
|
|
240
|
+
const contributors = findChildByType(view, contributorsNodeType);
|
|
241
|
+
if (contributors) {
|
|
242
|
+
const { tr } = this.view.state;
|
|
243
|
+
const affiliationsNode = affiliationsNodeType.create();
|
|
244
|
+
const insertPos = contributors.pos + contributors.node.nodeSize;
|
|
245
|
+
dispatch(tr.insert(insertPos, affiliationsNode));
|
|
246
|
+
affiliations = findChildByType(view, affiliationsNodeType);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
if (affiliations) {
|
|
250
|
+
const { tr } = this.view.state;
|
|
251
|
+
const affiliationNode = affiliationNodeType.create(attrs);
|
|
252
|
+
dispatch(tr.insert(affiliations.pos + 1, affiliationNode));
|
|
253
|
+
}
|
|
227
254
|
};
|
|
255
|
+
this.actionGutterButtons = () => [this.authorContextMenu()];
|
|
228
256
|
}
|
|
229
257
|
updateContents() {
|
|
230
258
|
const affs = affiliationsKey.getState(this.view.state);
|
|
@@ -238,7 +266,6 @@ export class ContributorsView extends BlockView {
|
|
|
238
266
|
this.version = affs.version;
|
|
239
267
|
this.container.innerHTML = '';
|
|
240
268
|
this.buildAuthors(affs);
|
|
241
|
-
this.createEditButton();
|
|
242
269
|
this.createLegend();
|
|
243
270
|
this.updateSelection();
|
|
244
271
|
}
|
package/dist/types/commands.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ export declare const insertSection: (subsection?: boolean) => (state: Manuscript
|
|
|
53
53
|
export declare const insertBackmatterSection: (category: SectionCategory) => (state: ManuscriptEditorState, dispatch?: Dispatch, view?: EditorView) => boolean;
|
|
54
54
|
export declare const insertAbstract: (state: ManuscriptEditorState, dispatch?: Dispatch, view?: EditorView) => boolean;
|
|
55
55
|
export declare const insertContributors: (state: ManuscriptEditorState, dispatch?: Dispatch, view?: EditorView) => boolean;
|
|
56
|
+
export declare const insertAffiliation: (state: ManuscriptEditorState, dispatch?: Dispatch, view?: EditorView) => boolean;
|
|
56
57
|
export declare const insertKeywords: (state: ManuscriptEditorState, dispatch?: Dispatch, view?: EditorView) => boolean;
|
|
57
58
|
export declare const insertList: (type: ManuscriptNodeType, style?: string) => (state: ManuscriptEditorState, dispatch?: Dispatch, view?: EditorView) => boolean;
|
|
58
59
|
export declare const insertBibliographySection: () => boolean;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ContributorAttrs } from '../../lib/authors';
|
|
3
2
|
export interface AuthorActionsProps {
|
|
4
|
-
author: ContributorAttrs;
|
|
5
3
|
onSave: () => void;
|
|
6
4
|
onDelete: () => void;
|
|
7
|
-
|
|
5
|
+
showDeleteDialog: boolean;
|
|
6
|
+
handleShowDeleteDialog: () => void;
|
|
7
|
+
newAuthor: boolean;
|
|
8
|
+
isDisableSave: boolean;
|
|
8
9
|
}
|
|
9
10
|
export declare const AuthorActions: React.FC<AuthorActionsProps>;
|
|
@@ -25,6 +25,7 @@ interface AuthorDetailsFormProps {
|
|
|
25
25
|
onChange: (values: ContributorAttrs) => void;
|
|
26
26
|
onSave: (values: ContributorAttrs) => void;
|
|
27
27
|
actionsRef?: MutableRefObject<FormActions | undefined>;
|
|
28
|
+
isEmailRequired?: boolean;
|
|
28
29
|
}
|
|
29
30
|
export declare const AuthorDetailsForm: React.FC<AuthorDetailsFormProps>;
|
|
30
31
|
export {};
|
|
@@ -19,7 +19,9 @@ interface AuthorListProps {
|
|
|
19
19
|
author?: ContributorAttrs;
|
|
20
20
|
authors: ContributorAttrs[];
|
|
21
21
|
onSelect: (item: ContributorAttrs) => void;
|
|
22
|
+
onDelete: () => void;
|
|
22
23
|
moveAuthor: (index: number, target: number) => void;
|
|
24
|
+
lastSavedAuthor: string | null;
|
|
23
25
|
}
|
|
24
26
|
export declare const AuthorList: React.FC<AuthorListProps>;
|
|
25
27
|
export {};
|
|
@@ -22,5 +22,6 @@ export interface AuthorsModalProps {
|
|
|
22
22
|
onSaveAuthor: (author: ContributorAttrs) => void;
|
|
23
23
|
onDeleteAuthor: (author: ContributorAttrs) => void;
|
|
24
24
|
onSaveAffiliation: (affiliation: AffiliationAttrs) => void;
|
|
25
|
+
addNewAuthor?: boolean;
|
|
25
26
|
}
|
|
26
27
|
export declare const AuthorsModal: React.FC<AuthorsModalProps>;
|
|
@@ -19,7 +19,9 @@ interface DraggableAuthorProps {
|
|
|
19
19
|
author: ContributorAttrs;
|
|
20
20
|
isSelected: boolean;
|
|
21
21
|
onClick: () => void;
|
|
22
|
+
onDelete: () => void;
|
|
22
23
|
moveAuthor: (from: number, to: number) => void;
|
|
24
|
+
showSuccessIcon?: boolean;
|
|
23
25
|
}
|
|
24
26
|
export declare const DraggableAuthor: React.FC<DraggableAuthorProps>;
|
|
25
27
|
export {};
|
package/dist/types/versions.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "2.6.
|
|
1
|
+
export declare const VERSION = "2.6.38-LEAN-4186.2";
|
|
2
2
|
export declare const MATHJAX_VERSION = "3.2.2";
|
|
@@ -34,17 +34,18 @@ export declare class ContributorsView extends BlockView<Trackable<ContributorsNo
|
|
|
34
34
|
private isJointFirstAuthor;
|
|
35
35
|
createElement: () => void;
|
|
36
36
|
createDOM: () => void;
|
|
37
|
-
|
|
37
|
+
authorContextMenu: () => HTMLElement;
|
|
38
38
|
createLegend: () => void;
|
|
39
39
|
private handleClick;
|
|
40
40
|
private updateSelection;
|
|
41
41
|
showContextMenu: (element: Element) => void;
|
|
42
|
-
handleEdit: (id: string) => void;
|
|
42
|
+
handleEdit: (id: string, addNew?: boolean) => void;
|
|
43
43
|
handleSaveAuthor: (author: ContributorAttrs) => void;
|
|
44
44
|
handleDeleteAuthor: (author: ContributorAttrs) => void;
|
|
45
45
|
handleSaveAffiliation: (affiliation: AffiliationAttrs) => void;
|
|
46
46
|
insertAuthorNode: (attrs: ContributorAttrs) => void;
|
|
47
47
|
insertAffiliationNode: (attrs: AffiliationAttrs) => void;
|
|
48
|
+
actionGutterButtons: () => HTMLElement[];
|
|
48
49
|
}
|
|
49
50
|
declare const _default: (props: import("../configs/ManuscriptsEditor").EditorProps, dispatch?: import("..").Dispatch | undefined) => import("../types").NodeViewCreator<ContributorsView>;
|
|
50
51
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manuscripts/body-editor",
|
|
3
3
|
"description": "Prosemirror components for editing and viewing manuscripts",
|
|
4
|
-
"version": "2.6.
|
|
4
|
+
"version": "2.6.38-LEAN-4186.2",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-body-editor",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@iarna/word-count": "^1.1.2",
|
|
33
33
|
"@manuscripts/json-schema": "2.2.11",
|
|
34
34
|
"@manuscripts/library": "1.3.11",
|
|
35
|
-
"@manuscripts/style-guide": "2.0.
|
|
35
|
+
"@manuscripts/style-guide": "2.0.28-LEAN-4186.2",
|
|
36
36
|
"@manuscripts/track-changes-plugin": "1.8.6",
|
|
37
37
|
"@manuscripts/transform": "3.0.27",
|
|
38
38
|
"@popperjs/core": "^2.11.8",
|
|
@@ -217,7 +217,6 @@
|
|
|
217
217
|
width: 100%;
|
|
218
218
|
position: absolute;
|
|
219
219
|
top: 0;
|
|
220
|
-
left: 0;
|
|
221
220
|
z-index: 3;
|
|
222
221
|
}
|
|
223
222
|
|
|
@@ -525,6 +524,9 @@ span.comment-marker {
|
|
|
525
524
|
.ProseMirror {
|
|
526
525
|
--inserted-pending-bg-color: #e6ffdb;
|
|
527
526
|
--inserted-pending-color: #01872e;
|
|
527
|
+
--updated-pending-bg-color: #E6F7FC;
|
|
528
|
+
--updated-pending-color: #0284B0;
|
|
529
|
+
--accepted-bg-color: #e2e2e2;
|
|
528
530
|
--deleted-color: #f35143;
|
|
529
531
|
--deleted-pending-bg-color: #fff1f0;
|
|
530
532
|
--updated-bg-color: #d9f6ff;
|
|
@@ -575,6 +577,20 @@ span.comment-marker {
|
|
|
575
577
|
text-decoration: underline;
|
|
576
578
|
}
|
|
577
579
|
|
|
580
|
+
.ProseMirror .selected-suggestion .inserted,
|
|
581
|
+
.ProseMirror .selected-suggestion [data-track-op='insert'] .block,
|
|
582
|
+
.ProseMirror .selected-suggestion .deleted {
|
|
583
|
+
background-color: var(--selected-pending-background-color) !important;
|
|
584
|
+
color: var(--common-color) !important;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
.tracking-visible .ProseMirror .set_attrs,
|
|
588
|
+
.tracking-visible .ProseMirror [data-track-op='set_attrs'] {
|
|
589
|
+
background: var(--updated-pending-bg-color);
|
|
590
|
+
color: var(--updated-pending-color);
|
|
591
|
+
text-decoration: none;
|
|
592
|
+
}
|
|
593
|
+
|
|
578
594
|
.inserted:has(.selected-suggestion),
|
|
579
595
|
.inserted.selected-suggestion,
|
|
580
596
|
.selected-suggestion:has(.inserted) {
|
|
@@ -806,12 +822,13 @@ figure.block:has(.equation.set_attrs.selected-suggestion) {
|
|
|
806
822
|
.contributors-list .separator {
|
|
807
823
|
margin-right: 4px;
|
|
808
824
|
}
|
|
809
|
-
.contributors .tools-panel {
|
|
825
|
+
.block-contributors .tools-panel {
|
|
810
826
|
position: initial;
|
|
811
827
|
display: flex;
|
|
812
828
|
flex: 1;
|
|
813
829
|
align-items: center;
|
|
814
830
|
margin-top: 4px;
|
|
831
|
+
left: -10px;
|
|
815
832
|
}
|
|
816
833
|
.contributor .contributor-comment {
|
|
817
834
|
left: 0;
|
|
@@ -1042,3 +1059,15 @@ th:hover > .table-context-menu-button,
|
|
|
1042
1059
|
top: 6px;
|
|
1043
1060
|
pointer-events: none;
|
|
1044
1061
|
}
|
|
1062
|
+
|
|
1063
|
+
|
|
1064
|
+
.ProseMirror .block-contributors .context-menu > div {
|
|
1065
|
+
border-radius: 4px;
|
|
1066
|
+
border: 1px solid #c9c9c9;
|
|
1067
|
+
background: #fff;
|
|
1068
|
+
box-shadow: 0px 4px 9px 0px rgba(0, 0, 0, 0.3);
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
.ProseMirror .block-contributors .action-gutter {
|
|
1072
|
+
right: 15px;
|
|
1073
|
+
}
|
package/styles/Editor.css
CHANGED
|
@@ -662,6 +662,13 @@
|
|
|
662
662
|
transition: 0.2s all;
|
|
663
663
|
}
|
|
664
664
|
|
|
665
|
+
.ProseMirror .action-gutter {
|
|
666
|
+
position: relative;
|
|
667
|
+
cursor: ns-resize;
|
|
668
|
+
opacity: 0;
|
|
669
|
+
transition: 0.2s all;
|
|
670
|
+
}
|
|
671
|
+
|
|
665
672
|
.ProseMirror .block-section_title .block-gutter,
|
|
666
673
|
.ProseMirror .block-paragraph .block-gutter {
|
|
667
674
|
margin-top: 16px;
|
|
@@ -674,6 +681,14 @@
|
|
|
674
681
|
z-index: 2;
|
|
675
682
|
}
|
|
676
683
|
|
|
684
|
+
.ProseMirror:not(.ProseMirror-focused.popper-open)
|
|
685
|
+
.block-container:not(.block-section, .block-box_element):hover
|
|
686
|
+
.authors-container +
|
|
687
|
+
.action-gutter {
|
|
688
|
+
opacity: 1;
|
|
689
|
+
z-index: 2;
|
|
690
|
+
}
|
|
691
|
+
|
|
677
692
|
.ProseMirror .block-box_element:hover > .block-gutter {
|
|
678
693
|
opacity: 1;
|
|
679
694
|
z-index: 2;
|