@manuscripts/style-guide 0.30.17 → 0.30.21

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 (123) hide show
  1. package/dist/cjs/components/AffiliationsEditor/AffiliationsEditor.js +3 -3
  2. package/dist/cjs/components/AffiliationsEditor/AffiliationsEditorItem.js +7 -6
  3. package/dist/cjs/components/AffiliationsEditor/AffiliationsEditorProfile.js +3 -3
  4. package/dist/cjs/components/AffiliationsEditor/AffiliationsEditorView.js +10 -40
  5. package/dist/cjs/components/AffiliationsEditor/styles.js +2 -1
  6. package/dist/cjs/components/AffiliationsList.js +3 -2
  7. package/dist/cjs/components/AlertMessage.js +9 -9
  8. package/dist/cjs/components/AuthorForm/AuthorForm.js +2 -1
  9. package/dist/cjs/components/AuthorForm/ContributorRolesSelect.js +6 -6
  10. package/dist/cjs/components/AuthorForm/RemoveAuthorButton.js +1 -1
  11. package/dist/cjs/components/AuthorForm/index.js +0 -1
  12. package/dist/cjs/components/AuthorName.js +2 -2
  13. package/dist/cjs/components/AuthorsContainer.js +4 -3
  14. package/dist/cjs/components/AuthorsDND/AuthorsDND.js +39 -17
  15. package/dist/cjs/components/AuthorsDND/DraggableAuthorItem.js +6 -25
  16. package/dist/cjs/components/AuthorsDND/index.js +5 -10
  17. package/dist/cjs/components/AuthorsList/Author.js +3 -2
  18. package/dist/cjs/components/AuthorsList/AuthorsList.js +3 -2
  19. package/dist/cjs/components/Avatar.js +5 -4
  20. package/dist/cjs/components/Button.js +15 -15
  21. package/dist/cjs/components/ColorField/ColorField.js +2 -1
  22. package/dist/cjs/components/ColorField/ColorSelector.js +8 -7
  23. package/dist/cjs/components/Comments/CommentActions.js +9 -12
  24. package/dist/cjs/components/Comments/CommentBody.js +5 -5
  25. package/dist/cjs/components/Comments/CommentTarget.js +1 -1
  26. package/dist/cjs/components/Comments/CommentUser.js +3 -2
  27. package/dist/cjs/components/Comments/CommentWrapper.js +18 -16
  28. package/dist/cjs/components/Comments/ResolveButton.js +3 -2
  29. package/dist/cjs/components/Dialog.js +2 -2
  30. package/dist/cjs/components/FileManager/ConfirmationPopUp.js +2 -1
  31. package/dist/cjs/components/FileManager/DragItemArea.js +2 -1
  32. package/dist/cjs/components/FileManager/FileManager.js +11 -16
  33. package/dist/cjs/components/FileManager/FileSectionItem/DesignationActions.js +5 -4
  34. package/dist/cjs/components/FileManager/FileSectionItem/DesignationActionsList.js +5 -4
  35. package/dist/cjs/components/FileManager/FileSectionItem/DragLayer.js +5 -4
  36. package/dist/cjs/components/FileManager/FileSectionItem/DraggableFileSectionItem.js +8 -7
  37. package/dist/cjs/components/FileManager/FileSectionItem/FileInfo.js +3 -2
  38. package/dist/cjs/components/FileManager/FileSectionItem/FileSectionItem.js +3 -2
  39. package/dist/cjs/components/FileManager/FileSectionItem/FileSectionUploadItem.js +3 -2
  40. package/dist/cjs/components/FileManager/FileSectionItem/FileTypeIcon.js +2 -1
  41. package/dist/cjs/components/FileManager/FileSectionItem/ItemActions.js +5 -4
  42. package/dist/cjs/components/FileManager/FileSectionItem/ProgressBarUploadItem.js +2 -1
  43. package/dist/cjs/components/FileManager/FileSectionState.js +5 -3
  44. package/dist/cjs/components/FileManager/FilesSection.js +4 -3
  45. package/dist/cjs/components/FileManager/SelectDesignationActions.js +11 -11
  46. package/dist/cjs/components/FileManager/SelectDialogDesignation.js +3 -2
  47. package/dist/cjs/components/FileManager/UploadFileArea.js +11 -10
  48. package/dist/cjs/components/FileManager/util.js +15 -8
  49. package/dist/cjs/components/Form.js +1 -1
  50. package/dist/cjs/components/Inspector.js +7 -7
  51. package/dist/cjs/components/InspectorSection.js +5 -4
  52. package/dist/cjs/components/ManuscriptNoteList.js +17 -17
  53. package/dist/cjs/components/PdfPreview.js +13 -13
  54. package/dist/cjs/components/RadioButton.js +2 -1
  55. package/dist/cjs/components/RelativeDate.js +3 -2
  56. package/dist/cjs/components/SaveStatus.js +2 -1
  57. package/dist/cjs/components/SimpleModal.js +3 -2
  58. package/dist/cjs/components/StyledModal.js +3 -2
  59. package/dist/cjs/components/SubmissionInspector/BaseInformation.js +51 -24
  60. package/dist/cjs/components/SubmissionInspector/Button.js +2 -2
  61. package/dist/cjs/components/SubmissionInspector/Progress.js +6 -5
  62. package/dist/cjs/components/SubmissionInspector/Text.js +2 -2
  63. package/dist/cjs/components/TextField.js +3 -2
  64. package/dist/cjs/components/TextFieldContainer.js +2 -1
  65. package/dist/cjs/components/TextFieldError.js +2 -1
  66. package/dist/cjs/components/TextFieldGroupContainer.js +2 -1
  67. package/dist/cjs/components/Tip.js +7 -6
  68. package/dist/cjs/components/icons/back-arrow.js +2 -1
  69. package/dist/cjs/hooks/use-dropdown.js +6 -5
  70. package/dist/cjs/lib/authors.js +24 -15
  71. package/dist/cjs/lib/capabilities.js +13 -8
  72. package/dist/cjs/lib/comments.js +9 -5
  73. package/dist/cjs/lib/lw-errors-decoder.js +55 -0
  74. package/dist/cjs/lib/name.js +2 -1
  75. package/dist/es/components/AffiliationsEditor/AffiliationsEditorView.js +6 -36
  76. package/dist/es/components/AuthorForm/ContributorRolesSelect.js +1 -2
  77. package/dist/es/components/AuthorForm/index.js +0 -1
  78. package/dist/es/components/AuthorsDND/AuthorsDND.js +20 -16
  79. package/dist/es/components/AuthorsDND/DraggableAuthorItem.js +2 -2
  80. package/dist/es/components/AuthorsDND/index.js +1 -1
  81. package/dist/es/components/Comments/CommentActions.js +1 -5
  82. package/dist/es/components/Comments/CommentWrapper.js +10 -9
  83. package/dist/es/components/FileManager/FileManager.js +2 -8
  84. package/dist/es/components/FileManager/FileSectionItem/DragLayer.js +1 -1
  85. package/dist/es/components/FileManager/FileSectionState.js +1 -1
  86. package/dist/es/components/FileManager/SelectDesignationActions.js +7 -8
  87. package/dist/es/components/PdfPreview.js +4 -4
  88. package/dist/es/components/SubmissionInspector/BaseInformation.js +33 -7
  89. package/dist/es/components/TextFieldContainer.js +1 -1
  90. package/dist/es/components/TextFieldGroupContainer.js +1 -1
  91. package/dist/es/lib/lw-errors-decoder.js +55 -0
  92. package/dist/types/components/AffiliationsEditor/AffiliationsEditorView.d.ts +4 -7
  93. package/dist/types/components/AffiliationsEditor/styles.d.ts +2 -2
  94. package/dist/types/components/AlertMessage.d.ts +1 -1
  95. package/dist/types/components/AuthorForm/index.d.ts +0 -1
  96. package/dist/types/components/AuthorsDND/AuthorsDND.d.ts +2 -2
  97. package/dist/types/components/AuthorsDND/DraggableAuthorItem.d.ts +15 -5
  98. package/dist/types/components/AuthorsDND/index.d.ts +1 -1
  99. package/dist/types/components/Button.d.ts +9 -9
  100. package/dist/types/components/FileManager/util.d.ts +0 -1
  101. package/dist/types/components/Form.d.ts +1 -1
  102. package/dist/types/components/InspectorSection.d.ts +1 -1
  103. package/dist/types/components/PdfPreview.d.ts +1 -1
  104. package/dist/types/components/SimpleModal.d.ts +1 -1
  105. package/dist/types/components/SubmissionInspector/Button.d.ts +1 -1
  106. package/dist/types/components/icons/add-author.d.ts +0 -1
  107. package/dist/types/components/icons/add-icon-active.d.ts +0 -1
  108. package/dist/types/components/icons/add-icon-inverted.d.ts +0 -1
  109. package/dist/types/components/icons/back-arrow.d.ts +0 -1
  110. package/dist/types/components/icons/bookmark.d.ts +0 -1
  111. package/dist/types/components/icons/google.d.ts +0 -1
  112. package/dist/types/components/icons/orcid.d.ts +0 -1
  113. package/dist/types/components/icons/project-notification.d.ts +0 -1
  114. package/dist/types/components/icons/project.d.ts +0 -1
  115. package/dist/types/components/icons/projects-list.d.ts +0 -1
  116. package/dist/types/components/icons/search.d.ts +0 -1
  117. package/dist/types/components/icons/tick-mark.d.ts +0 -1
  118. package/dist/types/components/icons/user.d.ts +0 -1
  119. package/dist/types/lib/comments.d.ts +2 -2
  120. package/package.json +5 -5
  121. package/dist/cjs/components/AuthorForm/AffiliationsSelect.js +0 -55
  122. package/dist/es/components/AuthorForm/AffiliationsSelect.js +0 -49
  123. package/dist/types/components/AuthorForm/AffiliationsSelect.d.ts +0 -29
