@manuscripts/article-editor 1.17.13 → 1.17.14
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/FileActions.js +139 -0
- package/dist/cjs/components/FileManager/FileActions.js.map +1 -0
- package/dist/cjs/components/FileManager/FileContainer.js +51 -0
- package/dist/cjs/components/FileManager/FileContainer.js.map +1 -0
- package/dist/cjs/components/FileManager/FileCreatedDate.js +29 -0
- package/dist/cjs/components/FileManager/FileCreatedDate.js.map +1 -0
- package/dist/cjs/components/FileManager/FileManager.js +68 -0
- package/dist/cjs/components/FileManager/FileManager.js.map +1 -0
- package/dist/cjs/components/FileManager/FileManagerDragLayer.js +67 -0
- package/dist/cjs/components/FileManager/FileManagerDragLayer.js.map +1 -0
- package/dist/cjs/components/FileManager/FileName.js +28 -0
- package/dist/cjs/components/FileManager/FileName.js.map +1 -0
- package/dist/cjs/components/FileManager/FileSectionAlert.js +181 -0
- package/dist/cjs/components/FileManager/FileSectionAlert.js.map +1 -0
- package/dist/cjs/components/FileManager/FileTypeIcon.js +24 -0
- package/dist/cjs/components/FileManager/FileTypeIcon.js.map +1 -0
- package/dist/cjs/components/FileManager/FileUploader.js +100 -0
- package/dist/cjs/components/FileManager/FileUploader.js.map +1 -0
- package/dist/cjs/components/FileManager/InlineFilesSection.js +152 -0
- package/dist/cjs/components/FileManager/InlineFilesSection.js.map +1 -0
- package/dist/cjs/components/FileManager/OtherFilesSection.js +109 -0
- package/dist/cjs/components/FileManager/OtherFilesSection.js.map +1 -0
- package/dist/cjs/components/FileManager/SupplementsSection.js +132 -0
- package/dist/cjs/components/FileManager/SupplementsSection.js.map +1 -0
- package/dist/cjs/components/projects/EditorElement.js +9 -12
- package/dist/cjs/components/projects/EditorElement.js.map +1 -1
- package/dist/cjs/components/projects/Inspector.js +9 -9
- package/dist/cjs/components/projects/Inspector.js.map +1 -1
- package/dist/cjs/lib/attrs-change-filter.js.map +1 -1
- package/dist/cjs/postgres-data/PsSource.js +11 -0
- package/dist/cjs/postgres-data/PsSource.js.map +1 -1
- package/dist/cjs/store/Store.js.map +1 -1
- package/dist/es/components/FileManager/FileActions.js +109 -0
- package/dist/es/components/FileManager/FileActions.js.map +1 -0
- package/dist/es/components/FileManager/FileContainer.js +45 -0
- package/dist/es/components/FileManager/FileContainer.js.map +1 -0
- package/dist/es/components/FileManager/FileCreatedDate.js +22 -0
- package/dist/es/components/FileManager/FileCreatedDate.js.map +1 -0
- package/dist/es/components/FileManager/FileManager.js +61 -0
- package/dist/es/components/FileManager/FileManager.js.map +1 -0
- package/dist/es/components/FileManager/FileManagerDragLayer.js +60 -0
- package/dist/es/components/FileManager/FileManagerDragLayer.js.map +1 -0
- package/dist/es/components/FileManager/FileName.js +21 -0
- package/dist/es/components/FileManager/FileName.js.map +1 -0
- package/dist/es/components/FileManager/FileSectionAlert.js +174 -0
- package/dist/es/components/FileManager/FileSectionAlert.js.map +1 -0
- package/dist/es/components/FileManager/FileTypeIcon.js +17 -0
- package/dist/es/components/FileManager/FileTypeIcon.js.map +1 -0
- package/dist/es/components/FileManager/FileUploader.js +73 -0
- package/dist/es/components/FileManager/FileUploader.js.map +1 -0
- package/dist/es/components/FileManager/InlineFilesSection.js +122 -0
- package/dist/es/components/FileManager/InlineFilesSection.js.map +1 -0
- package/dist/es/components/FileManager/OtherFilesSection.js +82 -0
- package/dist/es/components/FileManager/OtherFilesSection.js.map +1 -0
- package/dist/es/components/FileManager/SupplementsSection.js +105 -0
- package/dist/es/components/FileManager/SupplementsSection.js.map +1 -0
- package/dist/es/components/projects/EditorElement.js +10 -13
- package/dist/es/components/projects/EditorElement.js.map +1 -1
- package/dist/es/components/projects/Inspector.js +10 -10
- package/dist/es/components/projects/Inspector.js.map +1 -1
- package/dist/es/lib/attrs-change-filter.js.map +1 -1
- package/dist/es/postgres-data/PsSource.js +11 -0
- package/dist/es/postgres-data/PsSource.js.map +1 -1
- package/dist/es/store/Store.js.map +1 -1
- package/dist/types/EditorApp.d.ts +1 -1
- package/dist/types/components/FileManager/FileActions.d.ts +21 -0
- package/dist/types/components/FileManager/FileContainer.d.ts +1 -0
- package/dist/types/components/FileManager/FileCreatedDate.d.ts +19 -0
- package/dist/types/components/FileManager/FileManager.d.ts +23 -0
- package/dist/types/components/FileManager/FileManagerDragLayer.d.ts +13 -0
- package/dist/types/components/FileManager/FileName.d.ts +17 -0
- package/dist/types/components/FileManager/FileSectionAlert.d.ts +13 -0
- package/dist/types/components/FileManager/FileTypeIcon.d.ts +20 -0
- package/dist/types/components/FileManager/FileUploader.d.ts +19 -0
- package/dist/types/components/FileManager/InlineFilesSection.d.ts +17 -0
- package/dist/types/components/FileManager/OtherFilesSection.d.ts +19 -0
- package/dist/types/components/FileManager/SupplementsSection.d.ts +20 -0
- package/dist/types/lib/attrs-change-filter.d.ts +1 -1
- package/dist/types/postgres-data/PsSource.d.ts +1 -1
- package/dist/types/store/DataSourceStrategy.d.ts +1 -1
- package/dist/types/store/Store.d.ts +1 -2
- package/package.json +3 -3
|
@@ -0,0 +1,139 @@
|
|
|
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.FileAction = exports.FileActionDropdownList = exports.ActionsIcon = exports.FileActions = void 0;
|
|
30
|
+
/*!
|
|
31
|
+
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
32
|
+
*
|
|
33
|
+
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
34
|
+
*
|
|
35
|
+
* The Original Code is manuscripts-frontend.
|
|
36
|
+
*
|
|
37
|
+
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
38
|
+
*
|
|
39
|
+
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
|
|
40
|
+
*/
|
|
41
|
+
const style_guide_1 = require("@manuscripts/style-guide");
|
|
42
|
+
const react_1 = __importStar(require("react"));
|
|
43
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
44
|
+
/**
|
|
45
|
+
* This component represents the drop-down list action for each file item.
|
|
46
|
+
*/
|
|
47
|
+
const FileActions = ({ sectionType, onDownload, onReplace, onDetach, move, className }) => {
|
|
48
|
+
const can = (0, style_guide_1.usePermissions)();
|
|
49
|
+
const { isOpen, toggleOpen, wrapperRef } = (0, style_guide_1.useDropdown)();
|
|
50
|
+
const [isMoveDialogOpen, setMoveDialogOpen] = (0, react_1.useState)(false);
|
|
51
|
+
const showDownload = can?.downloadFiles && onDownload;
|
|
52
|
+
const showReplace = can?.replaceFile && onReplace;
|
|
53
|
+
const showDetach = can?.editArticle && onDetach;
|
|
54
|
+
const showMove = can?.moveFile && move;
|
|
55
|
+
const show = showDownload || showReplace || showDetach || showMove;
|
|
56
|
+
const fileInputRef = (0, react_1.useRef)(null);
|
|
57
|
+
const handleChange = async (event) => {
|
|
58
|
+
if (onReplace && event && event.target && event.target.files) {
|
|
59
|
+
const file = event.target.files[0];
|
|
60
|
+
await onReplace(file);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
const openFileDialog = () => {
|
|
64
|
+
if (fileInputRef && fileInputRef.current) {
|
|
65
|
+
fileInputRef.current.click();
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
if (!show) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
return (react_1.default.createElement(style_guide_1.DropdownContainer, { ref: wrapperRef },
|
|
72
|
+
react_1.default.createElement(exports.ActionsIcon, { onClick: toggleOpen, type: "button", className: "show-on-hover", "data-cy": "file-actions", "aria-label": "Actions", "aria-pressed": isOpen },
|
|
73
|
+
react_1.default.createElement(style_guide_1.DotsIcon, null)),
|
|
74
|
+
isOpen && (react_1.default.createElement(exports.FileActionDropdownList, { "data-cy": "file-actions-dropdown", direction: "right", className: className, width: 192, top: 5, onClick: toggleOpen },
|
|
75
|
+
showDownload && (react_1.default.createElement(exports.FileAction, { onClick: onDownload }, "Download")),
|
|
76
|
+
showReplace && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
77
|
+
react_1.default.createElement(exports.FileAction, { onClick: openFileDialog }, "Replace"),
|
|
78
|
+
react_1.default.createElement("input", { ref: fileInputRef, type: "file", style: { display: 'none' }, onChange: handleChange }))),
|
|
79
|
+
showDetach && react_1.default.createElement(exports.FileAction, { onClick: onDetach }, "Detach"),
|
|
80
|
+
showMove && (react_1.default.createElement(exports.FileAction, { onClick: () => setMoveDialogOpen(true) },
|
|
81
|
+
"Move to ",
|
|
82
|
+
move.sectionType)))),
|
|
83
|
+
showMove && (react_1.default.createElement(MoveFileConfirmationDialog, { "data-cy": "file-move-confirm-dialog", isOpen: isMoveDialogOpen, close: () => setMoveDialogOpen(false), source: sectionType, target: move.sectionType, handleMove: move.handler }))));
|
|
84
|
+
};
|
|
85
|
+
exports.FileActions = FileActions;
|
|
86
|
+
const MoveFileConfirmationDialog = ({ isOpen, close, source, target, handleMove }) => {
|
|
87
|
+
const header = `Are you sure you want to move this file to “${target}”?`;
|
|
88
|
+
const message = `The file will be removed from “${source}” and added to “${target}”.`;
|
|
89
|
+
const handleConfirm = () => {
|
|
90
|
+
handleMove();
|
|
91
|
+
close();
|
|
92
|
+
};
|
|
93
|
+
return (react_1.default.createElement(style_guide_1.Dialog, { isOpen: isOpen, category: style_guide_1.Category.confirmation, header: header, message: message, actions: {
|
|
94
|
+
primary: {
|
|
95
|
+
action: handleConfirm,
|
|
96
|
+
title: 'Move',
|
|
97
|
+
},
|
|
98
|
+
secondary: {
|
|
99
|
+
action: () => close(),
|
|
100
|
+
title: 'Cancel',
|
|
101
|
+
},
|
|
102
|
+
} }));
|
|
103
|
+
};
|
|
104
|
+
exports.ActionsIcon = styled_components_1.default.button `
|
|
105
|
+
border: none;
|
|
106
|
+
background: transparent;
|
|
107
|
+
cursor: pointer;
|
|
108
|
+
padding: 0 8px;
|
|
109
|
+
&:focus {
|
|
110
|
+
outline: none;
|
|
111
|
+
}
|
|
112
|
+
&:hover svg circle {
|
|
113
|
+
fill: #1a9bc7;
|
|
114
|
+
}
|
|
115
|
+
`;
|
|
116
|
+
exports.FileActionDropdownList = (0, styled_components_1.default)(style_guide_1.DropdownList) `
|
|
117
|
+
border: 1px solid #e2e2e2;
|
|
118
|
+
box-sizing: border-box;
|
|
119
|
+
box-shadow: 0 4px 9px rgba(0, 0, 0, 0.3);
|
|
120
|
+
border-radius: 8px;
|
|
121
|
+
min-width: 180px;
|
|
122
|
+
background: ${(props) => props.theme.colors.background.primary};
|
|
123
|
+
z-index: 999;
|
|
124
|
+
text-align: left;
|
|
125
|
+
overflow: hidden;
|
|
126
|
+
`;
|
|
127
|
+
exports.FileAction = styled_components_1.default.div `
|
|
128
|
+
font-family: ${(props) => props.theme.font.family.Lato};
|
|
129
|
+
cursor: pointer;
|
|
130
|
+
font-size: 16px;
|
|
131
|
+
line-height: 24px;
|
|
132
|
+
color: ${(props) => props.theme.colors.text.primary};
|
|
133
|
+
padding: 16px;
|
|
134
|
+
&:hover,
|
|
135
|
+
&:focus {
|
|
136
|
+
background: #f2fbfc;
|
|
137
|
+
}
|
|
138
|
+
`;
|
|
139
|
+
//# sourceMappingURL=FileActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileActions.js","sourceRoot":"","sources":["../../../../src/components/FileManager/FileActions.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;GAUG;AACH,0DAQiC;AACjC,+CAA4D;AAC5D,0EAAsC;AAItC;;GAEG;AACI,MAAM,WAAW,GAOnB,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE;IACzE,MAAM,GAAG,GAAG,IAAA,4BAAc,GAAE,CAAA;IAC5B,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,IAAA,yBAAW,GAAE,CAAA;IACxD,MAAM,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,GAAG,IAAA,gBAAQ,EAAU,KAAK,CAAC,CAAA;IAEtE,MAA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AAM,EACd,QAAQ,EAAE,sBAAQ,CAAC,YAAY,EAC/B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,MAAM,EAAE,aAAa;gBACrB,KAAK,EAAE,MAAM;aACd;YACD,SAAS,EAAE;gBACT,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE;gBACrB,KAAK,EAAE,QAAQ;aAChB;SACF,GACD,CACH,CAAA;AACH,CAAC,CAAA;AAEY,QAAA,WAAW,GAAG,2BAAM,CAAC,MAAM,CAAA;;;;;;;;;;;CAWvC,CAAA;AAEY,QAAA,sBAAsB,GAAG,IAAA,2BAAM,EAAC,0BAAY,CAAC,CAAA;;;;;;gBAM1C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO;;;;CAI/D,CAAA;AAEY,QAAA,UAAU,GAAG,2BAAM,CAAC,GAAG,CAAA;iBACnB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI;;;;WAI7C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO;;;;;;CAMpD,CAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
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.FileContainer = void 0;
|
|
7
|
+
/*!
|
|
8
|
+
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
9
|
+
*
|
|
10
|
+
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
11
|
+
*
|
|
12
|
+
* The Original Code is manuscripts-frontend.
|
|
13
|
+
*
|
|
14
|
+
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
15
|
+
*
|
|
16
|
+
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
|
|
17
|
+
*/
|
|
18
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
19
|
+
exports.FileContainer = styled_components_1.default.div `
|
|
20
|
+
display: flex;
|
|
21
|
+
font-family: ${(props) => props.theme.font.family.Lato};
|
|
22
|
+
align-items: center;
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
position: relative;
|
|
26
|
+
padding: 24px 18px;
|
|
27
|
+
height: 72px;
|
|
28
|
+
|
|
29
|
+
&.dragging {
|
|
30
|
+
opacity: 0.2;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.file-icon {
|
|
34
|
+
min-width: 20px;
|
|
35
|
+
width: 20px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.show-on-hover {
|
|
39
|
+
display: none;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&:hover .show-on-hover {
|
|
43
|
+
display: block;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&:hover,
|
|
47
|
+
&:focus {
|
|
48
|
+
background: #f2fbfc;
|
|
49
|
+
}
|
|
50
|
+
`;
|
|
51
|
+
//# sourceMappingURL=FileContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileContainer.js","sourceRoot":"","sources":["../../../../src/components/FileManager/FileContainer.tsx"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;GAUG;AACH,0EAAsC;AAEzB,QAAA,aAAa,GAAG,2BAAM,CAAC,GAAG,CAAA;;iBAEtB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BvD,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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.FileDate = exports.FileDateContainer = exports.FileCreatedDate = void 0;
|
|
7
|
+
const style_guide_1 = require("@manuscripts/style-guide");
|
|
8
|
+
const date_fns_1 = require("date-fns");
|
|
9
|
+
const react_1 = __importDefault(require("react"));
|
|
10
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
11
|
+
const FileCreatedDate = ({ file, className }) => {
|
|
12
|
+
if (!file.createdDate) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
return (react_1.default.createElement(exports.FileDateContainer, { "data-tooltip-id": `${file.id}-created-date-tooltip`, className: className },
|
|
16
|
+
react_1.default.createElement(exports.FileDate, null, (0, date_fns_1.format)(new Date(file.createdDate), 'M/d/yy, HH:mm')),
|
|
17
|
+
react_1.default.createElement(style_guide_1.Tooltip, { id: `${file.id}-created-date-tooltip`, place: "bottom" }, "File Uploaded")));
|
|
18
|
+
};
|
|
19
|
+
exports.FileCreatedDate = FileCreatedDate;
|
|
20
|
+
exports.FileDateContainer = styled_components_1.default.div `
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
min-width: 88px;
|
|
23
|
+
margin-left: 8px;
|
|
24
|
+
`;
|
|
25
|
+
exports.FileDate = styled_components_1.default.div `
|
|
26
|
+
font-size: ${(props) => props.theme.font.size.small};
|
|
27
|
+
line-height: 27px;
|
|
28
|
+
`;
|
|
29
|
+
//# sourceMappingURL=FileCreatedDate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileCreatedDate.js","sourceRoot":"","sources":["../../../../src/components/FileManager/FileCreatedDate.tsx"],"names":[],"mappings":";;;;;;AAYA,0DAAkD;AAClD,uCAAiC;AACjC,kDAAyB;AACzB,0EAAsC;AAE/B,MAAM,eAAe,GAGvB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE;IAC3B,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;QACrB,OAAO,IAAI,CAAA;KACZ;IAED,OAAO,CACL,8BAAC,yBAAiB,uBACC,GAAG,IAAI,CAAC,EAAE,uBAAuB,EAClD,SAAS,EAAE,SAAS;QAEpB,8BAAC,gBAAQ,QAAE,IAAA,iBAAM,EAAC,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,eAAe,CAAC,CAAY;QAC1E,8BAAC,qBAAO,IAAC,EAAE,EAAE,GAAG,IAAI,CAAC,EAAE,uBAAuB,EAAE,KAAK,EAAC,QAAQ,oBAEpD,CACQ,CACrB,CAAA;AACH,CAAC,CAAA;AAnBY,QAAA,eAAe,mBAmB3B;AAEY,QAAA,iBAAiB,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;CAI1C,CAAA;AAEY,QAAA,QAAQ,GAAG,2BAAM,CAAC,GAAG,CAAA;eACnB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK;;CAEpD,CAAA"}
|
|
@@ -0,0 +1,68 @@
|
|
|
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.FileManager = exports.FileSectionType = void 0;
|
|
7
|
+
/*!
|
|
8
|
+
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
9
|
+
*
|
|
10
|
+
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
11
|
+
*
|
|
12
|
+
* The Original Code is manuscripts-frontend.
|
|
13
|
+
*
|
|
14
|
+
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
15
|
+
*
|
|
16
|
+
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
|
|
17
|
+
*/
|
|
18
|
+
const body_editor_1 = require("@manuscripts/body-editor");
|
|
19
|
+
const style_guide_1 = require("@manuscripts/style-guide");
|
|
20
|
+
const react_1 = __importDefault(require("react"));
|
|
21
|
+
const store_1 = require("../../store");
|
|
22
|
+
const Inspector_1 = require("../Inspector");
|
|
23
|
+
const FileManagerDragLayer_1 = require("./FileManagerDragLayer");
|
|
24
|
+
const InlineFilesSection_1 = require("./InlineFilesSection");
|
|
25
|
+
const OtherFilesSection_1 = require("./OtherFilesSection");
|
|
26
|
+
const SupplementsSection_1 = require("./SupplementsSection");
|
|
27
|
+
var FileSectionType;
|
|
28
|
+
(function (FileSectionType) {
|
|
29
|
+
FileSectionType["Inline"] = "Inline files";
|
|
30
|
+
FileSectionType["Supplements"] = "Supplements";
|
|
31
|
+
FileSectionType["OtherFile"] = "Other files";
|
|
32
|
+
})(FileSectionType = exports.FileSectionType || (exports.FileSectionType = {}));
|
|
33
|
+
/**
|
|
34
|
+
* This is the main component of the file handling
|
|
35
|
+
* that should be called in the inspector,
|
|
36
|
+
* and it expects to receive an array of submission attachments
|
|
37
|
+
* and use Drag-and-Drop technique for manuscript-frontend inspector.
|
|
38
|
+
*
|
|
39
|
+
* File section component consist of three types of files which is:
|
|
40
|
+
* 1- Inline files.
|
|
41
|
+
* 2- Supplemental files.
|
|
42
|
+
* 3- Other files.
|
|
43
|
+
*/
|
|
44
|
+
const FileManager = () => {
|
|
45
|
+
const [{ doc, files }] = (0, store_1.useStore)((s) => ({
|
|
46
|
+
doc: s.doc,
|
|
47
|
+
files: s.files,
|
|
48
|
+
}));
|
|
49
|
+
const { figures, supplements, others } = (0, body_editor_1.groupFiles)(doc, files);
|
|
50
|
+
return (react_1.default.createElement(Inspector_1.InspectorTabs, { defaultIndex: 0, "data-cy": "files-tabs", style: { overflow: 'visible' } },
|
|
51
|
+
react_1.default.createElement(FileManagerDragLayer_1.FileManagerDragLayer, null),
|
|
52
|
+
react_1.default.createElement(Inspector_1.InspectorTabList, null,
|
|
53
|
+
react_1.default.createElement(Inspector_1.InspectorTab, { "data-tooltip-id": "inline-tooltip" }, "Inline files"),
|
|
54
|
+
react_1.default.createElement(style_guide_1.Tooltip, { id: "inline-tooltip", place: "bottom" }, "Files that can be found inline in the manuscript."),
|
|
55
|
+
react_1.default.createElement(Inspector_1.InspectorTab, { "data-tooltip-id": "supplements-tooltip" }, "Supplements"),
|
|
56
|
+
react_1.default.createElement(style_guide_1.Tooltip, { id: "supplements-tooltip", place: "bottom" }, "Files that were marked as supplements."),
|
|
57
|
+
react_1.default.createElement(Inspector_1.InspectorTab, { "data-tooltip-id": "other-tooltip" }, "Other files"),
|
|
58
|
+
react_1.default.createElement(style_guide_1.Tooltip, { id: "other-tooltip", place: "bottom" }, "Files excluded from the final submission.")),
|
|
59
|
+
react_1.default.createElement(Inspector_1.InspectorTabPanels, { style: { overflowY: 'visible', position: 'relative' } },
|
|
60
|
+
react_1.default.createElement(Inspector_1.InspectorTabPanel, { "data-cy": "inline" },
|
|
61
|
+
react_1.default.createElement(InlineFilesSection_1.InlineFilesSection, { elements: figures })),
|
|
62
|
+
react_1.default.createElement(Inspector_1.InspectorTabPanel, { "data-cy": "supplements" },
|
|
63
|
+
react_1.default.createElement(SupplementsSection_1.SupplementsSection, { supplements: supplements })),
|
|
64
|
+
react_1.default.createElement(Inspector_1.InspectorTabPanel, { "data-cy": "other" },
|
|
65
|
+
react_1.default.createElement(OtherFilesSection_1.OtherFilesSection, { files: others })))));
|
|
66
|
+
};
|
|
67
|
+
exports.FileManager = FileManager;
|
|
68
|
+
//# sourceMappingURL=FileManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileManager.js","sourceRoot":"","sources":["../../../../src/components/FileManager/FileManager.tsx"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;GAUG;AACH,0DAAqD;AACrD,0DAAkD;AAClD,kDAAyB;AAEzB,uCAAsC;AACtC,4CAMqB;AACrB,iEAA6D;AAC7D,6DAAyD;AACzD,2DAAuD;AACvD,6DAAyD;AAEzD,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,0CAAuB,CAAA;IACvB,8CAA2B,CAAA;IAC3B,4CAAyB,CAAA;AAC3B,CAAC,EAJW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAI1B;AASD;;;;;;;;;;GAUG;AACI,MAAM,WAAW,GAAa,GAAG,EAAE;IACxC,MAAM,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACxC,GAAG,EAAE,CAAC,CAAC,GAAG;QACV,KAAK,EAAE,CAAC,CAAC,KAAK;KACf,CAAC,CAAC,CAAA;IAEH,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,IAAA,wBAAU,EAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IAE/D,OAAO,CACL,8BAAC,yBAAa,IACZ,YAAY,EAAE,CAAC,aACP,YAAY,EACpB,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE;QAE9B,8BAAC,2CAAoB,OAAG;QACxB,8BAAC,4BAAgB;YACf,8BAAC,wBAAY,uBAAiB,gBAAgB,mBAE/B;YACf,8BAAC,qBAAO,IAAC,EAAE,EAAC,gBAAgB,EAAC,KAAK,EAAC,QAAQ,wDAEjC;YACV,8BAAC,wBAAY,uBAAiB,qBAAqB,kBAEpC;YACf,8BAAC,qBAAO,IAAC,EAAE,EAAC,qBAAqB,EAAC,KAAK,EAAC,QAAQ,6CAEtC;YACV,8BAAC,wBAAY,uBAAiB,eAAe,kBAA2B;YACxE,8BAAC,qBAAO,IAAC,EAAE,EAAC,eAAe,EAAC,KAAK,EAAC,QAAQ,gDAEhC,CACO;QACnB,8BAAC,8BAAkB,IACjB,KAAK,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE;YAErD,8BAAC,6BAAiB,eAAS,QAAQ;gBACjC,8BAAC,uCAAkB,IAAC,QAAQ,EAAE,OAAO,GAAI,CACvB;YACpB,8BAAC,6BAAiB,eAAS,aAAa;gBACtC,8BAAC,uCAAkB,IAAC,WAAW,EAAE,WAAW,GAAI,CAC9B;YACpB,8BAAC,6BAAiB,eAAS,OAAO;gBAChC,8BAAC,qCAAiB,IAAC,KAAK,EAAE,MAAM,GAAI,CAClB,CACD,CACP,CACjB,CAAA;AACH,CAAC,CAAA;AAhDY,QAAA,WAAW,eAgDvB"}
|
|
@@ -0,0 +1,67 @@
|
|
|
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.FileManagerDragLayer = void 0;
|
|
7
|
+
/*!
|
|
8
|
+
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
9
|
+
*
|
|
10
|
+
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
11
|
+
*
|
|
12
|
+
* The Original Code is manuscripts-frontend.
|
|
13
|
+
*
|
|
14
|
+
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
15
|
+
*
|
|
16
|
+
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
|
|
17
|
+
*/
|
|
18
|
+
const react_1 = __importDefault(require("react"));
|
|
19
|
+
const react_dnd_1 = require("react-dnd");
|
|
20
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
21
|
+
const FileContainer_1 = require("./FileContainer");
|
|
22
|
+
const FileCreatedDate_1 = require("./FileCreatedDate");
|
|
23
|
+
const FileName_1 = require("./FileName");
|
|
24
|
+
const Container = styled_components_1.default.div `
|
|
25
|
+
position: fixed;
|
|
26
|
+
pointer-events: none;
|
|
27
|
+
z-index: 999;
|
|
28
|
+
left: 0;
|
|
29
|
+
top: 0;
|
|
30
|
+
max-width: 400px;
|
|
31
|
+
`;
|
|
32
|
+
const DraggableFileContainer = (0, styled_components_1.default)(FileContainer_1.FileContainer) `
|
|
33
|
+
padding: 16px 32px;
|
|
34
|
+
background: #f2fbfc;
|
|
35
|
+
border: 1px solid #bce7f6;
|
|
36
|
+
box-shadow: 0 4px 9px rgba(0, 0, 0, 0.3);
|
|
37
|
+
border-radius: 6px;
|
|
38
|
+
`;
|
|
39
|
+
const getItemStyles = (currentOffset) => {
|
|
40
|
+
if (!currentOffset) {
|
|
41
|
+
return {
|
|
42
|
+
display: 'none',
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const { x, y } = currentOffset;
|
|
46
|
+
const transform = `translate(${x}px, ${y}px)`;
|
|
47
|
+
return {
|
|
48
|
+
transform,
|
|
49
|
+
WebkitTransform: transform,
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
const FileManagerDragLayer = () => {
|
|
53
|
+
const { itemType, isDragging, item, currentOffset } = (0, react_dnd_1.useDragLayer)((monitor) => ({
|
|
54
|
+
item: monitor.getItem(),
|
|
55
|
+
itemType: monitor.getItemType(),
|
|
56
|
+
currentOffset: monitor.getSourceClientOffset(),
|
|
57
|
+
isDragging: monitor.isDragging(),
|
|
58
|
+
}));
|
|
59
|
+
if (!isDragging) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
return (react_1.default.createElement(Container, { style: getItemStyles(currentOffset) }, itemType === 'file' && (react_1.default.createElement(DraggableFileContainer, null,
|
|
63
|
+
react_1.default.createElement(FileName_1.FileName, { file: item.file }),
|
|
64
|
+
item.file.createdDate && react_1.default.createElement(FileCreatedDate_1.FileCreatedDate, { file: item.file })))));
|
|
65
|
+
};
|
|
66
|
+
exports.FileManagerDragLayer = FileManagerDragLayer;
|
|
67
|
+
//# sourceMappingURL=FileManagerDragLayer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileManagerDragLayer.js","sourceRoot":"","sources":["../../../../src/components/FileManager/FileManagerDragLayer.tsx"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;GAUG;AACH,kDAAyB;AACzB,yCAAiD;AACjD,0EAAsC;AAEtC,mDAA+C;AAC/C,uDAAmD;AACnD,yCAAqC;AAErC,MAAM,SAAS,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;;;;CAO3B,CAAA;AAED,MAAM,sBAAsB,GAAG,IAAA,2BAAM,EAAC,6BAAa,CAAC,CAAA;;;;;;CAMnD,CAAA;AAED,MAAM,aAAa,GAAG,CAAC,aAA6B,EAAE,EAAE;IACtD,IAAI,CAAC,aAAa,EAAE;QAClB,OAAO;YACL,OAAO,EAAE,MAAM;SAChB,CAAA;KACF;IAED,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,aAAa,CAAA;IAE9B,MAAM,SAAS,GAAG,aAAa,CAAC,OAAO,CAAC,KAAK,CAAA;IAC7C,OAAO;QACL,SAAS;QACT,eAAe,EAAE,SAAS;KAC3B,CAAA;AACH,CAAC,CAAA;AAEM,MAAM,oBAAoB,GAAa,GAAG,EAAE;IACjD,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,IAAA,wBAAY,EAChE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QACZ,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE;QACvB,QAAQ,EAAE,OAAO,CAAC,WAAW,EAAE;QAC/B,aAAa,EAAE,OAAO,CAAC,qBAAqB,EAAE;QAC9C,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE;KACjC,CAAC,CACH,CAAA;IAED,IAAI,CAAC,UAAU,EAAE;QACf,OAAO,IAAI,CAAA;KACZ;IAED,OAAO,CACL,8BAAC,SAAS,IAAC,KAAK,EAAE,aAAa,CAAC,aAAa,CAAC,IAC3C,QAAQ,KAAK,MAAM,IAAI,CACtB,8BAAC,sBAAsB;QACrB,8BAAC,mBAAQ,IAAC,IAAI,EAAE,IAAI,CAAC,IAAI,GAAI;QAC5B,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,8BAAC,iCAAe,IAAC,IAAI,EAAE,IAAI,CAAC,IAAI,GAAI,CACvC,CAC1B,CACS,CACb,CAAA;AACH,CAAC,CAAA;AAxBY,QAAA,oBAAoB,wBAwBhC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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.FileNameText = exports.FileName = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const FileTypeIcon_1 = require("./FileTypeIcon");
|
|
10
|
+
const FileName = ({ file }) => {
|
|
11
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
12
|
+
react_1.default.createElement(FileTypeIcon_1.FileTypeIcon, { file: file }),
|
|
13
|
+
react_1.default.createElement(exports.FileNameText, { "data-cy": "filename" }, file.name)));
|
|
14
|
+
};
|
|
15
|
+
exports.FileName = FileName;
|
|
16
|
+
exports.FileNameText = styled_components_1.default.div `
|
|
17
|
+
font-family: ${(props) => props.theme.font.family.Lato};
|
|
18
|
+
font-size: ${(props) => props.theme.font.size.medium};
|
|
19
|
+
line-height: ${(props) => props.theme.font.lineHeight.large};
|
|
20
|
+
font-weight: ${(props) => props.theme.font.weight.normal};
|
|
21
|
+
color: ${(props) => props.theme.colors.text.primary};
|
|
22
|
+
margin-left: ${(props) => props.theme.grid.unit * 2}px;
|
|
23
|
+
flex-grow: 1;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
white-space: nowrap;
|
|
26
|
+
text-overflow: ellipsis;
|
|
27
|
+
`;
|
|
28
|
+
//# sourceMappingURL=FileName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileName.js","sourceRoot":"","sources":["../../../../src/components/FileManager/FileName.tsx"],"names":[],"mappings":";;;;;;AAYA,kDAAyB;AACzB,0EAAsC;AAEtC,iDAA6C;AAEtC,MAAM,QAAQ,GAEhB,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IAChB,OAAO,CACL;QACE,8BAAC,2BAAY,IAAC,IAAI,EAAE,IAAI,GAAI;QAC5B,8BAAC,oBAAY,eAAS,UAAU,IAAE,IAAI,CAAC,IAAI,CAAgB,CAC1D,CACJ,CAAA;AACH,CAAC,CAAA;AATY,QAAA,QAAQ,YASpB;AAEY,QAAA,YAAY,GAAG,2BAAM,CAAC,GAAG,CAAA;iBACrB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI;eACzC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM;iBACrC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK;iBAC5C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;WAC/C,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO;iBACpC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;;;;;CAKpD,CAAA"}
|
|
@@ -0,0 +1,181 @@
|
|
|
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.FileSectionAlert = exports.FileSectionAlertType = void 0;
|
|
7
|
+
/*!
|
|
8
|
+
* The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://mpapp-public.gitlab.io/manuscripts-frontend/LICENSE. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
|
|
9
|
+
*
|
|
10
|
+
* Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
|
|
11
|
+
*
|
|
12
|
+
* The Original Code is manuscripts-frontend.
|
|
13
|
+
*
|
|
14
|
+
* The Original Developer is the Initial Developer. The Initial Developer of the Original Code is Atypon Systems LLC.
|
|
15
|
+
*
|
|
16
|
+
* All portions of the code written by Atypon Systems LLC are Copyright (c) 2024 Atypon Systems LLC. All Rights Reserved.
|
|
17
|
+
*/
|
|
18
|
+
const style_guide_1 = require("@manuscripts/style-guide");
|
|
19
|
+
const react_1 = __importDefault(require("react"));
|
|
20
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
21
|
+
const FileContainer_1 = require("./FileContainer");
|
|
22
|
+
const FileName_1 = require("./FileName");
|
|
23
|
+
var FileSectionAlertType;
|
|
24
|
+
(function (FileSectionAlertType) {
|
|
25
|
+
FileSectionAlertType[FileSectionAlertType["NONE"] = 0] = "NONE";
|
|
26
|
+
FileSectionAlertType[FileSectionAlertType["UPLOAD_IN_PROGRESS"] = 1] = "UPLOAD_IN_PROGRESS";
|
|
27
|
+
FileSectionAlertType[FileSectionAlertType["UPLOAD_SUCCESSFUL"] = 2] = "UPLOAD_SUCCESSFUL";
|
|
28
|
+
FileSectionAlertType[FileSectionAlertType["MOVE_SUCCESSFUL"] = 3] = "MOVE_SUCCESSFUL";
|
|
29
|
+
})(FileSectionAlertType = exports.FileSectionAlertType || (exports.FileSectionAlertType = {}));
|
|
30
|
+
const FileSectionAlert = ({ alert }) => {
|
|
31
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
32
|
+
alert.type === FileSectionAlertType.UPLOAD_IN_PROGRESS && (react_1.default.createElement(FileUploadInProgressAlert, { name: alert.message })),
|
|
33
|
+
alert.type === FileSectionAlertType.UPLOAD_SUCCESSFUL && (react_1.default.createElement(FileUploadSuccessful, null)),
|
|
34
|
+
alert.type === FileSectionAlertType.MOVE_SUCCESSFUL && (react_1.default.createElement(FileMoveSuccessful, { name: alert.message }))));
|
|
35
|
+
};
|
|
36
|
+
exports.FileSectionAlert = FileSectionAlert;
|
|
37
|
+
const FileUploadInProgressAlert = ({ name }) => {
|
|
38
|
+
return (react_1.default.createElement(FileUploadContainer, null,
|
|
39
|
+
react_1.default.createElement(style_guide_1.FileUnknownIcon, null),
|
|
40
|
+
react_1.default.createElement(FileUploadNameContainer, null,
|
|
41
|
+
react_1.default.createElement(UploadFileNameText, null, name),
|
|
42
|
+
react_1.default.createElement(FileUploadProgressBar, null))));
|
|
43
|
+
};
|
|
44
|
+
const FileUploadSuccessful = () => {
|
|
45
|
+
return (react_1.default.createElement(AlertMessageContainer, null,
|
|
46
|
+
react_1.default.createElement(style_guide_1.AlertMessage, { type: style_guide_1.AlertMessageType.success, hideCloseButton: true, dismissButton: {
|
|
47
|
+
text: 'OK',
|
|
48
|
+
} }, "File uploaded successfully")));
|
|
49
|
+
};
|
|
50
|
+
const FileMoveSuccessful = ({ name }) => {
|
|
51
|
+
return (react_1.default.createElement(AlertMessageContainer, null,
|
|
52
|
+
react_1.default.createElement(style_guide_1.AlertMessage, { type: style_guide_1.AlertMessageType.success, hideCloseButton: true, dismissButton: {
|
|
53
|
+
text: 'OK',
|
|
54
|
+
} },
|
|
55
|
+
"File moved to ",
|
|
56
|
+
name)));
|
|
57
|
+
};
|
|
58
|
+
const AlertMessageContainer = styled_components_1.default.div `
|
|
59
|
+
margin-left: 16px;
|
|
60
|
+
margin-right: 16px;
|
|
61
|
+
`;
|
|
62
|
+
const FileUploadContainer = (0, styled_components_1.default)(FileContainer_1.FileContainer) `
|
|
63
|
+
background: #f2fbfc;
|
|
64
|
+
`;
|
|
65
|
+
const FileUploadNameContainer = styled_components_1.default.div `
|
|
66
|
+
flex-grow: 1;
|
|
67
|
+
margin-left: 8px;
|
|
68
|
+
`;
|
|
69
|
+
const UploadFileNameText = (0, styled_components_1.default)(FileName_1.FileNameText) `
|
|
70
|
+
margin: 0;
|
|
71
|
+
`;
|
|
72
|
+
const FileUploadProgressBar = () => {
|
|
73
|
+
return (react_1.default.createElement(LinearProgress, null,
|
|
74
|
+
react_1.default.createElement(Bar, { className: "bar1" }),
|
|
75
|
+
react_1.default.createElement(Bar, { className: "bar2" })));
|
|
76
|
+
};
|
|
77
|
+
const LinearProgress = styled_components_1.default.div `
|
|
78
|
+
background: ${(props) => props.theme.colors.background.tertiary};
|
|
79
|
+
opacity: 0.7;
|
|
80
|
+
height: 4px;
|
|
81
|
+
position: relative;
|
|
82
|
+
width: 100%;
|
|
83
|
+
margin: 8px auto 0;
|
|
84
|
+
overflow: hidden;
|
|
85
|
+
border-radius: 8px;
|
|
86
|
+
animation: start 0.3s ease-in;
|
|
87
|
+
`;
|
|
88
|
+
const Bar = styled_components_1.default.div `
|
|
89
|
+
position: absolute;
|
|
90
|
+
opacity: 0.7;
|
|
91
|
+
background: #1a9bc7;
|
|
92
|
+
transition: transform 0.2s linear;
|
|
93
|
+
left: 0;
|
|
94
|
+
top: 0;
|
|
95
|
+
bottom: 0;
|
|
96
|
+
width: 100%;
|
|
97
|
+
|
|
98
|
+
&.bar1 {
|
|
99
|
+
animation: growBar1 2.5s infinite, moveBar1 2.5s infinite;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&.bar2 {
|
|
103
|
+
animation: growBar2 2.5s infinite, moveBar2 2.5s infinite;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@keyframes growBar1 {
|
|
107
|
+
0% {
|
|
108
|
+
animation-timing-function: linear;
|
|
109
|
+
transform: scaleX(0.1);
|
|
110
|
+
}
|
|
111
|
+
35% {
|
|
112
|
+
animation-timing-function: cubic-bezier(0.3, 0.1, 0.7, 1);
|
|
113
|
+
transform: scaleX(0.1);
|
|
114
|
+
}
|
|
115
|
+
70% {
|
|
116
|
+
animation-timing-function: cubic-bezier(0.2, 0, 0.2, 1.4);
|
|
117
|
+
transform: scaleX(0.8);
|
|
118
|
+
}
|
|
119
|
+
100% {
|
|
120
|
+
transform: scaleX(0.1);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@keyframes moveBar1 {
|
|
125
|
+
0% {
|
|
126
|
+
left: -105%;
|
|
127
|
+
animation-timing-function: linear;
|
|
128
|
+
}
|
|
129
|
+
20% {
|
|
130
|
+
left: -105%;
|
|
131
|
+
animation-timing-function: cubic-bezier(0.5, 0, 0.7, 0.4);
|
|
132
|
+
}
|
|
133
|
+
60% {
|
|
134
|
+
left: 21%;
|
|
135
|
+
animation-timing-function: cubic-bezier(0.3, 0.4, 0.55, 0.9);
|
|
136
|
+
}
|
|
137
|
+
80% {
|
|
138
|
+
left: 40%;
|
|
139
|
+
animation-timing-function: cubic-bezier(0.1, 0.2, 0.3, 0.95);
|
|
140
|
+
}
|
|
141
|
+
100% {
|
|
142
|
+
left: 90%;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@keyframes growBar2 {
|
|
147
|
+
0% {
|
|
148
|
+
animation-timing-function: cubic-bezier(0.2, 0, 0.5, 0.4);
|
|
149
|
+
transform: scaleX(0.1);
|
|
150
|
+
}
|
|
151
|
+
20% {
|
|
152
|
+
animation-timing-function: cubic-bezier(0.1, 0.2, 0.6, 1);
|
|
153
|
+
transform: scaleX(0.3);
|
|
154
|
+
}
|
|
155
|
+
60% {
|
|
156
|
+
animation-timing-function: cubic-bezier(0.2, 0, 0.2, 1.4);
|
|
157
|
+
transform: scaleX(0.6);
|
|
158
|
+
}
|
|
159
|
+
100% {
|
|
160
|
+
transform: scaleX(0.1);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
@keyframes moveBar2 {
|
|
164
|
+
0% {
|
|
165
|
+
left: -100%;
|
|
166
|
+
animation-timing-function: cubic-bezier(0.15, 0, 0.5, 0.4);
|
|
167
|
+
}
|
|
168
|
+
25% {
|
|
169
|
+
left: -50%;
|
|
170
|
+
animation-timing-function: cubic-bezier(0.3, 0.3, 0.8, 0.7);
|
|
171
|
+
}
|
|
172
|
+
50% {
|
|
173
|
+
left: 45%;
|
|
174
|
+
animation-timing-function: cubic-bezier(0.1, 0.6, 0.6, 0.9);
|
|
175
|
+
}
|
|
176
|
+
100% {
|
|
177
|
+
left: 95%;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
`;
|
|
181
|
+
//# sourceMappingURL=FileSectionAlert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileSectionAlert.js","sourceRoot":"","sources":["../../../../src/components/FileManager/FileSectionAlert.tsx"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;GAUG;AACH,0DAIiC;AACjC,kDAAyB;AACzB,0EAAsC;AAEtC,mDAA+C;AAC/C,yCAAyC;AAEzC,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,+DAAI,CAAA;IACJ,2FAAkB,CAAA;IAClB,yFAAiB,CAAA;IACjB,qFAAe,CAAA;AACjB,CAAC,EALW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAK/B;AAEM,MAAM,gBAAgB,GAExB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACjB,OAAO,CACL;QACG,KAAK,CAAC,IAAI,KAAK,oBAAoB,CAAC,kBAAkB,IAAI,CACzD,8BAAC,yBAAyB,IAAC,IAAI,EAAE,KAAK,CAAC,OAAO,GAAI,CACnD;QACA,KAAK,CAAC,IAAI,KAAK,oBAAoB,CAAC,iBAAiB,IAAI,CACxD,8BAAC,oBAAoB,OAAG,CACzB;QACA,KAAK,CAAC,IAAI,KAAK,oBAAoB,CAAC,eAAe,IAAI,CACtD,8BAAC,kBAAkB,IAAC,IAAI,EAAE,KAAK,CAAC,OAAO,GAAI,CAC5C,CACA,CACJ,CAAA;AACH,CAAC,CAAA;AAhBY,QAAA,gBAAgB,oBAgB5B;AAED,MAAM,yBAAyB,GAE1B,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IAChB,OAAO,CACL,8BAAC,mBAAmB;QAClB,8BAAC,6BAAe,OAAG;QACnB,8BAAC,uBAAuB;YACtB,8BAAC,kBAAkB,QAAE,I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;;;;;CAShE,CAAA;AACD,MAAM,GAAG,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4FrB,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
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.FileTypeIcon = void 0;
|
|
7
|
+
const style_guide_1 = require("@manuscripts/style-guide");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
/**
|
|
10
|
+
* Each file item has an icon to represent besides the file info based on the file extension,
|
|
11
|
+
* in case the file type is an image or video then the icon should be the preview image or video thumbnail.
|
|
12
|
+
*/
|
|
13
|
+
const FileTypeIcon = ({ file }) => {
|
|
14
|
+
if (file.type.id === 'missing') {
|
|
15
|
+
return react_1.default.createElement(style_guide_1.FileCorruptedIcon, { className: "file-icon" });
|
|
16
|
+
}
|
|
17
|
+
if (file.type.id === 'main-manuscript') {
|
|
18
|
+
return react_1.default.createElement(style_guide_1.FileMainDocumentIcon, { className: "file-icon" });
|
|
19
|
+
}
|
|
20
|
+
const icon = (0, style_guide_1.getFileIcon)(file.name);
|
|
21
|
+
return icon || react_1.default.createElement(style_guide_1.FileUnknownIcon, { className: "file-icon" });
|
|
22
|
+
};
|
|
23
|
+
exports.FileTypeIcon = FileTypeIcon;
|
|
24
|
+
//# sourceMappingURL=FileTypeIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileTypeIcon.js","sourceRoot":"","sources":["../../../../src/components/FileManager/FileTypeIcon.tsx"],"names":[],"mappings":";;;;;;AAYA,0DAKiC;AACjC,kDAAyB;AAEzB;;;GAGG;AACI,MAAM,YAAY,GAEpB,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IAChB,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,SAAS,EAAE;QAC9B,OAAO,8BAAC,+BAAiB,IAAC,SAAS,EAAC,WAAW,GAAG,CAAA;KACnD;IACD,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,iBAAiB,EAAE;QACtC,OAAO,8BAAC,kCAAoB,IAAC,SAAS,EAAC,WAAW,GAAG,CAAA;KACtD;IAED,MAAM,IAAI,GAAG,IAAA,yBAAW,EAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAEnC,OAAO,IAAI,IAAI,8BAAC,6BAAe,IAAC,SAAS,EAAC,WAAW,GAAG,CAAA;AAC1D,CAAC,CAAA;AAbY,QAAA,YAAY,gBAaxB"}
|