@manuscripts/article-editor 1.9.4 → 1.9.5-LEAN-3092-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/dist/cjs/src/components/Sidebar/Sidebar.js +1 -2
  2. package/dist/cjs/src/components/Sidebar/Sidebar.js.map +1 -1
  3. package/dist/cjs/src/hooks/use-create-editor.js +0 -18
  4. package/dist/cjs/src/hooks/use-create-editor.js.map +1 -1
  5. package/dist/es/src/components/Sidebar/Sidebar.js +1 -2
  6. package/dist/es/src/components/Sidebar/Sidebar.js.map +1 -1
  7. package/dist/es/src/hooks/use-create-editor.js +0 -18
  8. package/dist/es/src/hooks/use-create-editor.js.map +1 -1
  9. package/package.json +6 -7
  10. package/dist/cjs/src/components/SelectField.js +0 -24
  11. package/dist/cjs/src/components/SelectField.js.map +0 -1
  12. package/dist/cjs/src/components/library/BibliographyImportButton.js +0 -149
  13. package/dist/cjs/src/components/library/BibliographyImportButton.js.map +0 -1
  14. package/dist/cjs/src/components/library/CitationEditor.js +0 -227
  15. package/dist/cjs/src/components/library/CitationEditor.js.map +0 -1
  16. package/dist/cjs/src/components/library/CitationModal.js +0 -262
  17. package/dist/cjs/src/components/library/CitationModal.js.map +0 -1
  18. package/dist/cjs/src/components/library/CitationSearch.js +0 -214
  19. package/dist/cjs/src/components/library/CitationSearch.js.map +0 -1
  20. package/dist/cjs/src/components/library/CitationSearchSection.js +0 -133
  21. package/dist/cjs/src/components/library/CitationSearchSection.js.map +0 -1
  22. package/dist/cjs/src/components/library/CitationViewer.js +0 -53
  23. package/dist/cjs/src/components/library/CitationViewer.js.map +0 -1
  24. package/dist/cjs/src/components/library/ReferenceForm.js +0 -419
  25. package/dist/cjs/src/components/library/ReferenceForm.js.map +0 -1
  26. package/dist/cjs/src/components/library/ReferencesEditor.js +0 -70
  27. package/dist/cjs/src/components/library/ReferencesEditor.js.map +0 -1
  28. package/dist/cjs/src/components/library/ReferencesViewer.js +0 -33
  29. package/dist/cjs/src/components/library/ReferencesViewer.js.map +0 -1
  30. package/dist/cjs/src/components/library/SearchResults.js +0 -126
  31. package/dist/cjs/src/components/library/SearchResults.js.map +0 -1
  32. package/dist/cjs/src/components/projects/icons/DeleteIcon.js +0 -27
  33. package/dist/cjs/src/components/projects/icons/DeleteIcon.js.map +0 -1
  34. package/dist/cjs/src/components/projects/icons/GroupIcon.js +0 -29
  35. package/dist/cjs/src/components/projects/icons/GroupIcon.js.map +0 -1
  36. package/dist/cjs/src/components/projects/icons/LinkIcon.js +0 -23
  37. package/dist/cjs/src/components/projects/icons/LinkIcon.js.map +0 -1
  38. package/dist/cjs/src/components/projects/icons/TemplateIcon.js +0 -23
  39. package/dist/cjs/src/components/projects/icons/TemplateIcon.js.map +0 -1
  40. package/dist/cjs/src/lib/select-styles.js +0 -40
  41. package/dist/cjs/src/lib/select-styles.js.map +0 -1
  42. package/dist/cjs/src/lib/sources.js +0 -36
  43. package/dist/cjs/src/lib/sources.js.map +0 -1
  44. package/dist/es/src/components/SelectField.js +0 -17
  45. package/dist/es/src/components/SelectField.js.map +0 -1
  46. package/dist/es/src/components/library/BibliographyImportButton.js +0 -120
  47. package/dist/es/src/components/library/BibliographyImportButton.js.map +0 -1
  48. package/dist/es/src/components/library/CitationEditor.js +0 -198
  49. package/dist/es/src/components/library/CitationEditor.js.map +0 -1
  50. package/dist/es/src/components/library/CitationModal.js +0 -232
  51. package/dist/es/src/components/library/CitationModal.js.map +0 -1
  52. package/dist/es/src/components/library/CitationSearch.js +0 -184
  53. package/dist/es/src/components/library/CitationSearch.js.map +0 -1
  54. package/dist/es/src/components/library/CitationSearchSection.js +0 -103
  55. package/dist/es/src/components/library/CitationSearchSection.js.map +0 -1
  56. package/dist/es/src/components/library/CitationViewer.js +0 -46
  57. package/dist/es/src/components/library/CitationViewer.js.map +0 -1
  58. package/dist/es/src/components/library/ReferenceForm.js +0 -389
  59. package/dist/es/src/components/library/ReferenceForm.js.map +0 -1
  60. package/dist/es/src/components/library/ReferencesEditor.js +0 -43
  61. package/dist/es/src/components/library/ReferencesEditor.js.map +0 -1
  62. package/dist/es/src/components/library/ReferencesViewer.js +0 -26
  63. package/dist/es/src/components/library/ReferencesViewer.js.map +0 -1
  64. package/dist/es/src/components/library/SearchResults.js +0 -119
  65. package/dist/es/src/components/library/SearchResults.js.map +0 -1
  66. package/dist/es/src/components/projects/icons/DeleteIcon.js +0 -20
  67. package/dist/es/src/components/projects/icons/DeleteIcon.js.map +0 -1
  68. package/dist/es/src/components/projects/icons/GroupIcon.js +0 -22
  69. package/dist/es/src/components/projects/icons/GroupIcon.js.map +0 -1
  70. package/dist/es/src/components/projects/icons/LinkIcon.js +0 -16
  71. package/dist/es/src/components/projects/icons/LinkIcon.js.map +0 -1
  72. package/dist/es/src/components/projects/icons/TemplateIcon.js +0 -16
  73. package/dist/es/src/components/projects/icons/TemplateIcon.js.map +0 -1
  74. package/dist/es/src/lib/select-styles.js +0 -37
  75. package/dist/es/src/lib/select-styles.js.map +0 -1
  76. package/dist/es/src/lib/sources.js +0 -33
  77. package/dist/es/src/lib/sources.js.map +0 -1
  78. package/dist/types/src/components/SelectField.d.ts +0 -23
  79. package/dist/types/src/components/library/BibliographyImportButton.d.ts +0 -23
  80. package/dist/types/src/components/library/CitationEditor.d.ts +0 -30
  81. package/dist/types/src/components/library/CitationModal.d.ts +0 -17
  82. package/dist/types/src/components/library/CitationSearch.d.ts +0 -22
  83. package/dist/types/src/components/library/CitationSearchSection.d.ts +0 -34
  84. package/dist/types/src/components/library/CitationViewer.d.ts +0 -18
  85. package/dist/types/src/components/library/ReferenceForm.d.ts +0 -51
  86. package/dist/types/src/components/library/ReferencesEditor.d.ts +0 -22
  87. package/dist/types/src/components/library/ReferencesViewer.d.ts +0 -9
  88. package/dist/types/src/components/library/SearchResults.d.ts +0 -26
  89. package/dist/types/src/components/projects/icons/DeleteIcon.d.ts +0 -13
  90. package/dist/types/src/components/projects/icons/GroupIcon.d.ts +0 -15
  91. package/dist/types/src/components/projects/icons/LinkIcon.d.ts +0 -13
  92. package/dist/types/src/components/projects/icons/TemplateIcon.d.ts +0 -13
  93. package/dist/types/src/lib/select-styles.d.ts +0 -13
  94. package/dist/types/src/lib/sources.d.ts +0 -25