@@ -14,8 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import React from 'react';
17
- import { ValueType } from 'react-select';
18
- import { DefaultTheme, ThemeProps } from 'styled-components';
17
+ import { OnChangeValue } from 'react-select';
19
18
  import { AffiliationGeneric, AffiliationOption } from '../../types';
20
19
  import { AuthorFormComponentOverrides } from '../AuthorForm/AuthorFormComponents';
21
20
  interface Props {
@@ -23,7 +22,7 @@ interface Props {
23
22
  selected: AffiliationGeneric[];
24
23
  inputValue: string;
25
24
  handleInputChange: (text: string) => void;
26
- handleChoose: (value: ValueType<AffiliationOption>) => void;
25
+ handleChoose: (value: OnChangeValue<AffiliationOption, false>) => void;
27
26
  updateAffiliation: (affiliation: AffiliationGeneric) => void;
28
27
  removeAuthorAffiliation: (affiliation: AffiliationGeneric) => void;
29
28
  components?: AuthorFormComponentOverrides;
@@ -31,7 +30,5 @@ interface Props {
31
30
  menuZIndex?: number;
32
31
  };
33
32
  }
34
- declare const _default: React.ForwardRefExoticComponent<Pick<React.PropsWithChildren<Props & ThemeProps<DefaultTheme>>, "children" | "selected" | "updateAffiliation" | "removeAuthorAffiliation" | "options" | "handleChoose" | "handleInputChange" | "inputValue" | "components" | "styleOverrides"> & {
35
- theme?: DefaultTheme | undefined;
36
- }>;
37
- export default _default;
33
+ declare const AffiliationsEditorView: React.FC<Props>;
34
+ export default AffiliationsEditorView;
@@ -14,10 +14,10 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import React from 'react';
17
- import { IndicatorContainerProps } from 'react-select';
17
+ import { IndicatorsContainerProps } from 'react-select';
18
18
  import { AffiliationOption } from '../../types';
19
19
  export declare const Container: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
20
20
  export declare const Field: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
21
21
  export declare const List: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
22
22
  export declare const AddAffiliationContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
23
- export declare const AddAffiliationIndicator: React.FC<IndicatorContainerProps<AffiliationOption>>;
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;
@@ -14,4 +14,3 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  export * from './AuthorForm';
17
- export * from './AffiliationsSelect';
@@ -24,5 +24,5 @@ interface Props {
24
24
  getSidebarItemDecorator?: (authorID: string) => JSX.Element | null;
25
25
  components?: AuthorItemComponentOverrides;
26
26
  }
27
- export declare const AuthorsDND: React.FunctionComponent<Props>;
28
- export {};
27
+ declare const AuthorsDND: React.FunctionComponent<Props>;
28
+ export default AuthorsDND;
@@ -16,8 +16,9 @@
16
16
  import { Contributor } from '@manuscripts/manuscripts-json-schema';
17
17
  import React from 'react';
18
18
  import { DefaultTheme } from 'styled-components';
19
- import { AuthorItem, ConnectedDragSourceProps, ConnectedDropTargetProps } from '../../types';
19
+ import { AuthorItem, ConnectedDragSourceProps, ConnectedDropTargetProps, DropSide } from '../../types';
20
20
  import { AuthorItemComponentOverrides } from './AuthorItemComponents';
21
+ declare type ConnectedProps = ConnectedDragSourceProps & ConnectedDropTargetProps;
21
22
  interface Props {
22
23
  authorItem: AuthorItem;
23
24
  onDrop: (oldIndex: number, newIndex: number) => void;
@@ -30,11 +31,20 @@ interface Props {
30
31
  theme: DefaultTheme;
31
32
  components?: AuthorItemComponentOverrides;
32
33
  }
34
+ interface State {
35
+ dragPosition: DropSide;
36
+ }
33
37
  interface UserProfileWithAvatar {
34
38
  _id: string;
35
39
  avatar: string;
36
40
  }
37
- declare const _default: React.ForwardRefExoticComponent<Pick<Pick<Pick<Props & ConnectedDragSourceProps & ConnectedDropTargetProps, "author" | "theme" | "onDrop" | "components" | "selectAuthor" | "authors" | "authorItem" | "user" | "selectedAuthor" | "sidebarItemDecorator" | "connectDragSource" | "isDragging" | "item">, "author" | "theme" | "onDrop" | "components" | "selectAuthor" | "authors" | "authorItem" | "user" | "selectedAuthor" | "sidebarItemDecorator"> & React.RefAttributes<React.Component<Pick<Pick<Props & ConnectedDragSourceProps & ConnectedDropTargetProps, "author" | "theme" | "onDrop" | "components" | "selectAuthor" | "authors" | "authorItem" | "user" | "selectedAuthor" | "sidebarItemDecorator" | "connectDragSource" | "isDragging" | "item">, "author" | "theme" | "onDrop" | "components" | "selectAuthor" | "authors" | "authorItem" | "user" | "selectedAuthor" | "sidebarItemDecorator">, any, any>>, "author" | "ref" | "key" | "onDrop" | "components" | "selectAuthor" | "authors" | "authorItem" | "user" | "selectedAuthor" | "sidebarItemDecorator"> & {
38
- theme?: DefaultTheme | undefined;
39
- }>;
40
- export default _default;
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;
@@ -13,4 +13,4 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export * from './AuthorsDND';
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;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ExternalFile } from '@manuscripts/manuscripts-json-schema';
3
2
  import { Capabilities } from '../../lib/capabilities';
4
3
  export declare enum FileSectionType {
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  /// <reference types="react" />
17
- export declare const CenteredForm: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "title" | "name" | "slot" | "style" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "autoComplete" | "method" | "target" | "acceptCharset" | "action" | "encType" | "noValidate"> & import("react").RefAttributes<HTMLFormElement>>, import("styled-components").DefaultTheme, {}, never>;
17
+ export declare const CenteredForm: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>, "title" | "role" | "name" | "placeholder" | "slot" | "style" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "autoComplete" | "method" | "target" | "acceptCharset" | "action" | "encType" | "noValidate"> & import("react").RefAttributes<HTMLFormElement>>, import("styled-components").DefaultTheme, {}, never>;
18
18
  export declare const FormHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
19
19
  export declare const FormActions: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
20
20
  export declare const FormError: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -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;
@@ -1,4 +1,4 @@
1
- import 'pdfjs-dist/es5/web/pdf_viewer.css';
1
+ import 'pdfjs-dist/web/pdf_viewer.css';
2
2
  import React from 'react';
3
3
  declare const PdfPreview: React.FC<{
4
4
  scale?: number;
@@ -17,7 +17,7 @@ import React from 'react';
17
17
  export declare const ModalContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
18
18
  export declare const ModalHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
19
19
  export declare const CloseButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
20
- type: "button" | "submit" | "reset";
20
+ type: "button" | "reset" | "submit";
21
21
  } & {
22
22
  danger?: boolean | undefined;
23
23
  disabled?: boolean | undefined;
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  export declare const ZoomButton: 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;
@@ -13,7 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- /// <reference types="react" />
17
16
  import { IconProps } from './types';
18
17
  declare const AddAuthor: (props: IconProps) => JSX.Element;
19
18
  export default AddAuthor;
@@ -13,7 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- /// <reference types="react" />
17
16
  import { IconProps } from './types';
18
17
  declare const AddIconActive: (props: IconProps) => JSX.Element;
19
18
  export default AddIconActive;
@@ -13,7 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- /// <reference types="react" />
17
16
  import { IconProps } from './types';
18
17
  declare const AddIconInverted: (props: IconProps) => JSX.Element;
19
18
  export default AddIconInverted;
@@ -13,7 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- /// <reference types="react" />
17
16
  import { IconProps } from './types';
18
17
  export declare const BackArrow: (props: IconProps) => JSX.Element;
19
18
  export default BackArrow;
@@ -13,7 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- /// <reference types="react" />
17
16
  import { IconProps } from './types';
18
17
  declare const Bookmark: (props: IconProps) => JSX.Element;
19
18
  export default Bookmark;
@@ -13,7 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- /// <reference types="react" />
17
16
  import { IconProps } from './types';
18
17
  declare const Google: (props: IconProps) => JSX.Element;
19
18
  export default Google;
@@ -13,7 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- /// <reference types="react" />
17
16
  import { IconProps } from './types';
18
17
  declare const Orcid: (props: IconProps) => JSX.Element;
19
18
  export default Orcid;
@@ -13,7 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- /// <reference types="react" />
17
16
  import { IconProps } from './types';
18
17
  declare const ProjectNotification: (props: IconProps) => JSX.Element;
19
18
  export default ProjectNotification;
@@ -13,7 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- /// <reference types="react" />
17
16
  import { IconProps } from './types';
18
17
  declare const ProjectIcon: (props: IconProps) => JSX.Element;
19
18
  export default ProjectIcon;
@@ -13,7 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- /// <reference types="react" />
17
16
  import { IconProps } from './types';
18
17
  declare const ProjectsList: (props: IconProps) => JSX.Element;
19
18
  export default ProjectsList;
@@ -13,7 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- /// <reference types="react" />
17
16
  import { IconProps } from './types';
18
17
  declare const SearchIcon: (props: IconProps) => JSX.Element;
19
18
  export default SearchIcon;
@@ -13,7 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- /// <reference types="react" />
17
16
  import { IconProps } from './types';
18
17
  declare const TickMark: (props: IconProps) => JSX.Element;
19
18
  export default TickMark;
@@ -13,7 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- /// <reference types="react" />
17
16
  import { IconProps } from './types';
18
17
  declare const User: (props: IconProps) => JSX.Element;
19
18
  export default User;
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { Build } from '@manuscripts/manuscript-transform';
16
+ import { Build, ManuscriptNode } from '@manuscripts/manuscript-transform';
17
17
  import { BibliographicName, CommentAnnotation, Contribution, ManuscriptNote } from '@manuscripts/manuscripts-json-schema';
18
18
  export declare type CommentType = ManuscriptNote | CommentAnnotation;
19
19
  export interface UnsavedComment extends Build<CommentAnnotation> {
@@ -25,6 +25,6 @@ export interface CommentData<T = CommentType> {
25
25
  }
26
26
  export declare const isSavedComment: (comment: CommentType | UnsavedComment) => comment is CommentType;
27
27
  export declare type CommentsTreeMap<T = CommentType> = Map<string, CommentData<T>[]>;
28
- export declare const buildCommentTree: (doc: any, comments: CommentType[], newComment?: CommentAnnotation | ManuscriptNote | undefined) => CommentsTreeMap<CommentType>;
28
+ export declare const buildCommentTree: (doc: ManuscriptNode, comments: CommentType[], newComment?: CommentType | undefined) => CommentsTreeMap<CommentType>;
29
29
  export declare const buildNoteTree: (comments: CommentType[]) => CommentsTreeMap<CommentType>;
30
30
  export declare const buildName: (name: Pick<BibliographicName, 'given' | 'family'>) => string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@manuscripts/style-guide",
3
3
  "description": "Shared components for Manuscripts applications",
4
- "version": "0.30.17",
4
+ "version": "0.30.21",
5
5
  "repository": "gitlab:mpapp-public/manuscripts-style-guide",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/cjs",
@@ -36,6 +36,7 @@
36
36
  "@manuscripts/assets": "^0.6.1",
37
37
  "@manuscripts/eslint-config": "^0.4.2",
38
38
  "@reach/tabs": "^0.11.2",
39
+ "@types/prosemirror-model": "~1.13.0",
39
40
  "@types/react-color": "^3.0.4",
40
41
  "@types/react-router-dom": "^5.1.6",
41
42
  "date-fns": "^2.16.1",
@@ -47,7 +48,7 @@
47
48
  "react-modal": "^3.11.2",
48
49
  "react-modern-calendar-datepicker": "^3.1.3",
49
50
  "react-router-dom": "^5.2.0",
50
- "react-select": "^3.0.8",
51
+ "react-select": "^5.0.1",
51
52
  "react-sizeme": "^2.6.12",
52
53
  "react-tooltip": "^4.2.11",
53
54
  "tooltip.js": "^1.3.3",
@@ -75,7 +76,6 @@
75
76
  "@types/react": "^16.9.52",
76
77
  "@types/react-dom": "^16.9.8",
77
78
  "@types/react-modal": "^3.10.6",
78
- "@types/react-select": "^3.0.22",
79
79
  "@types/storybook__addon-actions": "^3.4.1",
80
80
  "@types/storybook__react": "^4.0.2",
81
81
  "@types/styled-components": "^5.1.4",
@@ -85,7 +85,7 @@
85
85
  "babel-jest": "^26.5.2",
86
86
  "babel-loader": "^8.0.6",
87
87
  "babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
88
- "chokidar": "^3.4.2",
88
+ "chokidar": "^3.3.1",
89
89
  "eslint": "^7.11.0",
90
90
  "eslint-config-prettier": "^6.12.0",
91
91
  "eslint-plugin-header": "^3.1.0",
@@ -111,7 +111,7 @@
111
111
  "react-is": "^16.11.0",
112
112
  "rimraf": "^3.0.0",
113
113
  "styled-components": "^5.2.0",
114
- "typescript": "^4.0.3"
114
+ "typescript": "~4.4.4"
115
115
  },
116
116
  "peerDependencies": {
117
117
  "@manuscripts/comment-editor": "^0.2.3",
@@ -1,55 +0,0 @@
1
- "use strict";
2
- /*!
3
- * © 2019 Atypon Systems LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
- return new (P || (P = Promise))(function (resolve, reject) {
20
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
- step((generator = generator.apply(thisArg, _arguments || [])).next());
24
- });
25
- };
26
- var __importDefault = (this && this.__importDefault) || function (mod) {
27
- return (mod && mod.__esModule) ? mod : { "default": mod };
28
- };
29
- Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.AffiliationsSelect = void 0;
31
- const react_1 = __importDefault(require("react"));
32
- const creatable_1 = __importDefault(require("react-select/creatable"));
33
- const styled_components_1 = require("styled-components");
34
- exports.AffiliationsSelect = ({ affiliations, createAffiliation, form, field, theme }) => {
35
- return (react_1.default.createElement(creatable_1.default, { isMulti: true, noOptionsMessage: () => 'Type institution name to search for it.', onChange: (value, actionMeta) => __awaiter(void 0, void 0, void 0, function* () {
36
- form.setFieldValue(field.name, yield Promise.all(value.map((option) => __awaiter(void 0, void 0, void 0, function* () {
37
- if (actionMeta.action === 'create-option' && option.__isNew__) {
38
- return createAffiliation(option.label);
39
- }
40
- return affiliations.get(option.value);
41
- }))));
42
- yield form.submitForm();
43
- }), options: Array.from(affiliations.values()).map((affiliation) => ({
44
- value: affiliation._id,
45
- label: affiliation.institution || '',
46
- })), value: (field.value || []).map((item) => ({
47
- value: item._id,
48
- label: item.institution,
49
- })), styles: {
50
- control: (provided, state) => (Object.assign(Object.assign({}, provided), { backgroundColor: theme.colors.background.primary, borderColor: state.isFocused
51
- ? theme.colors.border.field.active
52
- : theme.colors.border.field.default, borderRadius: theme.grid.radius.default, boxShadow: 'none', fontFamily: theme.font.family.sans })),
53
- } }));
54
- };
55
- exports.default = styled_components_1.withTheme(exports.AffiliationsSelect);
@@ -1,49 +0,0 @@
1
- /*!
2
- * © 2019 Atypon Systems LLC
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
17
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18
- return new (P || (P = Promise))(function (resolve, reject) {
19
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
21
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
22
- step((generator = generator.apply(thisArg, _arguments || [])).next());
23
- });
24
- };
25
- import React from 'react';
26
- import CreatableSelect from 'react-select/creatable';
27
- import { withTheme } from 'styled-components';
28
- export const AffiliationsSelect = ({ affiliations, createAffiliation, form, field, theme }) => {
29
- return (React.createElement(CreatableSelect, { isMulti: true, noOptionsMessage: () => 'Type institution name to search for it.', onChange: (value, actionMeta) => __awaiter(void 0, void 0, void 0, function* () {
30
- form.setFieldValue(field.name, yield Promise.all(value.map((option) => __awaiter(void 0, void 0, void 0, function* () {
31
- if (actionMeta.action === 'create-option' && option.__isNew__) {
32
- return createAffiliation(option.label);
33
- }
34
- return affiliations.get(option.value);
35
- }))));
36
- yield form.submitForm();
37
- }), options: Array.from(affiliations.values()).map((affiliation) => ({
38
- value: affiliation._id,
39
- label: affiliation.institution || '',
40
- })), value: (field.value || []).map((item) => ({
41
- value: item._id,
42
- label: item.institution,
43
- })), styles: {
44
- control: (provided, state) => (Object.assign(Object.assign({}, provided), { backgroundColor: theme.colors.background.primary, borderColor: state.isFocused
45
- ? theme.colors.border.field.active
46
- : theme.colors.border.field.default, borderRadius: theme.grid.radius.default, boxShadow: 'none', fontFamily: theme.font.family.sans })),
47
- } }));
48
- };
49
- export default withTheme(AffiliationsSelect);
@@ -1,29 +0,0 @@
1
- /*!
2
- * © 2019 Atypon Systems LLC
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { Affiliation, UserProfileAffiliation } from '@manuscripts/manuscripts-json-schema';
17
- import { FieldProps } from 'formik';
18
- import React from 'react';
19
- import { DefaultTheme, ThemeProps } from 'styled-components';
20
- declare type AffiliationType = UserProfileAffiliation | Affiliation;
21
- interface Props {
22
- affiliations: Map<string, AffiliationType>;
23
- createAffiliation: (institution: string) => Promise<AffiliationType>;
24
- }
25
- export declare const AffiliationsSelect: React.FunctionComponent<Props & FieldProps & ThemeProps<DefaultTheme>>;
26
- declare const _default: React.ForwardRefExoticComponent<Pick<React.PropsWithChildren<Props & FieldProps<any, any> & ThemeProps<DefaultTheme>>, "form" | "meta" | "children" | "field" | "affiliations" | "createAffiliation"> & {
27
- theme?: DefaultTheme | undefined;
28
- }>;
29
- export default _default;