@manuscripts/style-guide 1.4.0-LEAN-2852-6 → 1.4.0-LEAN-2585-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/AuthorsList/Author.js +19 -11
- package/dist/cjs/components/AuthorsList/AuthorsList.js +1 -1
- package/dist/cjs/lib/capabilities.js +1 -1
- package/dist/es/components/AuthorsList/Author.js +19 -11
- package/dist/es/components/AuthorsList/AuthorsList.js +1 -1
- package/dist/es/lib/capabilities.js +1 -1
- package/dist/types/components/AuthorsList/Author.d.ts +1 -0
- package/package.json +3 -3
|
@@ -56,27 +56,35 @@ const LinkSharedStyles = (0, styled_components_1.css) `
|
|
|
56
56
|
color: inherit;
|
|
57
57
|
outline: none;
|
|
58
58
|
|
|
59
|
-
&:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
&:not(:disabled) {
|
|
60
|
+
&:hover,
|
|
61
|
+
&:focus {
|
|
62
|
+
&,
|
|
63
|
+
span {
|
|
64
|
+
color: ${(props) => props.theme.colors.text.tertiary};
|
|
65
|
+
}
|
|
64
66
|
}
|
|
65
67
|
}
|
|
66
68
|
`;
|
|
67
69
|
const AuthorAffiliation = styled_components_1.default.span `
|
|
68
70
|
${LinkSharedStyles}
|
|
69
71
|
`;
|
|
70
|
-
const AuthorsContainer = styled_components_1.default.
|
|
72
|
+
const AuthorsContainer = styled_components_1.default.button `
|
|
71
73
|
display: inline-flex;
|
|
74
|
+
background: transparent;
|
|
75
|
+
border: 0;
|
|
76
|
+
font-size: 1rem;
|
|
72
77
|
${LinkSharedStyles}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
78
|
+
|
|
79
|
+
&:not(:disabled) {
|
|
80
|
+
&:hover {
|
|
81
|
+
text-decoration: underline;
|
|
82
|
+
cursor: pointer !important;
|
|
83
|
+
}
|
|
76
84
|
}
|
|
77
85
|
`;
|
|
78
|
-
const Author = ({ author, affiliations, jointFirstAuthor, startEditing, selectAuthor, showEditButton, }) => (react_1.default.createElement("span", { key: author._id },
|
|
79
|
-
showEditButton ? (react_1.default.createElement(AuthorsContainer, {
|
|
86
|
+
const Author = ({ author, affiliations, jointFirstAuthor, startEditing, selectAuthor, showEditButton, disableEditButton, }) => (react_1.default.createElement("span", { key: author._id },
|
|
87
|
+
showEditButton ? (react_1.default.createElement(AuthorsContainer, { disabled: disableEditButton, onClick: (e) => {
|
|
80
88
|
e.preventDefault();
|
|
81
89
|
startEditing && startEditing();
|
|
82
90
|
selectAuthor && selectAuthor(author);
|
|
@@ -46,7 +46,7 @@ const AuthorsActions = styled_components_1.default.div `
|
|
|
46
46
|
const AuthorsList = ({ authors, authorAffiliations, startEditing, showEditButton, disableEditButton, selectAuthor, }) => (react_1.default.createElement(AuthorsContainer, { isEmpty: !authors.length },
|
|
47
47
|
react_1.default.createElement("div", null, authors.map((author, index) => (react_1.default.createElement(react_1.default.Fragment, { key: author._id },
|
|
48
48
|
!!index && ', ',
|
|
49
|
-
react_1.default.createElement(Author_1.Author, { author: author, jointFirstAuthor: (0, authors_1.isJointFirstAuthor)(authors, index), affiliations: authorAffiliations.get(author._id), selectAuthor: selectAuthor, startEditing: startEditing, showEditButton: showEditButton }))))),
|
|
49
|
+
react_1.default.createElement(Author_1.Author, { author: author, jointFirstAuthor: (0, authors_1.isJointFirstAuthor)(authors, index), affiliations: authorAffiliations.get(author._id), selectAuthor: selectAuthor, startEditing: startEditing, showEditButton: showEditButton, disableEditButton: disableEditButton }))))),
|
|
50
50
|
showEditButton && startEditing && (react_1.default.createElement(AuthorsActions, null,
|
|
51
51
|
react_1.default.createElement(Button_1.PrimaryButton, { mini: true, onClick: startEditing, className: 'edit_authors_button', disabled: disableEditButton }, "Edit Authors")))));
|
|
52
52
|
exports.AuthorsList = AuthorsList;
|
|
@@ -56,7 +56,7 @@ const getCapabilities = (project, profile, role, actions) => {
|
|
|
56
56
|
accessEditor: true,
|
|
57
57
|
formatArticle: !isViewer(),
|
|
58
58
|
editArticle: !isViewer(),
|
|
59
|
-
editMetadata: !(isViewer() ||
|
|
59
|
+
editMetadata: !(isViewer() || isProofer()) || isAnnotator(),
|
|
60
60
|
editCitationsAndRefs: !(isViewer() || isAnnotator() || isProofer()),
|
|
61
61
|
shareProject: isOwner(),
|
|
62
62
|
applySaveChanges: !(isAnnotator() || isProofer()),
|
|
@@ -27,27 +27,35 @@ const LinkSharedStyles = css `
|
|
|
27
27
|
color: inherit;
|
|
28
28
|
outline: none;
|
|
29
29
|
|
|
30
|
-
&:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
&:not(:disabled) {
|
|
31
|
+
&:hover,
|
|
32
|
+
&:focus {
|
|
33
|
+
&,
|
|
34
|
+
span {
|
|
35
|
+
color: ${(props) => props.theme.colors.text.tertiary};
|
|
36
|
+
}
|
|
35
37
|
}
|
|
36
38
|
}
|
|
37
39
|
`;
|
|
38
40
|
const AuthorAffiliation = styled.span `
|
|
39
41
|
${LinkSharedStyles}
|
|
40
42
|
`;
|
|
41
|
-
const AuthorsContainer = styled.
|
|
43
|
+
const AuthorsContainer = styled.button `
|
|
42
44
|
display: inline-flex;
|
|
45
|
+
background: transparent;
|
|
46
|
+
border: 0;
|
|
47
|
+
font-size: 1rem;
|
|
43
48
|
${LinkSharedStyles}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
49
|
+
|
|
50
|
+
&:not(:disabled) {
|
|
51
|
+
&:hover {
|
|
52
|
+
text-decoration: underline;
|
|
53
|
+
cursor: pointer !important;
|
|
54
|
+
}
|
|
47
55
|
}
|
|
48
56
|
`;
|
|
49
|
-
export const Author = ({ author, affiliations, jointFirstAuthor, startEditing, selectAuthor, showEditButton, }) => (React.createElement("span", { key: author._id },
|
|
50
|
-
showEditButton ? (React.createElement(AuthorsContainer, {
|
|
57
|
+
export const Author = ({ author, affiliations, jointFirstAuthor, startEditing, selectAuthor, showEditButton, disableEditButton, }) => (React.createElement("span", { key: author._id },
|
|
58
|
+
showEditButton ? (React.createElement(AuthorsContainer, { disabled: disableEditButton, onClick: (e) => {
|
|
51
59
|
e.preventDefault();
|
|
52
60
|
startEditing && startEditing();
|
|
53
61
|
selectAuthor && selectAuthor(author);
|
|
@@ -40,6 +40,6 @@ const AuthorsActions = styled.div `
|
|
|
40
40
|
export const AuthorsList = ({ authors, authorAffiliations, startEditing, showEditButton, disableEditButton, selectAuthor, }) => (React.createElement(AuthorsContainer, { isEmpty: !authors.length },
|
|
41
41
|
React.createElement("div", null, authors.map((author, index) => (React.createElement(React.Fragment, { key: author._id },
|
|
42
42
|
!!index && ', ',
|
|
43
|
-
React.createElement(Author, { author: author, jointFirstAuthor: isJointFirstAuthor(authors, index), affiliations: authorAffiliations.get(author._id), selectAuthor: selectAuthor, startEditing: startEditing, showEditButton: showEditButton }))))),
|
|
43
|
+
React.createElement(Author, { author: author, jointFirstAuthor: isJointFirstAuthor(authors, index), affiliations: authorAffiliations.get(author._id), selectAuthor: selectAuthor, startEditing: startEditing, showEditButton: showEditButton, disableEditButton: disableEditButton }))))),
|
|
44
44
|
showEditButton && startEditing && (React.createElement(AuthorsActions, null,
|
|
45
45
|
React.createElement(PrimaryButton, { mini: true, onClick: startEditing, className: 'edit_authors_button', disabled: disableEditButton }, "Edit Authors")))));
|
|
@@ -50,7 +50,7 @@ export const getCapabilities = (project, profile, role, actions) => {
|
|
|
50
50
|
accessEditor: true,
|
|
51
51
|
formatArticle: !isViewer(),
|
|
52
52
|
editArticle: !isViewer(),
|
|
53
|
-
editMetadata: !(isViewer() ||
|
|
53
|
+
editMetadata: !(isViewer() || isProofer()) || isAnnotator(),
|
|
54
54
|
editCitationsAndRefs: !(isViewer() || isAnnotator() || isProofer()),
|
|
55
55
|
shareProject: isOwner(),
|
|
56
56
|
applySaveChanges: !(isAnnotator() || isProofer()),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manuscripts/style-guide",
|
|
3
3
|
"description": "Shared components for Manuscripts applications",
|
|
4
|
-
"version": "1.4.0-LEAN-
|
|
4
|
+
"version": "1.4.0-LEAN-2585-0",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"@formatjs/intl-relativetimeformat": "^4.5.9",
|
|
37
37
|
"@formatjs/intl-utils": "^2.2.0",
|
|
38
38
|
"@manuscripts/assets": "^0.6.2",
|
|
39
|
-
"@manuscripts/transform": "1.5.0
|
|
40
|
-
"@manuscripts/json-schema": "2.2
|
|
39
|
+
"@manuscripts/transform": "1.5.0",
|
|
40
|
+
"@manuscripts/json-schema": "^2.1.2",
|
|
41
41
|
"@manuscripts/title-editor": "^1.1.0",
|
|
42
42
|
"@manuscripts/comment-editor": "^1.0.3",
|
|
43
43
|
"@reach/tabs": "^0.11.2",
|