@manuscripts/style-guide 1.7.1 → 1.7.2-LEAN-3083
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/Comments/CommentBody.js +3 -3
- package/dist/cjs/components/Comments/CommentUser.js +1 -1
- package/dist/cjs/components/Comments/ResolveButton.js +3 -3
- package/dist/cjs/components/FileManager/FileCreatedDate.js +3 -3
- package/dist/cjs/components/FileManager/FileManager.js +7 -7
- package/dist/cjs/components/FileManager/OtherFilesSection.js +2 -2
- package/dist/cjs/components/FileManager/SupplementsSection.js +1 -2
- package/dist/cjs/components/References/CitationEditor.js +2 -2
- package/dist/cjs/components/References/ReferenceForm.js +8 -9
- package/dist/cjs/components/References/ReferenceSearch.js +2 -2
- package/dist/cjs/components/References/ReferencesModal.js +5 -5
- package/dist/cjs/components/RelativeDate.js +23 -6
- package/dist/cjs/components/{FileManager/Tooltip.js → Tooltip.js} +12 -7
- package/dist/cjs/index.js +1 -5
- package/dist/cjs/lib/files.js +4 -5
- package/dist/es/components/Comments/CommentBody.js +3 -3
- package/dist/es/components/Comments/CommentUser.js +1 -1
- package/dist/es/components/Comments/ResolveButton.js +3 -3
- package/dist/es/components/FileManager/FileCreatedDate.js +3 -3
- package/dist/es/components/FileManager/FileManager.js +7 -7
- package/dist/es/components/FileManager/OtherFilesSection.js +2 -2
- package/dist/es/components/FileManager/SupplementsSection.js +2 -3
- package/dist/es/components/References/CitationEditor.js +1 -1
- package/dist/es/components/References/ReferenceForm.js +6 -7
- package/dist/es/components/References/ReferenceSearch.js +1 -1
- package/dist/es/components/References/ReferencesModal.js +5 -5
- package/dist/es/components/RelativeDate.js +23 -6
- package/dist/es/components/Tooltip.js +25 -0
- package/dist/es/index.js +1 -5
- package/dist/es/lib/files.js +1 -2
- package/dist/types/components/AlertMessage.d.ts +1 -1
- package/dist/types/components/AuthorForm/RemoveAuthorButton.d.ts +1 -1
- package/dist/types/components/AutoSaveInput.d.ts +1 -1
- package/dist/types/components/Comments/CommentUser.d.ts +2 -3
- package/dist/types/components/Dialog.d.ts +1 -1
- package/dist/types/components/Dropdown.d.ts +1 -1
- package/dist/types/components/EditorHeader/EditorHeader.d.ts +1 -2
- package/dist/types/components/FileManager/FileActions.d.ts +1 -1
- package/dist/types/components/FileManager/FileManager.d.ts +1 -2
- package/dist/types/components/FileManager/util.d.ts +1 -0
- package/dist/types/components/Form.d.ts +1 -1
- package/dist/types/components/Inspector.d.ts +7 -9
- package/dist/types/components/NavDropdown.d.ts +1 -1
- package/dist/types/components/References/ReferenceForm.d.ts +1 -1
- package/dist/types/components/RelativeDate.d.ts +15 -1
- package/dist/types/components/Resizer/Resizer.d.ts +1 -1
- package/dist/types/components/Resizer/ResizerButton.d.ts +1 -1
- package/dist/types/components/Tooltip.d.ts +5 -0
- package/dist/types/components/icons/add-author.d.ts +2 -1
- package/dist/types/components/icons/add-comment-icon.d.ts +2 -1
- package/dist/types/components/icons/add-icon-active.d.ts +2 -1
- package/dist/types/components/icons/add-icon-inverted.d.ts +2 -1
- package/dist/types/components/icons/back-arrow.d.ts +2 -1
- package/dist/types/components/icons/bookmark.d.ts +2 -1
- package/dist/types/components/icons/google.d.ts +2 -1
- package/dist/types/components/icons/orcid.d.ts +2 -1
- package/dist/types/components/icons/project-notification.d.ts +2 -1
- package/dist/types/components/icons/project.d.ts +2 -1
- package/dist/types/components/icons/projects-list.d.ts +2 -1
- package/dist/types/components/icons/search.d.ts +2 -1
- package/dist/types/components/icons/tick-mark.d.ts +2 -1
- package/dist/types/components/icons/user.d.ts +2 -1
- package/dist/types/index.d.ts +1 -5
- package/dist/types/lib/capabilities.d.ts +3 -4
- package/package.json +30 -41
- package/dist/cjs/components/AffiliationsList.js +0 -43
- package/dist/cjs/components/AuthorsContainer.js +0 -71
- package/dist/cjs/components/AuthorsList/Author.js +0 -99
- package/dist/cjs/components/AuthorsList/AuthorsList.js +0 -52
- package/dist/cjs/components/AuthorsList/index.js +0 -32
- package/dist/cjs/components/ColorField/ColorField.js +0 -49
- package/dist/cjs/components/ColorField/ColorSelector.js +0 -115
- package/dist/cjs/components/ColorField/index.js +0 -32
- package/dist/cjs/components/Tip.js +0 -83
- package/dist/es/components/AffiliationsList.js +0 -36
- package/dist/es/components/AuthorsContainer.js +0 -41
- package/dist/es/components/AuthorsList/Author.js +0 -69
- package/dist/es/components/AuthorsList/AuthorsList.js +0 -45
- package/dist/es/components/AuthorsList/index.js +0 -16
- package/dist/es/components/ColorField/ColorField.js +0 -42
- package/dist/es/components/ColorField/ColorSelector.js +0 -85
- package/dist/es/components/ColorField/index.js +0 -16
- package/dist/es/components/FileManager/Tooltip.js +0 -20
- package/dist/es/components/Tip.js +0 -53
- package/dist/types/components/AffiliationsList.d.ts +0 -22
- package/dist/types/components/AuthorsContainer.d.ts +0 -25
- package/dist/types/components/AuthorsList/Author.d.ts +0 -29
- package/dist/types/components/AuthorsList/AuthorsList.d.ts +0 -28
- package/dist/types/components/AuthorsList/index.d.ts +0 -16
- package/dist/types/components/ColorField/ColorField.d.ts +0 -27
- package/dist/types/components/ColorField/ColorSelector.d.ts +0 -19
- package/dist/types/components/ColorField/index.d.ts +0 -16
- package/dist/types/components/FileManager/Tooltip.d.ts +0 -2
- package/dist/types/components/Tip.d.ts +0 -18
- package/styles/tip.css +0 -82
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.2-LEAN-3083",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -18,53 +18,39 @@
|
|
|
18
18
|
"build": "npm-run-all --parallel 'build:* --project tsconfig.build.json'",
|
|
19
19
|
"build:cjs": "tsc --outDir dist/cjs --module commonjs",
|
|
20
20
|
"build:es": "tsc --outDir dist/es --declarationDir dist/types --declaration",
|
|
21
|
-
"build-storybook": "build
|
|
21
|
+
"build-storybook": "storybook build",
|
|
22
22
|
"dev": "npm-run-all --parallel 'build:* --project tsconfig.build.json --watch'",
|
|
23
23
|
"lint": "eslint src stories --ext .ts,.tsx --max-warnings=0",
|
|
24
24
|
"lint:fix": "eslint src stories --fix --ext .ts,.tsx --max-warnings=0",
|
|
25
25
|
"prebuild": "rimraf dist",
|
|
26
26
|
"prettier": "prettier --write \"{src,stories}/**/*.{ts,tsx}\"",
|
|
27
27
|
"preversion": "npm-run-all --parallel lint typecheck test",
|
|
28
|
-
"storybook": "
|
|
28
|
+
"storybook": "storybook dev -p 6006",
|
|
29
29
|
"test": "jest",
|
|
30
30
|
"typecheck": "tsc --noEmit",
|
|
31
31
|
"version": "yarn build",
|
|
32
32
|
"prepare": "husky install"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@
|
|
36
|
-
"@formatjs/intl-relativetimeformat": "^4.5.9",
|
|
37
|
-
"@formatjs/intl-utils": "^2.2.0",
|
|
38
|
-
"@manuscripts/assets": "^0.6.2",
|
|
39
|
-
"@manuscripts/transform": "2.0.4",
|
|
35
|
+
"@manuscripts/assets": "^0.6.4",
|
|
40
36
|
"@manuscripts/json-schema": "^2.2.2",
|
|
41
|
-
"@
|
|
37
|
+
"@manuscripts/transform": "2.0.4",
|
|
38
|
+
"@reach/tabs": "^0.18.0",
|
|
39
|
+
"date-fns": "^2.29.3",
|
|
42
40
|
"formik": "^2.2.9",
|
|
43
41
|
"fuzzysort": "^2.0.4",
|
|
44
|
-
"
|
|
45
|
-
"lodash-es": "^4.17.21",
|
|
46
|
-
"tooltip.js": "^1.3.3",
|
|
47
|
-
"typeface-lato": "^1.1.13",
|
|
48
|
-
"prosemirror-commands": "^1.5.0",
|
|
49
|
-
"prosemirror-history": "^1.3.0",
|
|
50
|
-
"prosemirror-inputrules": "^1.2.0",
|
|
51
|
-
"prosemirror-keymap": "^1.2.0",
|
|
52
|
-
"prosemirror-model": "^1.18.3",
|
|
53
|
-
"prosemirror-state": "^1.4.2",
|
|
54
|
-
"prosemirror-transform": "^1.7.0",
|
|
42
|
+
"lodash": "^4.17.21",
|
|
55
43
|
"react": "^17.0.2",
|
|
56
|
-
"react-color": "^2.19.3",
|
|
57
44
|
"react-dnd": "^11.1.3",
|
|
58
45
|
"react-dnd-html5-backend": "^11.1.3",
|
|
59
46
|
"react-dom": "^17.0.2",
|
|
60
|
-
"react-
|
|
61
|
-
"react-modal": "^3.
|
|
62
|
-
"react-modern-calendar-datepicker": "^3.1.
|
|
63
|
-
"react-
|
|
64
|
-
"react-router-dom": "^5.2.0",
|
|
47
|
+
"react-is": "^17.0.2",
|
|
48
|
+
"react-modal": "^3.16.1",
|
|
49
|
+
"react-modern-calendar-datepicker": "^3.1.6",
|
|
50
|
+
"react-router-dom": "^5.3.4",
|
|
65
51
|
"react-select": "^5.7.3",
|
|
66
|
-
"react-sizeme": "^
|
|
67
|
-
"react-tooltip": "^
|
|
52
|
+
"react-sizeme": "^3.0.2",
|
|
53
|
+
"react-tooltip": "^5.26.0",
|
|
68
54
|
"styled-components": "^5.2.0"
|
|
69
55
|
},
|
|
70
56
|
"devDependencies": {
|
|
@@ -72,21 +58,20 @@
|
|
|
72
58
|
"@babel/preset-env": "^7.20.2",
|
|
73
59
|
"@babel/preset-react": "^7.18.6",
|
|
74
60
|
"@babel/preset-typescript": "^7.18.6",
|
|
75
|
-
"@inline-svg-unique-id/react": "^1.2.3",
|
|
76
61
|
"@manuscripts/eslint-config": "^0.5.1",
|
|
77
|
-
"@storybook/addon-
|
|
78
|
-
"@storybook/
|
|
79
|
-
"@storybook/
|
|
80
|
-
"@storybook/
|
|
62
|
+
"@storybook/addon-essentials": "^7.6.10",
|
|
63
|
+
"@storybook/addon-interactions": "^7.6.10",
|
|
64
|
+
"@storybook/addon-links": "^7.6.10",
|
|
65
|
+
"@storybook/blocks": "^7.6.10",
|
|
66
|
+
"@storybook/react": "^7.6.10",
|
|
67
|
+
"@storybook/react-webpack5": "^7.6.10",
|
|
68
|
+
"@storybook/test": "^7.6.10",
|
|
81
69
|
"@types/jest": "^29.2.4",
|
|
82
|
-
"@types/lodash
|
|
83
|
-
"@types/react": "^16.9.52",
|
|
84
|
-
"@types/react-color": "^3.0.6",
|
|
85
|
-
"@types/react-dom": "^16.9.8",
|
|
86
|
-
"@types/react-modal": "^3.10.6",
|
|
87
|
-
"@types/react-router-dom": "^5.1.6",
|
|
70
|
+
"@types/lodash": "^4.14.202",
|
|
88
71
|
"@types/styled-components": "^5.1.4",
|
|
89
|
-
"@types/
|
|
72
|
+
"@types/react-dom": "^17.0.2",
|
|
73
|
+
"@types/react-modal": "^3.16.3",
|
|
74
|
+
"@types/react-router-dom": "^5.3.3",
|
|
90
75
|
"@typescript-eslint/eslint-plugin": "^5.47.0",
|
|
91
76
|
"@typescript-eslint/parser": "^5.47.0",
|
|
92
77
|
"babel-jest": "^29.3.1",
|
|
@@ -103,15 +88,19 @@
|
|
|
103
88
|
"eslint-plugin-react": "^7.31.11",
|
|
104
89
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
105
90
|
"eslint-plugin-simple-import-sort": "^8.0.0",
|
|
91
|
+
"eslint-plugin-storybook": "^0.6.15",
|
|
106
92
|
"husky": "^8.0.2",
|
|
107
93
|
"jest": "^29.3.1",
|
|
108
94
|
"jest-environment-jsdom": "^29.3.1",
|
|
109
95
|
"npm-run-all": "^4.1.5",
|
|
110
96
|
"prettier": "^2.8.1",
|
|
111
97
|
"rimraf": "^3.0.0",
|
|
98
|
+
"storybook": "^7.6.10",
|
|
99
|
+
"typeface-lato": "^1.1.13",
|
|
112
100
|
"typescript": "^4.4.4"
|
|
113
101
|
},
|
|
114
102
|
"resolutions": {
|
|
115
|
-
"@types/react": "^17.0.2"
|
|
103
|
+
"@types/react": "^17.0.2",
|
|
104
|
+
"jackspeak": "2.1.1"
|
|
116
105
|
}
|
|
117
106
|
}
|
|
@@ -1,43 +0,0 @@
|
|
|
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;
|
|
@@ -1,71 +0,0 @@
|
|
|
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
|
-
`;
|
|
@@ -1,99 +0,0 @@
|
|
|
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;
|
|
@@ -1,52 +0,0 @@
|
|
|
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;
|
|
@@ -1,32 +0,0 @@
|
|
|
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);
|
|
@@ -1,49 +0,0 @@
|
|
|
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.ColorField = void 0;
|
|
22
|
-
const react_1 = __importDefault(require("react"));
|
|
23
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
24
|
-
const ColorSelector_1 = require("./ColorSelector");
|
|
25
|
-
const ColorField = ({ options, value, handleChange, }) => (react_1.default.createElement(Container, null,
|
|
26
|
-
options.map((color) => (react_1.default.createElement(ItemButton, { key: color.value, type: "button", color: color.value, isActive: value === color.value, onClick: () => handleChange(color.value) }))),
|
|
27
|
-
react_1.default.createElement(ColorSelector_1.ColorSelector, { handleChange: handleChange })));
|
|
28
|
-
exports.ColorField = ColorField;
|
|
29
|
-
const Container = styled_components_1.default.div `
|
|
30
|
-
display: flex;
|
|
31
|
-
flex-wrap: wrap;
|
|
32
|
-
align-items: center;
|
|
33
|
-
`;
|
|
34
|
-
const ItemButton = styled_components_1.default.button `
|
|
35
|
-
background: ${(props) => props.color};
|
|
36
|
-
box-shadow: ${(props) => (props.isActive ? '0 0 1px 1px #000' : 'none')};
|
|
37
|
-
height: ${(props) => props.theme.grid.unit * 3}px;
|
|
38
|
-
width: ${(props) => props.theme.grid.unit * 3}px;
|
|
39
|
-
border-radius: 50%;
|
|
40
|
-
margin: 2px;
|
|
41
|
-
padding: 0;
|
|
42
|
-
border: 1px solid ${(props) => props.theme.colors.border.tertiary};
|
|
43
|
-
cursor: pointer;
|
|
44
|
-
flex-shrink: 0;
|
|
45
|
-
|
|
46
|
-
/* &:focus {
|
|
47
|
-
outline: none;
|
|
48
|
-
}*/
|
|
49
|
-
`;
|
|
@@ -1,115 +0,0 @@
|
|
|
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.ColorSelector = void 0;
|
|
45
|
-
const react_1 = __importStar(require("react"));
|
|
46
|
-
const react_color_1 = require("react-color");
|
|
47
|
-
const react_popper_1 = require("react-popper");
|
|
48
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
49
|
-
const Button_1 = require("../Button");
|
|
50
|
-
const ColorSelector = ({ handleChange }) => {
|
|
51
|
-
const [open, setOpen] = (0, react_1.useState)(false);
|
|
52
|
-
const [color, setColor] = (0, react_1.useState)('#ffffff');
|
|
53
|
-
const toggleOpen = (0, react_1.useCallback)(() => {
|
|
54
|
-
setOpen((open) => !open);
|
|
55
|
-
}, [setOpen]);
|
|
56
|
-
const handleSave = (0, react_1.useCallback)(() => {
|
|
57
|
-
if (color) {
|
|
58
|
-
handleChange(color);
|
|
59
|
-
}
|
|
60
|
-
setOpen(false);
|
|
61
|
-
}, [color, handleChange, setOpen]);
|
|
62
|
-
const handleColorChange = (0, react_1.useCallback)((color) => {
|
|
63
|
-
setColor(color.hex);
|
|
64
|
-
}, [setColor]);
|
|
65
|
-
const handleCancel = (0, react_1.useCallback)(() => {
|
|
66
|
-
setOpen(false);
|
|
67
|
-
}, [setOpen]);
|
|
68
|
-
return (react_1.default.createElement(react_popper_1.Manager, null,
|
|
69
|
-
react_1.default.createElement(react_popper_1.Reference, null, ({ ref }) => (react_1.default.createElement(AddButton, { ref: ref, type: 'button', onClick: toggleOpen }, "+"))),
|
|
70
|
-
open && (react_1.default.createElement(react_popper_1.Popper, { placement: 'left' }, ({ ref, style, placement }) => (react_1.default.createElement("div", { ref: ref, style: Object.assign(Object.assign({}, style), { zIndex: 10 }), "data-placement": placement },
|
|
71
|
-
react_1.default.createElement(PopperContent, null,
|
|
72
|
-
react_1.default.createElement(react_color_1.ChromePicker, { onChangeComplete: handleColorChange, color: color }),
|
|
73
|
-
react_1.default.createElement(Actions, null,
|
|
74
|
-
react_1.default.createElement(Button_1.PrimaryButton, { mini: true, onClick: handleSave }, "Add color"),
|
|
75
|
-
react_1.default.createElement(Button_1.SecondaryButton, { mini: true, onClick: handleCancel }, "Cancel")))))))));
|
|
76
|
-
};
|
|
77
|
-
exports.ColorSelector = ColorSelector;
|
|
78
|
-
const Actions = styled_components_1.default.div `
|
|
79
|
-
display: flex;
|
|
80
|
-
justify-content: center;
|
|
81
|
-
align-items: center;
|
|
82
|
-
`;
|
|
83
|
-
const PopperContent = styled_components_1.default.div `
|
|
84
|
-
border: 1px solid ${(props) => props.theme.colors.text.muted};
|
|
85
|
-
border-radius: ${(props) => props.theme.grid.radius.small};
|
|
86
|
-
box-shadow: ${(props) => props.theme.shadow.dropShadow};
|
|
87
|
-
background: ${(props) => props.theme.colors.background.primary};
|
|
88
|
-
padding: ${(props) => props.theme.grid.unit * 2}px;
|
|
89
|
-
|
|
90
|
-
.chrome-picker {
|
|
91
|
-
box-shadow: none !important;
|
|
92
|
-
}
|
|
93
|
-
`;
|
|
94
|
-
const AddButton = styled_components_1.default.button `
|
|
95
|
-
display: inline-flex;
|
|
96
|
-
align-items: center;
|
|
97
|
-
justify-content: center;
|
|
98
|
-
background: transparent;
|
|
99
|
-
border: 1px solid transparent;
|
|
100
|
-
border-radius: 50%;
|
|
101
|
-
width: ${(props) => props.theme.grid.unit * 4}px;
|
|
102
|
-
height: ${(props) => props.theme.grid.unit * 4}px;
|
|
103
|
-
margin: 2px;
|
|
104
|
-
cursor: pointer;
|
|
105
|
-
line-height: 0;
|
|
106
|
-
font-size: ${(props) => props.theme.font.size.medium};
|
|
107
|
-
|
|
108
|
-
:hover {
|
|
109
|
-
border-color: ${(props) => props.theme.colors.border.secondary};
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
:focus {
|
|
113
|
-
outline: none;
|
|
114
|
-
}
|
|
115
|
-
`;
|
|
@@ -1,32 +0,0 @@
|
|
|
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("./ColorField"), exports);
|