@manuscripts/style-guide 1.13.9 → 1.13.11-LEAN-3771.0

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 (61) hide show
  1. package/dist/cjs/index.js +0 -4
  2. package/dist/cjs/lib/files.js +125 -77
  3. package/dist/es/index.js +0 -4
  4. package/dist/es/lib/files.js +117 -73
  5. package/dist/types/index.d.ts +0 -4
  6. package/dist/types/lib/files.d.ts +19 -24
  7. package/package.json +1 -1
  8. package/dist/cjs/components/EditorHeader/EditorHeader.js +0 -210
  9. package/dist/cjs/components/EditorHeader/ProceedView.js +0 -195
  10. package/dist/cjs/components/FileManager/FileActions.js +0 -134
  11. package/dist/cjs/components/FileManager/FileContainer.js +0 -39
  12. package/dist/cjs/components/FileManager/FileCreatedDate.js +0 -25
  13. package/dist/cjs/components/FileManager/FileManager.js +0 -60
  14. package/dist/cjs/components/FileManager/FileManagerDragLayer.js +0 -55
  15. package/dist/cjs/components/FileManager/FileManagerProvider.js +0 -39
  16. package/dist/cjs/components/FileManager/FileName.js +0 -27
  17. package/dist/cjs/components/FileManager/FileSectionAlert.js +0 -170
  18. package/dist/cjs/components/FileManager/FileTypeIcon.js +0 -20
  19. package/dist/cjs/components/FileManager/FileUploader.js +0 -85
  20. package/dist/cjs/components/FileManager/InlineFilesSection.js +0 -133
  21. package/dist/cjs/components/FileManager/OtherFilesSection.js +0 -101
  22. package/dist/cjs/components/FileManager/SupplementsSection.js +0 -118
  23. package/dist/cjs/components/FileManager/index.js +0 -32
  24. package/dist/cjs/components/FileManager/util.js +0 -138
  25. package/dist/cjs/hooks/use-files.js +0 -39
  26. package/dist/es/components/EditorHeader/EditorHeader.js +0 -180
  27. package/dist/es/components/EditorHeader/ProceedView.js +0 -165
  28. package/dist/es/components/FileManager/FileActions.js +0 -104
  29. package/dist/es/components/FileManager/FileContainer.js +0 -33
  30. package/dist/es/components/FileManager/FileCreatedDate.js +0 -18
  31. package/dist/es/components/FileManager/FileManager.js +0 -33
  32. package/dist/es/components/FileManager/FileManagerDragLayer.js +0 -48
  33. package/dist/es/components/FileManager/FileManagerProvider.js +0 -12
  34. package/dist/es/components/FileManager/FileName.js +0 -20
  35. package/dist/es/components/FileManager/FileSectionAlert.js +0 -163
  36. package/dist/es/components/FileManager/FileTypeIcon.js +0 -13
  37. package/dist/es/components/FileManager/FileUploader.js +0 -58
  38. package/dist/es/components/FileManager/InlineFilesSection.js +0 -103
  39. package/dist/es/components/FileManager/OtherFilesSection.js +0 -74
  40. package/dist/es/components/FileManager/SupplementsSection.js +0 -91
  41. package/dist/es/components/FileManager/index.js +0 -16
  42. package/dist/es/components/FileManager/util.js +0 -128
  43. package/dist/es/hooks/use-files.js +0 -35
  44. package/dist/types/components/EditorHeader/EditorHeader.d.ts +0 -68
  45. package/dist/types/components/EditorHeader/ProceedView.d.ts +0 -22
  46. package/dist/types/components/FileManager/FileActions.d.ts +0 -19
  47. package/dist/types/components/FileManager/FileContainer.d.ts +0 -1
  48. package/dist/types/components/FileManager/FileCreatedDate.d.ts +0 -8
  49. package/dist/types/components/FileManager/FileManager.d.ts +0 -30
  50. package/dist/types/components/FileManager/FileManagerDragLayer.d.ts +0 -2
  51. package/dist/types/components/FileManager/FileManagerProvider.d.ts +0 -15
  52. package/dist/types/components/FileManager/FileName.d.ts +0 -6
  53. package/dist/types/components/FileManager/FileSectionAlert.d.ts +0 -13
  54. package/dist/types/components/FileManager/FileTypeIcon.d.ts +0 -5
  55. package/dist/types/components/FileManager/FileUploader.d.ts +0 -5
  56. package/dist/types/components/FileManager/InlineFilesSection.d.ts +0 -6
  57. package/dist/types/components/FileManager/OtherFilesSection.d.ts +0 -5
  58. package/dist/types/components/FileManager/SupplementsSection.d.ts +0 -5
  59. package/dist/types/components/FileManager/index.d.ts +0 -16
  60. package/dist/types/components/FileManager/util.d.ts +0 -25
  61. package/dist/types/hooks/use-files.d.ts +0 -8
