@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
@@ -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 { default as AuthorsDND } from './AuthorsDND';
@@ -14,35 +14,35 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  export declare const SecondaryButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
17
- type: "button" | "submit" | "reset";
17
+ type: "button" | "reset" | "submit";
18
18
  } & {
19
19
  danger?: boolean | undefined;
20
20
  disabled?: boolean | undefined;
21
21
  mini?: boolean | undefined;
22
22
  }, "type">;
23
23
  export declare const PrimaryButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
24
- type: "button" | "submit" | "reset";
24
+ type: "button" | "reset" | "submit";
25
25
  } & {
26
26
  danger?: boolean | undefined;
27
27
  disabled?: boolean | undefined;
28
28
  mini?: boolean | undefined;
29
29
  }, "type">;
30
30
  export declare const TertiaryButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
31
- type: "button" | "submit" | "reset";
31
+ type: "button" | "reset" | "submit";
32
32
  } & {
33
33
  danger?: boolean | undefined;
34
34
  disabled?: boolean | undefined;
35
35
  mini?: boolean | undefined;
36
36
  }, "type">;
37
37
  export declare const IconTextButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
38
- type: "button" | "submit" | "reset";
38
+ type: "button" | "reset" | "submit";
39
39
  } & {
40
40
  danger?: boolean | undefined;
41
41
  disabled?: boolean | undefined;
42
42
  mini?: boolean | undefined;
43
43
  }, "type">;
44
44
  export declare const ToggleButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
45
- type: "button" | "submit" | "reset";
45
+ type: "button" | "reset" | "submit";
46
46
  } & {
47
47
  danger?: boolean | undefined;
48
48
  disabled?: boolean | undefined;
@@ -51,7 +51,7 @@ export declare const ToggleButton: import("styled-components").StyledComponent<"
51
51
  selected?: boolean | undefined;
52
52
  }, "type">;
53
53
  export declare const ToggleButtonAlt: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
54
- type: "button" | "submit" | "reset";
54
+ type: "button" | "reset" | "submit";
55
55
  } & {
56
56
  danger?: boolean | undefined;
57
57
  disabled?: boolean | undefined;
@@ -60,7 +60,7 @@ export declare const ToggleButtonAlt: import("styled-components").StyledComponen
60
60
  selected?: boolean | undefined;
61
61
  }, "type">;
62
62
  export declare const IconButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
63
- type: "button" | "submit" | "reset";
63
+ type: "button" | "reset" | "submit";
64
64
  } & {
65
65
  danger?: boolean | undefined;
66
66
  disabled?: boolean | undefined;
@@ -71,7 +71,7 @@ export declare const IconButton: import("styled-components").StyledComponent<"bu
71
71
  iconColor?: string | undefined;
72
72
  }, "type">;
73
73
  export declare const RoundIconButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
74
- type: "button" | "submit" | "reset";
74
+ type: "button" | "reset" | "submit";
75
75
  } & {
76
76
  danger?: boolean | undefined;
77
77
  disabled?: boolean | undefined;
@@ -84,7 +84,7 @@ export declare const RoundIconButton: import("styled-components").StyledComponen
84
84
  defaultColor: boolean;
85
85
  }, "type" | "defaultColor">;
86
86
  export declare const SecondaryIconButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
