@manuscripts/style-guide 1.7.8-LEAN-3301 → 1.7.8-LEAN-3278

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 (81) hide show
  1. package/dist/cjs/components/AffiliationsEditor/AffiliationsEditor.js +62 -0
  2. package/dist/cjs/components/AffiliationsEditor/AffiliationsEditorItem.js +176 -0
  3. package/dist/cjs/components/AffiliationsEditor/AffiliationsEditorProfile.js +62 -0
  4. package/dist/cjs/components/AffiliationsEditor/AffiliationsEditorView.js +80 -0
  5. package/dist/cjs/components/AffiliationsEditor/index.js +25 -0
  6. package/dist/cjs/components/AffiliationsEditor/styles.js +56 -0
  7. package/dist/cjs/components/AuthorForm/AuthorForm.js +99 -0
  8. package/dist/cjs/components/AuthorForm/AuthorFormComponents.js +63 -0
  9. package/dist/cjs/components/AuthorForm/ContributorRolesSelect.js +100 -0
  10. package/dist/cjs/components/AuthorForm/RemoveAuthorButton.js +45 -0
  11. package/dist/cjs/components/AuthorForm/index.js +32 -0
  12. package/dist/cjs/components/AuthorName.js +52 -0
  13. package/dist/cjs/components/AuthorsDND/AuthorItemComponents.js +22 -0
  14. package/dist/cjs/components/AuthorsDND/AuthorsDND.js +68 -0
  15. package/dist/cjs/components/AuthorsDND/DraggableAuthorItem.js +197 -0
  16. package/dist/cjs/components/AuthorsDND/index.js +23 -0
  17. package/dist/cjs/components/{DragLayer.js → FileManager/DragLayer.js} +50 -26
  18. package/dist/cjs/components/FileManager/FileManager.js +1 -1
  19. package/dist/cjs/components/icons/index.js +1 -3
  20. package/dist/cjs/index.js +6 -2
  21. package/dist/cjs/lib/authors.js +110 -0
  22. package/dist/cjs/lib/capabilities.js +1 -1
  23. package/dist/cjs/lib/formatAddress.js +31 -0
  24. package/dist/cjs/lib/name.js +26 -0
  25. package/dist/cjs/types.js +17 -0
  26. package/dist/es/components/AffiliationsEditor/AffiliationsEditor.js +34 -0
  27. package/dist/es/components/AffiliationsEditor/AffiliationsEditorItem.js +146 -0
  28. package/dist/es/components/AffiliationsEditor/AffiliationsEditorProfile.js +34 -0
  29. package/dist/es/components/AffiliationsEditor/AffiliationsEditorView.js +52 -0
  30. package/dist/es/components/AffiliationsEditor/index.js +17 -0
  31. package/dist/es/components/AffiliationsEditor/styles.js +49 -0
  32. package/dist/es/components/AuthorForm/AuthorForm.js +92 -0
  33. package/dist/es/components/AuthorForm/AuthorFormComponents.js +57 -0
  34. package/dist/es/components/AuthorForm/ContributorRolesSelect.js +70 -0
  35. package/dist/es/components/AuthorForm/RemoveAuthorButton.js +40 -0
  36. package/dist/es/components/AuthorForm/index.js +16 -0
  37. package/dist/es/components/AuthorName.js +23 -0
  38. package/dist/es/components/AuthorsDND/AuthorItemComponents.js +19 -0
  39. package/dist/es/components/AuthorsDND/AuthorsDND.js +40 -0
  40. package/dist/es/components/AuthorsDND/DraggableAuthorItem.js +192 -0
  41. package/dist/es/components/AuthorsDND/index.js +16 -0
  42. package/dist/es/components/{DragLayer.js → FileManager/DragLayer.js} +27 -26
  43. package/dist/es/components/FileManager/FileManager.js +1 -1
  44. package/dist/es/components/icons/index.js +0 -1
  45. package/dist/es/index.js +6 -2
  46. package/dist/es/lib/authors.js +98 -0
  47. package/dist/es/lib/capabilities.js +1 -1
  48. package/dist/es/lib/formatAddress.js +29 -0
  49. package/dist/es/lib/name.js +22 -0
  50. package/dist/es/types.js +16 -0
  51. package/dist/types/components/AffiliationsEditor/AffiliationsEditor.d.ts +31 -0
  52. package/dist/types/components/AffiliationsEditor/AffiliationsEditorItem.d.ts +26 -0
  53. package/dist/types/components/AffiliationsEditor/AffiliationsEditorProfile.d.ts +30 -0
  54. package/dist/types/components/AffiliationsEditor/AffiliationsEditorView.d.ts +34 -0
  55. package/dist/types/components/AffiliationsEditor/index.d.ts +17 -0
  56. package/dist/types/components/AffiliationsEditor/styles.d.ts +23 -0
  57. package/dist/types/components/AlertMessage.d.ts +1 -1
  58. package/dist/types/components/AuthorForm/AuthorForm.d.ts +29 -0
  59. package/dist/types/components/AuthorForm/AuthorFormComponents.d.ts +31 -0
  60. package/dist/types/components/AuthorForm/ContributorRolesSelect.d.ts +23 -0
  61. package/dist/types/components/AuthorForm/RemoveAuthorButton.d.ts +27 -0
  62. package/dist/types/components/AuthorForm/index.d.ts +16 -0
  63. package/dist/types/components/AuthorName.d.ts +22 -0
  64. package/dist/types/components/AuthorsDND/AuthorItemComponents.d.ts +24 -0
  65. package/dist/types/components/AuthorsDND/AuthorsDND.d.ts +28 -0
  66. package/dist/types/components/AuthorsDND/DraggableAuthorItem.d.ts +50 -0
  67. package/dist/types/components/AuthorsDND/index.d.ts +16 -0
  68. package/dist/types/components/Button.d.ts +9 -9
  69. package/dist/types/components/EditorHeader/EditorHeader.d.ts +1 -1
  70. package/dist/types/components/InspectorSection.d.ts +1 -1
  71. package/dist/types/components/NavDropdown.d.ts +1 -1
  72. package/dist/types/components/StyledModal.d.ts +1 -1
  73. package/dist/types/components/icons/index.d.ts +0 -1
  74. package/dist/types/index.d.ts +6 -2
  75. package/dist/types/lib/authors.d.ts +30 -0
  76. package/dist/types/lib/capabilities.d.ts +1 -1
  77. package/dist/types/lib/formatAddress.d.ts +18 -0
  78. package/dist/types/lib/name.d.ts +17 -0
  79. package/dist/types/types.d.ts +80 -0
  80. package/package.json +1 -1
  81. /package/dist/types/components/{DragLayer.d.ts → FileManager/DragLayer.d.ts} +0 -0