@@ -1,74 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { buildSupplement } from '@manuscripts/json-schema';
11
- import React, { useContext, useEffect, useState } from 'react';
12
- import { useDrag } from 'react-dnd';
13
- import { getEmptyImage } from 'react-dnd-html5-backend';
14
- import { FileActions } from './FileActions';
15
- import { FileContainer } from './FileContainer';
16
- import { FileCreatedDate } from './FileCreatedDate';
17
- import { PermissionsContext } from './FileManager';
18
- import { FileManagerContext } from './FileManagerProvider';
19
- import { FileName } from './FileName';
20
- import { FileSectionAlert, FileSectionAlertType } from './FileSectionAlert';
21
- import { FileUploader } from './FileUploader';
22
- import { FileSectionType } from './util';
23
- export const OtherFilesSection = ({ files }) => {
24
- const { fileManagement, saveModel } = useContext(FileManagerContext);
25
- const can = useContext(PermissionsContext);
26
- const [alert, setAlert] = useState({
27
- type: FileSectionAlertType.NONE,
28
- message: '',
29
- });
30
- const handleUpload = (file) => __awaiter(void 0, void 0, void 0, function* () {
31
- setAlert({
32
- type: FileSectionAlertType.UPLOAD_IN_PROGRESS,
33
- message: file.name,
34
- });
35
- yield fileManagement.upload(file);
36
- setAlert({
37
- type: FileSectionAlertType.UPLOAD_SUCCESSFUL,
38
- message: '',
39
- });
40
- });
41
- const moveToSupplements = (file) => __awaiter(void 0, void 0, void 0, function* () {
42
- const supplement = buildSupplement('', file.id);
43
- yield saveModel(supplement);
44
- setAlert({
45
- type: FileSectionAlertType.MOVE_SUCCESSFUL,
46
- message: FileSectionType.Supplements,
47
- });
48
- });
49
- return (React.createElement("div", null,
50
- (can === null || can === void 0 ? void 0 : can.uploadFile) && React.createElement(FileUploader, { onUpload: handleUpload }),
51
- React.createElement(FileSectionAlert, { alert: alert }),
52
- files.map((file) => (React.createElement(OtherFile, { key: file.id, file: file, handleDownload: () => fileManagement.download(file), handleMoveToSupplements: () => __awaiter(void 0, void 0, void 0, function* () { return yield moveToSupplements(file); }) })))));
53
- };
54
- const OtherFile = ({ file, handleDownload, handleMoveToSupplements }) => {
55
- const [{ isDragging }, dragRef, preview] = useDrag({
56
- type: 'file',
57
- item: {
58
- file,
59
- },
60
- collect: (monitor) => ({
61
- isDragging: monitor.isDragging(),
62
- }),
63
- });
64
- useEffect(() => {
65
- preview(getEmptyImage());
66
- }, [preview]);
67
- return (React.createElement(FileContainer, { key: file.id, "data-cy": "file-container", ref: dragRef, className: isDragging ? 'dragging' : '' },
68
- React.createElement(FileName, { file: file }),
69
- React.createElement(FileCreatedDate, { file: file, className: "show-on-hover" }),
70
- React.createElement(FileActions, { sectionType: FileSectionType.OtherFile, handleDownload: handleDownload, move: {
71
- sectionType: FileSectionType.Supplements,
72
- handler: handleMoveToSupplements,
73
- } })));
74
- };
@@ -1,91 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { buildSupplement, ObjectTypes, } from '@manuscripts/json-schema';
11
- import React, { useContext, useEffect, useState } from 'react';
12
- import { useDrag } from 'react-dnd';
13
- import { getEmptyImage } from 'react-dnd-html5-backend';
14
- import { FileActions } from './FileActions';
15
- import { FileContainer } from './FileContainer';
16
- import { FileCreatedDate } from './FileCreatedDate';
17
- import { PermissionsContext } from './FileManager';
18
- import { FileManagerContext } from './FileManagerProvider';
19
- import { FileName } from './FileName';
20
- import { FileSectionAlert, FileSectionAlertType } from './FileSectionAlert';
21
- import { FileUploader } from './FileUploader';
22
- import { FileSectionType } from './util';
23
- export const SupplementsSection = ({ supplements }) => {
24
- const { modelMap, saveModel, deleteModel, fileManagement } = useContext(FileManagerContext);
25
- const can = useContext(PermissionsContext);
26
- const [alert, setAlert] = useState({
27
- type: FileSectionAlertType.NONE,
28
- message: '',
29
- });
30
- const upload = (file) => __awaiter(void 0, void 0, void 0, function* () {
31
- setAlert({
32
- type: FileSectionAlertType.UPLOAD_IN_PROGRESS,
33
- message: file.name,
34
- });
35
- const uploaded = yield fileManagement.upload(file);
36
- setAlert({
37
- type: FileSectionAlertType.UPLOAD_SUCCESSFUL,
38
- message: '',
39
- });
40
- return uploaded;
41
- });
42
- const handleUpload = (file) => __awaiter(void 0, void 0, void 0, function* () {
43
- const uploaded = yield upload(file);
44
- const supplement = buildSupplement('', uploaded.id);
45
- yield saveModel(Object.assign(Object.assign({}, supplement), { MIME: file.type }));
46
- });
47
- const handleReplace = (modelId, file) => __awaiter(void 0, void 0, void 0, function* () {
48
- const uploaded = yield upload(file);
49
- const supplement = buildSupplement('', uploaded.id);
50
- yield deleteModel(modelId);
51
- yield saveModel(Object.assign(Object.assign({}, supplement), { MIME: file.type }));
52
- });
53
- const handleMoveToOtherFiles = (modelId) => __awaiter(void 0, void 0, void 0, function* () {
54
- yield deleteModel(modelId);
55
- setAlert({
56
- type: FileSectionAlertType.MOVE_SUCCESSFUL,
57
- message: FileSectionType.OtherFile,
58
- });
59
- });
60
- return (React.createElement(React.Fragment, null,
61
- (can === null || can === void 0 ? void 0 : can.uploadFile) && React.createElement(FileUploader, { onUpload: handleUpload }),
62
- React.createElement(FileSectionAlert, { alert: alert }),
63
- supplements.map((supplement) => (React.createElement(SupplementFile, { key: supplement.modelId, file: supplement, handleDownload: () => fileManagement.download(supplement), handleReplace: (f) => __awaiter(void 0, void 0, void 0, function* () { return yield handleReplace(supplement.modelId, f); }), handleDetach: () => __awaiter(void 0, void 0, void 0, function* () { return yield handleMoveToOtherFiles(supplement.modelId); }) })))));
64
- };
65
- const SupplementFile = ({ file, handleDownload, handleReplace, handleDetach }) => {
66
- const [{ isDragging }, dragRef, preview] = useDrag({
67
- type: 'file',
68
- item: {
69
- file,
70
- model: {
71
- _id: file.modelId,
72
- objectType: ObjectTypes.Supplement,
73
- },
74
- },
75
- collect: (monitor) => ({
76
- isDragging: monitor.isDragging(),
77
- }),
78
- });
79
- useEffect(() => {
80
- preview(getEmptyImage());
81
- }, [preview]);
82
- return (React.createElement(FileContainer, { "data-cy": "file-container", key: file.id, ref: dragRef, className: isDragging ? 'dragging' : '' },
83
- React.createElement(FileName, { file: file }),
84
- React.createElement(FileCreatedDate, { file: file, className: "show-on-hover" }),
85
- React.createElement(FileActions, { "data-cy": "file-actions", sectionType: FileSectionType.Supplements, handleDownload: file.id ? handleDownload : undefined, handleReplace: handleReplace, move: file.id
86
- ? {
87
- sectionType: FileSectionType.OtherFile,
88
- handler: handleDetach,
89
- }
90
- : undefined })));
91
- };
@@ -1,16 +0,0 @@
1
- /*!
2
- * © 2020 Atypon Systems LLC
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- export * from './FileManager';
@@ -1,128 +0,0 @@
1
- import React from 'react';
2
- import { FileAudioIcon, FileCodeIcon, FileCompressedIcon, FileDocumentIcon, FileFigureIcon, FileGraphicalAbstractIcon, FileImageIcon, FileLatexIcon, FilePdfIcon, FileTableIcon, FileUnknownIcon, FileVideoIcon, } from '../icons';
3
- export var FileSectionType;
4
- (function (FileSectionType) {
5
- FileSectionType["Inline"] = "Inline files";
6
- FileSectionType["Supplements"] = "Supplements";
7
- FileSectionType["OtherFile"] = "Other files";
8
- })(FileSectionType || (FileSectionType = {}));
9
- export var FileType;
10
- (function (FileType) {
11
- FileType[FileType["Image"] = 0] = "Image";
12
- FileType[FileType["Audio"] = 1] = "Audio";
13
- FileType[FileType["Video"] = 2] = "Video";
14
- FileType[FileType["PlainDocument"] = 3] = "PlainDocument";
15
- FileType[FileType["SheetsWorkbooks"] = 4] = "SheetsWorkbooks";
16
- FileType[FileType["Latex"] = 5] = "Latex";
17
- FileType[FileType["CodeFile"] = 6] = "CodeFile";
18
- FileType[FileType["PdfFile"] = 7] = "PdfFile";
19
- FileType[FileType["CompressedFile"] = 8] = "CompressedFile";
20
- FileType[FileType["PlainText"] = 9] = "PlainText";
21
- FileType[FileType["Figure"] = 10] = "Figure";
22
- FileType[FileType["GraphicalAbstract"] = 11] = "GraphicalAbstract";
23
- })(FileType || (FileType = {}));
24
- const extension2type = new Map([
25
- ['png', FileType.Image],
26
- ['jpg', FileType.Image],
27
- ['jpeg', FileType.Image],
28
- ['jfif', FileType.Image],
29
- ['gif', FileType.Image],
30
- ['svg', FileType.Image],
31
- ['tif', FileType.Image],
32
- ['tiff', FileType.Image],
33
- ['mp3', FileType.Audio],
34
- ['wav', FileType.Audio],
35
- ['wma', FileType.Audio],
36
- ['flac', FileType.Audio],
37
- ['avi', FileType.Video],
38
- ['mp4', FileType.Video],
39
- ['mov', FileType.Video],
40
- ['wmv', FileType.Video],
41
- ['doc', FileType.PlainDocument],
42
- ['docx', FileType.PlainDocument],
43
- ['rtf', FileType.PlainDocument],
44
- ['xls', FileType.SheetsWorkbooks],
45
- ['xlsx', FileType.SheetsWorkbooks],
46
- ['xml', FileType.SheetsWorkbooks],
47
- ['tex', FileType.Latex],
48
- ['js', FileType.CodeFile],
49
- ['py', FileType.CodeFile],
50
- ['tsx', FileType.CodeFile],
51
- ['html', FileType.CodeFile],
52
- ['pdf', FileType.PdfFile],
53
- ['zip', FileType.CompressedFile],
54
- ['rar', FileType.CompressedFile],
55
- ['arj', FileType.CompressedFile],
56
- ['tar.gz', FileType.CompressedFile],
57
- ['tgz', FileType.CompressedFile],
58
- ['txt', FileType.PlainText],
59
- ]);
60
- const type2icon = new Map([
61
- [
62
- FileType.Audio,
63
- React.createElement(FileAudioIcon, { key: FileType.Audio, className: "file-icon" }),
64
- ],
65
- [
66
- FileType.Video,
67
- React.createElement(FileVideoIcon, { key: FileType.Video, className: "file-icon" }),
68
- ],
69
- [
70
- FileType.PlainDocument,
71
- React.createElement(FileDocumentIcon, { key: FileType.PlainDocument, color: "#1A9BC7", className: "file-icon" }),
72
- ],
73
- [
74
- FileType.SheetsWorkbooks,
75
- React.createElement(FileTableIcon, { key: FileType.SheetsWorkbooks, className: "file-icon" }),
76
- ],
77
- [
78
- FileType.Latex,
79
- React.createElement(FileLatexIcon, { key: FileType.Latex, color: "#1A9BC7", className: "file-icon" }),
80
- ],
81
- [
82
- FileType.CodeFile,
83
- React.createElement(FileCodeIcon, { key: FileType.CodeFile, className: "file-icon" }),
84
- ],
85
- [
86
- FileType.PdfFile,
87
- React.createElement(FilePdfIcon, { key: FileType.PdfFile, className: "file-icon" }),
88
- ],
89
- [
90
- FileType.CompressedFile,
91
- React.createElement(FileCompressedIcon, { key: FileType.CompressedFile, className: "file-icon" }),
92
- ],
93
- [
94
- FileType.PlainText,
95
- React.createElement(FileDocumentIcon, { key: FileType.PlainText, color: "#FFBD26", className: "file-icon" }),
96
- ],
97
- [
98
- FileType.Image,
99
- React.createElement(FileImageIcon, { key: FileType.Image, className: "file-icon" }),
100
- ],
101
- [
102
- FileType.Figure,
103
- React.createElement(FileFigureIcon, { key: FileType.Figure, className: "file-icon" }),
104
- ],
105
- [
106
- FileType.GraphicalAbstract,
107
- React.createElement(FileGraphicalAbstractIcon, { key: FileType.GraphicalAbstract, className: "file-icon" }),
108
- ],
109
- [undefined, React.createElement(FileUnknownIcon, { key: undefined, className: "file-icon" })],
110
- ]);
111
- export const getFileType = (file) => {
112
- const extension = getExtension(file.name);
113
- return extension2type.get(extension.toLowerCase());
114
- };
115
- export const getFileIcon = (file) => {
116
- const type = getFileType(file);
117
- return type2icon.get(type);
118
- };
119
- export const getFileTypeIcon = (type) => {
120
- return type2icon.get(type);
121
- };
122
- export const isImageFile = (file) => {
123
- return getFileType(file) === FileType.Image;
124
- };
125
- const getExtension = (name) => {
126
- const index = name.indexOf('.');
127
- return index ? name.substring(index + 1) : '';
128
- };
@@ -1,35 +0,0 @@
1
- import { ObjectTypes } from '@manuscripts/json-schema';
2
- import { getInlineFiles, getSupplements, } from '../lib/files';
3
- import { useDeepCompareMemo } from './use-deep-compare';
4
- const types = [
5
- ObjectTypes.Section,
6
- ObjectTypes.FigureElement,
7
- ObjectTypes.Figure,
8
- ObjectTypes.Supplement,
9
- ObjectTypes.ElementsOrder,
10
- ];
11
- const getOtherFiles = (inlineFiles, supplements, files) => {
12
- const excluded = new Set();
13
- inlineFiles.flatMap((f) => f.files).forEach((f) => excluded.add(f.id));
14
- supplements.forEach((s) => excluded.add(s.id));
15
- return files.filter((f) => !excluded.has(f.id));
16
- };
17
- export const useFiles = (modelMap, files) => {
18
- const models = [];
19
- for (const [_, model] of modelMap.entries()) {
20
- if (types.includes(model.objectType)) {
21
- models.push(model);
22
- }
23
- }
24
- return useDeepCompareMemo(() => {
25
- const inlineFiles = getInlineFiles(modelMap, files);
26
- const supplements = getSupplements(modelMap, files);
27
- const otherFiles = getOtherFiles(inlineFiles, supplements, files);
28
- return {
29
- inlineFiles,
30
- supplements,
31
- otherFiles,
32
- };
33
- }, [models, files]);
34
- };
35
- export default useFiles;
@@ -1,68 +0,0 @@
1
- import React from 'react';
2
- export type PartialSubmission = {
3
- id: string;
4
- currentStep: SubmissionStep;
5
- previousStep?: SubmissionStep | null | undefined;
6
- nextStep?: SubmissionStep | null | undefined;
7
- };
8
- export type SubmissionStep = {
9
- type: SubmissionStepType;
10
- };
11
- export type SubmissionStepTransition = {
12
- status: {
13
- id: string;
14
- label: string;
15
- };
16
- type: SubmissionStepType;
17
- };
18
- export type SubmissionStepType = {
19
- id: string;
20
- label: string;
21
- description: string;
22
- transitions: Array<SubmissionStepTransition>;
23
- role: {
24
- label: string;
25
- };
26
- };
27
- export declare enum DialogState {
28
- INIT = 0,
29
- LOADING = 1,
30
- ERROR = 2,
31
- SUCCESS = 3,
32
- CLOSED = 4
33
- }
34
- export type ProceedDialogData = {
35
- state: DialogState;
36
- error?: string;
37
- mutationError?: any;
38
- updateState: (state: DialogState) => void;
39
- clearError: () => void;
40
- };
41
- export declare const EditorHeader: React.FC<{
42
- handleSnapshot?: () => Promise<void>;
43
- submission: PartialSubmission;
44
- hasPendingSuggestions?: boolean;
45
- canCompleteTask: boolean;
46
- exceptionDialog: React.FC<{
47
- errorCode: string;
48
- }>;
49
- userRole: string;
50
- submitProceed: {
51
- dialogData: ProceedDialogData;
52
- submit: (statusId: string, noteValue: string) => Promise<unknown>;
53
- };
54
- goBack?: () => void;
55
- status?: 'saved' | 'saving' | 'offline' | 'failed';
56
- isAnnotator: boolean;
57
- isProofer: boolean;
58
- message: React.FC;
59
- disabelProceedNote?: boolean;
60
- }>;
61
- export declare const PrimaryButtonSmall: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
62
- type: "button" | "submit" | "reset";
63
- } & {
64
- danger?: boolean | undefined;
65
- disabled?: boolean | undefined;
66
- mini?: boolean | undefined;
67
- }, "type">;
68
- export declare const MediumTextArea: import("styled-components").StyledComponent<"textarea", import("styled-components").DefaultTheme, import("../Form").ErrorProps, never>;
@@ -1,22 +0,0 @@
1
- import React from 'react';
2
- import { ProceedDialogData } from '../..';
3
- import { SubmissionStepTransition, SubmissionStepType } from './EditorHeader';
4
- export declare const ProceedView: React.FC<{
5
- isAnnotator: boolean;
6
- isProofer: boolean;
7
- disable: boolean;
8
- onTransitionClick: (event: unknown) => void;
9
- onNoteChange?: (event: unknown) => void;
10
- hasPendingSuggestions: boolean;
11
- dialogData: ProceedDialogData;
12
- noteValue: string;
13
- currentStepTransition: SubmissionStepTransition[];
14
- previousStepType: SubmissionStepType | undefined;
15
- currentStepType: SubmissionStepType;
16
- nextStepType: SubmissionStepType;
17
- onCancelClick: () => void;
18
- continueDialogAction: () => Promise<void>;
19
- message: React.FC<{
20
- isCentered: boolean;
21
- }>;
22
- }>;
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import { Move, Replace } from './FileManager';
3
- import { FileSectionType } from './util';
4
- export declare const FileActions: React.FC<{
5
- sectionType: FileSectionType;
6
- handleDownload?: () => void;
7
- handleReplace?: Replace;
8
- handleDetach?: () => void;
9
- move?: Move;
10
- className?: string;
11
- }>;
12
- export declare const ActionsIcon: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {}, never>;
13
- export declare const FileActionDropdownList: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
14
- direction?: "right" | "left" | undefined;
15
- width?: number | undefined;
16
- height?: number | undefined;
17
- top?: number | undefined;
18
- }, never>;
19
- export declare const FileAction: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -1 +0,0 @@
1
- export declare const FileContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import { FileAttachment } from '../../lib/files';
3
- export declare const FileCreatedDate: React.FC<{
4
- file: FileAttachment;
5
- className?: string;
6
- }>;
7
- export declare const FileDateContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
8
- export declare const FileDate: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -1,30 +0,0 @@
1
- import { Build, Model } from '@manuscripts/json-schema';
2
- import React from 'react';
3
- import { FileSectionType } from '../../index';
4
- import { Capabilities } from '../../lib/capabilities';
5
- import { FileAttachment } from '../../lib/files';
6
- export type Upload = (file: File) => Promise<FileAttachment>;
7
- export type Download = (file: FileAttachment) => void;
8
- export type PreviewLink = (file: FileAttachment) => string | undefined;
9
- export type Replace = (file: File) => Promise<void>;
10
- export type Move = {
11
- sectionType: FileSectionType;
12
- handler: () => Promise<void>;
13
- };
14
- export interface FileManagement {
15
- upload: Upload;
16
- download: Download;
17
- previewLink: PreviewLink;
18
- }
19
- export type SaveModel = <T extends Model>(model: T | Build<T> | Partial<T>) => Promise<T>;
20
- export type DeleteModel = (id: string) => Promise<string>;
21
- export declare const PermissionsContext: React.Context<Capabilities | null>;
22
- export declare const FileManager: React.FC<{
23
- files: FileAttachment[];
24
- fileManagement: FileManagement;
25
- modelMap: Map<string, Model>;
26
- saveModel: SaveModel;
27
- deleteModel: DeleteModel;
28
- enableDragAndDrop: boolean;
29
- can: Capabilities;
30
- }>;
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const FileManagerDragLayer: React.FC;
@@ -1,15 +0,0 @@
1
- import { Model } from '@manuscripts/json-schema';
2
- import React from 'react';
3
- import { DeleteModel, FileManagement, SaveModel } from './FileManager';
4
- export declare const FileManagerContext: React.Context<{
5
- saveModel: SaveModel;
6
- deleteModel: DeleteModel;
7
- modelMap: Map<string, Model>;
8
- fileManagement: FileManagement;
9
- }>;
10
- export declare const FileManagerProvider: React.FC<{
11
- saveModel: SaveModel;
12
- deleteModel: DeleteModel;
13
- modelMap: Map<string, Model>;
14
- fileManagement: FileManagement;
15
- }>;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import { FileAttachment } from '../../lib/files';
3
- export declare const FileName: React.FC<{
4
- file: FileAttachment;
5
- }>;
6
- export declare const FileNameText: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- export declare enum FileSectionAlertType {
3
- NONE = 0,
4
- UPLOAD_IN_PROGRESS = 1,
5
- UPLOAD_SUCCESSFUL = 2,
6
- MOVE_SUCCESSFUL = 3
7
- }
8
- export declare const FileSectionAlert: React.FC<{
9
- alert: {
10
- type: FileSectionAlertType;
11
- message: string;
12
- };
13
- }>;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { FileAttachment } from '../../lib/files';
3
- export declare const FileTypeIcon: React.FC<{
4
- file: FileAttachment;
5
- }>;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- export interface FileUploaderProps {
3
- onUpload: (file: File) => void;
4
- }
5
- export declare const FileUploader: React.FC<FileUploaderProps>;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import { ElementFiles } from '../../lib/files';
3
- export declare const InlineFilesSection: React.FC<{
4
- elements: ElementFiles[];
5
- isEditor: boolean;
6
- }>;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { FileAttachment } from '../../lib/files';
3
- export declare const OtherFilesSection: React.FC<{
4
- files: FileAttachment[];
5
- }>;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { ModelFile } from '../../lib/files';
3
- export declare const SupplementsSection: React.FC<{
4
- supplements: ModelFile[];
5
- }>;
@@ -1,16 +0,0 @@
1
- /*!
2
- * © 2020 Atypon Systems LLC
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- export * from './FileManager';
@@ -1,25 +0,0 @@
1
- /// <reference types="react" />
2
- import { FileAttachment } from '../../lib/files';
3
- export declare enum FileSectionType {
4
- Inline = "Inline files",
5
- Supplements = "Supplements",
6
- OtherFile = "Other files"
7
- }
8
- export declare enum FileType {
9
- Image = 0,
10
- Audio = 1,
11
- Video = 2,
12
- PlainDocument = 3,
13
- SheetsWorkbooks = 4,
14
- Latex = 5,
15
- CodeFile = 6,
16
- PdfFile = 7,
17
- CompressedFile = 8,
18
- PlainText = 9,
19
- Figure = 10,
20
- GraphicalAbstract = 11
21
- }
22
- export declare const getFileType: (file: FileAttachment) => FileType | undefined;
23
- export declare const getFileIcon: (file: FileAttachment) => JSX.Element | undefined;
24
- export declare const getFileTypeIcon: (type: FileType) => JSX.Element | undefined;
25
- export declare const isImageFile: (file: FileAttachment) => boolean;
@@ -1,8 +0,0 @@
1
- import { Model } from '@manuscripts/json-schema';
2
- import { ElementFiles, FileAttachment, ModelFile } from '../lib/files';
3
- export declare const useFiles: (modelMap: Map<string, Model>, files: FileAttachment[]) => {
4
- inlineFiles: ElementFiles[];
5
- supplements: ModelFile[];
6
- otherFiles: FileAttachment[];
7
- };
8
- export default useFiles;