87
- type: "button" | "submit" | "reset";
87
+ type: "button" | "reset" | "submit";
88
88
  } & {
89
89
  danger?: boolean | undefined;
90
90
  disabled?: boolean | undefined;
@@ -60,7 +60,7 @@ export declare const EditorHeader: React.FC<{
60
60
  disabelProceedNote?: boolean;
61
61
  }>;
62
62
  export declare const PrimaryButtonSmall: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
63
- type: "button" | "submit" | "reset";
63
+ type: "button" | "reset" | "submit";
64
64
  } & {
65
65
  danger?: boolean | undefined;
66
66
  disabled?: boolean | undefined;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import React, { CSSProperties } from 'react';
17
17
  export declare const ExpanderButton: 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;
@@ -36,7 +36,7 @@ interface DropdownProps {
36
36
  export declare const NavDropdownToggle: import("styled-components").StyledComponent<React.SFC<React.SVGAttributes<SVGElement>>, import("styled-components").DefaultTheme, {}, never>;
37
37
  export declare const NotificationsBadge: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, DropdownProps, never>;
38
38
  export declare const NavDropdownButtonContainer: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
39
- type: "button" | "submit" | "reset";
39
+ type: "button" | "reset" | "submit";
40
40
  } & {
41
41
  danger?: boolean | undefined;
42
42
  disabled?: boolean | undefined;
@@ -22,7 +22,7 @@ interface Props {
22
22
  export declare const ModalContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
23
23
  export declare const ModalHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
24
24
  export declare const CloseButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
25
- type: "button" | "submit" | "reset";
25
+ type: "button" | "reset" | "submit";
26
26
  } & {
27
27
  danger?: boolean | undefined;
28
28
  disabled?: boolean | undefined;
@@ -45,4 +45,3 @@ export { default as LeftArrow } from './left-arrow';
45
45
  export { default as BlockQuoteIcon } from './block-quote-icon';
46
46
  export { default as PullQuoteIcon } from './pull-quote-icon';
47
47
  export { default as PlusIcon } from './plus-icon';
48
- export { DeleteIcon } from './delete-icon';
@@ -14,6 +14,10 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  export { Theme } from './theme';
17
+ export * from './components/AffiliationsEditor';
18
+ export * from './components/AuthorForm';
19
+ export * from './components/AuthorName';
20
+ export * from './components/AuthorsDND';
17
21
  export * from './components/AlertMessage';
18
22
  export * from './components/Button';
19
23
  export * from './components/RadioButton';
@@ -28,8 +32,6 @@ export * from './components/Resizer';
28
32
  export * from './components/SaveStatus';
29
33
  export * from './components/StyledModal';
30
34
  export * from './components/TableFootnotesSelector';
31
- export * from './components/Sidebar';
32
- export * from './components/DragLayer';
33
35
  export * from './components/TextField';
34
36
  export * from './components/TextFieldContainer';
35
37
  export * from './components/TextFieldError';
@@ -54,8 +56,10 @@ export * from './hooks/use-dropdown';
54
56
  export * from './hooks/use-files';
55
57
  export * from './hooks/use-menus';
56
58
  export { useDeepCompareMemo, useDeepCompareCallback, } from './hooks/use-deep-compare';
59
+ export * from './lib/authors';
57
60
  export * from './lib/capabilities';
58
61
  export * from './lib/files';
59
62
  export * from './lib/comments';
60
63
  export * from './lib/menus';
61
64
  export { default as errorsDecoder } from './lib/errors-decoder';
65
+ export * from './types';
@@ -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 { Affiliation, Contributor, Model, UserProfileAffiliation } from '@manuscripts/json-schema';
17
+ import { AffiliationGeneric, AffiliationMap, AffiliationOption, AuthorAffiliation } from '../types';
18
+ export declare const buildSortedAuthors: (modelMap: Map<string, Model>) => Contributor[];
19
+ export declare const buildAuthorPriority: (authors: Contributor[]) => number;
20
+ export declare const buildAffiliationIDs: (authors: Contributor[]) => string[];
21
+ export declare const buildAuthorAffiliations: (authors: Contributor[], affiliations: AffiliationMap, uniqueAffiliationIDs: string[]) => Map<any, any>;
22
+ export declare const buildAffiliationsMap: (affiliationIDs: string[], modelMap: Map<string, Model>) => AffiliationMap;
23
+ export declare const buildAuthorsAndAffiliations: (modelMap: Map<string, Model>) => {
24
+ affiliations: AffiliationMap;
25
+ authors: Contributor[];
26
+ authorAffiliations: Map<any, any>;
27
+ };
28
+ export declare const isJointFirstAuthor: (authors: Contributor[], index: number) => boolean;
29
+ export declare const affiliationLabel: (affiliation: Affiliation | AffiliationGeneric | UserProfileAffiliation) => string;
30
+ export declare const affiliationsOptions: (affiliations: Map<string, AffiliationGeneric>, authorAffiliations?: AuthorAffiliation[] | null) => AffiliationOption[];
@@ -30,7 +30,7 @@ export type Capabilities = {
30
30
  putOnHoldTask: boolean;
31
31
  changeDueDate: boolean;
32
32
  previewAccess: boolean;
33
- editNotTracked: boolean;
33
+ editWithoutTracking: boolean;
34
34
  accessEditor: boolean;
35
35
  formatArticle: boolean;
36
36
  editArticle: boolean;
@@ -0,0 +1,18 @@
1
+ /*!
2
+ * © 2019 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Affiliation } from '@manuscripts/json-schema';
17
+ declare const _default: (affiliation: Affiliation) => string;
18
+ export default _default;
@@ -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
+ import { BibliographicName } from '@manuscripts/json-schema';
17
+ export declare const initials: (name: BibliographicName) => string;
@@ -0,0 +1,80 @@
1
+ /*!
2
+ * © 2019 Atypon Systems LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Affiliation, BibliographicName, Contributor } from '@manuscripts/json-schema';
17
+ import { ConnectDragSource, ConnectDropTarget } from 'react-dnd';
18
+ export type AffiliationMap = Map<string, Affiliation>;
19
+ interface AffiliationData {
20
+ ordinal: number;
21
+ data: Affiliation;
22
+ }
23
+ export interface AuthorData {
24
+ authors: Contributor[];
25
+ affiliations: AffiliationMap;
26
+ authorAffiliations: Map<string, AffiliationData[]>;
27
+ }
28
+ export interface AuthorItem {
29
+ _id: string;
30
+ index: number;
31
+ priority: number | null;
32
+ }
33
+ export type DropSide = 'before' | 'after' | null;
34
+ export type DropHandler = (source: AuthorItem, target: AuthorItem, position: DropSide, authors: Contributor[]) => void;
35
+ export interface DragSourceProps {
36
+ authorItem: AuthorItem;
37
+ position: DropSide;
38
+ }
39
+ export interface ConnectedDragSourceProps {
40
+ connectDragSource: ConnectDragSource;
41
+ isDragging: boolean;
42
+ item: DragSourceProps;
43
+ }
44
+ export interface ConnectedDropTargetProps {
45
+ connectDropTarget: ConnectDropTarget;
46
+ isOver: boolean;
47
+ isOverCurrent: boolean;
48
+ canDrop: boolean;
49
+ }
50
+ interface BibliographicNameValues extends Partial<BibliographicName> {
51
+ _id: string;
52
+ objectType: 'MPBibliographicName';
53
+ given: string;
54
+ family: string;
55
+ suffix?: string;
56
+ }
57
+ export interface AffiliationGeneric extends Omit<Affiliation, 'manuscriptID' | 'objectType'> {
58
+ manuscriptID?: string;
59
+ }
60
+ export interface AuthorAffiliation {
61
+ ordinal: number;
62
+ data: Affiliation | AffiliationGeneric;
63
+ }
64
+ export interface AuthorValues {
65
+ affiliations: string[];
66
+ _id: string;
67
+ priority: number;
68
+ email: string;
69
+ isCorresponding: boolean;
70
+ bibliographicName: BibliographicNameValues;
71
+ role: string;
72
+ roles: string[];
73
+ ORCIDIdentifier: string;
74
+ contribution: string;
75
+ }
76
+ export interface AffiliationOption {
77
+ value: string;
78
+ label: string;
79
+ }
80
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@manuscripts/style-guide",
3
3
  "description": "Shared components for Manuscripts applications",
4
- "version": "1.7.8-LEAN-3301",
4
+ "version": "1.7.8-LEAN-3278",
5
5
  "repository": "github:Atypon-OpenSource/manuscripts-style-guide",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",