package/dist/es/index.js CHANGED
@@ -13,6 +13,10 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ export * from './components/AffiliationsEditor';
17
+ export * from './components/AuthorForm';
18
+ export * from './components/AuthorName';
19
+ export * from './components/AuthorsDND';
16
20
  export * from './components/AlertMessage';
17
21
  export * from './components/Button';
18
22
  export * from './components/RadioButton';
@@ -27,8 +31,6 @@ export * from './components/Resizer';
27
31
  export * from './components/SaveStatus';
28
32
  export * from './components/StyledModal';
29
33
  export * from './components/TableFootnotesSelector';
30
- export * from './components/Sidebar';
31
- export * from './components/DragLayer';
32
34
  export * from './components/TextField';
33
35
  export * from './components/TextFieldContainer';
34
36
  export * from './components/TextFieldError';
@@ -53,8 +55,10 @@ export * from './hooks/use-dropdown';
53
55
  export * from './hooks/use-files';
54
56
  export * from './hooks/use-menus';
55
57
  export { useDeepCompareMemo, useDeepCompareCallback, } from './hooks/use-deep-compare';
58
+ export * from './lib/authors';
56
59
  export * from './lib/capabilities';
57
60
  export * from './lib/files';
58
61
  export * from './lib/comments';
59
62
  export * from './lib/menus';
60
63
  export { default as errorsDecoder } from './lib/errors-decoder';