@@ -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=ReferenceForm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReferenceForm.js","sourceRoot":"","sources":["../../../../../src/components/library/ReferenceForm.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,SAAS,MAAM,qCAAqC,CAAA;AAC3D,OAAO,QAAQ,MAAM,4CAA4C,CAAA;AACjE,OAAO,aAAa,MAAM,yCAAyC,CAAA;AAEnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AA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Qe,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
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReferencesEditor.js","sourceRoot":"","sources":["../../../../../src/components/library/ReferencesEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAA2B,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAE/E,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAE/D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAS/C,MAAM,CAAC,MAAM,gBAAgB,GAAoB,CAAC,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C,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;SACpC;IACH,CAAC,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAA;IAEzC,OAAO,CACL,oBAAC,aAAa,IACZ,YAAY,EAAE,aAAa,EAC3B,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,uBAAuB,EACvC,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,gBAAgB,GAClC,CACH,CAAA;AACH,CAAC,CAAA"}
@@ -1,26 +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) 2021 Atypon Systems LLC. All Rights Reserved.
11
- */
12
- import { TertiaryButton } from '@manuscripts/style-guide';
13
- import React from 'react';
14
- import styled from 'styled-components';
15
- const References = styled.div `
16
- display: flex;
17
- flex-direction: column;
18
- flex-wrap: wrap;
19
- `;
20
- const Reference = styled(TertiaryButton) `
21
- text-decoration: none;
22
- `;
23
- export const ReferencesViewer = ({ items }) => {
24
- return (React.createElement(References, null, items.map((item) => (React.createElement(Reference, { as: 'a', key: item.referencedObject, href: `#${item.referencedObject}` }, item.label)))));
25
- };
26
- //# sourceMappingURL=ReferencesViewer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReferencesViewer.js","sourceRoot":"","sources":["../../../../../src/components/library/ReferencesViewer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAMtC,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAI5B,CAAA;AAED,MAAM,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC,CAAA;;CAEvC,CAAA;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAoB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC7D,OAAO,CACL,oBAAC,UAAU,QACR,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,oBAAC,SAAS,IACR,EAAE,EAAE,GAAG,EACP,GAAG,EAAE,IAAI,CAAC,gBAAgB,EAC1B,IAAI,EAAE,IAAI,IAAI,CAAC,gBAAgB,EAAE,IAEhC,IAAI,CAAC,KAAK,CACD,CACb,CAAC,CACS,CACd,CAAA;AACH,CAAC,CAAA"}
@@ -1,119 +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 AddedIcon from '@manuscripts/assets/react/AddedIcon';
13
- import AddIcon from '@manuscripts/assets/react/AddIcon';
14
- import { estimateID, shortLibraryItemMetadata } from '@manuscripts/library';
15
- import { Title } from '@manuscripts/title-editor';
16
- import React from 'react';
17
- import styled from 'styled-components';
18
- const SearchResult = styled.div `
19
- cursor: pointer;
20
- padding: ${(props) => props.theme.grid.unit * 2}px 0;
21
- display: flex;
22
-
23
- &:not(:last-of-type) {
24
- border-bottom: 1px solid #f6f6f6;
25
- }
26
- `;
27
- const SearchResultAuthors = styled.div `
28
- color: ${(props) => props.theme.colors.text.secondary};
29
- flex: 1;
30
- font-weight: ${(props) => props.theme.font.weight.light};
31
- margin-top: ${(props) => props.theme.grid.unit}px;
32
- `;
33
- const ResultAuthorsPlaceholder = styled(SearchResultAuthors) `
34
- background: ${(props) => props.theme.colors.text.muted};
35
- height: 1.2em;
36
- `;
37
- const ResultTitlePlaceholder = styled.div `
38
- background: ${(props) => props.theme.colors.border.primary};
39
- height: 1.2em;
40
- `;
41
- const ResultMetadata = styled.div `
42
- flex: 1;
43
- `;
44
- const Fetching = styled.div `
45
- display: inline-block;
46
- height: ${(props) => props.theme.grid.unit * 6}px;
47
- width: ${(props) => props.theme.grid.unit * 6}px;
48
- border: 1px dashed ${(props) => props.theme.colors.brand.default};
49
- box-sizing: border-box;
50
- border-radius: 50%;
51
- animation: spin 10s linear infinite;
52
-
53
- @keyframes spin {
54
- 100% {
55
- transform: rotateZ(360deg);
56
- }
57
- }
58
- `;
59
- const StatusIcon = styled.div `
60
- flex-shrink: 1;
61
- margin-right: ${(props) => props.theme.grid.unit * 3}px;
62
- height: ${(props) => props.theme.grid.unit * 6}px;
63
- width: ${(props) => props.theme.grid.unit * 6}px;
64
- display: inline-flex;
65
- justify-content: center;
66
- align-items: center;
67
- cursor: pointer;
68
- `;
69
- const Results = styled.div `
70
- padding: 0 ${(props) => props.theme.grid.unit * 4}px;
71
- flex: 1;
72
- overflow-y: auto;
73
- `;
74
- const Error = styled.div `
75
- padding: 0 ${(props) => props.theme.grid.unit * 3}px;
76
- `;
77
- const ResultPlaceholder = () => (React.createElement(SearchResult, { style: { opacity: 0.2 } },
78
- React.createElement("div", { style: { width: 40 } }, "\u2026"),
79
- React.createElement(ResultMetadata, null,
80
- React.createElement(ResultTitlePlaceholder, null),
81
- React.createElement(ResultAuthorsPlaceholder, null))));
82
- const chooseStatusIcon = (fetching, selected, id) => {
83
- if (fetching.has(id)) {
84
- return React.createElement(Fetching, null);
85
- }
86
- if (selected.has(id)) {
87
- return React.createElement(AddedIcon, { "data-cy": 'plus-icon-ok', width: 24, height: 24 });
88
- }
89
- return React.createElement(AddIcon, { "data-cy": 'plus-icon', width: 24, height: 24 });
90
- };
91
- export const SearchResults = ({ error, searching, showMoreSearching, results, handleSelect, selected, fetching, }) => {
92
- if (error) {
93
- // TODO: keep results if error while fetching
94
- return React.createElement(Error, null, error);
95
- }
96
- if (searching && !showMoreSearching) {
97
- return (React.createElement(Results, null,
98
- React.createElement(SearchingLabel, null, "Searching...."),
99
- React.createElement(ResultPlaceholder, null),
100
- React.createElement(ResultPlaceholder, null),
101
- React.createElement(ResultPlaceholder, null)));
102
- }
103
- if (!results || !results.items || !results.items.length) {
104
- return null;
105
- }
106
- return (React.createElement(Results, null, results.items.map((item) => {
107
- const id = estimateID(item);
108
- return (React.createElement(SearchResult, { onClick: () => handleSelect(id, item), key: id },
109
- React.createElement(StatusIcon, null, chooseStatusIcon(fetching, selected, id)),
110
- React.createElement(ResultMetadata, null,
111
- React.createElement(Title, { value: item.title || 'Untitled', title: item.title }),
112
- React.createElement(SearchResultAuthors, { "data-cy": 'search-result-author' }, shortLibraryItemMetadata(item)))));
113
- })));
114
- };
115
- const SearchingLabel = styled.div `
116
- color: ${(props) => props.theme.colors.text.secondary};
117
- margin-left: ${(props) => props.theme.grid.unit * 10}px;
118
- `;
119
- //# sourceMappingURL=SearchResults.js.map
@@ -1 +0,0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