@manuscripts/style-guide 1.0.6 → 1.0.7-LEAN-2237
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/FileManager/FileManager.js +7 -20
- package/dist/cjs/components/FileManager/FileSectionItem/DragLayer.js +1 -1
- package/dist/cjs/components/FileManager/FileSectionItem/FileInfo.js +1 -3
- package/dist/cjs/components/FileManager/FileSectionItem/FileSectionItem.js +4 -6
- package/dist/cjs/components/FileManager/FileSectionItem/ItemActions.js +3 -17
- package/dist/cjs/components/FileManager/FileSectionState.js +4 -14
- package/dist/cjs/components/FileManager/FilesSection.js +6 -20
- package/dist/cjs/components/FileManager/InlineFilesSection.js +1 -1
- package/dist/cjs/components/FileManager/util.js +1 -323
- package/dist/cjs/index.js +1 -5
- package/dist/cjs/lib/capabilities.js +0 -1
- package/dist/es/components/FileManager/FileManager.js +8 -21
- package/dist/es/components/FileManager/FileSectionItem/DragLayer.js +1 -1
- package/dist/es/components/FileManager/FileSectionItem/FileInfo.js +1 -3
- package/dist/es/components/FileManager/FileSectionItem/FileSectionItem.js +4 -6
- package/dist/es/components/FileManager/FileSectionItem/ItemActions.js +3 -17
- package/dist/es/components/FileManager/FileSectionState.js +4 -14
- package/dist/es/components/FileManager/FilesSection.js +8 -22
- package/dist/es/components/FileManager/InlineFilesSection.js +1 -1
- package/dist/es/components/FileManager/util.js +0 -318
- package/dist/es/index.js +0 -2
- package/dist/es/lib/capabilities.js +0 -1
- package/dist/types/components/FileManager/FileManager.d.ts +2 -4
- package/dist/types/components/FileManager/FileSectionItem/FileInfo.d.ts +0 -5
- package/dist/types/components/FileManager/FileSectionItem/FileSectionItem.d.ts +1 -3
- package/dist/types/components/FileManager/FileSectionItem/ItemActions.d.ts +0 -2
- package/dist/types/components/FileManager/FileSectionState.d.ts +1 -5
- package/dist/types/components/FileManager/util.d.ts +0 -31
- package/dist/types/components/icons/add-author.d.ts +0 -1
- package/dist/types/components/icons/add-comment-icon.d.ts +0 -1
- package/dist/types/components/icons/add-icon-active.d.ts +0 -1
- package/dist/types/components/icons/add-icon-inverted.d.ts +0 -1
- package/dist/types/components/icons/back-arrow.d.ts +0 -1
- package/dist/types/components/icons/bookmark.d.ts +0 -1
- package/dist/types/components/icons/google.d.ts +0 -1
- package/dist/types/components/icons/orcid.d.ts +0 -1
- package/dist/types/components/icons/plus-icon.d.ts +0 -1
- package/dist/types/components/icons/project-notification.d.ts +0 -1
- package/dist/types/components/icons/project.d.ts +0 -1
- package/dist/types/components/icons/projects-list.d.ts +0 -1
- package/dist/types/components/icons/search.d.ts +0 -1
- package/dist/types/components/icons/tick-mark.d.ts +0 -1
- package/dist/types/components/icons/user.d.ts +0 -1
- package/dist/types/index.d.ts +0 -2
- package/dist/types/lib/capabilities.d.ts +0 -1
- package/package.json +35 -37
- package/dist/cjs/components/FileManager/FileSectionItem/DesignationActions.js +0 -131
- package/dist/cjs/components/FileManager/FileSectionItem/DesignationActionsList.js +0 -54
- package/dist/cjs/components/FileManager/SelectDesignationActions.js +0 -74
- package/dist/cjs/components/FileManager/SelectDialogDesignation.js +0 -33
- package/dist/cjs/components/PdfPreview.js +0 -111
- package/dist/es/components/FileManager/FileSectionItem/DesignationActions.js +0 -101
- package/dist/es/components/FileManager/FileSectionItem/DesignationActionsList.js +0 -47
- package/dist/es/components/FileManager/SelectDesignationActions.js +0 -44
- package/dist/es/components/FileManager/SelectDialogDesignation.js +0 -26
- package/dist/es/components/PdfPreview.js +0 -83
- package/dist/types/components/FileManager/FileSectionItem/DesignationActions.d.ts +0 -14
- package/dist/types/components/FileManager/FileSectionItem/DesignationActionsList.d.ts +0 -13
- package/dist/types/components/FileManager/SelectDesignationActions.d.ts +0 -12
- package/dist/types/components/FileManager/SelectDialogDesignation.d.ts +0 -11
- package/dist/types/components/PdfPreview.d.ts +0 -7
|
@@ -3,14 +3,12 @@ import { Build } from '@manuscripts/transform';
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Capabilities } from '../../lib/capabilities';
|
|
5
5
|
import { SubmissionAttachment } from './FileSectionItem/FileSectionItem';
|
|
6
|
-
export type Upload = (file: File
|
|
7
|
-
export type Replace = (attachmentId: string, name: string, file: File
|
|
8
|
-
export type ChangeDesignation = (attachmentId: string, typeId: string, name: string) => Promise<boolean>;
|
|
6
|
+
export type Upload = (file: File) => Promise<boolean | SubmissionAttachment | undefined>;
|
|
7
|
+
export type Replace = (attachmentId: string, name: string, file: File) => Promise<boolean | SubmissionAttachment | undefined>;
|
|
9
8
|
export interface FileManagement {
|
|
10
9
|
getAttachments: () => SubmissionAttachment[];
|
|
11
10
|
upload: Upload;
|
|
12
11
|
replace: Replace;
|
|
13
|
-
changeDesignation: ChangeDesignation;
|
|
14
12
|
}
|
|
15
13
|
export declare const PermissionsContext: React.Context<Capabilities | null>;
|
|
16
14
|
export declare const FileManager: React.FC<{
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import React, { Dispatch } from 'react';
|
|
2
|
-
import { ChangeDesignation } from '../FileManager';
|
|
3
2
|
import { Action } from '../FileSectionState';
|
|
4
|
-
import { Designation } from '../util';
|
|
5
3
|
export declare const FileInfo: React.FC<{
|
|
6
4
|
showAttachmentName: boolean;
|
|
7
|
-
showDesignationActions: boolean;
|
|
8
5
|
title: string;
|
|
9
6
|
submissionAttachmentName: string;
|
|
10
7
|
fileExtension: string;
|
|
11
|
-
designation?: Designation;
|
|
12
8
|
attachmentId: string;
|
|
13
|
-
handleChangeDesignation: ChangeDesignation;
|
|
14
9
|
dispatch?: Dispatch<Action>;
|
|
15
10
|
}>;
|
|
16
11
|
export declare const FileInfoContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { CSSProperties, Dispatch } from 'react';
|
|
2
2
|
import { DragElementWrapper, DragSourceOptions } from 'react-dnd';
|
|
3
3
|
import { Maybe } from '../../SubmissionInspector/types';
|
|
4
|
-
import {
|
|
4
|
+
import { Replace } from '../FileManager';
|
|
5
5
|
import { Action } from '../FileSectionState';
|
|
6
6
|
export type SubmissionAttachment = {
|
|
7
7
|
id: string;
|
|
@@ -17,12 +17,10 @@ export interface FileSectionItemProps {
|
|
|
17
17
|
externalFile: SubmissionAttachment;
|
|
18
18
|
title: string;
|
|
19
19
|
showAttachmentName?: boolean;
|
|
20
|
-
showDesignationActions?: boolean;
|
|
21
20
|
showActions?: boolean;
|
|
22
21
|
showReplaceAction?: boolean;
|
|
23
22
|
handleDownload?: (url: string) => void;
|
|
24
23
|
handleReplace?: Replace;
|
|
25
|
-
handleChangeDesignation: ChangeDesignation;
|
|
26
24
|
dispatch?: Dispatch<Action>;
|
|
27
25
|
dragRef?: DragElementWrapper<DragSourceOptions>;
|
|
28
26
|
className?: string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { Dispatch } from 'react';
|
|
2
|
-
import { Maybe } from '../../SubmissionInspector/types';
|
|
3
2
|
import { Replace } from '../FileManager';
|
|
4
3
|
import { Action } from '../FileSectionState';
|
|
5
4
|
import { SubmissionAttachment } from './FileSectionItem';
|
|
@@ -10,7 +9,6 @@ export declare const ItemActions: React.FC<{
|
|
|
10
9
|
handleUpdateInline?: (attachment: SubmissionAttachment) => void;
|
|
11
10
|
attachmentId: string;
|
|
12
11
|
fileName: string;
|
|
13
|
-
designation?: Maybe<string> | undefined;
|
|
14
12
|
publicUrl: string | undefined;
|
|
15
13
|
hideActionList: (e?: React.MouseEvent) => void;
|
|
16
14
|
dispatch?: Dispatch<Action>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FileSectionType } from './util';
|
|
2
2
|
export declare const getInitialState: () => State;
|
|
3
3
|
export interface State {
|
|
4
4
|
uploadedFile: File | undefined;
|
|
@@ -10,13 +10,10 @@ export interface State {
|
|
|
10
10
|
fileUploadedSuccessfullySection: FileSectionType | undefined;
|
|
11
11
|
successMessage: string;
|
|
12
12
|
isShowSuccessMessage: boolean;
|
|
13
|
-
selectDesignation: Designation | undefined;
|
|
14
|
-
showDesignationPopup: FileSectionType | undefined;
|
|
15
13
|
}
|
|
16
14
|
declare enum ActionTypes {
|
|
17
15
|
UPLOAD_FILE = "UploadFile",
|
|
18
16
|
MOVE_FILE = "moveFile",
|
|
19
|
-
SELECT_DESIGNATION = "selectDesignation",
|
|
20
17
|
HANDLE_CANCEL_UPLOAD = "handleCancel",
|
|
21
18
|
HANDLE_UPLOAD_ACTION = "handleUpload",
|
|
22
19
|
HANDLE_FINISH_UPLOAD = "handleFinishUpload",
|
|
@@ -32,7 +29,6 @@ export declare const actions: {
|
|
|
32
29
|
UPLOAD_FILE: (uploadFile: File, sectionType: FileSectionType) => Action;
|
|
33
30
|
HANDLE_UPLOAD_ACTION: () => Action;
|
|
34
31
|
HANDLE_CANCEL_UPLOAD: () => Action;
|
|
35
|
-
SELECT_DESIGNATION: (designation: Designation) => Action;
|
|
36
32
|
MOVE_FILE: (attachmentId: string, typeId: string, name: string, successMoveMessage: string) => Action;
|
|
37
33
|
HANDLE_FINISH_UPLOAD: () => Action;
|
|
38
34
|
HANDLE_SUCCESS_MESSAGE: (successMessage: string, sectionType?: FileSectionType) => Action;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Capabilities } from '../../lib/capabilities';
|
|
3
|
-
import { Maybe } from '../SubmissionInspector/types';
|
|
4
1
|
import { SubmissionAttachment } from './FileSectionItem/FileSectionItem';
|
|
5
2
|
export declare enum FileSectionType {
|
|
6
3
|
Inline = 0,
|
|
@@ -21,27 +18,6 @@ export declare enum FileType {
|
|
|
21
18
|
Figure = 10,
|
|
22
19
|
GraphicalAbstract = 11
|
|
23
20
|
}
|
|
24
|
-
export declare enum Designation {
|
|
25
|
-
Figure = 0,
|
|
26
|
-
Table = 1,
|
|
27
|
-
Supplementary = 2,
|
|
28
|
-
ConflictOfInterest = 3,
|
|
29
|
-
Document = 4,
|
|
30
|
-
GraphicalAbstract = 5,
|
|
31
|
-
GraphicalAbstractImage = 6,
|
|
32
|
-
GraphicalAbstractText = 7,
|
|
33
|
-
Metadata = 8,
|
|
34
|
-
SubmissionFile = 9,
|
|
35
|
-
SubmissionPdf = 10,
|
|
36
|
-
TitlePage = 11,
|
|
37
|
-
Dataset = 12,
|
|
38
|
-
MainManuscript = 13
|
|
39
|
-
}
|
|
40
|
-
export declare const designationWithFileSectionsMap: Map<Designation, FileSectionType>;
|
|
41
|
-
export declare const namesWithDesignationMap: Map<Maybe<string> | undefined, Designation>;
|
|
42
|
-
export declare const designationWithReadableNamesMap: Map<Designation, string>;
|
|
43
|
-
export declare const designationWithAllowedMediaTypesMap: Map<Designation, string[]>;
|
|
44
|
-
export declare const designationWithAllowedDesignationsToTransitionMap: Map<Designation, Designation[]>;
|
|
45
21
|
export declare const extensionsWithFileTypesMap: Map<string, FileType>;
|
|
46
22
|
export declare const fileTypesWithTitlesMap: Map<FileType | undefined, string>;
|
|
47
23
|
export declare const fileTypesWithIconMap: Map<FileType | undefined, JSX.Element>;
|
|
@@ -49,11 +25,4 @@ export declare const generateAttachmentsTitles: (externalFiles: SubmissionAttach
|
|
|
49
25
|
title: string;
|
|
50
26
|
externalFile: SubmissionAttachment;
|
|
51
27
|
}>;
|
|
52
|
-
export declare const getDesignationActionsList: (designation: Designation, fileExtension: string) => Array<Designation>;
|
|
53
|
-
export declare const getDesignationName: (designation: Designation) => string;
|
|
54
|
-
export declare const getDesignationByFileSection: (fileSectionType: FileSectionType) => Array<Designation>;
|
|
55
|
-
export declare const getUploadFileDesignationList: (fileExtension: string, fileSectionType: FileSectionType | Designation[], can: Capabilities | null) => Array<{
|
|
56
|
-
value: number;
|
|
57
|
-
label: string;
|
|
58
|
-
}>;
|
|
59
28
|
export declare const droppableSections: FileSectionType[];
|
|
@@ -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;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -47,7 +47,6 @@ export * from './components/Inspector';
|
|
|
47
47
|
export * from './components/InspectorSection';
|
|
48
48
|
export * from './components/Badge';
|
|
49
49
|
export * from './components/NavDropdown';
|
|
50
|
-
export { default as PdfPreview } from './components/PdfPreview';
|
|
51
50
|
export * from './components/SubmissionInspector';
|
|
52
51
|
export * from './components/Dropdown';
|
|
53
52
|
export * from './hooks/use-dropdown';
|
|
@@ -57,6 +56,5 @@ export * from './lib/authors';
|
|
|
57
56
|
export * from './lib/capabilities';
|
|
58
57
|
export { default as errorsDecoder } from './lib/lw-errors-decoder';
|
|
59
58
|
export * from './types';
|
|
60
|
-
export { SelectDialogDesignation } from './components/FileManager/SelectDialogDesignation';
|
|
61
59
|
export * from './components/LoadingOverlay';
|
|
62
60
|
export * from './components/EditorHeader/EditorHeader';
|
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.0.
|
|
4
|
+
"version": "1.0.7-LEAN-2237",
|
|
5
5
|
"repository": "github:Atypon-OpenSource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|
|
@@ -32,29 +32,51 @@
|
|
|
32
32
|
"prepare": "husky install"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
+
"@apollo/client": "^3.7.3",
|
|
35
36
|
"@formatjs/intl-relativetimeformat": "^4.5.9",
|
|
36
37
|
"@formatjs/intl-utils": "^2.2.0",
|
|
38
|
+
"@manuscripts/assets": "^0.6.2",
|
|
39
|
+
"@manuscripts/transform": "^1.1.1",
|
|
40
|
+
"@manuscripts/json-schema": "^1.0.0",
|
|
41
|
+
"@manuscripts/title-editor": "^1.1.0",
|
|
42
|
+
"@manuscripts/comment-editor": "^1.0.1",
|
|
43
|
+
"@reach/tabs": "^0.11.2",
|
|
44
|
+
"formik": "^2.2.9",
|
|
37
45
|
"date-fns": "^2.29.3",
|
|
38
46
|
"lodash-es": "^4.17.21",
|
|
39
|
-
"pdfjs-dist": "^3.1.81",
|
|
40
47
|
"tooltip.js": "^1.3.3",
|
|
41
|
-
"typeface-lato": "^1.1.13"
|
|
48
|
+
"typeface-lato": "^1.1.13",
|
|
49
|
+
"prosemirror-commands": "^1.5.0",
|
|
50
|
+
"prosemirror-history": "^1.3.0",
|
|
51
|
+
"prosemirror-inputrules": "^1.2.0",
|
|
52
|
+
"prosemirror-keymap": "^1.2.0",
|
|
53
|
+
"prosemirror-model": "^1.18.3",
|
|
54
|
+
"prosemirror-state": "^1.4.2",
|
|
55
|
+
"prosemirror-transform": "^1.7.0",
|
|
56
|
+
"prosemirror-view": "^1.29.1",
|
|
57
|
+
"react": "^17.0.2",
|
|
58
|
+
"react-color": "^2.19.3",
|
|
59
|
+
"react-dnd": "^11.1.3",
|
|
60
|
+
"react-dnd-html5-backend": "^11.1.3",
|
|
61
|
+
"react-dom": "^17.0.2",
|
|
62
|
+
"react-intl": "^3.12.0",
|
|
63
|
+
"react-modal": "^3.11.2",
|
|
64
|
+
"react-modern-calendar-datepicker": "^3.1.3",
|
|
65
|
+
"react-popper": "^1.3.11",
|
|
66
|
+
"react-router-dom": "^5.2.0",
|
|
67
|
+
"react-select": "^5.0.1",
|
|
68
|
+
"react-sizeme": "^2.6.12",
|
|
69
|
+
"react-tooltip": "^4.2.11",
|
|
70
|
+
"styled-components": "^5.2.0"
|
|
42
71
|
},
|
|
43
72
|
"devDependencies": {
|
|
44
|
-
"@apollo/client": "^3.7.3",
|
|
45
73
|
"@babel/core": "^7.20.5",
|
|
46
74
|
"@babel/preset-env": "^7.20.2",
|
|
47
75
|
"@babel/preset-react": "^7.18.6",
|
|
48
76
|
"@babel/preset-typescript": "^7.18.6",
|
|
49
|
-
"@manuscripts/assets": "^0.6.2",
|
|
50
|
-
"@manuscripts/comment-editor": "^1.0.0",
|
|
51
77
|
"@manuscripts/data": "^0.1.0",
|
|
52
78
|
"@manuscripts/eslint-config": "^0.5.1",
|
|
53
79
|
"@manuscripts/examples": "^0.0.7",
|
|
54
|
-
"@manuscripts/json-schema": "^1.0.0",
|
|
55
|
-
"@manuscripts/title-editor": "^1.0.0",
|
|
56
|
-
"@manuscripts/transform": "^1.0.1",
|
|
57
|
-
"@reach/tabs": "^0.11.2",
|
|
58
80
|
"@storybook/addon-actions": "^6.5.15",
|
|
59
81
|
"@storybook/addons": "^6.5.15",
|
|
60
82
|
"@storybook/core": "^6.5.15",
|
|
@@ -84,36 +106,12 @@
|
|
|
84
106
|
"eslint-plugin-react": "^7.31.11",
|
|
85
107
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
86
108
|
"eslint-plugin-simple-import-sort": "^8.0.0",
|
|
87
|
-
"formik": "^2.2.9",
|
|
88
109
|
"husky": "^8.0.2",
|
|
89
110
|
"jest": "^29.3.1",
|
|
90
111
|
"jest-environment-jsdom": "^29.3.1",
|
|
91
112
|
"npm-run-all": "^4.1.5",
|
|
92
113
|
"prettier": "^2.8.1",
|
|
93
|
-
"prosemirror-commands": "^1.5.0",
|
|
94
|
-
"prosemirror-history": "^1.3.0",
|
|
95
|
-
"prosemirror-inputrules": "^1.2.0",
|
|
96
|
-
"prosemirror-keymap": "^1.2.0",
|
|
97
|
-
"prosemirror-model": "^1.18.3",
|
|
98
|
-
"prosemirror-state": "^1.4.2",
|
|
99
|
-
"prosemirror-transform": "^1.7.0",
|
|
100
|
-
"prosemirror-view": "^1.29.1",
|
|
101
|
-
"react": "^16.13.1",
|
|
102
|
-
"react-color": "^2.19.3",
|
|
103
|
-
"react-dnd": "^11.1.3",
|
|
104
|
-
"react-dnd-html5-backend": "^11.1.3",
|
|
105
|
-
"react-dom": "^16.13.1",
|
|
106
|
-
"react-intl": "^3.12.0",
|
|
107
|
-
"react-is": "^16.13.1",
|
|
108
|
-
"react-modal": "^3.11.2",
|
|
109
|
-
"react-modern-calendar-datepicker": "^3.1.3",
|
|
110
|
-
"react-popper": "^1.3.11",
|
|
111
|
-
"react-router-dom": "^5.2.0",
|
|
112
|
-
"react-select": "^5.0.1",
|
|
113
|
-
"react-sizeme": "^2.6.12",
|
|
114
|
-
"react-tooltip": "^4.2.11",
|
|
115
114
|
"rimraf": "^3.0.0",
|
|
116
|
-
"styled-components": "^5.2.0",
|
|
117
115
|
"typescript": "^4.4.4"
|
|
118
116
|
},
|
|
119
117
|
"peerDependencies": {
|
|
@@ -133,11 +131,11 @@
|
|
|
133
131
|
"prosemirror-state": "^1.4.2",
|
|
134
132
|
"prosemirror-transform": "^1.7.0",
|
|
135
133
|
"prosemirror-view": "^1.29.1",
|
|
136
|
-
"react": "^
|
|
134
|
+
"react": "^17.0.2",
|
|
137
135
|
"react-color": "^2.19.3",
|
|
138
136
|
"react-dnd": "^11.1.3",
|
|
139
137
|
"react-dnd-html5-backend": "^11.1.3",
|
|
140
|
-
"react-dom": "^
|
|
138
|
+
"react-dom": "^17.0.2",
|
|
141
139
|
"react-intl": "^3.12.0",
|
|
142
140
|
"react-modal": "^3.11.2",
|
|
143
141
|
"react-modern-calendar-datepicker": "^3.1.3",
|
|
@@ -148,6 +146,6 @@
|
|
|
148
146
|
"react-tooltip": "^4.2.11"
|
|
149
147
|
},
|
|
150
148
|
"resolutions": {
|
|
151
|
-
"@types/react": "^
|
|
149
|
+
"@types/react": "^17.0.2"
|
|
152
150
|
}
|
|
153
151
|
}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.DesignationActions = void 0;
|
|
30
|
-
const react_1 = __importStar(require("react"));
|
|
31
|
-
const react_tooltip_1 = __importDefault(require("react-tooltip"));
|
|
32
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
33
|
-
const BottomArrowIcon_1 = __importDefault(require("../../icons/BottomArrowIcon"));
|
|
34
|
-
const ConfirmationPopUp_1 = require("../ConfirmationPopUp");
|
|
35
|
-
const TooltipDiv_1 = require("../TooltipDiv");
|
|
36
|
-
const util_1 = require("../util");
|
|
37
|
-
const DesignationActionsList_1 = require("./DesignationActionsList");
|
|
38
|
-
const DesignationActions = ({ designation, attachmentId, fileExtension, handleChangeDesignation, fileName, can, dispatch, }) => {
|
|
39
|
-
const [isActionsShown, setIsActionsShown] = (0, react_1.useState)(false);
|
|
40
|
-
const [confirmationPopUpData, setConfirmationPopUpData] = (0, react_1.useState)({
|
|
41
|
-
isConfirmationPopUpOpen: false,
|
|
42
|
-
confirmationPopUpMessage: '',
|
|
43
|
-
confirmationPopUpHeader: '',
|
|
44
|
-
selectedDesignation: '',
|
|
45
|
-
});
|
|
46
|
-
const toggleActionsList = () => {
|
|
47
|
-
setIsActionsShown((prevState) => {
|
|
48
|
-
return !prevState;
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
const hideActionsList = () => {
|
|
52
|
-
setIsActionsShown(false);
|
|
53
|
-
};
|
|
54
|
-
if (designation !== undefined && fileExtension) {
|
|
55
|
-
const designationActionsList = (0, util_1.getDesignationActionsList)(designation, fileExtension);
|
|
56
|
-
if (!designationActionsList.length) {
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
59
|
-
const handleOpenConfirmationPopup = (popupHeader, popupMessage, designation) => {
|
|
60
|
-
setConfirmationPopUpData({
|
|
61
|
-
confirmationPopUpMessage: popupMessage,
|
|
62
|
-
confirmationPopUpHeader: popupHeader,
|
|
63
|
-
isConfirmationPopUpOpen: true,
|
|
64
|
-
selectedDesignation: designation,
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
|
-
const handleMoveAction = () => {
|
|
68
|
-
handleChangeDesignation &&
|
|
69
|
-
handleChangeDesignation(attachmentId, confirmationPopUpData.selectedDesignation, fileName);
|
|
70
|
-
handleCloseAction();
|
|
71
|
-
};
|
|
72
|
-
const handleCloseAction = () => {
|
|
73
|
-
setConfirmationPopUpData({
|
|
74
|
-
confirmationPopUpMessage: '',
|
|
75
|
-
confirmationPopUpHeader: '',
|
|
76
|
-
selectedDesignation: '',
|
|
77
|
-
isConfirmationPopUpOpen: false,
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
|
-
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
81
|
-
react_1.default.createElement(SecondaryActionsContainer, { onClick: toggleActionsList, onBlur: hideActionsList },
|
|
82
|
-
!(can === null || can === void 0 ? void 0 : can.changeDesignation) && (react_1.default.createElement(TooltipContainer, null,
|
|
83
|
-
react_1.default.createElement(react_tooltip_1.default, { id: "file-designation", place: "bottom", offset: { bottom: -8 }, effect: "solid", className: "tooltip" },
|
|
84
|
-
react_1.default.createElement("div", null, "You don\u2019t have permissions to adjust this selection")))),
|
|
85
|
-
react_1.default.createElement(SecondaryActionsText, { "data-for": "file-designation", "data-tip": true }, util_1.designationWithReadableNamesMap.get(designation)),
|
|
86
|
-
react_1.default.createElement(BottomArrowIcon_1.default, null),
|
|
87
|
-
isActionsShown && (can === null || can === void 0 ? void 0 : can.changeDesignation) && (react_1.default.createElement(ActionsListContainer, null,
|
|
88
|
-
react_1.default.createElement(DesignationActionsList_1.DesignationActionsList, { handleChangeDesignation: handleChangeDesignation, designationActionsList: designationActionsList, fileName: fileName, designation: designation, attachmentId: attachmentId, dispatch: dispatch, handleOpenConfirmationPopup: handleOpenConfirmationPopup })))),
|
|
89
|
-
confirmationPopUpData.isConfirmationPopUpOpen && (react_1.default.createElement(ConfirmationPopUp_1.ConfirmationPopUp, { popupHeader: confirmationPopUpData.confirmationPopUpHeader !== undefined
|
|
90
|
-
? confirmationPopUpData.confirmationPopUpHeader
|
|
91
|
-
: '', popUpMessage: confirmationPopUpData.confirmationPopUpMessage !== undefined
|
|
92
|
-
? confirmationPopUpData.confirmationPopUpMessage
|
|
93
|
-
: '', isOpen: confirmationPopUpData.isConfirmationPopUpOpen, handleClose: () => handleCloseAction(), handleMove: () => handleMoveAction() }))));
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
return null;
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
exports.DesignationActions = DesignationActions;
|
|
100
|
-
const SecondaryActionsContainer = styled_components_1.default.button `
|
|
101
|
-
display: flex;
|
|
102
|
-
align-items: center;
|
|
103
|
-
background: transparent;
|
|
104
|
-
border: none;
|
|
105
|
-
padding: 0;
|
|
106
|
-
font-family: ${(props) => props.theme.font.family.Lato};
|
|
107
|
-
font-weight: normal;
|
|
108
|
-
font-size: 14px;
|
|
109
|
-
line-height: 20px;
|
|
110
|
-
color: ${(props) => props.theme.colors.text.secondary};
|
|
111
|
-
cursor: pointer;
|
|
112
|
-
|
|
113
|
-
&:focus {
|
|
114
|
-
outline: none;
|
|
115
|
-
}
|
|
116
|
-
`;
|
|
117
|
-
const SecondaryActionsText = styled_components_1.default.div `
|
|
118
|
-
margin-right: 8px;
|
|
119
|
-
`;
|
|
120
|
-
const ActionsListContainer = styled_components_1.default.div `
|
|
121
|
-
position: absolute;
|
|
122
|
-
top: 40px;
|
|
123
|
-
z-index: 999;
|
|
124
|
-
`;
|
|
125
|
-
const TooltipContainer = (0, styled_components_1.default)(TooltipDiv_1.TooltipDiv) `
|
|
126
|
-
.tooltip {
|
|
127
|
-
white-space: normal;
|
|
128
|
-
width: 144px;
|
|
129
|
-
height: 32px;
|
|
130
|
-
}
|
|
131
|
-
`;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DesignationActionsList = void 0;
|
|
7
|
-
const react_1 = __importDefault(require("react"));
|
|
8
|
-
const FileSectionState_1 = require("../FileSectionState");
|
|
9
|
-
const ItemsAction_1 = require("../ItemsAction");
|
|
10
|
-
const util_1 = require("../util");
|
|
11
|
-
const DesignationActionsList = ({ handleChangeDesignation, designationActionsList, fileName, designation, attachmentId, dispatch, handleOpenConfirmationPopup, }) => {
|
|
12
|
-
const handleChangeOtherFilesTabDesignation = (designation, isMoveInOtherFileSection, confirmationPopupHeader, confirmationPopupMessage, successMoveMessage) => {
|
|
13
|
-
if (isMoveInOtherFileSection) {
|
|
14
|
-
if (dispatch) {
|
|
15
|
-
dispatch(FileSectionState_1.actions.MOVE_FILE(attachmentId, (0, util_1.getDesignationName)(designation), fileName, successMoveMessage));
|
|
16
|
-
handleOpenConfirmationPopup(confirmationPopupHeader, confirmationPopupMessage, (0, util_1.getDesignationName)(designation));
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
handleChangeDesignation &&
|
|
21
|
-
handleChangeDesignation(attachmentId, (0, util_1.getDesignationName)(designation), fileName);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
const isSupplementaryActionIncluded = designationActionsList.indexOf(util_1.Designation.Supplementary) !== -1;
|
|
25
|
-
const otherFilesActionsList = designationActionsList
|
|
26
|
-
.filter((value) => value !== util_1.Designation.Supplementary)
|
|
27
|
-
.map((value) => {
|
|
28
|
-
return (react_1.default.createElement(ItemsAction_1.ActionsItem, { key: value, onClick: () => {
|
|
29
|
-
let isMoveToOtherFileSection = true;
|
|
30
|
-
if (designation !== undefined) {
|
|
31
|
-
isMoveToOtherFileSection =
|
|
32
|
-
util_1.designationWithFileSectionsMap.get(designation) !==
|
|
33
|
-
util_1.FileSectionType.OtherFile;
|
|
34
|
-
}
|
|
35
|
-
handleChangeOtherFilesTabDesignation(value, isMoveToOtherFileSection, 'Are you sure you want to move this file to "Other"?', 'The file will be removed from the "Supplementary" and added to "Other".', 'Supplementary file successfully moved to other files');
|
|
36
|
-
} }, util_1.designationWithReadableNamesMap.get(value)));
|
|
37
|
-
});
|
|
38
|
-
return (react_1.default.createElement(ItemsAction_1.ActionsBox, null,
|
|
39
|
-
otherFilesActionsList.length > 0 && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
40
|
-
react_1.default.createElement(ItemsAction_1.ActionsLabel, null, "Other Files"),
|
|
41
|
-
otherFilesActionsList)),
|
|
42
|
-
isSupplementaryActionIncluded && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
43
|
-
react_1.default.createElement(ItemsAction_1.ActionsSeparator, null),
|
|
44
|
-
react_1.default.createElement(ItemsAction_1.ActionsItem, { onClick: () => {
|
|
45
|
-
let isMoveToOtherFileSection = true;
|
|
46
|
-
if (designation !== undefined) {
|
|
47
|
-
isMoveToOtherFileSection =
|
|
48
|
-
util_1.designationWithFileSectionsMap.get(designation) !==
|
|
49
|
-
util_1.FileSectionType.Supplements;
|
|
50
|
-
}
|
|
51
|
-
handleChangeOtherFilesTabDesignation(util_1.Designation.Supplementary, isMoveToOtherFileSection, 'Are you sure you want to move this file to "Supplementary"?', 'The file will be removed from the "Other" and added to "Supplementary".', 'File successfully moved to Supplementary files');
|
|
52
|
-
} }, util_1.designationWithReadableNamesMap.get(util_1.Designation.Supplementary))))));
|
|
53
|
-
};
|
|
54
|
-
exports.DesignationActionsList = DesignationActionsList;
|