64
+ export * from './types';
@@ -0,0 +1,98 @@
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 { ObjectTypes, } from '@manuscripts/json-schema';
17
+ const getModelsByType = (modelMap, objectType) => {
18
+ const output = [];
19
+ for (const model of modelMap.values()) {
20
+ if (model.objectType === objectType) {
21
+ output.push(model);
22
+ }
23
+ }
24
+ return output;
25
+ };
26
+ export const buildSortedAuthors = (modelMap) => {
27
+ return getModelsByType(modelMap, ObjectTypes.Contributor)
28
+ .filter((item) => item.role === 'author')
29
+ .sort((a, b) => Number(a.priority) - Number(b.priority));
30
+ };
31
+ export const buildAuthorPriority = (authors) => {
32
+ if (!authors.length) {
33
+ return 0;
34
+ }
35
+ const priorities = authors.map((author) => Number(author.priority));
36
+ return Math.max(...priorities) + 1;
37
+ };
38
+ export const buildAffiliationIDs = (authors) => {
39
+ const ids = [];
40
+ authors.forEach((author) => {
41
+ if (author.affiliations) {
42
+ author.affiliations.forEach((id) => {
43
+ ids.push(id);
44
+ });
45
+ }
46
+ });
47
+ return ids.filter((value, index) => ids.indexOf(value) === index);
48
+ };
49
+ export const buildAuthorAffiliations = (authors, affiliations, uniqueAffiliationIDs) => {
50
+ const items = new Map();
51
+ authors.forEach((author) => {
52
+ items.set(author._id, (author.affiliations || []).map((id) => {
53
+ return {
54
+ ordinal: uniqueAffiliationIDs.indexOf(id) + 1,
55
+ data: affiliations.get(id),
56
+ };
57
+ }));
58
+ });
59
+ return items;
60
+ };
61
+ export const buildAffiliationsMap = (affiliationIDs, modelMap) => new Map(affiliationIDs.map((id) => [
62
+ id,
63
+ modelMap.get(id),
64
+ ]));
65
+ export const buildAuthorsAndAffiliations = (modelMap) => {
66
+ const authors = buildSortedAuthors(modelMap);
67
+ const affiliationIDs = buildAffiliationIDs(authors);
68
+ const affiliations = buildAffiliationsMap(affiliationIDs, modelMap);
69
+ const authorAffiliations = buildAuthorAffiliations(authors, affiliations, affiliationIDs);
70
+ return {
71
+ affiliations,
72
+ authors,
73
+ authorAffiliations,
74
+ };
75
+ };
76
+ export const isJointFirstAuthor = (authors, index) => {
77
+ const author = index === 0 ? authors[index] : authors[index - 1];
78
+ return Boolean(author.isJointContributor);
79
+ };
80
+ export const affiliationLabel = (affiliation) => {
81
+ const { department, institution = '' } = affiliation;
82
+ if (!institution) {
83
+ return '(unknown institution)';
84
+ }
85
+ return department ? `${institution} (${department})`.trim() : institution;
86
+ };
87
+ export const affiliationsOptions = (affiliations, authorAffiliations) => {
88
+ if (!authorAffiliations) {
89
+ return affiliationsOptions(affiliations, []);
90
+ }
91
+ const authorAffiliationsIds = new Set(authorAffiliations.map((authorAffiliation) => authorAffiliation.data._id));
92
+ return Array.from(affiliations.values())
93
+ .filter((affiliation) => !authorAffiliationsIds.has(affiliation._id))
94
+ .map((affiliation) => ({
95
+ value: affiliation._id,
96
+ label: affiliationLabel(affiliation) || '',
97
+ }));
98
+ };
@@ -17,6 +17,7 @@ export const getCapabilities = (project, profile, role, actions) => {
17
17
  const allowed = (action) => !!(actions === null || actions === void 0 ? void 0 : actions.includes(action));
18
18
  return {
19
19
  handleSuggestion: isOwner() || isEditor() || isWriter(),
20
+ editWithoutTracking: isWriter(),
20
21
  rejectOwnSuggestion: !isViewer(),
21
22
  createSuggestion: !isViewer(),
22
23
  viewSuggestion: true,
@@ -46,7 +47,6 @@ export const getCapabilities = (project, profile, role, actions) => {
46
47
  putOnHoldTask: isProdEditor(),
47
48
  changeDueDate: isProdEditor() && allowed(Actions.updateDueDate),
48
49
  previewAccess: true,
49
- editNotTracked: false,
50
50
  accessEditor: true,
51
51
  formatArticle: !isViewer(),
52
52
  editArticle: !isViewer(),
@@ -0,0 +1,29 @@
1
+ /*!
2
+ * © 2019 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export default (affiliation) => {
17
+ const { department, institution, addressLine1, city, county, country, postCode, } = affiliation;
18
+ return [
19
+ department,
20
+ institution,
21
+ addressLine1,
22
+ city,
23
+ county,
24
+ country,
25
+ postCode,
26
+ ]
27
+ .filter(Boolean)
28
+ .join(', ');
29
+ };
@@ -0,0 +1,22 @@
1
+ /*!
2
+ * © 2019 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export const initials = (name) => name.given
17
+ ? name.given
18
+ .trim()
19
+ .split(' ')
20
+ .map((part) => part.substr(0, 1).toUpperCase() + '.')
21
+ .join('')
22
+ : '';
@@ -0,0 +1,16 @@
1
+ /*!
2
+ * © 2019 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export {};
@@ -0,0 +1,31 @@
1
+ /*!
2
+ * © 2019 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import React from 'react';
17
+ import { AffiliationGeneric, AuthorAffiliation } from '../../types';
18
+ import { AuthorFormComponentOverrides } from '../AuthorForm/AuthorFormComponents';
19
+ interface Props {
20
+ affiliations: Map<string, AffiliationGeneric>;
21
+ authorAffiliations?: AuthorAffiliation[];
22
+ addAuthorAffiliation: (affiliation: AffiliationGeneric | string) => void;
23
+ removeAuthorAffiliation: (affiliation: AffiliationGeneric) => void;
24
+ updateAffiliation: (affiliation: AffiliationGeneric) => void;
25
+ components?: AuthorFormComponentOverrides;
26
+ styleOverrides?: {
27
+ menuZIndex?: number;
28
+ };
29
+ }
30
+ declare const AffiliationsEditor: React.FC<Props>;
31
+ export default AffiliationsEditor;
@@ -0,0 +1,26 @@
1
+ /*!
2
+ * © 2019 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import React from 'react';
17
+ import { AffiliationGeneric } from '../../types';
18
+ interface Props {
19
+ affiliation: AffiliationGeneric;
20
+ requestToggle: () => void;
21
+ isOpen: boolean;
22
+ updateAffiliation: (affiliation: AffiliationGeneric) => void;
23
+ removeAuthorAffiliation: (affiliation: AffiliationGeneric) => void;
24
+ }
25
+ export declare const AffiliationsEditorItem: React.FC<Props>;
26
+ export default AffiliationsEditorItem;
@@ -0,0 +1,30 @@
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 { UserProfileAffiliation } from '@manuscripts/json-schema';
17
+ import React from 'react';
18
+ import { AuthorFormComponentOverrides } from '../AuthorForm/AuthorFormComponents';
19
+ interface Props {
20
+ affiliations: Map<string, UserProfileAffiliation>;
21
+ addAffiliation: (affiliation: string) => void;
22
+ removeAffiliation: (affiliation: UserProfileAffiliation) => void;
23
+ updateAffiliation: (affiliation: UserProfileAffiliation) => void;
24
+ components?: AuthorFormComponentOverrides;
25
+ styleOverrides?: {
26
+ menuZIndex?: number;
27
+ };
28
+ }
29
+ declare const AffiliationsEditorProfile: React.FC<Props>;
30
+ export default AffiliationsEditorProfile;
@@ -0,0 +1,34 @@
1
+ /*!
2
+ * © 2019 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import React from 'react';
17
+ import { OnChangeValue } from 'react-select';
18
+ import { AffiliationGeneric, AffiliationOption } from '../../types';
19
+ import { AuthorFormComponentOverrides } from '../AuthorForm/AuthorFormComponents';
20
+ interface Props {
21
+ options: AffiliationOption[];
22
+ selected: AffiliationGeneric[];
23
+ inputValue: string;
24
+ handleInputChange: (text: string) => void;
25
+ handleChoose: (value: OnChangeValue<AffiliationOption, false>) => void;
26
+ updateAffiliation: (affiliation: AffiliationGeneric) => void;
27
+ removeAuthorAffiliation: (affiliation: AffiliationGeneric) => void;
28
+ components?: AuthorFormComponentOverrides;
29
+ styleOverrides?: {
30
+ menuZIndex?: number;
31
+ };
32
+ }
33
+ declare const AffiliationsEditorView: React.FC<Props>;
34
+ export default AffiliationsEditorView;
@@ -0,0 +1,17 @@
1
+ /*!
2
+ * © 2019 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export { default as AffiliationsEditor } from './AffiliationsEditor';
17
+ export { default as AffiliationsEditorProfile } from './AffiliationsEditorProfile';
@@ -0,0 +1,23 @@
1
+ /*!
2
+ * © 2019 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import React from 'react';
17
+ import { IndicatorsContainerProps } from 'react-select';
18
+ import { AffiliationOption } from '../../types';
19
+ export declare const Container: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
20
+ export declare const Field: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
21
+ export declare const List: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
22
+ export declare const AddAffiliationContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
23
+ export declare const AddAffiliationIndicator: React.FC<IndicatorsContainerProps<AffiliationOption, false>>;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import React from 'react';
17
17
  export declare const TextButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
18
- type: "button" | "submit" | "reset";
18
+ type: "button" | "reset" | "submit";
19
19
  } & {
20
20
  danger?: boolean | undefined;
21
21
  disabled?: boolean | undefined;
@@ -0,0 +1,29 @@
1
+ /*!
2
+ * © 2019 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Contributor, ContributorRole } from '@manuscripts/json-schema';
17
+ import React from 'react';
18
+ import { AuthorValues } from '../../types';
19
+ import { AuthorFormComponentOverrides } from './AuthorFormComponents';
20
+ export declare const AuthorForm: React.FunctionComponent<{
21
+ author: Contributor;
22
+ isRemoveAuthorOpen: boolean;
23
+ removeAuthor: (data: Contributor) => void;
24
+ handleSave: (values: AuthorValues) => Promise<void>;
25
+ handleRemoveAuthor: () => void;
26
+ components?: AuthorFormComponentOverrides;
27
+ contributorRoles?: ContributorRole[];
28
+ createContributorRole?: (name: string) => Promise<ContributorRole>;
29
+ }>;
@@ -0,0 +1,31 @@
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 { DefaultTheme, StyledComponent } from 'styled-components';
17
+ export declare const Fields: StyledComponent<"div", DefaultTheme, {}, never>;
18
+ export declare const Label: StyledComponent<"label", DefaultTheme, {}, never>;
19
+ export declare const LabelText: StyledComponent<"div", DefaultTheme, {}, never>;
20
+ export declare const Fieldset: StyledComponent<"fieldset", DefaultTheme, {}, never>;
21
+ export declare const Legend: StyledComponent<"legend", DefaultTheme, {}, never>;
22
+ export declare const Container: StyledComponent<"div", DefaultTheme, {}, never>;
23
+ export interface AuthorFormComponents {
24
+ Legend: StyledComponent<'legend', DefaultTheme>;
25
+ CheckboxLabel: StyledComponent<'label', DefaultTheme>;
26
+ TextField: StyledComponent<'input', DefaultTheme>;
27
+ }
28
+ export type AuthorFormComponentOverrides = {
29
+ [K in keyof AuthorFormComponents]?: AuthorFormComponents[K];
30
+ };
31
+ export declare const defaultAuthorFormComponents: AuthorFormComponents;
@@ -0,0 +1,23 @@
1
+ /*!
2
+ * © 2020 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 { ContributorRole } from '@manuscripts/json-schema';
17
+ import React from 'react';
18
+ export declare const ContributorRolesSelect: React.FC<{
19
+ contributorRoles: ContributorRole[];
20
+ createContributorRole: (name: string) => Promise<ContributorRole>;
21
+ value: string[];
22
+ setFieldValue: (value: string[]) => void;
23
+ }>;
@@ -0,0 +1,27 @@
1
+ /*!
2
+ * © 2019 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Contributor } from '@manuscripts/json-schema';
17
+ import React from 'react';
18
+ interface Props {
19
+ author: Contributor;
20
+ isOpen: boolean;
21
+ removeAuthor: () => void;
22
+ handleOpen: () => void;
23
+ }
24
+ declare class RemoveAuthorButton extends React.Component<Props> {
25
+ render(): React.JSX.Element;
26
+ }
27
+ export default RemoveAuthorButton;
@@ -0,0 +1,16 @@
1
+ /*!
2
+ * © 2019 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export * from './AuthorForm';
@@ -0,0 +1,22 @@
1
+ /*!
2
+ * © 2019 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { BibliographicName } from '@manuscripts/json-schema';
17
+ import React from 'react';
18
+ export interface AuthorNameProps {
19
+ name: BibliographicName;
20
+ email?: string;
21
+ }
22
+ export declare const AuthorName: React.FC<AuthorNameProps>;
@@ -0,0 +1,24 @@
1
+ /*!
2
+ * © 2019 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import React from 'react';
17
+ import { AuthorNameProps } from '../AuthorName';
18
+ export interface AuthorItemComponents {
19
+ AuthorName: React.FunctionComponent<AuthorNameProps>;
20
+ }
21
+ export type AuthorItemComponentOverrides = {
22
+ [K in keyof AuthorItemComponents]?: AuthorItemComponents[K];
23
+ };
24
+ export declare const defaultAuthorItemComponents: AuthorItemComponents;
@@ -0,0 +1,28 @@
1
+ /*!
2
+ * © 2019 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Contributor } from '@manuscripts/json-schema';
17
+ import React from 'react';
18
+ import { AuthorItemComponentOverrides } from './AuthorItemComponents';
19
+ interface Props {
20
+ authors: Contributor[];
21
+ selectAuthor: (item: Contributor) => void;
22
+ selectedAuthor: Contributor | null;
23
+ handleDrop: (oldIndex: number, newIndex: number) => void;
24
+ getSidebarItemDecorator?: (authorID: string) => JSX.Element | null;
25
+ components?: AuthorItemComponentOverrides;
26
+ }
27
+ declare const AuthorsDND: React.FunctionComponent<Props>;
28
+ export default AuthorsDND;
@@ -0,0 +1,50 @@
1
+ /*!
2
+ * © 2019 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Contributor } from '@manuscripts/json-schema';
17
+ import React from 'react';
18
+ import { DefaultTheme } from 'styled-components';
19
+ import { AuthorItem, ConnectedDragSourceProps, ConnectedDropTargetProps, DropSide } from '../../types';
20
+ import { AuthorItemComponentOverrides } from './AuthorItemComponents';
21
+ type ConnectedProps = ConnectedDragSourceProps & ConnectedDropTargetProps;
22
+ interface Props {
23
+ authorItem: AuthorItem;
24
+ onDrop: (oldIndex: number, newIndex: number) => void;
25
+ author: Contributor;
26
+ authors: Contributor[];
27
+ user: Partial<UserProfileWithAvatar>;
28
+ selectedAuthor: Contributor | null;
29
+ selectAuthor: (item: Contributor) => void;
30
+ sidebarItemDecorator?: JSX.Element | null;
31
+ theme: DefaultTheme;
32
+ components?: AuthorItemComponentOverrides;
33
+ }
34
+ interface State {
35
+ dragPosition: DropSide;
36
+ }
37
+ interface UserProfileWithAvatar {
38
+ _id: string;
39
+ avatar: string;
40
+ }
41
+ declare class AuthorComponent extends React.Component<Props & ConnectedProps, State> {
42
+ state: State;
43
+ render(): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
44
+ private mightDrop;
45
+ private selectedAuthorClass;
46
+ private topPreviewStyles;
47
+ private bottomPreviewStyles;
48
+ }
49
+ declare const DraggableAuthorItem: import("react-dnd").DndComponentClass<import("react-dnd").DndComponentClass<typeof AuthorComponent, import("react-dnd").Omit<Props & ConnectedDragSourceProps & ConnectedDropTargetProps, "connectDropTarget" | "isOver" | "isOverCurrent" | "canDrop">>, import("react-dnd").Omit<import("react-dnd").Omit<Props & ConnectedDragSourceProps & ConnectedDropTargetProps, "connectDropTarget" | "isOver" | "isOverCurrent" | "canDrop">, "connectDragSource" | "isDragging" | "item">>;
50
+ export default DraggableAuthorItem;