@manuscripts/article-editor 1.9.4 → 1.9.5-LEAN-3083-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/src/components/Sidebar/Sidebar.js +1 -2
- package/dist/cjs/src/components/Sidebar/Sidebar.js.map +1 -1
- package/dist/cjs/src/components/metadata/AuthorModalViews.js +7 -3
- package/dist/cjs/src/components/metadata/AuthorModalViews.js.map +1 -1
- package/dist/cjs/src/components/metadata/AuthorsPage.js +1 -11
- package/dist/cjs/src/components/metadata/AuthorsPage.js.map +1 -1
- package/dist/cjs/src/components/projects/ManuscriptPageContainer.js +0 -14
- package/dist/cjs/src/components/projects/ManuscriptPageContainer.js.map +1 -1
- package/dist/cjs/src/hooks/use-create-editor.js +2 -22
- package/dist/cjs/src/hooks/use-create-editor.js.map +1 -1
- package/dist/cjs/src/hooks/use-tracked-model-management.js +10 -0
- package/dist/cjs/src/hooks/use-tracked-model-management.js.map +1 -1
- package/dist/cjs/src/lib/authors.js +3 -1
- package/dist/cjs/src/lib/authors.js.map +1 -1
- package/dist/es/src/components/Sidebar/Sidebar.js +1 -2
- package/dist/es/src/components/Sidebar/Sidebar.js.map +1 -1
- package/dist/es/src/components/metadata/AuthorModalViews.js +7 -3
- package/dist/es/src/components/metadata/AuthorModalViews.js.map +1 -1
- package/dist/es/src/components/metadata/AuthorsPage.js +0 -9
- package/dist/es/src/components/metadata/AuthorsPage.js.map +1 -1
- package/dist/es/src/components/projects/ManuscriptPageContainer.js +0 -14
- package/dist/es/src/components/projects/ManuscriptPageContainer.js.map +1 -1
- package/dist/es/src/hooks/use-create-editor.js +2 -22
- package/dist/es/src/hooks/use-create-editor.js.map +1 -1
- package/dist/es/src/hooks/use-tracked-model-management.js +10 -0
- package/dist/es/src/hooks/use-tracked-model-management.js.map +1 -1
- package/dist/es/src/lib/authors.js +3 -1
- package/dist/es/src/lib/authors.js.map +1 -1
- package/dist/types/src/components/metadata/AuthorsPage.d.ts +0 -1
- package/dist/types/src/store/useStore.d.ts +1 -1
- package/package.json +5 -6
- package/dist/cjs/src/components/SelectField.js +0 -24
- package/dist/cjs/src/components/SelectField.js.map +0 -1
- package/dist/cjs/src/components/library/BibliographyImportButton.js +0 -149
- package/dist/cjs/src/components/library/BibliographyImportButton.js.map +0 -1
- package/dist/cjs/src/components/library/CitationEditor.js +0 -227
- package/dist/cjs/src/components/library/CitationEditor.js.map +0 -1
- package/dist/cjs/src/components/library/CitationModal.js +0 -262
- package/dist/cjs/src/components/library/CitationModal.js.map +0 -1
- package/dist/cjs/src/components/library/CitationSearch.js +0 -214
- package/dist/cjs/src/components/library/CitationSearch.js.map +0 -1
- package/dist/cjs/src/components/library/CitationSearchSection.js +0 -133
- package/dist/cjs/src/components/library/CitationSearchSection.js.map +0 -1
- package/dist/cjs/src/components/library/CitationViewer.js +0 -53
- package/dist/cjs/src/components/library/CitationViewer.js.map +0 -1
- package/dist/cjs/src/components/library/ReferenceForm.js +0 -419
- package/dist/cjs/src/components/library/ReferenceForm.js.map +0 -1
- package/dist/cjs/src/components/library/ReferencesEditor.js +0 -70
- package/dist/cjs/src/components/library/ReferencesEditor.js.map +0 -1
- package/dist/cjs/src/components/library/ReferencesViewer.js +0 -33
- package/dist/cjs/src/components/library/ReferencesViewer.js.map +0 -1
- package/dist/cjs/src/components/library/SearchResults.js +0 -126
- package/dist/cjs/src/components/library/SearchResults.js.map +0 -1
- package/dist/cjs/src/components/metadata/AuthorsInlineViewContainer.js +0 -94
- package/dist/cjs/src/components/metadata/AuthorsInlineViewContainer.js.map +0 -1
- package/dist/cjs/src/components/projects/icons/DeleteIcon.js +0 -27
- package/dist/cjs/src/components/projects/icons/DeleteIcon.js.map +0 -1
- package/dist/cjs/src/components/projects/icons/GroupIcon.js +0 -29
- package/dist/cjs/src/components/projects/icons/GroupIcon.js.map +0 -1
- package/dist/cjs/src/components/projects/icons/LinkIcon.js +0 -23
- package/dist/cjs/src/components/projects/icons/LinkIcon.js.map +0 -1
- package/dist/cjs/src/components/projects/icons/TemplateIcon.js +0 -23
- package/dist/cjs/src/components/projects/icons/TemplateIcon.js.map +0 -1
- package/dist/cjs/src/lib/select-styles.js +0 -40
- package/dist/cjs/src/lib/select-styles.js.map +0 -1
- package/dist/cjs/src/lib/sources.js +0 -36
- package/dist/cjs/src/lib/sources.js.map +0 -1
- package/dist/es/src/components/SelectField.js +0 -17
- package/dist/es/src/components/SelectField.js.map +0 -1
- package/dist/es/src/components/library/BibliographyImportButton.js +0 -120
- package/dist/es/src/components/library/BibliographyImportButton.js.map +0 -1
- package/dist/es/src/components/library/CitationEditor.js +0 -198
- package/dist/es/src/components/library/CitationEditor.js.map +0 -1
- package/dist/es/src/components/library/CitationModal.js +0 -232
- package/dist/es/src/components/library/CitationModal.js.map +0 -1
- package/dist/es/src/components/library/CitationSearch.js +0 -184
- package/dist/es/src/components/library/CitationSearch.js.map +0 -1
- package/dist/es/src/components/library/CitationSearchSection.js +0 -103
- package/dist/es/src/components/library/CitationSearchSection.js.map +0 -1
- package/dist/es/src/components/library/CitationViewer.js +0 -46
- package/dist/es/src/components/library/CitationViewer.js.map +0 -1
- package/dist/es/src/components/library/ReferenceForm.js +0 -389
- package/dist/es/src/components/library/ReferenceForm.js.map +0 -1
- package/dist/es/src/components/library/ReferencesEditor.js +0 -43
- package/dist/es/src/components/library/ReferencesEditor.js.map +0 -1
- package/dist/es/src/components/library/ReferencesViewer.js +0 -26
- package/dist/es/src/components/library/ReferencesViewer.js.map +0 -1
- package/dist/es/src/components/library/SearchResults.js +0 -119
- package/dist/es/src/components/library/SearchResults.js.map +0 -1
- package/dist/es/src/components/metadata/AuthorsInlineViewContainer.js +0 -65
- package/dist/es/src/components/metadata/AuthorsInlineViewContainer.js.map +0 -1
- package/dist/es/src/components/projects/icons/DeleteIcon.js +0 -20
- package/dist/es/src/components/projects/icons/DeleteIcon.js.map +0 -1
- package/dist/es/src/components/projects/icons/GroupIcon.js +0 -22
- package/dist/es/src/components/projects/icons/GroupIcon.js.map +0 -1
- package/dist/es/src/components/projects/icons/LinkIcon.js +0 -16
- package/dist/es/src/components/projects/icons/LinkIcon.js.map +0 -1
- package/dist/es/src/components/projects/icons/TemplateIcon.js +0 -16
- package/dist/es/src/components/projects/icons/TemplateIcon.js.map +0 -1
- package/dist/es/src/lib/select-styles.js +0 -37
- package/dist/es/src/lib/select-styles.js.map +0 -1
- package/dist/es/src/lib/sources.js +0 -33
- package/dist/es/src/lib/sources.js.map +0 -1
- package/dist/types/src/components/SelectField.d.ts +0 -23
- package/dist/types/src/components/library/BibliographyImportButton.d.ts +0 -23
- package/dist/types/src/components/library/CitationEditor.d.ts +0 -30
- package/dist/types/src/components/library/CitationModal.d.ts +0 -17
- package/dist/types/src/components/library/CitationSearch.d.ts +0 -22
- package/dist/types/src/components/library/CitationSearchSection.d.ts +0 -34
- package/dist/types/src/components/library/CitationViewer.d.ts +0 -18
- package/dist/types/src/components/library/ReferenceForm.d.ts +0 -51
- package/dist/types/src/components/library/ReferencesEditor.d.ts +0 -22
- package/dist/types/src/components/library/ReferencesViewer.d.ts +0 -9
- package/dist/types/src/components/library/SearchResults.d.ts +0 -26
- package/dist/types/src/components/metadata/AuthorsInlineViewContainer.d.ts +0 -23
- package/dist/types/src/components/projects/icons/DeleteIcon.d.ts +0 -13
- package/dist/types/src/components/projects/icons/GroupIcon.d.ts +0 -15
- package/dist/types/src/components/projects/icons/LinkIcon.d.ts +0 -13
- package/dist/types/src/components/projects/icons/TemplateIcon.d.ts +0 -13
- package/dist/types/src/lib/select-styles.d.ts +0 -13
- package/dist/types/src/lib/sources.d.ts +0 -25
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CitationSearch.js","sourceRoot":"","sources":["../../../../../src/components/library/CitationSearch.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,sBA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,EAAE,YAAY,YAAyB;gBAE/D,oBAAC,aAAa,IACZ,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,QAAQ,CAAC,IAAI,KAAK,CAAC,WAGf,CACJ,CACN,CACA,CACb,CAAA;AACH,CAAC,CAAA;AAED,MAAM,kBAAkB,GAAG,MAAM,CAAC,WAAW,CAAC,CAAA;;oBAE1B,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;;;;;;gBAMxC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM;;;gBAG1C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM;;;CAGzD,CAAA"}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
3
|
-
*
|
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
5
|
-
*
|
|
6
|
-
* The Original Code is manuscripts-frontend.
|
|
7
|
-
*
|
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
9
|
-
*
|
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
-
*/
|
|
12
|
-
import ArrowDownBlack from '@manuscripts/assets/react/ArrowDownBlack';
|
|
13
|
-
import { SecondaryButton } from '@manuscripts/style-guide';
|
|
14
|
-
import React, { useCallback, useEffect, useState } from 'react';
|
|
15
|
-
import styled from 'styled-components';
|
|
16
|
-
import config from '../../config';
|
|
17
|
-
import { SearchResults } from './SearchResults';
|
|
18
|
-
const ResultsSection = styled.div `
|
|
19
|
-
margin: ${(props) => props.theme.grid.unit * 2}px 0;
|
|
20
|
-
`;
|
|
21
|
-
const SearchSource = styled.div `
|
|
22
|
-
margin: 0 ${(props) => props.theme.grid.unit * 4}px
|
|
23
|
-
${(props) => props.theme.grid.unit * 2}px;
|
|
24
|
-
color: ${(props) => props.theme.colors.text.secondary};
|
|
25
|
-
cursor: pointer;
|
|
26
|
-
|
|
27
|
-
&:hover {
|
|
28
|
-
color: ${(props) => props.theme.colors.text.muted};
|
|
29
|
-
}
|
|
30
|
-
`;
|
|
31
|
-
const MoreButton = styled(SecondaryButton) `
|
|
32
|
-
font-size: inherit;
|
|
33
|
-
text-transform: none;
|
|
34
|
-
text-decoration: underline;
|
|
35
|
-
border: none;
|
|
36
|
-
margin-left: ${(props) => props.theme.grid.unit * 4}px;
|
|
37
|
-
color: ${(props) => props.theme.colors.button.default.color.default};
|
|
38
|
-
`;
|
|
39
|
-
const DropdownChevron = styled(ArrowDownBlack) `
|
|
40
|
-
margin-right: ${(props) => props.theme.grid.unit * 4}px;
|
|
41
|
-
width: ${(props) => props.theme.grid.unit * 6}px;
|
|
42
|
-
`;
|
|
43
|
-
export const CitationSearchSection = ({ query, source, addToSelection, selectSource, rows, selected, fetching, }) => {
|
|
44
|
-
const [error, setError] = useState();
|
|
45
|
-
const [expanded, setExpanded] = useState(true);
|
|
46
|
-
const [searching, setSearching] = useState(false);
|
|
47
|
-
const [showMoreSearching, setShowMoreSearching] = useState(false);
|
|
48
|
-
const [results, setResults] = useState();
|
|
49
|
-
useEffect(() => {
|
|
50
|
-
setError(undefined);
|
|
51
|
-
setResults(undefined);
|
|
52
|
-
setShowMoreSearching(false);
|
|
53
|
-
setSearching(query !== '');
|
|
54
|
-
}, [query]);
|
|
55
|
-
const handleSearchResults = useCallback((searchQuery, results) => {
|
|
56
|
-
if (searchQuery === query) {
|
|
57
|
-
setError(undefined);
|
|
58
|
-
setSearching(false);
|
|
59
|
-
setShowMoreSearching(false);
|
|
60
|
-
setResults(results);
|
|
61
|
-
}
|
|
62
|
-
}, [query]);
|
|
63
|
-
useEffect(() => {
|
|
64
|
-
if (!expanded) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
if (source.id !== 'library' && !query) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
source
|
|
71
|
-
.search(query, { rows }, config.support.email)
|
|
72
|
-
.then((results) => {
|
|
73
|
-
handleSearchResults(query, results);
|
|
74
|
-
})
|
|
75
|
-
.catch((error) => {
|
|
76
|
-
setError(error.message);
|
|
77
|
-
});
|
|
78
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
79
|
-
}, [query, expanded, handleSearchResults, rows]);
|
|
80
|
-
const toggleExpanded = useCallback(() => {
|
|
81
|
-
setExpanded((value) => !value);
|
|
82
|
-
}, []);
|
|
83
|
-
const showMoreCallback = useCallback(() => {
|
|
84
|
-
selectSource(source.id);
|
|
85
|
-
setSearching(true);
|
|
86
|
-
setShowMoreSearching(true);
|
|
87
|
-
}, [selectSource, source.id]);
|
|
88
|
-
return (React.createElement(ResultsSection, null,
|
|
89
|
-
React.createElement(SearchSource, { onClick: toggleExpanded },
|
|
90
|
-
React.createElement(DropdownChevron, { style: {
|
|
91
|
-
transform: expanded ? 'rotate(0)' : 'rotate(-90deg)',
|
|
92
|
-
} }),
|
|
93
|
-
source.title),
|
|
94
|
-
expanded && (React.createElement(SearchResults, { error: error, results: results, searching: searching, showMoreSearching: showMoreSearching, handleSelect: addToSelection, selected: selected, fetching: fetching })),
|
|
95
|
-
showMoreSearching && React.createElement(SearchingLabel, null, "Searching...."),
|
|
96
|
-
expanded && results && results.total > rows && rows < 25 && (React.createElement(MoreButton, { onClick: showMoreCallback, "data-cy": 'more-button' }, "Show more"))));
|
|
97
|
-
};
|
|
98
|
-
export const SearchingLabel = styled.div `
|
|
99
|
-
color: ${(props) => props.theme.colors.text.secondary};
|
|
100
|
-
margin: ${(props) => props.theme.grid.unit * 4}px
|
|
101
|
-
${(props) => props.theme.grid.unit * 5}px;
|
|
102
|
-
`;
|
|
103
|
-
//# sourceMappingURL=CitationSearchSection.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CitationSearchSection.js","sourceRoot":"","sources":["../../../../../src/components/library/CitationSearchSection.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,cAAc,MAAM,0CAA0C,CAAA;AAErE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAE1D,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC/D,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,MAAM,MAAM,cAAc,CAAA;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA;YACrB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;CAC/C,CAAA;AAED,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAA;cACjB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;MAC5C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;WAC/B,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS;;;;aAI1C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,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|
|
|
1
|
-
/*!
|
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
3
|
-
*
|
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
5
|
-
*
|
|
6
|
-
* The Original Code is manuscripts-frontend.
|
|
7
|
-
*
|
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
9
|
-
*
|
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
-
*/
|
|
12
|
-
import { shortLibraryItemMetadata } from '@manuscripts/library';
|
|
13
|
-
import { Title } from '@manuscripts/title-editor';
|
|
14
|
-
import React from 'react';
|
|
15
|
-
import styled from 'styled-components';
|
|
16
|
-
const CitedItem = styled.div `
|
|
17
|
-
padding: ${(props) => props.theme.grid.unit * 4}px 0;
|
|
18
|
-
cursor: pointer;
|
|
19
|
-
|
|
20
|
-
&:not(:last-of-type) {
|
|
21
|
-
border-bottom: 1px solid ${(props) => props.theme.colors.border.tertiary};
|
|
22
|
-
}
|
|
23
|
-
`;
|
|
24
|
-
const CitedItemTitle = styled(Title) ``;
|
|
25
|
-
const CitedItemAuthors = styled.div `
|
|
26
|
-
margin-top: ${(props) => props.theme.grid.unit}px;
|
|
27
|
-
color: ${(props) => props.theme.colors.text.secondary};
|
|
28
|
-
flex: 1;
|
|
29
|
-
white-space: nowrap;
|
|
30
|
-
text-overflow: ellipsis;
|
|
31
|
-
overflow: hidden;
|
|
32
|
-
`;
|
|
33
|
-
const CitedItems = styled.div `
|
|
34
|
-
padding: 0 ${(props) => props.theme.grid.unit * 4}px;
|
|
35
|
-
font-family: ${(props) => props.theme.font.family.sans};
|
|
36
|
-
max-height: 70vh;
|
|
37
|
-
overflow-y: auto;
|
|
38
|
-
`;
|
|
39
|
-
export const CitationViewer = ({ items }) => (React.createElement(CitedItems, null, items.map((item) => (React.createElement(CitedItem, { key: item._id, onClick: () => {
|
|
40
|
-
if (item.DOI) {
|
|
41
|
-
window.open(`https://doi.org/${item.DOI}`);
|
|
42
|
-
}
|
|
43
|
-
} },
|
|
44
|
-
React.createElement(CitedItemTitle, { value: item.title || 'Untitled' }),
|
|
45
|
-
React.createElement(CitedItemAuthors, null, shortLibraryItemMetadata(item)))))));
|
|
46
|
-
//# sourceMappingURL=CitationViewer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CitationViewer.js","sourceRoot":"","sources":["../../../../../src/components/library/CitationViewer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAA;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AACjD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAA;aACf,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;;;;+BAIlB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ;;CAE3E,CAAA;AAED,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA,EAAE,CAAA;AAEtC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;gBACnB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI;WACrC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS;;;;;CAKtD,CAAA;AAED,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAA;eACd,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;iBAClC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI;;;CAGvD,CAAA;AAMD,MAAM,CAAC,MAAM,cAAc,GAAoB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAC5D,oBAAC,UAAU,QACR,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,oBAAC,SAAS,IACR,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,OAAO,EAAE,GAAG,EAAE;QACZ,IAAI,IAAI,CAAC,GAAG,EAAE;YACZ,MAAM,CAAC,IAAI,CAAC,mBAAmB,IAAI,CAAC,GAAG,EAAE,CAAC,CAAA;SAC3C;IACH,CAAC;IAED,oBAAC,cAAc,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,UAAU,GAAI;IAEnD,oBAAC,gBAAgB,QAAE,wBAAwB,CAAC,IAAI,CAAC,CAAoB,CAC3D,CACb,CAAC,CACS,CACd,CAAA"}
|
|
@@ -1,389 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
3
|
-
*
|
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
5
|
-
*
|
|
6
|
-
* The Original Code is manuscripts-frontend.
|
|
7
|
-
*
|
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
9
|
-
*
|
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2019 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
-
*/
|
|
12
|
-
import AddAuthor from '@manuscripts/assets/react/AddAuthor';
|
|
13
|
-
import Trashcan from '@manuscripts/assets/react/AnnotationRemove';
|
|
14
|
-
import ArrowDownBlue from '@manuscripts/assets/react/ArrowDownBlue';
|
|
15
|
-
import { bibliographyItemTypes } from '@manuscripts/library';
|
|
16
|
-
import { ButtonGroup, Category, Dialog, IconButton, PrimaryButton, SecondaryButton, TextField, } from '@manuscripts/style-guide';
|
|
17
|
-
import { TitleField } from '@manuscripts/title-editor';
|
|
18
|
-
import { buildBibliographicDate, buildBibliographicName, } from '@manuscripts/transform';
|
|
19
|
-
import { Field, FieldArray, Form, Formik, } from 'formik';
|
|
20
|
-
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
21
|
-
import ReactTooltip from 'react-tooltip';
|
|
22
|
-
import styled from 'styled-components';
|
|
23
|
-
import { DeleteIcon } from '../projects/icons/DeleteIcon';
|
|
24
|
-
import { LinkIcon } from '../projects/icons/LinkIcon';
|
|
25
|
-
import { SelectField } from '../SelectField';
|
|
26
|
-
export const LabelContainer = styled.div `
|
|
27
|
-
display: flex;
|
|
28
|
-
justify-content: space-between;
|
|
29
|
-
align-items: center;
|
|
30
|
-
margin-bottom: ${(props) => props.theme.grid.unit}px;
|
|
31
|
-
`;
|
|
32
|
-
const Label = styled.label `
|
|
33
|
-
font-family: ${(props) => props.theme.font.family.sans};
|
|
34
|
-
font-size: ${(props) => props.theme.font.size.medium};
|
|
35
|
-
display: flex;
|
|
36
|
-
color: ${(props) => props.theme.colors.text.secondary};
|
|
37
|
-
`;
|
|
38
|
-
const FieldLabel = styled.label `
|
|
39
|
-
font-family: ${(props) => props.theme.font.family.sans};
|
|
40
|
-
font-size: ${(props) => props.theme.font.size.medium};
|
|
41
|
-
color: ${(props) => props.theme.colors.text.muted};
|
|
42
|
-
padding-right: ${(props) => props.theme.grid.unit * 3}px;
|
|
43
|
-
`;
|
|
44
|
-
const NameFieldContainer = styled.div `
|
|
45
|
-
display: flex;
|
|
46
|
-
align-items: center;
|
|
47
|
-
justify-content: space-between;
|
|
48
|
-
background-color: ${(props) => props.theme.colors.background.primary};
|
|
49
|
-
:not(:last-child) {
|
|
50
|
-
border-bottom: 1px solid ${(props) => props.theme.colors.text.muted};
|
|
51
|
-
}
|
|
52
|
-
`;
|
|
53
|
-
const NameField = styled.input `
|
|
54
|
-
font-size: ${(props) => props.theme.font.size.normal};
|
|
55
|
-
padding: ${(props) => props.theme.grid.unit * 2}px
|
|
56
|
-
${(props) => props.theme.grid.unit * 4}px;
|
|
57
|
-
box-sizing: border-box;
|
|
58
|
-
border: none;
|
|
59
|
-
background-color: transparent;
|
|
60
|
-
width: 50%;
|
|
61
|
-
|
|
62
|
-
&:focus {
|
|
63
|
-
outline: none;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
&::placeholder {
|
|
67
|
-
color: ${(props) => props.theme.colors.text.muted};
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
&:hover::placeholder {
|
|
71
|
-
color: ${(props) => props.theme.colors.text.secondary};
|
|
72
|
-
}
|
|
73
|
-
`;
|
|
74
|
-
const StyledTitleField = styled(TitleField) `
|
|
75
|
-
& .ProseMirror {
|
|
76
|
-
font-family: ${(props) => props.theme.font.family.sans};
|
|
77
|
-
font-size: ${(props) => props.theme.font.size.medium};
|
|
78
|
-
line-height: 1.25;
|
|
79
|
-
color: ${(props) => props.theme.colors.text.primary};
|
|
80
|
-
border-radius: ${(props) => props.theme.grid.radius.small};
|
|
81
|
-
border: 1px solid ${(props) => props.theme.colors.text.muted};
|
|
82
|
-
padding: ${(props) => props.theme.grid.unit * 2}px
|
|
83
|
-
${(props) => props.theme.grid.unit * 3}px;
|
|
84
|
-
min-height: ${(props) => props.theme.grid.unit * 21}px;
|
|
85
|
-
&:focus {
|
|
86
|
-
outline: none;
|
|
87
|
-
border-color: ${(props) => props.theme.colors.border.field.hover};
|
|
88
|
-
background-color: ${(props) => props.theme.colors.background.fifth};
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
&:hover {
|
|
93
|
-
& .ProseMirror {
|
|
94
|
-
background-color: ${(props) => props.theme.colors.background.fifth};
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
`;
|
|
98
|
-
const FormTextField = styled(TextField) `
|
|
99
|
-
padding: ${(props) => props.theme.grid.unit * 2}px
|
|
100
|
-
${(props) => props.theme.grid.unit * 3}px;
|
|
101
|
-
`;
|
|
102
|
-
const ContainerTextField = styled(FormTextField) `
|
|
103
|
-
min-height: ${(props) => props.theme.grid.unit * 15}px;
|
|
104
|
-
`;
|
|
105
|
-
const YearField = styled(Field) `
|
|
106
|
-
font-family: ${(props) => props.theme.font.family.sans};
|
|
107
|
-
padding: ${(props) => props.theme.grid.unit * 2}px
|
|
108
|
-
${(props) => props.theme.grid.unit * 3}px;
|
|
109
|
-
font-size: ${(props) => props.theme.font.size.medium};
|
|
110
|
-
color: ${(props) => props.theme.colors.text.primary};
|
|
111
|
-
border-radius: ${(props) => props.theme.grid.radius.small};
|
|
112
|
-
border: solid 1px ${(props) => props.theme.colors.text.muted};
|
|
113
|
-
`;
|
|
114
|
-
const Button = styled(IconButton).attrs({
|
|
115
|
-
defaultColor: true,
|
|
116
|
-
size: 24,
|
|
117
|
-
}) `
|
|
118
|
-
circle,
|
|
119
|
-
use {
|
|
120
|
-
fill: ${(props) => props.theme.colors.brand.default};
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
path {
|
|
124
|
-
mask: none;
|
|
125
|
-
}
|
|
126
|
-
`;
|
|
127
|
-
const Actions = styled.div `
|
|
128
|
-
flex-shrink: 1;
|
|
129
|
-
display: flex;
|
|
130
|
-
justify-content: space-between;
|
|
131
|
-
align-items: center;
|
|
132
|
-
padding: ${(props) => props.theme.grid.unit * 8}px;
|
|
133
|
-
|
|
134
|
-
.tooltip {
|
|
135
|
-
max-width: ${(props) => props.theme.grid.unit * 39}px;
|
|
136
|
-
padding: ${(props) => props.theme.grid.unit * 2}px;
|
|
137
|
-
border-radius: 6px;
|
|
138
|
-
}
|
|
139
|
-
`;
|
|
140
|
-
export const FormField = styled.div `
|
|
141
|
-
padding: ${(props) => props.theme.grid.unit * 3}px;
|
|
142
|
-
padding-left: ${(props) => props.theme.grid.unit * 8}px;
|
|
143
|
-
`;
|
|
144
|
-
export const FlexForm = styled(Form) `
|
|
145
|
-
height: 100%;
|
|
146
|
-
display: flex;
|
|
147
|
-
flex-direction: column;
|
|
148
|
-
overflow: hidden;
|
|
149
|
-
`;
|
|
150
|
-
export const FormFields = styled.div `
|
|
151
|
-
flex: 1;
|
|
152
|
-
overflow-y: auto;
|
|
153
|
-
`;
|
|
154
|
-
const AuthorDropDown = ({ author, index, remove, handleChange }) => {
|
|
155
|
-
const [isOpen, setIsOpen] = useState(!!author['isNew']);
|
|
156
|
-
const fullName = [author.given, author.family].join(' ').trim();
|
|
157
|
-
const title = fullName.length > 0 ? fullName : 'Edit author name';
|
|
158
|
-
return (React.createElement(Section, { key: author._id },
|
|
159
|
-
React.createElement(Title, null,
|
|
160
|
-
React.createElement(ToggleButton, { type: "button", onClick: () => setIsOpen(!isOpen), isOpen: isOpen },
|
|
161
|
-
React.createElement(DropdownIndicator, null,
|
|
162
|
-
React.createElement(ArrowDownBlue, null)),
|
|
163
|
-
title),
|
|
164
|
-
React.createElement(RemoveButton, { type: "button", "aria-label": "Delete this affiliation", onClick: () => remove(index) },
|
|
165
|
-
React.createElement(Trashcan, null))),
|
|
166
|
-
isOpen && (React.createElement(AuthorForm, null,
|
|
167
|
-
React.createElement(Field, { name: `author.${index}.given`, value: author.given, onChange: handleChange }, ({ field }) => (React.createElement(NameFieldContainer, null,
|
|
168
|
-
React.createElement(NameField, { ...field, id: field.name, placeholder: 'Given', autoFocus: true }),
|
|
169
|
-
React.createElement(FieldLabel, { htmlFor: field.name }, "Given")))),
|
|
170
|
-
React.createElement(Field, { name: `author.${index}.family`, value: author.family, onChange: handleChange }, ({ field }) => (React.createElement(NameFieldContainer, null,
|
|
171
|
-
React.createElement(NameField, { ...field, id: field.name, placeholder: 'Family', autoFocus: true }),
|
|
172
|
-
React.createElement(FieldLabel, { htmlFor: field.name }, "Family"))))))));
|
|
173
|
-
};
|
|
174
|
-
export const buildInitialValues = (item) => ({
|
|
175
|
-
_id: item._id,
|
|
176
|
-
title: item.title || '',
|
|
177
|
-
author: item.author || [],
|
|
178
|
-
DOI: item.DOI || '',
|
|
179
|
-
issued: item.issued || '',
|
|
180
|
-
type: item.type || '',
|
|
181
|
-
'container-title': item['container-title'] || '',
|
|
182
|
-
URL: item.URL || '',
|
|
183
|
-
issue: item.issue ? String(item.issue) : '',
|
|
184
|
-
volume: item.volume ? String(item.volume) : '',
|
|
185
|
-
supplement: item.supplement ? String(item.supplement) : '',
|
|
186
|
-
page: item.page ? String(item.page) : '',
|
|
187
|
-
});
|
|
188
|
-
// NOTE: not undefined due to https://github.com/jaredpalmer/formik/issues/2180
|
|
189
|
-
export const bibliographyItemTypeOptions = Array.from(bibliographyItemTypes.entries())
|
|
190
|
-
.map(([value, label]) => ({ value, label }))
|
|
191
|
-
.sort((a, b) => a.label.localeCompare(b.label));
|
|
192
|
-
const ReferenceForm = ({ item, formMikRef, disableDelete, deleteCallback, handleCancel, saveCallback, }) => {
|
|
193
|
-
const formRef = useRef(null);
|
|
194
|
-
useEffect(() => {
|
|
195
|
-
if (formRef.current) {
|
|
196
|
-
formRef.current.scrollTop = 0;
|
|
197
|
-
}
|
|
198
|
-
}, [item]);
|
|
199
|
-
const [showDeleteDialog, setShowDeleteDialog] = useState(false);
|
|
200
|
-
const deleteClickCallback = useCallback(() => setShowDeleteDialog(true), []);
|
|
201
|
-
return (React.createElement(Formik, { initialValues: buildInitialValues(item), onSubmit: saveCallback, innerRef: formMikRef, enableReinitialize: true }, ({ values, setFieldValue, handleChange }) => {
|
|
202
|
-
return (React.createElement(FlexForm, null,
|
|
203
|
-
React.createElement(Dialog, { isOpen: showDeleteDialog, category: Category.confirmation, header: "Delete Reference", message: "Are you sure you want to delete this reference from the list?", actions: {
|
|
204
|
-
secondary: {
|
|
205
|
-
action: () => {
|
|
206
|
-
deleteCallback();
|
|
207
|
-
setShowDeleteDialog(false);
|
|
208
|
-
},
|
|
209
|
-
title: 'Delete',
|
|
210
|
-
},
|
|
211
|
-
primary: {
|
|
212
|
-
action: () => setShowDeleteDialog(false),
|
|
213
|
-
title: 'Cancel',
|
|
214
|
-
},
|
|
215
|
-
} }),
|
|
216
|
-
React.createElement(Actions, null,
|
|
217
|
-
React.createElement(ButtonGroup, null,
|
|
218
|
-
React.createElement(IconButton, { defaultColor: true, as: "a", href: `https://doi.org/${values.DOI}`, target: '_blank' },
|
|
219
|
-
React.createElement(LinkIcon, null)),
|
|
220
|
-
React.createElement("div", { "data-tip": true, "data-for": 'delete-button' },
|
|
221
|
-
React.createElement(DeleteButton, { defaultColor: true, disabled: disableDelete, onClick: deleteClickCallback },
|
|
222
|
-
React.createElement(DeleteIcon, null)),
|
|
223
|
-
React.createElement(ReactTooltip, { disable: !disableDelete, id: 'delete-button', place: "bottom", effect: "solid", offset: { top: 15 }, className: "tooltip" }, "Unable to delete because the item is used in the document"))),
|
|
224
|
-
React.createElement(ButtonGroup, null,
|
|
225
|
-
React.createElement(SecondaryButton, { onClick: handleCancel }, "Cancel"),
|
|
226
|
-
React.createElement(PrimaryButton, { type: "submit" }, "Save"))),
|
|
227
|
-
React.createElement(FormFields, { ref: formRef },
|
|
228
|
-
React.createElement(FormField, null,
|
|
229
|
-
React.createElement(LabelContainer, null,
|
|
230
|
-
React.createElement(Label, { htmlFor: 'citation-item-type' }, "Type")),
|
|
231
|
-
React.createElement(Field, { id: 'citation-item-type', name: 'type', component: SelectField, options: bibliographyItemTypeOptions })),
|
|
232
|
-
React.createElement(FormField, null,
|
|
233
|
-
React.createElement(LabelContainer, null,
|
|
234
|
-
React.createElement(Label, null, "Title")),
|
|
235
|
-
React.createElement(StyledTitleField, { value: values.title || '', handleChange: (data) => setFieldValue('title', data), autoFocus: !values.title })),
|
|
236
|
-
React.createElement(FieldArray, { name: 'author', render: ({ push, remove }) => (React.createElement(FormField, null,
|
|
237
|
-
React.createElement(LabelContainer, null,
|
|
238
|
-
React.createElement(Label, null, "Authors"),
|
|
239
|
-
React.createElement(Button, { onClick: () => push(buildBibliographicName({
|
|
240
|
-
given: '',
|
|
241
|
-
family: '',
|
|
242
|
-
isNew: true,
|
|
243
|
-
})) },
|
|
244
|
-
React.createElement(AddAuthor, { height: 17, width: 17 }))),
|
|
245
|
-
React.createElement("div", null, values.author &&
|
|
246
|
-
values.author.map((author, index) => (React.createElement(AuthorDropDown, { key: index, index: index, author: author, remove: remove, handleChange: handleChange })))))) }),
|
|
247
|
-
React.createElement(FormField, null,
|
|
248
|
-
React.createElement(LabelContainer, null,
|
|
249
|
-
React.createElement(Label, { htmlFor: "issued['date-parts'][0][0]" }, "Year")),
|
|
250
|
-
React.createElement(YearField, { name: "issued['date-parts'][0][0]", type: 'number', step: 1, onChange: (event) => {
|
|
251
|
-
const { value } = event.target;
|
|
252
|
-
if (value) {
|
|
253
|
-
if (values.issued) {
|
|
254
|
-
// NOTE: this assumes that "issued" is already a complete object
|
|
255
|
-
setFieldValue("issued['date-parts'][0][0]", Number(value));
|
|
256
|
-
}
|
|
257
|
-
else {
|
|
258
|
-
setFieldValue('issued', buildBibliographicDate({
|
|
259
|
-
'date-parts': [[Number(value)]],
|
|
260
|
-
}));
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
else {
|
|
264
|
-
// NOTE: not undefined due to https://github.com/jaredpalmer/formik/issues/2180
|
|
265
|
-
setFieldValue('issued', '');
|
|
266
|
-
}
|
|
267
|
-
} })),
|
|
268
|
-
React.createElement(FormField, null,
|
|
269
|
-
React.createElement(LabelContainer, null,
|
|
270
|
-
React.createElement(Label, { htmlFor: 'container-title' }, "Container Title")),
|
|
271
|
-
React.createElement(Field, { name: 'container-title' }, (props) => (React.createElement(ContainerTextField, { id: 'container-title', ...props.field })))),
|
|
272
|
-
React.createElement(FormField, null,
|
|
273
|
-
React.createElement(LabelContainer, null,
|
|
274
|
-
React.createElement(Label, { htmlFor: 'volume' }, "Volume")),
|
|
275
|
-
React.createElement(Field, { name: 'volume' }, (props) => (React.createElement(FormTextField, { id: 'volume', ...props.field })))),
|
|
276
|
-
React.createElement(FormField, null,
|
|
277
|
-
React.createElement(LabelContainer, null,
|
|
278
|
-
React.createElement(Label, { htmlFor: 'issue' }, "Issue")),
|
|
279
|
-
React.createElement(Field, { name: 'issue' }, (props) => (React.createElement(FormTextField, { id: 'issue', ...props.field })))),
|
|
280
|
-
React.createElement(FormField, null,
|
|
281
|
-
React.createElement(LabelContainer, null,
|
|
282
|
-
React.createElement(Label, { htmlFor: 'page' }, "Page")),
|
|
283
|
-
React.createElement(Field, { name: 'page' }, (props) => (React.createElement(FormTextField, { id: 'page', ...props.field })))),
|
|
284
|
-
React.createElement(FormField, null,
|
|
285
|
-
React.createElement(LabelContainer, null,
|
|
286
|
-
React.createElement(Label, { htmlFor: 'url' }, "URL")),
|
|
287
|
-
React.createElement(Field, { name: 'URL' }, (props) => (React.createElement(FormTextField, { type: 'url', id: 'url', ...props.field })))),
|
|
288
|
-
React.createElement(FormField, null,
|
|
289
|
-
React.createElement(LabelContainer, null,
|
|
290
|
-
React.createElement(Label, { htmlFor: 'doi' }, "DOI")),
|
|
291
|
-
React.createElement(Field, { name: 'DOI' }, (props) => (React.createElement(FormTextField, { id: 'doi', pattern: '(https://doi.org/)?10..+', ...props.field })))),
|
|
292
|
-
React.createElement(FormField, null,
|
|
293
|
-
React.createElement(LabelContainer, null,
|
|
294
|
-
React.createElement(Label, { htmlFor: 'supplement' }, "Supplement")),
|
|
295
|
-
React.createElement(Field, { name: 'supplement' }, (props) => (React.createElement(FormTextField, { type: 'supplement', id: 'supplement', ...props.field })))))));
|
|
296
|
-
}));
|
|
297
|
-
};
|
|
298
|
-
export default ReferenceForm;
|
|
299
|
-
const DeleteButton = styled(IconButton) `
|
|
300
|
-
background-color: ${(props) => props.theme.colors.background.primary} !important;
|
|
301
|
-
border-color: ${(props) => props.theme.colors.background.primary} !important;
|
|
302
|
-
.icon_element {
|
|
303
|
-
fill: ${(props) => (props.disabled && '#c9c9c9') || '#F35143'} !important;
|
|
304
|
-
}
|
|
305
|
-
`;
|
|
306
|
-
const Section = styled.section `
|
|
307
|
-
border: 1px solid ${(props) => props.theme.colors.border.field.default};
|
|
308
|
-
border-radius: ${(props) => props.theme.grid.radius.default};
|
|
309
|
-
background: ${(props) => props.theme.colors.background.primary};
|
|
310
|
-
margin-bottom: ${(props) => props.theme.grid.unit * 3}px;
|
|
311
|
-
overflow: hidden;
|
|
312
|
-
`;
|
|
313
|
-
const AuthorForm = styled(Section) `
|
|
314
|
-
margin: ${(props) => props.theme.grid.unit * 3}px;
|
|
315
|
-
`;
|
|
316
|
-
const Title = styled.h4 `
|
|
317
|
-
margin: 0;
|
|
318
|
-
display: flex;
|
|
319
|
-
align-items: center;
|
|
320
|
-
font-size: 0.875rem;
|
|
321
|
-
padding-right: 0.5rem;
|
|
322
|
-
background: ${(props) => props.isInvalid ? props.theme.colors.background.warning : 'transparent'};
|
|
323
|
-
color: ${(props) => props.isInvalid ? props.theme.colors.text.warning : 'inherit'};
|
|
324
|
-
`;
|
|
325
|
-
const DropdownIndicator = styled(ArrowDownBlue) `
|
|
326
|
-
border: 0;
|
|
327
|
-
border-radius: 50%;
|
|
328
|
-
margin-right: 0.6em;
|
|
329
|
-
min-width: 20px;
|
|
330
|
-
`;
|
|
331
|
-
const ToggleButton = styled.button `
|
|
332
|
-
flex-grow: 1;
|
|
333
|
-
display: flex;
|
|
334
|
-
align-items: center;
|
|
335
|
-
width: 100%;
|
|
336
|
-
background: transparent;
|
|
337
|
-
border: none;
|
|
338
|
-
text-align: left;
|
|
339
|
-
font-family: ${(props) => props.theme.font.family.sans};
|
|
340
|
-
font-size: 1rem;
|
|
341
|
-
padding: 0.6em 0.5em;
|
|
342
|
-
|
|
343
|
-
outline: none;
|
|
344
|
-
|
|
345
|
-
&:focus {
|
|
346
|
-
color: ${(props) => props.theme.colors.button.primary.border.hover};
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
svg {
|
|
350
|
-
transform: ${(props) => (props.isOpen ? 'rotateX(180deg)' : 'initial')};
|
|
351
|
-
}
|
|
352
|
-
`;
|
|
353
|
-
const RemoveButton = styled.button `
|
|
354
|
-
border: none;
|
|
355
|
-
background: transparent;
|
|
356
|
-
padding: 0;
|
|
357
|
-
|
|
358
|
-
outline: none;
|
|
359
|
-
|
|
360
|
-
&:focus path {
|
|
361
|
-
fill: ${(props) => props.theme.colors.button.primary.color.hover};
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
svg {
|
|
365
|
-
width: 2rem;
|
|
366
|
-
height: 2rem;
|
|
367
|
-
}
|
|
368
|
-
`;
|
|
369
|
-
export const AddAffiliationContainer = styled.div `
|
|
370
|
-
padding-right: 0.71rem;
|
|
371
|
-
display: flex;
|
|
372
|
-
flex-direction: column;
|
|
373
|
-
justify-content: space-around;
|
|
374
|
-
|
|
375
|
-
svg {
|
|
376
|
-
width: 1.5rem;
|
|
377
|
-
height: 1.5rem;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
circle,
|
|
381
|
-
use {
|
|
382
|
-
fill: ${(props) => props.theme.colors.brand.default};
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
path {
|
|
386
|
-
mask: none;
|
|
387
|
-
}
|
|
388
|
-
`;
|
|
389
|
-
//# sourceMappingURL=ReferenceFor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O,CAAC,CAAC,CAAC,aAAa;WAChE,CAAC,KAAK,EAAE,EAAE,CACjB,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;CAChE,CAAA;AAED,MAAM,iBAAiB,GAAG,MAAM,CAAC,aAAa,CAAC,CAAA;;;;;CAK9C,CAAA;AAED,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAEhC;;;;;;;;iBAQe,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI;;;;;;;aAO3C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK;;;;iBAIrD,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC;;CAEzE,CAAA;AAED,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAA;;;;;;;;YAQtB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK;;;;;;;CAOnE,CAAA;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;YAarC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO;;;;;;CAMtD,CAAA"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
3
|
-
*
|
|
4
|
-
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
5
|
-
*
|
|
6
|
-
* The Original Code is manuscripts-frontend.
|
|
7
|
-
*
|
|
8
|
-
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
9
|
-
*
|
|
10
|
-
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2023 Atypon Systems LLC. All Rights Reserved.
|
|
11
|
-
*/
|
|
12
|
-
import { ObjectTypes } from '@manuscripts/json-schema';
|
|
13
|
-
import React, { useCallback, useEffect, useState } from 'react';
|
|
14
|
-
import { CitationModal } from './CitationModal';
|
|
15
|
-
export const ReferencesEditor = (props) => {
|
|
16
|
-
const { saveModel, deleteModel, referenceID } = props;
|
|
17
|
-
const [modelMap, setModelMap] = useState(props.modelMap);
|
|
18
|
-
const [showEditModel, setShowEditModel] = useState(false);
|
|
19
|
-
const [selectedItem, setSelectedItem] = useState();
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
if (referenceID) {
|
|
22
|
-
const reference = modelMap.get(referenceID);
|
|
23
|
-
setSelectedItem(reference);
|
|
24
|
-
setShowEditModel(true);
|
|
25
|
-
}
|
|
26
|
-
}, [referenceID, modelMap]);
|
|
27
|
-
const saveCallback = useCallback(async (item) => {
|
|
28
|
-
await saveModel({ ...item, objectType: ObjectTypes.BibliographyItem });
|
|
29
|
-
setModelMap(new Map([
|
|
30
|
-
...modelMap,
|
|
31
|
-
[item._id, { ...item, objectType: ObjectTypes.BibliographyItem }],
|
|
32
|
-
]));
|
|
33
|
-
}, [saveModel, modelMap]);
|
|
34
|
-
const deleteReferenceCallback = useCallback(async () => {
|
|
35
|
-
if (selectedItem) {
|
|
36
|
-
await deleteModel(selectedItem._id);
|
|
37
|
-
modelMap.delete(selectedItem._id);
|
|
38
|
-
setModelMap(new Map([...modelMap]));
|
|
39
|
-
}
|
|
40
|
-
}, [selectedItem, deleteModel, modelMap]);
|
|
41
|
-
return (React.createElement(CitationModal, { editCitation: showEditModel, modelMap: modelMap, saveCallback: saveCallback, selectedItem: selectedItem, deleteCallback: deleteReferenceCallback, setSelectedItem: setSelectedItem, setShowEditModel: setShowEditModel }));
|
|
42
|
-
};
|
|
43
|
-
//# sourceMappingURL=ReferencesEditor.js.map
|