@manuscripts/style-guide 0.30.24 → 0.30.27
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 +20 -38
- package/dist/cjs/components/FileManager/FileSectionItem/DesignationActions.js +4 -4
- package/dist/cjs/components/FileManager/FileSectionItem/DesignationActionsList.js +5 -5
- package/dist/cjs/components/FileManager/FileSectionItem/FileInfo.js +4 -5
- package/dist/cjs/components/FileManager/FileSectionItem/FileSectionItem.js +8 -8
- package/dist/cjs/components/FileManager/FileSectionItem/ItemActions.js +2 -2
- package/dist/cjs/components/FileManager/FileSectionState.js +1 -16
- package/dist/cjs/components/FileManager/FilesSection.js +1 -6
- package/dist/cjs/components/FileManager/InlineFilesSection.js +9 -9
- package/dist/cjs/components/FileManager/util.js +7 -23
- package/dist/cjs/components/icons/attach.js +24 -0
- package/dist/cjs/components/icons/index.js +5 -1
- package/dist/cjs/components/icons/upload.js +11 -0
- package/dist/cjs/lib/inlineFiles.js +40 -20
- package/dist/es/components/FileManager/FileManager.js +21 -39
- package/dist/es/components/FileManager/FileSectionItem/DesignationActions.js +4 -4
- package/dist/es/components/FileManager/FileSectionItem/DesignationActionsList.js +5 -5
- package/dist/es/components/FileManager/FileSectionItem/FileInfo.js +4 -5
- package/dist/es/components/FileManager/FileSectionItem/FileSectionItem.js +8 -8
- package/dist/es/components/FileManager/FileSectionItem/ItemActions.js +2 -2
- package/dist/es/components/FileManager/FileSectionState.js +1 -16
- package/dist/es/components/FileManager/FilesSection.js +1 -6
- package/dist/es/components/FileManager/InlineFilesSection.js +10 -10
- package/dist/es/components/FileManager/util.js +5 -19
- package/dist/es/components/icons/attach.js +19 -0
- package/dist/es/components/icons/index.js +2 -0
- package/dist/es/components/icons/upload.js +6 -0
- package/dist/es/lib/inlineFiles.js +40 -20
- package/dist/types/components/FileManager/FileManager.d.ts +6 -5
- package/dist/types/components/FileManager/FileSectionItem/DesignationActions.d.ts +2 -1
- package/dist/types/components/FileManager/FileSectionItem/DesignationActionsList.d.ts +2 -1
- package/dist/types/components/FileManager/FileSectionItem/FileInfo.d.ts +2 -2
- package/dist/types/components/FileManager/FileSectionItem/FileSectionItem.d.ts +14 -4
- package/dist/types/components/FileManager/FileSectionItem/ItemActions.d.ts +4 -2
- package/dist/types/components/FileManager/FileSectionState.d.ts +2 -7
- package/dist/types/components/FileManager/FilesSection.d.ts +1 -1
- package/dist/types/components/FileManager/InlineFilesSection.d.ts +5 -3
- package/dist/types/components/FileManager/UploadFileArea.d.ts +1 -1
- package/dist/types/components/FileManager/util.d.ts +5 -6
- package/dist/types/components/icons/attach.d.ts +18 -0
- package/dist/types/components/icons/index.d.ts +2 -0
- package/dist/types/components/icons/upload.d.ts +3 -0
- package/dist/types/lib/inlineFiles.d.ts +3 -3
- package/package.json +1 -1
|
@@ -2,11 +2,12 @@ import React, { Dispatch } from 'react';
|
|
|
2
2
|
import { Action } from '../FileSectionState';
|
|
3
3
|
import { Designation } from '../util';
|
|
4
4
|
export declare const DesignationActionsList: React.FC<{
|
|
5
|
-
handleChangeDesignation?: (submissionId: string, typeId: string, name: string) => Promise<boolean>;
|
|
5
|
+
handleChangeDesignation?: (submissionId: string, attachmentId: string, typeId: string, name: string) => Promise<boolean>;
|
|
6
6
|
designationActionsList: Array<Designation>;
|
|
7
7
|
submissionId: string;
|
|
8
8
|
fileName: string;
|
|
9
9
|
designation?: Designation;
|
|
10
|
+
attachmentId: string;
|
|
10
11
|
dispatch?: Dispatch<Action>;
|
|
11
12
|
handleOpenConfirmationPopup: (popupHeader: string, popupMessage: string, designation: string) => void;
|
|
12
13
|
}>;
|
|
@@ -5,11 +5,11 @@ export declare const FileInfo: React.FC<{
|
|
|
5
5
|
showAttachmentName: boolean;
|
|
6
6
|
showDesignationActions: boolean;
|
|
7
7
|
title: string;
|
|
8
|
-
description?: string;
|
|
9
8
|
submissionAttachmentName: string;
|
|
10
9
|
fileExtension: string;
|
|
11
10
|
designation?: Designation;
|
|
12
|
-
|
|
11
|
+
attachmentId: string;
|
|
12
|
+
handleChangeDesignation: (submissionId: string, attachmentId: string, typeId: string, name: string) => Promise<boolean>;
|
|
13
13
|
submissionId?: string;
|
|
14
14
|
dispatch?: Dispatch<Action>;
|
|
15
15
|
}>;
|
|
@@ -1,17 +1,27 @@
|
|
|
1
|
-
import { ExternalFile } from '@manuscripts/manuscripts-json-schema';
|
|
2
1
|
import React, { CSSProperties, Dispatch } from 'react';
|
|
3
2
|
import { DragElementWrapper, DragSourceOptions } from 'react-dnd';
|
|
3
|
+
import { Maybe } from '../../SubmissionInspector/types';
|
|
4
4
|
import { Action } from '../FileSectionState';
|
|
5
|
+
export declare type SubmissionAttachment = {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
type: SubmissionAttachmentType;
|
|
9
|
+
link: string;
|
|
10
|
+
};
|
|
11
|
+
export declare type SubmissionAttachmentType = {
|
|
12
|
+
id: string;
|
|
13
|
+
label?: Maybe<string> | undefined;
|
|
14
|
+
};
|
|
5
15
|
export interface FileSectionItemProps {
|
|
6
16
|
submissionId?: string;
|
|
7
|
-
externalFile:
|
|
17
|
+
externalFile: SubmissionAttachment;
|
|
8
18
|
title: string;
|
|
9
19
|
showAttachmentName?: boolean;
|
|
10
20
|
showDesignationActions?: boolean;
|
|
11
21
|
showActions?: boolean;
|
|
12
22
|
handleDownload?: (url: string) => void;
|
|
13
|
-
handleReplace?: (submissionId: string, name: string, file: File, typeId: string) => Promise<boolean>;
|
|
14
|
-
handleChangeDesignation: (submissionId: string, typeId: string, name: string) => Promise<boolean>;
|
|
23
|
+
handleReplace?: (submissionId: string, attachmentId: string, name: string, file: File, typeId: string) => Promise<boolean>;
|
|
24
|
+
handleChangeDesignation: (submissionId: string, attachmentId: string, typeId: string, name: string) => Promise<boolean>;
|
|
15
25
|
dispatch?: Dispatch<Action>;
|
|
16
26
|
dragRef?: DragElementWrapper<DragSourceOptions>;
|
|
17
27
|
className?: string;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React, { Dispatch } from 'react';
|
|
2
|
+
import { Maybe } from '../../SubmissionInspector/types';
|
|
2
3
|
import { Action } from '../FileSectionState';
|
|
3
4
|
export declare const ItemActions: React.FC<{
|
|
4
5
|
downloadAttachmentHandler: (url: string) => void;
|
|
5
|
-
replaceAttachmentHandler: (submissionId: string, name: string, file: File, typeId: string) => Promise<boolean>;
|
|
6
|
+
replaceAttachmentHandler: (submissionId: string, attachmentId: string, name: string, file: File, typeId: string) => Promise<boolean>;
|
|
6
7
|
submissionId: string;
|
|
8
|
+
attachmentId: string;
|
|
7
9
|
fileName: string;
|
|
8
|
-
designation?: string | undefined;
|
|
10
|
+
designation?: Maybe<string> | undefined;
|
|
9
11
|
publicUrl: string | undefined;
|
|
10
12
|
hideActionList: (e?: React.MouseEvent) => void;
|
|
11
13
|
dispatch?: Dispatch<Action>;
|
|
@@ -3,7 +3,6 @@ export declare const getInitialState: () => State;
|
|
|
3
3
|
export interface State {
|
|
4
4
|
uploadedFile: File | undefined;
|
|
5
5
|
isUploadFile: boolean;
|
|
6
|
-
isFileUploaded: boolean;
|
|
7
6
|
moveToOtherState: {
|
|
8
7
|
submissionId: string;
|
|
9
8
|
typeId: string;
|
|
@@ -21,9 +20,7 @@ declare enum ActionTypes {
|
|
|
21
20
|
HANDLE_CANCEL_UPLOAD = "handleCancel",
|
|
22
21
|
HANDLE_UPLOAD_ACTION = "handleUpload",
|
|
23
22
|
HANDLE_FINISH_UPLOAD = "handleFinishUpload",
|
|
24
|
-
HANDLE_SUCCESS_MESSAGE = "handleSuccessMessage"
|
|
25
|
-
SHOW_FILE_UPLOADED_ALERT = "showFileUploadedAlert",
|
|
26
|
-
CLOSE_FILE_UPLOADED_ALERT = "closeFileUploadedAlert"
|
|
23
|
+
HANDLE_SUCCESS_MESSAGE = "handleSuccessMessage"
|
|
27
24
|
}
|
|
28
25
|
export declare const reducer: (state: State, action: Action) => State;
|
|
29
26
|
export interface Action {
|
|
@@ -35,10 +32,8 @@ export declare const actions: {
|
|
|
35
32
|
HANDLE_UPLOAD_ACTION: () => Action;
|
|
36
33
|
HANDLE_CANCEL_UPLOAD: () => Action;
|
|
37
34
|
SELECT_DESIGNATION: (designation: Designation) => Action;
|
|
38
|
-
MOVE_FILE: (submissionId: string, typeId: string, name: string, successMoveMessage: string) => Action;
|
|
35
|
+
MOVE_FILE: (submissionId: string, attachmentId: string, typeId: string, name: string, successMoveMessage: string) => Action;
|
|
39
36
|
HANDLE_FINISH_UPLOAD: () => Action;
|
|
40
|
-
SHOW_FILE_UPLOADED_ALERT: () => Action;
|
|
41
|
-
CLOSE_FILE_UPLOADED_ALERT: () => Action;
|
|
42
37
|
HANDLE_SUCCESS_MESSAGE: () => Action;
|
|
43
38
|
};
|
|
44
39
|
export {};
|
|
@@ -4,7 +4,7 @@ import { FileSectionType } from './util';
|
|
|
4
4
|
export declare const FilesSection: React.FC<{
|
|
5
5
|
submissionId: string;
|
|
6
6
|
enableDragAndDrop: boolean;
|
|
7
|
-
handleUpload: (submissionId: string, file: File, designation: string) => Promise<
|
|
7
|
+
handleUpload: (submissionId: string, file: File, designation: string) => Promise<any>;
|
|
8
8
|
fileSection: FileSectionType;
|
|
9
9
|
filesItem: JSX.Element[];
|
|
10
10
|
dispatch: Dispatch<Action>;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Model } from '@manuscripts/manuscripts-json-schema';
|
|
2
2
|
import React, { Dispatch } from 'react';
|
|
3
|
+
import { SubmissionAttachment } from './FileSectionItem/FileSectionItem';
|
|
3
4
|
import { Action } from './FileSectionState';
|
|
4
5
|
export interface ExternalFileRef {
|
|
5
6
|
url: string;
|
|
6
7
|
kind?: string;
|
|
7
|
-
ref?:
|
|
8
|
+
ref?: SubmissionAttachment;
|
|
8
9
|
}
|
|
9
10
|
export declare const InlineFilesSection: React.FC<{
|
|
10
11
|
submissionId: string;
|
|
12
|
+
attachments: SubmissionAttachment[];
|
|
11
13
|
modelMap: Map<string, Model>;
|
|
12
|
-
handleReplace: (submissionId: string, name: string, file: File, typeId: string) => Promise<boolean>;
|
|
14
|
+
handleReplace: (submissionId: string, attachmentId: string, name: string, file: File, typeId: string) => Promise<boolean>;
|
|
13
15
|
handleDownload: (url: string) => void;
|
|
14
16
|
isEditor: boolean;
|
|
15
17
|
dispatch: Dispatch<Action>;
|
|
@@ -2,7 +2,7 @@ import React, { Dispatch } from 'react';
|
|
|
2
2
|
import { Action } from './FileSectionState';
|
|
3
3
|
import { FileSectionType } from './util';
|
|
4
4
|
export declare const UploadFileArea: React.FC<{
|
|
5
|
-
handleUploadFile: (submissionId: string, file: File, designation: string) => Promise<
|
|
5
|
+
handleUploadFile: (submissionId: string, file: File, designation: string) => Promise<any>;
|
|
6
6
|
fileSection: FileSectionType;
|
|
7
7
|
submissionId: string;
|
|
8
8
|
dispatch: Dispatch<Action>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ExternalFile } from '@manuscripts/manuscripts-json-schema';
|
|
2
1
|
import { Capabilities } from '../../lib/capabilities';
|
|
2
|
+
import { Maybe } from '../SubmissionInspector/types';
|
|
3
|
+
import { SubmissionAttachment } from './FileSectionItem/FileSectionItem';
|
|
3
4
|
export declare enum FileSectionType {
|
|
4
5
|
Inline = 0,
|
|
5
6
|
Supplements = 1,
|
|
@@ -36,18 +37,17 @@ export declare enum Designation {
|
|
|
36
37
|
MainManuscript = 13
|
|
37
38
|
}
|
|
38
39
|
export declare const designationWithFileSectionsMap: Map<Designation, FileSectionType>;
|
|
39
|
-
export declare const namesWithDesignationMap: Map<string | undefined, Designation>;
|
|
40
|
+
export declare const namesWithDesignationMap: Map<Maybe<string> | undefined, Designation>;
|
|
40
41
|
export declare const designationWithReadableNamesMap: Map<Designation, string>;
|
|
41
42
|
export declare const designationWithAllowedMediaTypesMap: Map<Designation, string[]>;
|
|
42
43
|
export declare const designationWithAllowedDesignationsToTransitionMap: Map<Designation, Designation[]>;
|
|
43
44
|
export declare const extensionsWithFileTypesMap: Map<string, FileType>;
|
|
44
45
|
export declare const fileTypesWithTitlesMap: Map<FileType | undefined, string>;
|
|
45
46
|
export declare const fileTypesWithIconMap: Map<FileType | undefined, JSX.Element>;
|
|
46
|
-
export declare const
|
|
47
|
+
export declare const generateAttachmentsTitles: (externalFiles: SubmissionAttachment[], fileSectionType: FileSectionType) => Array<{
|
|
47
48
|
title: string;
|
|
48
|
-
externalFile:
|
|
49
|
+
externalFile: SubmissionAttachment;
|
|
49
50
|
}>;
|
|
50
|
-
export declare const sortExternalFiles: (externalFile: ExternalFile[]) => ExternalFile[];
|
|
51
51
|
export declare const getDesignationActionsList: (designation: Designation, fileExtension: string) => Array<Designation>;
|
|
52
52
|
export declare const getDesignationName: (designation: Designation) => string;
|
|
53
53
|
export declare const getDesignationByFileSection: (fileSectionType: FileSectionType) => Array<Designation>;
|
|
@@ -56,4 +56,3 @@ export declare const getUploadFileDesignationList: (fileExtension: string, fileS
|
|
|
56
56
|
label: string;
|
|
57
57
|
}>;
|
|
58
58
|
export declare const droppableSections: FileSectionType[];
|
|
59
|
-
export declare const isFigure: (file: ExternalFile) => boolean;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © 2022 Atypon Systems LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import React from 'react';
|
|
17
|
+
declare const AttachIcon: React.FC;
|
|
18
|
+
export default AttachIcon;
|
|
@@ -32,3 +32,5 @@ export { default as ZoomOutIcon } from './zoom-out';
|
|
|
32
32
|
export { default as TaskStepCurrentIcon } from './task-step-current';
|
|
33
33
|
export { default as TaskStepDoneIcon } from './task-step-done';
|
|
34
34
|
export { default as TaskStepNextIcon } from './task-step-next';
|
|
35
|
+
export { default as AttachIcon } from './attach';
|
|
36
|
+
export { default as UploadIcon } from './upload';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Model } from '@manuscripts/manuscripts-json-schema';
|
|
2
|
-
import {
|
|
2
|
+
import { SubmissionAttachment } from '../components/FileManager/FileSectionItem/FileSectionItem';
|
|
3
3
|
import { FileType } from '../components/FileManager/util';
|
|
4
|
-
declare const _default: (modelMap: Map<string, Model
|
|
4
|
+
declare const _default: (modelMap: Map<string, Model>, attachments: SubmissionAttachment[]) => {
|
|
5
5
|
id: string;
|
|
6
6
|
label: string;
|
|
7
7
|
type: FileType;
|
|
8
8
|
caption?: string | undefined;
|
|
9
|
-
|
|
9
|
+
attachments?: SubmissionAttachment[] | undefined;
|
|
10
10
|
}[];
|
|
11
11
|
export default _default;
|
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.
|
|
4
|
+
"version": "0.30.27",
|
|
5
5
|
"repository": "gitlab:atypon-opensource/manuscripts-style-guide",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"main": "dist/cjs",
|