@manuscripts/style-guide 0.30.15 → 0.30.19
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/AffiliationsEditor/AffiliationsEditor.js +3 -3
- package/dist/cjs/components/AffiliationsEditor/AffiliationsEditorItem.js +7 -6
- package/dist/cjs/components/AffiliationsEditor/AffiliationsEditorProfile.js +3 -3
- package/dist/cjs/components/AffiliationsEditor/AffiliationsEditorView.js +10 -40
- package/dist/cjs/components/AffiliationsEditor/styles.js +2 -1
- package/dist/cjs/components/AffiliationsList.js +3 -2
- package/dist/cjs/components/AlertMessage.js +9 -9
- package/dist/cjs/components/AuthorForm/AuthorForm.js +2 -1
- package/dist/cjs/components/AuthorForm/ContributorRolesSelect.js +6 -6
- package/dist/cjs/components/AuthorForm/RemoveAuthorButton.js +1 -1
- package/dist/cjs/components/AuthorForm/index.js +0 -1
- package/dist/cjs/components/AuthorName.js +2 -2
- package/dist/cjs/components/AuthorsContainer.js +4 -3
- package/dist/cjs/components/AuthorsDND/AuthorsDND.js +39 -17
- package/dist/cjs/components/AuthorsDND/DraggableAuthorItem.js +6 -25
- package/dist/cjs/components/AuthorsDND/index.js +5 -10
- package/dist/cjs/components/AuthorsList/Author.js +3 -2
- package/dist/cjs/components/AuthorsList/AuthorsList.js +3 -2
- package/dist/cjs/components/Avatar.js +5 -4
- package/dist/cjs/components/Button.js +15 -15
- package/dist/cjs/components/ColorField/ColorField.js +2 -1
- package/dist/cjs/components/ColorField/ColorSelector.js +8 -7
- package/dist/cjs/components/Comments/CommentActions.js +9 -12
- package/dist/cjs/components/Comments/CommentBody.js +5 -5
- package/dist/cjs/components/Comments/CommentTarget.js +1 -1
- package/dist/cjs/components/Comments/CommentUser.js +3 -2
- package/dist/cjs/components/Comments/CommentWrapper.js +18 -16
- package/dist/cjs/components/Comments/ResolveButton.js +3 -2
- package/dist/cjs/components/Dialog.js +2 -2
- package/dist/cjs/components/FileManager/ConfirmationPopUp.js +2 -1
- package/dist/cjs/components/FileManager/DragItemArea.js +2 -1
- package/dist/cjs/components/FileManager/FileManager.js +21 -10
- package/dist/cjs/components/FileManager/FileSectionItem/DesignationActions.js +5 -4
- package/dist/cjs/components/FileManager/FileSectionItem/DesignationActionsList.js +5 -4
- package/dist/cjs/components/FileManager/FileSectionItem/DragLayer.js +5 -4
- package/dist/cjs/components/FileManager/FileSectionItem/DraggableFileSectionItem.js +8 -7
- package/dist/cjs/components/FileManager/FileSectionItem/FileInfo.js +3 -2
- package/dist/cjs/components/FileManager/FileSectionItem/FileSectionItem.js +13 -7
- package/dist/cjs/components/FileManager/FileSectionItem/FileSectionUploadItem.js +4 -3
- package/dist/cjs/components/FileManager/FileSectionItem/FileTypeIcon.js +2 -1
- package/dist/cjs/components/FileManager/FileSectionItem/ItemActions.js +9 -4
- package/dist/cjs/components/FileManager/FileSectionItem/ProgressBarUploadItem.js +2 -1
- package/dist/cjs/components/FileManager/FileSectionState.js +12 -3
- package/dist/cjs/components/FileManager/FilesSection.js +4 -3
- package/dist/cjs/components/FileManager/SelectDesignationActions.js +11 -11
- package/dist/cjs/components/FileManager/SelectDialogDesignation.js +3 -2
- package/dist/cjs/components/FileManager/UploadFileArea.js +11 -10
- package/dist/cjs/components/FileManager/util.js +15 -8
- package/dist/cjs/components/Form.js +1 -1
- package/dist/cjs/components/Inspector.js +7 -7
- package/dist/cjs/components/InspectorSection.js +5 -4
- package/dist/cjs/components/ManuscriptNoteList.js +17 -17
- package/dist/cjs/components/PdfPreview.js +13 -13
- package/dist/cjs/components/RadioButton.js +2 -1
- package/dist/cjs/components/RelativeDate.js +3 -2
- package/dist/cjs/components/SaveStatus.js +2 -1
- package/dist/cjs/components/SimpleModal.js +3 -2
- package/dist/cjs/components/StyledModal.js +3 -2
- package/dist/cjs/components/SubmissionInspector/BaseInformation.js +19 -18
- package/dist/cjs/components/SubmissionInspector/Button.js +2 -2
- package/dist/cjs/components/SubmissionInspector/Progress.js +6 -5
- package/dist/cjs/components/SubmissionInspector/Text.js +2 -2
- package/dist/cjs/components/TextField.js +3 -2
- package/dist/cjs/components/TextFieldContainer.js +2 -1
- package/dist/cjs/components/TextFieldError.js +2 -1
- package/dist/cjs/components/TextFieldGroupContainer.js +2 -1
- package/dist/cjs/components/Tip.js +7 -6
- package/dist/cjs/components/icons/back-arrow.js +2 -1
- package/dist/cjs/hooks/use-dropdown.js +6 -5
- package/dist/cjs/lib/authors.js +24 -15
- package/dist/cjs/lib/capabilities.js +13 -8
- package/dist/cjs/lib/comments.js +9 -5
- package/dist/cjs/lib/lw-errors-decoder.js +51 -1
- package/dist/cjs/lib/name.js +2 -1
- package/dist/es/components/AffiliationsEditor/AffiliationsEditorView.js +6 -36
- package/dist/es/components/AuthorForm/ContributorRolesSelect.js +1 -2
- package/dist/es/components/AuthorForm/index.js +0 -1
- package/dist/es/components/AuthorsDND/AuthorsDND.js +20 -16
- package/dist/es/components/AuthorsDND/DraggableAuthorItem.js +2 -2
- package/dist/es/components/AuthorsDND/index.js +1 -1
- package/dist/es/components/Comments/CommentActions.js +1 -5
- package/dist/es/components/Comments/CommentWrapper.js +10 -9
- package/dist/es/components/FileManager/FileManager.js +13 -3
- package/dist/es/components/FileManager/FileSectionItem/DragLayer.js +1 -1
- package/dist/es/components/FileManager/FileSectionItem/FileSectionItem.js +10 -5
- package/dist/es/components/FileManager/FileSectionItem/FileSectionUploadItem.js +1 -1
- package/dist/es/components/FileManager/FileSectionItem/ItemActions.js +6 -2
- package/dist/es/components/FileManager/FileSectionState.js +8 -1
- package/dist/es/components/FileManager/SelectDesignationActions.js +7 -8
- package/dist/es/components/PdfPreview.js +4 -4
- package/dist/es/components/TextFieldContainer.js +1 -1
- package/dist/es/components/TextFieldGroupContainer.js +1 -1
- package/dist/es/lib/lw-errors-decoder.js +51 -1
- package/dist/types/components/AffiliationsEditor/AffiliationsEditorView.d.ts +4 -7
- package/dist/types/components/AffiliationsEditor/styles.d.ts +2 -2
- package/dist/types/components/AlertMessage.d.ts +1 -1
- package/dist/types/components/AuthorForm/index.d.ts +0 -1
- package/dist/types/components/AuthorsDND/AuthorsDND.d.ts +2 -2
- package/dist/types/components/AuthorsDND/DraggableAuthorItem.d.ts +15 -5
- package/dist/types/components/AuthorsDND/index.d.ts +1 -1
- package/dist/types/components/Button.d.ts +9 -9
- package/dist/types/components/FileManager/FileSectionItem/FileSectionItem.d.ts +1 -2
- package/dist/types/components/FileManager/FileSectionItem/FileSectionUploadItem.d.ts +1 -1
- package/dist/types/components/FileManager/FileSectionItem/ItemActions.d.ts +3 -1
- package/dist/types/components/FileManager/FileSectionState.d.ts +2 -0
- package/dist/types/components/FileManager/util.d.ts +0 -1
- package/dist/types/components/Form.d.ts +1 -1
- package/dist/types/components/InspectorSection.d.ts +1 -1
- package/dist/types/components/PdfPreview.d.ts +1 -1
- package/dist/types/components/SimpleModal.d.ts +1 -1
- package/dist/types/components/SubmissionInspector/Button.d.ts +1 -1
- package/dist/types/components/icons/add-author.d.ts +0 -1
- package/dist/types/components/icons/add-icon-active.d.ts +0 -1
- package/dist/types/components/icons/add-icon-inverted.d.ts +0 -1
- package/dist/types/components/icons/back-arrow.d.ts +0 -1
- package/dist/types/components/icons/bookmark.d.ts +0 -1
- package/dist/types/components/icons/google.d.ts +0 -1
- package/dist/types/components/icons/orcid.d.ts +0 -1
- package/dist/types/components/icons/project-notification.d.ts +0 -1
- package/dist/types/components/icons/project.d.ts +0 -1
- package/dist/types/components/icons/projects-list.d.ts +0 -1
- package/dist/types/components/icons/search.d.ts +0 -1
- package/dist/types/components/icons/tick-mark.d.ts +0 -1
- package/dist/types/components/icons/user.d.ts +0 -1
- package/dist/types/lib/comments.d.ts +2 -2
- package/package.json +5 -5
- package/dist/cjs/components/AuthorForm/AffiliationsSelect.js +0 -55
- package/dist/es/components/AuthorForm/AffiliationsSelect.js +0 -49
- package/dist/types/components/AuthorForm/AffiliationsSelect.d.ts +0 -29
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": "0.30.
|
|
4
|
+
"version": "0.30.19",
|
|
5
5
|
"repository": "gitlab:mpapp-public/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"@manuscripts/assets": "^0.6.1",
|
|
37
37
|
"@manuscripts/eslint-config": "^0.4.2",
|
|
38
38
|
"@reach/tabs": "^0.11.2",
|
|
39
|
+
"@types/prosemirror-model": "~1.13.0",
|
|
39
40
|
"@types/react-color": "^3.0.4",
|
|
40
41
|
"@types/react-router-dom": "^5.1.6",
|
|
41
42
|
"date-fns": "^2.16.1",
|
|
@@ -47,7 +48,7 @@
|
|
|
47
48
|
"react-modal": "^3.11.2",
|
|
48
49
|
"react-modern-calendar-datepicker": "^3.1.3",
|
|
49
50
|
"react-router-dom": "^5.2.0",
|
|
50
|
-
"react-select": "^
|
|
51
|
+
"react-select": "^5.0.1",
|
|
51
52
|
"react-sizeme": "^2.6.12",
|
|
52
53
|
"react-tooltip": "^4.2.11",
|
|
53
54
|
"tooltip.js": "^1.3.3",
|
|
@@ -75,7 +76,6 @@
|
|
|
75
76
|
"@types/react": "^16.9.52",
|
|
76
77
|
"@types/react-dom": "^16.9.8",
|
|
77
78
|
"@types/react-modal": "^3.10.6",
|
|
78
|
-
"@types/react-select": "^3.0.22",
|
|
79
79
|
"@types/storybook__addon-actions": "^3.4.1",
|
|
80
80
|
"@types/storybook__react": "^4.0.2",
|
|
81
81
|
"@types/styled-components": "^5.1.4",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"babel-jest": "^26.5.2",
|
|
86
86
|
"babel-loader": "^8.0.6",
|
|
87
87
|
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
|
|
88
|
-
"chokidar": "^3.
|
|
88
|
+
"chokidar": "^3.3.1",
|
|
89
89
|
"eslint": "^7.11.0",
|
|
90
90
|
"eslint-config-prettier": "^6.12.0",
|
|
91
91
|
"eslint-plugin-header": "^3.1.0",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"react-is": "^16.11.0",
|
|
112
112
|
"rimraf": "^3.0.0",
|
|
113
113
|
"styled-components": "^5.2.0",
|
|
114
|
-
"typescript": "
|
|
114
|
+
"typescript": "~4.4.4"
|
|
115
115
|
},
|
|
116
116
|
"peerDependencies": {
|
|
117
117
|
"@manuscripts/comment-editor": "^0.2.3",
|
|
@@ -1,55 +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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
27
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
|
-
};
|
|
29
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.AffiliationsSelect = void 0;
|
|
31
|
-
const react_1 = __importDefault(require("react"));
|
|
32
|
-
const creatable_1 = __importDefault(require("react-select/creatable"));
|
|
33
|
-
const styled_components_1 = require("styled-components");
|
|
34
|
-
exports.AffiliationsSelect = ({ affiliations, createAffiliation, form, field, theme }) => {
|
|
35
|
-
return (react_1.default.createElement(creatable_1.default, { isMulti: true, noOptionsMessage: () => 'Type institution name to search for it.', onChange: (value, actionMeta) => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
-
form.setFieldValue(field.name, yield Promise.all(value.map((option) => __awaiter(void 0, void 0, void 0, function* () {
|
|
37
|
-
if (actionMeta.action === 'create-option' && option.__isNew__) {
|
|
38
|
-
return createAffiliation(option.label);
|
|
39
|
-
}
|
|
40
|
-
return affiliations.get(option.value);
|
|
41
|
-
}))));
|
|
42
|
-
yield form.submitForm();
|
|
43
|
-
}), options: Array.from(affiliations.values()).map((affiliation) => ({
|
|
44
|
-
value: affiliation._id,
|
|
45
|
-
label: affiliation.institution || '',
|
|
46
|
-
})), value: (field.value || []).map((item) => ({
|
|
47
|
-
value: item._id,
|
|
48
|
-
label: item.institution,
|
|
49
|
-
})), styles: {
|
|
50
|
-
control: (provided, state) => (Object.assign(Object.assign({}, provided), { backgroundColor: theme.colors.background.primary, borderColor: state.isFocused
|
|
51
|
-
? theme.colors.border.field.active
|
|
52
|
-
: theme.colors.border.field.default, borderRadius: theme.grid.radius.default, boxShadow: 'none', fontFamily: theme.font.family.sans })),
|
|
53
|
-
} }));
|
|
54
|
-
};
|
|
55
|
-
exports.default = styled_components_1.withTheme(exports.AffiliationsSelect);
|
|
@@ -1,49 +0,0 @@
|
|
|
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
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
import React from 'react';
|
|
26
|
-
import CreatableSelect from 'react-select/creatable';
|
|
27
|
-
import { withTheme } from 'styled-components';
|
|
28
|
-
export const AffiliationsSelect = ({ affiliations, createAffiliation, form, field, theme }) => {
|
|
29
|
-
return (React.createElement(CreatableSelect, { isMulti: true, noOptionsMessage: () => 'Type institution name to search for it.', onChange: (value, actionMeta) => __awaiter(void 0, void 0, void 0, function* () {
|
|
30
|
-
form.setFieldValue(field.name, yield Promise.all(value.map((option) => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
-
if (actionMeta.action === 'create-option' && option.__isNew__) {
|
|
32
|
-
return createAffiliation(option.label);
|
|
33
|
-
}
|
|
34
|
-
return affiliations.get(option.value);
|
|
35
|
-
}))));
|
|
36
|
-
yield form.submitForm();
|
|
37
|
-
}), options: Array.from(affiliations.values()).map((affiliation) => ({
|
|
38
|
-
value: affiliation._id,
|
|
39
|
-
label: affiliation.institution || '',
|
|
40
|
-
})), value: (field.value || []).map((item) => ({
|
|
41
|
-
value: item._id,
|
|
42
|
-
label: item.institution,
|
|
43
|
-
})), styles: {
|
|
44
|
-
control: (provided, state) => (Object.assign(Object.assign({}, provided), { backgroundColor: theme.colors.background.primary, borderColor: state.isFocused
|
|
45
|
-
? theme.colors.border.field.active
|
|
46
|
-
: theme.colors.border.field.default, borderRadius: theme.grid.radius.default, boxShadow: 'none', fontFamily: theme.font.family.sans })),
|
|
47
|
-
} }));
|
|
48
|
-
};
|
|
49
|
-
export default withTheme(AffiliationsSelect);
|
|
@@ -1,29 +0,0 @@
|
|
|
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 { Affiliation, UserProfileAffiliation } from '@manuscripts/manuscripts-json-schema';
|
|
17
|
-
import { FieldProps } from 'formik';
|
|
18
|
-
import React from 'react';
|
|
19
|
-
import { DefaultTheme, ThemeProps } from 'styled-components';
|
|
20
|
-
declare type AffiliationType = UserProfileAffiliation | Affiliation;
|
|
21
|
-
interface Props {
|
|
22
|
-
affiliations: Map<string, AffiliationType>;
|
|
23
|
-
createAffiliation: (institution: string) => Promise<AffiliationType>;
|
|
24
|
-
}
|
|
25
|
-
export declare const AffiliationsSelect: React.FunctionComponent<Props & FieldProps & ThemeProps<DefaultTheme>>;
|
|
26
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<React.PropsWithChildren<Props & FieldProps<any, any> & ThemeProps<DefaultTheme>>, "form" | "meta" | "children" | "field" | "affiliations" | "createAffiliation"> & {
|
|
27
|
-
theme?: DefaultTheme | undefined;
|
|
28
|
-
}>;
|
|
29
|
-
export default _default;
|