@manuscripts/style-guide 1.7.0-LEAN-3083 → 1.7.1
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/AffiliationsList.js +43 -0
- package/dist/cjs/components/AuthorsContainer.js +71 -0
- package/dist/cjs/components/AuthorsList/Author.js +99 -0
- package/dist/cjs/components/AuthorsList/AuthorsList.js +52 -0
- package/dist/cjs/components/AuthorsList/index.js +32 -0
- package/dist/cjs/components/Comments/CommentBody.js +1 -1
- package/dist/cjs/components/Comments/CommentTarget.js +1 -1
- package/dist/cjs/components/Comments/CommentWrapper.js +2 -2
- package/dist/cjs/components/FileManager/FileActions.js +2 -2
- package/dist/cjs/components/FileManager/FileManager.js +6 -6
- package/dist/cjs/components/FileManager/FileName.js +1 -1
- package/dist/cjs/components/FileManager/InlineFilesSection.js +1 -1
- package/dist/cjs/components/FileManager/OtherFilesSection.js +1 -1
- package/dist/cjs/components/FileManager/SupplementsSection.js +2 -2
- package/dist/cjs/index.js +3 -0
- package/dist/es/components/AffiliationsList.js +36 -0
- package/dist/es/components/AuthorsContainer.js +41 -0
- package/dist/es/components/AuthorsList/Author.js +69 -0
- package/dist/es/components/AuthorsList/AuthorsList.js +45 -0
- package/dist/es/components/AuthorsList/index.js +16 -0
- package/dist/es/components/Comments/CommentBody.js +1 -1
- package/dist/es/components/Comments/CommentTarget.js +1 -1
- package/dist/es/components/Comments/CommentWrapper.js +2 -2
- package/dist/es/components/FileManager/FileActions.js +2 -2
- package/dist/es/components/FileManager/FileManager.js +6 -6
- package/dist/es/components/FileManager/FileName.js +1 -1
- package/dist/es/components/FileManager/InlineFilesSection.js +1 -1
- package/dist/es/components/FileManager/OtherFilesSection.js +1 -1
- package/dist/es/components/FileManager/SupplementsSection.js +2 -2
- package/dist/es/index.js +3 -0
- package/dist/types/components/AffiliationsList.d.ts +22 -0
- package/dist/types/components/AuthorsContainer.d.ts +25 -0
- package/dist/types/components/AuthorsList/Author.d.ts +29 -0
- package/dist/types/components/AuthorsList/AuthorsList.d.ts +28 -0
- package/dist/types/components/AuthorsList/index.d.ts +16 -0
- package/dist/types/index.d.ts +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* © 2019 Atypon Systems LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.AffiliationsList = void 0;
|
|
22
|
+
const react_1 = __importDefault(require("react"));
|
|
23
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
24
|
+
const formatAddress_1 = __importDefault(require("../lib/formatAddress"));
|
|
25
|
+
const Container = styled_components_1.default.table `
|
|
26
|
+
border-collapse: collapse;
|
|
27
|
+
font: inherit;
|
|
28
|
+
color: ${(props) => props.theme.colors.text.secondary};
|
|
29
|
+
margin-top: ${(props) => props.theme.grid.unit * 4}px;
|
|
30
|
+
`;
|
|
31
|
+
const Header = styled_components_1.default.th `
|
|
32
|
+
font-weight: ${(props) => props.theme.font.weight.normal}
|
|
33
|
+
padding: 0 4px 0 0;
|
|
34
|
+
vertical-align: top;
|
|
35
|
+
`;
|
|
36
|
+
const Body = styled_components_1.default.td `
|
|
37
|
+
padding: 0;
|
|
38
|
+
`;
|
|
39
|
+
const AffiliationsList = ({ affiliations, }) => (react_1.default.createElement(Container, null,
|
|
40
|
+
react_1.default.createElement("tbody", null, Array.from(affiliations.values()).map((affiliation, index) => (react_1.default.createElement("tr", { key: affiliation._id },
|
|
41
|
+
react_1.default.createElement(Header, null, index + 1),
|
|
42
|
+
react_1.default.createElement(Body, null, (0, formatAddress_1.default)(affiliation))))))));
|
|
43
|
+
exports.AffiliationsList = AffiliationsList;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* © 2021 Atypon Systems LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
|
+
};
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
exports.AuthorsContainer = void 0;
|
|
45
|
+
const react_1 = __importStar(require("react"));
|
|
46
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
47
|
+
const AffiliationsList_1 = require("./AffiliationsList");
|
|
48
|
+
const AuthorsList_1 = require("./AuthorsList");
|
|
49
|
+
const AuthorsContainer = ({ authorData, showEditButton, startEditing, selectAuthor, disableEditButton, }) => {
|
|
50
|
+
const authorAffiliations = (0, react_1.useMemo)(() => authorData.authors.filter((author) => author.role === 'author'), [authorData.authors]);
|
|
51
|
+
const isThereJointContributor = (0, react_1.useMemo)(() => authorData.authors.find((contributor) => contributor.isJointContributor), [authorData.authors]);
|
|
52
|
+
return (react_1.default.createElement(Container, { "data-cy": 'author-container' },
|
|
53
|
+
react_1.default.createElement(AuthorsList_1.AuthorsList, { authors: authorAffiliations, authorAffiliations: authorData.authorAffiliations, startEditing: startEditing, showEditButton: showEditButton, selectAuthor: selectAuthor, disableEditButton: disableEditButton }),
|
|
54
|
+
react_1.default.createElement(AffiliationsList_1.AffiliationsList, { affiliations: authorData.affiliations }),
|
|
55
|
+
isThereJointContributor && (react_1.default.createElement(LegendWrapper, null,
|
|
56
|
+
react_1.default.createElement(Legend, null, "\u2020"),
|
|
57
|
+
"These authors contributed equally to this work."))));
|
|
58
|
+
};
|
|
59
|
+
exports.AuthorsContainer = AuthorsContainer;
|
|
60
|
+
const Container = styled_components_1.default.div `
|
|
61
|
+
margin-top: ${(props) => props.theme.grid.unit * 4}px;
|
|
62
|
+
`;
|
|
63
|
+
const LegendWrapper = styled_components_1.default.p `
|
|
64
|
+
margin: ${(props) => props.theme.grid.unit * 4}px 0 0 0;
|
|
65
|
+
`;
|
|
66
|
+
const Legend = styled_components_1.default.span `
|
|
67
|
+
display: inline-block;
|
|
68
|
+
font-size: 0.75em;
|
|
69
|
+
line-height: 1;
|
|
70
|
+
vertical-align: top;
|
|
71
|
+
`;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* © 2019 Atypon Systems LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
42
|
+
};
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
exports.Author = void 0;
|
|
45
|
+
const react_1 = __importDefault(require("react"));
|
|
46
|
+
const styled_components_1 = __importStar(require("styled-components"));
|
|
47
|
+
const AuthorName_1 = require("../AuthorName");
|
|
48
|
+
const AuthorNotes = styled_components_1.default.span `
|
|
49
|
+
display: inline-block;
|
|
50
|
+
font-size: 0.75em;
|
|
51
|
+
line-height: 1;
|
|
52
|
+
vertical-align: top;
|
|
53
|
+
`;
|
|
54
|
+
const LinkSharedStyles = (0, styled_components_1.css) `
|
|
55
|
+
text-decoration: none;
|
|
56
|
+
color: inherit;
|
|
57
|
+
outline: none;
|
|
58
|
+
|
|
59
|
+
&:not(:disabled) {
|
|
60
|
+
&:hover,
|
|
61
|
+
&:focus {
|
|
62
|
+
&,
|
|
63
|
+
span {
|
|
64
|
+
color: ${(props) => props.theme.colors.text.tertiary};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
`;
|
|
69
|
+
const AuthorAffiliation = styled_components_1.default.span `
|
|
70
|
+
${LinkSharedStyles}
|
|
71
|
+
`;
|
|
72
|
+
const AuthorsContainer = styled_components_1.default.button `
|
|
73
|
+
display: inline-flex;
|
|
74
|
+
background: transparent;
|
|
75
|
+
border: 0;
|
|
76
|
+
font-size: 1rem;
|
|
77
|
+
${LinkSharedStyles}
|
|
78
|
+
|
|
79
|
+
&:not(:disabled) {
|
|
80
|
+
&:hover {
|
|
81
|
+
text-decoration: underline;
|
|
82
|
+
cursor: pointer !important;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
`;
|
|
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) => {
|
|
88
|
+
e.preventDefault();
|
|
89
|
+
startEditing && startEditing();
|
|
90
|
+
selectAuthor && selectAuthor(author);
|
|
91
|
+
} },
|
|
92
|
+
react_1.default.createElement(AuthorName_1.AuthorName, { name: author.bibliographicName, email: (author.isCorresponding && author.email) || undefined }))) : (react_1.default.createElement(AuthorName_1.AuthorName, { name: author.bibliographicName, email: (author.isCorresponding && author.email) || undefined })),
|
|
93
|
+
affiliations && (react_1.default.createElement(AuthorNotes, null, affiliations.map((affiliation, index) => (react_1.default.createElement(react_1.default.Fragment, { key: affiliation.data._id },
|
|
94
|
+
!!index && ',',
|
|
95
|
+
react_1.default.createElement(AuthorAffiliation, null, affiliation.ordinal)))))),
|
|
96
|
+
author.isCorresponding && (react_1.default.createElement(AuthorNotes, { title: 'Corresponding author' }, "*")),
|
|
97
|
+
jointFirstAuthor && (react_1.default.createElement(AuthorNotes, { title: 'Joint contributor' }, "\u2020"))));
|
|
98
|
+
exports.Author = Author;
|
|
99
|
+
exports.default = exports.Author;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* © 2019 Atypon Systems LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.AuthorsList = void 0;
|
|
22
|
+
const react_1 = __importDefault(require("react"));
|
|
23
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
24
|
+
const authors_1 = require("../../lib/authors");
|
|
25
|
+
const Button_1 = require("../Button");
|
|
26
|
+
const Author_1 = require("./Author");
|
|
27
|
+
const AuthorsContainer = styled_components_1.default.div `
|
|
28
|
+
align-items: center;
|
|
29
|
+
display: flex;
|
|
30
|
+
|
|
31
|
+
@media (min-width: 768px) {
|
|
32
|
+
& ${Button_1.PrimaryButton} {
|
|
33
|
+
display: ${(props) => (props.isEmpty ? 'initial' : 'none')};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&:hover ${Button_1.PrimaryButton} {
|
|
37
|
+
display: initial;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
const AuthorsActions = styled_components_1.default.div `
|
|
42
|
+
align-items: center;
|
|
43
|
+
display: flex;
|
|
44
|
+
margin-left: ${(props) => props.theme.grid.unit * 2}px;
|
|
45
|
+
`;
|
|
46
|
+
const AuthorsList = ({ authors, authorAffiliations, startEditing, showEditButton, disableEditButton, selectAuthor, }) => (react_1.default.createElement(AuthorsContainer, { isEmpty: !authors.length },
|
|
47
|
+
react_1.default.createElement("div", null, authors.map((author, index) => (react_1.default.createElement(react_1.default.Fragment, { key: author._id },
|
|
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, disableEditButton: disableEditButton }))))),
|
|
50
|
+
showEditButton && startEditing && (react_1.default.createElement(AuthorsActions, null,
|
|
51
|
+
react_1.default.createElement(Button_1.PrimaryButton, { mini: true, onClick: startEditing, className: 'edit_authors_button', disabled: disableEditButton }, "Edit Authors")))));
|
|
52
|
+
exports.AuthorsList = AuthorsList;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*!
|
|
3
|
+
* © 2019 Atypon Systems LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
29
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
30
|
+
};
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
__exportStar(require("./AuthorsList"), exports);
|
|
@@ -63,7 +63,7 @@ exports.CommentBody = react_1.default.memo(({ comment, saveComment, deleteCommen
|
|
|
63
63
|
(comment.contents === values.contents ||
|
|
64
64
|
!values.contents.replace(/<[^>]+>/g, '').length)), type: "submit" }, "Save"))))))) : (react_1.default.createElement("div", null,
|
|
65
65
|
react_1.default.createElement(CommentContent, { onClick: () => scrollIntoHighlight && scrollIntoHighlight(comment) },
|
|
66
|
-
react_1.default.createElement(StyledCommentViewer,
|
|
66
|
+
react_1.default.createElement(StyledCommentViewer, { "data-cy": "note-text" }, comment.contents)),
|
|
67
67
|
!isReply && (react_1.default.createElement(CommentFooter, null,
|
|
68
68
|
react_1.default.createElement("span", null,
|
|
69
69
|
react_1.default.createElement(ActionButton, { hidden: !isProdNote, "data-tip": true, "data-for": `reply-${comment._id}`, onClick: () => handleCreateReply(comment._id), "aria-label": 'reply', className: "reply-button note-actions" },
|
|
@@ -51,5 +51,5 @@ exports.CommentTarget = react_1.default.memo(({ isSelected, children }) => {
|
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
-
return react_1.default.createElement("div", { ref: threadRef }, children);
|
|
54
|
+
return (react_1.default.createElement("div", { "data-cy": "comment-target", ref: threadRef }, children));
|
|
55
55
|
});
|
|
@@ -84,8 +84,8 @@ const CommentWrapper = ({ createKeyword, comment, can, currentUserId, getCollabo
|
|
|
84
84
|
}
|
|
85
85
|
}, [handleRequestSelect]);
|
|
86
86
|
const isOwnComment = (0, react_1.useMemo)(() => isOwn(comment, currentUserId), [comment, currentUserId]);
|
|
87
|
-
return (react_1.default.createElement(Note, { ref: threadRef, isSelected: isSelected },
|
|
88
|
-
react_1.default.createElement(NoteHeader,
|
|
87
|
+
return (react_1.default.createElement(Note, { "data-cy": "note", ref: threadRef, isSelected: isSelected },
|
|
88
|
+
react_1.default.createElement(NoteHeader, { "data-cy": "note-header" },
|
|
89
89
|
react_1.default.createElement(NoteTitle, { type: "button", onMouseDown: onTitleMouseDown, onKeyDown: onTitleKeyDown }, comment.contributions && (react_1.default.createElement(CommentUser_1.CommentUser, { contributions: comment.contributions, getCollaboratorById: getCollaborator, displayName: comment.displayName, createdAt: (0, comments_1.isSavedComment)(comment) ? comment.createdAt * 1000 : undefined }))),
|
|
90
90
|
react_1.default.createElement(CommentActions_1.CommentActions, { id: comment._id, isOwnComment: isOwnComment, can: can, target: comment.target, isResolved: comment.resolved, handleSetResolved: handleSetResolved, deleteComment: deleteComment, setIsEditing: setIsEditing, isProdNote: isProdNote })),
|
|
91
91
|
children,
|
|
@@ -65,9 +65,9 @@ const FileActions = ({ sectionType, handleDownload, handleReplace, handleDetach,
|
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
return show ? (react_1.default.createElement(Dropdown_1.DropdownContainer, { ref: wrapperRef },
|
|
68
|
-
react_1.default.createElement(exports.ActionsIcon, { onClick: toggleOpen, type: "button", className: "show-on-hover", "aria-label": "Actions", "aria-pressed": isOpen },
|
|
68
|
+
react_1.default.createElement(exports.ActionsIcon, { onClick: toggleOpen, type: "button", className: "show-on-hover", "data-cy": "file-actions", "aria-label": "Actions", "aria-pressed": isOpen },
|
|
69
69
|
react_1.default.createElement(dots_icon_1.default, null)),
|
|
70
|
-
isOpen && (react_1.default.createElement(exports.FileActionDropdownList, { direction: "right", className: className, width: 192, top: 5, onClick: toggleOpen },
|
|
70
|
+
isOpen && (react_1.default.createElement(exports.FileActionDropdownList, { "data-cy": "file-actions-dropdown", direction: "right", className: className, width: 192, top: 5, onClick: toggleOpen },
|
|
71
71
|
showDownload && (react_1.default.createElement(exports.FileAction, { onClick: handleDownload }, "Download")),
|
|
72
72
|
showReplace && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
73
73
|
react_1.default.createElement(exports.FileAction, { onClick: openFileDialog }, "Replace"),
|
|
@@ -50,11 +50,11 @@ const FileManager = ({ files, fileManagement, modelMap, saveModel, deleteModel,
|
|
|
50
50
|
react_1.default.createElement(Inspector_1.InspectorTab, { "data-for": "other", "data-tip": true }, "Other files"),
|
|
51
51
|
react_1.default.createElement(Tooltip_1.Tooltip, { id: "other", place: "bottom", offset: { bottom: -11 }, effect: "solid", className: "tooltip" }, "Files excluded from the final submission.")),
|
|
52
52
|
react_1.default.createElement(Inspector_1.InspectorTabPanels, { style: { overflowY: 'visible', position: 'relative' } },
|
|
53
|
-
react_1.default.createElement(Inspector_1.InspectorTabPanel,
|
|
54
|
-
react_1.default.createElement(InlineFilesSection_1.InlineFilesSection, {
|
|
55
|
-
react_1.default.createElement(Inspector_1.InspectorTabPanel,
|
|
56
|
-
react_1.default.createElement(SupplementsSection_1.SupplementsSection, {
|
|
57
|
-
react_1.default.createElement(Inspector_1.InspectorTabPanel,
|
|
58
|
-
react_1.default.createElement(OtherFilesSection_1.OtherFilesSection, {
|
|
53
|
+
react_1.default.createElement(Inspector_1.InspectorTabPanel, { "data-cy": "inline" },
|
|
54
|
+
react_1.default.createElement(InlineFilesSection_1.InlineFilesSection, { elements: inlineFiles, isEditor: enableDragAndDrop })),
|
|
55
|
+
react_1.default.createElement(Inspector_1.InspectorTabPanel, { "data-cy": "supplements" },
|
|
56
|
+
react_1.default.createElement(SupplementsSection_1.SupplementsSection, { supplements: supplements })),
|
|
57
|
+
react_1.default.createElement(Inspector_1.InspectorTabPanel, { "data-cy": "other" },
|
|
58
|
+
react_1.default.createElement(OtherFilesSection_1.OtherFilesSection, { files: otherFiles }))))))));
|
|
59
59
|
};
|
|
60
60
|
exports.FileManager = FileManager;
|
|
@@ -10,7 +10,7 @@ const FileTypeIcon_1 = require("./FileTypeIcon");
|
|
|
10
10
|
const FileName = ({ file }) => {
|
|
11
11
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
12
12
|
react_1.default.createElement(FileTypeIcon_1.FileTypeIcon, { file: file }),
|
|
13
|
-
react_1.default.createElement(exports.FileNameText,
|
|
13
|
+
react_1.default.createElement(exports.FileNameText, { "data-cy": "filename" }, file.name)));
|
|
14
14
|
};
|
|
15
15
|
exports.FileName = FileName;
|
|
16
16
|
exports.FileNameText = styled_components_1.default.div `
|
|
@@ -84,7 +84,7 @@ const InlineFilesSection = ({ elements, isEditor }) => {
|
|
|
84
84
|
};
|
|
85
85
|
exports.InlineFilesSection = InlineFilesSection;
|
|
86
86
|
const ElementFile = ({ file, handleReplace, handleDownload, handleDetach }) => {
|
|
87
|
-
return (react_1.default.createElement(ModelFileContainer,
|
|
87
|
+
return (react_1.default.createElement(ModelFileContainer, { "data-cy": "file-container" },
|
|
88
88
|
react_1.default.createElement(FileName_1.FileName, { file: file }),
|
|
89
89
|
react_1.default.createElement(FileCreatedDate_1.FileCreatedDate, { file: file, className: "show-on-hover" }),
|
|
90
90
|
react_1.default.createElement(FileActions_1.FileActions, { "data-cy": "file-actions", sectionType: util_1.FileSectionType.Inline, handleDownload: file.id ? handleDownload : undefined, handleDetach: file.id ? handleDetach : undefined, handleReplace: handleReplace })));
|
|
@@ -91,7 +91,7 @@ const OtherFile = ({ file, handleDownload, handleMoveToSupplements }) => {
|
|
|
91
91
|
(0, react_1.useEffect)(() => {
|
|
92
92
|
preview((0, react_dnd_html5_backend_1.getEmptyImage)());
|
|
93
93
|
}, [preview]);
|
|
94
|
-
return (react_1.default.createElement(FileContainer_1.FileContainer, { key: file.id, ref: drag, className: isDragging ? 'dragging' : '' },
|
|
94
|
+
return (react_1.default.createElement(FileContainer_1.FileContainer, { key: file.id, "data-cy": "file-container", ref: drag, className: isDragging ? 'dragging' : '' },
|
|
95
95
|
react_1.default.createElement(FileName_1.FileName, { file: file }),
|
|
96
96
|
react_1.default.createElement(FileCreatedDate_1.FileCreatedDate, { file: file, className: "show-on-hover" }),
|
|
97
97
|
react_1.default.createElement(FileActions_1.FileActions, { sectionType: util_1.FileSectionType.OtherFile, handleDownload: handleDownload, move: {
|
|
@@ -106,10 +106,10 @@ const SupplementFile = ({ file, handleDownload, handleReplace, handleDetach }) =
|
|
|
106
106
|
(0, react_1.useEffect)(() => {
|
|
107
107
|
preview((0, react_dnd_html5_backend_1.getEmptyImage)());
|
|
108
108
|
}, [preview]);
|
|
109
|
-
return (react_1.default.createElement(FileContainer_1.FileContainer, { key: file.id, ref: drag, className: isDragging ? 'dragging' : '' },
|
|
109
|
+
return (react_1.default.createElement(FileContainer_1.FileContainer, { "data-cy": "file-container", key: file.id, ref: drag, className: isDragging ? 'dragging' : '' },
|
|
110
110
|
react_1.default.createElement(FileName_1.FileName, { file: file }),
|
|
111
111
|
react_1.default.createElement(FileCreatedDate_1.FileCreatedDate, { file: file, className: "show-on-hover" }),
|
|
112
|
-
react_1.default.createElement(FileActions_1.FileActions, { sectionType: util_1.FileSectionType.Supplements, handleDownload: file.id ? handleDownload : undefined, handleReplace: handleReplace, move: file.id
|
|
112
|
+
react_1.default.createElement(FileActions_1.FileActions, { "data-cy": "file-actions", sectionType: util_1.FileSectionType.Supplements, handleDownload: file.id ? handleDownload : undefined, handleReplace: handleReplace, move: file.id
|
|
113
113
|
? {
|
|
114
114
|
sectionType: util_1.FileSectionType.OtherFile,
|
|
115
115
|
handler: handleDetach,
|
package/dist/cjs/index.js
CHANGED
|
@@ -34,9 +34,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
35
|
exports.errorsDecoder = exports.useDeepCompareCallback = exports.useDeepCompareMemo = void 0;
|
|
36
36
|
__exportStar(require("./components/AffiliationsEditor"), exports);
|
|
37
|
+
__exportStar(require("./components/AffiliationsList"), exports);
|
|
37
38
|
__exportStar(require("./components/AuthorForm"), exports);
|
|
38
39
|
__exportStar(require("./components/AuthorName"), exports);
|
|
40
|
+
__exportStar(require("./components/AuthorsList"), exports);
|
|
39
41
|
__exportStar(require("./components/AuthorsDND"), exports);
|
|
42
|
+
__exportStar(require("./components/AuthorsContainer"), exports);
|
|
40
43
|
__exportStar(require("./components/AlertMessage"), exports);
|
|
41
44
|
__exportStar(require("./components/Button"), exports);
|
|
42
45
|
__exportStar(require("./components/ColorField"), exports);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2019 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 formatAddress from '../lib/formatAddress';
|
|
19
|
+
const Container = styled.table `
|
|
20
|
+
border-collapse: collapse;
|
|
21
|
+
font: inherit;
|
|
22
|
+
color: ${(props) => props.theme.colors.text.secondary};
|
|
23
|
+
margin-top: ${(props) => props.theme.grid.unit * 4}px;
|
|
24
|
+
`;
|
|
25
|
+
const Header = styled.th `
|
|
26
|
+
font-weight: ${(props) => props.theme.font.weight.normal}
|
|
27
|
+
padding: 0 4px 0 0;
|
|
28
|
+
vertical-align: top;
|
|
29
|
+
`;
|
|
30
|
+
const Body = styled.td `
|
|
31
|
+
padding: 0;
|
|
32
|
+
`;
|
|
33
|
+
export const AffiliationsList = ({ affiliations, }) => (React.createElement(Container, null,
|
|
34
|
+
React.createElement("tbody", null, Array.from(affiliations.values()).map((affiliation, index) => (React.createElement("tr", { key: affiliation._id },
|
|
35
|
+
React.createElement(Header, null, index + 1),
|
|
36
|
+
React.createElement(Body, null, formatAddress(affiliation))))))));
|
|
@@ -0,0 +1,41 @@
|
|
|
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, { useMemo } from 'react';
|
|
17
|
+
import styled from 'styled-components';
|
|
18
|
+
import { AffiliationsList } from './AffiliationsList';
|
|
19
|
+
import { AuthorsList } from './AuthorsList';
|
|
20
|
+
export const AuthorsContainer = ({ authorData, showEditButton, startEditing, selectAuthor, disableEditButton, }) => {
|
|
21
|
+
const authorAffiliations = useMemo(() => authorData.authors.filter((author) => author.role === 'author'), [authorData.authors]);
|
|
22
|
+
const isThereJointContributor = useMemo(() => authorData.authors.find((contributor) => contributor.isJointContributor), [authorData.authors]);
|
|
23
|
+
return (React.createElement(Container, { "data-cy": 'author-container' },
|
|
24
|
+
React.createElement(AuthorsList, { authors: authorAffiliations, authorAffiliations: authorData.authorAffiliations, startEditing: startEditing, showEditButton: showEditButton, selectAuthor: selectAuthor, disableEditButton: disableEditButton }),
|
|
25
|
+
React.createElement(AffiliationsList, { affiliations: authorData.affiliations }),
|
|
26
|
+
isThereJointContributor && (React.createElement(LegendWrapper, null,
|
|
27
|
+
React.createElement(Legend, null, "\u2020"),
|
|
28
|
+
"These authors contributed equally to this work."))));
|
|
29
|
+
};
|
|
30
|
+
const Container = styled.div `
|
|
31
|
+
margin-top: ${(props) => props.theme.grid.unit * 4}px;
|
|
32
|
+
`;
|
|
33
|
+
const LegendWrapper = styled.p `
|
|
34
|
+
margin: ${(props) => props.theme.grid.unit * 4}px 0 0 0;
|
|
35
|
+
`;
|
|
36
|
+
const Legend = styled.span `
|
|
37
|
+
display: inline-block;
|
|
38
|
+
font-size: 0.75em;
|
|
39
|
+
line-height: 1;
|
|
40
|
+
vertical-align: top;
|
|
41
|
+
`;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2019 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, { css } from 'styled-components';
|
|
18
|
+
import { AuthorName } from '../AuthorName';
|
|
19
|
+
const AuthorNotes = styled.span `
|
|
20
|
+
display: inline-block;
|
|
21
|
+
font-size: 0.75em;
|
|
22
|
+
line-height: 1;
|
|
23
|
+
vertical-align: top;
|
|
24
|
+
`;
|
|
25
|
+
const LinkSharedStyles = css `
|
|
26
|
+
text-decoration: none;
|
|
27
|
+
color: inherit;
|
|
28
|
+
outline: none;
|
|
29
|
+
|
|
30
|
+
&:not(:disabled) {
|
|
31
|
+
&:hover,
|
|
32
|
+
&:focus {
|
|
33
|
+
&,
|
|
34
|
+
span {
|
|
35
|
+
color: ${(props) => props.theme.colors.text.tertiary};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
const AuthorAffiliation = styled.span `
|
|
41
|
+
${LinkSharedStyles}
|
|
42
|
+
`;
|
|
43
|
+
const AuthorsContainer = styled.button `
|
|
44
|
+
display: inline-flex;
|
|
45
|
+
background: transparent;
|
|
46
|
+
border: 0;
|
|
47
|
+
font-size: 1rem;
|
|
48
|
+
${LinkSharedStyles}
|
|
49
|
+
|
|
50
|
+
&:not(:disabled) {
|
|
51
|
+
&:hover {
|
|
52
|
+
text-decoration: underline;
|
|
53
|
+
cursor: pointer !important;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
`;
|
|
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) => {
|
|
59
|
+
e.preventDefault();
|
|
60
|
+
startEditing && startEditing();
|
|
61
|
+
selectAuthor && selectAuthor(author);
|
|
62
|
+
} },
|
|
63
|
+
React.createElement(AuthorName, { name: author.bibliographicName, email: (author.isCorresponding && author.email) || undefined }))) : (React.createElement(AuthorName, { name: author.bibliographicName, email: (author.isCorresponding && author.email) || undefined })),
|
|
64
|
+
affiliations && (React.createElement(AuthorNotes, null, affiliations.map((affiliation, index) => (React.createElement(React.Fragment, { key: affiliation.data._id },
|
|
65
|
+
!!index && ',',
|
|
66
|
+
React.createElement(AuthorAffiliation, null, affiliation.ordinal)))))),
|
|
67
|
+
author.isCorresponding && (React.createElement(AuthorNotes, { title: 'Corresponding author' }, "*")),
|
|
68
|
+
jointFirstAuthor && (React.createElement(AuthorNotes, { title: 'Joint contributor' }, "\u2020"))));
|
|
69
|
+
export default Author;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2019 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 { isJointFirstAuthor } from '../../lib/authors';
|
|
19
|
+
import { PrimaryButton } from '../Button';
|
|
20
|
+
import { Author } from './Author';
|
|
21
|
+
const AuthorsContainer = styled.div `
|
|
22
|
+
align-items: center;
|
|
23
|
+
display: flex;
|
|
24
|
+
|
|
25
|
+
@media (min-width: 768px) {
|
|
26
|
+
& ${PrimaryButton} {
|
|
27
|
+
display: ${(props) => (props.isEmpty ? 'initial' : 'none')};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&:hover ${PrimaryButton} {
|
|
31
|
+
display: initial;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
const AuthorsActions = styled.div `
|
|
36
|
+
align-items: center;
|
|
37
|
+
display: flex;
|
|
38
|
+
margin-left: ${(props) => props.theme.grid.unit * 2}px;
|
|
39
|
+
`;
|
|
40
|
+
export const AuthorsList = ({ authors, authorAffiliations, startEditing, showEditButton, disableEditButton, selectAuthor, }) => (React.createElement(AuthorsContainer, { isEmpty: !authors.length },
|
|
41
|
+
React.createElement("div", null, authors.map((author, index) => (React.createElement(React.Fragment, { key: author._id },
|
|
42
|
+
!!index && ', ',
|
|
43
|
+
React.createElement(Author, { author: author, jointFirstAuthor: isJointFirstAuthor(authors, index), affiliations: authorAffiliations.get(author._id), selectAuthor: selectAuthor, startEditing: startEditing, showEditButton: showEditButton, disableEditButton: disableEditButton }))))),
|
|
44
|
+
showEditButton && startEditing && (React.createElement(AuthorsActions, null,
|
|
45
|
+
React.createElement(PrimaryButton, { mini: true, onClick: startEditing, className: 'edit_authors_button', disabled: disableEditButton }, "Edit Authors")))));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2019 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
|
+
export * from './AuthorsList';
|
|
@@ -34,7 +34,7 @@ export const CommentBody = React.memo(({ comment, saveComment, deleteComment, is
|
|
|
34
34
|
(comment.contents === values.contents ||
|
|
35
35
|
!values.contents.replace(/<[^>]+>/g, '').length)), type: "submit" }, "Save"))))))) : (React.createElement("div", null,
|
|
36
36
|
React.createElement(CommentContent, { onClick: () => scrollIntoHighlight && scrollIntoHighlight(comment) },
|
|
37
|
-
React.createElement(StyledCommentViewer,
|
|
37
|
+
React.createElement(StyledCommentViewer, { "data-cy": "note-text" }, comment.contents)),
|
|
38
38
|
!isReply && (React.createElement(CommentFooter, null,
|
|
39
39
|
React.createElement("span", null,
|
|
40
40
|
React.createElement(ActionButton, { hidden: !isProdNote, "data-tip": true, "data-for": `reply-${comment._id}`, onClick: () => handleCreateReply(comment._id), "aria-label": 'reply', className: "reply-button note-actions" },
|
|
@@ -55,8 +55,8 @@ export const CommentWrapper = ({ createKeyword, comment, can, currentUserId, get
|
|
|
55
55
|
}
|
|
56
56
|
}, [handleRequestSelect]);
|
|
57
57
|
const isOwnComment = useMemo(() => isOwn(comment, currentUserId), [comment, currentUserId]);
|
|
58
|
-
return (React.createElement(Note, { ref: threadRef, isSelected: isSelected },
|
|
59
|
-
React.createElement(NoteHeader,
|
|
58
|
+
return (React.createElement(Note, { "data-cy": "note", ref: threadRef, isSelected: isSelected },
|
|
59
|
+
React.createElement(NoteHeader, { "data-cy": "note-header" },
|
|
60
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
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
62
|
children,
|
|
@@ -36,9 +36,9 @@ export const FileActions = ({ sectionType, handleDownload, handleReplace, handle
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
return show ? (React.createElement(DropdownContainer, { ref: wrapperRef },
|
|
39
|
-
React.createElement(ActionsIcon, { onClick: toggleOpen, type: "button", className: "show-on-hover", "aria-label": "Actions", "aria-pressed": isOpen },
|
|
39
|
+
React.createElement(ActionsIcon, { onClick: toggleOpen, type: "button", className: "show-on-hover", "data-cy": "file-actions", "aria-label": "Actions", "aria-pressed": isOpen },
|
|
40
40
|
React.createElement(DotsIcon, null)),
|
|
41
|
-
isOpen && (React.createElement(FileActionDropdownList, { direction: "right", className: className, width: 192, top: 5, onClick: toggleOpen },
|
|
41
|
+
isOpen && (React.createElement(FileActionDropdownList, { "data-cy": "file-actions-dropdown", direction: "right", className: className, width: 192, top: 5, onClick: toggleOpen },
|
|
42
42
|
showDownload && (React.createElement(FileAction, { onClick: handleDownload }, "Download")),
|
|
43
43
|
showReplace && (React.createElement(React.Fragment, null,
|
|
44
44
|
React.createElement(FileAction, { onClick: openFileDialog }, "Replace"),
|
|
@@ -24,10 +24,10 @@ export const FileManager = ({ files, fileManagement, modelMap, saveModel, delete
|
|
|
24
24
|
React.createElement(InspectorTab, { "data-for": "other", "data-tip": true }, "Other files"),
|
|
25
25
|
React.createElement(Tooltip, { id: "other", place: "bottom", offset: { bottom: -11 }, effect: "solid", className: "tooltip" }, "Files excluded from the final submission.")),
|
|
26
26
|
React.createElement(InspectorTabPanels, { style: { overflowY: 'visible', position: 'relative' } },
|
|
27
|
-
React.createElement(InspectorTabPanel,
|
|
28
|
-
React.createElement(InlineFilesSection, {
|
|
29
|
-
React.createElement(InspectorTabPanel,
|
|
30
|
-
React.createElement(SupplementsSection, {
|
|
31
|
-
React.createElement(InspectorTabPanel,
|
|
32
|
-
React.createElement(OtherFilesSection, {
|
|
27
|
+
React.createElement(InspectorTabPanel, { "data-cy": "inline" },
|
|
28
|
+
React.createElement(InlineFilesSection, { elements: inlineFiles, isEditor: enableDragAndDrop })),
|
|
29
|
+
React.createElement(InspectorTabPanel, { "data-cy": "supplements" },
|
|
30
|
+
React.createElement(SupplementsSection, { supplements: supplements })),
|
|
31
|
+
React.createElement(InspectorTabPanel, { "data-cy": "other" },
|
|
32
|
+
React.createElement(OtherFilesSection, { files: otherFiles }))))))));
|
|
33
33
|
};
|
|
@@ -4,7 +4,7 @@ import { FileTypeIcon } from './FileTypeIcon';
|
|
|
4
4
|
export const FileName = ({ file }) => {
|
|
5
5
|
return (React.createElement(React.Fragment, null,
|
|
6
6
|
React.createElement(FileTypeIcon, { file: file }),
|
|
7
|
-
React.createElement(FileNameText,
|
|
7
|
+
React.createElement(FileNameText, { "data-cy": "filename" }, file.name)));
|
|
8
8
|
};
|
|
9
9
|
export const FileNameText = styled.div `
|
|
10
10
|
font-family: ${(props) => props.theme.font.family.Lato};
|
|
@@ -54,7 +54,7 @@ export const InlineFilesSection = ({ elements, isEditor }) => {
|
|
|
54
54
|
})));
|
|
55
55
|
};
|
|
56
56
|
const ElementFile = ({ file, handleReplace, handleDownload, handleDetach }) => {
|
|
57
|
-
return (React.createElement(ModelFileContainer,
|
|
57
|
+
return (React.createElement(ModelFileContainer, { "data-cy": "file-container" },
|
|
58
58
|
React.createElement(FileName, { file: file }),
|
|
59
59
|
React.createElement(FileCreatedDate, { file: file, className: "show-on-hover" }),
|
|
60
60
|
React.createElement(FileActions, { "data-cy": "file-actions", sectionType: FileSectionType.Inline, handleDownload: file.id ? handleDownload : undefined, handleDetach: file.id ? handleDetach : undefined, handleReplace: handleReplace })));
|
|
@@ -64,7 +64,7 @@ const OtherFile = ({ file, handleDownload, handleMoveToSupplements }) => {
|
|
|
64
64
|
useEffect(() => {
|
|
65
65
|
preview(getEmptyImage());
|
|
66
66
|
}, [preview]);
|
|
67
|
-
return (React.createElement(FileContainer, { key: file.id, ref: drag, className: isDragging ? 'dragging' : '' },
|
|
67
|
+
return (React.createElement(FileContainer, { key: file.id, "data-cy": "file-container", ref: drag, className: isDragging ? 'dragging' : '' },
|
|
68
68
|
React.createElement(FileName, { file: file }),
|
|
69
69
|
React.createElement(FileCreatedDate, { file: file, className: "show-on-hover" }),
|
|
70
70
|
React.createElement(FileActions, { sectionType: FileSectionType.OtherFile, handleDownload: handleDownload, move: {
|
|
@@ -79,10 +79,10 @@ const SupplementFile = ({ file, handleDownload, handleReplace, handleDetach }) =
|
|
|
79
79
|
useEffect(() => {
|
|
80
80
|
preview(getEmptyImage());
|
|
81
81
|
}, [preview]);
|
|
82
|
-
return (React.createElement(FileContainer, { key: file.id, ref: drag, className: isDragging ? 'dragging' : '' },
|
|
82
|
+
return (React.createElement(FileContainer, { "data-cy": "file-container", key: file.id, ref: drag, className: isDragging ? 'dragging' : '' },
|
|
83
83
|
React.createElement(FileName, { file: file }),
|
|
84
84
|
React.createElement(FileCreatedDate, { file: file, className: "show-on-hover" }),
|
|
85
|
-
React.createElement(FileActions, { sectionType: FileSectionType.Supplements, handleDownload: file.id ? handleDownload : undefined, handleReplace: handleReplace, move: file.id
|
|
85
|
+
React.createElement(FileActions, { "data-cy": "file-actions", sectionType: FileSectionType.Supplements, handleDownload: file.id ? handleDownload : undefined, handleReplace: handleReplace, move: file.id
|
|
86
86
|
? {
|
|
87
87
|
sectionType: FileSectionType.OtherFile,
|
|
88
88
|
handler: handleDetach,
|
package/dist/es/index.js
CHANGED
|
@@ -14,9 +14,12 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
export * from './components/AffiliationsEditor';
|
|
17
|
+
export * from './components/AffiliationsList';
|
|
17
18
|
export * from './components/AuthorForm';
|
|
18
19
|
export * from './components/AuthorName';
|
|
20
|
+
export * from './components/AuthorsList';
|
|
19
21
|
export * from './components/AuthorsDND';
|
|
22
|
+
export * from './components/AuthorsContainer';
|
|
20
23
|
export * from './components/AlertMessage';
|
|
21
24
|
export * from './components/Button';
|
|
22
25
|
export * from './components/ColorField';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2019 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 { AffiliationMap } from '../types';
|
|
18
|
+
interface Props {
|
|
19
|
+
affiliations: AffiliationMap;
|
|
20
|
+
}
|
|
21
|
+
export declare const AffiliationsList: React.FunctionComponent<Props>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
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 { Contributor } from '@manuscripts/json-schema';
|
|
17
|
+
import React from 'react';
|
|
18
|
+
import { AuthorData } from '../types';
|
|
19
|
+
export declare const AuthorsContainer: React.FC<{
|
|
20
|
+
authorData: AuthorData;
|
|
21
|
+
showEditButton: boolean;
|
|
22
|
+
disableEditButton?: boolean;
|
|
23
|
+
startEditing: () => void;
|
|
24
|
+
selectAuthor: (data: Contributor) => void;
|
|
25
|
+
}>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2019 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 { Contributor } from '@manuscripts/json-schema';
|
|
17
|
+
import React from 'react';
|
|
18
|
+
import { AuthorAffiliation as AuthorAffiliationT } from '../../types';
|
|
19
|
+
interface AuthorProps {
|
|
20
|
+
author: Contributor;
|
|
21
|
+
affiliations?: AuthorAffiliationT[];
|
|
22
|
+
jointFirstAuthor: boolean;
|
|
23
|
+
showEditButton?: boolean;
|
|
24
|
+
disableEditButton?: boolean;
|
|
25
|
+
selectAuthor?: (data: Contributor) => void;
|
|
26
|
+
startEditing?: () => void;
|
|
27
|
+
}
|
|
28
|
+
export declare const Author: React.FunctionComponent<AuthorProps>;
|
|
29
|
+
export default Author;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2019 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 { Contributor } from '@manuscripts/json-schema';
|
|
17
|
+
import React from 'react';
|
|
18
|
+
import { AuthorAffiliation } from '../../types';
|
|
19
|
+
interface Props {
|
|
20
|
+
authors: Contributor[];
|
|
21
|
+
authorAffiliations: Map<string, AuthorAffiliation[]>;
|
|
22
|
+
showEditButton?: boolean;
|
|
23
|
+
disableEditButton?: boolean;
|
|
24
|
+
startEditing?: () => void;
|
|
25
|
+
selectAuthor?: (data: Contributor) => void;
|
|
26
|
+
}
|
|
27
|
+
export declare const AuthorsList: React.FunctionComponent<Props>;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2019 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
|
+
export * from './AuthorsList';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -15,9 +15,12 @@
|
|
|
15
15
|
*/
|
|
16
16
|
export { Theme } from './theme';
|
|
17
17
|
export * from './components/AffiliationsEditor';
|
|
18
|
+
export * from './components/AffiliationsList';
|
|
18
19
|
export * from './components/AuthorForm';
|
|
19
20
|
export * from './components/AuthorName';
|
|
21
|
+
export * from './components/AuthorsList';
|
|
20
22
|
export * from './components/AuthorsDND';
|
|
23
|
+
export * from './components/AuthorsContainer';
|
|
21
24
|
export * from './components/AlertMessage';
|
|
22
25
|
export * from './components/Button';
|
|
23
26
|
export * from './components/ColorField';
|
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.7.
|
|
4
|
+
"version": "1.7.1",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|